[MH2] Implemented Calibrated Blast

This commit is contained in:
Evan Kranzler 2021-05-27 08:31:02 -04:00
parent ce73c44b1e
commit dd0a19679c
2 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,86 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TimingRule;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetAnyTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CalibratedBlast extends CardImpl {
public CalibratedBlast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Reveal cards from the top of your library until you reveal a nonland card. Put the revealed cards on the bottom of your library in a random order. When you reveal a nonland card this way, Calibrated Blast deals damage equal to that card's mana value to any target.
this.getSpellAbility().addEffect(new CalibratedBlastEffect());
// Flashback {3}{R}{R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{R}{R}"), TimingRule.INSTANT));
}
private CalibratedBlast(final CalibratedBlast card) {
super(card);
}
@Override
public CalibratedBlast copy() {
return new CalibratedBlast(this);
}
}
class CalibratedBlastEffect extends OneShotEffect {
CalibratedBlastEffect() {
super(Outcome.Benefit);
staticText = "reveal cards from the top of your library until you reveal a nonland card. " +
"Put the revealed cards on the bottom of your library in a random order. When you reveal " +
"a nonland card this way, {this} deals damage equal to that card's mana value to any target";
}
private CalibratedBlastEffect(final CalibratedBlastEffect effect) {
super(effect);
}
@Override
public CalibratedBlastEffect copy() {
return new CalibratedBlastEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl();
for (Card card : player.getLibrary().getCards(game)) {
cards.add(card);
if (card.isLand()) {
continue;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new DamageTargetEffect(card.getManaValue()), false, "When you reveal " +
"a nonland card this way, {this} deals damage equal to that card's mana value to any target"
);
ability.addTarget(new TargetAnyTarget());
game.fireReflexiveTriggeredAbility(ability, source);
break;
}
player.revealCards(source, cards, game);
player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true;
}
}

View file

@ -37,6 +37,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Brainstone", 223, Rarity.UNCOMMON, mage.cards.b.Brainstone.class)); cards.add(new SetCardInfo("Brainstone", 223, Rarity.UNCOMMON, mage.cards.b.Brainstone.class));
cards.add(new SetCardInfo("Break Ties", 8, Rarity.COMMON, mage.cards.b.BreakTies.class)); cards.add(new SetCardInfo("Break Ties", 8, Rarity.COMMON, mage.cards.b.BreakTies.class));
cards.add(new SetCardInfo("Cabal Coffers", 301, Rarity.MYTHIC, mage.cards.c.CabalCoffers.class)); cards.add(new SetCardInfo("Cabal Coffers", 301, Rarity.MYTHIC, mage.cards.c.CabalCoffers.class));
cards.add(new SetCardInfo("Calibrated Blast", 118, Rarity.RARE, mage.cards.c.CalibratedBlast.class));
cards.add(new SetCardInfo("Chance Encounter", 277, Rarity.RARE, mage.cards.c.ChanceEncounter.class)); cards.add(new SetCardInfo("Chance Encounter", 277, Rarity.RARE, mage.cards.c.ChanceEncounter.class));
cards.add(new SetCardInfo("Chatterstorm", 152, Rarity.COMMON, mage.cards.c.Chatterstorm.class)); cards.add(new SetCardInfo("Chatterstorm", 152, Rarity.COMMON, mage.cards.c.Chatterstorm.class));
cards.add(new SetCardInfo("Counterspell", 267, Rarity.UNCOMMON, mage.cards.c.Counterspell.class)); cards.add(new SetCardInfo("Counterspell", 267, Rarity.UNCOMMON, mage.cards.c.Counterspell.class));