Fixed Tangle Wire not working if destroyed in response to the trigger.

This commit is contained in:
emerald000 2016-11-08 01:28:14 -05:00
parent 69d6b2c8f5
commit 996d1a47f9

View file

@ -83,7 +83,7 @@ class TangleWireEffect extends OneShotEffect {
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.LAND)));
}
TangleWireEffect() {
super(Outcome.Sacrifice);
staticText = "that player taps an untapped artifact, creature, or land he or she controls for each fade counter on Tangle Wire";
@ -96,15 +96,15 @@ class TangleWireEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
Permanent permanent = game.getPermanent(source.getSourceId());
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (player == null || permanent == null) {
return false;
}
int targetCount = game.getBattlefield().countAll(filter, player.getId(), game);
int counterCount = permanent.getCounters(game).getCount(CounterType.FADE);
int amount = Math.min(counterCount, targetCount);
Target target = new TargetControlledPermanent(amount, amount, filter, true);
target.setNotTarget(true);