Added early eventType check for ContinuousRuleModifying effects.

This commit is contained in:
LevelX2 2015-01-22 22:41:03 +01:00
parent 8ea8e77b88
commit dbffbad3cb
44 changed files with 343 additions and 188 deletions

View file

@ -62,10 +62,14 @@ public class DontUntapInControllersUntapStepSourceEffect extends ContinuousRuleM
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == EventType.UNTAP;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getTurn().getStepType() == PhaseStep.UNTAP
&& event.getType() == EventType.UNTAP
&& event.getTargetId().equals(source.getSourceId())) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && permanent.getControllerId().equals(game.getActivePlayerId())) {