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