From 41ccd409ce0b4103d2f31283476399d95cca04ba Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Sep 2020 16:02:01 -0400 Subject: [PATCH] [ZNR] Implemented Base Camp --- Mage.Sets/src/mage/cards/b/BaseCamp.java | 86 +++++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BaseCamp.java diff --git a/Mage.Sets/src/mage/cards/b/BaseCamp.java b/Mage.Sets/src/mage/cards/b/BaseCamp.java new file mode 100644 index 0000000000..d5c97d4115 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BaseCamp.java @@ -0,0 +1,86 @@ +package mage.cards.b; + +import mage.ConditionalMana; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.ColorlessManaAbility; +import mage.abilities.mana.ConditionalAnyColorManaAbility; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BaseCamp extends CardImpl { + + public BaseCamp(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + // Base Camp enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {T}: Add {C}. + this.addAbility(new ColorlessManaAbility()); + + // {T}: Add one mana of any color. Spend this mana only to cast a Cleric, Rogue, Warrior, or Wizard spell or to activate an ability of a Cleric, Rogue, Warrior, or Wizard. + this.addAbility(new ConditionalAnyColorManaAbility( + new TapSourceCost(), 1, new BaseCampManaBuilder() + )); + } + + private BaseCamp(final BaseCamp card) { + super(card); + } + + @Override + public BaseCamp copy() { + return new BaseCamp(this); + } +} + +class BaseCampManaBuilder extends ConditionalManaBuilder { + + @Override + public ConditionalMana build(Object... options) { + return new BaseCampConditionalMana(this.mana); + } + + @Override + public String getRule() { + return "Spend this mana only to cast a Cleric, Rogue, Warrior, or Wizard spell " + + "or to activate an ability of a Cleric, Rogue, Warrior, or Wizard"; + } +} + +class BaseCampConditionalMana extends ConditionalMana { + + public BaseCampConditionalMana(Mana mana) { + super(mana); + addCondition(BaseCampCondition.instance); + } +} + +enum BaseCampCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source.getSourceId()); + return object != null && ( + object.hasSubtype(SubType.CLERIC, game) + || object.hasSubtype(SubType.ROGUE, game) + || object.hasSubtype(SubType.WARRIOR, game) + || object.hasSubtype(SubType.WIZARD, game) + ); + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 00af6a2c83..622509d5b1 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -123,6 +123,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Attended Healer", 6, Rarity.UNCOMMON, mage.cards.a.AttendedHealer.class)); cards.add(new SetCardInfo("Bala Ged Recovery", 180, Rarity.UNCOMMON, mage.cards.b.BalaGedRecovery.class)); cards.add(new SetCardInfo("Bala Ged Sanctuary", 180, Rarity.UNCOMMON, mage.cards.b.BalaGedSanctuary.class)); + cards.add(new SetCardInfo("Base Camp", 257, Rarity.UNCOMMON, mage.cards.b.BaseCamp.class)); cards.add(new SetCardInfo("Beyeen Coast", 46, Rarity.UNCOMMON, mage.cards.b.BeyeenCoast.class)); cards.add(new SetCardInfo("Beyeen Veil", 46, Rarity.UNCOMMON, mage.cards.b.BeyeenVeil.class)); cards.add(new SetCardInfo("Blackbloom Bog", 91, Rarity.UNCOMMON, mage.cards.b.BlackbloomBog.class));