Implemented Channeled Force

This commit is contained in:
Evan Kranzler 2020-04-11 09:19:58 -04:00
parent 526f2301d7
commit 5c8163c7c5
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.costs.common.DiscardXTargetCost;
import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.OneShotEffect;
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.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChanneledForce extends CardImpl {
public ChanneledForce(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{R}");
// As an additional cost to cast this spell, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, true));
// Target player draws X cards. Channeled Force deals X damage to up to one target creature or planeswalker.
this.getSpellAbility().addEffect(new ChanneledForceEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
}
private ChanneledForce(final ChanneledForce card) {
super(card);
}
@Override
public ChanneledForce copy() {
return new ChanneledForce(this);
}
}
class ChanneledForceEffect extends OneShotEffect {
ChanneledForceEffect() {
super(Outcome.Benefit);
staticText = "Target player draws X cards. {this} deals X damage to up to one target creature or planeswalker.";
}
private ChanneledForceEffect(final ChanneledForceEffect effect) {
super(effect);
}
@Override
public ChanneledForceEffect copy() {
return new ChanneledForceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int xValue = GetXValue.instance.calculate(game, source, this);
if (xValue == 0) {
return false;
}
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.drawCards(xValue, game);
}
game.damagePlayerOrPlaneswalker(
source.getTargets().get(1).getFirstTarget(), xValue,
source.getSourceId(), game, false, true
);
return true;
}
}

View file

@ -90,6 +90,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("Channeled Force", 180, Rarity.UNCOMMON, mage.cards.c.ChanneledForce.class));
cards.add(new SetCardInfo("Charge of the Forever-Beast", 147, Rarity.UNCOMMON, mage.cards.c.ChargeOfTheForeverBeast.class));
cards.add(new SetCardInfo("Checkpoint Officer", 5, Rarity.COMMON, mage.cards.c.CheckpointOfficer.class));
cards.add(new SetCardInfo("Chevill, Bane of Monsters", 181, Rarity.MYTHIC, mage.cards.c.ChevillBaneOfMonsters.class));