Search in sources :

Example 1 with CastSpellLastTurnWatcher

use of mage.watchers.common.CastSpellLastTurnWatcher in project mage by magefree.

the class PeerlessSamuraiEffect method init.

@Override
public void init(Ability source, Game game) {
    super.init(source, game);
    CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
    if (watcher != null) {
        spellsCast = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId());
    }
}
Also used : CastSpellLastTurnWatcher(mage.watchers.common.CastSpellLastTurnWatcher)

Example 2 with CastSpellLastTurnWatcher

use of mage.watchers.common.CastSpellLastTurnWatcher in project mage by magefree.

the class IrencragFeatCantCastEffect method applies.

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
    CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
    int spellsCast = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId());
    // If spellsCast is greater the player has already cast a spell after Irencrag Feat
    return event.getPlayerId().equals(source.getControllerId()) && spellsCast > start;
}
Also used : CastSpellLastTurnWatcher(mage.watchers.common.CastSpellLastTurnWatcher)

Example 3 with CastSpellLastTurnWatcher

use of mage.watchers.common.CastSpellLastTurnWatcher in project mage by magefree.

the class MonologueTaxTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    Player player = game.getPlayer(getControllerId());
    CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
    return player != null && watcher != null && player.hasOpponent(event.getPlayerId(), game) && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2;
}
Also used : Player(mage.players.Player) CastSpellLastTurnWatcher(mage.watchers.common.CastSpellLastTurnWatcher)

Example 4 with CastSpellLastTurnWatcher

use of mage.watchers.common.CastSpellLastTurnWatcher in project mage by magefree.

the class HardenedBerserkerSpellsCostReductionEffect method init.

@Override
public void init(Ability source, Game game) {
    super.init(source, game);
    CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
    if (watcher != null) {
        spellsCast = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId());
    }
}
Also used : CastSpellLastTurnWatcher(mage.watchers.common.CastSpellLastTurnWatcher)

Example 5 with CastSpellLastTurnWatcher

use of mage.watchers.common.CastSpellLastTurnWatcher in project mage by magefree.

the class SaheeliTheGiftedTokenEffect method init.

@Override
public void init(Ability source, Game game) {
    super.init(source, game);
    CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
    if (watcher != null) {
        spellsCast = watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId());
    }
}
Also used : CastSpellLastTurnWatcher(mage.watchers.common.CastSpellLastTurnWatcher)

Aggregations

CastSpellLastTurnWatcher (mage.watchers.common.CastSpellLastTurnWatcher)9 Player (mage.players.Player)3 MageObject (mage.MageObject)1 BasicManaEffect (mage.abilities.effects.mana.BasicManaEffect)1 Card (mage.cards.Card)1