mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
added support for StackDescription to Token and AlterLife AFs
This commit is contained in:
@@ -219,6 +219,10 @@ public class AbilityFactoryAlterLife {
|
|||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.containsKey("StackDescription")) {
|
||||||
|
sb.append(params.get("StackDescription"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
final String conditionDesc = params.get("ConditionDescription");
|
final String conditionDesc = params.get("ConditionDescription");
|
||||||
if (conditionDesc != null) {
|
if (conditionDesc != null) {
|
||||||
sb.append(conditionDesc).append(" ");
|
sb.append(conditionDesc).append(" ");
|
||||||
@@ -238,6 +242,7 @@ public class AbilityFactoryAlterLife {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("gains ").append(amount).append(" life.");
|
sb.append("gains ").append(amount).append(" life.");
|
||||||
|
}
|
||||||
|
|
||||||
final AbilitySub abSub = sa.getSubAbility();
|
final AbilitySub abSub = sa.getSubAbility();
|
||||||
if (abSub != null) {
|
if (abSub != null) {
|
||||||
|
|||||||
@@ -413,8 +413,22 @@ public class AbilityFactoryToken extends AbilityFactory {
|
|||||||
* @return a {@link java.lang.String} object.
|
* @return a {@link java.lang.String} object.
|
||||||
*/
|
*/
|
||||||
private String doStackDescription(final SpellAbility sa) {
|
private String doStackDescription(final SpellAbility sa) {
|
||||||
|
|
||||||
|
final HashMap<String, String> params = this.abilityFactory.getMapParams();
|
||||||
|
final StringBuilder sb = new StringBuilder();
|
||||||
final Card host = this.abilityFactory.getHostCard();
|
final Card host = this.abilityFactory.getHostCard();
|
||||||
|
|
||||||
|
if (sa instanceof AbilitySub) {
|
||||||
|
sb.append(" ");
|
||||||
|
} else {
|
||||||
|
sb.append(host.getName()).append(" - ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.containsKey("StackDescription")) {
|
||||||
|
sb.append(params.get("StackDescription"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
final int finalPower = AbilityFactory.calculateAmount(this.abilityFactory.getHostCard(), this.tokenPower, sa);
|
final int finalPower = AbilityFactory.calculateAmount(this.abilityFactory.getHostCard(), this.tokenPower, sa);
|
||||||
final int finalToughness = AbilityFactory.calculateAmount(this.abilityFactory.getHostCard(),
|
final int finalToughness = AbilityFactory.calculateAmount(this.abilityFactory.getHostCard(),
|
||||||
this.tokenToughness, sa);
|
this.tokenToughness, sa);
|
||||||
@@ -422,14 +436,6 @@ public class AbilityFactoryToken extends AbilityFactory {
|
|||||||
|
|
||||||
final String substitutedName = this.tokenName.equals("ChosenType") ? host.getChosenType() : this.tokenName;
|
final String substitutedName = this.tokenName.equals("ChosenType") ? host.getChosenType() : this.tokenName;
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
if (sa instanceof AbilitySub) {
|
|
||||||
sb.append(" ");
|
|
||||||
} else {
|
|
||||||
sb.append(host.getName()).append(" - ");
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append("Put (").append(finalAmount).append(") ").append(finalPower).append("/").append(finalToughness);
|
sb.append("Put (").append(finalAmount).append(") ").append(finalPower).append("/").append(finalToughness);
|
||||||
sb.append(" ").append(substitutedName).append(" token");
|
sb.append(" ").append(substitutedName).append(" token");
|
||||||
if (finalAmount != 1) {
|
if (finalAmount != 1) {
|
||||||
@@ -442,6 +448,7 @@ public class AbilityFactoryToken extends AbilityFactory {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sa.getSubAbility() != null) {
|
if (sa.getSubAbility() != null) {
|
||||||
sb.append(sa.getSubAbility().getStackDescription());
|
sb.append(sa.getSubAbility().getStackDescription());
|
||||||
|
|||||||
Reference in New Issue
Block a user