Add Addendum condition

master
Ada Joule 2019-01-16 17:27:05 +07:00
parent e42b42c829
commit fcb38517b3
2 changed files with 16 additions and 0 deletions

View File

@ -950,4 +950,14 @@ public abstract class MagicCondition implements MagicMatchedCostEvent {
return player.controlsPermanent(MagicTargetFilterFactory.LEGENDARY_CREATURE_OR_PLANESWALKER);
}
};
public static MagicCondition ADDENDUM = new MagicCondition() {
@Override
public boolean accept(final MagicSource source) {
final MagicCardOnStack spell = (MagicCardOnStack)source;
final MagicGame game = source.getGame();
final MagicPhaseType phaseType = game.getPhase().getType();
return spell.isCast() && spell.isController(game.getTurnPlayer()) && (phaseType == MagicPhaseType.FirstMain || phaseType == MagicPhaseType.SecondMain);
}
};
}

View File

@ -799,6 +799,12 @@ public enum MagicConditionParser {
return MagicCondition.HAS_THE_CITYS_BLESSING;
}
},
Addendum("you cast this spell during your main phase") {
@Override
public MagicCondition toCondition(final Matcher arg) {
return MagicCondition.ADDENDUM;
}
},
;
private final Pattern pattern;