[WOC] Implement Tegwyll's Scouring (#12891)

* Also add all reprints from Wilds of Eldraine Commander.
This commit is contained in:
karapuzz14 2024-09-29 05:26:24 +03:00 committed by GitHub
parent 554ba8739e
commit 2b9b1c01bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 139 additions and 34 deletions

View file

@ -1,6 +1,7 @@
package mage.abilities.common;
import mage.abilities.SpellAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.Card;
@ -14,14 +15,21 @@ import mage.util.CardUtil;
*/
public class PayMoreToCastAsThoughtItHadFlashAbility extends SpellAbility {
private final ManaCosts costsToAdd;
private final Cost costsToAdd;
public PayMoreToCastAsThoughtItHadFlashAbility(Card card, ManaCosts<ManaCost> costsToAdd) {
super(card.getSpellAbility().getManaCosts().copy(), card.getName() + " as though it had flash", Zone.HAND, SpellAbilityType.BASE_ALTERNATE);
public PayMoreToCastAsThoughtItHadFlashAbility(Card card, Cost costsToAdd) {
super(card.getSpellAbility().getManaCosts().copy(), card.getName(), Zone.HAND, SpellAbilityType.BASE_ALTERNATE);
this.costsToAdd = costsToAdd;
this.timing = TimingRule.INSTANT;
this.setRuleAtTheTop(true);
CardUtil.increaseCost(this, costsToAdd);
if(costsToAdd instanceof ManaCosts<?>) {
ManaCosts<ManaCost> manaCosts = (ManaCosts<ManaCost>) costsToAdd;
CardUtil.increaseCost(this, manaCosts);
}
else {
this.addCost(costsToAdd);
}
}
protected PayMoreToCastAsThoughtItHadFlashAbility(final PayMoreToCastAsThoughtItHadFlashAbility ability) {
@ -38,10 +46,13 @@ public class PayMoreToCastAsThoughtItHadFlashAbility extends SpellAbility {
public String getRule(boolean all) {
return getRule();
}
@Override
public String getRule() {
return "You may cast {this} as though it had flash if you pay " + costsToAdd.getText() + " more to cast it. <i>(You may cast it any time you could cast an instant.)</i>";
if (costsToAdd instanceof ManaCosts) {
return "You may cast {this} as though it had flash if you pay " + costsToAdd.getText() + " more to cast it. <i>(You may cast it any time you could cast an instant.)</i>";
} else {
return "You may cast {this} as though it had flash by " + costsToAdd.getText() + " in addition to paying its other costs.";
}
}
}
}