This commit is contained in:
jeffwadsworth 2021-07-29 14:57:27 -05:00
parent 3725c60281
commit 64d533b70f

View file

@ -136,24 +136,23 @@ class PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities ex
@Override @Override
public boolean checksEventType(GameEvent event, Game game) { public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.CAST_SPELL return event.getType() == GameEvent.EventType.TARGET;
|| event.getType() == GameEvent.EventType.ACTIVATE_ABILITY;
} }
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
if (event.getTargetId().equals(playerId)) { if (event.getTargetId().equals(playerId)) {
return false; return true;
} }
} }
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
if (event.getTargetId().equals(permanent.getId())) { if (event.getTargetId().equals(permanent.getId())) {
return false;
}
}
return true; return true;
} }
}
return false;
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {