From 03b51d1f34e5058cf3a6a074b9166cf90434706e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 23 Jul 2014 08:11:11 +0200 Subject: [PATCH] Fixed some effects apply return value. Some changes to game logging. --- Mage.Sets/src/mage/sets/conflux/PathToExile.java | 9 +++++---- Mage.Sets/src/mage/sets/magic2014/MoltenBirth.java | 7 ++++--- Mage.Sets/src/mage/sets/morningtide/VendilionClique.java | 1 + Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java | 2 +- Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java | 3 ++- .../effects/common/CounterUnlessPaysEffect.java | 1 + Mage/src/mage/abilities/keyword/PersistAbility.java | 2 +- Mage/src/mage/abilities/keyword/SuspendAbility.java | 3 +-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/sets/conflux/PathToExile.java b/Mage.Sets/src/mage/sets/conflux/PathToExile.java index de9b270d83..9e8ff7eb59 100644 --- a/Mage.Sets/src/mage/sets/conflux/PathToExile.java +++ b/Mage.Sets/src/mage/sets/conflux/PathToExile.java @@ -86,16 +86,17 @@ class PathToExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { + if (controller != null && permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); - if (permanent.moveToZone(Zone.EXILED, source.getId(), game, false)) { - if (player.chooseUse(Outcome.PutCardInPlay, "Use Path to Exile effect?", game)) { + if (controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD)) { + if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) { TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); if (player.searchLibrary(target, game)) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), permanent.getControllerId(), true); + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); } } player.shuffleLibrary(game); diff --git a/Mage.Sets/src/mage/sets/magic2014/MoltenBirth.java b/Mage.Sets/src/mage/sets/magic2014/MoltenBirth.java index 180c8f0c1a..598269ad44 100644 --- a/Mage.Sets/src/mage/sets/magic2014/MoltenBirth.java +++ b/Mage.Sets/src/mage/sets/magic2014/MoltenBirth.java @@ -92,11 +92,12 @@ class MoltenBirthEffect extends OneShotEffect { Card molten = game.getCard(source.getSourceId()); if (you != null) { ElementalToken token = new ElementalToken(); - token.putOntoBattlefield(2, game, source.getId(), source.getControllerId()); + token.putOntoBattlefield(2, game, source.getSourceId(), source.getControllerId()); if (you.flipCoin(game)) { - molten.moveToZone(Zone.HAND, source.getId(), game, true); - game.informPlayers(new StringBuilder(you.getName()).append(" won the flip. Molten Birth is returned to ").append(you.getName()).append(" hand.").toString()); + molten.moveToZone(Zone.HAND, source.getSourceId(), game, true); + game.informPlayers(new StringBuilder(you.getName()).append(" won the flip. ").append(molten.getLogName()).append(" is returned to ").append(you.getName()).append(" hand.").toString()); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java index 05588bdb36..6c7336aa2b 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java +++ b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java @@ -112,6 +112,7 @@ class VendilionCliqueEffect extends OneShotEffect { player.drawCards(1, game); } } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java index 4c8cdcfd1c..18b13d48f6 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java @@ -133,8 +133,8 @@ class StoneforgeMysticEffect extends OneShotEffect { controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); } } + return true; } - return false; } } diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java index 2b8c34d7fd..1529c71da9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java @@ -102,9 +102,10 @@ class GoblinGuideEffect extends OneShotEffect { defender.revealCards("Goblin Guide", cards, game); if (card.getCardType().contains(CardType.LAND)) { defender.getLibrary().removeFromTop(game); - card.moveToZone(Zone.HAND, source.getId(), game, true); + defender.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); } } + return true; } return false; } diff --git a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java index 0842222034..99f2385b6b 100644 --- a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java @@ -89,6 +89,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect { if (!costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false)) { return game.getStack().counter(spell.getId(), source.getSourceId(), game); } + return true; } } return false; diff --git a/Mage/src/mage/abilities/keyword/PersistAbility.java b/Mage/src/mage/abilities/keyword/PersistAbility.java index b8c4ab6ce7..ebb98fedc5 100644 --- a/Mage/src/mage/abilities/keyword/PersistAbility.java +++ b/Mage/src/mage/abilities/keyword/PersistAbility.java @@ -66,7 +66,7 @@ class PersistEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { game.addEffect(new PersistReplacementEffect(), source); - return false; + return true; } } diff --git a/Mage/src/mage/abilities/keyword/SuspendAbility.java b/Mage/src/mage/abilities/keyword/SuspendAbility.java index 4ec089c643..3b7460baa3 100644 --- a/Mage/src/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/mage/abilities/keyword/SuspendAbility.java @@ -313,7 +313,6 @@ class SuspendPlayCardEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); Card card = game.getCard(source.getSourceId()); if (player != null && card != null) { @@ -340,7 +339,7 @@ class SuspendPlayCardEffect extends OneShotEffect { card.getAbilities().removeAll(abilitiesToRemove); } // cast the card for free - player.cast(card.getSpellAbility(), game, true); + return player.cast(card.getSpellAbility(), game, true); } return false; }