mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Replace isCurse parsing with a simple isCurse() function in AbilityFactory
- Tweaked AbilityCost toString function for Spells - Additional costs now displayed for Spells using AbilityFactory - Buyback spells now alter the abCost value for Abilities generated by AbilityFactory.
This commit is contained in:
@@ -57,9 +57,8 @@ public class AbilityFactory {
|
|||||||
return abTgt;
|
return abTgt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCurse = false;
|
|
||||||
public boolean isCurse(){
|
public boolean isCurse(){
|
||||||
return isCurse;
|
return mapParams.containsKey("IsCurse");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasSubAb = false;
|
private boolean hasSubAb = false;
|
||||||
@@ -146,8 +145,6 @@ public class AbilityFactory {
|
|||||||
abTgt = new Target(mapParams.get("Tgt"));
|
abTgt = new Target(mapParams.get("Tgt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
isCurse = mapParams.containsKey("IsCurse");
|
|
||||||
|
|
||||||
hasSubAb = mapParams.containsKey("SubAbility");
|
hasSubAb = mapParams.containsKey("SubAbility");
|
||||||
|
|
||||||
hasSpDesc = mapParams.containsKey("SpellDescription");
|
hasSpDesc = mapParams.containsKey("SpellDescription");
|
||||||
@@ -201,11 +198,10 @@ public class AbilityFactory {
|
|||||||
|
|
||||||
if (hasSpDesc)
|
if (hasSpDesc)
|
||||||
{
|
{
|
||||||
String desc = mapParams.get("SpellDescription");
|
StringBuilder sb = new StringBuilder(abCost.toString());
|
||||||
if (isAb)
|
sb.append(mapParams.get("SpellDescription"));
|
||||||
desc = abCost.toString() + desc;
|
|
||||||
|
|
||||||
SA.setDescription(desc);
|
SA.setDescription(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -206,14 +206,14 @@ public class Ability_Cost {
|
|||||||
// maybe add a conversion method that turns the amounts into words 1=a(n), 2=two etc.
|
// maybe add a conversion method that turns the amounts into words 1=a(n), 2=two etc.
|
||||||
|
|
||||||
private String spellToString() {
|
private String spellToString() {
|
||||||
StringBuilder cost = new StringBuilder("As an additional cost to play ");
|
StringBuilder cost = new StringBuilder("As an additional cost to cast ");
|
||||||
cost.append(name);
|
cost.append(name);
|
||||||
cost.append(", ");
|
cost.append(", ");
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
|
|
||||||
if (!(manaCost.equals("0") || manaCost.equals(""))){
|
if (!(manaCost.equals("0") || manaCost.equals(""))){
|
||||||
// never a normal additional mana cost for spells
|
// usually no additional mana cost for spells
|
||||||
cost.append(manaCost);
|
// only three Alliances cards have additional mana costs, but they are basically kicker/multikicker
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tapCost || untapCost){
|
if (tapCost || untapCost){
|
||||||
@@ -274,7 +274,7 @@ public class Ability_Cost {
|
|||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cost.append(".");
|
cost.append(".").append("\n");
|
||||||
return cost.toString();
|
return cost.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6121,7 +6121,10 @@ public class CardFactory implements NewConstants {
|
|||||||
if (!bbCost.equals(""))
|
if (!bbCost.equals(""))
|
||||||
{
|
{
|
||||||
SpellAbility bbSA = sa.copy();
|
SpellAbility bbSA = sa.copy();
|
||||||
bbSA.setManaCost(CardUtil.addManaCosts(card.getManaCost(), bbCost));
|
String newCost = CardUtil.addManaCosts(card.getManaCost(), bbCost);
|
||||||
|
bbSA.setManaCost(newCost);
|
||||||
|
if (bbSA.payCosts != null)
|
||||||
|
bbSA.payCosts.setMana(newCost); // abCost value needs to be increased for paying spells
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Buyback ").append(bbCost).append(" (You may pay an additional ").append(bbCost);
|
sb.append("Buyback ").append(bbCost).append(" (You may pay an additional ").append(bbCost);
|
||||||
sb.append(" as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
sb.append(" as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
||||||
|
|||||||
Reference in New Issue
Block a user