From eda8d75e40125293b33fce6e4ac04f64313bab90 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 23 May 2022 18:46:59 -0400 Subject: [PATCH] [CLB] Implemented Campfire --- Mage.Sets/src/mage/cards/c/Campfire.java | 91 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/Campfire.java diff --git a/Mage.Sets/src/mage/cards/c/Campfire.java b/Mage.Sets/src/mage/cards/c/Campfire.java new file mode 100644 index 00000000000..e542355cae3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Campfire.java @@ -0,0 +1,91 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.CommanderCardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CommanderPredicate; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Campfire extends CardImpl { + + public Campfire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); + + // {1}, {T}: You gain 2 life. + Ability ability = new SimpleActivatedAbility(new GainLifeEffect(2), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {2}, {T}: Exile Campfire: Put all commanders you own from the command zone and from your graveyard into your hand. Then shuffle your graveyard into your library. + ability = new SimpleActivatedAbility(new CampfireEffect(), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new ExileSourceCost()); + this.addAbility(ability); + } + + private Campfire(final Campfire card) { + super(card); + } + + @Override + public Campfire copy() { + return new Campfire(this); + } +} + +class CampfireEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(CommanderPredicate.instance); + } + + CampfireEffect() { + super(Outcome.Benefit); + staticText = "put all commanders you own from the command zone and from " + + "your graveyard into your hand. Then shuffle your graveyard into your library"; + } + + private CampfireEffect(final CampfireEffect effect) { + super(effect); + } + + @Override + public CampfireEffect copy() { + return new CampfireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(game.getCommanderCardsFromCommandZone(player, CommanderCardType.ANY)); + cards.addAll(player.getGraveyard().getCards(filter, game)); + player.moveCards(cards, Zone.HAND, source, game); + player.putCardsOnBottomOfLibrary(player.getGraveyard(), game, source, false); + player.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index a4b7df3eeff..e118f8aa70e 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -40,6 +40,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Bountiful Promenade", 348, Rarity.RARE, mage.cards.b.BountifulPromenade.class)); cards.add(new SetCardInfo("Bramble Sovereign", 218, Rarity.MYTHIC, mage.cards.b.BrambleSovereign.class)); cards.add(new SetCardInfo("Cadira, Caller of the Small", 269, Rarity.UNCOMMON, mage.cards.c.CadiraCallerOfTheSmall.class)); + cards.add(new SetCardInfo("Campfire", 304, Rarity.UNCOMMON, mage.cards.c.Campfire.class)); cards.add(new SetCardInfo("Charcoal Diamond", 305, Rarity.COMMON, mage.cards.c.CharcoalDiamond.class)); cards.add(new SetCardInfo("Cloakwood Hermit", 221, Rarity.UNCOMMON, mage.cards.c.CloakwoodHermit.class)); cards.add(new SetCardInfo("Command Tower", 351, Rarity.COMMON, mage.cards.c.CommandTower.class));