mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08:00
Fixed that creatures or enchantments with triggered abilities that should trigger only once as they or the enhcanted creature blocks (also multiple creatures e.g. Guardian of the Gateless) really only trigger once. They triggered wrongly per blocked creature before.
This commit is contained in:
parent
ccd91f0657
commit
63b8890287
15 changed files with 244 additions and 60 deletions
|
|
@ -28,7 +28,7 @@
|
|||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.BlocksAttachedTriggeredAbility;
|
||||
import mage.abilities.common.BlocksCreatureAttachedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.SkipNextUntapTargetEffect;
|
||||
|
|
@ -63,7 +63,7 @@ public class ShieldOfTheRighteous extends CardImpl<ShieldOfTheRighteous> {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
|
||||
|
||||
// Whenever equipped creature blocks a creature, that creature doesn't untap during its controller's next untap step.
|
||||
this.addAbility(new BlocksAttachedTriggeredAbility(new SkipNextUntapTargetEffect("that creature"), "equipped", false, false, true));
|
||||
this.addAbility(new BlocksCreatureAttachedTriggeredAbility(new SkipNextUntapTargetEffect("that creature"), "equipped", false, false, true));
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BlocksTriggeredAbility;
|
||||
import mage.abilities.common.BlocksCreatureTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
|
|
@ -61,7 +61,7 @@ public class KaijinOfTheVanishingTouch extends CardImpl<KaijinOfTheVanishingTouc
|
|||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
// Whenever Kaijin of the Vanishing Touch blocks a creature, return that creature to its owner's hand at end of combat. (Return it only if it's on the battlefield.)
|
||||
Ability ability = new BlocksTriggeredAbility(new KaijinOfTheVanishingTouchEffect(), false, true);
|
||||
Ability ability = new BlocksCreatureTriggeredAbility(new KaijinOfTheVanishingTouchEffect(), false, true);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,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.BlocksCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
|
|
@ -69,7 +69,7 @@ public class BrimazKingOfOreskos extends CardImpl<BrimazKingOfOreskos> {
|
|||
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new CatSoldierCreatureToken(), 1, false, true), false));
|
||||
|
||||
// Whenever Brimaz blocks a creature, put a 1/1 white Cat Soldier creature token with vigilance onto the battlefield blocking that creature.
|
||||
this.addAbility(new BlocksTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
|
||||
this.addAbility(new BlocksCreatureTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
|
||||
}
|
||||
|
||||
public BrimazKingOfOreskos(final BrimazKingOfOreskos card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.sets.conflux;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BlocksTriggeredAbility;
|
||||
import mage.abilities.common.BlocksCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
|
@ -65,7 +65,7 @@ public class Meglonoth extends CardImpl<Meglonoth> {
|
|||
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 BlocksCreatureTriggeredAbility(new MeglonothEffect(), false, true));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class FavorOfTheWoods extends CardImpl<FavorOfTheWoods> {
|
|||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// Whenever enchanted creature blocks, you gain 3 life.
|
||||
this.addAbility(new BlocksAttachedTriggeredAbility(new GainLifeEffect(3), "equipped", false));
|
||||
this.addAbility(new BlocksAttachedTriggeredAbility(new GainLifeEffect(3), "enchanted", false));
|
||||
}
|
||||
|
||||
public FavorOfTheWoods(final FavorOfTheWoods card) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BlocksTriggeredAbility;
|
||||
import mage.abilities.common.BlocksCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.common.SkipNextUntapTargetEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -51,7 +51,7 @@ public class WallOfFrost extends CardImpl<WallOfFrost> {
|
|||
|
||||
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 SkipNextUntapTargetEffect("that creature"), false, true));
|
||||
this.addAbility(new BlocksCreatureTriggeredAbility(new SkipNextUntapTargetEffect("that creature"), false, true));
|
||||
}
|
||||
|
||||
public WallOfFrost(final WallOfFrost card) {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,10 @@ public class GoldenglowMoth extends CardImpl<GoldenglowMoth> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Whenever Goldenglow Moth blocks, you may gain 4 life.
|
||||
this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(4), true));
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@ public class PrideGuardian extends CardImpl<PrideGuardian> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
// Whenever Pride Guardian blocks, you gain 3 life.
|
||||
this.addAbility(new BlocksTriggeredAbility(new GainLifeEffect(3), false));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ public class PsychicMembrane extends CardImpl<PsychicMembrane> {
|
|||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
// Whenever Psychic Membrane blocks, you may draw a card.
|
||||
this.addAbility(new BlocksTriggeredAbility(new DrawCardControllerEffect(1), true));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,10 @@ public class EliteJavelineer extends CardImpl<EliteJavelineer> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Elite Javelineer blocks, it deals 1 damage to target attacking creature.
|
||||
Ability ability = new BlocksTriggeredAbility(new DamageTargetEffect(1), false);
|
||||
ability.addTarget(new TargetCreaturePermanent(new FilterAttackingCreature()));
|
||||
ability.addTarget(new TargetCreaturePermanent(new FilterAttackingCreature(), true));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BlocksTriggeredAbility;
|
||||
import mage.abilities.common.BlocksCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -57,7 +57,8 @@ public class LoyalSentry extends CardImpl<LoyalSentry> {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(new BlocksTriggeredAbility(new LoyalSentryEffect(), false, true));
|
||||
// When Loyal Sentry blocks a creature, destroy that creature and Loyal Sentry.
|
||||
this.addAbility(new BlocksCreatureTriggeredAbility(new LoyalSentryEffect(), false, true));
|
||||
}
|
||||
|
||||
public LoyalSentry (final LoyalSentry card) {
|
||||
|
|
@ -82,11 +83,11 @@ class LoyalSentryEffect extends OneShotEffect<LoyalSentryEffect> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent p = game.getPermanent(source.getFirstTarget());
|
||||
Permanent s = game.getPermanent(source.getSourceId());
|
||||
Permanent p = game.getPermanent(source.getFirstTarget());
|
||||
if (p != null) {
|
||||
p.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
Permanent s = game.getPermanent(source.getSourceId());
|
||||
if (s != null) {
|
||||
s.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
|
|
@ -98,4 +99,4 @@ class LoyalSentryEffect extends OneShotEffect<LoyalSentryEffect> {
|
|||
return new LoyalSentryEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue