mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
WrappedAbility: fixed StackDescription
This commit is contained in:
@@ -1648,13 +1648,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
final List<TargetChoices> res = Lists.newArrayList();
|
final List<TargetChoices> res = Lists.newArrayList();
|
||||||
|
|
||||||
SpellAbility sa = getRootAbility();
|
SpellAbility sa = getRootAbility();
|
||||||
if (sa.getTargetRestrictions() != null) {
|
if (sa.usesTargeting()) {
|
||||||
res.add(sa.getTargets());
|
res.add(sa.getTargets());
|
||||||
}
|
}
|
||||||
while (sa.getSubAbility() != null) {
|
while (sa.getSubAbility() != null) {
|
||||||
sa = sa.getSubAbility();
|
sa = sa.getSubAbility();
|
||||||
|
|
||||||
if (sa.getTargetRestrictions() != null) {
|
if (sa.usesTargeting()) {
|
||||||
res.add(sa.getTargets());
|
res.add(sa.getTargets());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package forge.game.trigger;
|
|||||||
|
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.GameObject;
|
|
||||||
import forge.game.ability.AbilityKey;
|
import forge.game.ability.AbilityKey;
|
||||||
import forge.game.ability.ApiType;
|
import forge.game.ability.ApiType;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -231,23 +230,19 @@ public class WrappedAbility extends Ability {
|
|||||||
public String getStackDescription() {
|
public String getStackDescription() {
|
||||||
final Trigger regtrig = getTrigger();
|
final Trigger regtrig = getTrigger();
|
||||||
final StringBuilder sb = new StringBuilder(regtrig.replaceAbilityText(regtrig.toString(true), this));
|
final StringBuilder sb = new StringBuilder(regtrig.replaceAbilityText(regtrig.toString(true), this));
|
||||||
if (usesTargeting()) {
|
List<TargetChoices> allTargets = sa.getAllTargetChoices();
|
||||||
|
if (!allTargets.isEmpty()) {
|
||||||
sb.append(" (Targeting ");
|
sb.append(" (Targeting ");
|
||||||
for (final GameObject o : this.getTargets()) {
|
sb.append(allTargets);
|
||||||
sb.append(o.toString());
|
|
||||||
sb.append(", ");
|
|
||||||
}
|
|
||||||
if (sb.toString().endsWith(", ")) {
|
|
||||||
sb.setLength(sb.length() - 2);
|
|
||||||
} else {
|
|
||||||
sb.append("ERROR");
|
|
||||||
}
|
|
||||||
sb.append(")");
|
sb.append(")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String important = regtrig.getImportantStackObjects(this);
|
||||||
|
if (!important.isEmpty()) {
|
||||||
sb.append(" [");
|
sb.append(" [");
|
||||||
sb.append(regtrig.getImportantStackObjects(this));
|
sb.append(important);
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user