Implemented Camaraderie

This commit is contained in:
Evan Kranzler 2018-09-18 19:27:11 -04:00
parent f2f60f3780
commit 63c2b9f68c
2 changed files with 73 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));