diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java index 16b76efb3b9..b4c35ead074 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java @@ -50,6 +50,13 @@ public class DestroyAi extends SpellAbilityAi { hasXCost = abCost.getCostMana() != null ? abCost.getCostMana().getAmountOfX() > 0 : false; } + if ("AtOpponentsCombatOrAfter".equals(sa.getParam("AILogic"))) { + PhaseHandler ph = ai.getGame().getPhaseHandler(); + if (ph.getPlayerTurn() == ai || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) { + return false; + } + } + if (ComputerUtil.preventRunAwayActivations(sa)) { return false; } diff --git a/forge-gui/res/cardsfolder/d/dack_fayden.txt b/forge-gui/res/cardsfolder/d/dack_fayden.txt index 9562b7baddc..35fd3adfc11 100644 --- a/forge-gui/res/cardsfolder/d/dack_fayden.txt +++ b/forge-gui/res/cardsfolder/d/dack_fayden.txt @@ -8,6 +8,6 @@ A:AB$ GainControl | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | ValidTgts A:AB$ Effect | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Emblem - Dack Fayden | Triggers$ TrigSpellCast | SVars$ EffSpellCast | Duration$ Permanent | AILogic$ Always | Stackable$ False | SpellDescription$ You get an emblem with "Whenever you cast a spell that targets one or more permanents, gain control of those permanents." SVar:TrigSpellCast:Mode$ SpellCast | ValidActivatingPlayer$ You | TargetsValid$ Permanent | Execute$ EffSpellCast | TriggerDescription$ Whenever you cast a spell that targets one or more permanents, gain control of those permanents. SVar:EffSpellCast:AB$ GainControl | Cost$ 0 | Defined$ TriggeredSpellAbilityTargetingCards -SVar:RemAIDeck:True +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dack_fayden.jpg Oracle:[+1]: Target player draws two cards, then discards two cards.\n[-2]: Gain control of target artifact.\n[-6]: You get an emblem with "Whenever you cast a spell that targets one or more permanents, gain control of those permanents." diff --git a/forge-gui/res/cardsfolder/d/dance_of_many.txt b/forge-gui/res/cardsfolder/d/dance_of_many.txt index 27a2fe34e0a..ca433e37567 100644 --- a/forge-gui/res/cardsfolder/d/dance_of_many.txt +++ b/forge-gui/res/cardsfolder/d/dance_of_many.txt @@ -9,6 +9,6 @@ SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.IsRemembered | Execute$ TrigSac | TriggerDescription$ When the token leaves the battlefield, sacrifice CARDNAME. SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | SubAbility$ DBCleanup K:UpkeepCost:U U -SVar:RemAIDeck:True +SVar:NeedsToPlay:Creature.inZoneBattlefield SVar:Picture:http://www.wizards.com/global/images/magic/general/dance_of_many.jpg Oracle:When Dance of Many enters the battlefield, create a token that's a copy of target nontoken creature.\nWhen Dance of Many leaves the battlefield, exile the token.\nWhen the token leaves the battlefield, sacrifice Dance of Many.\nAt the beginning of your upkeep, sacrifice Dance of Many unless you pay {U}{U}. diff --git a/forge-gui/res/cardsfolder/d/dark_sphere.txt b/forge-gui/res/cardsfolder/d/dark_sphere.txt index d97872fa362..82af8138af7 100644 --- a/forge-gui/res/cardsfolder/d/dark_sphere.txt +++ b/forge-gui/res/cardsfolder/d/dark_sphere.txt @@ -6,6 +6,5 @@ SVar:DBEffect:DB$ Effect | Triggers$ DamageDealt | StaticAbilities$ StaticPreven SVar:StaticPrevent:Mode$ PreventDamage | Source$ Card.IsRemembered | Target$ You | Amount$ HalfDown | EffectZone$ Command | Description$ The next time a source of your choice would deal damage to you this turn, prevent half that damage, rounded down. SVar:DamageDealt:Mode$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | Execute$ ExileEffect | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dark_sphere.jpg Oracle:{T}, Sacrifice Dark Sphere: The next time a source of your choice would deal damage to you this turn, prevent half that damage, rounded down. diff --git a/forge-gui/res/cardsfolder/d/dark_tutelage.txt b/forge-gui/res/cardsfolder/d/dark_tutelage.txt index b91512befd8..f78b584afe3 100644 --- a/forge-gui/res/cardsfolder/d/dark_tutelage.txt +++ b/forge-gui/res/cardsfolder/d/dark_tutelage.txt @@ -2,10 +2,10 @@ Name:Dark Tutelage ManaCost:2 B Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDig | TriggerDescription$ At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost. -SVar:TrigDig:AB$Dig | Cost$ 0 | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Hand | RememberChanged$ True | SubAbility$ DBLose +SVar:TrigDig:DB$ Dig | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Hand | RememberChanged$ True | SubAbility$ DBLose SVar:DBLose:DB$LoseLife | LifeAmount$ X | SubAbility$ DBCleanup | References$ X SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True SVar:X:Remembered$CardManaCost -SVar:RemAIDeck:True +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dark_tutelage.jpg Oracle:At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost. diff --git a/forge-gui/res/cardsfolder/d/death_denied.txt b/forge-gui/res/cardsfolder/d/death_denied.txt index 95c02dc2569..31fee9a54e0 100644 --- a/forge-gui/res/cardsfolder/d/death_denied.txt +++ b/forge-gui/res/cardsfolder/d/death_denied.txt @@ -5,6 +5,5 @@ A:SP$ ChangeZone | Cost$ X B B | TargetMin$ 0 | TargetMax$ MaxTgts | ValidTgts$ # It may seem wrong to not use X in the target, but since the Targets are what defines X, it's redundant (and not supported by the code) SVar:X:Targeted$Amount SVar:MaxTgts:Count$TypeInYourYard.Creature -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/death_denied.jpg Oracle:Return X target creature cards from your graveyard to your hand. diff --git a/forge-gui/res/cardsfolder/d/deepfire_elemental.txt b/forge-gui/res/cardsfolder/d/deepfire_elemental.txt index 71602d8b6ec..43991466cce 100644 --- a/forge-gui/res/cardsfolder/d/deepfire_elemental.txt +++ b/forge-gui/res/cardsfolder/d/deepfire_elemental.txt @@ -2,9 +2,9 @@ Name:Deepfire Elemental ManaCost:4 B R Types:Creature Elemental PT:4/4 -A:AB$ Destroy | Cost$ X X 1 | ValidTgts$ Artifact,Creature | TgtPrompt$ Select target artifact or creature | References$ X | SpellDescription$ Destroy target artifact or creature with converted mana cost X. +A:AB$ Destroy | Cost$ X X 1 | ValidTgts$ Artifact,Creature | TgtPrompt$ Select target artifact or creature | References$ X | AILogic$ AtOpponentsCombatOrAfter | SpellDescription$ Destroy target artifact or creature with converted mana cost X. # It may seem wrong to not use X in the target, but since the Target is what defines X, it's redundant (and not supported by the code) SVar:X:Targeted$CardManaCost -SVar:RemAIDeck:True +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/deepfire_elemental.jpg Oracle:{X}{X}{1}: Destroy target artifact or creature with converted mana cost X. diff --git a/forge-gui/res/cardsfolder/d/demonic_taskmaster.txt b/forge-gui/res/cardsfolder/d/demonic_taskmaster.txt index bb0586d09ca..631d46acc17 100644 --- a/forge-gui/res/cardsfolder/d/demonic_taskmaster.txt +++ b/forge-gui/res/cardsfolder/d/demonic_taskmaster.txt @@ -4,7 +4,7 @@ Types:Creature Demon PT:4/3 K:Flying T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice a creature other than CARDNAME. -SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ You | SacValid$ Creature.Other -SVar:RemAIDeck:True +SVar:TrigSac:DB$ Sacrifice | Defined$ You | SacValid$ Creature.Other +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/demonic_taskmaster.jpg Oracle:Flying\nAt the beginning of your upkeep, sacrifice a creature other than Demonic Taskmaster. diff --git a/forge-gui/res/cardsfolder/d/demonspine_whip.txt b/forge-gui/res/cardsfolder/d/demonspine_whip.txt index 09c77efc766..8120a2e48be 100644 --- a/forge-gui/res/cardsfolder/d/demonspine_whip.txt +++ b/forge-gui/res/cardsfolder/d/demonspine_whip.txt @@ -4,6 +4,5 @@ Types:Artifact Equipment K:Equip 1 A:AB$ Pump | Cost$ X | Defined$ Equipped | NumAtt$ +X | References$ X | SpellDescription$ Equipped creature gets +X/+0 until end of turn. SVar:X:Count$xPaid -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/demonspine_whip.jpg Oracle:{X}: Equipped creature gets +X/+0 until end of turn.\nEquip {1} diff --git a/forge-gui/res/cardsfolder/d/diplomacy_of_the_wastes.txt b/forge-gui/res/cardsfolder/d/diplomacy_of_the_wastes.txt index 0cdd47a4834..8efcb6bab01 100644 --- a/forge-gui/res/cardsfolder/d/diplomacy_of_the_wastes.txt +++ b/forge-gui/res/cardsfolder/d/diplomacy_of_the_wastes.txt @@ -3,7 +3,6 @@ ManaCost:2 B Types:Sorcery A:SP$ Discard | Cost$ 2 B | ValidTgts$ Opponent | DiscardValid$ Card.nonLand | NumCards$ 1 | Mode$ RevealYouChoose | SubAbility$ DBLoseLife | SpellDescription$ Target opponent reveals his or her hand. You choose a nonland card from it. That player discards that card. If you control a Warrior, that player loses 2 life. SVar:DBLoseLife:DB$ LoseLife | Defined$ ParentTarget | LifeAmount$ 2 | ConditionPresent$ Warrior.YouCtrl -SVar:RemAIDeck:True DeckHints:Type$Warrior SVar:Picture:http://www.wizards.com/global/images/magic/general/diplomacy_of_the_wastes.jpg Oracle:Target opponent reveals his or her hand. You choose a nonland card from it. That player discards that card. If you control a Warrior, that player loses 2 life. diff --git a/forge-gui/res/cardsfolder/d/displace.txt b/forge-gui/res/cardsfolder/d/displace.txt index a9d684fde40..392daf9b057 100644 --- a/forge-gui/res/cardsfolder/d/displace.txt +++ b/forge-gui/res/cardsfolder/d/displace.txt @@ -1,18 +1,10 @@ Name:Displace - ManaCost:2 U - Types:Instant - A:SP$ ChangeZone | Cost$ 2 U | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 2 | Origin$ Battlefield | Destination$ Exile | TgtPrompt$ Select target creature you control | RememberTargets$ True | SubAbility$ DBReturn | SpellDescription$ Exile up to two target creatures you control, then return those cards to the battlefield under their owner's control. - SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ All | Destination$ Battlefield | SubAbility$ DBCleanup - SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True - +#TODO: The AI successfully uses this to save one of its creatures, but not two. Also, it's not used on creatures that are held with something like Arrest. May need improvement before RemAIDeck is removed. SVar:RemAIDeck:True - SVar:Picture:http://www.wizards.com/global/images/magic/general/displace.jpg - Oracle:Exile up to two target creatures you control, then return those cards to the battlefield under their owner's control. - diff --git a/forge-gui/res/cardsfolder/d/distant_melody.txt b/forge-gui/res/cardsfolder/d/distant_melody.txt index 614cc2bfad9..1139ada2527 100644 --- a/forge-gui/res/cardsfolder/d/distant_melody.txt +++ b/forge-gui/res/cardsfolder/d/distant_melody.txt @@ -4,7 +4,7 @@ Types:Sorcery A:SP$ ChooseType | Cost$ 3 U | Defined$ You | Type$ Creature | SubAbility$ DBDraw | AILogic$ MostProminentComputerControls | SpellDescription$ Choose a creature type. Draw a card for each permanent you control of that type. SVar:DBDraw:DB$ Draw | NumCards$ X | References$ X SVar:X:Count$Valid Permanent.ChosenType+YouCtrl -SVar:RemAIDeck:True +SVar:RemRandomDeck:True SVar:NeedsToPlay:Creature SVar:Picture:http://www.wizards.com/global/images/magic/general/distant_melody.jpg Oracle:Choose a creature type. Draw a card for each permanent you control of that type. diff --git a/forge-gui/res/cardsfolder/d/distorting_wake.txt b/forge-gui/res/cardsfolder/d/distorting_wake.txt index 890355864ec..8bfb5cd2f38 100644 --- a/forge-gui/res/cardsfolder/d/distorting_wake.txt +++ b/forge-gui/res/cardsfolder/d/distorting_wake.txt @@ -4,6 +4,5 @@ Types:Sorcery A:SP$ ChangeZone | Cost$ X U U U | Origin$ Battlefield | Destination$ Hand | TargetMin$ 0 | TargetMax$ MaxTgts | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | References$ X,MaxTgts | SpellDescription$ Return X target nonland permanents to their owners' hands. SVar:X:Targeted$Amount SVar:MaxTgts:Count$Valid Permanent.nonLand -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/distorting_wake.jpg Oracle:Return X target nonland permanents to their owners' hands. diff --git a/forge-gui/res/cardsfolder/d/doomgape.txt b/forge-gui/res/cardsfolder/d/doomgape.txt index 7889e76d3d9..458ec8f044f 100644 --- a/forge-gui/res/cardsfolder/d/doomgape.txt +++ b/forge-gui/res/cardsfolder/d/doomgape.txt @@ -8,6 +8,8 @@ SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ You | SacValid$ Creature | SacMes SVar:DBGainLife:DB$GainLife | LifeAmount$ X | SubAbility$ DBCleanup | References$ X SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:RememberedLKI$CardToughness -SVar:RemAIDeck:True +SVar:NeedsToPlayVar:Z GE2 +SVar:Z:Count$Valid Creature.YouCtrl+inZoneBattlefield +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/doomgape.jpg Oracle:Trample\nAt the beginning of your upkeep, sacrifice a creature. You gain life equal to that creature's toughness. diff --git a/forge-gui/res/cardsfolder/d/dormant_volcano.txt b/forge-gui/res/cardsfolder/d/dormant_volcano.txt index eef6a315b80..a961b79d50d 100644 --- a/forge-gui/res/cardsfolder/d/dormant_volcano.txt +++ b/forge-gui/res/cardsfolder/d/dormant_volcano.txt @@ -5,6 +5,6 @@ K:CARDNAME enters the battlefield tapped. A:AB$ Mana | Cost$ T | Produced$ C R | SpellDescription$ Add {C}{R} to your mana pool. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSacUnless | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice it unless you return an untapped Mountain you control to its owner's hand. SVar:TrigSacUnless:DB$ Sacrifice | Defined$ Self | UnlessCost$ Return<1/Mountain.untapped/untapped Mountain> | UnlessPayer$ You -SVar:RemAIDeck:True +SVar:NeedsToPlay:Mountain.YouCtrl+inZoneBattlefield+untapped SVar:Picture:http://www.wizards.com/global/images/magic/general/dormant_volcano.jpg Oracle:Dormant Volcano enters the battlefield tapped.\nWhen Dormant Volcano enters the battlefield, sacrifice it unless you return an untapped Mountain you control to its owner's hand.\n{T}: Add {C}{R} to your mana pool. diff --git a/forge-gui/res/cardsfolder/d/dream_pillager.txt b/forge-gui/res/cardsfolder/d/dream_pillager.txt index 4f96e922046..9f53f16ed44 100644 --- a/forge-gui/res/cardsfolder/d/dream_pillager.txt +++ b/forge-gui/res/cardsfolder/d/dream_pillager.txt @@ -9,6 +9,5 @@ SVar:DBEffect:DB$ Effect | StaticAbilities$ STPlay | ForgetOnMoved$ Exile | Reme SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.nonLand+IsRemembered | MayPlay$ True | AffectedZone$ Exile | Description$ Until end of turn, you may play that card. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:TriggerCount$DamageAmount -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dream_pillager.jpg Oracle:Flying\nWhenever Dream Pillager deals combat damage to a player, exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way. diff --git a/forge-gui/res/cardsfolder/d/dregs_of_sorrow.txt b/forge-gui/res/cardsfolder/d/dregs_of_sorrow.txt index 99785fbeaf2..9e7f31abab9 100644 --- a/forge-gui/res/cardsfolder/d/dregs_of_sorrow.txt +++ b/forge-gui/res/cardsfolder/d/dregs_of_sorrow.txt @@ -5,7 +5,7 @@ A:SP$ Destroy | Cost$ X 4 B | TargetMin$ 0 | TargetMax$ MaxTgts | ValidTgts$ Cre # It may seem wrong to not use X in the target, but since the Targets are what defines X, it's redundant (and not supported by the code) SVar:X:Targeted$Amount SVar:MaxTgts:Count$Valid Creature.nonBlack -SVar:DB:DB$Draw | Defined$ You | NumCards$ X +SVar:DB:DB$Draw | Defined$ You | NumCards$ X | References$ X SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dregs_of_sorrow.jpg Oracle:Destroy X target nonblack creatures. Draw X cards. diff --git a/forge-gui/res/cardsfolder/d/duergar_assailant.txt b/forge-gui/res/cardsfolder/d/duergar_assailant.txt index f9ca5f82f33..9f72308baa2 100644 --- a/forge-gui/res/cardsfolder/d/duergar_assailant.txt +++ b/forge-gui/res/cardsfolder/d/duergar_assailant.txt @@ -3,6 +3,5 @@ ManaCost:RW Types:Creature Dwarf Soldier PT:1/1 A:AB$ DealDamage | Cost$ Sac<1/CARDNAME> | ValidTgts$ Creature.attacking,Creature.blocking | TgtPrompt$ Select target attacking or blocking creature | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target attacking or blocking creature. -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/duergar_assailant.jpg Oracle:Sacrifice Duergar Assailant: Duergar Assailant deals 1 damage to target attacking or blocking creature.