Example #1
0
  @Override
  public boolean apply(Spell input, Game game) {
    CastSpellLastTurnWatcher watcher =
        (CastSpellLastTurnWatcher)
            game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getName());

    if (watcher.getSpellOrder(new MageObjectReference(input.getId(), game), game) == 2) {
      return true;
    }

    return false;
  }
 @Override
 public boolean applies(GameEvent event, Ability source, Game game) {
   BoseijuWhoSheltersAllWatcher watcher =
       (BoseijuWhoSheltersAllWatcher)
           game.getState().getWatchers().get("ManaPaidFromBoseijuWhoSheltersAllWatcher");
   Spell spell = game.getStack().getSpell(event.getTargetId());
   if (spell != null && watcher.spells.contains(spell.getId())) {
     if (filter.match(spell.getCard(), game)) {
       return true;
     }
   }
   return false;
 }
Example #3
0
  @Override
  public boolean apply(Game game, Ability source) {

    List<Spell> spellsToCounter = new LinkedList<Spell>();
    for (StackObject stackObject : game.getStack()) {
      if (stackObject instanceof Spell
          && !stackObject.getControllerId().equals(source.getControllerId())) {
        spellsToCounter.add((Spell) stackObject);
      }
    }
    for (Spell spell : spellsToCounter) {
      game.getStack().counter(spell.getId(), source.getSourceId(), game);
    }
    return true;
  }