From eb489e3ed49e4b906b5fcf6e344e61ad5b466641 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 14 Oct 2023 19:05:02 -0400 Subject: [PATCH] [WHO] Implement Judoon Enforcers --- .../src/mage/cards/j/JudoonEnforcers.java | 48 +++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 1 + ...ngeMaxNumberThatCanAttackSourceEffect.java | 22 ++------- 3 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/j/JudoonEnforcers.java diff --git a/Mage.Sets/src/mage/cards/j/JudoonEnforcers.java b/Mage.Sets/src/mage/cards/j/JudoonEnforcers.java new file mode 100644 index 00000000000..b98dbf8ef12 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JudoonEnforcers.java @@ -0,0 +1,48 @@ +package mage.cards.j; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.ChangeMaxNumberThatCanAttackSourceEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JudoonEnforcers extends CardImpl { + + public JudoonEnforcers(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{W}"); + + this.subtype.add(SubType.ALIEN); + this.subtype.add(SubType.RHINO); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // No more than one creature can attack you each combat. + this.addAbility(new SimpleStaticAbility(new ChangeMaxNumberThatCanAttackSourceEffect(1))); + + // Suspend 6--{1}{R}{W} + this.addAbility(new SuspendAbility(6, new ManaCostsImpl<>("{1}{R}{W}"), this)); + } + + private JudoonEnforcers(final JudoonEnforcers card) { + super(card); + } + + @Override + public JudoonEnforcers copy() { + return new JudoonEnforcers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index dd9fed88197..60946af84ae 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -111,6 +111,7 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Jamie McCrimmon", 105, Rarity.RARE, mage.cards.j.JamieMcCrimmon.class)); cards.add(new SetCardInfo("Jenny Flint", 136, Rarity.RARE, mage.cards.j.JennyFlint.class)); cards.add(new SetCardInfo("Jenny, Generated Anomaly", 137, Rarity.RARE, mage.cards.j.JennyGeneratedAnomaly.class)); + cards.add(new SetCardInfo("Judoon Enforcers", 138, Rarity.UNCOMMON, mage.cards.j.JudoonEnforcers.class)); cards.add(new SetCardInfo("K-9, Mark I", 47, Rarity.RARE, mage.cards.k.K9MarkI.class)); cards.add(new SetCardInfo("Laser Screwdriver", 178, Rarity.UNCOMMON, mage.cards.l.LaserScrewdriver.class)); cards.add(new SetCardInfo("Lavaclaw Reaches", 289, Rarity.RARE, mage.cards.l.LavaclawReaches.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/ChangeMaxNumberThatCanAttackSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/ChangeMaxNumberThatCanAttackSourceEffect.java index 6309fe6a287..008ded32442 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/ChangeMaxNumberThatCanAttackSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/ChangeMaxNumberThatCanAttackSourceEffect.java @@ -8,6 +8,7 @@ import mage.constants.Outcome; import mage.constants.SubLayer; import mage.game.Game; import mage.players.Player; +import mage.util.CardUtil; /** * @author LevelX2 @@ -17,9 +18,10 @@ public class ChangeMaxNumberThatCanAttackSourceEffect extends ContinuousEffectIm private final int maxAttackedBy; public ChangeMaxNumberThatCanAttackSourceEffect(int maxAttackedBy) { - super(Duration.WhileOnBattlefield, Outcome.Benefit); + super(Duration.WhileOnBattlefield, Layer.RulesEffects, SubLayer.NA, Outcome.Benefit); this.maxAttackedBy = maxAttackedBy; - staticText = "No more than " + (maxAttackedBy == 1 ? "one" : "two") + " creatures can attack you each combat"; + staticText = "no more than " + CardUtil.numberToText(maxAttackedBy) + + " creature" + (maxAttackedBy > 1 ? "s" : "") + " can attack you each combat"; } protected ChangeMaxNumberThatCanAttackSourceEffect(final ChangeMaxNumberThatCanAttackSourceEffect effect) { @@ -33,11 +35,7 @@ public class ChangeMaxNumberThatCanAttackSourceEffect extends ContinuousEffectIm } @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (layer != Layer.RulesEffects) { - return false; - } - + public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; @@ -48,14 +46,4 @@ public class ChangeMaxNumberThatCanAttackSourceEffect extends ContinuousEffectIm } return true; } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.RulesEffects; - } }