Thanks for welcome. I hope my contributions actually help somewhat.
Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.
The code to blame is in AbilityFactory.getAbility. When called for a Drawback, abCost is never instantiated and thus a null pointer error occurs below.
- AbilityFactory.getAbility Snippets | Open
- Code: Select all
if (!isDb){
if (!mapParams.containsKey("Cost"))
throw new RuntimeException("AbilityFact1ory : getAbility -- no Cost in " + hostCard.getName());
abCost = new Ability_Cost(mapParams.get("Cost"), hostCard.getName(), isAb);
}
- Code: Select all
if (hasSpDesc)
{
StringBuilder sb = new StringBuilder();
if (mapParams.containsKey("PrecostDesc"))
sb.append(mapParams.get("PrecostDesc")).append(" ");
if (mapParams.containsKey("CostDesc"))
sb.append(mapParams.get("CostDesc")).append(" ");
else sb.append(abCost.toString());
sb.append(mapParams.get("SpellDescription"));
SA.setDescription(sb.toString());
}
Would it be worth it to check for abCost being null here or is the idea that a drawback should always be described in the ability it falls under? I wanted to ask before doing anything myself so I don't accidently step on somebody's toes somehow.
Either way, what is the general consensus on where the description of multi-part abilities/spells should go?