From 63c2b9f68cc4d1954e0b29240fc3f4e5abec4d0f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 18 Sep 2018 19:27:11 -0400 Subject: [PATCH] Implemented Camaraderie --- Mage.Sets/src/mage/cards/c/Camaraderie.java | 72 ++++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/Camaraderie.java diff --git a/Mage.Sets/src/mage/cards/c/Camaraderie.java b/Mage.Sets/src/mage/cards/c/Camaraderie.java new file mode 100644 index 0000000000..505d1de53f --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Camaraderie.java @@ -0,0 +1,72 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class Camaraderie extends CardImpl { + + public Camaraderie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{W}"); + + // You gain X life and draw X cards, where X is the number of creatures you control. Creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new CamaraderieEffect()); + } + + public Camaraderie(final Camaraderie card) { + super(card); + } + + @Override + public Camaraderie copy() { + return new Camaraderie(this); + } +} + +class CamaraderieEffect extends OneShotEffect { + + public CamaraderieEffect() { + super(Outcome.Benefit); + this.staticText = "You gain X life and draw X cards, " + + "where X is the number of creatures you control. " + + "Creatures you control get +1/+1 until end of turn."; + } + + public CamaraderieEffect(final CamaraderieEffect effect) { + super(effect); + } + + @Override + public CamaraderieEffect copy() { + return new CamaraderieEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getSourceId()); + if (player == null) { + return false; + } + int xValue = game.getBattlefield().count( + StaticFilters.FILTER_CONTROLLED_CREATURE, + source.getSourceId(), source.getControllerId(), game + ); + player.gainLife(xValue, game, source); + player.drawCards(xValue, game); + game.addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index e28c05f970..dec4c9668d 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -41,6 +41,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Boros Guildgate", 244, Rarity.COMMON, mage.cards.b.BorosGuildgate.class)); cards.add(new SetCardInfo("Boros Locket", 231, Rarity.COMMON, mage.cards.b.BorosLocket.class)); cards.add(new SetCardInfo("Bounty Agent", 2, Rarity.RARE, mage.cards.b.BountyAgent.class)); + cards.add(new SetCardInfo("Camaraderie", 157, Rarity.RARE, mage.cards.c.Camaraderie.class)); cards.add(new SetCardInfo("Centaur Peacemaker", 158, Rarity.COMMON, mage.cards.c.CentaurPeacemaker.class)); cards.add(new SetCardInfo("Charnel Troll", 160, Rarity.RARE, mage.cards.c.CharnelTroll.class)); cards.add(new SetCardInfo("Chemister's Insight", 32, Rarity.UNCOMMON, mage.cards.c.ChemistersInsight.class));