From f87afd472fb7bb212e6f19a6c046b7015bb414a0 Mon Sep 17 00:00:00 2001 From: Tim Mocny Date: Sat, 5 Feb 2022 05:38:40 +0000 Subject: [PATCH] NEO: Fable of the Mirror-Breaker // Reflection of Kiki-Jiki and CopyPermanentEffect StackDescription improvement --- .../ability/effects/CopyPermanentEffect.java | 25 ++++++++++++++++++- ...mirror_breaker_reflection_of_kiki_jiki.txt | 25 +++++++++++++++++++ .../r_2_2_goblin_shaman_treasure.txt | 9 +++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/fable_of_the_mirror_breaker_reflection_of_kiki_jiki.txt create mode 100644 forge-gui/res/tokenscripts/r_2_2_goblin_shaman_treasure.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index 4367fa38002..f60128d48d6 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -1,7 +1,9 @@ package forge.game.ability.effects; +import java.util.Arrays; import java.util.List; +import forge.util.Lang; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.mutable.MutableBoolean; @@ -43,10 +45,31 @@ public class CopyPermanentEffect extends TokenEffectBase { final StringBuilder sb = new StringBuilder(); final List tgtCards = getTargetCards(sa); + boolean justOne = tgtCards.size() == 1; sb.append("Copy "); - sb.append(StringUtils.join(tgtCards, ", ")); + sb.append(Lang.joinHomogenous(tgtCards)); + if (sa.hasParam("AddKeywords")) { + final List keywords = Lists.newArrayList(); + keywords.addAll(Arrays.asList(sa.getParam("AddKeywords").split(" & "))); + sb.append(", except ").append(justOne ? "it has " : "they have "); + sb.append(Lang.joinHomogenous(keywords).toLowerCase()); + } sb.append("."); + if (sa.hasParam("AtEOT")) { + String atEOT = sa.getParam("AtEOT"); + String verb = "Sacrifice "; + if (atEOT.startsWith("Exile")) { + verb = "Exile "; + } + sb.append(" ").append(verb).append(justOne ? "it " : "them ").append("at "); + String when = "the beginning of the next end step."; + if (atEOT.endsWith("Combat")) { + when = "end of combat."; + } + sb.append(when); + } + return sb.toString(); } diff --git a/forge-gui/res/cardsfolder/upcoming/fable_of_the_mirror_breaker_reflection_of_kiki_jiki.txt b/forge-gui/res/cardsfolder/upcoming/fable_of_the_mirror_breaker_reflection_of_kiki_jiki.txt new file mode 100644 index 00000000000..7cdb8e963cb --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/fable_of_the_mirror_breaker_reflection_of_kiki_jiki.txt @@ -0,0 +1,25 @@ +Name:Fable of the Mirror-Breaker +ManaCost:2 R +Types:Enchantment Saga +K:Saga:3:DBToken,DBDiscard,DBTransform +SVar:DBToken:DB$ Token | TokenScript$ r_2_2_goblin_shaman_treasure | SpellDescription$ Create a 2/2 red Goblin Shaman creature token with "Whenever this creature attacks, create a Treasure token." +SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 2 | Optional$ True | Mode$ TgtChoose | RememberDiscarded$ True | SubAbility$ DBDraw | SpellDescription$ You may discard up two cards. If you do, draw that many cards. +SVar:DBDraw:DB$ Draw | NumCards$ Y | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Y:Remembered$Amount +SVar:DBTransform:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBReturn | SpellDescription$ Exile this Saga, then return it to the battlefield transformed under your control. +SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Transformed$ True | GainControl$ True | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +AlternateMode:DoubleFaced +DeckHas:Ability$Token|Sacrifice|Discard & Type$Artifact|Treasure +Oracle:(As this Saga enters and after your draw step, add a lore counter.)\nI — Create a 2/2 red Goblin Shaman creature token with "Whenever this creature attacks, create a Treasure token."\nII — You may discard up two cards. If you do, draw that many cards.\nIII — Exile this Saga, then return it to the battlefield transformed under your control. + +ALTERNATE + +Name:Reflection of Kiki-Jiki +ManaCost:no cost +Colors:red +Types:Enchantment Creature Goblin Shaman +PT:2/2 +A:AB$ CopyPermanent | Cost$ 1 T | ValidTgts$ Creature.YouCtrl+nonLegendary+Other | TgtPrompt$ Select another target nonlegendary creature you control | AddKeywords$ Haste | AtEOT$ Sacrifice | SpellDescription$ Create a token that's a copy of another target nonlegendary creature you control, except it has haste. Sacrifice it at the beginning of the next end step. +Oracle:{1}, {T}: Create a token that's a copy of another target nonlegendary creature you control, except it has haste. Sacrifice it at the beginning of the next end step. diff --git a/forge-gui/res/tokenscripts/r_2_2_goblin_shaman_treasure.txt b/forge-gui/res/tokenscripts/r_2_2_goblin_shaman_treasure.txt new file mode 100644 index 00000000000..7146956f028 --- /dev/null +++ b/forge-gui/res/tokenscripts/r_2_2_goblin_shaman_treasure.txt @@ -0,0 +1,9 @@ +Name:Goblin Shaman Token +ManaCost:no cost +Types:Creature Goblin Shaman +Colors:red +PT:2/2 +T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever this creature attacks, create a Treasure token. +SVar:TrigToken:DB$ Token | TokenScript$ c_a_treasure_sac +SVar:HasAttackEffect:TRUE +Oracle:Whenever this creature attacks, create a Treasure token.