From 83a200ef6926bd20a013c67d156ac34d88199ea2 Mon Sep 17 00:00:00 2001 From: Agetian Date: Thu, 19 Jan 2017 18:15:27 +0000 Subject: [PATCH] - A slightly more generic solution for the Necropotence+The Rack problem, seems like the culprit is the "card that was exiled face down returning to hand" scenario does not reset the ETB replacement effects for some reason. Advice and better solution still welcome. --- .../java/forge/game/ability/effects/ChangeZoneEffect.java | 7 +++++-- forge-gui/res/cardsfolder/n/necropotence.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java index d779ef90b3e..d99b12b68ed 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java @@ -435,6 +435,8 @@ public class ChangeZoneEffect extends SpellAbilityEffect { Card movedCard = null; + boolean retExiledFaceDownToHand = originZone.getZoneType().equals(ZoneType.Exile) && destination.equals(ZoneType.Hand) && tgtC.isFaceDown(); + if (destination.equals(ZoneType.Library)) { // library position is zero indexed int libraryPosition = 0; @@ -615,9 +617,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect { } // Without this, for example, The Rack returned from exile to hand via Necropotence has - // its ETB replacement effect missing and does not work. + // its ETB replacement effect missing and does not work (ditto via any other card that + // exiles a card face down and then returns it to hand, e.g. Bane Alley Broker). // TODO: Why does this happen? How generic should this "ETB keyword reset" be and where is it best done? - if (sa.hasParam("ResetETBKeywords")) { + if (retExiledFaceDownToHand) { CardFactoryUtil.setupEtbKeywords(movedCard); } } diff --git a/forge-gui/res/cardsfolder/n/necropotence.txt b/forge-gui/res/cardsfolder/n/necropotence.txt index 1f07811b68b..64cea2c2a5f 100644 --- a/forge-gui/res/cardsfolder/n/necropotence.txt +++ b/forge-gui/res/cardsfolder/n/necropotence.txt @@ -6,7 +6,7 @@ T:Mode$ Discarded | ValidCard$ Card.YouCtrl | TriggerZones$ Battlefield | Execut SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Exile A:AB$ ChangeZone | Cost$ PayLife<1> | Defined$ TopOfLibrary | Origin$ Library | Destination$ Exile | ExileFaceDown$ True | RememberChanged$ True | SubAbility$ DelayedReturn | AILogic$ Necropotence | AILifeThreshold$ 1 | SpellDescription$ Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. SVar:DelayedReturn:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | Execute$ TrigReturn | RememberObjects$ Remembered | TriggerDescription$ Put the exiled card into your hand. | SubAbility$ DBCleanup -SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Hand | ResetETBKeywords$ True | Defined$ DelayTriggerRemembered +SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Hand | Defined$ DelayTriggerRemembered SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:AICastPreference:NeverCastIfLifeBelow$ 7 SVar:RemRandomDeck:True