use of mage.watchers.common.CreaturesDiedWatcher in project mage by magefree.
the class BontuTheGlorifiedRestrictionEffect method applies.
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
Player controller = game.getPlayer(source.getControllerId());
CreaturesDiedWatcher watcher = game.getState().getWatcher(CreaturesDiedWatcher.class);
if (controller != null && watcher != null) {
return (watcher.getAmountOfCreaturesDiedThisTurnByController(controller.getId()) == 0);
}
return true;
}
// do not apply to other creatures.
return false;
}
Aggregations