mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fixed text generation for LoseLifeOpponentsEffect
This commit is contained in:
parent
bfa5b6ab5f
commit
138fa46824
1 changed files with 4 additions and 5 deletions
|
@ -17,7 +17,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public class LoseLifeOpponentsEffect extends OneShotEffect {
|
public class LoseLifeOpponentsEffect extends OneShotEffect {
|
||||||
|
|
||||||
private DynamicValue amount;
|
private final DynamicValue amount;
|
||||||
|
|
||||||
public LoseLifeOpponentsEffect(int amount) {
|
public LoseLifeOpponentsEffect(int amount) {
|
||||||
this(StaticValue.get(amount));
|
this(StaticValue.get(amount));
|
||||||
|
@ -26,7 +26,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect {
|
||||||
public LoseLifeOpponentsEffect(DynamicValue amount) {
|
public LoseLifeOpponentsEffect(DynamicValue amount) {
|
||||||
super(Outcome.Damage);
|
super(Outcome.Damage);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
staticText = "each opponent loses " + amount + " life";
|
staticText = generateStaticText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoseLifeOpponentsEffect(final LoseLifeOpponentsEffect effect) {
|
public LoseLifeOpponentsEffect(final LoseLifeOpponentsEffect effect) {
|
||||||
|
@ -50,8 +50,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect {
|
||||||
return new LoseLifeOpponentsEffect(this);
|
return new LoseLifeOpponentsEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private String generateStaticText() {
|
||||||
public String getText(Mode mode) {
|
|
||||||
if (staticText != null && !staticText.isEmpty()) {
|
if (staticText != null && !staticText.isEmpty()) {
|
||||||
return staticText;
|
return staticText;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +58,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect {
|
||||||
String message = amount.getMessage();
|
String message = amount.getMessage();
|
||||||
|
|
||||||
sb.append("each opponent loses ");
|
sb.append("each opponent loses ");
|
||||||
if (message.isEmpty() || !message.equals("1")) {
|
if (!message.equals("1")) {
|
||||||
sb.append(amount).append(' ');
|
sb.append(amount).append(' ');
|
||||||
}
|
}
|
||||||
sb.append("life");
|
sb.append("life");
|
||||||
|
|
Loading…
Reference in a new issue