From 0de140538c2aa354a85595aa94573095dce0ea61 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Fri, 7 Feb 2020 04:06:24 +0000 Subject: [PATCH] Refactor: Effects with "For as long" it has CounterType --- .../game/ability/SpellAbilityEffect.java | 17 ++++++++++ .../ability/effects/CountersPutEffect.java | 15 +++++--- .../game/ability/effects/EffectEffect.java | 34 +++++++++++++++---- .../res/cardsfolder/a/aquitects_will.txt | 7 ++-- .../res/cardsfolder/a/aven_mimeomancer.txt | 7 ++-- .../res/cardsfolder/c/cyclopean_tomb.txt | 17 +++++----- forge-gui/res/cardsfolder/d/dread_wight.txt | 15 ++++---- .../res/cardsfolder/l/liege_of_the_tangle.txt | 5 ++- .../res/cardsfolder/m/makeshift_mannequin.txt | 11 +++--- .../res/cardsfolder/m/mathas_fiend_seeker.txt | 10 +++--- .../res/cardsfolder/o/obsidian_fireheart.txt | 7 ++-- .../cardsfolder/q/quicksilver_fountain.txt | 10 +++--- 12 files changed, 93 insertions(+), 62 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index 160febd110b..d90b9c90396 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -337,6 +337,23 @@ public abstract class SpellAbilityEffect { final Trigger addedTrigger = card.addTrigger(parsedTrigger); addedTrigger.setIntrinsic(true); } + + protected static void addForgetCounterTrigger(final Card card, final String counterType) { + String trig = "Mode$ CounterRemoved | TriggerZones$ Command | ValidCard$ Card.IsRemembered | CounterType$ " + counterType + " | NewCounterAmount$ 0 | Static$ True"; + + String forgetEffect = "DB$ Pump | ForgetObjects$ TriggeredCard"; + String exileEffect = "DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile" + + " | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ0"; + + SpellAbility saForget = AbilityFactory.getAbility(forgetEffect, card); + AbilitySub saExile = (AbilitySub) AbilityFactory.getAbility(exileEffect, card); + saForget.setSubAbility(saExile); + + final Trigger parsedTrigger = TriggerHandler.parseTrigger(trig, card, true); + parsedTrigger.setOverridingAbility(saForget); + final Trigger addedTrigger = card.addTrigger(parsedTrigger); + addedTrigger.setIntrinsic(true); + } protected static void addLeaveBattlefieldReplacement(final Card card, final SpellAbility sa, final String zone) { final Card host = sa.getHostCard(); diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java index cc1df6ebea4..558650c28d6 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java @@ -192,6 +192,7 @@ public class CountersPutEffect extends SpellAbilityEffect { } if (obj instanceof Card) { + boolean counterAdded = false; counterAmount = sa.usesTargeting() && sa.hasParam("DividedAsYouChoose") ? sa.getTargetRestrictions().getDividedValue(gameCard) : counterAmount; if (!sa.usesTargeting() || gameCard.canBeTargetedBy(sa)) { if (max != -1) { @@ -246,15 +247,14 @@ public class CountersPutEffect extends SpellAbilityEffect { continue; } } - if (rememberCards) { - card.addRemembered(gameCard); - } final Zone zone = gameCard.getGame().getZoneOf(gameCard); if (zone == null || zone.is(ZoneType.Battlefield) || zone.is(ZoneType.Stack)) { if (etbcounter) { gameCard.addEtbCounter(counterType, counterAmount, placer); } else { - gameCard.addCounter(counterType, counterAmount, placer, true, table); + if (gameCard.addCounter(counterType, counterAmount, placer, true, table) > 0) { + counterAdded = true; + } } if (remember) { final int value = gameCard.getTotalCountersToAdd(); @@ -285,9 +285,14 @@ public class CountersPutEffect extends SpellAbilityEffect { if (etbcounter) { gameCard.addEtbCounter(counterType, counterAmount, placer); } else { - gameCard.addCounter(counterType, counterAmount, placer, false, table); + if (gameCard.addCounter(counterType, counterAmount, placer, false, table) > 0) { + counterAdded = true; + } } } + if (rememberCards && counterAdded) { + card.addRemembered(gameCard); + } game.updateLastStateForCard(gameCard); } } else if (obj instanceof Player) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index b60f3abea6a..7e59dde1f78 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -3,11 +3,15 @@ package forge.game.ability.effects; import forge.GameCommand; import forge.ImageKeys; import forge.game.Game; +import forge.game.GameObject; import forge.game.ability.AbilityFactory; import forge.game.ability.AbilityUtils; import forge.game.ability.SpellAbilityEffect; import forge.game.card.Card; import forge.game.card.CardCollection; +import forge.game.card.CardLists; +import forge.game.card.CardPredicates; +import forge.game.card.CounterType; import forge.game.player.Player; import forge.game.replacement.ReplacementEffect; import forge.game.replacement.ReplacementHandler; @@ -20,8 +24,10 @@ import forge.game.zone.ZoneType; import java.util.List; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import forge.util.TextUtil; +import forge.util.collect.FCollection; public class EffectEffect extends SpellAbilityEffect { @@ -44,7 +50,7 @@ public class EffectEffect extends SpellAbilityEffect { String[] effectKeywords = null; String[] effectStaticAbilities = null; String[] effectReplacementEffects = null; - String effectRemembered = null; + FCollection rememberList = null; String effectImprinted = null; List effectOwner = null; boolean imprintOnHost = false; @@ -74,7 +80,20 @@ public class EffectEffect extends SpellAbilityEffect { } if (sa.hasParam("RememberObjects")) { - effectRemembered = sa.getParam("RememberObjects"); + rememberList = new FCollection<>(); + for (final String rem : sa.getParam("RememberObjects").split(",")) { + rememberList.addAll(AbilityUtils.getDefinedObjects(hostCard, rem, sa)); + } + + if (sa.hasParam("ForgetCounter")) { + CounterType cType = CounterType.valueOf(sa.getParam("ForgetCounter")); + rememberList = new FCollection(CardLists.filter(Iterables.filter(rememberList, Card.class), CardPredicates.hasCounter(cType))); + } + + // don't create Effect if there is no remembered Objects + if (rememberList.isEmpty() && (sa.hasParam("ForgetOnMoved") || sa.hasParam("ExileOnMoved") || sa.hasParam("ForgetCounter"))) { + return; + } } if (sa.hasParam("ImprintCards")) { @@ -183,17 +202,18 @@ public class EffectEffect extends SpellAbilityEffect { } // Set Remembered - if (effectRemembered != null) { - for (final String rem : effectRemembered.split(",")) { - for (final Object o : AbilityUtils.getDefinedObjects(hostCard, rem, sa)) { - eff.addRemembered(o); - } + if (rememberList != null) { + for (final Object o : rememberList) { + eff.addRemembered(o); } if (sa.hasParam("ForgetOnMoved")) { addForgetOnMovedTrigger(eff, sa.getParam("ForgetOnMoved")); } else if (sa.hasParam("ExileOnMoved")) { addExileOnMovedTrigger(eff, sa.getParam("ExileOnMoved")); } + if (sa.hasParam("ForgetCounter")) { + addForgetCounterTrigger(eff, sa.getParam("ForgetCounter")); + } } // Set Imprinted diff --git a/forge-gui/res/cardsfolder/a/aquitects_will.txt b/forge-gui/res/cardsfolder/a/aquitects_will.txt index 1d0074cbc4c..3e8a8ba98e4 100644 --- a/forge-gui/res/cardsfolder/a/aquitects_will.txt +++ b/forge-gui/res/cardsfolder/a/aquitects_will.txt @@ -1,11 +1,10 @@ Name:Aquitect's Will ManaCost:U Types:Tribal Sorcery Merfolk -A:SP$ PutCounter | Cost$ U | ValidTgts$ Land | TgtPrompt$ Select target land | RememberTargets$ True | CounterType$ FLOOD | CounterNum$ 1 | SubAbility$ DBAnimate | SpellDescription$ Put a flood counter on target land. That land is an island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. -SVar:DBAnimate:DB$ Animate | Defined$ ParentTarget | staticAbilities$ AnimateIsland | Permanent$ True | SubAbility$ DBDraw -SVar:AnimateIsland:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self+counters_GE1_FLOOD | AddType$ Island +A:SP$ PutCounter | Cost$ U | ValidTgts$ Land | TgtPrompt$ Select target land | CounterType$ FLOOD | CounterNum$ 1 | SubAbility$ DBEffect | SpellDescription$ Put a flood counter on target land. That land is an island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ FountainStatic | ForgetOnMoved$ Battlefield | ForgetCounter$ FLOOD | Duration$ Permanent | SubAbility$ DBDraw +SVar:FountainStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddType$ Island | Description$ That land is an island in addition to its other types for as long as it has a flood counter on it. SVar:DBDraw:DB$ Draw | NumCards$ 1 | ConditionPresent$ Merfolk.YouCtrl | ConditionCompare$ GE1 | ConditionDescription$ If you control a Merfolk, AI:RemoveDeck:Random AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/aquitects_will.jpg Oracle:Put a flood counter on target land. That land is an Island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. diff --git a/forge-gui/res/cardsfolder/a/aven_mimeomancer.txt b/forge-gui/res/cardsfolder/a/aven_mimeomancer.txt index c7ce95da56b..c1cf5ea0625 100644 --- a/forge-gui/res/cardsfolder/a/aven_mimeomancer.txt +++ b/forge-gui/res/cardsfolder/a/aven_mimeomancer.txt @@ -4,9 +4,8 @@ Types:Creature Bird Wizard PT:3/1 K:Flying T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may put a feather counter on target creature. If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it. -SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ FEATHER | CounterNum$ 1 | SubAbility$ DBAnimate -SVar:DBAnimate:DB$ Animate | Defined$ Targeted | staticAbilities$ MimeomancerStatic | Permanent$ True -SVar:MimeomancerStatic:Mode$ Continuous | Affected$ Card.Self+counters_GE1_FEATHER | SetPower$ 3 | SetToughness$ 1 | AddKeyword$ Flying | Description$ CARDNAME is 3/1 and has flying for as long as it has a feather counter on it. +SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ FEATHER | CounterNum$ 1 | SubAbility$ DBEffect +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ MimeomancerStatic | ForgetOnMoved$ Battlefield | ForgetCounter$ FEATHER | Duration$ Permanent +SVar:MimeomancerStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | SetPower$ 3 | SetToughness$ 1 | AddKeyword$ Flying | Description$ CARDNAME is 3/1 and has flying for as long as it has a feather counter on it. AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/aven_mimeomancer.jpg Oracle:Flying\nAt the beginning of your upkeep, you may put a feather counter on target creature. If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it. diff --git a/forge-gui/res/cardsfolder/c/cyclopean_tomb.txt b/forge-gui/res/cardsfolder/c/cyclopean_tomb.txt index c935f0b025e..fec96905d05 100644 --- a/forge-gui/res/cardsfolder/c/cyclopean_tomb.txt +++ b/forge-gui/res/cardsfolder/c/cyclopean_tomb.txt @@ -1,17 +1,18 @@ Name:Cyclopean Tomb ManaCost:4 Types:Artifact -A:AB$ PutCounter | Cost$ 2 T | ValidTgts$ Land.nonSwamp | TgtPrompt$ Select target non-Swamp land | RememberTargets$ True | CounterType$ MIRE | CounterNum$ 1 | ActivationPhases$ Upkeep | SubAbility$ DBAnimate | SpellDescription$ Put a mire counter on target non-Swamp land. That land is a Swamp for as long as it has a mire counter on it. Activate this ability only during your upkeep. -SVar:DBAnimate:DB$ Animate | Defined$ ParentTarget | staticAbilities$ AnimateSwamp | Permanent$ True -SVar:AnimateSwamp:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self+counters_GE1_MIRE | AddType$ Swamp | RemoveLandTypes$ True | RemoveIntrinsicAbilities$ True +A:AB$ PutCounter | Cost$ 2 T | ValidTgts$ Land.nonSwamp | TgtPrompt$ Select target non-Swamp land | RememberCards$ True | CounterType$ MIRE | CounterNum$ 1 | ActivationPhases$ Upkeep | SubAbility$ DBEffect | SpellDescription$ Put a mire counter on target non-Swamp land. That land is a Swamp for as long as it has a mire counter on it. Activate this ability only during your upkeep. +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ TombStatic | ForgetOnMoved$ Battlefield | ForgetCounter$ MIRE | Duration$ Permanent +SVar:TombStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddType$ Swamp | RemoveLandTypes$ True | RemoveIntrinsicAbilities$ True | Description$ That land is a Swamp for as long as it has a mire counter on it T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, at the beginning of each of your upkeeps for the rest of the game, remove all mire counters from a land that a mire counter was put onto with CARDNAME but that a mire counter has not been removed from with CARDNAME. -SVar:TrigEffect:DB$ Effect | ImprintCards$ Remembered | Triggers$ UpkeepRemove,TrigForget | SVars$ PumpForget,TrigRemove,DBRemoveCounter,DBForget | Duration$ Permanent +SVar:TrigEffect:DB$ Effect | RememberObjects$ RememberedCard | Triggers$ UpkeepRemove | ForgetOnMoved$ Battlefield | SVars$ TrigRemove,DBRemoveCounter,DBForget,DBClearChosen,DBExileSelf | Duration$ Permanent | SubAbility$ DBClearRemembered SVar:UpkeepRemove:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigRemove | TriggerZones$ Command | TriggerDescription$ At the beginning of your upkeep, remove all mire counters from a land that a mire counter was put onto with Cyclopean Tomb but that a mire counter has not been removed from with Cyclopean Tomb. -SVar:TrigRemove:DB$ ChooseCard | Choices$ Card.IsImprinted | Mandatory$ True | SubAbility$ DBRemoveCounter +SVar:TrigRemove:DB$ ChooseCard | Choices$ Card.IsRemembered | Mandatory$ True | SubAbility$ DBRemoveCounter SVar:DBRemoveCounter:DB$ RemoveCounter | CounterType$ MIRE | CounterNum$ All | Defined$ ChosenCard | SubAbility$ DBForget -SVar:DBForget:DB$ Pump | ForgetImprinted$ ChosenCard -SVar:TrigForget:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | TriggerZones$ Command | ValidCard$ Card.IsImprinted | Static$ True | Execute$ PumpForget -SVar:PumpForget:DB$ Pump | ForgetImprinted$ TriggeredCard +SVar:DBForget:DB$ Pump | ForgetObjects$ ChosenCard | SubAbility$ DBClearChosen +SVar:DBClearChosen:DB$ Cleanup | ClearChosenCard$ True | SubAbility$ DBExileSelf +SVar:DBExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ0 +SVar:DBClearRemembered:DB$ Cleanup | ClearRemembered$ True AI:RemoveDeck:All AI:RemoveDeck:Random SVar:Picture:http://www.wizards.com/global/images/magic/general/cyclopean_tomb.jpg diff --git a/forge-gui/res/cardsfolder/d/dread_wight.txt b/forge-gui/res/cardsfolder/d/dread_wight.txt index aa327b564fd..98790ddd6d3 100644 --- a/forge-gui/res/cardsfolder/d/dread_wight.txt +++ b/forge-gui/res/cardsfolder/d/dread_wight.txt @@ -2,14 +2,11 @@ Name:Dread Wight ManaCost:3 B B Types:Creature Zombie PT:3/4 -T:Mode$ AttackerBlocked | ValidCard$ Creature | ValidBlocker$ Card.Self | Execute$ DelTrigBlocked | TriggerDescription$ At end of combat, put a paralyzation counter on each creature blocking or blocked by CARDNAME and tap those creatures. Each of those creatures doesn't untap during its controller's untap step for as long as it has a paralyzation counter on it. Each of those creatures gains "{4}: Remove a paralyzation counter from this creature." -T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | Execute$ DelTrigBlocker | Secondary$ True | TriggerDescription$ At end of combat, put a paralyzation counter on each creature blocking or blocked by CARDNAME and tap those creatures. Each of those creatures doesn't untap during its controller's untap step for as long as it has a paralyzation counter on it. Each of those creatures gains "{4}: Remove a paralyzation counter from this creature." -SVar:DelTrigBlocked:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Opponent | Execute$ TrigCounter | RememberObjects$ TriggeredAttacker | TriggerDescription$ At the end of combat, put a paralyzation counter on creature -SVar:DelTrigBlocker:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ You | Execute$ TrigCounter | RememberObjects$ TriggeredBlocker | TriggerDescription$ At the end of combat, put a paralyzation counter on creature -SVar:TrigCounter:DB$ PutCounter | CounterType$ PARALYZATION | CounterNum$ 1 | Defined$ DelayTriggerRemembered | SubAbility$ DBTap | SpellDescription$ Put paralyzation counter on creature -SVar:DBTap:DB$ Tap | Defined$ DelayTriggerRemembered | SpellDescription$ Tap creature | SubAbility$ DBAnimate -SVar:DBAnimate:DB$ Animate | Defined$ DelayTriggerRemembered | staticAbilities$ Static | Abilities$ ABRemoveCounter | Permanent$ True +T:Mode$ Phase | Phase$ EndCombat | Execute$ TrigCounter | TriggerDescription$ At end of combat, put a paralyzation counter on each creature blocking or blocked by CARDNAME and tap those creatures. Each of those creatures doesn't untap during its controller's untap step for as long as it has a paralyzation counter on it. Each of those creatures gains "{4}: Remove a paralyzation counter from this creature." +SVar:TrigCounter:DB$ PutCounterAll | CounterType$ PARALYZATION | CounterNum$ 1 | ValidCards$ Creature.blockedBySource,Creature.blockingSource | SubAbility$ DBTap +SVar:DBTap:DB$ TapAll | ValidCards$ Creature.blockedBySource,Creature.blockingSource | SubAbility$ DBEffect +SVar:DBEffect:DB$ Effect | RememberObjects$ Valid Creature.blockedBySource,Valid Creature.blockingSource | StaticAbilities$ DontUntap | Duration$ Permanent | ConditionPresent$ Creature.blockedBySource,Creature.blockingSource | SubAbility$ DBAnimate | ForgetOnMoved$ Battlefield | ForgetCounter$ PARALYZATION +SVar:DBAnimate:DB$ AnimateAll | ValidCards$ Creature.blockedBySource,Creature.blockingSource | Abilities$ ABRemoveCounter | Permanent$ True SVar:ABRemoveCounter:AB$ RemoveCounter | Defined$ Self | Cost$ 4 | CounterType$ PARALYZATION | CounterNum$ 1 | SpellDescription$ Remove a paralyzation counter from this creature. -SVar:Static:Mode$ Continuous | Affected$ Card.Self+counters_GE1_PARALYZATION | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | AffectedZone$ Battlefield -SVar:Picture:http://www.wizards.com/global/images/magic/general/dread_wight.jpg +SVar:DontUntap:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Card.IsRemembered | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | Description$ Each of those creatures doesn't untap during its controller's untap step for as long as it has a paralyzation counter on it. Oracle:At end of combat, put a paralyzation counter on each creature blocking or blocked by Dread Wight and tap those creatures. Each of those creatures doesn't untap during its controller's untap step for as long as it has a paralyzation counter on it. Each of those creatures gains "{4}: Remove a paralyzation counter from this creature." diff --git a/forge-gui/res/cardsfolder/l/liege_of_the_tangle.txt b/forge-gui/res/cardsfolder/l/liege_of_the_tangle.txt index c9fbe4af558..cc749a543d1 100644 --- a/forge-gui/res/cardsfolder/l/liege_of_the_tangle.txt +++ b/forge-gui/res/cardsfolder/l/liege_of_the_tangle.txt @@ -6,8 +6,7 @@ K:Trample T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may choose any number of target lands you control and put an awakening counter on each of them. Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Land.YouCtrl | OptionalDecider$ You | TargetMin$ 0 | TargetMax$ X | TgtPrompt$ Select lands you control | CounterType$ AWAKENING | CounterNum$ 1 | SubAbility$ DBEffect | References$ X SVar:X:Count$Valid Land.YouCtrl -SVar:DBEffect:DB$ Effect | Name$ Awakening Effect | StaticAbilities$ KWAnimateAll | Duration$ Permanent | RememberObjects$ Targeted -SVar:KWAnimateAll:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered+counters_GE1_AWAKENING | SetPower$ 8 | SetToughness$ 8 | AddType$ Creature & Elemental | SetColor$ Green | Description$ Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ TangleStatic | ForgetOnMoved$ Battlefield | ForgetCounter$ AWAKENING | Duration$ Permanent +SVar:TangleStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | SetPower$ 8 | SetToughness$ 8 | AddType$ Creature & Elemental | RemoveCreatureTypes$ True | SetColor$ Green | Description$ Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. SVar:MustBeBlocked:True -SVar:Picture:http://www.wizards.com/global/images/magic/general/liege_of_the_tangle.jpg Oracle:Trample\nWhenever Liege of the Tangle deals combat damage to a player, you may choose any number of target lands you control and put an awakening counter on each of them. Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. diff --git a/forge-gui/res/cardsfolder/m/makeshift_mannequin.txt b/forge-gui/res/cardsfolder/m/makeshift_mannequin.txt index df506eb57a4..9ba2bb3ab04 100644 --- a/forge-gui/res/cardsfolder/m/makeshift_mannequin.txt +++ b/forge-gui/res/cardsfolder/m/makeshift_mannequin.txt @@ -1,11 +1,10 @@ Name:Makeshift Mannequin ManaCost:3 B Types:Instant -A:SP$ ChangeZone | Cost$ 3 B | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature from your graveyard | Origin$ Graveyard | Destination$ Battlefield | RememberTargets$ True | SubAbility$ DBCounter | SpellDescription$ Return target creature card from your graveyard to the battlefield with a mannequin counter on it. For as long as that creature has a mannequin counter on it, it has "When this creature becomes the target of a spell or ability, sacrifice it." -SVar:DBCounter:DB$ PutCounter | CounterType$ MANNEQUIN | CounterNum$ 1 | Defined$ Remembered | SubAbility$ DBAnimate -SVar:DBAnimate:DB$ Animate | Triggers$ BecomesTarget | sVars$ MakeshiftSac | Defined$ Remembered | Permanent$ True | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:BecomesTarget:Mode$ BecomesTarget | ValidTarget$ Card.Self+counters_GE1_MANNEQUIN | TriggerZones$ Battlefield | Execute$ MakeshiftSac | TriggerDescription$ When CARDNAME becomes the target of a spell or ability, sacrifice it. +A:SP$ ChangeZone | Cost$ 3 B | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature from your graveyard | Origin$ Graveyard | Destination$ Battlefield | WithCounters$ MANNEQUIN_1 | RememberChanged$ True | SubAbility$ DBEffect | SpellDescription$ Return target creature card from your graveyard to the battlefield with a mannequin counter on it. For as long as that creature has a mannequin counter on it, it has "When this creature becomes the target of a spell or ability, sacrifice it." +SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ MannequinStatic | SVars$ MannequinBecomesTarget,MakeshiftSac | SubAbility$ DBCleanup | ForgetOnMoved$ Battlefield | ForgetCounter$ MANNEQUIN +SVar:MannequinStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddTrigger$ MannequinBecomesTarget | Description$ For as long as that creature has a mannequin counter on it, it has "When this creature becomes the target of a spell or ability, sacrifice it." +SVar:MannequinBecomesTarget:Mode$ BecomesTarget | ValidTarget$ Card.Self | TriggerZones$ Battlefield | Execute$ MakeshiftSac | TriggerDescription$ When CARDNAME becomes the target of a spell or ability, sacrifice it. SVar:MakeshiftSac:DB$Sacrifice | Defined$ Self -SVar:Picture:http://www.wizards.com/global/images/magic/general/makeshift_mannequin.jpg +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True Oracle:Return target creature card from your graveyard to the battlefield with a mannequin counter on it. For as long as that creature has a mannequin counter on it, it has "When this creature becomes the target of a spell or ability, sacrifice it." diff --git a/forge-gui/res/cardsfolder/m/mathas_fiend_seeker.txt b/forge-gui/res/cardsfolder/m/mathas_fiend_seeker.txt index c7a50f9d93a..6493eebbf32 100644 --- a/forge-gui/res/cardsfolder/m/mathas_fiend_seeker.txt +++ b/forge-gui/res/cardsfolder/m/mathas_fiend_seeker.txt @@ -4,12 +4,10 @@ Types:Legendary Creature Vampire PT:3/3 K:Menace T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your end step, put a bounty counter on target creature an opponent controls. For as long as that creature has a bounty counter on it, it has "When this creature dies, each opponent draws a card and gains 2 life." -SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature an opponent controls | CounterType$ BOUNTY | CounterNum$ 1 | IsCurse$ True | SubAbility$ DBAnimate -#TODO: Ideally, this has to be implemented with a condition where, if counters are removed from the permanent, the trigger -#is removed even if the counters of the same type are later added via something else. -SVar:DBAnimate:DB$ Animate | Defined$ Targeted | sVars$ MathasPayoffDraw,MathasPayoffLife,MathasDeath | Triggers$ MathasDeath | Permanent$ True -SVar:MathasDeath:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self+counters_GE1_BOUNTY | Execute$ MathasPayoffDraw | TriggerDescription$ When this creature dies, each opponent draws a card and gains 2 life. +SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature an opponent controls | CounterType$ BOUNTY | CounterNum$ 1 | IsCurse$ True | SubAbility$ DBEffect +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ MathasStatic | SVars$ MathasDeath,MathasPayoffDraw,MathasPayoffLife | ForgetOnMoved$ Battlefield | ForgetCounter$ BOUNTY | Duration$ Permanent +SVar:MathasStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddTrigger$ MathasDeath | Description$ For as long as that creature has a bounty counter on it, it has "When this creature dies, each opponent draws a card and gains 2 life." +SVar:MathasDeath:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ MathasPayoffDraw | TriggerDescription$ When this creature dies, each opponent draws a card and gains 2 life. SVar:MathasPayoffDraw:DB$ Draw | Defined$ Player.Opponent | NumCards$ 1 | SubAbility$ MathasPayoffLife SVar:MathasPayoffLife:DB$ GainLife | Defined$ Player.Opponent | LifeAmount$ 2 -SVar:Picture:http://www.wizards.com/global/images/magic/general/mathas_fiend_seeker.jpg Oracle:Menace\nAt the beginning of your end step, put a bounty counter on target creature an opponent controls. For as long as that creature has a bounty counter on it, it has "When this creature dies, each opponent draws a card and gains 2 life." diff --git a/forge-gui/res/cardsfolder/o/obsidian_fireheart.txt b/forge-gui/res/cardsfolder/o/obsidian_fireheart.txt index 941c4ccc494..6f5bfd8b9a6 100644 --- a/forge-gui/res/cardsfolder/o/obsidian_fireheart.txt +++ b/forge-gui/res/cardsfolder/o/obsidian_fireheart.txt @@ -2,10 +2,9 @@ Name:Obsidian Fireheart ManaCost:1 R R R Types:Creature Elemental PT:4/4 -A:AB$ PutCounter | Cost$ 1 R R | IsCurse$ True | ValidTgts$ Land.counters_EQ0_BLAZE | TgtPrompt$ Select target Land without a Blaze Counter | CounterType$ BLAZE | CounterNum$ 1 | SubAbility$ DBAnimate | SpellDescription$ Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.) -SVar:DBAnimate:DB$ Animate | Defined$ Targeted | staticAbilities$ ObsidianBlaze | sVars$ ObsidianBlazeTrig,ObsidianBlazeDmg | StackDescription$ None | Permanent$ True -SVar:ObsidianBlaze:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self+counters_GE1_BLAZE | AddTrigger$ ObsidianBlazeTrig +A:AB$ PutCounter | Cost$ 1 R R | IsCurse$ True | ValidTgts$ Land.counters_EQ0_BLAZE | TgtPrompt$ Select target Land without a Blaze Counter | CounterType$ BLAZE | CounterNum$ 1 | SubAbility$ DBEffect | SpellDescription$ Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after CARDNAME has left the battlefield.) +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ ObsidianStatic | SVars$ ObsidianBlazeTrig,ObsidianBlazeDmg | ForgetOnMoved$ Battlefield | ForgetCounter$ BLAZE | Duration$ Permanent +SVar:ObsidianStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddTrigger$ ObsidianBlazeTrig | Description$ For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." SVar:ObsidianBlazeTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ObsidianBlazeDmg | TriggerDescription$ At the beginning of your upkeep, CARDNAME deals 1 damage to you. SVar:ObsidianBlazeDmg:DB$ DealDamage | Defined$ You | NumDmg$ 1 -SVar:Picture:http://www.wizards.com/global/images/magic/general/obsidian_fireheart.jpg Oracle:{1}{R}{R}: Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.) diff --git a/forge-gui/res/cardsfolder/q/quicksilver_fountain.txt b/forge-gui/res/cardsfolder/q/quicksilver_fountain.txt index ef902bb6adf..7475b3c069a 100644 --- a/forge-gui/res/cardsfolder/q/quicksilver_fountain.txt +++ b/forge-gui/res/cardsfolder/q/quicksilver_fountain.txt @@ -2,12 +2,10 @@ Name:Quicksilver Fountain ManaCost:3 Types:Artifact T:Mode$ Phase | Phase$ Upkeep | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's upkeep, that player puts a flood counter on target non-Island land they control of their choice. That land is an Island for as long as it has a flood counter on it. -SVar:TrigPutCounter:DB$ PutCounter | TargetingPlayer$ TriggeredPlayer | ValidTgts$ Land.nonIsland+ActivePlayerCtrl | TgtPrompt$ Select target non-Island land you control | CounterType$ FLOOD | CounterNum$ 1 | SubAbility$ DBAnimate -SVar:DBAnimate:DB$ Animate | Defined$ Targeted | staticAbilities$ STFlood | Permanent$ True -SVar:STFlood:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self+counters_GE1_FLOOD | AddType$ Island | RemoveLandTypes$ True | RemoveIntrinsicAbilities$ True -T:Mode$ Phase | Phase$ End of Turn | CheckSVar$ X | SVarCompare$ EQ0 | TriggerZones$ Battlefield | Execute$ TrigRemoveAll | References$ X | TriggerDescription$ At the beginning of each end step, if all lands on the battlefield are Islands, remove all flood counters from them. +SVar:TrigPutCounter:DB$ PutCounter | TargetingPlayer$ TriggeredPlayer | ValidTgts$ Land.nonIsland+ActivePlayerCtrl | TgtPrompt$ Select target non-Island land you control | CounterType$ FLOOD | CounterNum$ 1 | Placer$ TriggeredPlayer | SubAbility$ DBEffect +SVar:DBEffect:DB$ Effect | RememberObjects$ Targeted | StaticAbilities$ FountainStatic | ForgetOnMoved$ Battlefield | ForgetCounter$ FLOOD | Duration$ Permanent +SVar:FountainStatic:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered | AddType$ Island | RemoveLandTypes$ True | RemoveIntrinsicAbilities$ True | Description$ That land is an Island for as long as it has a flood counter on it. +T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Land.nonIsland | PresentCompare$ EQ0 | TriggerZones$ Battlefield | Execute$ TrigRemoveAll | TriggerDescription$ At the beginning of each end step, if all lands on the battlefield are Islands, remove all flood counters from them. SVar:TrigRemoveAll:DB$ RemoveCounterAll | ValidCards$ Land | CounterType$ FLOOD | AllCounters$ True -SVar:X:Count$Valid Land.nonIsland AI:RemoveDeck:Random -SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_fountain.jpg Oracle:At the beginning of each player's upkeep, that player puts a flood counter on target non-Island land they control of their choice. That land is an Island for as long as it has a flood counter on it.\nAt the beginning of each end step, if all lands on the battlefield are Islands, remove all flood counters from them.