mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Alternative Cost for spells should be added to all spells on the card, not only the first spell ability (fixes interaction with split cards, among possibly other things).
This commit is contained in:
@@ -3564,26 +3564,24 @@ public class CardFactoryUtil {
|
||||
if (keyword.startsWith("Alternative Cost") && !card.isLand()) {
|
||||
final String[] kw = keyword.split(":");
|
||||
String costStr = kw[1];
|
||||
final SpellAbility sa = card.getFirstSpellAbility();
|
||||
if (sa == null) {
|
||||
return;
|
||||
}
|
||||
final SpellAbility newSA = sa.copy();
|
||||
newSA.setBasicSpell(false);
|
||||
if (costStr.equals("ConvertedManaCost")) {
|
||||
costStr = Integer.toString(card.getCMC());
|
||||
}
|
||||
final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana());
|
||||
newSA.getMapParams().put("Secondary", "True");
|
||||
newSA.setPayCosts(cost);
|
||||
newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)");
|
||||
newSA.setIntrinsic(intrinsic);
|
||||
for (SpellAbility sa: card.getBasicSpells()) {
|
||||
final SpellAbility newSA = sa.copy();
|
||||
newSA.setBasicSpell(false);
|
||||
if (costStr.equals("ConvertedManaCost")) {
|
||||
costStr = Integer.toString(card.getCMC());
|
||||
}
|
||||
final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana());
|
||||
newSA.getMapParams().put("Secondary", "True");
|
||||
newSA.setPayCosts(cost);
|
||||
newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)");
|
||||
newSA.setIntrinsic(intrinsic);
|
||||
|
||||
if (!intrinsic) {
|
||||
newSA.setTemporary(true);
|
||||
kws.addSpellAbility(newSA);
|
||||
if (!intrinsic) {
|
||||
newSA.setTemporary(true);
|
||||
kws.addSpellAbility(newSA);
|
||||
}
|
||||
card.addSpellAbility(newSA);
|
||||
}
|
||||
card.addSpellAbility(newSA);
|
||||
} else if (keyword.equals("Aftermath")) {
|
||||
// Aftermath does modify existing SA, and does not add new one
|
||||
|
||||
|
||||
Reference in New Issue
Block a user