From 20646da985a078a8a0e2f36e438a361e69282da2 Mon Sep 17 00:00:00 2001 From: Andre Cabaca Date: Tue, 18 Aug 2020 12:17:40 +0100 Subject: [PATCH 1/2] Fixed the Ghostly Pilferer triggered ability (spell casts from anywhere other than their hand) issue #6951 --- Mage.Sets/src/mage/cards/g/GhostlyPilferer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java b/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java index 68ffecfd52..050fa31589 100644 --- a/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java +++ b/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java @@ -41,6 +41,10 @@ public final class GhostlyPilferer extends CardImpl { // Whenever an opponent casts a spell from anywhere other than their hand, draw a card. this.addAbility(new GhostlyPilfererTriggeredAbility()); + /*TODO: I think this way is the optimal way(copied from counter balance): + * this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, + * new CounterbalanceEffect(), StaticFilters.FILTER_SPELL, true, SetTargetPointer.SPELL)); + */ // Discard a card: Ghostly Pilferer can't be blocked this turn. this.addAbility(new SimpleActivatedAbility( @@ -80,15 +84,13 @@ class GhostlyPilfererTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getZone() == Zone.HAND) { - return false; - } Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null; + return (this.controllerId != spell.getControllerId() + && event.getZone() != Zone.HAND); } @Override public String getRule() { return "Whenever an opponent casts a spell from anywhere other than their hand, draw a card."; } -} +} \ No newline at end of file From 805e3f8e6bcd610d0500c5d8a4b3be2c99cbfb73 Mon Sep 17 00:00:00 2001 From: acabaca24 <61804801+acabaca24@users.noreply.github.com> Date: Tue, 18 Aug 2020 15:31:48 +0100 Subject: [PATCH 2/2] Corrected opponent check Now checking game.getOpponents() --- Mage.Sets/src/mage/cards/g/GhostlyPilferer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java b/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java index 050fa31589..17052e33c3 100644 --- a/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java +++ b/Mage.Sets/src/mage/cards/g/GhostlyPilferer.java @@ -85,7 +85,7 @@ class GhostlyPilfererTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - return (this.controllerId != spell.getControllerId() + return (game.getOpponents(getControllerId()).contains(spell.getControllerId()) && event.getZone() != Zone.HAND); } @@ -93,4 +93,4 @@ class GhostlyPilfererTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever an opponent casts a spell from anywhere other than their hand, draw a card."; } -} \ No newline at end of file +}