mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
LifeGainEffect.getStackDescription handle Defined/Targeted coming up empty
This commit is contained in:
@@ -18,14 +18,15 @@ public class LifeGainEffect extends SpellAbilityEffect {
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
final String amountStr = sa.getParam("LifeAmount");
|
||||
final String spellDesc = sa.getParam("SpellDescription");
|
||||
|
||||
sb.append(Lang.joinHomogenous(getDefinedPlayersOrTargeted(sa)));
|
||||
if (sb.length() == 0 && spellDesc != null) {
|
||||
return (spellDesc);
|
||||
} else {
|
||||
sb.append(getDefinedPlayersOrTargeted(sa).size() > 1 ? " gain " : " gains ");
|
||||
if (!StringUtils.isNumeric(amountStr) && sa.hasParam("SpellDescription") &&
|
||||
sa.getParam("SpellDescription").contains("life equal to")) {
|
||||
String xDesc = sa.getParam("SpellDescription");
|
||||
xDesc = xDesc.substring(xDesc.indexOf("life equal to"));
|
||||
sb.append(xDesc);
|
||||
if (!StringUtils.isNumeric(amountStr) && spellDesc != null && spellDesc.contains("life equal to")) {
|
||||
sb.append(spellDesc.substring(spellDesc.indexOf("life equal to")));
|
||||
} else if (!amountStr.equals("AFLifeLost") || sa.hasSVar(amountStr)) {
|
||||
final int amount = AbilityUtils.calculateAmount(sa.getHostCard(), amountStr, sa);
|
||||
|
||||
@@ -33,6 +34,7 @@ public class LifeGainEffect extends SpellAbilityEffect {
|
||||
} else {
|
||||
sb.append("life equal to the life lost this way.");
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user