mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
[BRC] fix The Archimandrite errors
This commit is contained in:
parent
0ed04e0c09
commit
6f1d9fce9c
2 changed files with 28 additions and 3 deletions
|
@ -10,8 +10,8 @@ import mage.abilities.costs.common.TapTargetCost;
|
||||||
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
|
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
|
||||||
import mage.abilities.dynamicvalue.DynamicValue;
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||||
import mage.abilities.dynamicvalue.common.SavedDamageValue;
|
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.effects.common.GainLifeEffect;
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
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.Predicate;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.permanent.TappedPredicate;
|
import mage.filter.predicate.permanent.TappedPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -76,7 +77,7 @@ public final class TheArchimandrite extends CardImpl {
|
||||||
VigilanceAbility.getInstance(), Duration.EndOfTurn, filter
|
VigilanceAbility.getInstance(), Duration.EndOfTurn, filter
|
||||||
).setText("each Advisor, Artificer, and Monk you control gains vigilance"));
|
).setText("each Advisor, Artificer, and Monk you control gains vigilance"));
|
||||||
ability.addEffect(new BoostControlledEffect(
|
ability.addEffect(new BoostControlledEffect(
|
||||||
SavedDamageValue.MANY, StaticValue.get(0), Duration.EndOfTurn,
|
TheArchimandriteValue.instance, StaticValue.get(0), Duration.EndOfTurn,
|
||||||
filter2, false, true
|
filter2, false, true
|
||||||
).setText("and gets +X/+0 until end of turn, where X is the amount of life you gained"));
|
).setText("and gets +X/+0 until end of turn, where X is the amount of life you gained"));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
@ -97,3 +98,27 @@ public final class TheArchimandrite extends CardImpl {
|
||||||
return new TheArchimandrite(this);
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -46,9 +46,9 @@ public class GainLifeControllerTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getPlayerId().equals(this.getControllerId())) {
|
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||||
|
this.getEffects().setValue("gainedLife", event.getAmount());
|
||||||
if (setTargetPointer) {
|
if (setTargetPointer) {
|
||||||
this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
|
this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||||
this.getEffects().setValue("gainedLife", event.getAmount());
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue