mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +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()) {
|
if (keyword.startsWith("Alternative Cost") && !card.isLand()) {
|
||||||
final String[] kw = keyword.split(":");
|
final String[] kw = keyword.split(":");
|
||||||
String costStr = kw[1];
|
String costStr = kw[1];
|
||||||
final SpellAbility sa = card.getFirstSpellAbility();
|
for (SpellAbility sa: card.getBasicSpells()) {
|
||||||
if (sa == null) {
|
final SpellAbility newSA = sa.copy();
|
||||||
return;
|
newSA.setBasicSpell(false);
|
||||||
}
|
if (costStr.equals("ConvertedManaCost")) {
|
||||||
final SpellAbility newSA = sa.copy();
|
costStr = Integer.toString(card.getCMC());
|
||||||
newSA.setBasicSpell(false);
|
}
|
||||||
if (costStr.equals("ConvertedManaCost")) {
|
final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana());
|
||||||
costStr = Integer.toString(card.getCMC());
|
newSA.getMapParams().put("Secondary", "True");
|
||||||
}
|
newSA.setPayCosts(cost);
|
||||||
final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana());
|
newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)");
|
||||||
newSA.getMapParams().put("Secondary", "True");
|
newSA.setIntrinsic(intrinsic);
|
||||||
newSA.setPayCosts(cost);
|
|
||||||
newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)");
|
|
||||||
newSA.setIntrinsic(intrinsic);
|
|
||||||
|
|
||||||
if (!intrinsic) {
|
if (!intrinsic) {
|
||||||
newSA.setTemporary(true);
|
newSA.setTemporary(true);
|
||||||
kws.addSpellAbility(newSA);
|
kws.addSpellAbility(newSA);
|
||||||
|
}
|
||||||
|
card.addSpellAbility(newSA);
|
||||||
}
|
}
|
||||||
card.addSpellAbility(newSA);
|
|
||||||
} else if (keyword.equals("Aftermath")) {
|
} else if (keyword.equals("Aftermath")) {
|
||||||
// Aftermath does modify existing SA, and does not add new one
|
// Aftermath does modify existing SA, and does not add new one
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user