use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class SharkTyphoonTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!event.getSourceId().equals(this.getSourceId())) {
return false;
}
StackObject object = game.getStack().getStackObject(event.getSourceId());
if (object == null || !(object.getStackAbility() instanceof CyclingAbility)) {
return false;
}
this.getEffects().clear();
this.addEffect(new CreateTokenEffect(new SharkToken(object.getStackAbility().getManaCostsToPay().getX())));
return true;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class StitcherGeralfEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Cards cards = new CardsImpl();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
cards.addAll(player.millCards(3, source, game));
}
}
cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.GRAVEYARD);
TargetCard target = new TargetCard(0, 2, Zone.GRAVEYARD, new FilterCreatureCard("creature cards to exile"));
controller.chooseTarget(outcome, cards, target, source, game);
int power = 0;
for (UUID cardId : target.getTargets()) {
Card card = game.getCard(cardId);
if (card != null) {
power += card.getPower().getValue();
controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.GRAVEYARD, true);
}
}
return new CreateTokenEffect(new StitcherGeralfZombieToken(power)).apply(game, source);
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class ChandraDrawEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
CreateTokenEffect effect = new CreateTokenEffect(new ElementalTokenWithHaste(), 2);
effect.apply(game, source);
effect.exileTokensCreatedAtNextEndStep(game, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect in project mage by magefree.
the class CorpseweftEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int amount = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof ExileFromGraveCost) {
amount = ((ExileFromGraveCost) cost).getExiledCards().size() * 2;
new CreateTokenEffect(new CorpseweftZombieToken(amount, amount), 1, true, false).apply(game, source);
}
}
if (amount > 0) {
}
}
return false;
}
use of mage.abilities.effects.common.CreateTokenEffect 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