From 2f40a48ecd465e186bbf6bbcea28fe643d0786b1 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Fri, 31 Aug 2012 22:23:02 +0000 Subject: [PATCH] *Added ETBReplacement::[:Optional] keyword. *Added ActiveZones parameter to replacement effects to let replacement effects function wherever. *Converted clones to ETBReplacement *Added Essence of the Wild *CardCharacteristics now copy ReplacementEffects *ReplacementEffects now copy alot more stuff. *Divvied up Replacement Effect running into layers *Moved stuff common between Trigger and ReplacementEffect to TriggerReplacementBase *Let AF_Tap tap cards on the stack in order to work with ETBReplacement. *Converted Remote Farm to ETBReplacement. --- .gitattributes | 3 + res/cardsfolder/a/abundance.txt | 2 +- .../akki_lavarunner_tok_tok_volcano_born.txt | 4 +- res/cardsfolder/a/anthem_of_rakdos.txt | 4 +- res/cardsfolder/a/archmage_ascension.txt | 2 +- res/cardsfolder/b/benevolent_unicorn.txt | 2 +- res/cardsfolder/b/body_double.txt | 4 +- res/cardsfolder/b/boon_reflection.txt | 2 +- res/cardsfolder/c/clone.txt | 4 +- res/cardsfolder/c/copy_artifact.txt | 4 +- res/cardsfolder/c/copy_enchantment.txt | 4 +- res/cardsfolder/c/curse_of_bloodletting.txt | 4 +- res/cardsfolder/d/divine_presence.txt | 4 +- res/cardsfolder/d/dralnu_lich_lord.txt | 2 +- res/cardsfolder/e/elderscale_wurm.txt | 4 +- res/cardsfolder/e/empyrial_archangel.txt | 4 +- res/cardsfolder/e/enduring_renewal.txt | 2 +- res/cardsfolder/e/essence_of_the_wild.txt | 7 ++ res/cardsfolder/e/evil_twin.txt | 4 +- res/cardsfolder/f/fire_servant.txt | 2 +- res/cardsfolder/f/force_bubble.txt | 2 +- res/cardsfolder/f/furnace_of_rath.txt | 4 +- .../g/gisela_blade_of_goldnight.txt | 4 +- res/cardsfolder/g/gloom_surgeon.txt | 2 +- res/cardsfolder/g/grafdiggers_cage.txt | 4 +- res/cardsfolder/g/gratuitous_violence.txt | 4 +- res/cardsfolder/g/gravebane_zombie.txt | 2 +- res/cardsfolder/h/hostility.txt | 2 +- res/cardsfolder/i/immortal_coil.txt | 2 +- res/cardsfolder/i/inquisitors_flail.txt | 4 +- res/cardsfolder/j/jwari_shapeshifter.txt | 4 +- res/cardsfolder/l/laboratory_maniac.txt | 2 +- res/cardsfolder/l/lashknife_barrier.txt | 4 +- res/cardsfolder/l/lich.txt | 2 +- res/cardsfolder/l/lichenthrope.txt | 2 +- res/cardsfolder/l/lichs_mirror.txt | 2 +- res/cardsfolder/m/martyrs_of_korlis.txt | 4 +- res/cardsfolder/o/obstinate_familiar.txt | 2 +- res/cardsfolder/p/pariah.txt | 4 +- res/cardsfolder/p/pariahs_shield.txt | 4 +- res/cardsfolder/p/phantasmal_image.txt | 4 +- res/cardsfolder/p/phyrexian_hydra.txt | 2 +- res/cardsfolder/p/phyrexian_metamorph.txt | 4 +- res/cardsfolder/p/phytohydra.txt | 2 +- res/cardsfolder/p/possessed_portal.txt | 2 +- res/cardsfolder/p/purity.txt | 2 +- res/cardsfolder/p/pursuit_of_knowledge.txt | 2 +- res/cardsfolder/p/pyromancers_swath.txt | 2 +- res/cardsfolder/q/quicksilver_gargantuan.txt | 4 +- res/cardsfolder/r/remote_farm.txt | 5 +- res/cardsfolder/r/rhox_faithmender.txt | 2 +- res/cardsfolder/s/sages_of_the_anima.txt | 2 +- res/cardsfolder/s/sakashima_the_impostor.txt | 4 +- res/cardsfolder/s/sakashimas_student.txt | 4 +- .../s/samurai_of_the_pale_curtain.txt | 2 +- res/cardsfolder/s/sculpting_steel.txt | 4 +- res/cardsfolder/s/sekki_seasons_guide.txt | 2 +- res/cardsfolder/s/sulfuric_vapors.txt | 2 +- res/cardsfolder/s/sulfuric_vortex.txt | 2 +- res/cardsfolder/s/szadek_lord_of_secrets.txt | 2 +- res/cardsfolder/t/thought_reflection.txt | 2 +- .../t/tomorrow_azamis_familiar.txt | 2 +- res/cardsfolder/u/undead_alchemist.txt | 2 +- res/cardsfolder/v/vesuva.txt | 4 +- res/cardsfolder/v/vesuvan_doppelganger.txt | 4 +- res/cardsfolder/v/veteran_bodyguard.txt | 4 +- res/cardsfolder/v/vigor.txt | 2 +- res/cardsfolder/w/weathered_bodyguards.txt | 2 +- res/cardsfolder/w/wheel_of_sun_and_moon.txt | 2 +- src/main/java/forge/Card.java | 10 +- src/main/java/forge/GameAction.java | 6 +- .../java/forge/card/CardCharacteristics.java | 5 + .../forge/card/TriggerReplacementBase.java | 74 ++++++++++++ .../card/abilityfactory/AbilityFactory.java | 4 + .../AbilityFactoryPermanentState.java | 2 +- .../cardfactory/CardFactoryCreatures.java | 48 ++++++++ .../card/cardfactory/CardFactoryUtil.java | 84 +++++++++++++ .../forge/card/replacement/ReplaceDamage.java | 6 +- .../forge/card/replacement/ReplaceDraw.java | 6 +- .../card/replacement/ReplaceGainLife.java | 6 +- .../card/replacement/ReplaceGameLoss.java | 6 +- .../forge/card/replacement/ReplaceMoved.java | 6 +- .../card/replacement/ReplacementEffect.java | 42 +++---- .../card/replacement/ReplacementHandler.java | 113 +++++++++++++----- .../card/replacement/ReplacementLayer.java | 32 +++++ .../card/replacement/ReplacementResult.java | 11 ++ src/main/java/forge/card/trigger/Trigger.java | 71 +---------- .../forge/card/trigger/TriggerHandler.java | 2 +- src/main/java/forge/game/player/Player.java | 22 +++- .../forge/game/zone/DefaultPlayerZone.java | 4 + 90 files changed, 531 insertions(+), 236 deletions(-) create mode 100644 res/cardsfolder/e/essence_of_the_wild.txt create mode 100644 src/main/java/forge/card/replacement/ReplacementLayer.java create mode 100644 src/main/java/forge/card/replacement/ReplacementResult.java diff --git a/.gitattributes b/.gitattributes index ae272acbed9..0fb60078a7a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2932,6 +2932,7 @@ res/cardsfolder/e/essence_filter.txt svneol=native#text/plain res/cardsfolder/e/essence_flare.txt svneol=native#text/plain res/cardsfolder/e/essence_fracture.txt svneol=native#text/plain res/cardsfolder/e/essence_harvest.txt -text +res/cardsfolder/e/essence_of_the_wild.txt -text res/cardsfolder/e/essence_scatter.txt svneol=native#text/plain res/cardsfolder/e/essence_sliver.txt svneol=native#text/plain res/cardsfolder/e/essence_warden.txt svneol=native#text/plain @@ -12034,6 +12035,8 @@ src/main/java/forge/card/replacement/ReplaceGameLoss.java -text src/main/java/forge/card/replacement/ReplaceMoved.java -text src/main/java/forge/card/replacement/ReplacementEffect.java -text src/main/java/forge/card/replacement/ReplacementHandler.java -text +src/main/java/forge/card/replacement/ReplacementLayer.java -text +src/main/java/forge/card/replacement/ReplacementResult.java -text src/main/java/forge/card/replacement/package-info.java svneol=native#text/plain src/main/java/forge/card/spellability/Ability.java svneol=native#text/plain src/main/java/forge/card/spellability/AbilityActivated.java svneol=native#text/plain diff --git a/res/cardsfolder/a/abundance.txt b/res/cardsfolder/a/abundance.txt index d1134e37d1c..611e14bda76 100644 --- a/res/cardsfolder/a/abundance.txt +++ b/res/cardsfolder/a/abundance.txt @@ -2,7 +2,7 @@ Name:Abundance ManaCost:2 G G Types:Enchantment Text:no text -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ AbundantChoice | Optional$ True | Description$ If you would draw a card, you may instead choose land or nonland and reveal cards from the top of your library until you reveal a card of the chosen kind. Put that card into your hand and put all other cards revealed this way on the bottom of your library in any order. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ AbundantChoice | Optional$ True | Description$ If you would draw a card, you may instead choose land or nonland and reveal cards from the top of your library until you reveal a card of the chosen kind. Put that card into your hand and put all other cards revealed this way on the bottom of your library in any order. SVar:AbundantChoice:AB$ GenericChoice | Cost$ 0 | Choices$ DigLand,DigNonland | Defined$ You SVar:DigLand:DB$ DigUntil | Valid$ Card.Land | ValidDescription$ land | FoundDestination$ Hand | RevealedDestination$ Library | RevealedLibraryPosition$ -1 | ChoiceDescription$ Land SVar:DigNonland:DB$ DigUntil | Valid$ Card.nonLand | ValidDescription$ nonland | FoundDestination$ Hand | RevealedDestination$ Library | RevealedLibraryPosition$ -1 | ChoiceDescription$ nonLand diff --git a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt index 637b6049e1c..0cb3c980389 100644 --- a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt +++ b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt @@ -20,8 +20,8 @@ Types:Legendary Creature Goblin Shaman Text:no text PT:2/2 K:Protection from red -R:Event$ DamageDone | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1 | IsCombat$ False | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. -R:Event$ DamageDone | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1Combat | IsCombat$ True | Secondary$ True | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1 | IsCombat$ False | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1Combat | IsCombat$ True | Secondary$ True | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. SVar:DmgPlus1:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgPlus1Combat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Plus.1 diff --git a/res/cardsfolder/a/anthem_of_rakdos.txt b/res/cardsfolder/a/anthem_of_rakdos.txt index 9a470e8d1d8..f608247a4c4 100644 --- a/res/cardsfolder/a/anthem_of_rakdos.txt +++ b/res/cardsfolder/a/anthem_of_rakdos.txt @@ -5,8 +5,8 @@ Text:no text T:Mode$ Attacks | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ AnthemPump | TriggerDescription$ Whenever a creature you control attacks, it gets +2/+0 until end of turn and CARDNAME deals 1 damage to you. SVar:AnthemPump:AB$Pump | Cost$ 0 | Defined$ TriggeredAttacker | NumAtt$ +2 | SubAbility$ RakdosBurn SVar:RakdosBurn:DB$ DealDamage | Defined$ You | NumDmg$ 1 -R:Event$ DamageDone | ValidSource$ Card.YouCtrl | ValidTarget$ Creature,Player | Hellbent$ True | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ Hellbent - As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. -R:Event$ DamageDone | ValidSource$ Card.YouCtrl | ValidTarget$ Creature,Player | Hellbent$ True | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ Hellbent - As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card.YouCtrl | ValidTarget$ Creature,Player | Hellbent$ True | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ Hellbent - As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card.YouCtrl | ValidTarget$ Creature,Player | Hellbent$ True | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ Hellbent - As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. SVar:DmgTwice:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice diff --git a/res/cardsfolder/a/archmage_ascension.txt b/res/cardsfolder/a/archmage_ascension.txt index 0f9762c8650..af14d469237 100644 --- a/res/cardsfolder/a/archmage_ascension.txt +++ b/res/cardsfolder/a/archmage_ascension.txt @@ -3,7 +3,7 @@ ManaCost:2 U Types:Enchantment Text:no text T:Mode$ Phase | Phase$ End of Turn | CheckSVar$ X | SVarCompare$ GE2 | TriggerZones$ Battlefield | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerDescription$ At the beginning of each end step, if you drew two or more cards this turn, you may put a quest counter on CARDNAME. -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ Tutor | CheckSVar$ Y | SVarCompare$ GE6 | Optional$ True | Description$ As long as CARDNAME has six or more quest counters on it, if you would draw a card, you may instead search your library for a card, put that card into your hand, then shuffle your library. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Tutor | CheckSVar$ Y | SVarCompare$ GE6 | Optional$ True | Description$ As long as CARDNAME has six or more quest counters on it, if you would draw a card, you may instead search your library for a card, put that card into your hand, then shuffle your library. SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ QUEST | CounterNum$ 1 SVar:Tutor:AB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ValidCard$ Card.YouOwn SVar:X:Count$YouDrewThisTurn diff --git a/res/cardsfolder/b/benevolent_unicorn.txt b/res/cardsfolder/b/benevolent_unicorn.txt index 0f9a86f573e..337de95b67e 100644 --- a/res/cardsfolder/b/benevolent_unicorn.txt +++ b/res/cardsfolder/b/benevolent_unicorn.txt @@ -3,7 +3,7 @@ ManaCost:1 W Types:Creature Unicorn Text:no text PT:1/2 -R:Event$ DamageDone | ValidSource$ Spell | ValidTarget$ Creature,Player | ReplaceWith$ DmgMinus1 | Description$ If a spell would deal damage to a creature or player, it deals that much damage minus 1 to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Spell | ValidTarget$ Creature,Player | ReplaceWith$ DmgMinus1 | Description$ If a spell would deal damage to a creature or player, it deals that much damage minus 1 to that creature or player instead. SVar:DmgMinus1:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Picture:http://www.wizards.com/global/images/magic/general/benevolent_unicorn.jpg diff --git a/res/cardsfolder/b/body_double.txt b/res/cardsfolder/b/body_double.txt index 6de37c98bb7..a2e53d6d6f7 100644 --- a/res/cardsfolder/b/body_double.txt +++ b/res/cardsfolder/b/body_double.txt @@ -3,8 +3,8 @@ ManaCost:4 U Types:Creature Shapeshifter Text:no text PT:0/0 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature card in a graveyard. -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature | ChoiceZone$ Graveyard | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature | ChoiceZone$ Graveyard | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have Body Double enter the battlefield as a copy of any creature card in a graveyard. SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/body_double.jpg diff --git a/res/cardsfolder/b/boon_reflection.txt b/res/cardsfolder/b/boon_reflection.txt index 2d17cc5c628..df437fb5074 100644 --- a/res/cardsfolder/b/boon_reflection.txt +++ b/res/cardsfolder/b/boon_reflection.txt @@ -2,7 +2,7 @@ Name:Boon Reflection ManaCost:4 W Types:Enchantment Text:no text -R:Event$ GainLife | ValidPlayer$ You | ReplaceWith$ GainDouble | Description$ If you would gain life, you gain twice that much life instead. +R:Event$ GainLife | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ GainDouble | Description$ If you would gain life, you gain twice that much life instead. SVar:GainDouble:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X | References$ X SVar:X:ReplaceCount$LifeGained/Twice SVar:PlayMain1:True diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index 2a74503d647..5404b278cde 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -3,8 +3,8 @@ ManaCost:3 U Types:Creature Shapeshifter Text:no text PT:0/0 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg diff --git a/res/cardsfolder/c/copy_artifact.txt b/res/cardsfolder/c/copy_artifact.txt index cd1a6955ee0..a7e3feebb97 100644 --- a/res/cardsfolder/c/copy_artifact.txt +++ b/res/cardsfolder/c/copy_artifact.txt @@ -2,8 +2,8 @@ Name:Copy Artifact ManaCost:1 U Types:Enchantment Text:no text -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. -SVar:ChooseArtifact:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True | AILogic$ AtLeast1 +K:ETBReplacement:Copy:ChooseArtifact:Optional +SVar:ChooseArtifact:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True | AILogic$ AtLeast1 | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/copy_artifact.jpg diff --git a/res/cardsfolder/c/copy_enchantment.txt b/res/cardsfolder/c/copy_enchantment.txt index f10e6ad449c..57ff70b95f0 100644 --- a/res/cardsfolder/c/copy_enchantment.txt +++ b/res/cardsfolder/c/copy_enchantment.txt @@ -2,8 +2,8 @@ Name:Copy Enchantment ManaCost:2 U Types:Enchantment Text:no text -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseEnchantment | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any enchantment on the battlefield. -SVar:ChooseEnchantment:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Enchantment.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseEnchantment:Optional +SVar:ChooseEnchantment:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Enchantment.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any enchantment on the battlefield. SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/c/curse_of_bloodletting.txt b/res/cardsfolder/c/curse_of_bloodletting.txt index f157b896293..dc224afe4d7 100644 --- a/res/cardsfolder/c/curse_of_bloodletting.txt +++ b/res/cardsfolder/c/curse_of_bloodletting.txt @@ -4,8 +4,8 @@ Types:Enchantment Aura Curse Text:no text K:Enchant player A:SP$ Attach | Cost$ 3 R R | ValidTgts$ Player | AILogic$ Curse -R:Event$ DamageDone | ValidTarget$ Player.EnchantedBy | ReplaceWith$ DmgTimes2 | IsCombat$ False | Description$ If a source would deal damage to enchanted player, it deals double that damage instead. -R:Event$ DamageDone | ValidTarget$ Player.EnchantedBy | ReplaceWith$ DmgTimes2Combat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to enchanted player, it deals double that damage instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Player.EnchantedBy | ReplaceWith$ DmgTimes2 | IsCombat$ False | Description$ If a source would deal damage to enchanted player, it deals double that damage instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Player.EnchantedBy | ReplaceWith$ DmgTimes2Combat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to enchanted player, it deals double that damage instead. SVar:DmgTimes2:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgTimes2Combat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice diff --git a/res/cardsfolder/d/divine_presence.txt b/res/cardsfolder/d/divine_presence.txt index 42511e6c969..f0529b7b66c 100644 --- a/res/cardsfolder/d/divine_presence.txt +++ b/res/cardsfolder/d/divine_presence.txt @@ -2,8 +2,8 @@ Name:Divine Presence ManaCost:2 W Types:Enchantment Text:no text -R:Event$ DamageDone | ValidTarget$ Creature,Player | DamageAmount$ GE4 | ReplaceWith$ Dmg3 | IsCombat$ False | Description$ If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead. -R:Event$ DamageDone | ValidTarget$ Creature,Player | DamageAmount$ GE4 | IsCombat$ True | ReplaceWith$ Dmg3Combat | Secondary$ True | Description$ If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature,Player | DamageAmount$ GE4 | ReplaceWith$ Dmg3 | IsCombat$ False | Description$ If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature,Player | DamageAmount$ GE4 | IsCombat$ True | ReplaceWith$ Dmg3Combat | Secondary$ True | Description$ If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead. SVar:Dmg3:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ 3 SVar:Dmg3Combat:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 3 SVar:PlayMain1:TRUE diff --git a/res/cardsfolder/d/dralnu_lich_lord.txt b/res/cardsfolder/d/dralnu_lich_lord.txt index 8f8a3c0ed8d..b67e7b3c48d 100644 --- a/res/cardsfolder/d/dralnu_lich_lord.txt +++ b/res/cardsfolder/d/dralnu_lich_lord.txt @@ -3,7 +3,7 @@ ManaCost:3 U B Types:Legendary Creature Zombie Wizard Text:no text PT:3/3 -R:Event$ DamageDone | ValidTarget$ Card.Self | ReplaceWith$ Sac | Description$ If damage would be dealt to CARDNAME, sacrifice that many permanents instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ Sac | Description$ If damage would be dealt to CARDNAME, sacrifice that many permanents instead. SVar:Sac:AB$Sacrifice | Cost$ 0 | Defined$ You | SacValid$ Permanent | SacMessage$ Permanent | Amount$ X | References$ X SVar:X:ReplaceCount$DamageAmount A:AB$Pump | Cost$ T | ValidTgts$ Instant.YouCtrl,Sorcery.YouCtrl | KW$ Flashback | TgtZone$ Graveyard | PumpZone$ Graveyard | SpellDescription$ Target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.) diff --git a/res/cardsfolder/e/elderscale_wurm.txt b/res/cardsfolder/e/elderscale_wurm.txt index 140bbe78b3a..11ddcb738e0 100644 --- a/res/cardsfolder/e/elderscale_wurm.txt +++ b/res/cardsfolder/e/elderscale_wurm.txt @@ -6,8 +6,8 @@ PT:7/7 K:Trample T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigLife | CheckSVar$ ElderscaleCondition | SVarCompare$ LT7 | TriggerDescription$ When CARDNAME enters the battlefield, if your life total is less than 7, your life total becomes 7. SVar:TrigLife:AB$ SetLife | Cost$ 0 | Defined$ You | LifeAmount$ 7 -R:Event$ DamageDone | Affected$ You | ValidTarget$ You | ReplaceWith$ DmgLucky7 | CheckSVar$ ElderscaleCondition | SVarCompare$ GE7 | IsCombat$ False | Description$ As long as you have 7 or more life, damage that would reduce your life total to less than 7 reduces it to 7 instead. -R:Event$ DamageDone | Affected$ You | ValidTarget$ You | ReplaceWith$ DmgLucky7Combat | CheckSVar$ ElderscaleCondition | SVarCompare$ GE7 | IsCombat$ True | Secondary$ True | Description$ As long as you have 7 or more life, damage that would reduce your life total to less than 7 reduces it to 7 instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | Affected$ You | ValidTarget$ You | ReplaceWith$ DmgLucky7 | CheckSVar$ ElderscaleCondition | SVarCompare$ GE7 | IsCombat$ False | Description$ As long as you have 7 or more life, damage that would reduce your life total to less than 7 reduces it to 7 instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | Affected$ You | ValidTarget$ You | ReplaceWith$ DmgLucky7Combat | CheckSVar$ ElderscaleCondition | SVarCompare$ GE7 | IsCombat$ True | Secondary$ True | Description$ As long as you have 7 or more life, damage that would reduce your life total to less than 7 reduces it to 7 instead. SVar:DmgLucky7:AB$ DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ DmgDone | SubAbility$ NoPain SVar:DmgLucky7Combat:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ DmgDone | SubAbility$ NoPain SVar:NoPain:DB$ SetLife | Defined$ You | LifeAmount$ 7 | ConditionCheckSVar$ DmgResult | ConditionSVarCompare$ LT7 | SubAbility$ LifelinkQuirk diff --git a/res/cardsfolder/e/empyrial_archangel.txt b/res/cardsfolder/e/empyrial_archangel.txt index a2aa9e65af1..9595cee13e8 100644 --- a/res/cardsfolder/e/empyrial_archangel.txt +++ b/res/cardsfolder/e/empyrial_archangel.txt @@ -5,8 +5,8 @@ Text:no text PT:5/8 K:Flying K:Shroud -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ False | Description$ All damage that would be dealt to you is dealt to CARDNAME instead. -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgSelfCombat | IsCombat$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ False | Description$ All damage that would be dealt to you is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgSelfCombat | IsCombat$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to CARDNAME instead. SVar:DmgSelf:AB$DealDamage | Cost$ 0 | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgSelfCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/e/enduring_renewal.txt b/res/cardsfolder/e/enduring_renewal.txt index 69f22af1544..c70a7ea26e4 100644 --- a/res/cardsfolder/e/enduring_renewal.txt +++ b/res/cardsfolder/e/enduring_renewal.txt @@ -3,7 +3,7 @@ ManaCost:2 W W Types:Enchantment Text:no text S:Mode$ Continuous | Affected$ You | AddKeyword$ Play with your hand revealed. | Description$ Play with your hand revealed. -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ EnduringRevealTop | Description$ If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ EnduringRevealTop | Description$ If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card. SVar:EnduringRevealTop:AB$ Dig | Cost$ 0 | DigNum$ 1 | Reveal$ True | NoMove$ True | RememberRevealed$ True | SubAbility$ DBEnduringGraveyard SVar:DBEnduringGraveyard:DB$ ChangeZone | Defined$ Remembered | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ GE1 | Origin$ Library | Destination$ Graveyard | SubAbility$ DBEnduringDraw SVar:DBEnduringDraw:DB$ Draw | NumCards$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ EQ0 | SubAbility$ DBEnduringCleanup diff --git a/res/cardsfolder/e/essence_of_the_wild.txt b/res/cardsfolder/e/essence_of_the_wild.txt new file mode 100644 index 00000000000..9afdf5bfafe --- /dev/null +++ b/res/cardsfolder/e/essence_of_the_wild.txt @@ -0,0 +1,7 @@ +Name:Essence of the Wild +ManaCost:3 G G G +Types:Creature Avatar +Text:no text +PT:6/6 +SetInfo:ISD|Mythic|http://magiccards.info/scans/en/isd/178.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index 261ddaea480..7b0091c1703 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -4,8 +4,8 @@ Types:Creature Shapeshifter Text:no text PT:0/0 # Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. SVar:Rarity:Rare diff --git a/res/cardsfolder/f/fire_servant.txt b/res/cardsfolder/f/fire_servant.txt index 7bf88bfd252..2f0ecc41594 100644 --- a/res/cardsfolder/f/fire_servant.txt +++ b/res/cardsfolder/f/fire_servant.txt @@ -3,7 +3,7 @@ ManaCost:3 R R Types:Creature Elemental Text:no text PT:4/3 -R:Event$ DamageDone | ValidSource$ Instant.YouCtrl,Sorcery.YouCtrl | ReplaceWith$ DmgTwice | Description$ If a red instant or sorcery spell you control would deal damage, it deals double that damage instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Instant.YouCtrl,Sorcery.YouCtrl | ReplaceWith$ DmgTwice | Description$ If a red instant or sorcery spell you control would deal damage, it deals double that damage instead. SVar:DmgTwice:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice SVar:Picture:http://www.wizards.com/global/images/magic/general/fire_servant.jpg diff --git a/res/cardsfolder/f/force_bubble.txt b/res/cardsfolder/f/force_bubble.txt index e0ecbb359ac..0da4557a4e0 100644 --- a/res/cardsfolder/f/force_bubble.txt +++ b/res/cardsfolder/f/force_bubble.txt @@ -2,7 +2,7 @@ Name:Force Bubble ManaCost:2 W W Types:Enchantment Text:no text -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ Counters | Description$ If damage would be dealt to you, put that many depletion counters on CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ Counters | Description$ If damage would be dealt to you, put that many depletion counters on CARDNAME instead. SVar:Counters:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ DEPLETION | CounterNum$ X | References$ X T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_GE4_DEPLETION | Execute$ TrigSac | TriggerDescription$ When there are four or more depletion counters on CARDNAME, sacrifice it. SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self diff --git a/res/cardsfolder/f/furnace_of_rath.txt b/res/cardsfolder/f/furnace_of_rath.txt index 245dfe1a9f0..21ac7eac14a 100644 --- a/res/cardsfolder/f/furnace_of_rath.txt +++ b/res/cardsfolder/f/furnace_of_rath.txt @@ -2,8 +2,8 @@ Name:Furnace of Rath ManaCost:1 R R R Types:Enchantment Text:no text -R:Event$ DamageDone | ValidSource$ Card | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. -R:Event$ DamageDone | ValidSource$ Card | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. SVar:DmgTwice:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice diff --git a/res/cardsfolder/g/gisela_blade_of_goldnight.txt b/res/cardsfolder/g/gisela_blade_of_goldnight.txt index 176f1e94f92..f886584f11b 100644 --- a/res/cardsfolder/g/gisela_blade_of_goldnight.txt +++ b/res/cardsfolder/g/gisela_blade_of_goldnight.txt @@ -5,8 +5,8 @@ Text:no text PT:5/5 K:Flying K:First Strike -R:Event$ DamageDone | ValidSource$ Card | ValidTarget$ Opponent,Permanent.YouDontCtrl | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead. -R:Event$ DamageDone | ValidSource$ Card | ValidTarget$ Opponent,Permanent.YouDontCtrl | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card | ValidTarget$ Opponent,Permanent.YouDontCtrl | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Card | ValidTarget$ Opponent,Permanent.YouDontCtrl | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead. SVar:DmgTwice:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice diff --git a/res/cardsfolder/g/gloom_surgeon.txt b/res/cardsfolder/g/gloom_surgeon.txt index 0802992ea3d..7ed8434f492 100644 --- a/res/cardsfolder/g/gloom_surgeon.txt +++ b/res/cardsfolder/g/gloom_surgeon.txt @@ -3,7 +3,7 @@ ManaCost:1 B Types:Creature Spirit Text:no text PT:2/1 -R:Event$ DamageDone | ValidTarget$ Card.Self | IsCombat$ True | ReplaceWith$ Exile | PreventionEffect$ True | Description$ If damage would be dealt to CARDNAME, prevent that damage and exile that many cards from the top of your library. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | IsCombat$ True | ReplaceWith$ Exile | PreventionEffect$ True | Description$ If damage would be dealt to CARDNAME, prevent that damage and exile that many cards from the top of your library. SVar:Exile:AB$ Dig | Cost$ 0 | DigNum$ X | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Exile | References$ X SVar:X:ReplaceCount$DamageAmount SVar:Rarity:Rare diff --git a/res/cardsfolder/g/grafdiggers_cage.txt b/res/cardsfolder/g/grafdiggers_cage.txt index f53b840cee9..4331611d76f 100644 --- a/res/cardsfolder/g/grafdiggers_cage.txt +++ b/res/cardsfolder/g/grafdiggers_cage.txt @@ -2,8 +2,8 @@ Name:Grafdigger's Cage ManaCost:1 Types:Artifact Text:no text -R:Event$Moved | Origin$ Graveyard | Destination$ Battlefield | ValidCard$ Creature | Prevent$ True | Description$ Creature cards can't enter the battlefield from graveyards or libraries. -R:Event$Moved | Origin$ Library | Destination$ Battlefield | ValidCard$ Creature | Prevent$ True +R:Event$Moved | ActiveZones$ Battlefield | Origin$ Graveyard | Destination$ Battlefield | ValidCard$ Creature | Prevent$ True | Description$ Creature cards can't enter the battlefield from graveyards or libraries. +R:Event$Moved | ActiveZones$ Battlefield | Origin$ Library | Destination$ Battlefield | ValidCard$ Creature | Prevent$ True S:Mode$ CantBeCast | Origin$ Graveyard | Description$ Players can't cast cards in graveyards or libraries. S:Mode$ CantBeCast | Origin$ Library SVar:RemRandomDeck:True diff --git a/res/cardsfolder/g/gratuitous_violence.txt b/res/cardsfolder/g/gratuitous_violence.txt index faed48b1a81..5118d6a6d54 100644 --- a/res/cardsfolder/g/gratuitous_violence.txt +++ b/res/cardsfolder/g/gratuitous_violence.txt @@ -2,8 +2,8 @@ Name:Gratuitous Violence ManaCost:2 R R R Types:Enchantment Text:no text -R:Event$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. -R:Event$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwice | IsCombat$ False | Description$ If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgTwiceCombat | IsCombat$ True | Secondary$ True | Description$ If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. SVar:DmgTwice:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgTwiceCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Twice diff --git a/res/cardsfolder/g/gravebane_zombie.txt b/res/cardsfolder/g/gravebane_zombie.txt index eaa2fef90a3..08a1bee922c 100644 --- a/res/cardsfolder/g/gravebane_zombie.txt +++ b/res/cardsfolder/g/gravebane_zombie.txt @@ -3,7 +3,7 @@ ManaCost:3 B Types:Creature Zombie Text:no text PT:3/2 -R:Event$ Moved | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | ReplaceWith$ ToLibrary | Description$ If CARDNAME would die, put CARDNAME on top of its owner's library instead. +R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | ReplaceWith$ ToLibrary | Description$ If CARDNAME would die, put CARDNAME on top of its owner's library instead. SVar:ToLibrary:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Library | LibraryPosition$ 0 | Defined$ ReplacedCard SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/gravebane_zombie.jpg diff --git a/res/cardsfolder/h/hostility.txt b/res/cardsfolder/h/hostility.txt index 5277aef68a2..7b595ef4c89 100644 --- a/res/cardsfolder/h/hostility.txt +++ b/res/cardsfolder/h/hostility.txt @@ -4,7 +4,7 @@ Types:Creature Elemental Incarnation Text:no text PT:6/6 K:Haste -R:Event$ DamageDone | ValidSource$ Spell.YouCtrl | ValidTarget$ Opponent | PreventionEffect$ True | ReplaceWith$ HostilityTokens | Description$ If a spell you control would deal damage to an opponent, prevent that damage. Put a 3/1 red Elemental Shaman creature token with haste onto the battlefield for each 1 damage prevented this way. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Spell.YouCtrl | ValidTarget$ Opponent | PreventionEffect$ True | ReplaceWith$ HostilityTokens | Description$ If a spell you control would deal damage to an opponent, prevent that damage. Put a 3/1 red Elemental Shaman creature token with haste onto the battlefield for each 1 damage prevented this way. SVar:HostilityTokens:AB$ Token | Cost$ 0 | TokenAmount$ X | References$ X | TokenImage$ R 3 1 Elemental Shaman | TokenName$ Elemental Shaman | TokenColors$ Red | TokenTypes$ Creature,Elemental,Shaman | TokenPower$ 3 | TokenToughness$ 1 | TokenKeywords$ Haste | TokenOwner$ You SVar:X:ReplaceCount$DamageAmount T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigShuffle | TriggerDescription$ When CARDNAME is put into a graveyard from anywhere, shuffle it into its owner's library. diff --git a/res/cardsfolder/i/immortal_coil.txt b/res/cardsfolder/i/immortal_coil.txt index b2b1d3bdffa..2016f8d2bad 100644 --- a/res/cardsfolder/i/immortal_coil.txt +++ b/res/cardsfolder/i/immortal_coil.txt @@ -3,7 +3,7 @@ ManaCost:2 B B Types:Artifact Text:no text A:AB$ Draw | Cost$ T ExileFromGrave<2/Card> | CostDesc$ T, Exile two cards from your graveyard | NumCards$ 1 | SpellDescription$ Draw a card. -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ ChangeZone | PreventionEffect$ True | Description$ If damage would be dealt to you, prevent that damage. Exile a card from your graveyard for each 1 damage prevented this way. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ ChangeZone | PreventionEffect$ True | Description$ If damage would be dealt to you, prevent that damage. Exile a card from your graveyard for each 1 damage prevented this way. SVar:ChangeZone:AB$ ChangeZone | Cost$ 0 | Hidden$ True | Mandatory$ True | ChangeType$ Card | ChangeNum$ X | DefinedPlayer$ ReplacedTarget | Origin$ Graveyard | Destination$ Exile | References$ X T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Card.YouCtrl | PresentZone$ Graveyard | PresentCompare$ EQ0 | Execute$ TrigLoseGame | TriggerDescription$ When there are no cards in your graveyard, you lose the game. SVar:TrigLoseGame:AB$ LosesGame | Cost$ 0 | Defined$ You diff --git a/res/cardsfolder/i/inquisitors_flail.txt b/res/cardsfolder/i/inquisitors_flail.txt index a00fd877b44..871338b1f56 100644 --- a/res/cardsfolder/i/inquisitors_flail.txt +++ b/res/cardsfolder/i/inquisitors_flail.txt @@ -3,8 +3,8 @@ ManaCost:2 Types:Artifact Equipment Text:no text K:Equip 2 -R:Event$ DamageDone | ValidSource$ Creature.EquippedBy | ReplaceWith$ DmgTimes2 | IsCombat$ True | Description$ If equipped creature would deal combat damage, it deals double that damage instead. -R:Event$ DamageDone | ValidTarget$ Creature.EquippedBy | ValidSource$ Creature.Other | ReplaceWith$ DmgTimes2 | IsCombat$ True | Description$ If another creature would deal combat damage to equipped creature, it deals double that damage to equipped creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.EquippedBy | ReplaceWith$ DmgTimes2 | IsCombat$ True | Description$ If equipped creature would deal combat damage, it deals double that damage instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature.EquippedBy | ValidSource$ Creature.Other | ReplaceWith$ DmgTimes2 | IsCombat$ True | Description$ If another creature would deal combat damage to equipped creature, it deals double that damage to equipped creature instead. SVar:DmgTimes2:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Times.2 SVar:Picture:http://www.wizards.com/global/images/magic/general/inquisitors_flail.jpg diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index badfdbeec90..c5395219913 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -3,8 +3,8 @@ ManaCost:1 U Types:Creature Shapeshifter Ally Text:no text PT:0/0 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. -SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:RemRandomDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/l/laboratory_maniac.txt b/res/cardsfolder/l/laboratory_maniac.txt index 5d53b11acf3..c4668fcff97 100644 --- a/res/cardsfolder/l/laboratory_maniac.txt +++ b/res/cardsfolder/l/laboratory_maniac.txt @@ -3,7 +3,7 @@ ManaCost:2 U Types:Creature Human Wizard Text:no text PT:2/2 -R:Event$ Draw | ValidPlayer$ You | IsPresent$ Card.YouOwn | PresentZone$ Library | PresentCompare$ EQ0 | ReplaceWith$ Win | Description$ If you would draw a card while your library has no cards in it, you win the game instead. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | IsPresent$ Card.YouOwn | PresentZone$ Library | PresentCompare$ EQ0 | ReplaceWith$ Win | Description$ If you would draw a card while your library has no cards in it, you win the game instead. SVar:Win:AB$WinsGame | Cost$ 0 | Defined$ You SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/laboratory_maniac.jpg diff --git a/res/cardsfolder/l/lashknife_barrier.txt b/res/cardsfolder/l/lashknife_barrier.txt index bbc6f615eae..0d15a07db76 100644 --- a/res/cardsfolder/l/lashknife_barrier.txt +++ b/res/cardsfolder/l/lashknife_barrier.txt @@ -2,8 +2,8 @@ Name:Lashknife Barrier ManaCost:2 W Types:Enchantment Text:no text -R:Event$ DamageDone | ValidTarget$ Creature.YouCtrl | ReplaceWith$ DmgMinus1 | IsCombat$ False | Description$ If a source would deal damage to a creature you control, it deals that much damage minus 1 to that creature instead. -R:Event$ DamageDone | ValidTarget$ Creature.YouCtrl | ReplaceWith$ DmgMinus1Combat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to a creature you control, it deals that much damage minus 1 to that creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature.YouCtrl | ReplaceWith$ DmgMinus1 | IsCombat$ False | Description$ If a source would deal damage to a creature you control, it deals that much damage minus 1 to that creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature.YouCtrl | ReplaceWith$ DmgMinus1Combat | IsCombat$ True | Secondary$ True | Description$ If a source would deal damage to a creature you control, it deals that much damage minus 1 to that creature instead. SVar:DmgMinus1:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgMinus1Combat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Minus.1 diff --git a/res/cardsfolder/l/lich.txt b/res/cardsfolder/l/lich.txt index eb3ebf05011..b48276797f4 100644 --- a/res/cardsfolder/l/lich.txt +++ b/res/cardsfolder/l/lich.txt @@ -3,7 +3,7 @@ ManaCost:B B B B Types:Enchantment Text:As CARDNAME enters the battlefield, you lose life equal to your life total.\r\nWhenever you're dealt damage, sacrifice that many nontoken permanents. If you can't, you lose the game.\r\nWhen CARDNAME is put into a graveyard from the battlefield, you lose the game. S:Mode$ Continuous | Affected$ You | AddKeyword$ You don't lose the game for having 0 or less life. | Description$ You don't lose the game for having 0 or less life. -R:Event$ GainLife | ValidPlayer$ You | ReplaceWith$ Draw | Description$ If you would gain life, draw that many cards instead. +R:Event$ GainLife | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Draw | Description$ If you would gain life, draw that many cards instead. SVar:Draw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ X | References$ X SVar:X:ReplaceCount$LifeGained SVar:RemRandomDeck:True diff --git a/res/cardsfolder/l/lichenthrope.txt b/res/cardsfolder/l/lichenthrope.txt index 932427a0945..2ed11d04efb 100644 --- a/res/cardsfolder/l/lichenthrope.txt +++ b/res/cardsfolder/l/lichenthrope.txt @@ -3,7 +3,7 @@ ManaCost:3 G G Types:Creature Plant Fungus Text:no text PT:5/5 -R:Event$ DamageDone | ValidTarget$ Card.Self | ReplaceWith$ Counters | Description$ If damage would be dealt to CARDNAME, put that many -1/-1 counters on it instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ Counters | Description$ If damage would be dealt to CARDNAME, put that many -1/-1 counters on it instead. SVar:Counters:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ M1M1 | CounterNum$ X | References$ X SVar:X:ReplaceCount$DamageAmount T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRem | TriggerDescription$ At the beginning of your upkeep, remove a -1/-1 counter from CARDNAME. diff --git a/res/cardsfolder/l/lichs_mirror.txt b/res/cardsfolder/l/lichs_mirror.txt index 82e5125ec15..e56d1c55707 100644 --- a/res/cardsfolder/l/lichs_mirror.txt +++ b/res/cardsfolder/l/lichs_mirror.txt @@ -2,7 +2,7 @@ Name:Lich's Mirror ManaCost:5 Types:Artifact Text:no text -R:Event$ GameLoss | ValidPlayer$ You | ReplaceWith$ ShuffleDrawSetLife | Description$ If you would lose the game, instead shuffle your hand, your graveyard, and all permanents you own into your library, then draw seven cards and your life total becomes 20. +R:Event$ GameLoss | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ ShuffleDrawSetLife | Description$ If you would lose the game, instead shuffle your hand, your graveyard, and all permanents you own into your library, then draw seven cards and your life total becomes 20. SVar:ShuffleDrawSetLife:AB$ ChangeZoneAll | Cost$ 0 | ChangeType$ Card.YouOwn | Origin$ Battlefield | Destination$ Library | Shuffle$ True | SubAbility$ Shuffle2 SVar:Shuffle2:DB$ ChangeZoneAll | ChangeType$ Card.YouOwn | Origin$ Hand | Destination$ Library | Shuffle$ True | SubAbility$ Shuffle3 SVar:Shuffle3:DB$ ChangeZoneAll | ChangeType$ Card.YouOwn | Origin$ Graveyard | Destination$ Library | Shuffle$ True | SubAbility$ Draw diff --git a/res/cardsfolder/m/martyrs_of_korlis.txt b/res/cardsfolder/m/martyrs_of_korlis.txt index 43a7d3f929d..74f04d18331 100644 --- a/res/cardsfolder/m/martyrs_of_korlis.txt +++ b/res/cardsfolder/m/martyrs_of_korlis.txt @@ -3,8 +3,8 @@ ManaCost:3 W W Types:Creature Human Text:no text PT:1/6 -R:Event$ DamageDone | ValidSource$ Artifact | ValidTarget$ You | ReplaceWith$ DmgMartyrsofKorlisSelf | IsCombat$ False | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by artifacts is dealt to CARDNAME instead. -R:Event$ DamageDone | ValidSource$ Artifact | ValidTarget$ You | ReplaceWith$ DmgMartyrsofKorlisSelfCombat | IsCombat$ True | IsPresent$ Card.Self+untapped | Secondary$ True | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by artifacts is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Artifact | ValidTarget$ You | ReplaceWith$ DmgMartyrsofKorlisSelf | IsCombat$ False | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by artifacts is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Artifact | ValidTarget$ You | ReplaceWith$ DmgMartyrsofKorlisSelfCombat | IsCombat$ True | IsPresent$ Card.Self+untapped | Secondary$ True | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by artifacts is dealt to CARDNAME instead. SVar:DmgMartyrsofKorlisSelf:AB$DealDamage | Cost$ 0 | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ MartyrsofKorlisX | References$ MartyrsofKorlisX SVar:DmgMartyrsofKorlisSelfCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ MartyrsofKorlisX | References$ MartyrsofKorlisX SVar:MartyrsofKorlisX:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/o/obstinate_familiar.txt b/res/cardsfolder/o/obstinate_familiar.txt index 2a94353e090..fc47e5eca67 100644 --- a/res/cardsfolder/o/obstinate_familiar.txt +++ b/res/cardsfolder/o/obstinate_familiar.txt @@ -3,7 +3,7 @@ ManaCost:R Types:Creature Lizard Text:no text PT:1/1 -R:Event$ Draw | ValidPlayer$ You | Optional$ True | Prevent$ True | AICheckSVar$ AIHandling | AISVarCompare$ EQ0 | References$ AIHandling | Description$ If you would draw a card, you may skip that draw instead. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | Optional$ True | Prevent$ True | AICheckSVar$ AIHandling | AISVarCompare$ EQ0 | References$ AIHandling | Description$ If you would draw a card, you may skip that draw instead. SVar:AIHandling:Count$InYourLibrary SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/obstinate_familiar.jpg diff --git a/res/cardsfolder/p/pariah.txt b/res/cardsfolder/p/pariah.txt index e2bc7bdddc1..9dd816d3c96 100644 --- a/res/cardsfolder/p/pariah.txt +++ b/res/cardsfolder/p/pariah.txt @@ -4,8 +4,8 @@ Types:Enchantment Aura Text:no text K:Enchant creature A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | TgtPrompt$ Select target creature | AILogic$ Curse -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgEnchanted | IsCombat$ False | Description$ All damage that would be dealt to you is dealt to enchanted creature instead. -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgEnchantedCombat | IsCombat$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to enchanted creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgEnchanted | IsCombat$ False | Description$ All damage that would be dealt to you is dealt to enchanted creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgEnchantedCombat | IsCombat$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to enchanted creature instead. SVar:DmgEnchanted:AB$DealDamage | Cost$ 0 | Defined$ Enchanted | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgEnchantedCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Enchanted | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/p/pariahs_shield.txt b/res/cardsfolder/p/pariahs_shield.txt index 16fcc5cbdd5..2a22e743ce5 100644 --- a/res/cardsfolder/p/pariahs_shield.txt +++ b/res/cardsfolder/p/pariahs_shield.txt @@ -3,8 +3,8 @@ ManaCost:5 Types:Artifact Equipment Text:no text K:Equip 3 -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgEquipped | IsCombat$ False | IsEquipping$ True | Description$ All damage that would be dealt to you is dealt to equipped creature instead. -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ DmgEquippedCombat | IsCombat$ True | IsEquipping$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to equipped creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgEquipped | IsCombat$ False | IsEquipping$ True | Description$ All damage that would be dealt to you is dealt to equipped creature instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ DmgEquippedCombat | IsCombat$ True | IsEquipping$ True | Secondary$ True | Description$ All damage that would be dealt to you is dealt to equipped creature instead. SVar:DmgEquipped:AB$DealDamage | Cost$ 0 | Defined$ Equipped | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgEquippedCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Equipped | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index b9a786ee654..3697cd97645 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -4,8 +4,8 @@ Types:Creature Illusion Text:no text PT:0/0 # Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ PhantasmalImageTgtTrig | AddSVars$ PhantasmalImageSac,Targeting SVar:PhantasmalImageTgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ PhantasmalImageSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. SVar:PhantasmalImageSac:AB$Sacrifice | Cost$ 0 | Defined$ Self diff --git a/res/cardsfolder/p/phyrexian_hydra.txt b/res/cardsfolder/p/phyrexian_hydra.txt index faccaec0879..d67f5cfc07c 100644 --- a/res/cardsfolder/p/phyrexian_hydra.txt +++ b/res/cardsfolder/p/phyrexian_hydra.txt @@ -4,7 +4,7 @@ Types:Creature Hydra Text:no text PT:7/7 K:Infect -R:Event$ DamageDone | ValidTarget$ Card.Self | ReplaceWith$ Counters | PreventionEffect$ True | Description$ If damage would be dealt to CARDNAME, prevent that damage. Put a -1/-1 counter on CARDNAME for each 1 damage prevented this way. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ Counters | PreventionEffect$ True | Description$ If damage would be dealt to CARDNAME, prevent that damage. Put a -1/-1 counter on CARDNAME for each 1 damage prevented this way. SVar:Counters:AB$ PutCounter | Cost$ 0 | Defined$ ReplacedTarget | CounterType$ M1M1 | CounterNum$ X | References$ X SVar:X:ReplaceCount$DamageAmount SVar:Rarity:Rare diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index 2deb7c234de..2571a6d9d57 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -3,8 +3,8 @@ ManaCost:3 PU Types:Artifact Creature Shapeshifter Text:no text PT:0/0 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg diff --git a/res/cardsfolder/p/phytohydra.txt b/res/cardsfolder/p/phytohydra.txt index b1b6d2843f3..76ee01f266a 100644 --- a/res/cardsfolder/p/phytohydra.txt +++ b/res/cardsfolder/p/phytohydra.txt @@ -3,7 +3,7 @@ ManaCost:2 W W G Types:Creature Plant Hydra Text:no text PT:1/1 -R:Event$ DamageDone | ValidTarget$ Card.Self | ReplaceWith$ Counters | Description$ If damage would be dealt to Phytohydra, put that many +1/+1 counters on it instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ Counters | Description$ If damage would be dealt to Phytohydra, put that many +1/+1 counters on it instead. SVar:Counters:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | CounterNum$ X | References$ X SVar:X:ReplaceCount$DamageAmount SVar:Picture:http://www.wizards.com/global/images/magic/general/phytohydra.jpg diff --git a/res/cardsfolder/p/possessed_portal.txt b/res/cardsfolder/p/possessed_portal.txt index 781188cd38c..37abe653dc8 100644 --- a/res/cardsfolder/p/possessed_portal.txt +++ b/res/cardsfolder/p/possessed_portal.txt @@ -2,7 +2,7 @@ Name:Possessed Portal ManaCost:8 Types:Artifact Text:no text -R:Event$ Draw | ValidPlayer$ Player | Prevent$ True | Description$ If a player would draw a card, that player skips that draw instead. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ Player | Prevent$ True | Description$ If a player would draw a card, that player skips that draw instead. T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigSacrifice | TriggerDescription$ At the beginning of each end step, each player sacrifices a permanent unless he or she discards a card. SVar:TrigSacrifice:DB$ Sacrifice | SacValid$ Permanent | Defined$ You | UnlessCost$ Discard<1/Card> | UnlessPayer$ You | SubAbility$ OppSac SVar:OppSac:DB$ Sacrifice | SacValid$ Permanent | Defined$ Opponent | UnlessCost$ Discard<1/Card> | UnlessPayer$ Opponent diff --git a/res/cardsfolder/p/purity.txt b/res/cardsfolder/p/purity.txt index 4670f37bcf6..4c51e448b59 100644 --- a/res/cardsfolder/p/purity.txt +++ b/res/cardsfolder/p/purity.txt @@ -4,7 +4,7 @@ Types:Creature Elemental Incarnation Text: PT:6/6 K:Flying -R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ GainLife | PreventionEffect$ True | IsCombat$ False | Description$ If noncombat damage would be dealt to you, prevent that damage. You gain life equal to the damage prevented this way. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ You | ReplaceWith$ GainLife | PreventionEffect$ True | IsCombat$ False | Description$ If noncombat damage would be dealt to you, prevent that damage. You gain life equal to the damage prevented this way. SVar:GainLife:AB$GainLife | Cost$ 0 | Defined$ ReplacedTarget | LifeAmount$ X | References$ X SVar:X:ReplaceCount$DamageAmount T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigShuffle | TriggerDescription$ When CARDNAME is put into a graveyard from anywhere, shuffle it into its owner's library. diff --git a/res/cardsfolder/p/pursuit_of_knowledge.txt b/res/cardsfolder/p/pursuit_of_knowledge.txt index 3f442801880..be2cc2afe6c 100644 --- a/res/cardsfolder/p/pursuit_of_knowledge.txt +++ b/res/cardsfolder/p/pursuit_of_knowledge.txt @@ -2,7 +2,7 @@ Name:Pursuit of Knowledge ManaCost:3 W Types:Enchantment Text:no text -R:Event$ Draw | ValidPlayer$ You | Optional$ True | ReplaceWith$ Counter | Description$ If you would draw a card, you may put a study counter on CARDNAME instead. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | Optional$ True | ReplaceWith$ Counter | Description$ If you would draw a card, you may put a study counter on CARDNAME instead. A:AB$Draw | Cost$ SubCounter<3/STUDY> Sac<1/CARDNAME> | NumCards$ 7 | SpellDescription$ Draw seven cards. SVar:Counter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterNum$ 1 | CounterType$ STUDY SVar:RemAIDeck:True diff --git a/res/cardsfolder/p/pyromancers_swath.txt b/res/cardsfolder/p/pyromancers_swath.txt index 0cf75d8d575..b633088bfa0 100644 --- a/res/cardsfolder/p/pyromancers_swath.txt +++ b/res/cardsfolder/p/pyromancers_swath.txt @@ -2,7 +2,7 @@ Name:Pyromancer's Swath ManaCost:2 R Types:Enchantment Text:no text -R:Event$ DamageDone | ValidSource$ Instant.YouCtrl,Sorcery.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgPlus2 | Description$ If an instant or sorcery source you control would deal damage to a creature or player, it deals that much damage plus 2 to that creature or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Instant.YouCtrl,Sorcery.YouCtrl | ValidTarget$ Creature,Player | ReplaceWith$ DmgPlus2 | Description$ If an instant or sorcery source you control would deal damage to a creature or player, it deals that much damage plus 2 to that creature or player instead. SVar:DmgPlus2:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Plus.2 T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigDiscard | TriggerDescription$ At the beginning of each end step, discard your hand. diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index 1ac1eba19e7..21210009882 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -3,8 +3,8 @@ ManaCost:5 U U Types:Creature Shapeshifter Text:no text PT:7/7 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. -SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg diff --git a/res/cardsfolder/r/remote_farm.txt b/res/cardsfolder/r/remote_farm.txt index e1239565d1a..6fadcaf9ada 100644 --- a/res/cardsfolder/r/remote_farm.txt +++ b/res/cardsfolder/r/remote_farm.txt @@ -2,8 +2,9 @@ Name:Remote Farm ManaCost:no cost Types:Land Text:no text -K:CARDNAME enters the battlefield tapped. -K:etbCounter:DEPLETION:2 +K:ETBReplacement:Other:ETBTap +SVar:ETBTap:DB$ Tap | Defined$ Self | SubAbility$ ETBCounters | SpellDescription$ CARDNAME enters the battlefield tapped. CARDNAME enters the battlefield with 2 depletion counters on it. +SVar:ETBCounters:DB$ PutCounter | Defined$ Self | CounterType$ DEPLETION | CounterNum$ 2 A:AB$ Mana | Cost$ T SubCounter<1/DEPLETION> | Produced$ W | Deplete$ DEPLETION | Amount$ 2 | SpellDescription$ Add W W to your mana pool. If there are no depletion counters on CARDNAME, sacrifice it. SVar:RemAIDeck:True SVar:RemRandomDeck:True diff --git a/res/cardsfolder/r/rhox_faithmender.txt b/res/cardsfolder/r/rhox_faithmender.txt index 4184e10b352..b081ac04c29 100644 --- a/res/cardsfolder/r/rhox_faithmender.txt +++ b/res/cardsfolder/r/rhox_faithmender.txt @@ -4,7 +4,7 @@ Types:Creature Rhino Monk Text:no text PT:1/5 K:Lifelink -R:Event$ GainLife | ValidPlayer$ You | ReplaceWith$ GainDouble | Description$ If you would gain life, you gain twice that much life instead. +R:Event$ GainLife | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ GainDouble | Description$ If you would gain life, you gain twice that much life instead. SVar:GainDouble:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X SVar:X:ReplaceCount$LifeGained/Twice SVar:PlayMain1:True diff --git a/res/cardsfolder/s/sages_of_the_anima.txt b/res/cardsfolder/s/sages_of_the_anima.txt index ed9ae86fc49..371cdafd3fa 100644 --- a/res/cardsfolder/s/sages_of_the_anima.txt +++ b/res/cardsfolder/s/sages_of_the_anima.txt @@ -3,7 +3,7 @@ ManaCost:3 G U Types:Creature Elf Wizard Text:no text PT:3/4 -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ Dig | Description$ If you would draw a card, instead reveal the top three cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Dig | Description$ If you would draw a card, instead reveal the top three cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. SVar:Dig:AB$Dig | Cost$ 0 | DigNum$ 3 | Reveal$ True | ChangeNum$ All | ChangeValid$ Creature SVar:RemRandomDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index b7bc2516e14..e05970aaf43 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -4,8 +4,8 @@ Types:Legendary Creature Human Rogue Text:no text PT:3/1 # Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." -SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand diff --git a/res/cardsfolder/s/sakashimas_student.txt b/res/cardsfolder/s/sakashimas_student.txt index adfbfad5459..f24797557c9 100644 --- a/res/cardsfolder/s/sakashimas_student.txt +++ b/res/cardsfolder/s/sakashimas_student.txt @@ -4,8 +4,8 @@ Types:Creature Human Ninja Text:no text PT:0/0 A:AB$ ChangeZone | Cost$ 1 U Return<1/Creature.attacking+unblocked> | CostDesc$ Ninjutsu 1 U | ActivationZone$ Hand | Origin$ Hand | Ninjutsu$ True | Destination$ Battlefield | Defined$ Self | SpellDescription$ (1 U, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. -SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCreature:Optional +SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Ninja SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashimas_student.jpg diff --git a/res/cardsfolder/s/samurai_of_the_pale_curtain.txt b/res/cardsfolder/s/samurai_of_the_pale_curtain.txt index d1eeb45bc80..cf7c26f9c1e 100644 --- a/res/cardsfolder/s/samurai_of_the_pale_curtain.txt +++ b/res/cardsfolder/s/samurai_of_the_pale_curtain.txt @@ -4,7 +4,7 @@ Types:Creature Fox Samurai Text:no text PT:2/2 K:Bushido 1 -R:Event$ Moved | Destination$ Graveyard | ValidCard$ Permanent | ReplaceWith$ Exile | Description$ If a permanent would be put into a graveyard, exile it instead. +R:Event$ Moved | ActiveZones$ Battlefield | Destination$ Graveyard | ValidCard$ Permanent | ReplaceWith$ Exile | Description$ If a permanent would be put into a graveyard, exile it instead. SVar:Exile:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Exile | Defined$ ReplacedCard SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/samurai_of_the_pale_curtain.jpg diff --git a/res/cardsfolder/s/sculpting_steel.txt b/res/cardsfolder/s/sculpting_steel.txt index fc9fe05da3f..95f1b0540d9 100644 --- a/res/cardsfolder/s/sculpting_steel.txt +++ b/res/cardsfolder/s/sculpting_steel.txt @@ -2,8 +2,8 @@ Name:Sculpting Steel ManaCost:3 Types:Artifact Text:no text -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield. -SVar:ChooseArtifact:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseArtifact:Optional +SVar:ChooseArtifact:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield. SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sculpting_steel.jpg diff --git a/res/cardsfolder/s/sekki_seasons_guide.txt b/res/cardsfolder/s/sekki_seasons_guide.txt index 78cd1ecced9..5b7014c2daa 100644 --- a/res/cardsfolder/s/sekki_seasons_guide.txt +++ b/res/cardsfolder/s/sekki_seasons_guide.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Spirit Text:no text PT:0/0 K:etbCounters:P1P1:8 -R:Event$ DamageDone | ValidTarget$ Card.Self | ReplaceWith$ SekkiCounters | PreventionEffect$ True | Description$ If damage would be dealt to Sekki, prevent that damage, remove that many +1/+1 counters from Sekki, and put that many 1/1 colorless Spirit creature tokens onto the battlefield. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ SekkiCounters | PreventionEffect$ True | Description$ If damage would be dealt to Sekki, prevent that damage, remove that many +1/+1 counters from Sekki, and put that many 1/1 colorless Spirit creature tokens onto the battlefield. SVar:SekkiCounters:AB$ RemoveCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ SekkiX | SubAbility$ DBSekkiToken | References$ X SVar:DBSekkiToken:DB$ Token | Cost$ 0 | TokenAmount$ SekkiX | TokenName$ Spirit | TokenTypes$ Creature,Spirit | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | References$ SekkiX A:AB$ ChangeZone | Cost$ Sac<8/Spirit> | Defined$ Self | ActivationZone$ Graveyard | Origin$ Graveyard | Destination$ Battlefield | SpellDescription$ Return Sekki from your graveyard to the battlefield. diff --git a/res/cardsfolder/s/sulfuric_vapors.txt b/res/cardsfolder/s/sulfuric_vapors.txt index abb73c17267..38e16e35f82 100644 --- a/res/cardsfolder/s/sulfuric_vapors.txt +++ b/res/cardsfolder/s/sulfuric_vapors.txt @@ -2,7 +2,7 @@ Name:Sulfuric Vapors ManaCost:3 R Types:Enchantment Text:no text -R:Event$ DamageDone | ValidSource$ Spell.Red | ValidTarget$ Permanent,Player | ReplaceWith$ DmgPlus1 | Description$ If a red spell would deal damage to a permanent or player, it deals that much damage plus 1 to that permanent or player instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Spell.Red | ValidTarget$ Permanent,Player | ReplaceWith$ DmgPlus1 | Description$ If a red spell would deal damage to a permanent or player, it deals that much damage plus 1 to that permanent or player instead. SVar:DmgPlus1:AB$ DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Plus.1 SVar:PlayMain1:TRUE diff --git a/res/cardsfolder/s/sulfuric_vortex.txt b/res/cardsfolder/s/sulfuric_vortex.txt index 6551d9037c1..da1f7a453d8 100644 --- a/res/cardsfolder/s/sulfuric_vortex.txt +++ b/res/cardsfolder/s/sulfuric_vortex.txt @@ -4,7 +4,7 @@ Types:Enchantment Text:no text T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigDmg | TriggerDescription$ At the beginning of each player's upkeep, CARDNAME deals 2 damage to that player. SVar:TrigDmg:AB$DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ 2 -R:Event$ GainLife | Prevent$ True | Description$ If a player would gain life, that player gains no life instead. +R:Event$ GainLife | ActiveZones$ Battlefield | Prevent$ True | Description$ If a player would gain life, that player gains no life instead. SVar:Picture:http://www.wizards.com/global/images/magic/general/sulfuric_vortex.jpg SetInfo:SCG|Rare|http://magiccards.info/scans/en/sc/106.jpg Oracle:At the beginning of each player's upkeep, Sulfuric Vortex deals 2 damage to that player.\nIf a player would gain life, that player gains no life instead. diff --git a/res/cardsfolder/s/szadek_lord_of_secrets.txt b/res/cardsfolder/s/szadek_lord_of_secrets.txt index 63c6bcf36cb..cae4cf13fa5 100644 --- a/res/cardsfolder/s/szadek_lord_of_secrets.txt +++ b/res/cardsfolder/s/szadek_lord_of_secrets.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Vampire Text:no text PT:5/5 K:Flying -R:Event$ DamageDone | CombatDamage$ True | ValidSource$ Card.Self | ValidTarget$ Opponent | ReplaceWith$ CountersAndMill | Description$ If CARDNAME would deal combat damage to a player, instead put that many +1/+1 counters on Szadek and that player puts that many cards from the top of his or her library into his or her graveyard. +R:Event$ DamageDone | ActiveZones$ Battlefield | CombatDamage$ True | ValidSource$ Card.Self | ValidTarget$ Opponent | ReplaceWith$ CountersAndMill | Description$ If CARDNAME would deal combat damage to a player, instead put that many +1/+1 counters on Szadek and that player puts that many cards from the top of his or her library into his or her graveyard. SVar:X:ReplaceCount$DamageAmount SVar:CountersAndMill:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterNum$ X | References$ X | CounterType$ P1P1 | SubAbility$ Mill SVar:Mill:DB$ Mill | Cost$ 0 | Defined$ ReplacedTarget | NumCards$ X | References$ X diff --git a/res/cardsfolder/t/thought_reflection.txt b/res/cardsfolder/t/thought_reflection.txt index 27944c25cb1..cc2a5b59b85 100644 --- a/res/cardsfolder/t/thought_reflection.txt +++ b/res/cardsfolder/t/thought_reflection.txt @@ -2,7 +2,7 @@ Name:Thought Reflection ManaCost:4 U U U Types:Enchantment Text:no text -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ DrawTwo | Description$ If you would draw a card, draw two cards instead. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ DrawTwo | Description$ If you would draw a card, draw two cards instead. SVar:DrawTwo:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 2 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/thought_reflection.jpg diff --git a/res/cardsfolder/t/tomorrow_azamis_familiar.txt b/res/cardsfolder/t/tomorrow_azamis_familiar.txt index 3451e0e8146..1aa076efed0 100644 --- a/res/cardsfolder/t/tomorrow_azamis_familiar.txt +++ b/res/cardsfolder/t/tomorrow_azamis_familiar.txt @@ -3,7 +3,7 @@ ManaCost:5 U Types:Legendary Creature Spirit Text:no text PT:1/5 -R:Event$ Draw | ValidPlayer$ You | ReplaceWith$ Dig | Description$ If you would draw a card, look at the top three cards of your library instead. Put one of those cards into your hand and the rest on the bottom of your library in any order. +R:Event$ Draw | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Dig | Description$ If you would draw a card, look at the top three cards of your library instead. Put one of those cards into your hand and the rest on the bottom of your library in any order. SVar:Dig:AB$Dig | Cost$ 0 | DigNum$ 3 SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/u/undead_alchemist.txt b/res/cardsfolder/u/undead_alchemist.txt index fe3dc4b963d..2e53224cc01 100644 --- a/res/cardsfolder/u/undead_alchemist.txt +++ b/res/cardsfolder/u/undead_alchemist.txt @@ -3,7 +3,7 @@ ManaCost:3 U Types:Creature Zombie Text:no text PT:4/2 -R:Event$ DamageDone | ValidSource$ Creature.Zombie+YouCtrl | ValidTarget$ Opponent | ReplaceWith$ Mill | IsCombat$ True | Description$ If a Zombie you control would deal combat damage to a player, instead that player puts that many cards from the top of his or her library into his or her graveyard. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.Zombie+YouCtrl | ValidTarget$ Opponent | ReplaceWith$ Mill | IsCombat$ True | Description$ If a Zombie you control would deal combat damage to a player, instead that player puts that many cards from the top of his or her library into his or her graveyard. SVar:Mill:AB$Mill | Cost$ 0 | Defined$ ReplacedTarget | NumCards$ X | References$ X SVar:X:ReplaceCount$DamageAmount T:Mode$ ChangesZone | ValidCard$ Creature.YouDontOwn | Origin$ Library | Destination$ Graveyard | Execute$ ExileAndToken | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature card is put into an opponent's graveyard from his or her library, exile that card and put a 2/2 black Zombie creature token onto the battlefield. diff --git a/res/cardsfolder/v/vesuva.txt b/res/cardsfolder/v/vesuva.txt index 1659b7b8908..d8b65c9a6b2 100644 --- a/res/cardsfolder/v/vesuva.txt +++ b/res/cardsfolder/v/vesuva.txt @@ -2,8 +2,8 @@ Name:Vesuva ManaCost:no cost Types:Land Text:no text -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseLand | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. -SVar:ChooseLand:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseLand:Optional +SVar:ChooseLand:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuva.jpg diff --git a/res/cardsfolder/v/vesuvan_doppelganger.txt b/res/cardsfolder/v/vesuvan_doppelganger.txt index c6318837d32..166efa70f3f 100644 --- a/res/cardsfolder/v/vesuvan_doppelganger.txt +++ b/res/cardsfolder/v/vesuvan_doppelganger.txt @@ -4,8 +4,8 @@ Types:Creature Shapeshifter Text:no text PT:0/0 # Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." -SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +K:ETBReplacement:Copy:ChooseCard:Optional +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." SVar:DBCopy:DB$ Clone | Defined$ Remembered | Colors$ Blue | OverwriteColors$ True | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig SVar:VesDopUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ VesDopCopy | TriggerDescription$ At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability. SVar:VesDopCopy:AB$ Clone | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig | SubAbility$ DBCleanup diff --git a/res/cardsfolder/v/veteran_bodyguard.txt b/res/cardsfolder/v/veteran_bodyguard.txt index 2fabc70aa03..425b601d71e 100644 --- a/res/cardsfolder/v/veteran_bodyguard.txt +++ b/res/cardsfolder/v/veteran_bodyguard.txt @@ -3,8 +3,8 @@ ManaCost:3 W W Types:Creature Human Text:no text PT:2/5 -R:Event$ DamageDone | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ False | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. -R:Event$ DamageDone | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelfCombat | IsCombat$ True | IsPresent$ Card.Self+untapped | Secondary$ True | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ False | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelfCombat | IsCombat$ True | IsPresent$ Card.Self+untapped | Secondary$ True | Description$ As long as CARDNAME is untapped, all damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. SVar:DmgSelf:AB$DealDamage | Cost$ 0 | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:DmgSelfCombat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/v/vigor.txt b/res/cardsfolder/v/vigor.txt index 5d3dc8d2350..de3286260ba 100644 --- a/res/cardsfolder/v/vigor.txt +++ b/res/cardsfolder/v/vigor.txt @@ -4,7 +4,7 @@ Types:Creature Elemental Incarnation Text:no text PT:6/6 K:Trample -R:Event$ DamageDone | ValidTarget$ Creature.YouCtrl+Other | ReplaceWith$ Counters | PreventionEffect$ True | Description$ If damage would be dealt to a creature you control other than CARDNAME, prevent that damage. Put a +1/+1 counter on that creature for each 1 damage prevented this way. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Creature.YouCtrl+Other | ReplaceWith$ Counters | PreventionEffect$ True | Description$ If damage would be dealt to a creature you control other than CARDNAME, prevent that damage. Put a +1/+1 counter on that creature for each 1 damage prevented this way. SVar:Counters:AB$PutCounter | Cost$ 0 | Defined$ ReplacedTarget | CounterType$ P1P1 | CounterNum$ X | References$ X SVar:X:ReplaceCount$DamageAmount T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigShuffle | TriggerDescription$ When CARDNAME is put into a graveyard from anywhere, shuffle it into its owner's library. diff --git a/res/cardsfolder/w/weathered_bodyguards.txt b/res/cardsfolder/w/weathered_bodyguards.txt index bbb7f45bfec..41e338a10ff 100644 --- a/res/cardsfolder/w/weathered_bodyguards.txt +++ b/res/cardsfolder/w/weathered_bodyguards.txt @@ -4,7 +4,7 @@ Types:Creature Human Soldier Text:no text PT:2/5 K:Morph:3 W -R:Event$ DamageDone | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ True | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all combat damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. +R:Event$ DamageDone | ActiveZones$ Battlefield | ValidSource$ Creature.unblocked | ValidTarget$ You | ReplaceWith$ DmgSelf | IsCombat$ True | IsPresent$ Card.Self+untapped | Description$ As long as CARDNAME is untapped, all combat damage that would be dealt to you by unblocked creatures is dealt to CARDNAME instead. SVar:DmgSelf:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Self | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount SVar:Rarity:Rare diff --git a/res/cardsfolder/w/wheel_of_sun_and_moon.txt b/res/cardsfolder/w/wheel_of_sun_and_moon.txt index a4963daad5e..8d39bdfd303 100644 --- a/res/cardsfolder/w/wheel_of_sun_and_moon.txt +++ b/res/cardsfolder/w/wheel_of_sun_and_moon.txt @@ -4,7 +4,7 @@ Types:Enchantment Aura Text:no text K:Enchant player A:SP$ Attach | Cost$ GW GW | ValidTgts$ Player -R:Event$ Moved | Destination$ Graveyard | ValidCard$ Card.OwnedBy Player.EnchantedBy | ReplaceWith$ Reveal | Description$ If a card would be put into enchanted player's graveyard from anywhere, instead that card is revealed and put on the bottom of that player's library. +R:Event$ Moved | ActiveZones$ Battlefield | Destination$ Graveyard | ValidCard$ Card.OwnedBy Player.EnchantedBy | ReplaceWith$ Reveal | Description$ If a card would be put into enchanted player's graveyard from anywhere, instead that card is revealed and put on the bottom of that player's library. SVar:Reveal:AB$ ChangeZone | Cost$ 0 | Hidden$ True | Destination$ Library | Defined$ ReplacedCard | LibraryPosition$ -1 | Reveal$ True SVar:RemRandomDeck:True SVar:Rarity:Rare diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 8250bc49102..5a4c64b18fb 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -41,6 +41,7 @@ import forge.card.cardfactory.CardFactoryUtil; import forge.card.cost.Cost; import forge.card.mana.ManaCost; import forge.card.replacement.ReplacementEffect; +import forge.card.replacement.ReplacementResult; import forge.card.spellability.AbilityMana; import forge.card.spellability.AbilityTriggered; import forge.card.spellability.Spell; @@ -2322,6 +2323,8 @@ public class Card extends GameEntity implements Comparable { sbLong.append("defending player controls untap and block it if able.)"); } else if (keyword.get(i).startsWith("MayEffectFromOpeningHand")) { continue; + } else if (keyword.get(i).startsWith("ETBReplacement")) { + continue; } else if (keyword.get(i).contains("Haunt")) { sb.append("\r\nHaunt ("); if (this.isCreature()) { @@ -5079,6 +5082,9 @@ public class Card extends GameEntity implements Comparable { *

*/ public final void untap() { + if(getName().equals("Remote Farm")) { + System.out.println("HE TOUCHED ME"); + } if (this.isTapped()) { // Run triggers final Map runParams = new TreeMap(); @@ -8065,7 +8071,7 @@ public class Card extends GameEntity implements Comparable { repParams.put("IsCombat", isCombat); repParams.put("Prevention", true); - if (AllZone.getReplacementHandler().run(repParams)) { + if (AllZone.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) { return 0; } @@ -8192,7 +8198,7 @@ public class Card extends GameEntity implements Comparable { repParams.put("DamageAmount", damageIn); repParams.put("IsCombat", isCombat); - if (AllZone.getReplacementHandler().run(repParams)) { + if (AllZone.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) { return 0; } diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 944f832411d..1a67c6e2365 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -33,6 +33,7 @@ import forge.card.cost.Cost; import forge.card.cost.CostPayment; import forge.card.mana.ManaCost; import forge.card.mana.ManaCostShard; +import forge.card.replacement.ReplacementResult; import forge.card.spellability.Ability; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilityStatic; @@ -128,8 +129,9 @@ public class GameAction { repParams.put("Origin", zoneFrom != null ? zoneFrom.getZoneType() : null); repParams.put("Destination", zoneTo.getZoneType()); - if (AllZone.getReplacementHandler().run(repParams)) { - if (AllZone.getStack().isResolving(c) && !zoneTo.is(ZoneType.Graveyard)) { + ReplacementResult repres = AllZone.getReplacementHandler().run(repParams); + if (repres != ReplacementResult.NotReplaced) { + if (AllZone.getStack().isResolving(c) && !zoneTo.is(ZoneType.Graveyard) && repres == ReplacementResult.Prevented) { return Singletons.getModel().getGameAction().moveToGraveyard(c); } return c; diff --git a/src/main/java/forge/card/CardCharacteristics.java b/src/main/java/forge/card/CardCharacteristics.java index 5ff3ba9feb1..d0a5f7f6354 100644 --- a/src/main/java/forge/card/CardCharacteristics.java +++ b/src/main/java/forge/card/CardCharacteristics.java @@ -488,6 +488,11 @@ public class CardCharacteristics { this.sVars = new TreeMap(source.getSVars()); // String curSetCode = ""; this.curSetCode = source.getCurSetCode(); + + this.replacementEffects = new ArrayList(); + for(ReplacementEffect RE : source.getReplacementEffects()) { + this.replacementEffects.add(RE.getCopy()); + } } /** diff --git a/src/main/java/forge/card/TriggerReplacementBase.java b/src/main/java/forge/card/TriggerReplacementBase.java index a31114a9e02..387151ff651 100644 --- a/src/main/java/forge/card/TriggerReplacementBase.java +++ b/src/main/java/forge/card/TriggerReplacementBase.java @@ -1,7 +1,12 @@ package forge.card; +import java.util.EnumSet; + import forge.Card; import forge.GameEntity; +import forge.card.spellability.SpellAbility; +import forge.game.zone.PlayerZone; +import forge.game.zone.ZoneType; /** * Base class for Triggers and ReplacementEffects. @@ -9,6 +14,75 @@ import forge.GameEntity; * */ public abstract class TriggerReplacementBase { + + /** The host card. */ + protected Card hostCard; + + /** + *

+ * Getter for the field hostCard. + *

+ * + * @return a {@link forge.Card} object. + */ + public final Card getHostCard() { + return this.hostCard; + } + + /** + *

+ * Setter for the field hostCard. + *

+ * + * @param c + * a {@link forge.Card} object. + */ + public final void setHostCard(final Card c) { + this.hostCard = c; + } + + protected EnumSet validHostZones; + + public void setActiveZone(EnumSet zones) { + validHostZones = zones; + } + + /** + *

+ * zonesCheck. + *

+ * + * @return a boolean. + */ + public final boolean zonesCheck(PlayerZone hostCardZone) { + return !this.hostCard.isPhasedOut() + && (validHostZones == null || validHostZones.isEmpty() + || (hostCardZone != null && validHostZones.contains(hostCardZone.getZoneType())) + ); + } + + /** The overriding ability. */ + private SpellAbility overridingAbility = null; + + /** + * Gets the overriding ability. + * + * @return the overridingAbility + */ + public SpellAbility getOverridingAbility() { + return this.overridingAbility; + } + + /** + * Sets the overriding ability. + * + * @param overridingAbility0 + * the overridingAbility to set + */ + public void setOverridingAbility(final SpellAbility overridingAbility0) { + this.overridingAbility = overridingAbility0; + } + /** *

* matchesValid. diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index 9f46d095b20..9029d883ee5 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -2823,6 +2823,10 @@ public class AbilityFactory { final AbilityFactory af = sa.getAbilityFactory(); if (af == null) { sa.resolve(); + if(sa.getSubAbility() != null) + { + resolve(sa.getSubAbility(),usedStack); + } return; } final HashMap params = af.getMapParams(); diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java index edabf20b7d3..649ea73a505 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java @@ -1228,7 +1228,7 @@ public class AbilityFactoryPermanentState { } for (final Card tgtC : tgtCards) { - if (AllZoneUtil.isCardInPlay(tgtC) && ((tgt == null) || tgtC.canBeTargetedBy(sa))) { + if ((AllZoneUtil.isCardInPlay(tgtC) || AllZone.getZoneOf(tgtC).is(ZoneType.Stack)) && ((tgt == null) || tgtC.canBeTargetedBy(sa))) { if (tgtC.isUntapped() && (remTapped)) { card.addRemembered(tgtC); } diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index e69868f9b83..5150721221d 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -27,6 +27,7 @@ import com.esotericsoftware.minlog.Log; import forge.AllZone; import forge.AllZoneUtil; import forge.Card; +import forge.CardCharacteristicName; import forge.CardList; import forge.CardListFilter; import forge.CardUtil; @@ -36,6 +37,9 @@ import forge.Counters; import forge.Singletons; import forge.card.abilityfactory.AbilityFactory; import forge.card.cost.Cost; +import forge.card.replacement.ReplacementEffect; +import forge.card.replacement.ReplacementHandler; +import forge.card.replacement.ReplacementLayer; import forge.card.spellability.Ability; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilityStatic; @@ -1476,6 +1480,47 @@ public class CardFactoryCreatures { card.addSpellAbility(finalAb); } + + private static void getCard_EssenceOfTheWild(final Card card,final String cardName) { + class EOTWReplacement extends Ability { + + /** + * TODO: Write javadoc for Constructor. + * @param sourceCard + * @param manaCost + */ + public EOTWReplacement(Card sourceCard, String manaCost) { + super(sourceCard, manaCost); + } + + /* (non-Javadoc) + * @see forge.card.spellability.SpellAbility#resolve() + */ + @Override + public void resolve() { + Card movedCard = (Card)this.getReplacingObject("Card"); + if (movedCard.isCloned()) { // cloning again + movedCard.switchStates(CardCharacteristicName.Cloner, CardCharacteristicName.Original); + movedCard.setState(CardCharacteristicName.Original); + movedCard.clearStates(CardCharacteristicName.Cloner); + } + movedCard.addAlternateState(CardCharacteristicName.Cloner); + movedCard.switchStates(CardCharacteristicName.Original, CardCharacteristicName.Cloner); + movedCard.setState(CardCharacteristicName.Original); + movedCard.getCharacteristics().copy(this.getSourceCard().getCharacteristics()); + } + + } + + SpellAbility repAb = new EOTWReplacement(card,"0"); + CardFactoryUtil.setupETBReplacementAbility(repAb); + + ReplacementEffect re = ReplacementHandler.parseReplacement("Event$ Moved | ValidCard$ Creature.Other+YouCtrl | Destination$ Battlefield | ActiveZones$ Battlefield | Description$ Creatures you control enter the battlefield as copies of CARDNAME.", card); + re.setLayer(ReplacementLayer.Copy); + re.setOverridingAbility(repAb); + + card.addReplacementEffect(re); + } // // This is a hardcoded card template // @@ -1532,7 +1577,10 @@ public class CardFactoryCreatures { } else if (cardName.equals("Duct Crawler") || cardName.equals("Shrewd Hatchling") || cardName.equals("Spin Engine") || cardName.equals("Screeching Griffin")) { getCard_DuctCrawler(card, cardName); + } else if (cardName.equals("Essence of the Wild")) { + getCard_EssenceOfTheWild(card, cardName); } + // *************************************************** // end of card specific code diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 6e4ab80a58f..b0802b1a738 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -46,10 +46,14 @@ import forge.card.abilityfactory.AbilityFactory; import forge.card.cost.Cost; import forge.card.mana.ManaCost; import forge.card.mana.ManaCostShard; +import forge.card.replacement.ReplacementEffect; +import forge.card.replacement.ReplacementHandler; +import forge.card.replacement.ReplacementLayer; import forge.card.spellability.Ability; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilityMana; import forge.card.spellability.AbilityStatic; +import forge.card.spellability.AbilitySub; import forge.card.spellability.Spell; import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbilityRestriction; @@ -4807,9 +4811,89 @@ public class CardFactoryUtil { // add ability to instrinic strings so copies/clones create the ability also card.getIntrinsicAbilities().add(abilityStr.toString()); } + + final int etbrep = CardFactoryUtil.hasKeyword(card, "ETBReplacement"); + if (etbrep != -1) + { + String fullkw = card.getKeyword().get(etbrep); + card.getKeyword().remove(etbrep); + String[] splitkw = fullkw.split(":"); + ReplacementLayer layer = ReplacementLayer.smartValueOf(splitkw[1]); + AbilityFactory af = new AbilityFactory(); + SpellAbility repAb = af.getAbility(card.getSVar(splitkw[2]), card); + String desc = repAb.getDescription(); + setupETBReplacementAbility(repAb); + + String repeffstr = "Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | Description$ " + desc; + if(splitkw.length == 4) { + if(splitkw[3].contains("Optional")) { + repeffstr += " | OptionalDecider$ You"; + } + } + + ReplacementEffect re = ReplacementHandler.parseReplacement(repeffstr, card); + re.setLayer(layer); + re.setOverridingAbility(repAb); + + card.addReplacementEffect(re); + } return card; } + + public static void setupETBReplacementAbility(SpellAbility sa) { + SpellAbility tailend = sa; + while(tailend.getSubAbility() != null) { + tailend = tailend.getSubAbility(); + } + + class ETBReplacementMove extends AbilitySub { + private static final long serialVersionUID = 704771599662730112L; + + /** + * TODO: Write javadoc for Constructor. + * @param sourceCard + * @param tgt + */ + public ETBReplacementMove(Card sourceCard, Target tgt) { + super(sourceCard, tgt); + } + + @Override + public void resolve() { + forge.Singletons.getModel().getGameAction().moveToPlay(((Card)this.getReplacingObject("Card"))); + } + + /* (non-Javadoc) + * @see forge.card.spellability.AbilitySub#chkAIDrawback() + */ + @Override + public boolean chkAIDrawback() { + return false; + } + + /* (non-Javadoc) + * @see forge.card.spellability.AbilitySub#getCopy() + */ + @Override + public AbilitySub getCopy() { + // TODO Auto-generated method stub + return new ETBReplacementMove(getSourceCard(),null); + } + + /* (non-Javadoc) + * @see forge.card.spellability.AbilitySub#doTrigger(boolean) + */ + @Override + public boolean doTrigger(boolean mandatory) { + // TODO Auto-generated method stub + return false; + } + + } + + tailend.setSubAbility(new ETBReplacementMove(sa.getSourceCard(),null)); + } /** *

diff --git a/src/main/java/forge/card/replacement/ReplaceDamage.java b/src/main/java/forge/card/replacement/ReplaceDamage.java index e0587d9965a..895a80048ab 100644 --- a/src/main/java/forge/card/replacement/ReplaceDamage.java +++ b/src/main/java/forge/card/replacement/ReplaceDamage.java @@ -100,7 +100,11 @@ public class ReplaceDamage extends ReplacementEffect { */ @Override public ReplacementEffect getCopy() { - return new ReplaceDamage(this.getMapParams(), this.getHostCard()); + ReplacementEffect res = new ReplaceDamage(this.getMapParams(), this.getHostCard()); + res.setOverridingAbility(this.getOverridingAbility()); + res.setActiveZone(validHostZones); + res.setLayer(getLayer()); + return res; } /* (non-Javadoc) diff --git a/src/main/java/forge/card/replacement/ReplaceDraw.java b/src/main/java/forge/card/replacement/ReplaceDraw.java index 63774a3d1c2..5b326e53d33 100644 --- a/src/main/java/forge/card/replacement/ReplaceDraw.java +++ b/src/main/java/forge/card/replacement/ReplaceDraw.java @@ -59,7 +59,11 @@ public class ReplaceDraw extends ReplacementEffect { */ @Override public ReplacementEffect getCopy() { - return new ReplaceDraw(this.getMapParams(), getHostCard()); + ReplacementEffect res = new ReplaceDraw(this.getMapParams(), this.getHostCard()); + res.setOverridingAbility(this.getOverridingAbility()); + res.setActiveZone(validHostZones); + res.setLayer(getLayer()); + return res; } } diff --git a/src/main/java/forge/card/replacement/ReplaceGainLife.java b/src/main/java/forge/card/replacement/ReplaceGainLife.java index ed83b6ed3a6..0de246e5061 100644 --- a/src/main/java/forge/card/replacement/ReplaceGainLife.java +++ b/src/main/java/forge/card/replacement/ReplaceGainLife.java @@ -60,7 +60,11 @@ public class ReplaceGainLife extends ReplacementEffect { */ @Override public ReplacementEffect getCopy() { - return new ReplaceGainLife(this.getMapParams(), getHostCard()); + ReplacementEffect res = new ReplaceGainLife(this.getMapParams(), this.getHostCard()); + res.setOverridingAbility(this.getOverridingAbility()); + res.setActiveZone(validHostZones); + res.setLayer(getLayer()); + return res; } /* (non-Javadoc) diff --git a/src/main/java/forge/card/replacement/ReplaceGameLoss.java b/src/main/java/forge/card/replacement/ReplaceGameLoss.java index 96a2b5ed06d..50ee58f7f97 100644 --- a/src/main/java/forge/card/replacement/ReplaceGameLoss.java +++ b/src/main/java/forge/card/replacement/ReplaceGameLoss.java @@ -42,7 +42,11 @@ public class ReplaceGameLoss extends ReplacementEffect { */ @Override public ReplacementEffect getCopy() { - return new ReplaceGameLoss(this.getMapParams(), getHostCard()); + ReplacementEffect res = new ReplaceGameLoss(this.getMapParams(), this.getHostCard()); + res.setOverridingAbility(this.getOverridingAbility()); + res.setActiveZone(validHostZones); + res.setLayer(getLayer()); + return res; } } diff --git a/src/main/java/forge/card/replacement/ReplaceMoved.java b/src/main/java/forge/card/replacement/ReplaceMoved.java index 7ec52ca31e0..25ac2efc47f 100644 --- a/src/main/java/forge/card/replacement/ReplaceMoved.java +++ b/src/main/java/forge/card/replacement/ReplaceMoved.java @@ -56,7 +56,11 @@ public class ReplaceMoved extends ReplacementEffect { */ @Override public ReplacementEffect getCopy() { - return new ReplaceMoved(this.getMapParams(), this.getHostCard()); + ReplacementEffect res = new ReplaceMoved(this.getMapParams(), this.getHostCard()); + res.setOverridingAbility(this.getOverridingAbility()); + res.setActiveZone(validHostZones); + res.setLayer(getLayer()); + return res; } /* (non-Javadoc) diff --git a/src/main/java/forge/card/replacement/ReplacementEffect.java b/src/main/java/forge/card/replacement/ReplacementEffect.java index b689164e809..a378e09eb10 100644 --- a/src/main/java/forge/card/replacement/ReplacementEffect.java +++ b/src/main/java/forge/card/replacement/ReplacementEffect.java @@ -35,6 +35,8 @@ import forge.game.zone.ZoneType; */ public abstract class ReplacementEffect extends TriggerReplacementBase { + private ReplacementLayer layer = ReplacementLayer.None; + /** The has run. */ private boolean hasRun = false; @@ -135,32 +137,6 @@ public abstract class ReplacementEffect extends TriggerReplacementBase { this.mapParams = mapParams; } - /** The host card. */ - private Card hostCard; - - /** - *

- * Getter for the field hostCard. - *

- * - * @return a {@link forge.Card} object. - */ - public final Card getHostCard() { - return this.hostCard; - } - - /** - *

- * Setter for the field hostCard. - *

- * - * @param c - * a {@link forge.Card} object. - */ - public final void setHostCard(final Card c) { - this.hostCard = c; - } - /** * Can replace. * @@ -415,4 +391,18 @@ public abstract class ReplacementEffect extends TriggerReplacementBase { this.setMapParams(map); this.setHostCard(host); } + + /** + * @return the layer + */ + public ReplacementLayer getLayer() { + return layer; + } + + /** + * @param layer0 the layer to set + */ + public void setLayer(ReplacementLayer layer0) { + this.layer = layer0; + } } diff --git a/src/main/java/forge/card/replacement/ReplacementHandler.java b/src/main/java/forge/card/replacement/ReplacementHandler.java index 09ed76c75e6..075376aa8d1 100644 --- a/src/main/java/forge/card/replacement/ReplacementHandler.java +++ b/src/main/java/forge/card/replacement/ReplacementHandler.java @@ -18,6 +18,7 @@ package forge.card.replacement; import java.util.ArrayList; +import java.util.EnumSet; import java.util.HashMap; import java.util.List; @@ -40,17 +41,8 @@ public class ReplacementHandler { private final List tmpEffects = new ArrayList(); - /** - * - * Runs any applicable replacement effects. - * - * @param runParams - * the run params,same as for triggers. - * @return true if the event was replaced. - */ - public boolean run(final HashMap runParams) { + public ReplacementResult run(final HashMap runParams) { final Object affected = runParams.get("Affected"); - final List possibleReplacers = new ArrayList(); Player decider = null; // Figure out who decides which of multiple replacements to apply @@ -60,21 +52,66 @@ public class ReplacementHandler { } else { decider = ((Card) affected).getController(); } + + + if(runParams.get("Event").equals("Moved")) { + ReplacementResult res = run(runParams,ReplacementLayer.Control,decider); + if(res != ReplacementResult.NotReplaced) { + return res; + } + res = run(runParams,ReplacementLayer.Copy,decider); + if(res != ReplacementResult.NotReplaced) { + return res; + } + res = run(runParams,ReplacementLayer.Other,decider); + if(res != ReplacementResult.NotReplaced) { + return res; + } + res = run(runParams,ReplacementLayer.None,decider); + if(res != ReplacementResult.NotReplaced) { + return res; + } + } + else { + ReplacementResult res = run(runParams,ReplacementLayer.None,decider); + if(res != ReplacementResult.NotReplaced) { + return res; + } + } + + return ReplacementResult.NotReplaced; + + } + + /** + * + * Runs any applicable replacement effects. + * + * @param runParams + * the run params,same as for triggers. + * @return true if the event was replaced. + */ + public ReplacementResult run(final HashMap runParams, final ReplacementLayer layer,final Player decider) { + + final List possibleReplacers = new ArrayList(); + if(layer == ReplacementLayer.Other && ((String)runParams.get("Event")).equals("Moved")) { + System.out.println("Shdf"); + } // Round up Non-static replacement effects ("Until EOT," or // "The next time you would..." etc) for (final ReplacementEffect replacementEffect : this.tmpEffects) { - if (!replacementEffect.hasRun() && replacementEffect.canReplace(runParams)) { + if (!replacementEffect.hasRun() && replacementEffect.canReplace(runParams) && replacementEffect.getLayer() == layer) { possibleReplacers.add(replacementEffect); } } // Round up Static replacement effects for (final Player p : AllZone.getPlayersInGame()) { - for (final Card crd : p.getCardsIn(ZoneType.Battlefield)) { + for (final Card crd : p.getAllCards()) { for (final ReplacementEffect replacementEffect : crd.getReplacementEffects()) { if (replacementEffect.requirementsCheck()) { - if (!replacementEffect.hasRun() && replacementEffect.canReplace(runParams)) { + if (!replacementEffect.hasRun() && replacementEffect.canReplace(runParams) && replacementEffect.getLayer() == layer && replacementEffect.zonesCheck(AllZone.getZoneOf(crd))) { possibleReplacers.add(replacementEffect); } } @@ -83,7 +120,7 @@ public class ReplacementHandler { } if (possibleReplacers.isEmpty()) { - return false; + return ReplacementResult.NotReplaced; } ReplacementEffect chosenRE = null; @@ -106,23 +143,24 @@ public class ReplacementHandler { possibleReplacers.remove(chosenRE); if (chosenRE != null) { - chosenRE.setHasRun(true); - if (this.executeReplacement(runParams, chosenRE, decider)) { + chosenRE.setHasRun(true); + ReplacementResult res = this.executeReplacement(runParams, chosenRE, decider); + if (res != ReplacementResult.NotReplaced) { chosenRE.setHasRun(false); AllZone.getGameLog().add("ReplacementEffect", chosenRE.toString(), 2); - return true; + return res; } else { if (possibleReplacers.size() == 0) { - return false; + return res; } else { - boolean ret = run(runParams); + ReplacementResult ret = run(runParams); chosenRE.setHasRun(false); return ret; } } } else { - return false; + return ReplacementResult.NotReplaced; } } @@ -134,9 +172,11 @@ public class ReplacementHandler { * @param replacementEffect * the replacement effect to run */ - private boolean executeReplacement(final HashMap runParams, + private ReplacementResult executeReplacement(final HashMap runParams, final ReplacementEffect replacementEffect, final Player decider) { - + if(replacementEffect.getHostCard().getName().equals("Clone")) { + System.out.println("And here we go."); + } final HashMap mapParams = replacementEffect.getMapParams(); SpellAbility effectSA = null; @@ -149,7 +189,21 @@ public class ReplacementHandler { effectSA = abilityFactory.getAbility(effectAbString, replacementEffect.getHostCard()); - replacementEffect.setReplacingObjects(runParams, effectSA); + SpellAbility tailend = effectSA; + do + { + replacementEffect.setReplacingObjects(runParams, tailend); + tailend = tailend.getSubAbility(); + } while(tailend != null); + } + else if (replacementEffect.getOverridingAbility() != null) { + effectSA = replacementEffect.getOverridingAbility(); + SpellAbility tailend = effectSA; + do + { + replacementEffect.setReplacingObjects(runParams, tailend); + tailend = tailend.getSubAbility(); + } while(tailend != null); } // Decider gets to choose wether or not to apply the replacement. @@ -168,19 +222,19 @@ public class ReplacementHandler { buildQuestion.append(replacementEffect.toString()); buildQuestion.append(")"); if (!GameActionUtil.showYesNoDialog(replacementEffect.getHostCard(), buildQuestion.toString())) { - return false; + return ReplacementResult.NotReplaced; } } else { // AI-logic if (!replacementEffect.aiShouldRun(effectSA)) { - return false; + return ReplacementResult.NotReplaced; } } } if (mapParams.containsKey("Prevent")) { if (mapParams.get("Prevent").equals("True")) { - return true; // Nothing should replace the event. + return ReplacementResult.Prevented; // Nothing should replace the event. } } @@ -190,7 +244,7 @@ public class ReplacementHandler { ComputerUtil.playNoStack(effectSA); } - return true; + return ReplacementResult.Replaced; } /** @@ -235,6 +289,11 @@ public class ReplacementHandler { } else if (eventToReplace.equals("Moved")) { ret = new ReplaceMoved(mapParams, host); } + + String activeZones = mapParams.get("ActiveZones"); + if (null != activeZones) { + ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(activeZones))); + } return ret; } diff --git a/src/main/java/forge/card/replacement/ReplacementLayer.java b/src/main/java/forge/card/replacement/ReplacementLayer.java new file mode 100644 index 00000000000..2f215b7c2c1 --- /dev/null +++ b/src/main/java/forge/card/replacement/ReplacementLayer.java @@ -0,0 +1,32 @@ +package forge.card.replacement; + +import forge.CardCharacteristicName; + +/** + * TODO: Write javadoc for this type. + * + */ +public enum ReplacementLayer { + Control, + Copy, + Other, + None; + + /** + * TODO: Write javadoc for this method. + * @param substring + * @return + */ + public static ReplacementLayer smartValueOf(String value) { + if (value == null) { + return null; + } + final String valToCompate = value.trim(); + for (final ReplacementLayer v : ReplacementLayer.values()) { + if (v.name().compareToIgnoreCase(valToCompate) == 0) { + return v; + } + } + throw new IllegalArgumentException("No element named " + value + " in enum ReplacementLayer"); + } +} diff --git a/src/main/java/forge/card/replacement/ReplacementResult.java b/src/main/java/forge/card/replacement/ReplacementResult.java new file mode 100644 index 00000000000..62bb04d0e38 --- /dev/null +++ b/src/main/java/forge/card/replacement/ReplacementResult.java @@ -0,0 +1,11 @@ +package forge.card.replacement; + +/** + * TODO: Write javadoc for this type. + * + */ +public enum ReplacementResult { + Replaced, + NotReplaced, + Prevented; +} diff --git a/src/main/java/forge/card/trigger/Trigger.java b/src/main/java/forge/card/trigger/Trigger.java index 8220bf4c4a4..10b9a28150d 100644 --- a/src/main/java/forge/card/trigger/Trigger.java +++ b/src/main/java/forge/card/trigger/Trigger.java @@ -127,8 +127,7 @@ public abstract class Trigger extends TriggerReplacementBase { private TriggerType mode; - /** The overriding ability. */ - private SpellAbility overridingAbility = null; + private HashMap storedTriggeredObjects = null; @@ -157,32 +156,6 @@ public abstract class Trigger extends TriggerReplacementBase { return this.storedTriggeredObjects; } - /** The host card. */ - private Card hostCard; - - /** - *

- * Getter for the field hostCard. - *

- * - * @return a {@link forge.Card} object. - */ - public final Card getHostCard() { - return this.hostCard; - } - - /** - *

- * Setter for the field hostCard. - *

- * - * @param c - * a {@link forge.Card} object. - */ - public final void setHostCard(final Card c) { - this.hostCard = c; - } - /** The is intrinsic. */ private boolean isIntrinsic; @@ -251,20 +224,6 @@ public abstract class Trigger extends TriggerReplacementBase { } } - /** - *

- * zonesCheck. - *

- * - * @return a boolean. - */ - public final boolean zonesCheck(PlayerZone hostCardZone) { - return !this.getHostCard().isPhasedOut() - && (validHostZones == null || validHostZones.isEmpty() - || (hostCardZone != null && validHostZones.contains(hostCardZone.getZoneType())) - ); - } - /** *

* phasesCheck. @@ -560,7 +519,7 @@ public abstract class Trigger extends TriggerReplacementBase { /** The temporary. */ private boolean temporary = false; - private EnumSet validHostZones; + /** * Sets the temporary. @@ -619,25 +578,6 @@ public abstract class Trigger extends TriggerReplacementBase { this.runParams = runParams0; } - /** - * Gets the overriding ability. - * - * @return the overridingAbility - */ - public SpellAbility getOverridingAbility() { - return this.overridingAbility; - } - - /** - * Sets the overriding ability. - * - * @param overridingAbility0 - * the overridingAbility to set - */ - public void setOverridingAbility(final SpellAbility overridingAbility0) { - this.overridingAbility = overridingAbility0; - } - /** * Gets the id. * @@ -683,18 +623,13 @@ public abstract class Trigger extends TriggerReplacementBase { copy.setID(this.getId()); copy.setMode(this.getMode()); copy.setTriggerPhases(this.validPhases); - copy.setTriggerZone(validHostZones); + copy.setActiveZone(validHostZones); } public boolean isStatic() { return getMapParams().containsKey("Static"); // && params.get("Static").equals("True") [always true if present] } - - public void setTriggerZone(EnumSet zones) { - validHostZones = zones; - } - public void setTriggerPhases(List phases) { validPhases = phases; } diff --git a/src/main/java/forge/card/trigger/TriggerHandler.java b/src/main/java/forge/card/trigger/TriggerHandler.java index 2138b21e271..810f6fa86f5 100644 --- a/src/main/java/forge/card/trigger/TriggerHandler.java +++ b/src/main/java/forge/card/trigger/TriggerHandler.java @@ -207,7 +207,7 @@ public class TriggerHandler { String triggerZones = mapParams.get("TriggerZones"); if (null != triggerZones) { - ret.setTriggerZone(EnumSet.copyOf(ZoneType.listValueOf(triggerZones))); + ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(triggerZones))); } String triggerPhases = mapParams.get("Phase"); diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index 610937a6734..91e2ae19f7b 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -39,6 +39,7 @@ import forge.GameEntity; import forge.Singletons; import forge.card.cardfactory.CardFactoryUtil; import forge.card.mana.ManaPool; +import forge.card.replacement.ReplacementResult; import forge.card.spellability.SpellAbility; import forge.card.staticability.StaticAbility; import forge.card.trigger.TriggerType; @@ -142,7 +143,7 @@ public abstract class Player extends GameEntity { /** The Constant ALL_ZONES. */ public static final List ALL_ZONES = Collections.unmodifiableList(Arrays.asList(ZoneType.Battlefield, - ZoneType.Library, ZoneType.Graveyard, ZoneType.Hand, ZoneType.Exile, ZoneType.Command, ZoneType.Ante)); + ZoneType.Library, ZoneType.Graveyard, ZoneType.Hand, ZoneType.Exile, ZoneType.Command, ZoneType.Ante, ZoneType.Stack)); /** *

@@ -349,7 +350,7 @@ public abstract class Player extends GameEntity { repParams.put("Event", "GainLife"); repParams.put("Affected", this); repParams.put("LifeGained", toGain); - if (AllZone.getReplacementHandler().run(repParams)) { + if (AllZone.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) { return false; } @@ -772,7 +773,7 @@ public abstract class Player extends GameEntity { repParams.put("DamageAmount", damage); repParams.put("IsCombat", isCombat); - if (AllZone.getReplacementHandler().run(repParams)) { + if (AllZone.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) { return 0; } @@ -822,7 +823,7 @@ public abstract class Player extends GameEntity { repParams.put("IsCombat", isCombat); repParams.put("Prevention", true); - if (AllZone.getReplacementHandler().run(repParams)) { + if (AllZone.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) { return 0; } @@ -1255,7 +1256,7 @@ public abstract class Player extends GameEntity { repRunParams.put("Event", "Draw"); repRunParams.put("Affected", this); - if (AllZone.getReplacementHandler().run(repRunParams)) { + if (AllZone.getReplacementHandler().run(repRunParams) != ReplacementResult.NotReplaced) { return drawn; } @@ -1378,10 +1379,19 @@ public abstract class Player extends GameEntity { public final CardList getCardsIn(final List zones) { final CardList result = new CardList(); for (final ZoneType z : zones) { + if(z == ZoneType.Stack) { + for(Card c : AllZone.getStackZone().getCards()) + { + if(c.getOwner().equals(this)) { + result.add(c); + } + } + } if (this.getZone(z) != null) { result.addAll(this.getZone(z).getCards()); } } + return result; } @@ -2172,7 +2182,7 @@ public abstract class Player extends GameEntity { runParams.put("Affected", this); runParams.put("Event", "GameLoss"); - if (AllZone.getReplacementHandler().run(runParams)) { + if (AllZone.getReplacementHandler().run(runParams) != ReplacementResult.NotReplaced) { return false; } diff --git a/src/main/java/forge/game/zone/DefaultPlayerZone.java b/src/main/java/forge/game/zone/DefaultPlayerZone.java index 3c305d9b8e6..65b7e70d199 100644 --- a/src/main/java/forge/game/zone/DefaultPlayerZone.java +++ b/src/main/java/forge/game/zone/DefaultPlayerZone.java @@ -68,6 +68,10 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl public void add(final Object o, boolean update) { final Card c = (Card) o; + + if(zoneName == ZoneType.Graveyard && c.getName().equals("Clone")) { + System.out.println("I'm not a freak."); + } // Immutable cards are usually emblems,effects and the mana pool and we // don't want to log those.