本文整理汇总了C#中HRSim.Playfield.getAttackTargets方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.getAttackTargets方法的具体用法?C# Playfield.getAttackTargets怎么用?C# Playfield.getAttackTargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRSim.Playfield
的用法示例。
在下文中一共展示了Playfield.getAttackTargets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isEnemyLowest
private bool isEnemyLowest(Minion mnn, Playfield p)
{
Player mPlayer, ePlayer;
if (p.isOwnTurn)
{
mPlayer = p.playerFirst;
ePlayer = p.playerSecond;
}
else
{
mPlayer = p.playerFirst;
ePlayer = p.playerSecond;
}
bool ret = true;
List<Minion> litt = p.getAttackTargets(true, false);
int val = getValueOfEnemyMinion(mnn);
foreach (Minion m in ePlayer.ownMinions)
{
if (litt.Find(x => x.entitiyID == m.entitiyID) == null) continue;
if (getValueOfEnemyMinion(m) < val) ret = false;
}
return ret;
}
示例2: getMoveList
//.........这里部分代码省略.........
//}
//else
//{
// ret.Add(a);
//}
}
}
//tempRet.Sort((x, y) => y.Item2.CompareTo(x.Item2));
//if (tempRet.Count > 0)
//{
// ret.Add(tempRet[0].Item1);
// if (tempRet[0].Item1.target.own == p.isOwnTurn)
// {
// p.moveTrigger.hasOwnTargetMove = true;
// }
//}
//if (tempRet.Count > 1)
//{
// ret.Add(tempRet[1].Item1);
// if (tempRet[1].Item1.target.own == p.isOwnTurn)
// {
// p.moveTrigger.hasOwnTargetMove = true;
// }
//}
}
}
}
//get targets for Hero weapon and Minions ###################################################################################
trgts = p.getAttackTargets(own, isLethalCheck);
//if (!isLethalCheck) trgts = this.cutAttackList(trgts);
// attack with minions
List<Minion> attackingMinions = new List<Minion>(8);
foreach (Minion m in mPlayer.ownMinions)
{
if (m.Ready && m.Angr >= 1 && !m.frozen) attackingMinions.Add(m); //* add non-attacing minions
}
//attackingMinions = this.cutAttackList(attackingMinions);
foreach (Minion m in attackingMinions)
{
int attackPenality = 0;
foreach (Minion trgt in trgts)
{
if (usePenalityManager) attackPenality = pen.getAttackWithMininonPenality(m, p, trgt, isLethalCheck);
if (attackPenality <= 499)
{
Action a = new Action(actionEnum.attackWithMinion, null, m, 0, trgt, attackPenality, 0, 0);
ret.Add(a);
}
}
}
// attack with hero (weapon)
if (mPlayer.ownHero.Ready && mPlayer.ownHero.Angr >= 1)
{
int heroAttackPen = 0;
foreach (Minion trgt in trgts)
{
if (usePenalityManager) heroAttackPen = pen.getAttackWithHeroPenality(trgt, p, isLethalCheck);
if (heroAttackPen <= 499)