- 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()) { if (!activateForCost && list.isEmpty()) {
return false; 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"); String num = sa.getParam("ChangeNum");
if (num != null) { 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) { private boolean damageTargetAI(final Player ai, final SpellAbility saMe, final int dmg, final boolean immediately) {
final TargetRestrictions tgt = saMe.getTargetRestrictions(); 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) { if (tgt == null) {
return this.damageChooseNontargeted(ai, saMe, dmg); return this.damageChooseNontargeted(ai, saMe, dmg);
} }

View File

@@ -149,6 +149,17 @@ public class EffectAi extends SpellAbilityAi {
} }
} }
randomReturn = threatened; 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")) { } else if (logic.equals("Fight")) {
CardCollection humCreatures = ai.getOpponent().getCreaturesInPlay(); CardCollection humCreatures = ai.getOpponent().getCreaturesInPlay();
humCreatures = CardLists.getTargetableCards(humCreatures, sa); humCreatures = CardLists.getTargetableCards(humCreatures, sa);

View File

@@ -2,11 +2,10 @@ Name:Atarka's Command
ManaCost:R G ManaCost:R G
Types:Instant Types:Instant
A:SP$ Charm | Cost$ R G | Choices$ DBNoLife,DBDamage,DBLand,DBPumpAll | CharmNum$ 2 | SpellDescription$ Choose two - Your opponents can't gain life this turn; CARDNAME deals 3 damage to each opponent; You may put a land card from your hand onto the battlefield; Creatures you control get +1/+1 and gain reach until end of turn. A:SP$ Charm | Cost$ R G | Choices$ DBNoLife,DBDamage,DBLand,DBPumpAll | CharmNum$ 2 | SpellDescription$ Choose two - Your opponents can't gain life this turn; CARDNAME deals 3 damage to each opponent; You may put a land card from your hand onto the battlefield; Creatures you control get +1/+1 and gain reach until end of turn.
SVar:DBNoLife:DB$ Effect | Name$ Atarka's Command Effect | StaticAbilities$ STCantGain | SpellDescription$ Your opponents can't gain life this turn. SVar:DBNoLife:DB$ Effect | Name$ Atarka's Command Effect | StaticAbilities$ STCantGain | AILogic$ NoGain | SpellDescription$ Your opponents can't gain life this turn.
SVar:STCantGain:Mode$ Continuous | EffectZone$ Command | Affected$ Player.Opponent | AddKeyword$ You can't gain life. | Description$ Your opponents can't gain life. SVar:STCantGain:Mode$ Continuous | EffectZone$ Command | Affected$ Player.Opponent | AddKeyword$ You can't gain life. | Description$ Your opponents can't gain life.
SVar:DBDamage:DB$ DealDamage | Defined$ Player.Opponent | NumDmg$ 3 | SpellDescription$ CARDNAME deals 3 damage to each opponent. SVar:DBDamage:DB$ DealDamage | Defined$ Player.Opponent | NumDmg$ 3 | AILogic$ Good | SpellDescription$ CARDNAME deals 3 damage to each opponent.
SVar:DBLand:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | ChangeNum$ 1 | Optional$ You | SpellDescription$ You may put a land card from your hand onto the battlefield. SVar:DBLand:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | ChangeNum$ 1 | Optional$ You | SpellDescription$ You may put a land card from your hand onto the battlefield.
SVar:DBPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +1 | KW$ Reach | SpellDescription$ Creatures you control get +1/+1 and gain reach until end of turn. SVar:DBPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +1 | KW$ Reach | SpellDescription$ Creatures you control get +1/+1 and gain reach until end of turn.
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/atarkas_command.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/atarkas_command.jpg
Oracle:Choose two -\n• Your opponents can't gain life this turn.\n• Atarka's Command deals 3 damage to each opponent.\n• You may put a land card from your hand onto the battlefield.\n• Creatures you control get +1/+1 and gain reach until end of turn. Oracle:Choose two -\n• Your opponents can't gain life this turn.\n• Atarka's Command deals 3 damage to each opponent.\n• You may put a land card from your hand onto the battlefield.\n• Creatures you control get +1/+1 and gain reach until end of turn.