Package mage.watchers

Examples of mage.watchers.Watcher


  }

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getType() == EventType.DECLARE_ATTACKER && source.getSourceId().equals(event.getSourceId())) {
      Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "OpponentDamaged");
      if (watcher != null)
        return !watcher.conditionMet();
    }
    return false;
  }
View Full Code Here


    return new ArchiveTrapAlternativeCost(this);
  }

  @Override
  public boolean isAvailable(Game game, Ability source) {
    Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "LibrarySearched");
    if (watcher != null && watcher.conditionMet())
      return true;
    return false;
  }
View Full Code Here

    return new SearingBlazeEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "LandPlayed");
    Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
    Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
    if (watcher != null && watcher.conditionMet()) {
      if (player != null) {
        player.damage(3, source.getId(), game, false, true);
      }
      if (creature != null) {
        creature.damage(3, source.getId(), game, true, false);
View Full Code Here

  }

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getType() == EventType.DECLARE_ATTACKER && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
      Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "CastSpell");
      if (watcher != null && watcher.conditionMet())
        return true;
    }
    return false;
  }
View Full Code Here

  }

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getType() == EventType.CAST_SPELL && game.getActivePlayerId().equals(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
      Watcher watcher = game.getState().getWatchers().get(source.getControllerId(), "Attacked");
      if (watcher != null && watcher.conditionMet())
        return true;
    }
    return false;
  }
View Full Code Here

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
      Watcher watcher = game.getState().getWatchers().get(controllerId, "CreatureCast");
      if (watcher != null && watcher.conditionMet()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

        return new CobraTrapAlternativeCost(this);
    }

    @Override
    public boolean isAvailable(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("noncreature permanent destroyed", source.getControllerId());
        if (watcher != null && watcher.conditionMet()) {
            return true;
        }
        return false;
    }
View Full Code Here

public class CastFromHandCondition implements Condition {
    @Override
    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null) {
            Watcher watcher = game.getState().getWatchers().get("CastFromHand", source.getSourceId());
            if (watcher != null && watcher.conditionMet()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    private LandfallCondition() {
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId());
        return watcher.conditionMet();
    }
View Full Code Here

        return new MindbreakTrapAlternativeCost(this);
    }

    @Override
    public boolean isAvailable(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("opponent cast three or more spells", source.getControllerId());
        if (watcher != null && watcher.conditionMet()) {
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of mage.watchers.Watcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.