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