From 6f1d9fce9c337ce1ab26e5ce65c48a76070bc3fa Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 12 Nov 2022 14:07:32 -0500 Subject: [PATCH] [BRC] fix The Archimandrite errors --- .../src/mage/cards/t/TheArchimandrite.java | 29 +++++++++++++++++-- .../GainLifeControllerTriggeredAbility.java | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TheArchimandrite.java b/Mage.Sets/src/mage/cards/t/TheArchimandrite.java index 7a2a5f5968..9a930d6d88 100644 --- a/Mage.Sets/src/mage/cards/t/TheArchimandrite.java +++ b/Mage.Sets/src/mage/cards/t/TheArchimandrite.java @@ -10,8 +10,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.dynamicvalue.AdditiveDynamicValue; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; -import mage.abilities.dynamicvalue.common.SavedDamageValue; import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; @@ -26,6 +26,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicate; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -76,7 +77,7 @@ public final class TheArchimandrite extends CardImpl { VigilanceAbility.getInstance(), Duration.EndOfTurn, filter ).setText("each Advisor, Artificer, and Monk you control gains vigilance")); ability.addEffect(new BoostControlledEffect( - SavedDamageValue.MANY, StaticValue.get(0), Duration.EndOfTurn, + TheArchimandriteValue.instance, StaticValue.get(0), Duration.EndOfTurn, filter2, false, true ).setText("and gets +X/+0 until end of turn, where X is the amount of life you gained")); this.addAbility(ability); @@ -97,3 +98,27 @@ public final class TheArchimandrite extends CardImpl { return new TheArchimandrite(this); } } + +enum TheArchimandriteValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return (Integer) effect.getValue("gainedLife"); + } + + @Override + public TheArchimandriteValue copy() { + return this; + } + + @Override + public String getMessage() { + return ""; + } + + @Override + public String toString() { + return "X"; + } +} diff --git a/Mage/src/main/java/mage/abilities/common/GainLifeControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/GainLifeControllerTriggeredAbility.java index 45ef253bc0..20fc40c1af 100644 --- a/Mage/src/main/java/mage/abilities/common/GainLifeControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/GainLifeControllerTriggeredAbility.java @@ -46,9 +46,9 @@ public class GainLifeControllerTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { + this.getEffects().setValue("gainedLife", event.getAmount()); if (setTargetPointer) { this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId())); - this.getEffects().setValue("gainedLife", event.getAmount()); } return true; }