* Game log - added move message for permanents moved to graveyard by state based effects. Some formatting.

This commit is contained in:
LevelX2 2014-06-12 17:48:55 +02:00
parent 5323e79415
commit b964758325
4 changed files with 32 additions and 15 deletions

View file

@ -47,6 +47,8 @@ public class Dismember extends CardImpl {
super(ownerId, 57, "Dismember", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{BP}{BP}"); super(ownerId, 57, "Dismember", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{BP}{BP}");
this.expansionSetCode = "NPH"; this.expansionSetCode = "NPH";
this.color.setBlack(true); this.color.setBlack(true);
// Target creature gets -5/-5 until end of turn.
this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(true));
} }

View file

@ -71,11 +71,16 @@ public class EmrakulTheAeonsTorn extends CardImpl {
this.subtype.add("Eldrazi"); this.subtype.add("Eldrazi");
this.power = new MageInt(15); this.power = new MageInt(15);
this.toughness = new MageInt(15); this.toughness = new MageInt(15);
// Emrakul, the Aeons Torn can't be countered.
this.addAbility(new CantCounterAbility()); this.addAbility(new CantCounterAbility());
// When you cast Emrakul, take an extra turn after this one.
this.addAbility(new EmrakulTheAeonsTornOnCastAbility()); this.addAbility(new EmrakulTheAeonsTornOnCastAbility());
// Flying, protection from colored spells, annihilator 6
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
this.addAbility(new ProtectionAbility(filter)); this.addAbility(new ProtectionAbility(filter));
this.addAbility(new AnnihilatorAbility(6)); this.addAbility(new AnnihilatorAbility(6));
// When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library.
this.addAbility(new PutIntoGraveFromAnywhereTriggeredAbility(new EmrakulTheAeonsTornEffect(), false)); this.addAbility(new PutIntoGraveFromAnywhereTriggeredAbility(new EmrakulTheAeonsTornEffect(), false));
} }

View file

@ -1337,7 +1337,7 @@ public abstract class GameImpl implements Game, Serializable {
if (perm.getCardType().contains(CardType.CREATURE)) { if (perm.getCardType().contains(CardType.CREATURE)) {
//20091005 - 704.5f //20091005 - 704.5f
if (perm.getToughness().getValue() <= 0) { if (perm.getToughness().getValue() <= 0) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
continue; continue;
} }
@ -1373,7 +1373,7 @@ public abstract class GameImpl implements Game, Serializable {
if (perm.getCardType().contains(CardType.PLANESWALKER)) { if (perm.getCardType().contains(CardType.PLANESWALKER)) {
//20091005 - 704.5i //20091005 - 704.5i
if (perm.getCounters().getCount(CounterType.LOYALTY) == 0) { if (perm.getCounters().getCount(CounterType.LOYALTY) == 0) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
continue; continue;
} }
@ -1385,7 +1385,7 @@ public abstract class GameImpl implements Game, Serializable {
if (perm.getAttachedTo() == null) { if (perm.getAttachedTo() == null) {
Card card = this.getCard(perm.getId()); Card card = this.getCard(perm.getId());
if (card != null && !card.getCardType().contains(CardType.CREATURE)) { // no bestow creature if (card != null && !card.getCardType().contains(CardType.CREATURE)) { // no bestow creature
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
@ -1402,7 +1402,7 @@ public abstract class GameImpl implements Game, Serializable {
perm.attachTo(null, this); perm.attachTo(null, this);
fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId())); fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
} else { } else {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
@ -1411,7 +1411,7 @@ public abstract class GameImpl implements Game, Serializable {
Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter(); Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter();
if (auraFilter instanceof FilterControlledCreaturePermanent) { if (auraFilter instanceof FilterControlledCreaturePermanent) {
if (!((FilterControlledCreaturePermanent)auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this) || attachedTo.hasProtectionFrom(perm, this)) { if (!((FilterControlledCreaturePermanent)auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this) || attachedTo.hasProtectionFrom(perm, this)) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
@ -1424,7 +1424,7 @@ public abstract class GameImpl implements Game, Serializable {
perm.attachTo(null, this); perm.attachTo(null, this);
fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId())); fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
} else { } else {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
@ -1435,14 +1435,14 @@ public abstract class GameImpl implements Game, Serializable {
else if (target instanceof TargetPlayer) { else if (target instanceof TargetPlayer) {
Player attachedTo = getPlayer(perm.getAttachedTo()); Player attachedTo = getPlayer(perm.getAttachedTo());
if (attachedTo == null) { if (attachedTo == null) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
else { else {
Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter(); Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter();
if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) { if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true; somethingHappened = true;
} }
} }
@ -1529,7 +1529,7 @@ public abstract class GameImpl implements Game, Serializable {
controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this); controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this);
for (Permanent dupPlaneswalker: this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) { for (Permanent dupPlaneswalker: this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) {
if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) { if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) {
dupPlaneswalker.moveToZone(Zone.GRAVEYARD, null, this, false); movePermanentToGraveyardWithInfo(dupPlaneswalker);
} }
} }
} }
@ -1558,7 +1558,7 @@ public abstract class GameImpl implements Game, Serializable {
controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this); controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this);
for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) { for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) {
if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) { if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) {
dupLegend.moveToZone(Zone.GRAVEYARD, null, this, false); movePermanentToGraveyardWithInfo(dupLegend);
} }
} }
} }
@ -1579,6 +1579,16 @@ public abstract class GameImpl implements Game, Serializable {
return somethingHappened; return somethingHappened;
} }
private boolean movePermanentToGraveyardWithInfo(Permanent permanent) {
boolean result = false;
if (permanent.moveToZone(Zone.GRAVEYARD, null, this, false)) {
this.informPlayers(new StringBuilder(permanent.getLogName())
.append(" is put into graveyard from battlefield").toString());
result = true;
}
return result;
}
@Override @Override
public void addPlayerQueryEventListener(Listener<PlayerQueryEvent> listener) { public void addPlayerQueryEventListener(Listener<PlayerQueryEvent> listener) {
playerQueryEventSource.addListener(listener); playerQueryEventSource.addListener(listener);

View file

@ -2232,7 +2232,7 @@ public abstract class PlayerImpl implements Player, Serializable {
boolean result = false; boolean result = false;
if (card.moveToZone(Zone.HAND, sourceId, game, false)) { if (card.moveToZone(Zone.HAND, sourceId, game, false)) {
game.informPlayers(new StringBuilder(this.getName()) game.informPlayers(new StringBuilder(this.getName())
.append(" puts ").append(card.isFaceDown() ? " a face down card":card.getName()).append(" ") .append(" puts ").append(card.isFaceDown() ? " a face down card":card.getLogName()).append(" ")
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"")
.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand":"into its owner's hand").toString()); .append(card.getOwnerId().equals(this.getId()) ? "into his or her hand":"into its owner's hand").toString());
result = true; result = true;
@ -2245,7 +2245,7 @@ public abstract class PlayerImpl implements Player, Serializable {
boolean result = false; boolean result = false;
if (card.moveToZone(Zone.GRAVEYARD, sourceId, game, fromZone != null ? fromZone.equals(Zone.BATTLEFIELD) : false)) { if (card.moveToZone(Zone.GRAVEYARD, sourceId, game, fromZone != null ? fromZone.equals(Zone.BATTLEFIELD) : false)) {
game.informPlayers(new StringBuilder(this.getName()) game.informPlayers(new StringBuilder(this.getName())
.append(" puts ").append(card.getName()).append(" ") .append(" puts ").append(card.getLogName()).append(" ")
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"")
.append("into his or her graveyard").toString()); .append("into his or her graveyard").toString());
result = true; result = true;
@ -2258,7 +2258,7 @@ public abstract class PlayerImpl implements Player, Serializable {
boolean result = false; boolean result = false;
if (card.moveToZone(Zone.LIBRARY, sourceId, game, toTop)) { if (card.moveToZone(Zone.LIBRARY, sourceId, game, toTop)) {
StringBuilder sb = new StringBuilder(this.getName()) StringBuilder sb = new StringBuilder(this.getName())
.append(" puts ").append(withName ? card.getName():"a card").append(" "); .append(" puts ").append(withName ? card.getLogName():"a card").append(" ");
if (fromZone != null) { if (fromZone != null) {
if (fromZone.equals(Zone.PICK)) { if (fromZone.equals(Zone.PICK)) {
sb.append("a picked card "); sb.append("a picked card ");
@ -2278,7 +2278,7 @@ public abstract class PlayerImpl implements Player, Serializable {
boolean result = false; boolean result = false;
if (card.moveToExile(exileId, exileName, sourceId, game)) { if (card.moveToExile(exileId, exileName, sourceId, game)) {
game.informPlayers(new StringBuilder(this.getName()) game.informPlayers(new StringBuilder(this.getName())
.append(" moves ").append(card.getName()).append(" ") .append(" moves ").append(card.getLogName()).append(" ")
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"")
.append("to exile").toString()); .append("to exile").toString());
result = true; result = true;
@ -2296,7 +2296,7 @@ public abstract class PlayerImpl implements Player, Serializable {
boolean result = false; boolean result = false;
if (card.putOntoBattlefield(game, fromZone, sourceId, this.getId(), tapped)) { if (card.putOntoBattlefield(game, fromZone, sourceId, this.getId(), tapped)) {
game.informPlayers(new StringBuilder(this.getName()) game.informPlayers(new StringBuilder(this.getName())
.append(" puts ").append(card.getName()) .append(" puts ").append(card.getLogName())
.append(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") .append(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ")
.append("onto the Battlefield").toString()); .append("onto the Battlefield").toString());
result = true; result = true;