From 5df9127e01f5ae82a7e8c49b6f1c55bc560db28c Mon Sep 17 00:00:00 2001 From: Jeff Wadsworth Date: Tue, 3 Dec 2024 14:18:57 -0600 Subject: [PATCH] Fixed #13064 --- Mage.Sets/src/mage/cards/e/ElvishBranchbender.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/e/ElvishBranchbender.java b/Mage.Sets/src/mage/cards/e/ElvishBranchbender.java index 93697a497f07..cb7a22c9f91a 100644 --- a/Mage.Sets/src/mage/cards/e/ElvishBranchbender.java +++ b/Mage.Sets/src/mage/cards/e/ElvishBranchbender.java @@ -16,8 +16,10 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.TokenImpl; import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; /** * @@ -78,13 +80,18 @@ public ElvishBranchbenderEffect copy() { @Override public boolean apply(Game game, Ability source) { int xValue = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); + Permanent targetForest = game.getPermanent(this.getTargetPointer().copy().getFirst(game, source)); + if (targetForest == null) { + return false; + } ContinuousEffect effect = new BecomesCreatureTargetEffect( new ElvishBranchbenderToken(xValue), false, false, Duration.EndOfTurn) .withDurationRuleAtStart(true); - effect.setTargetPointer(this.getTargetPointer().copy()); + // works well with blinked effects + effect.setTargetPointer(new FixedTarget(targetForest, game)); game.addEffect(effect, source); - return false; + return true; } } @@ -101,6 +108,7 @@ private ElvishBranchbenderToken(final ElvishBranchbenderToken token) { super(token); } + @Override public ElvishBranchbenderToken copy() { return new ElvishBranchbenderToken(this); }