- Refactored BlocksTriggeredAbility to BlocksSourceTriggeredAbility

This commit is contained in:
jeffwadsworth 2020-08-10 11:49:03 -05:00
parent 12c50420bf
commit 3b90c48c75
46 changed files with 157 additions and 90 deletions

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -36,7 +36,7 @@ public final class AetherMembrane extends CardImpl {
// Whenever Aether Membrane blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public AetherMembrane(final AetherMembrane card) {

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
@ -35,7 +35,7 @@ public final class Aetherplasm extends CardImpl {
this.toughness = new MageInt(1);
// Whenever Aetherplasm blocks a creature, you may return Aetherplasm to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature.
this.addAbility(new BlocksTriggeredAbility(new DoIfCostPaid(new AetherplasmEffect(), new ReturnToHandFromBattlefieldSourceCost()), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new DoIfCostPaid(new AetherplasmEffect(), new ReturnToHandFromBattlefieldSourceCost()), false, true));
}
public Aetherplasm(final Aetherplasm card) {

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect;
@ -41,7 +41,7 @@ public final class AgelessSentinels extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Ageless Sentinels blocks, it becomes a Bird Giant, and it loses defender.
Ability ability = new BlocksTriggeredAbility(new AgelessSentinelsEffect(), false, false, true);
Ability ability = new BlocksSourceTriggeredAbility(new AgelessSentinelsEffect(), false, false, true);
Effect effect = new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield);
effect.setText("and it loses defender");
ability.addEffect(effect);

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.constants.SubType;
@ -27,7 +27,7 @@ public final class AlabornZealot extends CardImpl {
this.toughness = new MageInt(1);
// When Alaborn Zealot blocks a creature, destroy that creature and Alaborn Zealot.
Ability ability = new BlocksTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
Ability ability = new BlocksSourceTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
ability.addEffect(new DestroySourceEffect().setText("and {this}"));
this.addAbility(ability);
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.VigilanceAbility;
@ -44,7 +44,7 @@ public final class BrimazKingOfOreskos extends CardImpl {
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new CatSoldierCreatureToken(), 1, false, true), false));
// Whenever Brimaz blocks a creature, create a 1/1 white Cat Soldier creature token with vigilance blocking that creature.
this.addAbility(new BlocksTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
}
public BrimazKingOfOreskos(final BrimazKingOfOreskos card) {

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroySourceEffect;
@ -29,7 +29,7 @@ public final class CinderWall extends CardImpl {
// Defender
this.addAbility(DefenderAbility.getInstance());
// When Cinder Wall blocks, destroy it at end of combat.
this.addAbility(new BlocksTriggeredAbility(
this.addAbility(new BlocksSourceTriggeredAbility(
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroySourceEffect())),
false, false, true
));

View file

@ -3,7 +3,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect;
import mage.constants.SubType;
import mage.abilities.keyword.DefenderAbility;
@ -34,7 +34,7 @@ public final class ElderLandWurm extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// When Elder Land Wurm blocks, it loses defender.
this.addAbility(new BlocksTriggeredAbility(new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), false, false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), false, false, true));
}
public ElderLandWurm(final ElderLandWurm card) {

View file

@ -4,7 +4,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -28,7 +28,7 @@ public final class EliteJavelineer extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Elite Javelineer blocks, it deals 1 damage to target attacking creature.
Ability ability = new BlocksTriggeredAbility(new DamageTargetEffect(1, "it"), false);
Ability ability = new BlocksSourceTriggeredAbility(new DamageTargetEffect(1, "it"), false);
ability.addTarget(new TargetCreaturePermanent(new FilterAttackingCreature()));
this.addAbility(ability);
}

View file

@ -3,7 +3,7 @@ package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -24,7 +24,7 @@ public final class FolkOfAnHavva extends CardImpl {
this.toughness = new MageInt(1);
// Whenever Folk of An-Havva blocks, it gets +2/+0 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false));
}
public FolkOfAnHavva(final FolkOfAnHavva card) {

View file

@ -4,7 +4,7 @@ package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -29,7 +29,7 @@ public final class FortressCyclops extends CardImpl {
// Whenever Fortress Cyclops attacks, it gets +3/+0 until end of turn.
this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(3,0, Duration.EndOfTurn), false));
// Whenever Fortress Cyclops blocks, it gets +0/+3 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0,3, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(0,3, Duration.EndOfTurn), false));
}
public FortressCyclops(final FortressCyclops card) {

View file

@ -3,7 +3,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class GiantBadger extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Giant Badger blocks, it gets +2/+2 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false));
}
public GiantBadger(final GiantBadger card) {

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
@ -37,7 +37,7 @@ public final class GoblinSnowman extends CardImpl {
//Whenever Goblin Snowman blocks, prevent all combat damage that would be dealt to and dealt by it this turn.
Effect effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn);
effect.setText("prevent all combat damage that would be dealt to");
Ability ability = new BlocksTriggeredAbility(effect, false);
Ability ability = new BlocksSourceTriggeredAbility(effect, false);
effect = new PreventCombatDamageToSourceEffect(Duration.EndOfTurn);
effect.setText("and dealt by it this turn");
ability.addEffect(effect);

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -28,7 +28,7 @@ public final class GoldenglowMoth extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Goldenglow Moth blocks, you may gain 4 life.
this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(4), true));
this.addAbility(new BlocksSourceTriggeredAbility(new GainLifeEffect(4), true));
}

View file

@ -3,7 +3,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
@ -35,7 +35,7 @@ public final class GuardianOfTheGateless extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect(0)));
// Whenever Guardian of the Gateless blocks, it gets +1/+1 until end of turn for each creature it's blocking.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(1,1, Duration.EndOfTurn),false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(1,1, Duration.EndOfTurn),false));
}
public GuardianOfTheGateless(final GuardianOfTheGateless card) {

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.effects.Effect;
@ -42,7 +42,7 @@ public final class HordeAmbusher extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Horde Ambusher blocks, it deals 1 damage to you.
this.addAbility(new BlocksTriggeredAbility(new DamageControllerEffect(1, "it"), false));
this.addAbility(new BlocksSourceTriggeredAbility(new DamageControllerEffect(1, "it"), false));
// Morph - Reveal a red card in your hand.
this.addAbility(new MorphAbility(this, new RevealTargetFromHandCost(new TargetCardInHand(filter))));

View file

@ -4,7 +4,7 @@ package mage.cards.i;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -37,7 +37,7 @@ public final class InfernalMedusa extends CardImpl {
// Whenever Infernal Medusa blocks 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 BlocksTriggeredAbility(effect, false, true));
this.addAbility(new BlocksSourceTriggeredAbility(effect, false, true));
// Whenever Infernal Medusa becomes blocked by a non-Wall creature, destroy that creature at end of combat.
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
}

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
@ -33,7 +33,7 @@ public final class JarethLeonineTitan extends CardImpl {
this.toughness = new MageInt(7);
// Whenever Jareth, Leonine Titan blocks, it gets +7/+7 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(7,7,Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(7,7,Duration.EndOfTurn), false));
// {W}: Jareth gains protection from the color of your choice until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}"));
this.addAbility(ability);

View file

@ -3,7 +3,7 @@ package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -33,7 +33,7 @@ public final class KaijinOfTheVanishingTouch extends CardImpl {
// Whenever Kaijin of the Vanishing Touch blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public KaijinOfTheVanishingTouch(final KaijinOfTheVanishingTouch card) {

View file

@ -3,7 +3,7 @@ package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
@ -24,7 +24,7 @@ public final class LabyrinthMinotaur extends CardImpl {
this.toughness = new MageInt(4);
// Whenever Labyrinth Minotaur blocks a creature, that creature doesn't untap during its controller's next untap step.
this.addAbility(new BlocksTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
}
public LabyrinthMinotaur(final LabyrinthMinotaur card) {

View file

@ -4,7 +4,7 @@ package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
@ -27,7 +27,7 @@ public final class LoyalSentry extends CardImpl {
this.toughness = new MageInt(1);
// When Loyal Sentry blocks a creature, destroy that creature and Loyal Sentry.
Ability ability = new BlocksTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
Ability ability = new BlocksSourceTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
ability.addEffect(new DestroySourceEffect().setText("and {this}"));
this.addAbility(ability);
}

View file

@ -4,7 +4,7 @@ package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
@ -45,7 +45,7 @@ public final class MartonStromgald extends CardImpl {
// Whenever Marton Stromgald blocks, other blocking creatures get +1/+1 until end of turn for each blocking creature other than Marton Stromgald.
PermanentsOnBattlefieldCount blockingValue = new PermanentsOnBattlefieldCount(blockingFilter);
this.addAbility(new BlocksTriggeredAbility(new BoostAllEffect(blockingValue, blockingValue, Duration.EndOfTurn, new FilterBlockingCreature(), true, null, true), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostAllEffect(blockingValue, blockingValue, Duration.EndOfTurn, new FilterBlockingCreature(), true, null, true), false));
}

View file

@ -2,7 +2,7 @@ package mage.cards.m;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.keyword.VigilanceAbility;
@ -35,7 +35,7 @@ public final class Meglonoth extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Whenever Meglonoth blocks a creature, Meglonoth deals damage to that creature's controller equal to Meglonoth's power.
this.addAbility(new BlocksTriggeredAbility(new MeglonothEffect(), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new MeglonothEffect(), false, true));
}

View file

@ -4,7 +4,7 @@ package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -27,7 +27,7 @@ public final class PrideGuardian extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Pride Guardian blocks, you gain 3 life.
this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(3), false));
this.addAbility(new BlocksSourceTriggeredAbility(new GainLifeEffect(3), false));
}
public PrideGuardian(final PrideGuardian card) {

View file

@ -3,7 +3,7 @@ package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -26,7 +26,7 @@ public final class PsychicMembrane extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Psychic Membrane blocks, you may draw a card.
this.addAbility(new BlocksTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
this.addAbility(new BlocksSourceTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
}
public PsychicMembrane(final PsychicMembrane card) {

View file

@ -4,7 +4,7 @@ package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
@ -32,7 +32,7 @@ public final class RootSpider extends CardImpl {
effect.setText("it gets +1/+0");
Effect effect2 = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect2.setText("and gains first strike until end of turn");
Ability ability = new BlocksTriggeredAbility(effect, false);
Ability ability = new BlocksSourceTriggeredAbility(effect, false);
ability.addEffect(effect2);
this.addAbility(ability);
}

View file

@ -3,7 +3,7 @@ package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
@ -28,7 +28,7 @@ public final class RoyalTrooper extends CardImpl {
// Whenever Royal Trooper blocks, 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");
this.addAbility(new BlocksTriggeredAbility(effect, false));
this.addAbility(new BlocksSourceTriggeredAbility(effect, false));
}
public RoyalTrooper(final RoyalTrooper card) {

View file

@ -4,7 +4,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
@ -38,7 +38,7 @@ public final class SereneMaster extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Serene Master blocks, exchange its power and the power of target creature it's blocking until end of combat.
this.addAbility(new BlocksTriggeredAbility(new SereneMasterEffect(), false));
this.addAbility(new BlocksSourceTriggeredAbility(new SereneMasterEffect(), false));
}

View file

@ -3,7 +3,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -27,7 +27,7 @@ public final class ShieldSphere extends CardImpl {
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever Shield Sphere blocks, put a -0/-1 counter on it.
this.addAbility(new BlocksTriggeredAbility(new AddCountersSourceEffect(new BoostCounter(0, -1)), false));
this.addAbility(new BlocksSourceTriggeredAbility(new AddCountersSourceEffect(new BoostCounter(0, -1)), false));
}
public ShieldSphere(final ShieldSphere card) {

View file

@ -4,7 +4,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.costs.common.TapSourceCost;
@ -35,7 +35,7 @@ public final class ShieldedAetherThief extends CardImpl {
this.addAbility(FlashAbility.getInstance());
// Whenever Shield Aether Thief blocks, you get {E}.
this.addAbility(new BlocksTriggeredAbility(new GetEnergyCountersControllerEffect(1), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new GetEnergyCountersControllerEffect(1), false, true));
// {T}, Pay {E}{E}{E}: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost());

View file

@ -3,7 +3,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class ShuDefender extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Shu Defender blocks, it gets +0/+2 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
}
public ShuDefender(final ShuDefender card) {

View file

@ -4,7 +4,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
@ -29,7 +29,7 @@ public final class Spincrusher extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Spincrusher blocks, put a +1/+1 counter on it.
this.addAbility(new BlocksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new BlocksSourceTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// Remove a +1/+1 counter from Spincrusher: Spincrusher can't be blocked this turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CantBeBlockedSourceEffect(Duration.EndOfTurn),

View file

@ -3,7 +3,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
@ -31,7 +31,7 @@ public final class StoicEphemera extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Stoic Ephemera blocks, sacrifice it at end of combat.
this.addAbility(new BlocksTriggeredAbility(
this.addAbility(new BlocksSourceTriggeredAbility(
new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeSourceEffect())
), false, false, true

View file

@ -3,7 +3,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -28,7 +28,7 @@ public final class SustainerOfTheRealm extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Sustainer of the Realm blocks, it gets +0/+2 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
}
public SustainerOfTheRealm(final SustainerOfTheRealm card) {

View file

@ -3,7 +3,7 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class TownSentry extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Town Sentry blocks, it gets +0/+2 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false));
}
public TownSentry(final TownSentry card) {

View file

@ -4,7 +4,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.DefenderAbility;
@ -29,7 +29,7 @@ public final class VertigoSpawn extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Vertigo Spawn blocks a creature, tap that creature. That creature doesn't untap during its controller's next untap step.
Ability ability = new BlocksTriggeredAbility(new TapTargetEffect("that creature"), false, true);
Ability ability = new BlocksSourceTriggeredAbility(new TapTargetEffect("that creature"), false, true);
ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature"));
this.addAbility(ability);
}

View file

@ -3,7 +3,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.BandingAbility;
import mage.abilities.keyword.DefenderAbility;
@ -47,7 +47,7 @@ public final class WallOfCaltrops extends CardImpl {
}
}
class WallOfCaltropsAbility extends BlocksTriggeredAbility {
class WallOfCaltropsAbility extends BlocksSourceTriggeredAbility {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wall creature");

View file

@ -3,7 +3,7 @@ package mage.cards.w;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -32,7 +32,7 @@ public final class WallOfDust extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Wall of Dust blocks a creature, that creature can't attack during its controller's next turn.
this.addAbility(new BlocksTriggeredAbility(new WallOfDustRestrictionEffect(), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new WallOfDustRestrictionEffect(), false, true));
}
private WallOfDust(final WallOfDust card) {

View file

@ -3,7 +3,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -27,7 +27,7 @@ public final class WallOfFrost extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Wall of Frost blocks a creature, that creature doesn't untap during its controller's next untap step.
this.addAbility(new BlocksTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
}
public WallOfFrost(final WallOfFrost card) {

View file

@ -3,7 +3,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -33,7 +33,7 @@ public final class WallOfJunk extends CardImpl {
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)));
effect.setText("return it to its owner's hand at end of combat");
this.addAbility(new BlocksTriggeredAbility(effect, false, false, true));
this.addAbility(new BlocksSourceTriggeredAbility(effect, false, false, true));
}
public WallOfJunk(final WallOfJunk card) {

View file

@ -3,7 +3,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -32,7 +32,7 @@ public final class WallOfTears extends CardImpl {
// Whenever Wall of Tears blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksSourceTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public WallOfTears(final WallOfTears card) {

View file

@ -4,7 +4,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
@ -48,7 +48,7 @@ public final class WoollyRazorback extends CardImpl {
new SourceHasCounterCondition(CounterType.ICE), "and it has defender"));
this.addAbility(ability);
// Whenever Woolly Razorback blocks, remove an ice counter from it.
this.addAbility(new BlocksTriggeredAbility(new RemoveCounterSourceEffect(CounterType.ICE.createInstance()), false));
this.addAbility(new BlocksSourceTriggeredAbility(new RemoveCounterSourceEffect(CounterType.ICE.createInstance()), false));
}
public WoollyRazorback(final WoollyRazorback card) {

View file

@ -5,7 +5,7 @@ import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -31,7 +31,7 @@ public final class YdwenEfreet extends CardImpl {
this.toughness = new MageInt(6);
// Whenever Ydwen Efreet blocks, flip a coin. If you lose the flip, remove Ydwen Efreet from combat and it can't block this turn. Creatures it was blocking that had become blocked by only Ydwen Efreet this combat become unblocked.
this.addAbility(new BlocksTriggeredAbility(new YdwenEfreetEffect(), false));
this.addAbility(new BlocksSourceTriggeredAbility(new YdwenEfreetEffect(), false));
}
public YdwenEfreet(final YdwenEfreet card) {

View file

@ -3,7 +3,7 @@ package mage.cards.z;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -24,7 +24,7 @@ public final class ZephyrSpirit extends CardImpl {
this.toughness = new MageInt(6);
// When Zephyr Spirit blocks, return it to its owner's hand.
this.addAbility(new BlocksTriggeredAbility(
this.addAbility(new BlocksSourceTriggeredAbility(
new ReturnToHandSourceEffect(true).setText("return it to its owner's hand"),
false, false, true
));

View file

@ -3,7 +3,7 @@ package mage.cards.z;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.HorsemanshipAbility;
import mage.cards.CardImpl;
@ -29,7 +29,7 @@ public final class ZhaoZilongTigerGeneral extends CardImpl {
// Horsemanship
this.addAbility(HorsemanshipAbility.getInstance());
// Whenever Zhao Zilong, Tiger General blocks, it gets +1/+1 until end of turn.
this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false));
this.addAbility(new BlocksSourceTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false));
}
public ZhaoZilongTigerGeneral(final ZhaoZilongTigerGeneral card) {

View file

@ -0,0 +1,67 @@
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author North
*/
public class BlocksSourceTriggeredAbility extends TriggeredAbilityImpl {
private boolean setTargetPointer;
private boolean once = false;
public BlocksSourceTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, false);
}
public BlocksSourceTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
this(effect, optional, setTargetPointer, false);
}
public BlocksSourceTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer, boolean once) {
super(Zone.BATTLEFIELD, effect, optional);
this.setTargetPointer = setTargetPointer;
this.once = once;
}
public BlocksSourceTriggeredAbility(final BlocksSourceTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
this.once = ability.once;
}
@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())) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
return false;
}
@Override
public String getRule() {
return "When" + (once ? "" : "ever") + " {this} blocks" + (setTargetPointer ? " a creature, " : ", ") + super.getRule();
}
@Override
public BlocksSourceTriggeredAbility copy() {
return new BlocksSourceTriggeredAbility(this);
}
}

View file

@ -1,7 +1,7 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.BlocksSourceTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.constants.CardType;
import mage.constants.SubType;
@ -20,7 +20,7 @@ public final class MesmerizingBenthidToken extends TokenImpl {
subtype.add(SubType.ILLUSION);
power = new MageInt(0);
toughness = new MageInt(2);
this.addAbility(new BlocksTriggeredAbility(
this.addAbility(new BlocksSourceTriggeredAbility(
new DontUntapInControllersNextUntapStepTargetEffect("that creature"),
false, true
));