Improved texts for threats, burdens and twilight to display the numbers the system added/removed and was trying to add/remove.
This commit is contained in:
@@ -55,7 +55,7 @@ public class AddBurdenEffect extends AbstractEffect implements Preventable {
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
if (_prevented < _count) {
|
||||
int toAdd = _count - _prevented;
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " adds " + toAdd + " burden" + ((toAdd > 1) ? "s" : ""));
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " adds " + GameUtils.formatNumber(toAdd, _count) + " burden" + ((toAdd > 1) ? "s" : ""));
|
||||
game.getGameState().addBurdens(toAdd);
|
||||
for (int i = 0; i < toAdd; i++)
|
||||
game.getActionsEnvironment().emitEffectResult(new AddBurdenResult(_source));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RemoveBurdenEffect extends AbstractEffect {
|
||||
if (game.getModifiersQuerying().canRemoveBurden(game.getGameState(), _source)) {
|
||||
int toRemove = Math.min(_count, game.getGameState().getBurdens());
|
||||
if (toRemove > 0) {
|
||||
game.getGameState().sendMessage(_performingPlayerId + " removed " + toRemove + " burden" + ((toRemove > 1) ? "s" : "") + " with " + GameUtils.getCardLink(_source));
|
||||
game.getGameState().sendMessage(_performingPlayerId + " removed " + GameUtils.formatNumber(toRemove, _count) + " burden" + ((toRemove > 1) ? "s" : "") + " with " + GameUtils.getCardLink(_source));
|
||||
game.getGameState().removeBurdens(toRemove);
|
||||
for (int i = 0; i < toRemove; i++)
|
||||
game.getActionsEnvironment().emitEffectResult(new RemoveBurdenResult(_performingPlayerId, _source));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.effects;
|
||||
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class RemoveTwilightEffect extends AbstractEffect {
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
int toRemove = Math.min(game.getGameState().getTwilightPool(), _twilight);
|
||||
game.getGameState().sendMessage(toRemove + " twilight gets removed from twilight pool");
|
||||
game.getGameState().sendMessage(GameUtils.formatNumber(toRemove, _twilight) + " twilight gets removed from twilight pool");
|
||||
game.getGameState().removeTwilight(toRemove);
|
||||
|
||||
return new FullEffectResult(toRemove == _twilight, toRemove == _twilight);
|
||||
|
||||
@@ -84,4 +84,11 @@ public class GameUtils {
|
||||
cultures.add(physicalCard.getBlueprint().getCulture());
|
||||
return cultures.size();
|
||||
}
|
||||
|
||||
public static String formatNumber(int effective, int requested) {
|
||||
if (effective != requested)
|
||||
return effective + "(" + requested + ")";
|
||||
else
|
||||
return String.valueOf(effective);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class AddThreatsEffect extends AbstractEffect {
|
||||
int count = evaluateCount(game);
|
||||
int toAdd = Math.min(count, getThreatsPossibleToAdd(game));
|
||||
if (toAdd > 0) {
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " adds " + toAdd + " threat" + ((toAdd > 1) ? "s" : ""));
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " adds " + GameUtils.formatNumber(toAdd, count) + " threat" + ((toAdd > 1) ? "s" : ""));
|
||||
game.getGameState().addThreats(game.getGameState().getCurrentPlayerId(), toAdd);
|
||||
|
||||
for (int i = 0; i < toAdd; i++)
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RemoveThreatsEffect extends AbstractEffect {
|
||||
|
||||
if (toRemove > 0) {
|
||||
if (_source != null)
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " removed " + toRemove + " threat" + ((toRemove > 1) ? "s" : ""));
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " removed " + GameUtils.formatNumber(toRemove, _count) + " threat" + ((toRemove > 1) ? "s" : ""));
|
||||
game.getGameState().removeThreats(game.getGameState().getCurrentPlayerId(), toRemove);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user