From fe770a48ba15c0d85dec54f7abc01a6d1e924e0c Mon Sep 17 00:00:00 2001 From: Sloth Date: Sat, 1 Nov 2014 20:37:38 +0000 Subject: [PATCH] - Added a new AI SVar: AmbushAI. Creatures with it will be played when the opponent is attacking. --- forge-ai/src/main/java/forge/ai/AiController.java | 4 ++-- forge-gui/res/cardsfolder/a/affa_guard_hound.txt | 6 +++--- forge-gui/res/cardsfolder/a/angel_of_salvation.txt | 1 + forge-gui/res/cardsfolder/b/breaching_hippocamp.txt | 1 + forge-gui/res/cardsfolder/d/dawnfluke.txt | 1 + forge-gui/res/cardsfolder/e/ethersworn_shieldmage.txt | 1 + forge-gui/res/cardsfolder/h/haze_frog.txt | 2 +- forge-gui/res/cardsfolder/h/hollowhenge_spirit.txt | 2 ++ forge-gui/res/cardsfolder/v/viashino_bey.txt | 1 + forge-gui/res/cardsfolder/v/viashino_bladescout.txt | 3 ++- forge-gui/res/cardsfolder/v/village_bell_ringer.txt | 1 + 11 files changed, 16 insertions(+), 7 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index bf3211d2acb..b382f4bb0ef 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -777,8 +777,8 @@ public class AiController { && (player.isUnlimitedHandSize() || player.getCardsIn(ZoneType.Hand).size() <= player.getMaxHandSize()) && player.getManaPool().totalMana() <= 0 && (game.getPhaseHandler().isPlayerTurn(player) - || game.getPhaseHandler().getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) - && !card.hasETBTrigger()) + || game.getPhaseHandler().getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) + && (!card.hasETBTrigger() || card.hasSVar("AmbushAI")) && !ComputerUtil.castPermanentInMain1(player, sa)) { return AiPlayDecision.AnotherTime; } diff --git a/forge-gui/res/cardsfolder/a/affa_guard_hound.txt b/forge-gui/res/cardsfolder/a/affa_guard_hound.txt index 5abae48be00..d8ee81c205a 100644 --- a/forge-gui/res/cardsfolder/a/affa_guard_hound.txt +++ b/forge-gui/res/cardsfolder/a/affa_guard_hound.txt @@ -2,9 +2,9 @@ Name:Affa Guard Hound ManaCost:2 W Types:Creature Hound PT:2/2 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | TriggerDescription$ When CARDNAME enters the battlefield, target creature gets +0/+3 until end of turn. -SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDef$ +3 K:Flash -SVar:PlayMain1:TRUE +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | TriggerDescription$ When CARDNAME enters the battlefield, target creature gets +0/+3 until end of turn. +SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDef$ +3 +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/affa_guard_hound.jpg Oracle:Flash\nWhen Affa Guard Hound enters the battlefield, target creature gets +0/+3 until end of turn. diff --git a/forge-gui/res/cardsfolder/a/angel_of_salvation.txt b/forge-gui/res/cardsfolder/a/angel_of_salvation.txt index ae07619e776..dd70da82958 100644 --- a/forge-gui/res/cardsfolder/a/angel_of_salvation.txt +++ b/forge-gui/res/cardsfolder/a/angel_of_salvation.txt @@ -8,5 +8,6 @@ K:Flying T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ AngelicSalvation | TriggerDescription$ When CARDNAME enters the battlefield, prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. SVar:AngelicSalvation:DB$ PreventDamage | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to prevent damage to | Amount$ 5 | TargetMin$ 1 | TargetMax$ 5 | DividedAsYouChoose$ 5 SVar:RemAIDeck:True +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/angel_of_salvation.jpg Oracle:Flash, convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of that creature's color.)\nFlying\nWhen Angel of Salvation enters the battlefield, prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. diff --git a/forge-gui/res/cardsfolder/b/breaching_hippocamp.txt b/forge-gui/res/cardsfolder/b/breaching_hippocamp.txt index 87ce72bdc6f..b466f51d5ba 100644 --- a/forge-gui/res/cardsfolder/b/breaching_hippocamp.txt +++ b/forge-gui/res/cardsfolder/b/breaching_hippocamp.txt @@ -5,5 +5,6 @@ PT:3/2 K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigTap | TriggerDescription$ When CARDNAME enters the battlefield, untap another target creature you control. SVar:TrigTap:AB$ Untap | Cost$ 0 | ValidTgts$ Creature.Other+YouCtrl | TgtPrompt$ Choose another target creature you control. +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/breaching_hippocamp.jpg Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhen Breaching Hippocamp enters the battlefield, untap another target creature you control. diff --git a/forge-gui/res/cardsfolder/d/dawnfluke.txt b/forge-gui/res/cardsfolder/d/dawnfluke.txt index 0461121154f..90f2e3d40bb 100644 --- a/forge-gui/res/cardsfolder/d/dawnfluke.txt +++ b/forge-gui/res/cardsfolder/d/dawnfluke.txt @@ -9,5 +9,6 @@ SVar:TrigPrevent:DB$ PreventDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtP T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+evoked | Execute$ TrigSac | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it by it's evoke cost, sacrifice it. SVar:TrigSac:AB$ Sacrifice | Cost$ 0 SVar:RemAIDeck:True +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/dawnfluke.jpg Oracle:Flash\nWhen Dawnfluke enters the battlefield, prevent the next 3 damage that would be dealt to target creature or player this turn.\nEvoke {W} (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield.) diff --git a/forge-gui/res/cardsfolder/e/ethersworn_shieldmage.txt b/forge-gui/res/cardsfolder/e/ethersworn_shieldmage.txt index a71996230ee..fc8a564074e 100644 --- a/forge-gui/res/cardsfolder/e/ethersworn_shieldmage.txt +++ b/forge-gui/res/cardsfolder/e/ethersworn_shieldmage.txt @@ -6,5 +6,6 @@ K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When CARDNAME enters the battlefield, prevent all damage that would be dealt to artifact creatures this turn. SVar:TrigEffect:DB$ Effect | Name$ Ethersworn Shieldmage Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt to artifact creatures this turn. SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature.Artifact | Description$ Prevent all damage that would be dealt to artifact creatures this turn. +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/ethersworn_shieldmage.jpg Oracle:Flash\nWhen Ethersworn Shieldmage enters the battlefield, prevent all damage that would be dealt to artifact creatures this turn. diff --git a/forge-gui/res/cardsfolder/h/haze_frog.txt b/forge-gui/res/cardsfolder/h/haze_frog.txt index 0ace53b842f..298efb876f5 100644 --- a/forge-gui/res/cardsfolder/h/haze_frog.txt +++ b/forge-gui/res/cardsfolder/h/haze_frog.txt @@ -6,6 +6,6 @@ K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When CARDNAME enters the battlefield, prevent all combat damage that other creatures would deal this turn. SVar:TrigEffect:AB$ Effect | Cost$ 0 | Name$ Haze Frog Effect | StaticAbilities$ HazeFrogPrevent | References$ HazeFrogPrevent | RememberObjects$ Self SVar:HazeFrogPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.IsNotRemembered | CombatDamage$ True | Description$ Prevent all combat damage that other creatures would deal this turn. -SVar:RemAIDeck:True +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/haze_frog.jpg Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhen Haze Frog enters the battlefield, prevent all combat damage that other creatures would deal this turn. diff --git a/forge-gui/res/cardsfolder/h/hollowhenge_spirit.txt b/forge-gui/res/cardsfolder/h/hollowhenge_spirit.txt index 37e1b95cdd4..e1ec2c2fdd8 100644 --- a/forge-gui/res/cardsfolder/h/hollowhenge_spirit.txt +++ b/forge-gui/res/cardsfolder/h/hollowhenge_spirit.txt @@ -6,5 +6,7 @@ K:Flash K:Flying T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRemove | TriggerDescription$ When CARDNAME enters the battlefield, remove target attacking or blocking creature from combat. SVar:TrigRemove:AB$ RemoveFromCombat | Cost$ 0 | ValidTgts$ Creature.attacking,Creature.blocking | TgtPrompt$ Select target attacking or blocking creature +SVar:RemAIDeck:True +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/hollowhenge_spirit.jpg Oracle:Flash (You may cast this spell any time you could cast an instant.)\nFlying\nWhen Hollowhenge Spirit enters the battlefield, remove target attacking or blocking creature from combat. diff --git a/forge-gui/res/cardsfolder/v/viashino_bey.txt b/forge-gui/res/cardsfolder/v/viashino_bey.txt index da42dca6188..2acd2e9b4db 100644 --- a/forge-gui/res/cardsfolder/v/viashino_bey.txt +++ b/forge-gui/res/cardsfolder/v/viashino_bey.txt @@ -3,4 +3,5 @@ ManaCost:2 R Types:Creature Viashino PT:4/3 K:If CARDNAME attacks, all creatures you control attack if able. +SVar:Picture:http://www.wizards.com/global/images/magic/general/viashino_bey.jpg Oracle:If Viashino Bey attacks, all creatures you control attack if able. diff --git a/forge-gui/res/cardsfolder/v/viashino_bladescout.txt b/forge-gui/res/cardsfolder/v/viashino_bladescout.txt index 9ee7b673a9e..ba029309a3e 100644 --- a/forge-gui/res/cardsfolder/v/viashino_bladescout.txt +++ b/forge-gui/res/cardsfolder/v/viashino_bladescout.txt @@ -4,6 +4,7 @@ Types:Creature Viashino Scout PT:2/1 K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | TriggerDescription$ When CARDNAME enters the battlefield, target creature gains first strike until end of turn. -SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ First Strike +SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ First Strike +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/viashino_bladescout.jpg Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhen Viashino Bladescout enters the battlefield, target creature gains first strike until end of turn. diff --git a/forge-gui/res/cardsfolder/v/village_bell_ringer.txt b/forge-gui/res/cardsfolder/v/village_bell_ringer.txt index bf8c486859a..601e1ee5dcc 100644 --- a/forge-gui/res/cardsfolder/v/village_bell_ringer.txt +++ b/forge-gui/res/cardsfolder/v/village_bell_ringer.txt @@ -5,5 +5,6 @@ PT:1/4 K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap all creatures you control. SVar:TrigUntap:AB$ UntapAll | Cost$ 0 | ValidCards$ Creature.YouCtrl +SVar:AmbushAI:True SVar:Picture:http://www.wizards.com/global/images/magic/general/village_bell_ringer.jpg Oracle:Flash (You may cast this spell any time you could cast an instant.)\nWhen Village Bell-Ringer enters the battlefield, untap all creatures you control.