Removed some wrong import of Poison the Well and some minor changes.

This commit is contained in:
LevelX2 2015-01-20 14:00:56 +01:00
parent 8990163a7e
commit cbfc32db3c
7 changed files with 18 additions and 17 deletions

View file

@ -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;

View file

@ -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;
}
}
}

View file

@ -80,7 +80,7 @@ public class WhiplashTrap extends CardImpl {
class WhiplashTrapWatcher extends Watcher {
private Map<UUID, Integer> amountOfCreaturesPlayedThisTurn = new HashMap<UUID, Integer>();
private Map<UUID, Integer> 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";
}
}