use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class ElementalAppealEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
CreateTokenEffect effect = new CreateTokenEffect(new RedElementalWithTrampleAndHaste());
if (effect.apply(game, source)) {
effect.exileTokensCreatedAtNextEndStep(game, source);
if (KickedCondition.instance.apply(game, source)) {
List<Predicate<MageObject>> predList = new ArrayList<>();
for (UUID tokenId : effect.getLastAddedTokenIds()) {
predList.add(new CardIdPredicate(tokenId));
}
if (!predList.isEmpty()) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(Predicates.or(predList));
game.addEffect(new BoostAllEffect(7, 0, Duration.EndOfTurn, filter, false), source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class FeudkillersVerdictEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.gainLife(10, game, source);
boolean moreLife = false;
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
if (controller.getLife() > opponent.getLife()) {
moreLife = true;
break;
}
}
}
if (moreLife) {
return new CreateTokenEffect(new GiantWarriorToken(), 1).apply(game, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class HazezonTamarEntersEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Effect effect = new CreateTokenEffect(new HazezonTamarSandWarriorToken(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent()));
effect.setText("create X 1/1 Sand Warrior creature tokens that are red, green, and white, where X is the number of lands you control at that time");
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class MyrIncubatorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && controller.searchLibrary(target, source, game)) {
if (!target.getTargets().isEmpty()) {
tokensToCreate = target.getTargets().size();
controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game);
}
CreateTokenEffect effect = new CreateTokenEffect(new MyrToken(), tokensToCreate);
effect.apply(game, source);
controller.shuffleLibrary(source, game);
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class NoosegrafMobEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && permanent != null && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) {
permanent.removeCounters(CounterType.P1P1.createInstance(), source, game);
Effect effect = new CreateTokenEffect(new ZombieToken());
return effect.apply(game, source);
}
return false;
}
Aggregations