Search in sources :

Example 1 with SmokeBlessingToken

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

the class SmokeSpiritsAidEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Token token = new SmokeBlessingToken();
    for (UUID targetId : getTargetPointer().getTargets(game, source)) {
        Permanent permanent = game.getPermanent(targetId);
        if (permanent == null) {
            continue;
        }
        token.putOntoBattlefield(1, game, source);
        for (UUID tokenId : token.getLastAddedTokenIds()) {
            Permanent aura = game.getPermanent(tokenId);
            if (aura == null) {
                continue;
            }
            aura.getAbilities().get(0).getTargets().get(0).add(source.getFirstTarget(), game);
            aura.getAbilities().get(0).getEffects().get(0).apply(game, aura.getAbilities().get(0));
        }
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) SmokeBlessingToken(mage.game.permanent.token.SmokeBlessingToken) SmokeBlessingToken(mage.game.permanent.token.SmokeBlessingToken) Token(mage.game.permanent.token.Token) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 Permanent (mage.game.permanent.Permanent)1 SmokeBlessingToken (mage.game.permanent.token.SmokeBlessingToken)1 Token (mage.game.permanent.token.Token)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1