- Modified the texts of the effects.

This commit is contained in:
marcins78@gmail.com
2011-10-19 21:05:52 +00:00
parent ec18a5aa58
commit e79ed7fbb8
21 changed files with 52 additions and 28 deletions

View File

@@ -38,7 +38,7 @@ public class AddBurdenEffect extends AbstractEffect implements Preventable {
@Override
public String getText(LotroGame game) {
return "Add " + (_count - _prevented) + "burden(s)";
return "Add " + (_count - _prevented) + "burden" + (((_count - _prevented) > 1) ? "s" : "");
}
@Override
@@ -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(s)");
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " adds " + toAdd + " burden" + ((toAdd > 1) ? "s" : ""));
game.getGameState().addBurdens(toAdd);
return new FullEffectResult(new EffectResult[]{new AddBurdenResult(_source, toAdd)}, true, _prevented == 0);
}

View File

@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
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.EffectResult;
@@ -49,7 +50,8 @@ public class DiscardStackedCardsEffect extends AbstractEffect {
toDiscard.add(card);
}
gameState.sendMessage(getAppendedNames(toDiscard) + " is/are discarded from being stacked");
if (toDiscard.size() > 0)
gameState.sendMessage(getAppendedNames(toDiscard) + " " + GameUtils.be(toDiscard) + " discarded from being stacked");
gameState.removeCardsFromZone(toDiscard);
for (PhysicalCard card : toDiscard)
gameState.addCardToZone(card, Zone.DISCARD);

View File

@@ -52,7 +52,7 @@ public class ExertCharactersEffect extends AbstractPreventableCardEffect {
@Override
protected EffectResult[] playoutEffectOn(LotroGame game, Collection<PhysicalCard> cards) {
if (cards.size() > 0)
game.getGameState().sendMessage(getAppendedNames(cards) + " exert(s) due to " + GameUtils.getCardLink(_source));
game.getGameState().sendMessage(getAppendedNames(cards) + " exert" + GameUtils.s(cards) + " due to " + GameUtils.getCardLink(_source));
for (PhysicalCard woundedCard : cards)
game.getGameState().addWound(woundedCard);

View File

@@ -26,7 +26,8 @@ public class ReturnCardsToHandEffect extends AbstractEffect {
@Override
public String getText(LotroGame game) {
return "Return card(s) to hand";
Collection<PhysicalCard> cards = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filter);
return "Return " + getAppendedNames(cards) + " to hand";
}
@Override

View File

@@ -3,6 +3,7 @@ package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
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.EffectResult;
@@ -54,7 +55,7 @@ public class ShuffleCardsFromDiscardIntoDeckEffect extends AbstractEffect {
game.getGameState().shuffleCardsIntoDeck(toShuffleIn, _playerDeck);
game.getGameState().sendMessage(getAppendedNames(toShuffleIn) + " is/are shuffled into " + _playerDeck + " deck");
game.getGameState().sendMessage(getAppendedNames(toShuffleIn) + " " + GameUtils.be(toShuffleIn) + " shuffled into " + _playerDeck + " deck");
}
return new FullEffectResult(null, toShuffleIn.size() == _cards.size(), toShuffleIn.size() == _cards.size());

View File

@@ -3,6 +3,7 @@ package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
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.EffectResult;
@@ -62,7 +63,7 @@ public class ShuffleCardsFromPlayAndStackedOnItIntoDeckEffect extends AbstractEf
game.getGameState().shuffleCardsIntoDeck(toShuffleIn, _playerDeck);
game.getGameState().sendMessage(getAppendedNames(toShuffleIn) + " is/are shuffled into " + _playerDeck + " deck");
game.getGameState().sendMessage(getAppendedNames(toShuffleIn) + " " + GameUtils.be(toShuffleIn) + " shuffled into " + _playerDeck + " deck");
cardsShuffledCallback(toShuffleIn);
}

View File

@@ -51,7 +51,7 @@ public class ChooseAndDiscardCardsFromHandEffect extends AbstractEffect {
@Override
public String getText(LotroGame game) {
return "Discard card(s) from hand";
return null;
}
@Override
@@ -75,7 +75,7 @@ public class ChooseAndDiscardCardsFromHandEffect extends AbstractEffect {
cardsBeingDiscarded(hand, success);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose card(s) to discard", hand, _minimum, _maximum) {
new CardsSelectionDecision(1, "Choose cards to discard", hand, _minimum, _maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> cards = getSelectedCardsByResponse(result);

View File

@@ -21,7 +21,7 @@ public class ChooseAndDiscardCardsFromPlayEffect extends ChooseActiveCardsEffect
@Override
public String getText(LotroGame game) {
return "Choose card(s) to discard from play";
return null;
}
@Override

View File

@@ -63,7 +63,7 @@ public class ChooseAndDiscardStackedCardsEffect extends AbstractEffect {
game.getActionsEnvironment().addActionToStack(subAction);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose card(s) to discard", discardableCards, _minimum, _maximum) {
new CardsSelectionDecision(1, "Choose cards to discard", discardableCards, _minimum, _maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);

View File

@@ -39,7 +39,7 @@ public class ChooseAndStackCardsFromHandEffect extends AbstractEffect {
@Override
public String getText(LotroGame game) {
return "Stack card(s) from hand";
return null;
}
@Override
@@ -60,7 +60,7 @@ public class ChooseAndStackCardsFromHandEffect extends AbstractEffect {
game.getActionsEnvironment().addActionToStack(subAction);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose card(s) to stack", hand, _minimum, _maximum) {
new CardsSelectionDecision(1, "Choose cards to stack", hand, _minimum, _maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> cards = getSelectedCardsByResponse(result);

View File

@@ -53,7 +53,7 @@ public abstract class ChooseCardsFromHandEffect extends AbstractEffect {
cardsSelected(game, selectableCards);
else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose card(s) from hand", selectableCards, minimum, _maximum) {
new CardsSelectionDecision(1, "Choose cards from hand", selectableCards, minimum, _maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);

View File

@@ -60,7 +60,7 @@ public abstract class ChooseStackedCardsEffect extends AbstractEffect {
cardsChosen(stackedCards);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose card(s)", stackedCards, _minimum, _maximum) {
new CardsSelectionDecision(1, "Choose cards", stackedCards, _minimum, _maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> stackedCards = getSelectedCardsByResponse(result);

View File

@@ -3,10 +3,7 @@ package com.gempukku.lotro.logic;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
public class GameUtils {
public static String[] getOpponents(LotroGame game, String playerId) {
@@ -26,6 +23,18 @@ public class GameUtils {
return new LinkedList<PhysicalCard>(randomizedCards.subList(0, Math.min(count, randomizedCards.size())));
}
public static String s(Collection<PhysicalCard> cards) {
if (cards.size() > 1)
return "s";
return "";
}
public static String be(Collection<PhysicalCard> cards) {
if (cards.size() > 1)
return "are";
return "is";
}
public static String getCardLink(PhysicalCard card) {
return "<div class='cardHint' value='" + card.getBlueprintId() + "'>" + card.getBlueprint().getName() + "</div>";
}

View File

@@ -50,7 +50,8 @@ public class AssignmentPhaseEffect extends AbstractEffect {
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
game.getGameState().sendMessage(_playerId + " assigns minion(s) to skirmish");
if (_assignments.size() > 0)
game.getGameState().sendMessage(_playerId + " assigns characters to skirmish");
for (Map.Entry<PhysicalCard, List<PhysicalCard>> physicalCardListEntry : _assignments.entrySet()) {
PhysicalCard fpChar = physicalCardListEntry.getKey();
List<PhysicalCard> minions = physicalCardListEntry.getValue();

View File

@@ -26,7 +26,7 @@ public class ChooseAndHealCharactersEffect extends ChooseActiveCardsEffect {
}
public ChooseAndHealCharactersEffect(Action action, String playerId, int minimum, int maximum, int count, Filterable... filters) {
super(action.getActionSource(), playerId, "Choose character(s) to heal", minimum, maximum, filters);
super(action.getActionSource(), playerId, "Choose characters to heal", minimum, maximum, filters);
_action = action;
_playerId = playerId;
_count = count;
@@ -44,7 +44,7 @@ public class ChooseAndHealCharactersEffect extends ChooseActiveCardsEffect {
@Override
public String getText(LotroGame game) {
return "Choose character(s) to heal";
return null;
}
@Override

View File

@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
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.EffectResult;
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromHandResult;
@@ -56,7 +57,8 @@ public class DiscardCardsFromHandEffect extends AbstractEffect {
if (card.getZone() == Zone.HAND)
discardedCards.add(card);
gameState.sendMessage(getAppendedNames(discardedCards) + " is/are discarded from hand");
if (discardedCards.size() > 0)
gameState.sendMessage(getAppendedNames(discardedCards) + " " + GameUtils.be(discardedCards) + " discarded from hand");
gameState.removeCardsFromZone(discardedCards);
for (PhysicalCard card : discardedCards)
gameState.addCardToZone(card, Zone.DISCARD);

View File

@@ -38,7 +38,8 @@ public class DrawCardEffect extends AbstractEffect {
drawn++;
}
}
game.getGameState().sendMessage(_playerId + " draws " + drawn + " card(s)");
if (drawn > 0)
game.getGameState().sendMessage(_playerId + " draws " + drawn + " card" + ((drawn > 1) ? "s" : ""));
if (drawn > 0)
return new FullEffectResult(new EffectResult[]{new DrawCardOrPutIntoHandResult(_playerId, drawn)}, _count == drawn, _count == drawn);

View File

@@ -2,6 +2,7 @@ package com.gempukku.lotro.logic.effects;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.timing.AbstractSuccessfulEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.OverwhelmSkirmishResult;
@@ -24,7 +25,7 @@ public class OverwhelmedEffect extends AbstractSuccessfulEffect {
@Override
public String getText(LotroGame game) {
return "Character(s) was/where overwhelmed in Skirmish";
return getAppendedNames(_losers) + " " + GameUtils.be(_losers) + " overwhelmed in skirmish";
}
@Override

View File

@@ -24,7 +24,7 @@ public class SkirmishResolvedEffect extends AbstractSuccessfulEffect {
@Override
public String getText(LotroGame game) {
return "Character(s) won skirmish";
return getAppendedNames(_winners) + " won skirmish";
}
@Override

View File

@@ -5,6 +5,7 @@ import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.WoundResult;
@@ -61,9 +62,9 @@ public class WoundCharactersEffect extends AbstractPreventableCardEffect {
protected EffectResult[] playoutEffectOn(LotroGame game, Collection<PhysicalCard> cards) {
if (cards.size() > 0)
if (_sources != null)
game.getGameState().sendMessage(getAppendedNames(cards) + " is/are wounded by - " + getAppendedNames(_sources));
game.getGameState().sendMessage(getAppendedNames(cards) + " " + GameUtils.be(cards) + " wounded by - " + getAppendedNames(_sources));
else
game.getGameState().sendMessage(getAppendedNames(cards) + " get(s) wounded");
game.getGameState().sendMessage(getAppendedNames(cards) + " " + GameUtils.be(cards) + " wounded");
for (PhysicalCard woundedCard : cards) {
game.getGameState().addWound(woundedCard);

View File

@@ -1,4 +1,8 @@
<pre style="font-size:80%">
<b>19 Oct. 2011</b>
- Finished "Battle of Helm's Deep (05)" expansion.
- Modified the texts of the effects.
<b>18 Oct. 2011</b>
- Increased the time for playing game per player to 80 minutes (for testing only).
- When players join or leave the room now, everyone in the room will be notified.