1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-01 19:07:57 -09:00

[AFR] Implemented Song of Inspiration

This commit is contained in:
Evan Kranzler 2021-07-14 09:15:41 -04:00
parent d7b2d2208d
commit d00765c2d5
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.s;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
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.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SongOfInspiration extends CardImpl {
public SongOfInspiration(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
// Choose up to two target permanent cards in your graveyard. Roll a d20 and add the total mana value of those cards.
// 1-14 | Return those cards to your hand.
// 15+ | Return those cards to your hand. You gain life equal to their total mana value.
this.getSpellAbility().addEffect(new SongOfInspirationEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(
0, 2, StaticFilters.FILTER_CARD_PERMANENT
));
}
private SongOfInspiration(final SongOfInspiration card) {
super(card);
}
@Override
public SongOfInspiration copy() {
return new SongOfInspiration(this);
}
}
class SongOfInspirationEffect extends OneShotEffect {
SongOfInspirationEffect() {
super(Outcome.Benefit);
staticText = "choose up to two target permanent cards in your graveyard. Roll a d20 " +
"and add the total mana value of those cards.<br>1-14 | Return those cards to your hand." +
"<br>15+ | Return those cards to your hand. You gain life equal to their total mana value";
}
private SongOfInspirationEffect(final SongOfInspirationEffect effect) {
super(effect);
}
@Override
public SongOfInspirationEffect copy() {
return new SongOfInspirationEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source));
int totalMv = cards.getCards(game).stream().mapToInt(MageObject::getManaValue).sum();
int result = player.rollDice(source, game, 20);
player.moveCards(cards, Zone.HAND, source, game);
if (result + totalMv >= 15) {
player.gainLife(totalMv, game, source);
}
return true;
}
}

View file

@ -199,6 +199,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
cards.add(new SetCardInfo("Smoldering Marsh", 262, Rarity.RARE, mage.cards.s.SmolderingMarsh.class));
cards.add(new SetCardInfo("Sol Ring", 215, Rarity.UNCOMMON, mage.cards.s.SolRing.class));
cards.add(new SetCardInfo("Solemn Simulacrum", 216, Rarity.RARE, mage.cards.s.SolemnSimulacrum.class));
cards.add(new SetCardInfo("Song of Inspiration", 42, Rarity.RARE, mage.cards.s.SongOfInspiration.class));
cards.add(new SetCardInfo("Spinerock Knoll", 263, Rarity.RARE, mage.cards.s.SpinerockKnoll.class));
cards.add(new SetCardInfo("Spit Flame", 142, Rarity.RARE, mage.cards.s.SpitFlame.class));
cards.add(new SetCardInfo("Sram, Senior Edificer", 72, Rarity.RARE, mage.cards.s.SramSeniorEdificer.class));