Search in sources :

Example 1 with AngelToken

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

the class InvocationOfSaintTraftEffect method apply.

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

Example 2 with AngelToken

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

the class DevoutInvocationEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
        return false;
    }
    TargetPermanent target = new TargetControlledPermanent(0, Integer.MAX_VALUE, DevoutInvocation.filter, true);
    controller.choose(outcome, target, source.getSourceId(), game);
    if (target.getTargets().isEmpty()) {
        return false;
    }
    int tappedAmount = 0;
    for (UUID permanentId : target.getTargets()) {
        Permanent permanent = game.getPermanent(permanentId);
        if (permanent != null && permanent.tap(source, game)) {
            tappedAmount++;
        }
    }
    if (tappedAmount > 0) {
        AngelToken angelToken = new AngelToken();
        angelToken.putOntoBattlefield(tappedAmount, game, source, source.getControllerId());
    }
    return true;
}
Also used : TargetControlledPermanent(mage.target.common.TargetControlledPermanent) Player(mage.players.Player) AngelToken(mage.game.permanent.token.AngelToken) Permanent(mage.game.permanent.Permanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) TargetControlledPermanent(mage.target.common.TargetControlledPermanent) TargetPermanent(mage.target.TargetPermanent) TargetPermanent(mage.target.TargetPermanent) UUID(java.util.UUID) ValueHint(mage.abilities.hint.ValueHint)

Example 3 with AngelToken

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

the class GeistOfSaintTraftEffect method apply.

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

Aggregations

AngelToken (mage.game.permanent.token.AngelToken)3 Player (mage.players.Player)3 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)2 UUID (java.util.UUID)1 ValueHint (mage.abilities.hint.ValueHint)1 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 TargetPermanent (mage.target.TargetPermanent)1 TargetControlledPermanent (mage.target.common.TargetControlledPermanent)1