diff --git a/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/Zone.java b/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/Zone.java index 4874dd060..5ea853e2e 100644 --- a/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/Zone.java +++ b/gemp-lotr/gemp-lotr-common/src/main/java/com/gempukku/lotro/common/Zone.java @@ -10,6 +10,7 @@ public enum Zone implements Filterable { // Private knowledge HAND("hand", false, true, false), DISCARD("discard", false, true, false), + ADVENTURE_DECK("adventureDeck", false, true, false), // Nobody sees VOID("void", false, false, false), DECK("deck", false, false, false), REMOVED("removed", false, false, false); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameEvent.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameEvent.java index 961b412b3..870dc3883 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameEvent.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameEvent.java @@ -165,7 +165,7 @@ public class GameEvent { PhysicalCard stackedOn = physicalCard.getStackedOn(); if (stackedOn != null) gameEvent = gameEvent.targetCardId(stackedOn.getCardId()); - if (physicalCard.getBlueprint().getCardType() == CardType.SITE) + if (physicalCard.getBlueprint().getCardType() == CardType.SITE && physicalCard.getZone().isInPlay()) gameEvent = gameEvent.index(physicalCard.getSiteNumber()); return gameEvent; } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java index 1fe08e42e..94989c986 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java @@ -93,12 +93,13 @@ public class GameState { private void addPlayerCards(String playerId, List cards, LotroCardBlueprintLibrary library) { for (String blueprintId : cards) { PhysicalCardImpl physicalCard = createPhysicalCard(playerId, library, blueprintId); - physicalCard.setZone(Zone.DECK); - - if (physicalCard.getBlueprint().getCardType() == CardType.SITE) + if (physicalCard.getBlueprint().getCardType() == CardType.SITE) { + physicalCard.setZone(Zone.ADVENTURE_DECK); _adventureDecks.get(playerId).add(physicalCard); - else + } else { + physicalCard.setZone(Zone.DECK); _decks.get(playerId).add(physicalCard); + } } } @@ -307,9 +308,9 @@ public class GameState { } private List getZoneCards(String playerId, CardType type, Zone zone) { - if (zone == Zone.DECK && type != CardType.SITE) + if (zone == Zone.DECK) return _decks.get(playerId); - else if (zone == Zone.DECK) + else if (zone == Zone.ADVENTURE_DECK) return _adventureDecks.get(playerId); else if (zone == Zone.DISCARD) return _discards.get(playerId); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/PlaySiteEffect.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/PlaySiteEffect.java index e0041b1bc..36531b182 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/PlaySiteEffect.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/PlaySiteEffect.java @@ -119,7 +119,7 @@ public class PlaySiteEffect extends AbstractEffect { gameState.removeCardsFromZone(_playerId, Collections.singleton(oldSite)); oldSite.setSiteNumber(null); - gameState.addCardToZone(game, oldSite, Zone.DECK); + gameState.addCardToZone(game, oldSite, Zone.ADVENTURE_DECK); if (gameState.getCurrentSiteNumber() == siteNumber && !_playerId.equals(gameState.getCurrentPlayerId())) game.getModifiersEnvironment().addUntilEndOfTurnModifier( @@ -140,7 +140,7 @@ public class PlaySiteEffect extends AbstractEffect { } sitePlayedCallback(newSite); - game.getActionsEnvironment().emitEffectResult(new PlayCardResult(Zone.DECK, newSite, null, null)); + game.getActionsEnvironment().emitEffectResult(new PlayCardResult(Zone.ADVENTURE_DECK, newSite, null, null)); } }); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/GameStats.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/GameStats.java index c0009fb68..2a2f8ff74 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/GameStats.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/GameStats.java @@ -112,6 +112,7 @@ public class GameStats { final HashMap playerZoneSizes = new HashMap(); playerZoneSizes.put(Zone.HAND, game.getGameState().getHand(player).size()); playerZoneSizes.put(Zone.DECK, game.getGameState().getDeck(player).size()); + playerZoneSizes.put(Zone.ADVENTURE_DECK, game.getGameState().getAdventureDeck(player).size()); playerZoneSizes.put(Zone.DISCARD, game.getGameState().getDiscard(player).size()); playerZoneSizes.put(Zone.DEAD, game.getGameState().getDeadPile(player).size()); newZoneSizes.put(player, playerZoneSizes); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html index 4c6956f2a..0c19d956f 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html @@ -66,6 +66,17 @@ body { background-image: url('images/deadPile-42.png'); } +.adventureDeckSize { + display: none; + text-align: center; + vertical-align: middle; + font-size: 200%; + font-weight: bolder; + width: 42px; + height: 42px; + background-image: url('images/adventureDeck-42.png'); +} + .showStats { display: table-cell; } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js index b4cc1b954..5740ef780 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js @@ -28,6 +28,8 @@ var GempLotrGameUI = Class.extend({ discardPileDialogs: null, discardPileGroups: null, + adventureDeckDialogs: null, + adventureDeckGroups: null, deadPileDialogs: null, deadPileGroups: null, @@ -110,6 +112,8 @@ var GempLotrGameUI = Class.extend({ this.discardPileDialogs = {}; this.discardPileGroups = {}; + this.adventureDeckDialogs = {}; + this.adventureDeckGroups = {}; this.deadPileDialogs = {}; this.deadPileGroups = {}; @@ -263,7 +267,7 @@ var GempLotrGameUI = Class.extend({ for (var i = 0; i < this.allPlayerIds.length; i++) { this.gameStateElem.append("
" + (i + 1) + ". " + this.allPlayerIds[i] + "
" - + "
"); + + "
"); } this.gameStateElem.append("
0
"); @@ -283,10 +287,12 @@ var GempLotrGameUI = Class.extend({ $(this).removeClass("opened").css({width: 150 - that.padding}); $("#discard" + playerIndex).css({display: "none"}); $("#deadPile" + playerIndex).css({display: "none"}); + $("#adventureDeck" + playerIndex).css({display: "none"}); } else { - $(this).addClass("opened").css({width: 150 - that.padding + 80}); + $(this).addClass("opened").css({width: 150 - that.padding + 126}); $("#discard" + playerIndex).css({display: "table-cell"}); $("#deadPile" + playerIndex).css({display: "table-cell"}); + $("#adventureDeck" + playerIndex).css({display: "table-cell"}); } } }); @@ -296,13 +302,20 @@ var GempLotrGameUI = Class.extend({ $("#showStats" + i).append(showBut); } - if (!this.spectatorMode) + if (!this.spectatorMode) { $("#discard" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click( (function(index) { return function() { openSizeDialog(that.discardPileDialogs[that.bottomPlayerId]); }; })(i)); + $("#adventureDeck" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click( + (function(index) { + return function() { + openSizeDialog(that.adventureDeckDialogs[that.bottomPlayerId]); + }; + })(i)); + } for (var i = 0; i < this.allPlayerIds.length; i++) { $("#deadPile" + i).addClass("clickable").click( @@ -645,21 +658,21 @@ var GempLotrGameUI = Class.extend({ initializeDialogs: function() { this.smallDialog = $("
") .dialog({ - autoOpen: false, - closeOnEscape: false, - resizable: false, - width: 400, - height: 200 - }); + autoOpen: false, + closeOnEscape: false, + resizable: false, + width: 400, + height: 200 + }); this.cardActionDialog = $("
") .dialog({ - autoOpen: false, - closeOnEscape: false, - resizable: true, - width: 600, - height: 300 - }); + autoOpen: false, + closeOnEscape: false, + resizable: true, + width: 600, + height: 300 + }); var that = this; @@ -674,11 +687,11 @@ var GempLotrGameUI = Class.extend({ this.infoDialog = $("
") .dialog({ - autoOpen: false, - closeOnEscape: true, - resizable: false, - title: "Card information" - }); + autoOpen: false, + closeOnEscape: true, + resizable: false, + title: "Card information" + }); var swipeOptions = { threshold: 20, @@ -809,6 +822,10 @@ var GempLotrGameUI = Class.extend({ if (this.discardPileGroups.hasOwnProperty(playerId)) this.discardPileGroups[playerId].layoutCards(); + for (var playerId in this.adventureDeckGroups) + if (this.adventureDeckGroups.hasOwnProperty(playerId)) + this.adventureDeckGroups[playerId].layoutCards(); + for (var playerId in this.deadPileGroups) if (this.deadPileGroups.hasOwnProperty(playerId)) this.deadPileGroups[playerId].layoutCards(); @@ -1069,6 +1086,28 @@ var GempLotrGameUI = Class.extend({ discardPileDialog.bind("dialogresize", function() { that.dialogResize(discardPileDialog, that.discardPileGroups[participantId]); }); + + var adventureDeckDialog = $("
").dialog({ + autoOpen: false, + closeOnEscape: true, + resizable: true, + title: "Adventure deck - " + participantId, + minHeight: 80, + minWidth: 200, + width: 600, + height: 300 + }); + + this.adventureDeckDialogs[participantId] = adventureDeckDialog; + this.adventureDeckGroups[participantId] = new NormalCardGroup(adventureDeckDialog, function(card) { + return true; + }, false); + + this.adventureDeckGroups[participantId].setBounds(this.padding, this.padding, 580 - 2 * (this.padding), 250 - 2 * (this.padding)); + + adventureDeckDialog.bind("dialogresize", function() { + that.dialogResize(adventureDeckDialog, that.adventureDeckGroups[participantId]); + }); } for (var i = 0; i < this.allPlayerIds.length; i++) { @@ -1159,12 +1198,12 @@ var GempLotrGameUI = Class.extend({ if (!this.replayMode) { this.smallDialog.dialog("option", "buttons", - { - "OK": function() { - $(this).dialog("close"); - that.decisionFunction(id, $("#integerDecision").val()); - } - }); + { + "OK": function() { + $(this).dialog("close"); + that.decisionFunction(id, $("#integerDecision").val()); + } + }); } $("#integerDecision").SpinnerControl({ type: 'range', @@ -1202,12 +1241,12 @@ var GempLotrGameUI = Class.extend({ if (!this.replayMode) { this.smallDialog.dialog("option", "buttons", - { - "OK": function() { - that.smallDialog.dialog("close"); - that.decisionFunction(id, $("#multipleChoiceDecision").val()); - } - }); + { + "OK": function() { + that.smallDialog.dialog("close"); + that.decisionFunction(id, $("#multipleChoiceDecision").val()); + } + }); } } else { this.smallDialog.append("
"); @@ -1595,8 +1634,8 @@ var GempLotrGameUI = Class.extend({ $(div).find('LI.hover').removeClass('hover'); $(this).parent().addClass('hover'); }).mouseout(function() { - $(div).find('LI.hover').removeClass('hover'); - }); + $(div).find('LI.hover').removeClass('hover'); + }); var getRidOfContextMenu = function() { $(div).remove();