}
GameEvent event = GameEvent.getEvent(EventType.CREATE_TOKEN, null, sourceId, controllerId, amount);
if (!game.replaceEvent(event)) {
amount = event.getAmount();
for (int i = 0; i < amount; i++) {
PermanentToken newToken = new PermanentToken(this, controllerId, setCode, game);
game.getState().addCard(newToken);
game.addPermanent(newToken);
if (tapped) {
newToken.setTapped(true);
}
this.lastAddedTokenIds.add(newToken.getId());
this.lastAddedTokenId = newToken.getId();
game.setScopeRelevant(true);
game.applyEffects();
newToken.entersBattlefield(sourceId, game, Zone.OUTSIDE, true);
game.setScopeRelevant(false);
game.applyEffects();
game.fireEvent(new ZoneChangeEvent(newToken, controllerId, Zone.OUTSIDE, Zone.BATTLEFIELD));
if (attacking && game.getCombat() != null) {
game.getCombat().addAttackingCreature(newToken.getId(), game);
}
}
game.informPlayers(new StringBuilder(controller.getName()).append(" puts ")
.append(CardUtil.numberToText(amount, "a")).append(" ").append(this.getName()).append(" token").append(amount==1?"":"s")
.append(" onto the battlefield").toString());