- Implemented AI for Atarka's Command

This commit is contained in:
excessum
2015-10-07 13:10:36 +00:00
parent b84c5dbc23
commit c1eb95981d
4 changed files with 22 additions and 4 deletions

View File

@@ -290,6 +290,11 @@ public class ChangeZoneAi extends SpellAbilityAi {
if (!activateForCost && list.isEmpty()) {
return false;
}
if ("Atarka's Command".equals(source.getName())
&& (list.size() < 2 || ai.getLandsPlayedThisTurn() < 1)) {
// be strict on playing lands off charms
return false;
}
String num = sa.getParam("ChangeNum");
if (num != null) {

View File

@@ -213,7 +213,10 @@ public class DamageDealAi extends DamageAiBase {
*/
private boolean damageTargetAI(final Player ai, final SpellAbility saMe, final int dmg, final boolean immediately) {
final TargetRestrictions tgt = saMe.getTargetRestrictions();
if ("Atarka's Command".equals(saMe.getHostCard().getName())) {
// playReusable in damageChooseNontargeted wrongly assumes that CharmEffect options are re-usable
return this.shouldTgtP(ai, saMe, dmg, false);
}
if (tgt == null) {
return this.damageChooseNontargeted(ai, saMe, dmg);
}

View File

@@ -149,6 +149,17 @@ public class EffectAi extends SpellAbilityAi {
}
}
randomReturn = threatened;
} else if (logic.equals("NoGain")) {
// basic logic to cancel GainLife on stack
if (game.getStack().isEmpty()) {
return false;
}
final SpellAbility topStack = game.getStack().peekAbility();
if (topStack.getActivatingPlayer() == ai.getOpponent() && topStack.getApi() == ApiType.GainLife) {
return true;
} else {
return false;
}
} else if (logic.equals("Fight")) {
CardCollection humCreatures = ai.getOpponent().getCreaturesInPlay();
humCreatures = CardLists.getTargetableCards(humCreatures, sa);