mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
[CMR] Implemented Soulfire Eruption
This commit is contained in:
parent
f98e1da9a9
commit
dbbe92e389
2 changed files with 126 additions and 0 deletions
125
Mage.Sets/src/mage/cards/s/SoulfireEruption.java
Normal file
125
Mage.Sets/src/mage/cards/s/SoulfireEruption.java
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SoulfireEruption extends CardImpl {
|
||||
|
||||
public SoulfireEruption(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{R}{R}{R}");
|
||||
|
||||
// Choose any number of target creatures, planeswalkers, and/or players. For each of them, exile the top card of your library, then Soulfire Eruption deals damage equal to that card's converted mana cost to that permanent or player. You may play the exiled cards until the end of your next turn.
|
||||
this.getSpellAbility().addEffect(new SoulfireEruptionEffect());
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget(0, Integer.MAX_VALUE));
|
||||
}
|
||||
|
||||
private SoulfireEruption(final SoulfireEruption card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoulfireEruption copy() {
|
||||
return new SoulfireEruption(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SoulfireEruptionEffect extends OneShotEffect {
|
||||
|
||||
SoulfireEruptionEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "choose any number of target creatures, planeswalkers, and/or players. " +
|
||||
"For each of them, exile the top card of your library, " +
|
||||
"then {this} deals damage equal to that card's converted mana cost to that permanent or player. " +
|
||||
"You may play the exiled cards until the end of your next turn";
|
||||
}
|
||||
|
||||
private SoulfireEruptionEffect(final SoulfireEruptionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoulfireEruptionEffect copy() {
|
||||
return new SoulfireEruptionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
for (UUID targetId : source
|
||||
.getTargets()
|
||||
.stream()
|
||||
.map(Target::getTargets)
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.toSet())) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
Player player = game.getPlayer(targetId);
|
||||
if (permanent == null && player == null) {
|
||||
continue;
|
||||
}
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card == null) {
|
||||
continue;
|
||||
}
|
||||
controller.moveCards(card, Zone.EXILED, source, game);
|
||||
game.addEffect(new SoulfireEruptionCastEffect().setTargetPointer(new FixedTarget(card, game)), source);
|
||||
if (card.getConvertedManaCost() < 1) {
|
||||
continue;
|
||||
}
|
||||
if (permanent != null) {
|
||||
permanent.damage(card.getConvertedManaCost(), source.getSourceId(), game);
|
||||
}
|
||||
if (player != null) {
|
||||
player.damage(card.getConvertedManaCost(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class SoulfireEruptionCastEffect extends AsThoughEffectImpl {
|
||||
|
||||
SoulfireEruptionCastEffect() {
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.UntilEndOfYourNextTurn, Outcome.Benefit);
|
||||
}
|
||||
|
||||
private SoulfireEruptionCastEffect(final SoulfireEruptionCastEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoulfireEruptionCastEffect copy() {
|
||||
return new SoulfireEruptionCastEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& objectId.equals(getTargetPointer().getFirst(game, source));
|
||||
}
|
||||
}
|
||||
|
|
@ -438,6 +438,7 @@ public final class CommanderLegends extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Soul of Eternity", 50, Rarity.RARE, mage.cards.s.SoulOfEternity.class));
|
||||
cards.add(new SetCardInfo("Soul's Fire", 200, Rarity.COMMON, mage.cards.s.SoulsFire.class));
|
||||
cards.add(new SetCardInfo("Soul's Might", 257, Rarity.COMMON, mage.cards.s.SoulsMight.class));
|
||||
cards.add(new SetCardInfo("Soulfire Eruption", 201, Rarity.MYTHIC, mage.cards.s.SoulfireEruption.class));
|
||||
cards.add(new SetCardInfo("Spark Harvest", 150, Rarity.COMMON, mage.cards.s.SparkHarvest.class));
|
||||
cards.add(new SetCardInfo("Sparktongue Dragon", 202, Rarity.COMMON, mage.cards.s.SparktongueDragon.class));
|
||||
cards.add(new SetCardInfo("Spectator Seating", 356, Rarity.RARE, mage.cards.s.SpectatorSeating.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue