From 387e74d031361b819c4c7e0d86988a9bdb52c4fd Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 9 Nov 2022 19:51:59 -0500 Subject: [PATCH 1/5] the_temporal_anchor.txt --- .../res/cardsfolder/upcoming/the_temporal_anchor.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt diff --git a/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt b/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt new file mode 100644 index 00000000000..3def10df6fb --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt @@ -0,0 +1,10 @@ +Name:The Temporal Anchor +ManaCost:3 U U U +Types:Legendary Artifact +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigScry | TriggerDescription$ At the beginning of your upkeep, scry 2. +SVar:TrigScry:DB$ Scry | ScryNum$ 2 +T:Mode$ Scry | ValidPlayer$ You | ToBottom$ True | Execute$ TrigExile | TriggerDescription$ Whenever you choose to put one or more cards on the bottom of your library while scrying, exile that many cards from the bottom of your library. +SVar:TrigExile:DB$ Dig | DigNum$ X | ChangeNum$ All | FromBottom$ True | DestinationZone$ Exile +SVar:X:TriggerCount$ScryBottom +S:Mode$ Continuous | Condition$ PlayerTurn | MayPlay$ True | Affected$ Card.ExiledWithSource | AffectedZone$ Exile | Description$ During your turn, you may play cards exiled with CARDNAME. +Oracle:At the beginning of your upkeep, scry 2.\nWhenever you choose to put one or more cards on the bottom of your library while scrying, exile that many cards from the bottom of your library.\nDuring your turn, you may play cards exiled with The Temporal Anchor. From d56f68824541933c3c7362175a37fdc2368483ca Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 9 Nov 2022 19:56:57 -0500 Subject: [PATCH 2/5] king_narfis_betrayal.txt fix bad Desc --- forge-gui/res/cardsfolder/k/king_narfis_betrayal.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/k/king_narfis_betrayal.txt b/forge-gui/res/cardsfolder/k/king_narfis_betrayal.txt index 7b08301d5af..09f8e1842f5 100644 --- a/forge-gui/res/cardsfolder/k/king_narfis_betrayal.txt +++ b/forge-gui/res/cardsfolder/k/king_narfis_betrayal.txt @@ -8,6 +8,6 @@ SVar:DBChooseCard:DB$ ChooseCard | Defined$ You | Choices$ Creature.RememberedPl SVar:DBExile:DB$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card.IsRemembered SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearChosenCard$ True SVar:DBEffect:DB$ Effect | StaticAbilities$ PlayExile | SpellDescription$ Until end of turn, you may cast spells from among cards exiled with CARDNAME, and you may spend mana as though it were mana of any color to cast those spells. -SVar:PlayExile:Mode$ Continuous | MayPlayIgnoreType$ True | MayPlayIgnoreColor$ True | MayPlay$ True | Affected$ Card.ExiledWithEffectSource+nonLand | AffectedZone$ Exile | Description$ You may play cards exiled with EFFECTSOURCE, and you may spend mana as though it were mana of any color to cast those spells. +SVar:PlayExile:Mode$ Continuous | MayPlayIgnoreType$ True | MayPlayIgnoreColor$ True | MayPlay$ True | Affected$ Card.ExiledWithEffectSource+nonLand | AffectedZone$ Exile | Description$ Until end of turn, you may cast spells from among cards exiled with EFFECTSOURCE, and you may spend mana as though it were mana of any color to cast those spells. DeckHas:Ability$Mill Oracle:(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)\nI — Each player mills four cards. Then you may exile a creature or planeswalker card from each graveyard.\nII, III — Until end of turn, you may cast spells from among cards exiled with King Narfi's Betrayal, and you may spend mana as though it were mana of any color to cast those spells. From f37305a304fc01ae2437f1e792658adf612e5e81 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 9 Nov 2022 19:58:31 -0500 Subject: [PATCH 3/5] DigEffect support "FromBottom" ! --- .../java/forge/game/ability/effects/DigEffect.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java index 0997113d95f..659b86dd55e 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DigEffect.java @@ -184,11 +184,15 @@ public class DigEffect extends SpellAbilityEffect { } final CardCollection top = new CardCollection(); final CardCollection rest = new CardCollection(); - final PlayerZone sourceZone = p.getZone(srcZone); + CardCollection all = new CardCollection(p.getCardsIn(srcZone)); - int numToDig = Math.min(digNum, sourceZone.size()); + if (sa.hasParam("FromBottom")) { + Collections.reverse(all); + } + + int numToDig = Math.min(digNum, all.size()); for (int i = 0; i < numToDig; i++) { - top.add(sourceZone.get(i)); + top.add(all.get(i)); } if (!top.isEmpty()) { From 5f29af78ad019bff0c83594474a9e9ad673d5932 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 9 Nov 2022 20:00:00 -0500 Subject: [PATCH 4/5] TriggerScry "ToBottom" condition and value for the Temporal Anchor --- forge-game/src/main/java/forge/game/GameAction.java | 1 + .../src/main/java/forge/game/ability/AbilityKey.java | 1 + .../src/main/java/forge/game/trigger/TriggerScry.java | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 6f4961a9c77..fa13fa72e18 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -2343,6 +2343,7 @@ public class GameAction { // set up triggers (but not actually do them until later) final Map runParams = AbilityKey.mapFromPlayer(p); runParams.put(AbilityKey.ScryNum, numLookedAt); + runParams.put(AbilityKey.ScryBottom, toBottom.size()); game.getTriggerHandler().runTrigger(TriggerType.Scry, runParams, false); } } diff --git a/forge-game/src/main/java/forge/game/ability/AbilityKey.java b/forge-game/src/main/java/forge/game/ability/AbilityKey.java index f294102e414..72c85a515f5 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityKey.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityKey.java @@ -112,6 +112,7 @@ public enum AbilityKey { Result("Result"), RoomName("RoomName"), Scheme("Scheme"), + ScryBottom("ScryBottom"), ScryNum("ScryNum"), Sides("Sides"), Source("Source"), diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerScry.java b/forge-game/src/main/java/forge/game/trigger/TriggerScry.java index 05a90284011..fb60533557f 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerScry.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerScry.java @@ -58,13 +58,20 @@ public class TriggerScry extends Trigger { return false; } + if (hasParam("ToBottom")) { + Integer numBottom = (Integer) runParams.get(AbilityKey.ScryBottom); + if (numBottom <= 0) { + return false; + } + } + return true; } /** {@inheritDoc} */ @Override public final void setTriggeringObjects(final SpellAbility sa, Map runParams) { - sa.setTriggeringObjectsFrom(runParams, AbilityKey.Player, AbilityKey.ScryNum); + sa.setTriggeringObjectsFrom(runParams, AbilityKey.Player, AbilityKey.ScryNum, AbilityKey.ScryBottom); } @Override From 207e278405d02049b398b18879064904df1b8995 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Thu, 10 Nov 2022 11:03:40 -0500 Subject: [PATCH 5/5] the_temporal_anchor.txt +boilerplate exile handling --- .../res/cardsfolder/upcoming/the_temporal_anchor.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt b/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt index 3def10df6fb..9d75974dfec 100644 --- a/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt +++ b/forge-gui/res/cardsfolder/upcoming/the_temporal_anchor.txt @@ -4,7 +4,11 @@ Types:Legendary Artifact T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigScry | TriggerDescription$ At the beginning of your upkeep, scry 2. SVar:TrigScry:DB$ Scry | ScryNum$ 2 T:Mode$ Scry | ValidPlayer$ You | ToBottom$ True | Execute$ TrigExile | TriggerDescription$ Whenever you choose to put one or more cards on the bottom of your library while scrying, exile that many cards from the bottom of your library. -SVar:TrigExile:DB$ Dig | DigNum$ X | ChangeNum$ All | FromBottom$ True | DestinationZone$ Exile +SVar:TrigExile:DB$ Dig | DigNum$ X | ChangeNum$ All | FromBottom$ True | DestinationZone$ Exile | RememberChanged$ True SVar:X:TriggerCount$ScryBottom -S:Mode$ Continuous | Condition$ PlayerTurn | MayPlay$ True | Affected$ Card.ExiledWithSource | AffectedZone$ Exile | Description$ During your turn, you may play cards exiled with CARDNAME. +S:Mode$ Continuous | Condition$ PlayerTurn | MayPlay$ True | Affected$ Card.ExiledWithSource+IsRemembered | AffectedZone$ Exile | Description$ During your turn, you may play cards exiled with CARDNAME. +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ DBCleanup | Static$ True +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget +SVar:DBForget:DB$ Pump | ForgetObjects$ TriggeredCard Oracle:At the beginning of your upkeep, scry 2.\nWhenever you choose to put one or more cards on the bottom of your library while scrying, exile that many cards from the bottom of your library.\nDuring your turn, you may play cards exiled with The Temporal Anchor.