From e0cc1db4fe4c4f75ce729a3fdf5133e9215b7f4f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Nov 2022 10:19:53 -0400 Subject: [PATCH] [BRO] Implement Trench Stalker --- .../src/mage/cards/e/EvangelOfSynthesis.java | 18 ++----- Mage.Sets/src/mage/cards/e/Eyekite.java | 17 +----- Mage.Sets/src/mage/cards/g/GnarledSage.java | 33 ++++-------- .../src/mage/cards/s/SpinehornMinotaur.java | 20 ++----- Mage.Sets/src/mage/cards/t/TomeAnima.java | 25 +++------ Mage.Sets/src/mage/cards/t/TrenchStalker.java | 53 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + .../common/DrewTwoOrMoreCardsCondition.java | 24 +++++++++ 8 files changed, 103 insertions(+), 88 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/TrenchStalker.java create mode 100644 Mage/src/main/java/mage/abilities/condition/common/DrewTwoOrMoreCardsCondition.java diff --git a/Mage.Sets/src/mage/cards/e/EvangelOfSynthesis.java b/Mage.Sets/src/mage/cards/e/EvangelOfSynthesis.java index 176cb9559b..ce43d36341 100644 --- a/Mage.Sets/src/mage/cards/e/EvangelOfSynthesis.java +++ b/Mage.Sets/src/mage/cards/e/EvangelOfSynthesis.java @@ -4,7 +4,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; import mage.abilities.effects.common.DrawDiscardControllerEffect; @@ -16,8 +16,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.Game; -import mage.watchers.common.CardsDrawnThisTurnWatcher; import java.util.UUID; @@ -43,12 +41,12 @@ public final class EvangelOfSynthesis extends CardImpl { // As long as you've drawn two or more cards this turn, Evangel of Synthesis gets +1/+0 and has menace. Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield), - EvangelOfSynthesisCondition.instance, "as long as you've drawn " + + DrewTwoOrMoreCardsCondition.instance, "as long as you've drawn " + "two or more cards this turn, {this} gets +1/+0" )); ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect( new MenaceAbility(false), Duration.WhileOnBattlefield - ), EvangelOfSynthesisCondition.instance, "and has menace")); + ), DrewTwoOrMoreCardsCondition.instance, "and has menace")); this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint())); } @@ -61,13 +59,3 @@ public final class EvangelOfSynthesis extends CardImpl { return new EvangelOfSynthesis(this); } } - -enum EvangelOfSynthesisCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); - return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1; - } -} diff --git a/Mage.Sets/src/mage/cards/e/Eyekite.java b/Mage.Sets/src/mage/cards/e/Eyekite.java index 5c6c5d419f..f01461f489 100644 --- a/Mage.Sets/src/mage/cards/e/Eyekite.java +++ b/Mage.Sets/src/mage/cards/e/Eyekite.java @@ -1,9 +1,8 @@ package mage.cards.e; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; import mage.abilities.effects.common.continuous.BoostSourceEffect; @@ -13,8 +12,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.Game; -import mage.watchers.common.CardsDrawnThisTurnWatcher; import java.util.UUID; @@ -36,7 +33,7 @@ public final class Eyekite extends CardImpl { // Eyekite gets +2/+0 as long as you've drawn two or more cards this turn. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield), - EyekiteCondition.instance, "{this} gets +2/+0 as long as you've drawn two or more cards this turn." + DrewTwoOrMoreCardsCondition.instance, "{this} gets +2/+0 as long as you've drawn two or more cards this turn." )).addHint(CardsDrawnThisTurnDynamicValue.getHint())); } @@ -49,13 +46,3 @@ public final class Eyekite extends CardImpl { return new Eyekite(this); } } - -enum EyekiteCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); - return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/g/GnarledSage.java b/Mage.Sets/src/mage/cards/g/GnarledSage.java index a2a6ea284d..23ecc66615 100644 --- a/Mage.Sets/src/mage/cards/g/GnarledSage.java +++ b/Mage.Sets/src/mage/cards/g/GnarledSage.java @@ -3,8 +3,9 @@ package mage.cards.g; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.ReachAbility; @@ -14,8 +15,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.Game; -import mage.watchers.common.CardsDrawnThisTurnWatcher; import java.util.UUID; @@ -35,20 +34,16 @@ public final class GnarledSage extends CardImpl { this.addAbility(ReachAbility.getInstance()); // As long as you’ve drawn two or more cards this turn, Gnarled Sage gets +0/+2 and has vigilance. - Ability ability = new SimpleStaticAbility( - new ConditionalContinuousEffect( - new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), - GnarledSageCondition.instance, - "As long as you've drawn two or more cards this turn, {this} gets +0/+2" - )); - + Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( + new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), + DrewTwoOrMoreCardsCondition.instance, + "As long as you've drawn two or more cards this turn, {this} gets +0/+2" + )); ability.addEffect(new ConditionalContinuousEffect( new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield), - GnarledSageCondition.instance, - "and has vigilance" + DrewTwoOrMoreCardsCondition.instance, "and has vigilance" )); - - this.addAbility(ability); + this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint())); } private GnarledSage(final GnarledSage card) { @@ -60,13 +55,3 @@ public final class GnarledSage extends CardImpl { return new GnarledSage(this); } } - -enum GnarledSageCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); - return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/SpinehornMinotaur.java b/Mage.Sets/src/mage/cards/s/SpinehornMinotaur.java index 36f410b81f..1148581f25 100644 --- a/Mage.Sets/src/mage/cards/s/SpinehornMinotaur.java +++ b/Mage.Sets/src/mage/cards/s/SpinehornMinotaur.java @@ -1,10 +1,10 @@ package mage.cards.s; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.CardImpl; @@ -12,8 +12,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.Game; -import mage.watchers.common.CardsDrawnThisTurnWatcher; import java.util.UUID; @@ -33,9 +31,9 @@ public final class SpinehornMinotaur extends CardImpl { // As long as you've drawn two or more cards this turn, Spinehorn Minotaur has double strike. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield), - SpinehornMinotaurCondition.instance, "As long as you've drawn two or more cards this turn, " + + DrewTwoOrMoreCardsCondition.instance, "As long as you've drawn two or more cards this turn, " + "{this} has double strike" - ))); + )).addHint(CardsDrawnThisTurnDynamicValue.getHint())); } private SpinehornMinotaur(final SpinehornMinotaur card) { @@ -47,13 +45,3 @@ public final class SpinehornMinotaur extends CardImpl { return new SpinehornMinotaur(this); } } - -enum SpinehornMinotaurCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); - return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/t/TomeAnima.java b/Mage.Sets/src/mage/cards/t/TomeAnima.java index 0ea1b1dbd7..6bbd214e82 100644 --- a/Mage.Sets/src/mage/cards/t/TomeAnima.java +++ b/Mage.Sets/src/mage/cards/t/TomeAnima.java @@ -1,10 +1,10 @@ package mage.cards.t; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.CantBeBlockedSourceAbility; import mage.cards.CardImpl; @@ -12,8 +12,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.Game; -import mage.watchers.common.CardsDrawnThisTurnWatcher; import java.util.UUID; @@ -31,10 +29,11 @@ public final class TomeAnima extends CardImpl { // Tome Anima can’t be blocked as long as you’ve drawn two or more cards this turn. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( - new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.WhileOnBattlefield), - TomeAnimaCondition.instance, - "{this} can't be blocked as long as you've drawn two or more cards this turn" - ))); + new GainAbilitySourceEffect( + new CantBeBlockedSourceAbility(), Duration.WhileOnBattlefield + ), DrewTwoOrMoreCardsCondition.instance, "{this} can't be blocked " + + "as long as you've drawn two or more cards this turn" + )).addHint(CardsDrawnThisTurnDynamicValue.getHint())); } private TomeAnima(final TomeAnima card) { @@ -46,13 +45,3 @@ public final class TomeAnima extends CardImpl { return new TomeAnima(this); } } - -enum TomeAnimaCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); - return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1; - } -} diff --git a/Mage.Sets/src/mage/cards/t/TrenchStalker.java b/Mage.Sets/src/mage/cards/t/TrenchStalker.java new file mode 100644 index 0000000000..34a3d7b280 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TrenchStalker.java @@ -0,0 +1,53 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TrenchStalker extends CardImpl { + + public TrenchStalker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); + + this.subtype.add(SubType.BEAST); + this.subtype.add(SubType.HORROR); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // As long as you've drawn two or more cards this turn, Trench Stalker has deathtouch and lifelink. + Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield), + DrewTwoOrMoreCardsCondition.instance, "As long as you've drawn two or more cards this turn, {this} has deathtouch" + )); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield), + DrewTwoOrMoreCardsCondition.instance, "and lifelink" + )); + this.addAbility(ability.addHint(CardsDrawnThisTurnDynamicValue.getHint())); + } + + private TrenchStalker(final TrenchStalker card) { + super(card); + } + + @Override + public TrenchStalker copy() { + return new TrenchStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 5cc40684c5..bfd90dda91 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -233,6 +233,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Tower Worker", 255, Rarity.COMMON, mage.cards.t.TowerWorker.class)); cards.add(new SetCardInfo("Transmogrant Altar", 124, Rarity.UNCOMMON, mage.cards.t.TransmograntAltar.class)); cards.add(new SetCardInfo("Transmogrant's Crown", 125, Rarity.RARE, mage.cards.t.TransmograntsCrown.class)); + cards.add(new SetCardInfo("Trench Stalker", 116, Rarity.COMMON, mage.cards.t.TrenchStalker.class)); cards.add(new SetCardInfo("Tyrant of Kher Ridges", 154, Rarity.RARE, mage.cards.t.TyrantOfKherRidges.class)); cards.add(new SetCardInfo("Underground River", 267, Rarity.RARE, mage.cards.u.UndergroundRiver.class)); cards.add(new SetCardInfo("Union of the Third Path", 31, Rarity.COMMON, mage.cards.u.UnionOfTheThirdPath.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/DrewTwoOrMoreCardsCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DrewTwoOrMoreCardsCondition.java new file mode 100644 index 0000000000..fb5fd5ceef --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/DrewTwoOrMoreCardsCondition.java @@ -0,0 +1,24 @@ +package mage.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.game.Game; +import mage.watchers.common.CardsDrawnThisTurnWatcher; + +/** + * @author TheElk801 + */ +public enum DrewTwoOrMoreCardsCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class); + return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) >= 2; + } + + @Override + public String toString() { + return "you've drawn two or more cards this turn"; + } +}