* Fixed that the exile and return effect of the flip planeswalker did not always work correctly.

This commit is contained in:
LevelX2 2015-10-22 15:38:50 +02:00
parent af67e27bcd
commit 2aaea46dc6
4 changed files with 111 additions and 8 deletions

View file

@ -24,7 +24,7 @@ public class PlanswalkerEntersWithLoyalityCountersAbility extends EntersBattlefi
}
@Override
public EntersBattlefieldAbility copy() {
public PlanswalkerEntersWithLoyalityCountersAbility copy() {
return new PlanswalkerEntersWithLoyalityCountersAbility(this);
}
}

View file

@ -61,12 +61,11 @@ public class ExileAndReturnTransformedSourceEffect extends OneShotEffect {
Permanent sourceObject = game.getPermanent(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (sourceObject != null && controller != null && sourceObject.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter()) {
Card card = (Card) sourceObject;
if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
Player owner = game.getPlayer(card.getOwnerId());
if (owner != null) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
owner.moveCards(card, Zone.BATTLEFIELD, source, game);
if (controller.moveCards(sourceObject, Zone.EXILED, source, game)) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
Card cardFromExile = game.getCard(source.getSourceId());
if (cardFromExile != null) {
controller.moveCards(cardFromExile, Zone.BATTLEFIELD, source, game, false, false, true, null);
if (additionalEffect != null) {
if (additionalEffect instanceof ContinuousEffect) {
game.addEffect((ContinuousEffect) additionalEffect, source);

View file

@ -1876,7 +1876,7 @@ public abstract class GameImpl implements Game, Serializable {
Player controller = this.getPlayer(legend.getControllerId());
if (controller != null) {
Target targetLegendaryToKeep = new TargetPermanent(filterLegendName);
targetLegendaryToKeep.setTargetName(new StringBuilder(legend.getName()).append(" to keep (Legendary Rule)?").toString());
targetLegendaryToKeep.setTargetName(legend.getName() + " to keep (Legendary Rule)?");
controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this);
for (Permanent dupLegend : getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) {
if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) {