[C21] Implemented Rousing Refrain

This commit is contained in:
Evan Kranzler 2021-04-08 18:15:55 -04:00
parent af9f87f110
commit 305ec27f33
2 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,83 @@
package mage.cards.r;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ManaType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RousingRefrain extends CardImpl {
public RousingRefrain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
// Add {R} for each card in target opponent's hand. Until end of turn, you don't lose this mana as steps and phases end. Exile Rousing Refrain with three time counters on it.
this.getSpellAbility().addEffect(new RousingRefrainEffect());
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
this.getSpellAbility().addEffect(new AddCountersSourceEffect(
CounterType.TIME.createInstance(), StaticValue.get(3), false, true
).setText("with 3 time counters on it"));
this.getSpellAbility().addTarget(new TargetOpponent());
// Suspend 3{1}{R}
this.addAbility(new SuspendAbility(3, new ManaCostsImpl<>("{1}{R}"), this));
}
private RousingRefrain(final RousingRefrain card) {
super(card);
}
@Override
public RousingRefrain copy() {
return new RousingRefrain(this);
}
}
class RousingRefrainEffect extends OneShotEffect {
RousingRefrainEffect() {
super(Outcome.Benefit);
staticText = "Add {R} for each card in target opponent's hand. " +
"Until end of turn, you don't lose this mana as steps and phases end";
}
private RousingRefrainEffect(final RousingRefrainEffect effect) {
super(effect);
}
@Override
public RousingRefrainEffect copy() {
return new RousingRefrainEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(source.getFirstTarget());
if (controller == null || player == null || player.getHand().isEmpty()) {
return false;
}
controller.getManaPool().addMana(
new Mana(ManaType.RED, player.getHand().size()),
game, source, false
);
return true;
}
}

View file

@ -74,6 +74,7 @@ public final class Commander2021Edition extends ExpansionSet {
cards.add(new SetCardInfo("Reinterpret", 73, Rarity.RARE, mage.cards.r.Reinterpret.class));
cards.add(new SetCardInfo("Replication Technique", 31, Rarity.RARE, mage.cards.r.ReplicationTechnique.class));
cards.add(new SetCardInfo("Return to Dust", 100, Rarity.UNCOMMON, mage.cards.r.ReturnToDust.class));
cards.add(new SetCardInfo("Rousing Refrain", 56, Rarity.RARE, mage.cards.r.RousingRefrain.class));
cards.add(new SetCardInfo("Rout", 101, Rarity.RARE, mage.cards.r.Rout.class));
cards.add(new SetCardInfo("Sanctum Gargoyle", 102, Rarity.COMMON, mage.cards.s.SanctumGargoyle.class));
cards.add(new SetCardInfo("Scrap Trawler", 260, Rarity.RARE, mage.cards.s.ScrapTrawler.class));