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;
}
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());
}
Aggregations