This commit is contained in:
jeffwadsworth 2020-02-28 08:53:48 -06:00
parent 97767a0be1
commit 190c3ecc00

View file

@ -25,7 +25,8 @@ public final class Abeyance extends CardImpl {
public Abeyance(UUID ownerId, CardSetInfo setInfo) { public Abeyance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
// Until end of turn, target player can't cast instant or sorcery spells, and that player can't activate abilities that aren't mana abilities. // Until end of turn, target player can't cast instant or sorcery
// spells, and that player can't activate abilities that aren't mana abilities.
this.getSpellAbility().addEffect(new AbeyanceEffect()); this.getSpellAbility().addEffect(new AbeyanceEffect());
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
@ -47,8 +48,8 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
AbeyanceEffect() { AbeyanceEffect() {
super(Duration.EndOfTurn, Outcome.Detriment); super(Duration.EndOfTurn, Outcome.Detriment);
staticText = "Until end of turn, target player can't cast instant or sorcery spells, " + staticText = "Until end of turn, target player can't cast instant or sorcery spells, "
"and that player can't activate abilities that aren't mana abilities"; + "and that player can't activate abilities that aren't mana abilities";
} }
private AbeyanceEffect(final AbeyanceEffect effect) { private AbeyanceEffect(final AbeyanceEffect effect) {
@ -69,8 +70,8 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
public String getInfoMessage(Ability source, GameEvent event, Game game) { public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId()); MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) { if (mageObject != null) {
return "You can't cast instant or sorcery spells or activate abilities " + return "You can't cast instant or sorcery spells or activate abilities "
"that aren't mana abilities this turn (" + mageObject.getIdName() + ")."; + "that aren't mana abilities this turn (" + mageObject.getIdName() + ").";
} }
return null; return null;
} }
@ -78,7 +79,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (source.getFirstTarget() != null if (source.getFirstTarget() != null
&& source.getFirstTarget().equals(event.getPlayerId())) { && !source.getFirstTarget().equals(event.getPlayerId())) {
return false; return false;
} }
MageObject object = game.getObject(event.getSourceId()); MageObject object = game.getObject(event.getSourceId());
@ -91,7 +92,8 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
} }
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId()); Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
return ability.isPresent() && !(ability.get() instanceof ActivatedManaAbilityImpl); return ability.isPresent()
&& !(ability.get() instanceof ActivatedManaAbilityImpl);
} }
return false; return false;
} }