From 771396ee7807532f1aafd3e86fbdd2cc1d59c6ab Mon Sep 17 00:00:00 2001 From: Max Behling Date: Mon, 10 Sep 2018 12:08:10 -0500 Subject: [PATCH 1/2] Implemented Roots of Life --- Mage.Sets/src/mage/cards/r/RootsOfLife.java | 71 +++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RootsOfLife.java diff --git a/Mage.Sets/src/mage/cards/r/RootsOfLife.java b/Mage.Sets/src/mage/cards/r/RootsOfLife.java new file mode 100644 index 0000000000..68260f4df4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RootsOfLife.java @@ -0,0 +1,71 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.ChooseModeEffect; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.abilities.condition.common.ModeChoiceSourceCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; + + +/** + * + * @author fubs + */ +public final class RootsOfLife extends CardImpl { + + private final static String ruleTrigger1 = "&bull Island — Whenever an Island an opponent controls becomes tapped, you gain 1 life"; + private final static String ruleTrigger2 = "&bull Swamp — Whenever a Swamp an opponent controls becomes tapped, you gain 1 life"; + + private static final FilterPermanent islandFilter = new FilterPermanent("an Island an opponent controls"); + private static final FilterPermanent swampFilter = new FilterPermanent("a Swamp an opponent controls"); + + static { + islandFilter.add(new SubtypePredicate(SubType.ISLAND)); + islandFilter.add(new ControllerPredicate(TargetController.OPPONENT)); + swampFilter.add(new SubtypePredicate(SubType.SWAMP)); + swampFilter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public RootsOfLife(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); + + // As Roots of Life enters the battlefield, choose Island or Swamp. + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Island or Swamp?","Island", "Swamp"),null, + "As {this} enters the battlefield, choose Island or Swamp.","")); + + + // Whenever a land of the chosen type an opponent controls becomes tapped, you gain 1 life. + + // * Island chosen + this.addAbility(new ConditionalTriggeredAbility( + new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, islandFilter), + new ModeChoiceSourceCondition("Island"), + ruleTrigger1)); + + // * Swamp chosen + this.addAbility(new ConditionalTriggeredAbility( + new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, swampFilter), + new ModeChoiceSourceCondition("Swamp"), + ruleTrigger2)); + } + + public RootsOfLife(final RootsOfLife card) { + super(card); + } + + @Override + public RootsOfLife copy() { + return new RootsOfLife(this); + } +} From ecc932bf417ee22786302ac082578f7b598ff75c Mon Sep 17 00:00:00 2001 From: Max Behling Date: Mon, 10 Sep 2018 12:22:10 -0500 Subject: [PATCH 2/2] Database for Roots of Life --- Mage.Sets/src/mage/sets/Mirage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index ff6d1c12de..fff157ce7d 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -245,6 +245,7 @@ public final class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Ritual of Steel", 36, Rarity.COMMON, mage.cards.r.RitualOfSteel.class)); cards.add(new SetCardInfo("Rock Basilisk", 279, Rarity.RARE, mage.cards.r.RockBasilisk.class)); cards.add(new SetCardInfo("Rocky Tar Pit", 329, Rarity.UNCOMMON, mage.cards.r.RockyTarPit.class)); + cards.add(new SetCardInfo("Roots of Life", 323, Rarity.UNCOMMON, mage.cards.r.RootsOfLife.class)); cards.add(new SetCardInfo("Sabertooth Cobra", 238, Rarity.COMMON, mage.cards.s.SabertoothCobra.class)); cards.add(new SetCardInfo("Sacred Mesa", 37, Rarity.RARE, mage.cards.s.SacredMesa.class)); cards.add(new SetCardInfo("Sandbar Crocodile", 88, Rarity.COMMON, mage.cards.s.SandbarCrocodile.class));