From 2ee5755085213d0af58656bf59dffe8ed84ca0fe Mon Sep 17 00:00:00 2001 From: Xavier Morin Duchesne Date: Mon, 4 Jul 2022 11:58:26 -0400 Subject: [PATCH 1/5] Created card script for Jon Irenicus, Shattered One. --- .../upcoming/jon_irenicus_shattered_one.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt diff --git a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt new file mode 100644 index 00000000000..361bb403975 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt @@ -0,0 +1,26 @@ +Name:Jon Irenicus, Shattered One +ManaCost:2 U B +Types:Legendary Creature Elf Wizard +PT:3/3 +Oracle:At the beginning of your end step, target opponent gains control of up to one target creature you control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains "This creature can't be sacrificed." (It attacks each combat if able and attacks a player other than you if able.)\nWhenever a creature you own but don't control attacks, you draw a card. +# +######################################################################################################### +# At the beginning of your end step, target opponent gains control of up to one target creature you # +# control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains # +# "This creature can't be sacrificed." # +######################################################################################################### +T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control (This is a test #29). +SVar:DBSelectRecipient:DB$ Pump | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBDonate +SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters | StackDescription$ Test {p:Targeted} +SVar:DBPutCounters:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 2 | RememberCards$ True | SubAbility$ DBTap +SVar:DBTap:DB$ Tap | Defined$ Targeted | SubAbility$ DBGoad +SVar:DBGoad:DB$ Goad | Defined$ Targeted | SubAbility$ DBDisableSacing +SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent | SubAbility$ DBCleanUp +SVar:SCantSac:Mode$ CantSacrifice | ValidCard$ Card.Self | Description$ This creature cannot be sacrificed. +SVar:DBCleanUp:DB$ CleanUp | ClearRemembered$ True +# +######################################################################################################### +# Whenever a creature you own but don't control attacks, you draw a card. # +######################################################################################################### +T:Mode$ Attacks | ValidCard$ Creature.OppCtrl | ValidCard$ Creature.YouOwn | TriggerZones$ Battlefield | Execute$ DrawACard | TriggerDescription$ Whenever a creature you own but don't control attacks, you draw a card. +SVar:DrawACard:DB$ Draw | Defined$ You | NumCards$ 1 From 321516f6919361142d94d8d293ff947ecfe6d241 Mon Sep 17 00:00:00 2001 From: Xavier Morin Duchesne Date: Mon, 4 Jul 2022 12:04:45 -0400 Subject: [PATCH 2/5] Cleaning up card script. --- .../upcoming/jon_irenicus_shattered_one.txt | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt index 361bb403975..b72a4c1b8f9 100644 --- a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt +++ b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt @@ -2,13 +2,6 @@ Name:Jon Irenicus, Shattered One ManaCost:2 U B Types:Legendary Creature Elf Wizard PT:3/3 -Oracle:At the beginning of your end step, target opponent gains control of up to one target creature you control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains "This creature can't be sacrificed." (It attacks each combat if able and attacks a player other than you if able.)\nWhenever a creature you own but don't control attacks, you draw a card. -# -######################################################################################################### -# At the beginning of your end step, target opponent gains control of up to one target creature you # -# control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains # -# "This creature can't be sacrificed." # -######################################################################################################### T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control (This is a test #29). SVar:DBSelectRecipient:DB$ Pump | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBDonate SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters | StackDescription$ Test {p:Targeted} @@ -18,9 +11,6 @@ SVar:DBGoad:DB$ Goad | Defined$ Targeted | SubAbility$ DBDisableSacing SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent | SubAbility$ DBCleanUp SVar:SCantSac:Mode$ CantSacrifice | ValidCard$ Card.Self | Description$ This creature cannot be sacrificed. SVar:DBCleanUp:DB$ CleanUp | ClearRemembered$ True -# -######################################################################################################### -# Whenever a creature you own but don't control attacks, you draw a card. # -######################################################################################################### T:Mode$ Attacks | ValidCard$ Creature.OppCtrl | ValidCard$ Creature.YouOwn | TriggerZones$ Battlefield | Execute$ DrawACard | TriggerDescription$ Whenever a creature you own but don't control attacks, you draw a card. SVar:DrawACard:DB$ Draw | Defined$ You | NumCards$ 1 +Oracle:At the beginning of your end step, target opponent gains control of up to one target creature you control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains "This creature can't be sacrificed." (It attacks each combat if able and attacks a player other than you if able.)\nWhenever a creature you own but don't control attacks, you draw a card. From d1e1adf46dc0feeac4cf1ad7990d87c96b2b3c20 Mon Sep 17 00:00:00 2001 From: Xavier Morin Duchesne Date: Mon, 4 Jul 2022 13:25:57 -0400 Subject: [PATCH 3/5] Cleaned up descriptions, added Duration$ Permanent to goaded, and fixed ValidCard$ for Attacks trigger. --- .../upcoming/jon_irenicus_shattered_one.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt index b72a4c1b8f9..7a9686af9e8 100644 --- a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt +++ b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt @@ -2,15 +2,14 @@ Name:Jon Irenicus, Shattered One ManaCost:2 U B Types:Legendary Creature Elf Wizard PT:3/3 -T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control (This is a test #29). +T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control. SVar:DBSelectRecipient:DB$ Pump | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBDonate -SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters | StackDescription$ Test {p:Targeted} -SVar:DBPutCounters:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 2 | RememberCards$ True | SubAbility$ DBTap +SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters +SVar:DBPutCounters:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBTap SVar:DBTap:DB$ Tap | Defined$ Targeted | SubAbility$ DBGoad -SVar:DBGoad:DB$ Goad | Defined$ Targeted | SubAbility$ DBDisableSacing -SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent | SubAbility$ DBCleanUp +SVar:DBGoad:DB$ Goad | Defined$ Targeted | Duration$ Permanent | SubAbility$ DBDisableSacing +SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent SVar:SCantSac:Mode$ CantSacrifice | ValidCard$ Card.Self | Description$ This creature cannot be sacrificed. -SVar:DBCleanUp:DB$ CleanUp | ClearRemembered$ True -T:Mode$ Attacks | ValidCard$ Creature.OppCtrl | ValidCard$ Creature.YouOwn | TriggerZones$ Battlefield | Execute$ DrawACard | TriggerDescription$ Whenever a creature you own but don't control attacks, you draw a card. +T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl+YouOwn | TriggerZones$ Battlefield | Execute$ DrawACard | TriggerDescription$ Whenever a creature you own but don't control attacks, you draw a card. SVar:DrawACard:DB$ Draw | Defined$ You | NumCards$ 1 Oracle:At the beginning of your end step, target opponent gains control of up to one target creature you control. Put two +1/+1 counters on it and tap it. It's goaded for the rest of the game and it gains "This creature can't be sacrificed." (It attacks each combat if able and attacks a player other than you if able.)\nWhenever a creature you own but don't control attacks, you draw a card. From 6bd5ad8a06018197acb298ddc67a07898efd6d7b Mon Sep 17 00:00:00 2001 From: Xavier Date: Fri, 8 Jul 2022 00:26:27 -0400 Subject: [PATCH 4/5] Added TargetedCard to getDefinedCards() and to the filtered options in getDefinedPlayers() --- .../src/main/java/forge/game/ability/AbilityUtils.java | 8 +++----- .../cardsfolder/upcoming/jon_irenicus_shattered_one.txt | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 18190a19b1c..660ff3e3c7c 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -162,17 +162,15 @@ public class AbilityUtils { return cards; } } - else if (defined.equals("Targeted") && sa instanceof SpellAbility) { + else if ((defined.equals("Targeted") || defined.equals("TargetedCard")) && sa instanceof SpellAbility) { for (TargetChoices tc : ((SpellAbility)sa).getAllTargetChoices()) { Iterables.addAll(cards, tc.getTargetCards()); } } else if (defined.equals("TargetedSource") && sa instanceof SpellAbility) { - for (TargetChoices tc : ((SpellAbility)sa).getAllTargetChoices()) { - for (SpellAbility s : tc.getTargetSpells()) { + for (TargetChoices tc : ((SpellAbility)sa).getAllTargetChoices()) for (SpellAbility s : tc.getTargetSpells()) { cards.add(s.getHostCard()); } - } } else if (defined.equals("ThisTargetedCard") && sa instanceof SpellAbility) { // do not add parent targeted if (((SpellAbility)sa).getTargets() != null) { @@ -972,7 +970,7 @@ public class AbilityUtils { final Player player = sa instanceof SpellAbility ? ((SpellAbility)sa).getActivatingPlayer() : card.getController(); - if (defined.equals("Self") || defined.equals("ThisTargetedCard") || defined.startsWith("Valid") || getPaidCards(sa, defined) != null) { + if (defined.equals("Self") || defined.equals("TargetedCard") || defined.equals("ThisTargetedCard") || defined.startsWith("Valid") || getPaidCards(sa, defined) != null) { // do nothing, Self is for Cards, not Players } else if (defined.equals("TargetedOrController")) { players.addAll(getDefinedPlayers(card, "Targeted", sa)); diff --git a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt index 7a9686af9e8..1bed23e7f1a 100644 --- a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt +++ b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt @@ -5,7 +5,7 @@ PT:3/3 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control. SVar:DBSelectRecipient:DB$ Pump | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBDonate SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters -SVar:DBPutCounters:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBTap +SVar:DBPutCounters:DB$ PutCounter | Defined$ TargetedCard | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBTap | Description$ Test SVar:DBTap:DB$ Tap | Defined$ Targeted | SubAbility$ DBGoad SVar:DBGoad:DB$ Goad | Defined$ Targeted | Duration$ Permanent | SubAbility$ DBDisableSacing SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent From 9e5f2d48595e353378799e98a0f4626df4d97f50 Mon Sep 17 00:00:00 2001 From: Xavier Date: Sun, 10 Jul 2022 00:03:43 -0400 Subject: [PATCH 5/5] Deleted `Description$ Test` from script. --- .../res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt index 1bed23e7f1a..49397f88be3 100644 --- a/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt +++ b/forge-gui/res/cardsfolder/upcoming/jon_irenicus_shattered_one.txt @@ -5,7 +5,7 @@ PT:3/3 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBSelectRecipient | TriggerDescription$ At the beginning of your end step, target opponent gains control of up to one target creature you control. SVar:DBSelectRecipient:DB$ Pump | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBDonate SVar:DBDonate:DB$ GainControl | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select up to one target creature you control | NewController$ ParentTarget | SubAbility$ DBPutCounters -SVar:DBPutCounters:DB$ PutCounter | Defined$ TargetedCard | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBTap | Description$ Test +SVar:DBPutCounters:DB$ PutCounter | Defined$ TargetedCard | CounterType$ P1P1 | CounterNum$ 2 | SubAbility$ DBTap SVar:DBTap:DB$ Tap | Defined$ Targeted | SubAbility$ DBGoad SVar:DBGoad:DB$ Goad | Defined$ Targeted | Duration$ Permanent | SubAbility$ DBDisableSacing SVar:DBDisableSacing:DB$ Animate | Defined$ Targeted | staticAbilities$ SCantSac | Duration$ Permanent