Implemented Charge of the Forever-Beast

This commit is contained in:
Evan Kranzler 2020-04-06 21:28:50 -04:00
parent d55dc2879b
commit a818251d3f
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,76 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.costs.common.RevealTargetFromHandCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChargeOfTheForeverBeast extends CardImpl {
public ChargeOfTheForeverBeast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// As an additional cost to cast this spell, reveal a creature card from your hand.
this.getSpellAbility().addCost(new RevealTargetFromHandCost(
new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A)
));
// Charge of the Forever-Beast deals damage to target creature or planeswalker equal to the revealed card's power.
this.getSpellAbility().addEffect(new ChargeOfTheForeverBeastEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
}
private ChargeOfTheForeverBeast(final ChargeOfTheForeverBeast card) {
super(card);
}
@Override
public ChargeOfTheForeverBeast copy() {
return new ChargeOfTheForeverBeast(this);
}
}
class ChargeOfTheForeverBeastEffect extends OneShotEffect {
ChargeOfTheForeverBeastEffect() {
super(Outcome.Benefit);
staticText = "{this} deals damage to target creature or planeswalker equal to the revealed card's power";
}
private ChargeOfTheForeverBeastEffect(final ChargeOfTheForeverBeastEffect effect) {
super(effect);
}
@Override
public ChargeOfTheForeverBeastEffect copy() {
return new ChargeOfTheForeverBeastEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0);
if (permanent == null && cost == null) {
return false;
}
Card card = cost.getRevealedCards().get(0);
if (card == null) {
return false;
}
return permanent.damage(card.getPower().getValue(), source.getSourceId(), game) > 0;
}
}

View file

@ -68,6 +68,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
cards.add(new SetCardInfo("Capture Sphere", 44, Rarity.COMMON, mage.cards.c.CaptureSphere.class));
cards.add(new SetCardInfo("Cathartic Reunion", 110, Rarity.COMMON, mage.cards.c.CatharticReunion.class));
cards.add(new SetCardInfo("Cavern Whisperer", 79, Rarity.COMMON, mage.cards.c.CavernWhisperer.class));
cards.add(new SetCardInfo("Charge of the Forever-Beast", 147, Rarity.UNCOMMON, mage.cards.c.ChargeOfTheForeverBeast.class));
cards.add(new SetCardInfo("Chittering Harvester", 80, Rarity.UNCOMMON, mage.cards.c.ChitteringHarvester.class));
cards.add(new SetCardInfo("Cloudpiercer", 112, Rarity.COMMON, mage.cards.c.Cloudpiercer.class));
cards.add(new SetCardInfo("Colossification", 148, Rarity.RARE, mage.cards.c.Colossification.class));