diff --git a/Mage.Sets/src/mage/cards/f/ForceProjection.java b/Mage.Sets/src/mage/cards/f/ForceProjection.java index 179f02725e..e185fe46d1 100644 --- a/Mage.Sets/src/mage/cards/f/ForceProjection.java +++ b/Mage.Sets/src/mage/cards/f/ForceProjection.java @@ -82,7 +82,7 @@ class ForceProjectionEffect extends OneShotEffect { Effect sacrificeEffect = new SacrificeSourceEffect(); sacrificeEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().get(0), game)); TriggeredAbility ability = new BecomesTargetTriggeredAbility(sacrificeEffect, new FilterSpell()); - game.addTriggeredAbility(ability); + game.addTriggeredAbility(ability, null); return true; } diff --git a/Mage.Sets/src/mage/cards/h/HiddenPredators.java b/Mage.Sets/src/mage/cards/h/HiddenPredators.java index 1b12439e2f..238b72434f 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenPredators.java +++ b/Mage.Sets/src/mage/cards/h/HiddenPredators.java @@ -78,10 +78,10 @@ class HiddenPredatorsStateTriggeredAbility extends StateTriggeredAbility { } @Override - public void trigger(Game game, UUID controllerId) { + public void trigger(Game game, UUID controllerId, GameEvent triggeringEvent) { //20100716 - 603.8 game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.TRUE); - super.trigger(game, controllerId); + super.trigger(game, controllerId, triggeringEvent); } @Override diff --git a/Mage.Sets/src/mage/cards/l/LurkingJackals.java b/Mage.Sets/src/mage/cards/l/LurkingJackals.java index 46542b54fa..cdb3803a9d 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingJackals.java +++ b/Mage.Sets/src/mage/cards/l/LurkingJackals.java @@ -79,10 +79,10 @@ class LurkingJackalsStateTriggeredAbility extends StateTriggeredAbility { } @Override - public void trigger(Game game, UUID controllerId) { + public void trigger(Game game, UUID controllerId, GameEvent triggeringEvent) { //20100716 - 603.8 game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.TRUE); - super.trigger(game, controllerId); + super.trigger(game, controllerId, triggeringEvent); } @Override diff --git a/Mage.Sets/src/mage/cards/o/OpalAvenger.java b/Mage.Sets/src/mage/cards/o/OpalAvenger.java index 1552029b91..6484a5527b 100644 --- a/Mage.Sets/src/mage/cards/o/OpalAvenger.java +++ b/Mage.Sets/src/mage/cards/o/OpalAvenger.java @@ -75,10 +75,10 @@ class OpalAvengerStateTriggeredAbility extends StateTriggeredAbility { } @Override - public void trigger(Game game, UUID controllerId) { + public void trigger(Game game, UUID controllerId, GameEvent triggeringEvent) { //20100716 - 603.8 game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.TRUE); - super.trigger(game, controllerId); + super.trigger(game, controllerId, triggeringEvent); } @Override diff --git a/Mage.Sets/src/mage/cards/s/StrictProctor.java b/Mage.Sets/src/mage/cards/s/StrictProctor.java new file mode 100644 index 0000000000..b6b6034074 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StrictProctor.java @@ -0,0 +1,84 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class StrictProctor extends CardImpl { + + public StrictProctor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.SPIRIT); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever a permanent entering the battlefield causes a triggered ability to trigger, counter that ability unless its controller pays {2}. + this.addAbility(new StrictProctorTriggeredAbility()); + } + + private StrictProctor(final StrictProctor card) { + super(card); + } + + @Override + public StrictProctor copy() { + return new StrictProctor(this); + } +} + +class StrictProctorTriggeredAbility extends TriggeredAbilityImpl { + + StrictProctorTriggeredAbility() { + super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2))); + } + + private StrictProctorTriggeredAbility(final StrictProctorTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ABILITY_TRIGGERED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + GameEvent triggeringEvent = (GameEvent) game.getState().getValue(event.getId().toString()); + if (triggeringEvent == null || triggeringEvent.getType() != GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { + return false; + } + getEffects().setTargetPointer(new FixedTarget(triggeringEvent.getTargetId(), game)); + return true; + } + + @Override + public StrictProctorTriggeredAbility copy() { + return new StrictProctorTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever a permanent entering the battlefield causes a triggered ability to trigger, " + + "counter that ability unless its controller pays {2}."; + } +} diff --git a/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java b/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java index 152e7b7f45..74ebd459c6 100644 --- a/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java +++ b/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java @@ -80,10 +80,10 @@ class VeiledCrocodileStateTriggeredAbility extends StateTriggeredAbility { } @Override - public void trigger(Game game, UUID controllerId) { + public void trigger(Game game, UUID controllerId, GameEvent triggeringEvent) { //20100716 - 603.8 game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.TRUE); - super.trigger(game, controllerId); + super.trigger(game, controllerId, triggeringEvent); } @Override diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index 583d85f59d..a7ce87199c 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -269,6 +269,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Stonebound Mentor", 239, Rarity.COMMON, mage.cards.s.StoneboundMentor.class)); cards.add(new SetCardInfo("Stonerise Spirit", 32, Rarity.COMMON, mage.cards.s.StoneriseSpirit.class)); cards.add(new SetCardInfo("Storm-Kiln Artist", 115, Rarity.UNCOMMON, mage.cards.s.StormKilnArtist.class)); + cards.add(new SetCardInfo("Strict Proctor", 33, Rarity.RARE, mage.cards.s.StrictProctor.class)); cards.add(new SetCardInfo("Strixhaven Stadium", 259, Rarity.RARE, mage.cards.s.StrixhavenStadium.class)); cards.add(new SetCardInfo("Study Break", 34, Rarity.COMMON, mage.cards.s.StudyBreak.class)); cards.add(new SetCardInfo("Sudden Breakthrough", 116, Rarity.COMMON, mage.cards.s.SuddenBreakthrough.class)); diff --git a/Mage/src/main/java/mage/abilities/Ability.java b/Mage/src/main/java/mage/abilities/Ability.java index cd411416cc..967164cfbc 100644 --- a/Mage/src/main/java/mage/abilities/Ability.java +++ b/Mage/src/main/java/mage/abilities/Ability.java @@ -48,7 +48,7 @@ public interface Ability extends Controllable, Serializable { * * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, * mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see Game#addTriggeredAbility(TriggeredAbility, GameEvent) * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) */ void newId(); @@ -58,7 +58,7 @@ public interface Ability extends Controllable, Serializable { * * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, * mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see Game#addTriggeredAbility(TriggeredAbility, GameEvent) * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) */ void newOriginalId(); diff --git a/Mage/src/main/java/mage/abilities/DelayedTriggeredAbilities.java b/Mage/src/main/java/mage/abilities/DelayedTriggeredAbilities.java index c1d4d0e7f0..1bb564fc29 100644 --- a/Mage/src/main/java/mage/abilities/DelayedTriggeredAbilities.java +++ b/Mage/src/main/java/mage/abilities/DelayedTriggeredAbilities.java @@ -37,7 +37,7 @@ public class DelayedTriggeredAbilities extends AbilitiesImpl