[40K] Implemented Sister Repentia

This commit is contained in:
Evan Kranzler 2022-09-17 10:30:03 -04:00
parent 9c801056d3
commit a893e5ba88
16 changed files with 109 additions and 85 deletions

View file

@ -6,6 +6,7 @@ import mage.abilities.SpellAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
@ -18,53 +19,53 @@ import mage.watchers.common.MiracleWatcher;
/**
* 702.92. Miracle
*
* <p>
* 702.92a Miracle is a static ability linked to a triggered ability (see rule
* 603.10). "Miracle [cost]" means "You may reveal this card from your hand as
* you draw it if it's the first card you've drawn this turn. When you reveal
* this card this way, you may cast it by paying [cost] rather than its mana
* cost."
*
* <p>
* 702.92b If a player chooses to reveal a card using its miracle ability, they
* play with that card revealed until that card leaves their hand, that ability
* resolves, or that ability otherwise leaves the stack.
*
* <p>
* You can cast a card for its miracle cost only as the miracle triggered
* ability resolves. If you don't want to cast it at that time (or you can't
* cast it, perhaps because there are no legal targets available), you won't be
* able to cast it later for the miracle cost.
*
* <p>
* RULINGS: You still draw the card, whether you use the miracle ability or not.
* Any ability that triggers whenever you draw a card, for example, will
* trigger. If you don't cast the card using its miracle ability, it will remain
* in your hand.
*
* <p>
* You can reveal and cast a card with miracle on any turn, not just your own,
* if it's the first card you've drawn that turn.
*
* <p>
* You don't have to reveal a drawn card with miracle if you don't wish to cast
* it at that time.
*
* <p>
* You can cast a card for its miracle cost only as the miracle triggered
* ability resolves. If you don't want to cast it at that time (or you can't
* cast it, perhaps because there are no legal targets available), you won't be
* able to cast it later for the miracle cost.
*
* <p>
* You cast the card with miracle during the resolution of the triggered
* ability. Ignore any timing restrictions based on the card's type.
*
* <p>
* It's important to reveal a card with miracle before it is mixed with the
* other cards in your hand.
*
* <p>
* Multiple card draws are always treated as a sequence of individual card
* draws. For example, if you haven't drawn any cards yet during a turn and cast
* a spell that instructs you to draw three cards, you'll draw them one at a
* time. Only the first card drawn this way may be revealed and cast using its
* miracle ability.
*
* <p>
* If the card with miracle leaves your hand before the triggered ability
* resolves, you won't be able to cast it using its miracle ability.
*
* <p>
* You draw your opening hand before any turn begins. Cards you draw for your
* opening hand can't be cast using miracle.
*
@ -73,16 +74,15 @@ import mage.watchers.common.MiracleWatcher;
public class MiracleAbility extends TriggeredAbilityImpl {
private static final String staticRule = " <i>(You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)</i>";
private String ruleText;
private final String ruleText;
@SuppressWarnings("unchecked")
public MiracleAbility(Card card, ManaCosts miracleCosts) {
super(Zone.HAND, new MiracleEffect((ManaCosts<ManaCost>) miracleCosts), true);
public MiracleAbility(String miracleCosts) {
super(Zone.HAND, new MiracleEffect(miracleCosts), true);
addWatcher(new MiracleWatcher());
ruleText = "Miracle " + miracleCosts.getText() + staticRule;
ruleText = "Miracle " + miracleCosts + staticRule;
}
public MiracleAbility(final MiracleAbility ability) {
private MiracleAbility(final MiracleAbility ability) {
super(ability);
this.ruleText = ability.ruleText;
}
@ -117,10 +117,10 @@ class MiracleEffect extends OneShotEffect {
private final ManaCosts<ManaCost> miracleCosts;
public MiracleEffect(ManaCosts<ManaCost> miracleCosts) {
public MiracleEffect(String miracleCosts) {
super(Outcome.Benefit);
this.staticText = "cast this card for its miracle cost";
this.miracleCosts = miracleCosts;
this.miracleCosts = new ManaCostsImpl<>(miracleCosts);
}
public MiracleEffect(final MiracleEffect effect) {