From 69811ff65e45672da2393b108052ea97f72ed22e Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 4 Oct 2011 18:56:11 +0000 Subject: [PATCH] Few changes. --- .../actions/TransferPermanentAction.java | 5 ++ .../lotro/cards/set1/moria/Card1_179.java | 13 ++- .../effects/ChooseActiveCardsEffect.java | 8 +- ...PlayerAssignsArcheryDamageGameProcess.java | 17 ++-- ...PlayerAssignsArcheryDamageGameProcess.java | 17 ++-- .../PlayoutSkirmishesGameProcess.java | 7 +- .../timing/rules/CharacterDeathRule.java | 7 +- .../timing/rules/ResolveSkirmishRule.java | 14 +++- .../logic/timing/rules/SanctuaryRule.java | 17 ++-- .../gemp-lotr-web/src/main/webapp/hall.html | 1 + .../src/main/webapp/includes/instruction.html | 81 +++++++++++++++++++ 11 files changed, 155 insertions(+), 32 deletions(-) create mode 100644 gemp-lotr/gemp-lotr-web/src/main/webapp/includes/instruction.html diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/TransferPermanentAction.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/TransferPermanentAction.java index ca8cffa9e..0929ed27e 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/TransferPermanentAction.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/TransferPermanentAction.java @@ -25,4 +25,9 @@ public class TransferPermanentAction extends ActivateCardAction { } }); } + + @Override + public String getText(LotroGame game) { + return "Transfer " + getActionSource().getBlueprint().getName(); + } } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_179.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_179.java index 959355c42..d81c4c533 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_179.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_179.java @@ -37,9 +37,18 @@ public class Card1_179 extends AbstractMinion { @Override public List getOptionalAfterTriggers(final String playerId, final LotroGame game, EffectResult effectResult, final PhysicalCard self) { - if (PlayConditions.played(game.getGameState(), game.getModifiersQuerying(), effectResult, Filters.sameCard(self))) { - final Filter additionalAttachmentFilter = Filters.and(Filters.owner(self.getOwner()), Filters.culture(Culture.MORIA), Filters.race(Race.ORC)); + final Filter additionalAttachmentFilter = Filters.and(Filters.owner(self.getOwner()), Filters.culture(Culture.MORIA), Filters.race(Race.ORC)); + if (PlayConditions.played(game.getGameState(), game.getModifiersQuerying(), effectResult, Filters.sameCard(self)) + && Filters.filter(game.getGameState().getDiscard(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.weapon(), + new Filter() { + @Override + public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) { + AbstractAttachable weapon = (AbstractAttachable) physicalCard.getBlueprint(); + return weapon.checkPlayRequirements(playerId, game, physicalCard, additionalAttachmentFilter, 0); + } + }, Filters.playable(game)).size() > 0 + ) { OptionalTriggerAction action = new OptionalTriggerAction(self); action.appendEffect( new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getDiscard(playerId), diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseActiveCardsEffect.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseActiveCardsEffect.java index 66b58078a..690fb5c7f 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseActiveCardsEffect.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseActiveCardsEffect.java @@ -13,9 +13,9 @@ import java.util.Collection; import java.util.Set; public abstract class ChooseActiveCardsEffect extends AbstractEffect { - private PhysicalCard _source; + private final PhysicalCard _source; private final String _playerId; - private final String _choiceText; + private String _choiceText; private final int _minimum; private final int _maximum; private final Filter[] _filters; @@ -29,6 +29,10 @@ public abstract class ChooseActiveCardsEffect extends AbstractEffect { _filters = filters; } + public void setChoiceText(String choiceText) { + _choiceText = choiceText; + } + protected Filter getExtraFilter() { return Filters.any(); } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/FellowshipPlayerAssignsArcheryDamageGameProcess.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/FellowshipPlayerAssignsArcheryDamageGameProcess.java index 6cbe5b109..0a1e7a796 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/FellowshipPlayerAssignsArcheryDamageGameProcess.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/FellowshipPlayerAssignsArcheryDamageGameProcess.java @@ -37,16 +37,17 @@ public class FellowshipPlayerAssignsArcheryDamageGameProcess implements GameProc } }); - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Archery fire"; + } + }; for (int i = 0; i < _woundsToAssign; i++) { final int woundsLeft = _woundsToAssign - i; - action.appendEffect( - new ChooseAndWoundCharactersEffect(action, _game.getGameState().getCurrentPlayerId(), 1, 1, filter) { - @Override - public String getText(LotroGame game) { - return "Choose character to assign archery wound to - remaining wounds: " + woundsLeft; - } - }); + ChooseAndWoundCharactersEffect woundCharacter = new ChooseAndWoundCharactersEffect(action, _game.getGameState().getCurrentPlayerId(), 1, 1, filter); + woundCharacter.setChoiceText("Choose character to assign archery wound to - remaining wounds: " + woundsLeft); + action.appendEffect(woundCharacter); } _game.getActionsEnvironment().addActionToStack(action); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/ShadowPlayerAssignsArcheryDamageGameProcess.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/ShadowPlayerAssignsArcheryDamageGameProcess.java index cfd7520f5..5d4676844 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/ShadowPlayerAssignsArcheryDamageGameProcess.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/archery/ShadowPlayerAssignsArcheryDamageGameProcess.java @@ -28,16 +28,17 @@ public class ShadowPlayerAssignsArcheryDamageGameProcess implements GameProcess if (_woundsToAssign > 0) { Filter filter = Filters.and(Filters.type(CardType.MINION), Filters.owner(_playerId)); - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Archery fire"; + } + }; for (int i = 0; i < _woundsToAssign; i++) { final int woundsLeft = _woundsToAssign - i; - action.appendEffect( - new ChooseAndWoundCharactersEffect(action, _playerId, 1, 1, filter) { - @Override - public String getText(LotroGame game) { - return "Choose minion to assign archery wound to - remaining wounds: " + woundsLeft; - } - }); + ChooseAndWoundCharactersEffect woundCharacter = new ChooseAndWoundCharactersEffect(action, _playerId, 1, 1, filter); + woundCharacter.setChoiceText("Choose minion to assign archery wound to - remaining wounds: " + woundsLeft); + action.appendEffect(woundCharacter); } _game.getActionsEnvironment().addActionToStack(action); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/skirmish/PlayoutSkirmishesGameProcess.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/skirmish/PlayoutSkirmishesGameProcess.java index d84a062f6..c1355a166 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/skirmish/PlayoutSkirmishesGameProcess.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/processes/turn/skirmish/PlayoutSkirmishesGameProcess.java @@ -39,7 +39,12 @@ public class PlayoutSkirmishesGameProcess implements GameProcess { for (Skirmish assignment : assignments) fps.add(assignment.getFellowshipCharacter()); - RequiredTriggerAction chooseNextSkirmishAction = new RequiredTriggerAction(null); + RequiredTriggerAction chooseNextSkirmishAction = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Choosing next skirmish to play out"; + } + }; chooseNextSkirmishAction.appendEffect( new ChooseActiveCardEffect(null, gameState.getCurrentPlayerId(), "Choose next skirmish to resolve", Filters.in(fps)) { @Override diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/CharacterDeathRule.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/CharacterDeathRule.java index 1df935ce8..5570f0a2d 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/CharacterDeathRule.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/CharacterDeathRule.java @@ -40,7 +40,12 @@ public class CharacterDeathRule { deadCharacters.add(character); if (deadCharacters.size() > 0) { - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Character(s) death"; + } + }; action.appendEffect( new KillEffect(deadCharacters)); return Collections.singletonList(action); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/ResolveSkirmishRule.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/ResolveSkirmishRule.java index 511d25f71..b7658771f 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/ResolveSkirmishRule.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/ResolveSkirmishRule.java @@ -45,7 +45,12 @@ public class ResolveSkirmishRule { List losers = skirmishResult.getLosers(); - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Resolving skirmish"; + } + }; for (int i = 0; i < dmg; i++) { action.appendEffect( new WoundCharactersEffect(winners, Filters.in(losers))); @@ -56,7 +61,12 @@ public class ResolveSkirmishRule { OverwhelmSkirmishResult skirmishResult = (OverwhelmSkirmishResult) effectResult; List losers = new LinkedList(skirmishResult.getLosers()); - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Resolving skirmish"; + } + }; action.appendEffect(new KillEffect(losers)); return Collections.singletonList(action); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/SanctuaryRule.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/SanctuaryRule.java index 77b39fc2b..bb981e304 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/SanctuaryRule.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/SanctuaryRule.java @@ -28,16 +28,17 @@ public class SanctuaryRule { public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult) { if (effectResult.getType() == EffectResult.Type.START_OF_TURN && game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.SANCTUARY)) { - RequiredTriggerAction action = new RequiredTriggerAction(null); + RequiredTriggerAction action = new RequiredTriggerAction(null) { + @Override + public String getText(LotroGame game) { + return "Sanctuary healing"; + } + }; for (int i = 0; i < 5; i++) { final int remainingHeals = 5 - i; - action.appendEffect( - new ChooseAndHealCharactersEffect(action, game.getGameState().getCurrentPlayerId(), 0, 1, Filters.type(CardType.COMPANION)) { - @Override - public String getText(LotroGame game) { - return "Sanctuary healing - Choose companion to heal - remaining heals: " + remainingHeals; - } - }); + ChooseAndHealCharactersEffect healEffect = new ChooseAndHealCharactersEffect(action, game.getGameState().getCurrentPlayerId(), 0, 1, Filters.type(CardType.COMPANION)); + healEffect.setChoiceText("Sanctuary healing - Choose companion to heal - remaining heals: " + remainingHeals); + action.appendEffect(healEffect); } return Collections.singletonList(action); } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/hall.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/hall.html index 390d0ca1d..f8251ed03 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/hall.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/hall.html @@ -105,6 +105,7 @@
  • Game Hall
  • +
  • Manual
  • League Rules
  • Contribute
  • Change Log
  • diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/instruction.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/instruction.html new file mode 100644 index 000000000..a925d170a --- /dev/null +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/instruction.html @@ -0,0 +1,81 @@ +

    Manual

    + +

    GEMP-Lotr is an automatic game client for the Lord of the Rings Tradable Card Game. Below you will + find basic information about using it.

    + +
      +
    1. The Game Hall
      + A place where everything starts. When you log in, you automatically enter Game Hall. + Same thing happens when you win/lose game. Basically you can communicate here with + other players, create decks, create and join games, etc. +
    2. + +
    3. Building The Deck
      + Making a deck is very easy. In the Game Hall you will find Edit Deck button. Simply click it and + the deck builder will open. It is divided into three parts. In the left one, you can choose Ring + Bearer, The One Ring and Sites. To the right side you can find card sets, from which cards are + added to the deck. By clicking on the culture icon, cards from the selected ones will appear. + To reset, simply click again on the icon. Middle part is what actually your deck consists of. It + is divided into two sections, Free Peoples and Shadow.
      + Gemp has built-in validator, which counts Free Peoples/Shadow cards and checks if the deck + is valid for selected format. +
    4. + +
    5. Setting up game
      + Once you have created the deck, you can host/join games. Simply again, click on Create Table + and the game is ready. It will start automatically when someone will join it.
      + To join game click Join Table button in the selected green square (which represents table) + I strongly recommend to check both options in the Settings tab (i. e. auto-pass when there + is no action and auto-accept after selecting action or card) - game will speed up and will be + smoother for both players. +
    6. + +
    7. Playing game
      + Playing Lord of the Rings TCG via Gemp is similar to the one played in real life. First you bid + number of burdens to determine who goes first. If you win it, a window with choose a seat + number at the table will pop-up. Number 1 means that you want to go first, number 2 that + opponent will and so on.
      + Next step is choosing your starting fellowship. Select characters by clicking on them for the + total twilight cost up to 4 (selected character is the one with a blue frame on it). Select one, + click Done and select another one (if able).
      + Time to play some cards! On the bottom part of the game you can find your starting hand. + Click one time on the card to play it. Gemp automatically adds twilight points and triggers + actions which are not optional (for example, playing A Wizard is never late will automatically + let you choose a "Gandalf culture" character to play from the draw deck. However the + actions which may be used, are not played automatically (even it is obvious that you want + to do it). If such action is available, affected card will be highlighted with green frame (for + example Old Toby allows you to draw a card when you play it, but it needs to be clicked again + for this action to happen, as it is optional). This applies to all other actions in all stages of the + game.
      + Below the frame with turn sequence there is a smaller one where you will find what + you currently can do. In most cases cards eligible to play at the current moment will be + highlighted. If you don’t want to do anything, click Pass and the next step will commence. +
    8. + +
    9. Skirmish
      + As a vital part of the game, skirmish at first may look complicated. However, when you get + used to Gemp interface you will see its fast and user friendly. For the beginners, few words + on how it works.
      + First you need to assign minions to companions. Click on the minion, then the companion + you wish to fight him (eligible companions will be highlighted). Assigned minions and + companions will appear to the right side of the game table. When you finish assigning, click + Done. Before you do it, think if it is your final decision, because you won’t be able to assign + them differently afterwards.
      + Next step is skirmish. Click on the character which you want to fight first. When that skirmish + is complete, select another one and so on. Skirmish events, special abilities, etc. which are + playable will be highlighted during every fight. If you don’t want to play any, click Pass. + If such are not available, Gemp will do it automatically. After all skirmishes are resolved + (including fierce ones) game will proceed to next stage (Regroup) +
    10. + +
    11. The Iron rule
      + There is no rolling back, simple as that. You can’t cancel action that already happen, even if + opponent will agree. If you played cards you didn’t want to, assigned wrong or didn’t trigger + optional action it’s done and can’t be reversed. +
    12. + +
    13. Useful Stuff
      + On the upper part of the game hall, you will find many tabs with useful information. Thus its + not obligated, I recommend to read it. +
    14. +