use of mage.game.permanent.token.Token in project mage by magefree.
the class AcademyManufactorEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
int amount = 0;
Map<Token, Integer> tokens = ((CreateTokenEvent) event).getTokens();
for (Iterator<Map.Entry<Token, Integer>> iter = tokens.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry<Token, Integer> entry = iter.next();
Token token = entry.getKey();
if (token.hasSubtype(SubType.CLUE, game) || token.hasSubtype(SubType.FOOD, game) || token.hasSubtype(SubType.TREASURE, game)) {
amount += entry.getValue();
iter.remove();
}
}
tokens.put(new ClueArtifactToken(), amount);
tokens.put(new FoodToken(), amount);
tokens.put(new TreasureToken(), amount);
return false;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class ArchfiendsVesselEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent archfiendsVessel = source.getSourcePermanentIfItStillExists(game);
if (archfiendsVessel != null) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
boolean moved = controller.moveCards(archfiendsVessel, Zone.EXILED, source, game);
if (moved) {
Token token = new DemonToken();
token.putOntoBattlefield(1, game, source, controller.getId());
}
return true;
}
}
return false;
}
use of mage.game.permanent.token.Token in project mage by magefree.
the class DeathByDragonsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) {
Token token = new DragonToken2();
token.putOntoBattlefield(1, game, source, playerId);
}
}
return true;
}
return false;
}
Aggregations