[ZNR] fixed issues with Nimble Trapfinder (#7046)

This commit is contained in:
Evan Kranzler 2020-09-17 10:47:18 -04:00
parent aa08d229b3
commit 6a01fee9f8

View file

@ -20,6 +20,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.game.Game; import mage.game.Game;
@ -54,7 +55,8 @@ public final class NimbleTrapfinder extends CardImpl {
new BeginningOfCombatTriggeredAbility( new BeginningOfCombatTriggeredAbility(
new GainAbilityAllEffect(new DealsCombatDamageToAPlayerTriggeredAbility( new GainAbilityAllEffect(new DealsCombatDamageToAPlayerTriggeredAbility(
new DrawCardSourceControllerEffect(1), false new DrawCardSourceControllerEffect(1), false
), Duration.EndOfTurn), TargetController.YOU, false ), Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES),
TargetController.YOU, false
), FullPartyCondition.instance, "At the beginning of combat on your turn, " + ), FullPartyCondition.instance, "At the beginning of combat on your turn, " +
"if you have a full party, creatures you control gain " + "if you have a full party, creatures you control gain " +
"\"Whenever this creature deals combat damage to a player, draw a card\" until end of turn." "\"Whenever this creature deals combat damage to a player, draw a card\" until end of turn."
@ -132,8 +134,7 @@ class NimbleTrapfinderWatcher extends Watcher {
} }
boolean checkPlayer(Permanent permanent, Game game) { boolean checkPlayer(Permanent permanent, Game game) {
return permanent != null return playerMap
&& playerMap
.computeIfAbsent(permanent.getControllerId(), u -> new HashSet<>()) .computeIfAbsent(permanent.getControllerId(), u -> new HashSet<>())
.stream() .stream()
.anyMatch(mor -> !mor.refersTo(permanent, game)); .anyMatch(mor -> !mor.refersTo(permanent, game));