Search in sources :

Example 1 with CreaturesDiedWatcher

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;
}
Also used : Player(mage.players.Player) CreaturesDiedWatcher(mage.watchers.common.CreaturesDiedWatcher)

Aggregations

Player (mage.players.Player)1 CreaturesDiedWatcher (mage.watchers.common.CreaturesDiedWatcher)1