use of mage.game.permanent.token.Token in project mage by magefree.
the class DovescapeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source));
int spellCMC = 0;
UUID spellControllerID = null;
if (spell != null) {
spellCMC = spell.getManaValue();
spellControllerID = spell.getControllerId();
game.getStack().counter(spell.getId(), source, game);
}
Token token = new DovescapeToken();
token.putOntoBattlefield(spellCMC, game, source, spellControllerID);
return true;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class ForceOfRageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new AkoumStonewakerElementalToken();
token.putOntoBattlefield(2, game, source, source.getControllerId());
List<Permanent> permanentList = new ArrayList();
for (UUID permId : token.getLastAddedTokenIds()) {
permanentList.add(game.getPermanent(permId));
}
Effect effect = new SacrificeTargetEffect("sacrifice those tokens");
effect.setTargetPointer(new FixedTargets(permanentList, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect), source);
return true;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class GeminiEngineCreateTokenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
Token token;
if (permanent != null) {
token = new GeminiEngineTwinToken(permanent.getPower().getValue(), permanent.getToughness().getValue());
} else {
token = new GeminiEngineTwinToken(0, 0);
}
token.putOntoBattlefield(1, game, source, source.getControllerId(), false, true);
for (UUID tokenId : token.getLastAddedTokenIds()) {
Permanent tokenPerm = game.getPermanent(tokenId);
if (tokenPerm != null) {
Effect effect = new SacrificeTargetEffect("sacrifice " + tokenPerm.getLogName(), player.getId());
effect.setTargetPointer(new FixedTarget(tokenPerm, game));
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(effect), source);
}
}
return true;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class GeistSnatchCounterTargetEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
game.getStack().counter(source.getFirstTarget(), source, game);
Token token = new SpiritBlueToken();
token.putOntoBattlefield(1, game, source, source.getControllerId());
return true;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class GristTheHungerTideTokenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
Token token = new IzoniInsectToken();
while (true) {
token.putOntoBattlefield(1, game, source, source.getControllerId());
if (player.millCards(1, source, game).count(filter, game) < 1) {
break;
}
if (permanent != null) {
permanent.addCounters(CounterType.LOYALTY.createInstance(), source.getControllerId(), source, game);
}
}
return true;
}
Aggregations