From 4b7250e2b9c812f73775d236889842de032b84a0 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 6 Nov 2021 18:09:22 -0400 Subject: [PATCH] [VOW] Implemented Cultivator Colossus --- .../src/mage/cards/a/AshayaSoulOfTheWild.java | 12 +-- .../src/mage/cards/c/CultivatorColossus.java | 101 ++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 3 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/CultivatorColossus.java diff --git a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java index a0cb766eac..010985ee80 100644 --- a/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java +++ b/Mage.Sets/src/mage/cards/a/AshayaSoulOfTheWild.java @@ -3,8 +3,7 @@ package mage.cards.a; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.LandsYouControlCount; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.mana.GreenManaAbility; @@ -12,7 +11,6 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.FilterPermanent; -import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; @@ -25,9 +23,6 @@ import java.util.UUID; */ public final class AshayaSoulOfTheWild extends CardImpl { - private static final DynamicValue xValue - = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS); - public AshayaSoulOfTheWild(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); @@ -38,9 +33,8 @@ public final class AshayaSoulOfTheWild extends CardImpl { // Ashaya, Soul of the Wild’s power and toughness are each equal to the number of lands you control. this.addAbility(new SimpleStaticAbility( - Zone.ALL, new SetPowerToughnessSourceEffect( - xValue, Duration.EndOfGame - ))); + Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) + )); // Nontoken creatures you control are Forest lands in addition to their other types. (They’re still affected by summoning sickness.) this.addAbility(new SimpleStaticAbility(new AshayaSoulOfTheWildEffect())); diff --git a/Mage.Sets/src/mage/cards/c/CultivatorColossus.java b/Mage.Sets/src/mage/cards/c/CultivatorColossus.java new file mode 100644 index 0000000000..1e30399f6e --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CultivatorColossus.java @@ -0,0 +1,101 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.LandsYouControlCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CultivatorColossus extends CardImpl { + + public CultivatorColossus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); + + this.subtype.add(SubType.PLANT); + this.subtype.add(SubType.BEAST); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Cultivator Colossus's power and toughness are each equal to the number of lands you control. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame) + )); + + // When Cultivator Colossus enters the battlefield, you may put a land card from your hand onto the battlefield tapped. If you do, draw a card and repeat this process. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CultivatorColossusEffect())); + } + + private CultivatorColossus(final CultivatorColossus card) { + super(card); + } + + @Override + public CultivatorColossus copy() { + return new CultivatorColossus(this); + } +} + +class CultivatorColossusEffect extends OneShotEffect { + + CultivatorColossusEffect() { + super(Outcome.PutLandInPlay); + staticText = "you may put a land card from your hand onto the battlefield tapped. " + + "If you do, draw a card and repeat this process"; + } + + private CultivatorColossusEffect(final CultivatorColossusEffect effect) { + super(effect); + } + + @Override + public CultivatorColossusEffect copy() { + return new CultivatorColossusEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + while (player.getHand().count(StaticFilters.FILTER_CARD_LAND, game) > 0) { + TargetCard target = new TargetCardInHand( + 0, 1, StaticFilters.FILTER_CARD_LAND + ); + player.choose(outcome, target, source.getSourceId(), game); + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + break; + } + player.moveCards( + card, Zone.BATTLEFIELD, source, game, true, + false, false, null + ); + if (game.getPermanent(card.getId()) == null) { + break; + } + player.drawCards(1, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index c8d239cba4..464a4e5950 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -83,6 +83,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Crawling Infestation", 193, Rarity.UNCOMMON, mage.cards.c.CrawlingInfestation.class)); cards.add(new SetCardInfo("Cruel Witness", 55, Rarity.COMMON, mage.cards.c.CruelWitness.class)); cards.add(new SetCardInfo("Crushing Canopy", 194, Rarity.COMMON, mage.cards.c.CrushingCanopy.class)); + cards.add(new SetCardInfo("Cultivator Colossus", 195, Rarity.MYTHIC, mage.cards.c.CultivatorColossus.class)); cards.add(new SetCardInfo("Dawnhart Disciple", 196, Rarity.COMMON, mage.cards.d.DawnhartDisciple.class)); cards.add(new SetCardInfo("Dawnhart Geist", 8, Rarity.UNCOMMON, mage.cards.d.DawnhartGeist.class)); cards.add(new SetCardInfo("Daybreak Combatants", 153, Rarity.COMMON, mage.cards.d.DaybreakCombatants.class));