本文整理汇总了C#中HREngine.Bots.Playfield.ENEMYactivateAbility方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.ENEMYactivateAbility方法的具体用法?C# Playfield.ENEMYactivateAbility怎么用?C# Playfield.ENEMYactivateAbility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.Playfield
的用法示例。
在下文中一共展示了Playfield.ENEMYactivateAbility方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: simulateEnemysTurn
//.........这里部分代码省略.........
// attacked with minions done
// attack with hero
if (p.enemyHeroReady)
{
List<targett> trgts = p.getAttackTargets(false);
havedonesomething = true;
if (true)//(this.useCutingTargets)
{
trgts = Ai.Instance.cutAttackTargets(trgts, p, false);
}
foreach (targett trgt in trgts)
{
Playfield pf = new Playfield(p);
pf.ENEMYattackWithWeapon(trgt.target, trgt.targetEntity, 0);
posmoves.Add(pf);
}
}
// use ability
/// TODO check if ready after manaup
if (p.enemyAbilityReady && p.enemyHeroAblility.canplayCard(p, 0))
{
int abilityPenality = 0;
havedonesomething = true;
// if we have mage or priest, we have to target something####################################################
if (p.enemyHeroName == HeroEnum.mage || p.enemyHeroName == HeroEnum.priest)
{
List<targett> trgts = p.enemyHeroAblility.getTargetsForCard(p);
foreach (targett trgt in trgts)
{
Playfield pf = new Playfield(p);
havedonesomething = true;
pf.ENEMYactivateAbility(p.enemyHeroAblility, trgt.target, trgt.targetEntity);
posmoves.Add(pf);
}
}
else
{
// the other classes dont have to target####################################################
Playfield pf = new Playfield(p);
havedonesomething = true;
pf.ENEMYactivateAbility(p.enemyHeroAblility, -1, -1);
posmoves.Add(pf);
}
}
p.endEnemyTurn();
if (Ai.Instance.botBase.getPlayfieldValue(p) < bestoldval) // want the best enemy-play-> worst for us
{
bestoldval = Ai.Instance.botBase.getPlayfieldValue(p);
bestold = p;
}
posmoves.Remove(p);
if (posmoves.Count >= maxwide) break;
}
if ( bestoldval <= 10000 && bestold != null)
{
posmoves.Add(bestold);
}
deep++;
if (posmoves.Count >= maxwide) break;
}
foreach (Playfield p in posmoves)
{
if (!p.complete) p.endEnemyTurn();
}
int bestval = int.MaxValue;
Playfield bestplay = posmoves[0];
foreach (Playfield p in posmoves)
{
int val = Ai.Instance.botBase.getPlayfieldValue(p);
if (bestval > val)// we search the worst value
{
bestplay = p;
bestval = val;
}
}
this.value = bestplay.value;
if (simulateTwoTurns)
{
bestplay.prepareNextTurn();
MiniSimulator ms = new MiniSimulator();
this.value = (int)(0.5 * bestval + 0.5 * ms.doallmoves(bestplay));
}
}