From 1fc177e3d1e031dbe0e11e8623af2c03503f587d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 17 Jun 2019 12:49:35 -0400 Subject: [PATCH] Implemented Cryptic Caves --- Mage.Sets/src/mage/cards/c/CrypticCaves.java | 56 +++++++++++++++++++ .../src/mage/cards/t/TempleOfTheFalseGod.java | 21 ++++--- Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 3 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/CrypticCaves.java diff --git a/Mage.Sets/src/mage/cards/c/CrypticCaves.java b/Mage.Sets/src/mage/cards/c/CrypticCaves.java new file mode 100644 index 0000000000..477b0128c4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CrypticCaves.java @@ -0,0 +1,56 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledLandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CrypticCaves extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledLandPermanent("you control five or more lands"); + private static final Condition condition + = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 4); + + public CrypticCaves(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + // {T}: Add {C}. + this.addAbility(new ColorlessManaAbility()); + + // {1}, {T}, Sacrifice Cryptic Caves: Draw a card. Activate this ability only if you control five or more lands. + Ability ability = new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), + new GenericManaCost(1), condition + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + private CrypticCaves(final CrypticCaves card) { + super(card); + } + + @Override + public CrypticCaves copy() { + return new CrypticCaves(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TempleOfTheFalseGod.java b/Mage.Sets/src/mage/cards/t/TempleOfTheFalseGod.java index d6f50c4a70..69dc4c362e 100644 --- a/Mage.Sets/src/mage/cards/t/TempleOfTheFalseGod.java +++ b/Mage.Sets/src/mage/cards/t/TempleOfTheFalseGod.java @@ -1,8 +1,8 @@ package mage.cards.t; -import java.util.UUID; import mage.Mana; +import mage.abilities.condition.Condition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.mana.BasicManaEffect; @@ -12,25 +12,28 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ComparisonType; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledLandPermanent; + +import java.util.UUID; /** - * * @author LevelX2 */ public final class TempleOfTheFalseGod extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("you control five or more lands"); + private static final FilterPermanent filter + = new FilterControlledLandPermanent("you control five or more lands"); + private static final Condition condition + = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 4); public TempleOfTheFalseGod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // {tap}: Add {C}{C}. Activate this ability only if you control five or more lands. this.addAbility(new ActivateIfConditionManaAbility( - Zone.BATTLEFIELD, - new BasicManaEffect(Mana.ColorlessMana(2)), - new TapSourceCost(), - new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 4))); + Zone.BATTLEFIELD, new BasicManaEffect(Mana.ColorlessMana(2)), new TapSourceCost(), condition + )); } public TempleOfTheFalseGod(final TempleOfTheFalseGod card) { diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index 342addf377..07e56281d4 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -30,5 +30,6 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Chandra, Acolyte of Flame", 126, Rarity.RARE, mage.cards.c.ChandraAcolyteOfFlame.class)); cards.add(new SetCardInfo("Chandra, Awakened Inferno", 127, Rarity.MYTHIC, mage.cards.c.ChandraAwakenedInferno.class)); cards.add(new SetCardInfo("Chandra, Novice Pyromancer", 128, Rarity.UNCOMMON, mage.cards.c.ChandraNovicePyromancer.class)); + cards.add(new SetCardInfo("Cryptic Caves", 244, Rarity.UNCOMMON, mage.cards.c.CrypticCaves.class)); } }