diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java index 96182750057..309df89be9b 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java @@ -44,7 +44,7 @@ import mage.game.permanent.token.SnakeToken; public class EndlessSwarm extends CardImpl { public EndlessSwarm(UUID ownerId) { - super(ownerId, 129, "Endless Swarm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{G}"); + super(ownerId, 129, "Endless Swarm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}"); this.expansionSetCode = "SOK"; this.color.setGreen(true); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java index 09e467566fb..3f8b3727390 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCardInLibrary; public class EnduringIdeal extends CardImpl { public EnduringIdeal(UUID ownerId) { - super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{W}"); + super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}"); this.expansionSetCode = "SOK"; this.color.setWhite(true); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java index befaa50ebe5..37e560fdb04 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java @@ -58,7 +58,8 @@ public class EternalDominion extends CardImpl { this.color.setBlue(true); - // Search target opponent's library for an artifact, creature, enchantment, or land card. Put that card onto the battlefield under your control. Then that player shuffles his or her library. + // Search target opponent's library for an artifact, creature, enchantment, or land card. + // Put that card onto the battlefield under your control. Then that player shuffles his or her library. this.getSpellAbility().addEffect(new EternalDominionEffect()); this.getSpellAbility().addTarget(new TargetOpponent(true)); @@ -108,7 +109,7 @@ class EternalDominionEffect extends OneShotEffect { you.searchLibrary(target, game, opponent.getId()); Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - applied = targetCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), you.getId()); + applied = you.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); } opponent.shuffleLibrary(game); } @@ -119,4 +120,4 @@ class EternalDominionEffect extends OneShotEffect { public EternalDominionEffect copy() { return new EternalDominionEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/NeverendingTorment.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/NeverendingTorment.java index 44f485d1cfe..d832c0a240b 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/NeverendingTorment.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/NeverendingTorment.java @@ -1,4 +1,4 @@ -/* + /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; @@ -52,7 +53,7 @@ import mage.util.CardUtil; public class NeverendingTorment extends CardImpl { public NeverendingTorment(UUID ownerId) { - super(ownerId, 83, "Neverending Torment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}"); + super(ownerId, 83, "Neverending Torment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); this.expansionSetCode = "SOK"; this.color.setBlack(true); @@ -88,18 +89,17 @@ class NeverendingTormentEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID exileId = CardUtil.getCardExileZoneId(game, source); boolean applied = false; Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player you = game.getPlayer(source.getControllerId()); if (targetPlayer != null && you != null) { - TargetCardInLibrary target = new TargetCardInLibrary(new CardsInControllerHandCount().calculate(game, source), new FilterCard()); + TargetCardInLibrary target = new TargetCardInLibrary(you.getHand().size(), new FilterCard()); you.searchLibrary(target, game, targetPlayer.getId()); for (UUID cardId : target.getTargets()) { final Card targetCard = game.getCard(cardId); if (targetCard != null) { - applied = targetCard.moveToExile(exileId, "Neverending Torment", source.getSourceId(), game); + applied |= you.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY); } } targetPlayer.shuffleLibrary(game); @@ -111,4 +111,4 @@ class NeverendingTormentEffect extends OneShotEffect { public NeverendingTormentEffect copy() { return new NeverendingTormentEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java index 0e8d7ee6997..fb7f3ff68b3 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java @@ -36,12 +36,12 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreatureOrPlayer; -import mage.util.CardUtil; /** * @@ -51,13 +51,14 @@ import mage.util.CardUtil; public class UndyingFlames extends CardImpl { public UndyingFlames(UUID ownerId) { - super(ownerId, 119, "Undying Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}"); + super(ownerId, 119, "Undying Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); this.expansionSetCode = "SOK"; this.color.setRed(true); // Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to target creature or player equal to that card's converted mana cost. this.getSpellAbility().addEffect(new UndyingFlamesEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); // Epic this.getSpellAbility().addEffect(new EpicEffect()); @@ -78,7 +79,7 @@ class UndyingFlamesEffect extends OneShotEffect { public UndyingFlamesEffect() { super(Outcome.Benefit); - staticText = "Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to target creature or player equal to that card's converted mana cost"; + staticText = "Exile cards from the top of your library until you exile a nonland card. {this} deals damage to target creature or player equal to that card's converted mana cost"; } public UndyingFlamesEffect(final UndyingFlamesEffect effect) { @@ -87,27 +88,28 @@ class UndyingFlamesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID exileId = CardUtil.getCardExileZoneId(game, source); boolean applied = false; Player you = game.getPlayer(source.getControllerId()); - while (you != null - && you.getLibrary().size() > 0) { + Card sourceCard = game.getCard(source.getSourceId()); + while (you != null && sourceCard != null + && you.getLibrary().size() > 0 && you.isInGame()) { Card card = you.getLibrary().removeFromTop(game); if (card != null) { - if (card.getCardType().contains(CardType.LAND)) { - card.moveToExile(exileId, "Undying Flames", source.getSourceId(), game); - } else { - Target target = new TargetCreatureOrPlayer(); - if (you.chooseTarget(Outcome.Damage, target, source, game)) { - Permanent creature = game.getPermanent(target.getFirstTarget()); + you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY); + if (!card.getCardType().contains(CardType.LAND)) { + int damage = card.getManaCost().convertedManaCost(); + if (damage > 0) { + Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (creature != null) { - creature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false); + creature.damage(damage, source.getSourceId(), game, true, false); + game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(creature.getName()).toString()); applied = true; break; } - Player player = game.getPlayer(target.getFirstTarget()); + Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { - player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false); + player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); + game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(player.getName()).toString()); applied = true; break; } @@ -122,4 +124,4 @@ class UndyingFlamesEffect extends OneShotEffect { public UndyingFlamesEffect copy() { return new UndyingFlamesEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/EpicEffect.java b/Mage/src/mage/abilities/effects/common/EpicEffect.java index 48c352631e7..7e18bea4f65 100644 --- a/Mage/src/mage/abilities/effects/common/EpicEffect.java +++ b/Mage/src/mage/abilities/effects/common/EpicEffect.java @@ -59,6 +59,7 @@ public class EpicEffect extends OneShotEffect { for (Effect effect : spell.getSpellAbility().getEffects()) { if (effect instanceof EpicEffect) { epicEffect = effect; + break; } } spell.getSpellAbility().getEffects().remove(epicEffect); @@ -135,8 +136,11 @@ class EpicPushEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { if (spell != null) { - game.getStack().push(spell); - spell.chooseNewTargets(game, spell.getControllerId()); + // don't change the targets of the in the origin copied spell + Spell copySpell = spell.copy(); + game.getStack().push(copySpell); + copySpell.chooseNewTargets(game, source.getControllerId()); + return true; } return false; diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index c7d3060e770..5a475ebe9e2 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -86,6 +86,7 @@ public interface Game extends MageItem, Serializable { MageObject getEmblem(UUID objectId); UUID getControllerId(UUID objectId); Permanent getPermanent(UUID permanentId); + Permanent getPermanentOrLKIBattlefield(UUID permanentId); Card getCard(UUID cardId); Ability getAbility(UUID abilityId, UUID sourceId); void setZone(UUID objectId, Zone zone); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index c40d818fa2c..5963204a29e 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -388,6 +388,15 @@ public abstract class GameImpl> implements Game, Serializa return state.getPermanent(permanentId); } + @Override + public Permanent getPermanentOrLKIBattlefield(UUID permanentId) { + Permanent permanent = state.getPermanent(permanentId); + if (permanent == null) { + permanent = (Permanent) this.getLastKnownInformation(permanentId, Zone.BATTLEFIELD); + } + return permanent; + } + @Override public Card getCard(UUID cardId) { if (cardId == null) { diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index d4fcee5d098..3c9370304cb 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -369,6 +369,19 @@ public interface Player extends MageItem, Copyable { * @return */ boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, Zone fromZone); + /** + * Uses card.moveToExile and posts a inform message about moving the card to exile + * into the game log + * + * @param card + * @param exileId exile zone id (optional) + * @param exileName name of exile zone (optional) + * @param sourceId + * @param game + * @param fromZone if null, this info isn't postet + * @return + */ + boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone); /** * Uses putOntoBattlefield and posts also a info message about in the game log diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 9758871669c..984b0f57f7d 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2100,13 +2100,25 @@ public abstract class PlayerImpl> implements Player, Ser return result; } + @Override + public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone) { + boolean result = false; + if (card.moveToExile(exileId, exileName, sourceId, game)) { + game.informPlayers(new StringBuilder(this.getName()) + .append(" moves ").append(card.getName()).append(" ") + .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") + .append("to exile").toString()); + } + return result; + } + @Override public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId) { boolean result = false; if (card.putOntoBattlefield(game, fromZone, sourceId, this.getId())) { game.informPlayers(new StringBuilder(this.getName()) .append(" puts ").append(card.getName()) - .append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") + .append(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") .append("onto the Battlefield").toString()); } return result;