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