[MOM] Implement Into the Fire

This commit is contained in:
theelk801 2023-04-01 20:14:34 -04:00
parent 5770e2dc59
commit dd5406e832
2 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInHand;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class IntoTheFire extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("creature, planeswalker, and battle");
static {
filter.add(Predicates.or(
CardType.CREATURE.getPredicate(),
CardType.PLANESWALKER.getPredicate(),
CardType.BATTLE.getPredicate()
));
}
public IntoTheFire(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Choose one --
// * Into the Fire deals 2 damage to each creature, planeswalker, and battle.
this.getSpellAbility().addEffect(new DamageAllEffect(2, filter));
// * Put any number of cards from your hand on the bottom of your library, then draw that many cards plus one.
this.getSpellAbility().addMode(new Mode(new IntoTheFireEffect()));
}
private IntoTheFire(final IntoTheFire card) {
super(card);
}
@Override
public IntoTheFire copy() {
return new IntoTheFire(this);
}
}
class IntoTheFireEffect extends OneShotEffect {
IntoTheFireEffect() {
super(Outcome.Benefit);
staticText = "put any number of cards from your hand on the bottom of your library, then draw that many cards plus one";
}
private IntoTheFireEffect(final IntoTheFireEffect effect) {
super(effect);
}
@Override
public IntoTheFireEffect copy() {
return new IntoTheFireEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetCard targetCard = new TargetCardInHand(
0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CARDS
);
player.choose(outcome, player.getHand(), targetCard, game);
Cards cards = new CardsImpl(targetCard.getTargets());
player.putCardsOnBottomOfLibrary(cards, game, source, true);
player.drawCards(cards.size() + 1, source, game);
return true;
}
}

View file

@ -49,6 +49,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Heliod, the Radiant Dawn", 17, Rarity.RARE, mage.cards.h.HeliodTheRadiantDawn.class));
cards.add(new SetCardInfo("Heliod, the Warped Eclipse", 17, Rarity.RARE, mage.cards.h.HeliodTheWarpedEclipse.class));
cards.add(new SetCardInfo("Interdisciplinary Mascot", 326, Rarity.RARE, mage.cards.i.InterdisciplinaryMascot.class));
cards.add(new SetCardInfo("Into the Fire", 144, Rarity.RARE, mage.cards.i.IntoTheFire.class));
cards.add(new SetCardInfo("Island", 278, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jungle Hollow", 270, Rarity.COMMON, mage.cards.j.JungleHollow.class));
cards.add(new SetCardInfo("Monastery Mentor", 28, Rarity.MYTHIC, mage.cards.m.MonasteryMentor.class));