From a4d659176e0d851ec95bb132a81587a21b82cdd0 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Mon, 29 Jun 2020 11:45:26 -0500 Subject: [PATCH] - Refactored BlocksOrBecomesBlockedTriggeredAbility to BlocksOrBecomesBlockedSourceTriggeredAbility --- Mage.Sets/src/mage/cards/a/Abomination.java | 4 +- .../src/mage/cards/a/AislingLeprechaun.java | 4 +- Mage.Sets/src/mage/cards/a/AshmouthHound.java | 4 +- .../src/mage/cards/a/AssembledAlphas.java | 4 +- Mage.Sets/src/mage/cards/b/Brushwagg.java | 4 +- Mage.Sets/src/mage/cards/c/ChubToad.java | 4 +- Mage.Sets/src/mage/cards/c/Cockatrice.java | 4 +- Mage.Sets/src/mage/cards/c/CorrosiveOoze.java | 4 +- Mage.Sets/src/mage/cards/d/Deathgazer.java | 4 +- Mage.Sets/src/mage/cards/d/DreadSpecter.java | 4 +- Mage.Sets/src/mage/cards/d/Dromosaur.java | 4 +- .../src/mage/cards/e/EngulfingSlagwurm.java | 4 +- Mage.Sets/src/mage/cards/e/EscapedNull.java | 4 +- Mage.Sets/src/mage/cards/f/FlailingDrake.java | 4 +- .../src/mage/cards/f/FlameheartWerewolf.java | 4 +- Mage.Sets/src/mage/cards/g/GhostHounds.java | 4 +- Mage.Sets/src/mage/cards/g/GiantShark.java | 4 +- .../src/mage/cards/g/GiftOfTheWoods.java | 4 +- Mage.Sets/src/mage/cards/g/GoblinCadets.java | 4 +- .../src/mage/cards/g/GoblinEliteInfantry.java | 4 +- .../src/mage/cards/g/GoblinFlotilla.java | 4 +- Mage.Sets/src/mage/cards/g/GorgonRecluse.java | 4 +- .../src/mage/cards/i/InfernoElemental.java | 4 +- .../src/mage/cards/k/KarnSilverGolem.java | 4 +- .../src/mage/cards/k/KessigForgemaster.java | 4 +- Mage.Sets/src/mage/cards/l/LimDulsCohort.java | 4 +- .../src/mage/cards/m/MammothHarness.java | 4 +- Mage.Sets/src/mage/cards/m/MirrorShield.java | 4 +- Mage.Sets/src/mage/cards/o/OrneryGoblin.java | 4 +- Mage.Sets/src/mage/cards/r/RagingGorilla.java | 4 +- Mage.Sets/src/mage/cards/r/RockBasilisk.java | 4 +- Mage.Sets/src/mage/cards/s/SawtoothOgre.java | 4 +- Mage.Sets/src/mage/cards/s/ShapeStealer.java | 4 +- Mage.Sets/src/mage/cards/s/SlinkingGiant.java | 4 +- Mage.Sets/src/mage/cards/s/SpittingSlug.java | 4 +- .../src/mage/cards/t/TalruumChampion.java | 4 +- Mage.Sets/src/mage/cards/t/TangleAsp.java | 4 +- .../src/mage/cards/t/ThicketBasilisk.java | 4 +- .../src/mage/cards/t/TreefolkMystic.java | 4 +- .../src/mage/cards/v/VenomousDragonfly.java | 4 +- .../src/mage/cards/w/WitherscaleWurm.java | 4 +- ...rBecomesBlockedSourceTriggeredAbility.java | 91 +++++++++++++++++++ 42 files changed, 173 insertions(+), 82 deletions(-) create mode 100644 Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedSourceTriggeredAbility.java diff --git a/Mage.Sets/src/mage/cards/a/Abomination.java b/Mage.Sets/src/mage/cards/a/Abomination.java index 167f58ad8e..e9b37fb336 100644 --- a/Mage.Sets/src/mage/cards/a/Abomination.java +++ b/Mage.Sets/src/mage/cards/a/Abomination.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -39,7 +39,7 @@ public final class Abomination extends CardImpl { // Whenever Abomination blocks or becomes blocked by a green or white creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } public Abomination(final Abomination card) { diff --git a/Mage.Sets/src/mage/cards/a/AislingLeprechaun.java b/Mage.Sets/src/mage/cards/a/AislingLeprechaun.java index 94dc800975..b1bee8438d 100644 --- a/Mage.Sets/src/mage/cards/a/AislingLeprechaun.java +++ b/Mage.Sets/src/mage/cards/a/AislingLeprechaun.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; import mage.cards.CardImpl; @@ -29,7 +29,7 @@ public final class AislingLeprechaun extends CardImpl { // Whenever Aisling Leprechaun blocks or becomes blocked by a creature, that creature becomes green. Effect effect = new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.EndOfGame); effect.setText("that creature becomes green"); - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/AshmouthHound.java b/Mage.Sets/src/mage/cards/a/AshmouthHound.java index dda0221e81..e3e5ed4fb4 100644 --- a/Mage.Sets/src/mage/cards/a/AshmouthHound.java +++ b/Mage.Sets/src/mage/cards/a/AshmouthHound.java @@ -3,7 +3,7 @@ package mage.cards.a; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -25,7 +25,7 @@ public final class AshmouthHound extends CardImpl { this.toughness = new MageInt(1); // Whenever Ashmouth Hound blocks or becomes blocked by a creature, Ashmouth Hound deals 1 damage to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false)); } public AshmouthHound(final AshmouthHound card) { diff --git a/Mage.Sets/src/mage/cards/a/AssembledAlphas.java b/Mage.Sets/src/mage/cards/a/AssembledAlphas.java index 95a23a8ece..03807132bb 100644 --- a/Mage.Sets/src/mage/cards/a/AssembledAlphas.java +++ b/Mage.Sets/src/mage/cards/a/AssembledAlphas.java @@ -4,7 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DamageTargetEffect; @@ -27,7 +27,7 @@ public final class AssembledAlphas extends CardImpl { this.toughness = new MageInt(5); // Whenever Assembled Alphas blocks or becomes blocked by a creature, Assembled Alphas deals 3 damage to that creature and 3 damage to that creature's controller. - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility( + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility( new DamageTargetEffect(3, true, "that creature"), StaticFilters.FILTER_PERMANENT_CREATURE, false, null, true); Effect effect = new DamageTargetControllerEffect(3); diff --git a/Mage.Sets/src/mage/cards/b/Brushwagg.java b/Mage.Sets/src/mage/cards/b/Brushwagg.java index 147d23b284..d6c6e568b6 100644 --- a/Mage.Sets/src/mage/cards/b/Brushwagg.java +++ b/Mage.Sets/src/mage/cards/b/Brushwagg.java @@ -3,7 +3,7 @@ package mage.cards.b; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -24,7 +24,7 @@ public final class Brushwagg extends CardImpl { this.toughness = new MageInt(2); // Whenever Brushwagg blocks or becomes blocked, it gets -2/+2 until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-2, 2, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(-2, 2, Duration.EndOfTurn), false)); } public Brushwagg(final Brushwagg card) { diff --git a/Mage.Sets/src/mage/cards/c/ChubToad.java b/Mage.Sets/src/mage/cards/c/ChubToad.java index 8cc95ab155..ab57c1310b 100644 --- a/Mage.Sets/src/mage/cards/c/ChubToad.java +++ b/Mage.Sets/src/mage/cards/c/ChubToad.java @@ -4,7 +4,7 @@ package mage.cards.c; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; @@ -28,7 +28,7 @@ public final class ChubToad extends CardImpl { // Whenever Chub Toad blocks or becomes blocked, it gets +2/+2 until end of turn. Effect effect = new BoostSourceEffect(+2, +2, Duration.EndOfTurn); effect.setText("it gets +2/+2 until end of turn"); - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/Cockatrice.java b/Mage.Sets/src/mage/cards/c/Cockatrice.java index cd45ae14a3..d8cf0bb72d 100644 --- a/Mage.Sets/src/mage/cards/c/Cockatrice.java +++ b/Mage.Sets/src/mage/cards/c/Cockatrice.java @@ -3,7 +3,7 @@ package mage.cards.c; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -41,7 +41,7 @@ public final class Cockatrice extends CardImpl { // Whenever Cockatrice blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } public Cockatrice(final Cockatrice card) { diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java index 543b50c756..eaae709b7c 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java @@ -3,7 +3,7 @@ package mage.cards.c; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -44,7 +44,7 @@ public final class CorrosiveOoze extends CardImpl { // Whenever Corrosive Ooze blocks or becomes blocked by an equipped creature, destroy all Equipment attached to that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new CorrosiveOozeEffect()), true); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false), new CorrosiveOozeCombatWatcher()); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false), new CorrosiveOozeCombatWatcher()); } public CorrosiveOoze(final CorrosiveOoze card) { diff --git a/Mage.Sets/src/mage/cards/d/Deathgazer.java b/Mage.Sets/src/mage/cards/d/Deathgazer.java index ac8463fba9..4ff33fe235 100644 --- a/Mage.Sets/src/mage/cards/d/Deathgazer.java +++ b/Mage.Sets/src/mage/cards/d/Deathgazer.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -39,7 +39,7 @@ public final class Deathgazer extends CardImpl { // Whenever Deathgazer blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } diff --git a/Mage.Sets/src/mage/cards/d/DreadSpecter.java b/Mage.Sets/src/mage/cards/d/DreadSpecter.java index c3cb1d8e77..50e5aca675 100644 --- a/Mage.Sets/src/mage/cards/d/DreadSpecter.java +++ b/Mage.Sets/src/mage/cards/d/DreadSpecter.java @@ -4,7 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -38,7 +38,7 @@ public final class DreadSpecter extends CardImpl { // Whenever Dread Specter blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } public DreadSpecter(final DreadSpecter card) { diff --git a/Mage.Sets/src/mage/cards/d/Dromosaur.java b/Mage.Sets/src/mage/cards/d/Dromosaur.java index edc3d67690..99cac6e8ce 100644 --- a/Mage.Sets/src/mage/cards/d/Dromosaur.java +++ b/Mage.Sets/src/mage/cards/d/Dromosaur.java @@ -3,7 +3,7 @@ package mage.cards.d; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -25,7 +25,7 @@ public final class Dromosaur extends CardImpl { this.toughness = new MageInt(3); // Whenever Dromosaur blocks or becomes blocked by a creature, it gets +2/-2 until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(2, -2, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(2, -2, Duration.EndOfTurn), false)); } public Dromosaur(final Dromosaur card) { diff --git a/Mage.Sets/src/mage/cards/e/EngulfingSlagwurm.java b/Mage.Sets/src/mage/cards/e/EngulfingSlagwurm.java index 7a9919f7c4..2ff0a9b403 100644 --- a/Mage.Sets/src/mage/cards/e/EngulfingSlagwurm.java +++ b/Mage.Sets/src/mage/cards/e/EngulfingSlagwurm.java @@ -4,7 +4,7 @@ package mage.cards.e; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; @@ -30,7 +30,7 @@ public final class EngulfingSlagwurm extends CardImpl { this.toughness = new MageInt(7); // Whenever Engulfing Slagwurm blocks or becomes blocked by a creature, destroy that creature. You gain life equal to that creature's toughness. - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(new DestroyTargetEffect(), false); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(new DestroyTargetEffect(), false); ability.addEffect(new EngulfingSlagwurmEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/EscapedNull.java b/Mage.Sets/src/mage/cards/e/EscapedNull.java index fdfcb2db58..2a72bd2b0f 100644 --- a/Mage.Sets/src/mage/cards/e/EscapedNull.java +++ b/Mage.Sets/src/mage/cards/e/EscapedNull.java @@ -3,7 +3,7 @@ package mage.cards.e; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; @@ -27,7 +27,7 @@ public final class EscapedNull extends CardImpl { this.toughness = new MageInt(2); this.addAbility(LifelinkAbility.getInstance()); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(5, 0, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(5, 0, Duration.EndOfTurn), false)); } public EscapedNull(final EscapedNull card) { diff --git a/Mage.Sets/src/mage/cards/f/FlailingDrake.java b/Mage.Sets/src/mage/cards/f/FlailingDrake.java index 3083f1c918..db8dd6a855 100644 --- a/Mage.Sets/src/mage/cards/f/FlailingDrake.java +++ b/Mage.Sets/src/mage/cards/f/FlailingDrake.java @@ -4,7 +4,7 @@ package mage.cards.f; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -32,7 +32,7 @@ public final class FlailingDrake extends CardImpl { // Whenever Flailing Drake blocks or becomes blocked by a creature, that creature gets +1/+1 until end of turn. Effect effect = new BoostTargetEffect(+1, +1, Duration.EndOfTurn); effect.setText("that creature gets +1/+1 until end of turn"); - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, new FilterCreaturePermanent("a creature"), false, null, true); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, new FilterCreaturePermanent("a creature"), false, null, true); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java b/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java index 05ebb2bfe6..10fcf26864 100644 --- a/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java +++ b/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; @@ -36,7 +36,7 @@ public final class FlameheartWerewolf extends CardImpl { this.transformable = true; // Whenever Flameheart Werewolf blocks or becomes blocked by a creature, Flameheart Werewolf deals 2 damage to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(2, true, "that creature"), + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new DamageTargetEffect(2, true, "that creature"), StaticFilters.FILTER_PERMANENT_CREATURE, false, null, true)); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Flameheart Werewolf. diff --git a/Mage.Sets/src/mage/cards/g/GhostHounds.java b/Mage.Sets/src/mage/cards/g/GhostHounds.java index cac1255c0a..6ec9ac4172 100644 --- a/Mage.Sets/src/mage/cards/g/GhostHounds.java +++ b/Mage.Sets/src/mage/cards/g/GhostHounds.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.VigilanceAbility; @@ -40,7 +40,7 @@ public final class GhostHounds extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Whenever Ghost Hounds blocks or becomes blocked by a white creature, Ghost Hounds gains first strike until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), filter, false)); } diff --git a/Mage.Sets/src/mage/cards/g/GiantShark.java b/Mage.Sets/src/mage/cards/g/GiantShark.java index 3adccfc3a9..9ebb586001 100644 --- a/Mage.Sets/src/mage/cards/g/GiantShark.java +++ b/Mage.Sets/src/mage/cards/g/GiantShark.java @@ -2,7 +2,7 @@ package mage.cards.g; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.SacrificeSourceEffect; @@ -43,7 +43,7 @@ public final class GiantShark extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(filter))); // Whenever Giant Shark blocks or becomes blocked by a creature that has been dealt damage this turn, Giant Shark gets +2/+0 and gains trample until end of turn. - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn).setText("{this} gets +2/+0"), filter2, false); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn).setText("{this} gets +2/+0"), filter2, false); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn).setText("and gains trample until end of turn")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java b/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java index 185f1a9eb7..1d88c170a7 100644 --- a/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java +++ b/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java @@ -3,7 +3,7 @@ package mage.cards.g; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; @@ -37,7 +37,7 @@ public final class GiftOfTheWoods extends CardImpl { // Whenever enchanted creature blocks or becomes blocked, it gets +0/+3 until // end of turn and you gain 1 life. - Ability ability2 = new BlocksOrBecomesBlockedTriggeredAbility( + Ability ability2 = new BlocksOrBecomesBlockedSourceTriggeredAbility( new BoostEnchantedEffect(0, 3, Duration.EndOfTurn), false); ability2.addEffect(new GainLifeEffect(1).concatBy("and")); this.addAbility(ability2); diff --git a/Mage.Sets/src/mage/cards/g/GoblinCadets.java b/Mage.Sets/src/mage/cards/g/GoblinCadets.java index dff65dab69..318f94c7f2 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinCadets.java +++ b/Mage.Sets/src/mage/cards/g/GoblinCadets.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -27,7 +27,7 @@ public final class GoblinCadets extends CardImpl { this.toughness = new MageInt(1); // Whenever Goblin Cadets blocks or becomes blocked, target opponent gains control of it. - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(new GoblinCadetsChangeControlEffect(), false); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(new GoblinCadetsChangeControlEffect(), false); ability.addTarget(new TargetOpponent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GoblinEliteInfantry.java b/Mage.Sets/src/mage/cards/g/GoblinEliteInfantry.java index 4207a963e5..bc9233e335 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinEliteInfantry.java +++ b/Mage.Sets/src/mage/cards/g/GoblinEliteInfantry.java @@ -3,7 +3,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -24,7 +24,7 @@ public final class GoblinEliteInfantry extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-1, -1, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(-1, -1, Duration.EndOfTurn), false)); } public GoblinEliteInfantry(final GoblinEliteInfantry card) { diff --git a/Mage.Sets/src/mage/cards/g/GoblinFlotilla.java b/Mage.Sets/src/mage/cards/g/GoblinFlotilla.java index 2abda79241..dd281d5386 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinFlotilla.java +++ b/Mage.Sets/src/mage/cards/g/GoblinFlotilla.java @@ -3,7 +3,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfCombatTriggeredAbility; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoUnlessControllerPaysEffect; @@ -37,7 +37,7 @@ public final class GoblinFlotilla extends CardImpl { // At the beginning of each combat, unless you pay {R}, whenever Goblin Flotilla blocks or becomes blocked by a creature this combat, that creature gains first strike until end of turn. Effect effect = new DoUnlessControllerPaysEffect( new GainAbilitySourceEffect( - new BlocksOrBecomesBlockedTriggeredAbility( + new BlocksOrBecomesBlockedSourceTriggeredAbility( new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, "Blocks or Blocked by Goblin Flotilla"), diff --git a/Mage.Sets/src/mage/cards/g/GorgonRecluse.java b/Mage.Sets/src/mage/cards/g/GorgonRecluse.java index f9730324bd..1fa3627c58 100644 --- a/Mage.Sets/src/mage/cards/g/GorgonRecluse.java +++ b/Mage.Sets/src/mage/cards/g/GorgonRecluse.java @@ -4,7 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; @@ -40,7 +40,7 @@ public final class GorgonRecluse extends CardImpl { // Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); // Madness {B}{B} this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{B}{B}"))); diff --git a/Mage.Sets/src/mage/cards/i/InfernoElemental.java b/Mage.Sets/src/mage/cards/i/InfernoElemental.java index 6815e8a26a..1e3b74c9a4 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoElemental.java +++ b/Mage.Sets/src/mage/cards/i/InfernoElemental.java @@ -3,7 +3,7 @@ package mage.cards.i; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -24,7 +24,7 @@ public final class InfernoElemental extends CardImpl { this.toughness = new MageInt(4); // Whenever Inferno Elemental blocks or becomes blocked by a creature, Inferno Elemental deals 3 damage to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false)); } public InfernoElemental(final InfernoElemental card) { diff --git a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java index 57e69f971b..141991d4e4 100644 --- a/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java +++ b/Mage.Sets/src/mage/cards/k/KarnSilverGolem.java @@ -4,7 +4,7 @@ package mage.cards.k; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousEffectImpl; @@ -38,7 +38,7 @@ public final class KarnSilverGolem extends CardImpl { this.toughness = new MageInt(4); // Whenever Karn, Silver Golem blocks or becomes blocked, it gets -4/+4 until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-4, +4, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(-4, +4, Duration.EndOfTurn), false)); // {1}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KarnSilverGolemEffect(), new ManaCostsImpl("{1")); diff --git a/Mage.Sets/src/mage/cards/k/KessigForgemaster.java b/Mage.Sets/src/mage/cards/k/KessigForgemaster.java index c8ffa6637f..13f65fe901 100644 --- a/Mage.Sets/src/mage/cards/k/KessigForgemaster.java +++ b/Mage.Sets/src/mage/cards/k/KessigForgemaster.java @@ -6,7 +6,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; @@ -36,7 +36,7 @@ public final class KessigForgemaster extends CardImpl { this.secondSideCardClazz = mage.cards.f.FlameheartWerewolf.class; // Whenever Kessig Forgemaster blocks or becomes blocked by a creature, Kessig Forgemaster deals 1 damage to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), StaticFilters.FILTER_PERMANENT_CREATURE, false, null, true)); // At the beginning of each upkeep, if no spells were cast last turn, transform Kessig Forgemaster. diff --git a/Mage.Sets/src/mage/cards/l/LimDulsCohort.java b/Mage.Sets/src/mage/cards/l/LimDulsCohort.java index fee4085bbd..af21382902 100644 --- a/Mage.Sets/src/mage/cards/l/LimDulsCohort.java +++ b/Mage.Sets/src/mage/cards/l/LimDulsCohort.java @@ -2,7 +2,7 @@ package mage.cards.l; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.CantBeRegeneratedTargetEffect; import mage.constants.SubType; import mage.cards.CardImpl; @@ -25,7 +25,7 @@ public final class LimDulsCohort extends CardImpl { this.toughness = new MageInt(3); // Whenever Lim-Dûl's Cohort blocks or becomes blocked by a creature, that creature can't be regenerated this turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility( + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility( new CantBeRegeneratedTargetEffect(Duration.EndOfTurn), new FilterCreaturePermanent(), false, diff --git a/Mage.Sets/src/mage/cards/m/MammothHarness.java b/Mage.Sets/src/mage/cards/m/MammothHarness.java index aa126f999d..0df36ee9cf 100644 --- a/Mage.Sets/src/mage/cards/m/MammothHarness.java +++ b/Mage.Sets/src/mage/cards/m/MammothHarness.java @@ -3,7 +3,7 @@ package mage.cards.m; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -61,7 +61,7 @@ public final class MammothHarness extends CardImpl { } } -class MammothHarnessTriggeredAbility extends BlocksOrBecomesBlockedTriggeredAbility { +class MammothHarnessTriggeredAbility extends BlocksOrBecomesBlockedSourceTriggeredAbility { public MammothHarnessTriggeredAbility() { super(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), StaticFilters.FILTER_PERMANENT_CREATURE, false, null, false); diff --git a/Mage.Sets/src/mage/cards/m/MirrorShield.java b/Mage.Sets/src/mage/cards/m/MirrorShield.java index e2d4db1cde..27d9368dc8 100644 --- a/Mage.Sets/src/mage/cards/m/MirrorShield.java +++ b/Mage.Sets/src/mage/cards/m/MirrorShield.java @@ -1,7 +1,7 @@ package mage.cards.m; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; @@ -44,7 +44,7 @@ public final class MirrorShield extends CardImpl { ability.addEffect(new GainAbilityAttachedEffect( HexproofAbility.getInstance(), AttachmentType.EQUIPMENT ).setText("and has hexproof")); - ability.addEffect(new GainAbilityAttachedEffect(new BlocksOrBecomesBlockedTriggeredAbility( + ability.addEffect(new GainAbilityAttachedEffect(new BlocksOrBecomesBlockedSourceTriggeredAbility( new DestroyTargetEffect(), filter, false, rule + "", true ), AttachmentType.EQUIPMENT).setText("and \"" + rule + "\"")); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/o/OrneryGoblin.java b/Mage.Sets/src/mage/cards/o/OrneryGoblin.java index 7e56c1249a..3f523c0f66 100644 --- a/Mage.Sets/src/mage/cards/o/OrneryGoblin.java +++ b/Mage.Sets/src/mage/cards/o/OrneryGoblin.java @@ -2,7 +2,7 @@ package mage.cards.o; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.constants.SubType; import mage.cards.CardImpl; @@ -24,7 +24,7 @@ public final class OrneryGoblin extends CardImpl { this.toughness = new MageInt(1); // Whenever Ornery Goblin blocks or becomes blocked by a creature, Ornery Goblin deals 1 damage to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility( + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility( new DamageTargetEffect(1, true, "that creature"), false )); } diff --git a/Mage.Sets/src/mage/cards/r/RagingGorilla.java b/Mage.Sets/src/mage/cards/r/RagingGorilla.java index 8b11fd21f7..5c5df5d7f6 100644 --- a/Mage.Sets/src/mage/cards/r/RagingGorilla.java +++ b/Mage.Sets/src/mage/cards/r/RagingGorilla.java @@ -3,7 +3,7 @@ package mage.cards.r; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -24,7 +24,7 @@ public final class RagingGorilla extends CardImpl { this.toughness = new MageInt(3); // Whenever Raging Gorilla blocks or becomes blocked, it gets +2/-2 until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(2, -2, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(2, -2, Duration.EndOfTurn), false)); } public RagingGorilla(final RagingGorilla card) { diff --git a/Mage.Sets/src/mage/cards/r/RockBasilisk.java b/Mage.Sets/src/mage/cards/r/RockBasilisk.java index 6fef87b86b..43581603bc 100644 --- a/Mage.Sets/src/mage/cards/r/RockBasilisk.java +++ b/Mage.Sets/src/mage/cards/r/RockBasilisk.java @@ -3,7 +3,7 @@ package mage.cards.r; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -38,7 +38,7 @@ public final class RockBasilisk extends CardImpl { Effect effect = new CreateDelayedTriggeredAbilityEffect( new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } public RockBasilisk(final RockBasilisk card) { diff --git a/Mage.Sets/src/mage/cards/s/SawtoothOgre.java b/Mage.Sets/src/mage/cards/s/SawtoothOgre.java index a07b337cf9..960fd59c7f 100644 --- a/Mage.Sets/src/mage/cards/s/SawtoothOgre.java +++ b/Mage.Sets/src/mage/cards/s/SawtoothOgre.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -29,7 +29,7 @@ public final class SawtoothOgre extends CardImpl { Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility( new DamageTargetEffect(1)), true) .setText("{this} deals 1 damage to that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false)); } public SawtoothOgre(final SawtoothOgre card) { diff --git a/Mage.Sets/src/mage/cards/s/ShapeStealer.java b/Mage.Sets/src/mage/cards/s/ShapeStealer.java index d2bc6f976b..d21b0e2c98 100644 --- a/Mage.Sets/src/mage/cards/s/ShapeStealer.java +++ b/Mage.Sets/src/mage/cards/s/ShapeStealer.java @@ -4,7 +4,7 @@ package mage.cards.s; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; @@ -37,7 +37,7 @@ public final class ShapeStealer extends CardImpl { // each one in succession. The first trigger put on the stack will be the last to resolve, // so that will set Shape Stealer's final power and toughness. // Whenever Shape Stealer blocks or becomes blocked by a creature, change Shape Stealer's base power and toughness to that creature's power and toughness until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new ShapeStealerEffect(), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new ShapeStealerEffect(), false)); } public ShapeStealer(final ShapeStealer card) { diff --git a/Mage.Sets/src/mage/cards/s/SlinkingGiant.java b/Mage.Sets/src/mage/cards/s/SlinkingGiant.java index 3d83f4a134..07a3d03ff2 100644 --- a/Mage.Sets/src/mage/cards/s/SlinkingGiant.java +++ b/Mage.Sets/src/mage/cards/s/SlinkingGiant.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; @@ -28,7 +28,7 @@ public final class SlinkingGiant extends CardImpl { this.addAbility(WitherAbility.getInstance()); // Whenever Slinking Giant blocks or becomes blocked, it gets -3/-0 until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-3, 0, Duration.EndOfTurn), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(-3, 0, Duration.EndOfTurn), false)); } public SlinkingGiant(final SlinkingGiant card) { diff --git a/Mage.Sets/src/mage/cards/s/SpittingSlug.java b/Mage.Sets/src/mage/cards/s/SpittingSlug.java index 6907a53aab..4b52189692 100644 --- a/Mage.Sets/src/mage/cards/s/SpittingSlug.java +++ b/Mage.Sets/src/mage/cards/s/SpittingSlug.java @@ -4,7 +4,7 @@ package mage.cards.s; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; @@ -39,7 +39,7 @@ public final class SpittingSlug extends CardImpl { this.toughness = new MageInt(4); // Whenever Spitting Slug blocks or becomes blocked, you may pay {1}{G}. If you do, Spitting Slug gains first strike until end of turn. Otherwise, each creature blocking or blocked by Spitting Slug gains first strike until end of turn. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility( + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility( new DoIfCostPaid(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new SpittingSlugEffect(), new ManaCostsImpl("{1}{G}")).setText("you may pay {1}{G}. If you do, {this} gains first strike until end of turn. Otherwise, each creature blocking or blocked by {this} gains first strike until end of turn"), diff --git a/Mage.Sets/src/mage/cards/t/TalruumChampion.java b/Mage.Sets/src/mage/cards/t/TalruumChampion.java index abb97d8c05..96734c2cc1 100644 --- a/Mage.Sets/src/mage/cards/t/TalruumChampion.java +++ b/Mage.Sets/src/mage/cards/t/TalruumChampion.java @@ -3,7 +3,7 @@ package mage.cards.t; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; import mage.abilities.keyword.FirstStrikeAbility; @@ -31,7 +31,7 @@ public final class TalruumChampion extends CardImpl { // Whenever Talruum Champion blocks or becomes blocked by a creature, that creature loses first strike until end of turn. Effect effect = new LoseAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); effect.setText("that creature loses first strike until end of turn"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false)); } public TalruumChampion(final TalruumChampion card) { diff --git a/Mage.Sets/src/mage/cards/t/TangleAsp.java b/Mage.Sets/src/mage/cards/t/TangleAsp.java index ac1a74de78..a51b71dd67 100644 --- a/Mage.Sets/src/mage/cards/t/TangleAsp.java +++ b/Mage.Sets/src/mage/cards/t/TangleAsp.java @@ -3,7 +3,7 @@ package mage.cards.t; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -30,7 +30,7 @@ public final class TangleAsp extends CardImpl { // Whenever Tangle Asp blocks or becomes blocked by a creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false)); } public TangleAsp(final TangleAsp card) { diff --git a/Mage.Sets/src/mage/cards/t/ThicketBasilisk.java b/Mage.Sets/src/mage/cards/t/ThicketBasilisk.java index ceb3f94855..989d765d6a 100644 --- a/Mage.Sets/src/mage/cards/t/ThicketBasilisk.java +++ b/Mage.Sets/src/mage/cards/t/ThicketBasilisk.java @@ -3,7 +3,7 @@ package mage.cards.t; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -37,7 +37,7 @@ public final class ThicketBasilisk extends CardImpl { // Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, filter, false)); } public ThicketBasilisk(final ThicketBasilisk card) { diff --git a/Mage.Sets/src/mage/cards/t/TreefolkMystic.java b/Mage.Sets/src/mage/cards/t/TreefolkMystic.java index a7750637f7..e9a4807fc1 100644 --- a/Mage.Sets/src/mage/cards/t/TreefolkMystic.java +++ b/Mage.Sets/src/mage/cards/t/TreefolkMystic.java @@ -6,7 +6,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -30,7 +30,7 @@ public final class TreefolkMystic extends CardImpl { this.toughness = new MageInt(4); // Whenever Treefolk Mystic blocks or becomes blocked by a creature, destroy all Auras attached to that creature. - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new TreefolkMysticEffect(), false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new TreefolkMysticEffect(), false)); } public TreefolkMystic(final TreefolkMystic card) { diff --git a/Mage.Sets/src/mage/cards/v/VenomousDragonfly.java b/Mage.Sets/src/mage/cards/v/VenomousDragonfly.java index 4815d4b859..7da8c928d2 100644 --- a/Mage.Sets/src/mage/cards/v/VenomousDragonfly.java +++ b/Mage.Sets/src/mage/cards/v/VenomousDragonfly.java @@ -3,7 +3,7 @@ package mage.cards.v; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -32,7 +32,7 @@ public final class VenomousDragonfly extends CardImpl { // Whenever Venomous Dragonfly blocks or becomes blocked by a creature, destroy that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect())); effect.setText("destroy that creature at end of combat"); - this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false)); + this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, false)); } public VenomousDragonfly(final VenomousDragonfly card) { diff --git a/Mage.Sets/src/mage/cards/w/WitherscaleWurm.java b/Mage.Sets/src/mage/cards/w/WitherscaleWurm.java index 6d8d46bc86..dab327b5f5 100644 --- a/Mage.Sets/src/mage/cards/w/WitherscaleWurm.java +++ b/Mage.Sets/src/mage/cards/w/WitherscaleWurm.java @@ -4,7 +4,7 @@ package mage.cards.w; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedSourceTriggeredAbility; import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RemoveAllCountersSourceEffect; @@ -34,7 +34,7 @@ public final class WitherscaleWurm extends CardImpl { // Whenever Witherscale Wurm blocks or becomes blocked by a creature, that creature gains wither until end of turn. Effect effect = new GainAbilityTargetEffect(WitherAbility.getInstance(), Duration.EndOfTurn); effect.setText("that creature gains wither until end of turn"); - Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, new FilterCreaturePermanent("a creature"), false, null, true); + Ability ability = new BlocksOrBecomesBlockedSourceTriggeredAbility(effect, new FilterCreaturePermanent("a creature"), false, null, true); this.addAbility(ability); // Whenever Witherscale Wurm deals damage to an opponent, remove all -1/-1 counters from it. diff --git a/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedSourceTriggeredAbility.java new file mode 100644 index 0000000000..3863d19045 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedSourceTriggeredAbility.java @@ -0,0 +1,91 @@ + +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author North, Loki + */ +public class BlocksOrBecomesBlockedSourceTriggeredAbility extends TriggeredAbilityImpl { + + protected FilterPermanent filter; + protected String rule; + protected boolean setTargetPointer; + + public BlocksOrBecomesBlockedSourceTriggeredAbility(Effect effect, boolean optional) { + this(effect, StaticFilters.FILTER_PERMANENT_CREATURE, optional, null, true); + } + + public BlocksOrBecomesBlockedSourceTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional) { + this(effect, filter, optional, null, true); + } + + public BlocksOrBecomesBlockedSourceTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule) { + this(effect, filter, optional, rule, true); + } + + public BlocksOrBecomesBlockedSourceTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule, boolean setTargetPointer) { + super(Zone.BATTLEFIELD, effect, optional); + this.filter = filter; + this.rule = rule; + this.setTargetPointer = setTargetPointer; + } + + public BlocksOrBecomesBlockedSourceTriggeredAbility(final BlocksOrBecomesBlockedSourceTriggeredAbility ability) { + super(ability); + this.filter = ability.filter; + this.rule = ability.rule; + this.setTargetPointer = ability.setTargetPointer; + + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.BLOCKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId().equals(this.getSourceId())) { + Permanent blocked = game.getPermanent(event.getTargetId()); + if (blocked != null && filter.match(blocked, game)) { + if (setTargetPointer) { + this.getEffects().setTargetPointer(new FixedTarget(blocked, game)); + } + return true; + } + } + if (event.getTargetId().equals(this.getSourceId())) { + Permanent blocker = game.getPermanent(event.getSourceId()); + if (blocker != null && filter.match(blocker, game)) { + if (setTargetPointer) { + this.getEffects().setTargetPointer(new FixedTarget(blocker, game)); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + if (rule != null) { + return rule; + } + return "Whenever {this} blocks or becomes blocked" + (setTargetPointer ? " by a " + filter.getMessage() : "") + ", " + super.getRule(); + } + + @Override + public BlocksOrBecomesBlockedSourceTriggeredAbility copy() { + return new BlocksOrBecomesBlockedSourceTriggeredAbility(this); + } +}