From efd69b815353ec321b0c42f7395c17a1f37b3e99 Mon Sep 17 00:00:00 2001 From: Klisz Date: Tue, 5 Dec 2023 14:02:12 -0700 Subject: [PATCH] SLD: the_fourteenth_doctor.txt + support --- .../game/ability/effects/CloneEffect.java | 24 +++++++++++++++++++ .../upcoming/the_fourteenth_doctor.txt | 11 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/the_fourteenth_doctor.txt diff --git a/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java index 9a4baa05ece..4118e80fc72 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CloneEffect.java @@ -152,6 +152,7 @@ public class CloneEffect extends SpellAbilityEffect { if (!pumpKeywords.isEmpty()) { tgtCard.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, ts, 0); + addPumpUntil(sa, tgtCard, ts); } tgtCard.updateStateForView(); @@ -202,4 +203,27 @@ public class CloneEffect extends SpellAbilityEffect { } } + protected void addPumpUntil(SpellAbility sa, final Card c, long timestamp) { + if (!sa.hasParam("PumpDuration")) { + return; + } + final String duration = sa.getParam("PumpDuration"); + final Card host = sa.getHostCard(); + final Game game = host.getGame(); + final GameCommand untilEOT = new GameCommand() { + private static final long serialVersionUID = -42244224L; + + @Override + public void run() { + c.removeChangedCardKeywords(timestamp, 0); + game.fireEvent(new GameEventCardStatsChanged(c)); + } + }; + + if ("UntilYourNextTurn".equals(duration)) { + game.getCleanup().addUntil(sa.getActivatingPlayer(), untilEOT); + } else { + game.getEndOfTurn().addUntil(untilEOT); + } + } } diff --git a/forge-gui/res/cardsfolder/upcoming/the_fourteenth_doctor.txt b/forge-gui/res/cardsfolder/upcoming/the_fourteenth_doctor.txt new file mode 100644 index 00000000000..c27b65fbedd --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/the_fourteenth_doctor.txt @@ -0,0 +1,11 @@ +Name:The Fourteenth Doctor +ManaCost:RG W U +Types:Legendary Creature Time Lord Doctor +PT:3/4 +T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ When you cast this spell, reveal the top fourteen cards of your library. Put all Doctor cards revealed this way into your graveyard and the rest on the bottom of your library in a random order. +SVar:TrigDig:DB$ Dig | DigNum$ 14 | Reveal$ True | ChangeNum$ All | ChangeValid$ Doctor | DestinationZone$ Graveyard | RestRandomOrder$ True +K:ETBReplacement:Copy:DBCopy:Optional +SVar:DBCopy:DB$ Clone | Choices$ Doctor.YouOwn+ThisTurnEnteredFrom_Library | ChoiceZone$ Graveyard | PumpKeywords$ Haste | PumpDuration$ EOT | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of a Doctor card in your graveyard that was put there from your library this turn. If you do, it gains haste until end of turn. +DeckHas:Ability$Graveyard +DeckNeeds:Type$Doctor +Oracle:When you cast this spell, reveal the top fourteen cards of your library. Put all Doctor cards revealed this way into your graveyard and the rest on the bottom of your library in a random order.\nYou may have The Fourteenth Doctor enter the battlefield as a copy of a Doctor card in your graveyard that was put there from your library this turn. If you do, it gains haste until end of turn. \ No newline at end of file