Watching the game.

This commit is contained in:
marcins78@gmail.com
2011-09-18 21:04:04 +00:00
parent d175105f85
commit 3d937e1838
2 changed files with 17 additions and 10 deletions

View File

@@ -53,21 +53,20 @@ public class Card1_091 extends AbstractAttachableFPPossession {
});
action.addEffect(
new PlayoutDecisionEffect(game.getUserFeedback(), playerId,
new ForEachYouSpotDecision(1, "Choose number of pipes new RemoveBurdenEffect(playerId)you wish to spot", game, Filters.keyword(Keyword.PIPE), Integer.MAX_VALUE) {
new ForEachYouSpotDecision(1, "Choose number of pipes you wish to spot", game, Filters.keyword(Keyword.PIPE), Integer.MAX_VALUE) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
int spotCount = getValidatedResult(result);
int companionsCount = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
spotCount = Math.min(spotCount, companionsCount);
for (int i = 0; i < spotCount; i++)
action.addEffect(
new ChooseActiveCardsEffect(playerId, "Choose companions", spotCount, spotCount, Filters.type(CardType.COMPANION)) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
for (PhysicalCard card : cards)
action.addEffect(new HealCharacterEffect(playerId, card));
}
});
action.addEffect(
new ChooseActiveCardsEffect(playerId, "Choose companion(s) to heal", spotCount, spotCount, Filters.type(CardType.COMPANION)) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
for (PhysicalCard card : cards)
action.addEffect(new HealCharacterEffect(playerId, card));
}
});
}
}));
return Collections.singletonList(action);

View File

@@ -683,6 +683,14 @@ var GempLotrGameUI = Class.extend({
this.selfPlayerId = participantId;
var index = -1;
for (var i = 0; i < this.allPlayerIds.length; i++) {
if (this.allPlayerIds[i] == this.selfPlayerId)
index = i;
}
if (index == -1)
this.selfPlayerId = this.allPlayerIds[0];
this.initializeGameUI();
this.layoutUI();
},