diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java index c521de04256..a46a4e33e44 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java @@ -47,7 +47,6 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java b/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java index fd886b2e53c..cb515b66693 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java @@ -28,15 +28,12 @@ package mage.sets.shadowmoor; import java.util.UUID; -import static jdk.nashorn.internal.runtime.Debug.id; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -87,11 +84,13 @@ class PoisonTheWellEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent targetedLand = game.getPermanent(source.getFirstTarget()); if (targetedLand != null) { + targetedLand.destroy(source.getSourceId(), game, true); Player controller = game.getPlayer(targetedLand.getControllerId()); - targetedLand.destroy(source.getId(), game, true); - controller.damage(2, source.getId(), game, false, true); + if (controller != null) { + controller.damage(2, source.getSourceId(), game, false, true); + } return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/zendikar/WhiplashTrap.java b/Mage.Sets/src/mage/sets/zendikar/WhiplashTrap.java index 45dd463b0c6..15bb414d30e 100644 --- a/Mage.Sets/src/mage/sets/zendikar/WhiplashTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/WhiplashTrap.java @@ -80,7 +80,7 @@ public class WhiplashTrap extends CardImpl { class WhiplashTrapWatcher extends Watcher { - private Map amountOfCreaturesPlayedThisTurn = new HashMap(); + private Map amountOfCreaturesPlayedThisTurn = new HashMap<>(); public WhiplashTrapWatcher() { super("WhiplashTrapWatcher", WatcherScope.GAME); @@ -105,7 +105,7 @@ class WhiplashTrapWatcher extends Watcher { if (perm.getCardType().contains(CardType.CREATURE)) { Integer amount = amountOfCreaturesPlayedThisTurn.get(perm.getControllerId()); if (amount == null) { - amount = Integer.valueOf(1); + amount = 1; } else { ++amount; } @@ -118,8 +118,8 @@ class WhiplashTrapWatcher extends Watcher { int maxCreatures = 0; for (UUID opponentId : game.getOpponents(playerId)) { Integer amount = amountOfCreaturesPlayedThisTurn.get(opponentId); - if (amount != null && amount.intValue() > maxCreatures) { - maxCreatures = amount.intValue(); + if (amount != null && amount > maxCreatures) { + maxCreatures = amount; } } return maxCreatures; @@ -159,6 +159,6 @@ class WhiplashAlternativeCost extends AlternativeCostImpl { @Override public String getText() { - return "If an opponent had two or more creatures enter the battlefield under his or her control this turn, you may pay {U} rather than pay Whiplash Trap's mana cost"; + return "If an opponent had two or more creatures enter the battlefield under his or her control this turn, you may pay {U} rather than pay {this}'s mana cost"; } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/condition/common/MyMainPhaseCondition.java b/Mage/src/mage/abilities/condition/common/MyMainPhaseCondition.java index b621db0a0c4..e8d6419bba1 100644 --- a/Mage/src/mage/abilities/condition/common/MyMainPhaseCondition.java +++ b/Mage/src/mage/abilities/condition/common/MyMainPhaseCondition.java @@ -41,11 +41,13 @@ import mage.game.Game; public class MyMainPhaseCondition implements Condition { - private static MyMainPhaseCondition fInstance = new MyMainPhaseCondition(); - private static Set turnPhases = new HashSet() {{ + private static final MyMainPhaseCondition fInstance = new MyMainPhaseCondition(); + + private static final Set turnPhases = new HashSet() {{ add(TurnPhase.PRECOMBAT_MAIN); add(TurnPhase.POSTCOMBAT_MAIN); }}; + public static Condition getInstance() { return fInstance; } diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java index fb9cc9dd866..44637c432c9 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java @@ -113,9 +113,9 @@ public class ExileTargetEffect extends OneShotEffect { return staticText; } if (mode.getTargets().isEmpty()) { - return "Exile it"; + return "exile it"; } else { - return "Exile target " + mode.getTargets().get(0).getTargetName(); + return "exile target " + mode.getTargets().get(0).getTargetName(); } } } diff --git a/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java b/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java index 6099abc8322..de16de2f0c4 100644 --- a/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java +++ b/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java @@ -30,6 +30,7 @@ package mage.filter.predicate; /** * * @author North + * @param */ public interface ObjectSourcePlayerPredicate extends ObjectPlayerPredicate { } diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index acf9dddbcea..2392c972b61 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -159,7 +159,7 @@ public class Spell implements StackObject, Card { } public String getSpellCastText(Game game) { - for (Ability spellAbility : (Abilities) getAbilities()) { + for (Ability spellAbility : getAbilities()) { if (spellAbility instanceof MorphAbility && ((AlternativeSourceCosts) spellAbility).isActivated(getSpellAbility(), game)) { return "a card face down";