From 138fa46824f43478529fedb69910e891c1a13d5a Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:26:36 -0400 Subject: [PATCH] Fixed text generation for LoseLifeOpponentsEffect --- .../effects/common/LoseLifeOpponentsEffect.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java index d6e439a7ff..292f2e6fee 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java @@ -17,7 +17,7 @@ import java.util.UUID; */ public class LoseLifeOpponentsEffect extends OneShotEffect { - private DynamicValue amount; + private final DynamicValue amount; public LoseLifeOpponentsEffect(int amount) { this(StaticValue.get(amount)); @@ -26,7 +26,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect { public LoseLifeOpponentsEffect(DynamicValue amount) { super(Outcome.Damage); this.amount = amount; - staticText = "each opponent loses " + amount + " life"; + staticText = generateStaticText(); } public LoseLifeOpponentsEffect(final LoseLifeOpponentsEffect effect) { @@ -50,8 +50,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect { return new LoseLifeOpponentsEffect(this); } - @Override - public String getText(Mode mode) { + private String generateStaticText() { if (staticText != null && !staticText.isEmpty()) { return staticText; } @@ -59,7 +58,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect { String message = amount.getMessage(); sb.append("each opponent loses "); - if (message.isEmpty() || !message.equals("1")) { + if (!message.equals("1")) { sb.append(amount).append(' '); } sb.append("life");