Search in sources :

Example 1 with SpiritToken

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

the class SokenzanCrucibleOfDefianceEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Token token = new SpiritToken();
    token.putOntoBattlefield(2, game, source);
    game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance()).setTargetPointer(new FixedTargets(token, game)), source);
    return true;
}
Also used : FixedTargets(mage.target.targetpointer.FixedTargets) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) Token(mage.game.permanent.token.Token) SpiritToken(mage.game.permanent.token.SpiritToken) SpiritToken(mage.game.permanent.token.SpiritToken)

Example 2 with SpiritToken

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

the class KirinTouchedOrochiCounterEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    UUID targetId = source.getFirstTarget();
    Card card = game.getCard(targetId);
    if (controller == null || card == null || game.getState().getZone(targetId) != Zone.GRAVEYARD) {
        return false;
    }
    if (!controller.moveCards(card, Zone.EXILED, source, game)) {
        return false;
    }
    ReflexiveTriggeredAbility reflexiveTokenAbility = new ReflexiveTriggeredAbility(new CreateTokenEffect(new SpiritToken()), false);
    game.fireReflexiveTriggeredAbility(reflexiveTokenAbility, source);
    return true;
}
Also used : Player(mage.players.Player) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) SpiritToken(mage.game.permanent.token.SpiritToken) UUID(java.util.UUID) FilterCreatureCard(mage.filter.common.FilterCreatureCard) Card(mage.cards.Card) FilterNoncreatureCard(mage.filter.common.FilterNoncreatureCard)

Example 3 with SpiritToken

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

the class PromiseOfBunreiEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (controller != null && permanent != null) {
        if (permanent.sacrifice(source, game)) {
            return new CreateTokenEffect(new SpiritToken(), 4).apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) SpiritToken(mage.game.permanent.token.SpiritToken)

Example 4 with SpiritToken

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

the class ReleaseToMemoryEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getFirstTarget());
    if (player == null) {
        return false;
    }
    int creatures = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game);
    player.moveCards(player.getGraveyard(), Zone.EXILED, source, game);
    if (creatures > 0) {
        new SpiritToken().putOntoBattlefield(creatures, game, source);
    }
    return true;
}
Also used : Player(mage.players.Player) SpiritToken(mage.game.permanent.token.SpiritToken)

Example 5 with SpiritToken

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

the class SekkiSeasonsGuideEffect method replaceEvent.

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    int damage = event.getAmount();
    preventDamageAction(event, source, game);
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
        permanent.removeCounters(CounterType.P1P1.createInstance(damage), source, game);
    }
    new CreateTokenEffect(new SpiritToken(), damage).apply(game, source);
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) TargetControlledPermanent(mage.target.common.TargetControlledPermanent) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) SpiritToken(mage.game.permanent.token.SpiritToken)

Aggregations

SpiritToken (mage.game.permanent.token.SpiritToken)5 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)3 Player (mage.players.Player)3 Permanent (mage.game.permanent.Permanent)2 UUID (java.util.UUID)1 ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)1 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)1 Card (mage.cards.Card)1 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)1 FilterCreatureCard (mage.filter.common.FilterCreatureCard)1 FilterNoncreatureCard (mage.filter.common.FilterNoncreatureCard)1 Token (mage.game.permanent.token.Token)1 TargetControlledPermanent (mage.target.common.TargetControlledPermanent)1 FixedTargets (mage.target.targetpointer.FixedTargets)1