Search in sources :

Example 1 with SharkToken

use of mage.game.permanent.token.SharkToken in project mage by magefree.

the class SharkTyphoonTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (!event.getSourceId().equals(this.getSourceId())) {
        return false;
    }
    StackObject object = game.getStack().getStackObject(event.getSourceId());
    if (object == null || !(object.getStackAbility() instanceof CyclingAbility)) {
        return false;
    }
    this.getEffects().clear();
    this.addEffect(new CreateTokenEffect(new SharkToken(object.getStackAbility().getManaCostsToPay().getX())));
    return true;
}
Also used : CyclingAbility(mage.abilities.keyword.CyclingAbility) StackObject(mage.game.stack.StackObject) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) SharkToken(mage.game.permanent.token.SharkToken)

Example 2 with SharkToken

use of mage.game.permanent.token.SharkToken in project mage by magefree.

the class SharkTyphoonTriggeredAbility method apply.

@Override
public boolean apply(Game game, Ability source) {
    Spell spell = game.getSpellOrLKIStack(getTargetPointer().getFirst(game, source));
    int xValue = 0;
    if (spell != null) {
        xValue = spell.getManaValue();
    }
    return new SharkToken(xValue).putOntoBattlefield(1, game, source, source.getControllerId());
}
Also used : SharkToken(mage.game.permanent.token.SharkToken) Spell(mage.game.stack.Spell)

Aggregations

SharkToken (mage.game.permanent.token.SharkToken)2 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 CyclingAbility (mage.abilities.keyword.CyclingAbility)1 Spell (mage.game.stack.Spell)1 StackObject (mage.game.stack.StackObject)1