Fixes to token image handling.

This commit is contained in:
LevelX2 2015-07-19 10:09:50 +02:00
parent 6ef50c42bf
commit 4324a6a683
14 changed files with 356 additions and 71 deletions

View file

@ -47,9 +47,8 @@ public class DeployToTheFront extends CardImpl {
super(ownerId, 6, "Deploy to the Front", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}");
this.expansionSetCode = "C14";
// Put X 1/1 white Soldier creature tokens onto the battlefield, where X is the number of creatures on the battlefield.
Effect effect = new CreateTokenEffect(new SoldierToken("C14"), new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("the number of creatures on the battlefield")));
Effect effect = new CreateTokenEffect(new SoldierToken(), new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("the number of creatures on the battlefield")));
effect.setText("Put X 1/1 white Soldier creature tokens onto the battlefield, where X is the number of creatures on the battlefield");
this.getSpellAbility().addEffect(effect);
}

View file

@ -51,7 +51,6 @@ public class FirstResponse extends CardImpl {
super(ownerId, 12, "First Response", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.expansionSetCode = "M15";
// At the beginning of each upkeep, if you lost life last turn, put a 1/1 white Soldier creature token onto the battlefield.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FirstResponseEffect(), TargetController.ANY, false), new PlayerLostLifeWatcher());
@ -88,7 +87,7 @@ class FirstResponseEffect extends OneShotEffect {
PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
if (watcher != null) {
if (watcher.getLiveLostLastTurn(source.getControllerId()) > 0) {
return new CreateTokenEffect(new SoldierToken("M15")).apply(game, source);
return new CreateTokenEffect(new SoldierToken()).apply(game, source);
}
return true;
}

View file

@ -102,7 +102,7 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl {
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == EventType.ZONE_CHANGE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
@ -110,8 +110,8 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl {
Card card = game.getCard(event.getTargetId());
if (card != null) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null &&
card.getOwnerId().equals(enchantment.getAttachedTo())) {
if (enchantment != null && enchantment.getAttachedTo() != null
&& card.getOwnerId().equals(enchantment.getAttachedTo())) {
return true;
}
}
@ -128,7 +128,7 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl {
if (card != null) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Cards cards = new CardsImpl(card);
controller.revealCards(sourceObject.getName(), cards, game);
controller.revealCards(sourceObject.getIdName(), cards, game);
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, zEvent.getFromZone(), false, true);
return true;
}