Sanctuary healing - showing how many left to heal.

Attachment text, showing what you are attaching.
"Clear selection" changed to "Reset choice" (shorter)
Come after list of cards for Wound, Discard, Heal and Exert removed.
If there is only one target for archery fire, it is automatically chosen.
This commit is contained in:
marcins78@gmail.com
2011-09-20 22:12:08 +00:00
parent 09566838a8
commit 7e9f8d454e
18 changed files with 71 additions and 66 deletions

View File

@@ -46,7 +46,7 @@ public class AttachPermanentAction implements CostToEffectAction {
_removeCardEffect = new RemoveCardFromZoneEffect(card);
_chooseTargetEffect =
new ChooseActiveCardEffect(card.getOwner(), "Choose target to attach to", filter) {
new ChooseActiveCardEffect(card.getOwner(), "Attach " + card.getBlueprint().getName() + ". Choose target to attach to", filter) {
@Override
protected void cardSelected(PhysicalCard target) {
_putCardIntoPlayEffect = new AttachCardEffect(_source, target);

View File

@@ -56,7 +56,7 @@ public class ExertCharacterEffect extends AbstractEffect {
if (sb.length() == 0)
return "none";
else
return sb.substring(0, sb.length() - 1);
return sb.substring(0, sb.length() - 2);
}
@Override

View File

@@ -2,14 +2,15 @@ package com.gempukku.lotro.cards.set1.elven;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.ChooseAndExertCharacterEffect;
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardFromPlayEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect;
import java.util.List;
/**
* Set: The Fellowship of the Ring
@@ -39,19 +40,17 @@ public class Card1_058 extends AbstractEvent {
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.addCost(
new ChooseActiveCardEffect(playerId, "Exert first Elf", Filters.race(Race.ELF)) {
new ChooseActiveCardsEffect(playerId, "Choose elves to exert", 2, 2, Filters.race(Race.ELF), Filters.canExert()) {
@Override
protected void cardSelected(final PhysicalCard firstElf) {
action.addCost(new ExertCharacterEffect(playerId, firstElf));
action.addCost(
new ChooseAndExertCharacterEffect(action, playerId, "Exert second Elf", true, Filters.race(Race.ELF), Filters.not(Filters.sameCard(firstElf))));
protected void cardsSelected(List<PhysicalCard> cards) {
action.addCost(new ExertCharacterEffect(playerId, Filters.in(cards)));
}
});
action.addEffect(
new ChooseActiveCardEffect(playerId, "Choose condition", Filters.type(CardType.CONDITION)) {
@Override
protected void cardSelected(PhysicalCard condition) {
action.addEffect(new DiscardCardFromPlayEffect(self, condition));
}
});
return action;

View File

@@ -35,8 +35,7 @@ public class Card1_077 extends AbstractEvent {
new ChooseActiveCardsEffect(playerId, "Choose companions", 0, Integer.MAX_VALUE, Filters.type(CardType.COMPANION), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
for (PhysicalCard card : cards)
action.addCost(new ExertCharacterEffect(playerId, card));
action.addCost(new ExertCharacterEffect(playerId, Filters.in(cards)));
action.addEffect(new RemoveTwilightEffect(cards.size()));
}
});

View File

@@ -57,9 +57,7 @@ public class Card1_134 extends AbstractAttachable {
&& game.getGameState().getCurrentSite() == self.getAttachedTo()) {
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Exert each Hobbit who moves from this site");
List<PhysicalCard> hobbits = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION), Filters.race(Race.HOBBIT));
for (PhysicalCard hobbit : hobbits)
action.addEffect(new ExertCharacterEffect(hobbit.getOwner(), hobbit));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.and(Filters.type(CardType.COMPANION), Filters.race(Race.HOBBIT))));
return Collections.singletonList(action);
}

View File

@@ -58,8 +58,7 @@ public class Card1_137 extends AbstractEvent {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
for (PhysicalCard card : cards)
action.addEffect(new ExertCharacterEffect(playerId, card));
action.addEffect(new ExertCharacterEffect(playerId, Filters.in(cards)));
}
});

View File

@@ -44,8 +44,7 @@ public class Card1_239 extends AbstractEvent {
new ChooseActiveCardsEffect(game.getGameState().getCurrentPlayerId(), "Choose companions to exert", exertCount, exertCount, Filters.type(CardType.COMPANION), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> companions) {
for (PhysicalCard companion : companions)
action.addEffect(new ExertCharacterEffect(playerId, companion));
action.addEffect(new ExertCharacterEffect(playerId, Filters.in(companions)));
}
});
}

View File

@@ -41,8 +41,7 @@ public class Card1_318 extends AbstractPermanent {
new ChooseActiveCardsEffect(playerId, "Choose Hobbits", 2, 2, Filters.race(Race.HOBBIT), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
action.addCost(new ExertCharacterEffect(playerId, cards.get(0)));
action.addCost(new ExertCharacterEffect(playerId, cards.get(1)));
action.addCost(new ExertCharacterEffect(playerId, Filters.in(cards)));
}
});
action.addCost(new DiscardCardFromPlayEffect(self, self));

View File

@@ -11,7 +11,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.LinkedList;
import java.util.Collections;
import java.util.List;
/**
@@ -31,14 +31,12 @@ public class Card1_332 extends AbstractSite {
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
&& game.getGameState().getCurrentSite() == self) {
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
List<PhysicalCard> hobbits = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION));
for (PhysicalCard hobbit : hobbits) {
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION))) {
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Each Hobbit must exert");
action.addEffect(new ExertCharacterEffect(hobbit.getOwner(), hobbit));
actions.add(action);
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.and(Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION))));
return Collections.singletonList(action);
}
return actions;
}
return null;
}

View File

@@ -47,8 +47,7 @@ public class Card1_344 extends AbstractSite {
new ChooseActiveCardsEffect(fpPlayerId, "Choose two companions to exert", 2, 2, Filters.not(Filters.name("Gimli")), Filters.type(CardType.COMPANION), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(0)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(1)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.in(cards)));
}
});
action.addEffect(
@@ -67,8 +66,7 @@ public class Card1_344 extends AbstractSite {
new ChooseActiveCardsEffect(fpPlayerId, "Choose two companions to exert", 2, 2, Filters.not(Filters.name("Gimli")), Filters.type(CardType.COMPANION), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(0)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(1)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.in(cards)));
}
});

View File

@@ -52,8 +52,7 @@ public class Card1_346 extends AbstractSite {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(0)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(1)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.in(cards)));
}
});
action.addEffect(
@@ -72,8 +71,7 @@ public class Card1_346 extends AbstractSite {
new ChooseActiveCardsEffect(fpPlayerId, "Choose two companions to exert", 2, 2, Filters.not(Filters.name("Frodo")), Filters.type(CardType.COMPANION), Filters.canExert()) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(0)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), cards.get(1)));
action.addEffect(new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.in(cards)));
}
});

View File

@@ -50,7 +50,7 @@ public class DiscardCardsFromPlayEffect extends AbstractEffect {
if (sb.length() == 0)
return "none";
else
return sb.substring(0, sb.length() - 1);
return sb.substring(0, sb.length() - 2);
}
@Override

View File

@@ -62,7 +62,7 @@ public class HealCharacterEffect extends AbstractEffect {
if (sb.length() == 0)
return "none";
else
return sb.substring(0, sb.length() - 1);
return sb.substring(0, sb.length() - 2);
}
@Override

View File

@@ -57,7 +57,7 @@ public class WoundCharacterEffect extends AbstractEffect {
if (sb.length() == 0)
return "none";
else
return sb.substring(0, sb.length() - 1);
return sb.substring(0, sb.length() - 2);
}
@Override

View File

@@ -41,18 +41,27 @@ public class FellowshipPlayerAssignsArcheryDamageGameProcess implements GameProc
}
}));
_game.getUserFeedback().sendAwaitingDecision(gameState.getCurrentPlayerId(),
new CardsSelectionDecision(1, "Choose companion or ally at home to assign archery wound to - remaining wounds: " + _woundsToAssign, possibleWoundTargets, 1, 1) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
PhysicalCard selectedCard = getSelectedCardsByResponse(result).get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(gameState.getCurrentPlayerId(), selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new FellowshipPlayerAssignsArcheryDamageGameProcess(_game, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
}
});
if (possibleWoundTargets.size() == 1) {
PhysicalCard selectedCard = possibleWoundTargets.get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(gameState.getCurrentPlayerId(), selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new FellowshipPlayerAssignsArcheryDamageGameProcess(_game, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
} else {
_game.getUserFeedback().sendAwaitingDecision(gameState.getCurrentPlayerId(),
new CardsSelectionDecision(1, "Choose companion or ally at home to assign archery wound to - remaining wounds: " + _woundsToAssign, possibleWoundTargets, 1, 1) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
PhysicalCard selectedCard = getSelectedCardsByResponse(result).get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(gameState.getCurrentPlayerId(), selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new FellowshipPlayerAssignsArcheryDamageGameProcess(_game, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
}
});
}
} else {
_nextProcess = _followingGameProcess;
}

View File

@@ -35,18 +35,27 @@ public class ShadowPlayerAssignsArcheryDamageGameProcess implements GameProcess
Filters.type(CardType.MINION), Filters.owner(_playerId));
if (possibleWoundTargets.size() > 0) {
_game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose minion to assign archery wound to - remaining wounds: " + _woundsToAssign, possibleWoundTargets, 1, 1) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
PhysicalCard selectedCard = getSelectedCardsByResponse(result).get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(_playerId, selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new ShadowPlayerAssignsArcheryDamageGameProcess(_game, _playerId, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
}
});
if (possibleWoundTargets.size() == 1) {
PhysicalCard selectedCard = possibleWoundTargets.get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(_playerId, selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new ShadowPlayerAssignsArcheryDamageGameProcess(_game, _playerId, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
} else {
_game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose minion to assign archery wound to - remaining wounds: " + _woundsToAssign, possibleWoundTargets, 1, 1) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
PhysicalCard selectedCard = getSelectedCardsByResponse(result).get(0);
_game.getActionsEnvironment().addActionToStack(new WoundAction(_playerId, selectedCard, 1));
if (_woundsToAssign > 1)
_nextProcess = new ShadowPlayerAssignsArcheryDamageGameProcess(_game, _playerId, _woundsToAssign - 1, _followingGameProcess);
else
_nextProcess = _followingGameProcess;
}
});
}
} else {
_nextProcess = _followingGameProcess;
}

View File

@@ -54,7 +54,7 @@ public class SanctuaryRule {
@Override
public void doPlayEffect(LotroGame game) {
_action.addEffect(
new ChooseActiveCardsEffect(_fpPlayerId, "Sanctuary healing - Choose companion to heal", 0, 1, Filters.type(CardType.COMPANION)) {
new ChooseActiveCardsEffect(_fpPlayerId, "Sanctuary healing - Choose companion to heal - remaining heals: " + (6 - _counter), 0, 1, Filters.type(CardType.COMPANION)) {
@Override
protected void cardsSelected(List<PhysicalCard> cards) {
if (cards.size() > 0) {

View File

@@ -1115,7 +1115,7 @@ var GempLotrGameUI = Class.extend({
});
}
if (selectedCardIds.length > 0) {
that.alertButtons.append("<button id='ClearSelection'>Clear selection</button>");
that.alertButtons.append("<button id='ClearSelection'>Reset choice</button>");
that.alertButtons.append("<button id='Done'>Done</button>");
$("#Done").button().click(function() {
finishChoice();
@@ -1294,7 +1294,7 @@ var GempLotrGameUI = Class.extend({
var processButtons = function() {
that.alertButtons.html("");
if (selectedCardIds.length > 0) {
that.alertButtons.append("<button id='ClearSelection'>Clear selection</button>");
that.alertButtons.append("<button id='ClearSelection'>Reset choice</button>");
$("#ClearSelection").button().click(function() {
resetChoice();
});