1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 09:11:04 -09:00

[SNC] Implemented Unleash the Inferno

This commit is contained in:
Evan Kranzler 2022-04-11 22:44:06 -04:00
parent 195c65d6b8
commit 50d4d17d88
2 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,86 @@
package mage.cards.u;
import mage.abilities.Ability;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class UnleashTheInferno extends CardImpl {
public UnleashTheInferno(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{R}{G}");
// Unleash the Inferno deals 7 damage to target creature or planeswalker. When it deals excess damage this way destroy target artifact or enchantment an opponent controls with mana value less than or equal to that amount of excess damage.
this.getSpellAbility().addEffect(new UnleashTheInfernoEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
}
private UnleashTheInferno(final UnleashTheInferno card) {
super(card);
}
@Override
public UnleashTheInferno copy() {
return new UnleashTheInferno(this);
}
}
class UnleashTheInfernoEffect extends OneShotEffect {
UnleashTheInfernoEffect() {
super(Outcome.Benefit);
staticText = "{this} deals 7 damage to target creature or planeswalker. " +
"When it deals excess damage this way, destroy target artifact or enchantment " +
"an opponent controls with mana value less than or equal to that amount of excess damage";
}
private UnleashTheInfernoEffect(final UnleashTheInfernoEffect effect) {
super(effect);
}
@Override
public UnleashTheInfernoEffect copy() {
return new UnleashTheInfernoEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
return false;
}
int lethal = Math.min(permanent.getLethalDamage(source.getSourceId(), game), 7);
permanent.damage(7, source, game);
int excess = 7 - lethal;
if (lethal > 0) {
return true;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DestroyTargetEffect(), false);
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent(
"artifact or enchantment an opponent controls with mana value less that or equal to " + excess
);
filter.add(TargetController.OPPONENT.getControllerPredicate());
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, excess));
ability.addTarget(new TargetPermanent(filter));
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
}

View file

@ -101,6 +101,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Swamp", 266, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Topiary Stomper", 160, Rarity.RARE, mage.cards.t.TopiaryStomper.class));
cards.add(new SetCardInfo("Tramway Station", 258, Rarity.COMMON, mage.cards.t.TramwayStation.class));
cards.add(new SetCardInfo("Unleash the Inferno", 229, Rarity.RARE, mage.cards.u.UnleashTheInferno.class));
cards.add(new SetCardInfo("Unlucky Witness", 128, Rarity.UNCOMMON, mage.cards.u.UnluckyWitness.class));
cards.add(new SetCardInfo("Urabrask, Heretic Praetor", 129, Rarity.MYTHIC, mage.cards.u.UrabraskHereticPraetor.class));
cards.add(new SetCardInfo("Vampire Scrivener", 98, Rarity.UNCOMMON, mage.cards.v.VampireScrivener.class));