mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
DestroyEffect.getStackDescription clean up
This commit is contained in:
@@ -16,6 +16,7 @@ import forge.game.card.CardUtil;
|
||||
import forge.game.card.CardZoneTable;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Lang;
|
||||
|
||||
public class DestroyEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
@@ -24,40 +25,18 @@ public class DestroyEffect extends SpellAbilityEffect {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
final List<Card> tgtCards = getTargetCards(sa);
|
||||
final boolean justOne = tgtCards.size() == 1;
|
||||
|
||||
if (sa.hasParam("Sacrifice")) {
|
||||
sb.append("Sacrifice ");
|
||||
} else {
|
||||
sb.append("Destroy ");
|
||||
}
|
||||
|
||||
final Iterator<Card> it = tgtCards.iterator();
|
||||
while (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
|
||||
if (it.hasNext()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
}
|
||||
sb.append(sa.hasParam("Sacrifice") ? "Sacrifice " : "Destroy ").append(Lang.joinHomogenous(tgtCards));
|
||||
|
||||
if (sa.hasParam("Radiance")) {
|
||||
sb.append(" and each other ").append(sa.getParam("ValidTgts"))
|
||||
.append(" that shares a color with ");
|
||||
if (tgtCards.size() > 1) {
|
||||
sb.append("them");
|
||||
} else {
|
||||
sb.append("it");
|
||||
}
|
||||
final String thing = sa.getParamOrDefault("ValidTgts", "thing");
|
||||
sb.append(" and each other ").append(thing).append(" that shares a color with ");
|
||||
sb.append(justOne ? "it" : "them");
|
||||
}
|
||||
|
||||
if (noRegen) {
|
||||
sb.append(". ");
|
||||
if (tgtCards.size() == 1) {
|
||||
sb.append("It");
|
||||
} else {
|
||||
sb.append("They");
|
||||
}
|
||||
sb.append(" can't be regenerated");
|
||||
sb.append(". ").append(justOne ? "It" : "They").append(" can't be regenerated");
|
||||
}
|
||||
sb.append(".");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user