Search in sources :

Example 6 with CyclingAbility

use of mage.abilities.keyword.CyclingAbility in project mage by magefree.

the class ValiantRescuerWatcher method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    ValiantRescuerWatcher watcher = game.getState().getWatcher(ValiantRescuerWatcher.class);
    if (watcher == null || !watcher.checkSpell(event.getPlayerId(), event.getSourceId()) || game.getState().getStack().isEmpty() || !event.getPlayerId().equals(this.getControllerId()) || event.getSourceId().equals(this.getSourceId())) {
        return false;
    }
    StackObject item = game.getState().getStack().getFirst();
    return item instanceof StackAbility && item.getStackAbility() instanceof CyclingAbility;
}
Also used : CyclingAbility(mage.abilities.keyword.CyclingAbility) StackObject(mage.game.stack.StackObject) StackAbility(mage.game.stack.StackAbility)

Aggregations

CyclingAbility (mage.abilities.keyword.CyclingAbility)6 StackObject (mage.game.stack.StackObject)5 StackAbility (mage.game.stack.StackAbility)2 Player (mage.players.Player)2 Ability (mage.abilities.Ability)1 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 Card (mage.cards.Card)1 FilterCard (mage.filter.FilterCard)1 SharkToken (mage.game.permanent.token.SharkToken)1 CardUtil (mage.util.CardUtil)1