Implemented Heartwarming Redemption

This commit is contained in:
Evan Kranzler 2019-04-18 18:14:01 -04:00
parent 46f156f9d3
commit 4c8f3ec3ae
2 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,65 @@
package mage.cards.h;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class HeartwarmingRedemption extends CardImpl {
public HeartwarmingRedemption(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}{W}");
// Discard all the cards in your hand, then draw that many cards plus one. You gain life equal to the number of cards in your hand.
this.getSpellAbility().addEffect(new HeartwarmingRedemptionEffect());
}
private HeartwarmingRedemption(final HeartwarmingRedemption card) {
super(card);
}
@Override
public HeartwarmingRedemption copy() {
return new HeartwarmingRedemption(this);
}
}
class HeartwarmingRedemptionEffect extends OneShotEffect {
HeartwarmingRedemptionEffect() {
super(Outcome.Benefit);
staticText = "Discard all the cards in your hand, then draw that many cards plus one. " +
"You gain life equal to the number of cards in your hand.";
}
private HeartwarmingRedemptionEffect(final HeartwarmingRedemptionEffect effect) {
super(effect);
}
@Override
public HeartwarmingRedemptionEffect copy() {
return new HeartwarmingRedemptionEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
int discarded = player.discard(player.getHand().size(), false, source, game).size();
player.drawCards(discarded + 1, game);
player.gainLife(player.getHand().size(), game, source);
return true;
}
}
// Good night, sweet prince :(

View file

@ -127,6 +127,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Guild Globe", 239, Rarity.COMMON, mage.cards.g.GuildGlobe.class));
cards.add(new SetCardInfo("Guildpact Informant", 271, Rarity.COMMON, mage.cards.g.GuildpactInformant.class));
cards.add(new SetCardInfo("Heartfire", 131, Rarity.COMMON, mage.cards.h.Heartfire.class));
cards.add(new SetCardInfo("Heartwarming Redemption", 199, Rarity.UNCOMMON, mage.cards.h.HeartwarmingRedemption.class));
cards.add(new SetCardInfo("Herald of the Dreadhorde", 93, Rarity.COMMON, mage.cards.h.HeraldOfTheDreadhorde.class));
cards.add(new SetCardInfo("Honor the God-Pharaoh", 132, Rarity.COMMON, mage.cards.h.HonorTheGodPharaoh.class));
cards.add(new SetCardInfo("Huatli's Raptor", 200, Rarity.UNCOMMON, mage.cards.h.HuatlisRaptor.class));