From 69ced937b6ef9fd501e43491ceb941d3624a5e3c Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 20 Nov 2011 03:56:34 +0000 Subject: [PATCH] - Added set 09 (Reflections). - Added "Movie block" format. --- .../cards/effects/CancelSkirmishEffect.java | 4 ++- .../com/gempukku/lotro/game/LotroFormat.java | 2 ++ .../com/gempukku/lotro/game/LotroServer.java | 36 +------------------ .../game/formats/DefaultLotroFormat.java | 9 ++++- .../lotro/game/formats/FotRBlockFormat.java | 2 +- .../lotro/game/formats/FreeFormat.java | 2 +- .../lotro/game/formats/KingBlockFormat.java | 2 +- .../lotro/game/formats/MovieFormat.java | 2 +- .../lotro/game/formats/TTTBlockFormat.java | 2 +- .../game/formats/TowersStandardFormat.java | 2 +- .../gempukku/lotro/league/LeagueFormat.java | 2 +- .../src/main/webapp/includes/changeLog.html | 2 ++ .../src/main/webapp/includes/formatRules.html | 15 ++++++++ 13 files changed, 38 insertions(+), 44 deletions(-) diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/CancelSkirmishEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/CancelSkirmishEffect.java index dec7bfb7a..e09405c6d 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/CancelSkirmishEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/CancelSkirmishEffect.java @@ -1,6 +1,7 @@ package com.gempukku.lotro.cards.effects; import com.gempukku.lotro.common.Filterable; +import com.gempukku.lotro.common.Keyword; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.timing.AbstractEffect; @@ -30,7 +31,8 @@ public class CancelSkirmishEffect extends AbstractEffect { public boolean isPlayableInFull(LotroGame game) { return game.getGameState().getSkirmish() != null && !game.getGameState().getSkirmish().isCancelled() - && (_involvementFilter == null || Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_involvementFilter, Filters.inSkirmish)) > 0); + && (_involvementFilter == null || Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_involvementFilter, Filters.inSkirmish)) > 0) + && (game.getFormat().canCancelRingBearerSkirmish() || !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Keyword.RING_BEARER, Filters.inSkirmish)); } @Override diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroFormat.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroFormat.java index cd09ffc1b..8804ae56d 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroFormat.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/LotroFormat.java @@ -5,6 +5,8 @@ import com.gempukku.lotro.logic.vo.LotroDeck; public interface LotroFormat { public boolean isOrderedSites(); + public boolean canCancelRingBearerSkirmish(); + public boolean hasMulliganRule(); public void validateDeck(LotroDeck deck) throws DeckInvalidException; diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroServer.java index 88b6f06d7..5ede754e7 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroServer.java @@ -43,7 +43,7 @@ public class LotroServer extends AbstractServer { _lotroCardBlueprintLibrary = library; _chatServer = chatServer; _defaultCollection = new DefaultCardCollection(library); - for (int i = 1; i <= 8; i++) { + for (int i = 1; i <= 10; i++) { for (int j = 1; j <= 365; j++) { String blueprintId = i + "_" + j; try { @@ -59,40 +59,6 @@ public class LotroServer extends AbstractServer { } } - for (int i = 10; i <= 10; i++) { - for (int j = 1; j <= 365; j++) { - String blueprintId = i + "_" + j; - try { - LotroCardBlueprint cardBlueprint = _lotroCardBlueprintLibrary.getLotroCardBlueprint(blueprintId); - CardType cardType = cardBlueprint.getCardType(); - if (cardType == CardType.SITE || cardType == CardType.THE_ONE_RING) - _defaultCollection.addCards(blueprintId, cardBlueprint, 1); - else - _defaultCollection.addCards(blueprintId, cardBlueprint, 4); - } catch (IllegalArgumentException exp) { - - } - } - } - - if (test) { - for (int i = 9; i <= 9; i++) { - for (int j = 1; j <= 365; j++) { - String blueprintId = i + "_" + j; - try { - LotroCardBlueprint cardBlueprint = _lotroCardBlueprintLibrary.getLotroCardBlueprint(blueprintId); - CardType cardType = cardBlueprint.getCardType(); - if (cardType == CardType.SITE || cardType == CardType.THE_ONE_RING) - _defaultCollection.addCards(blueprintId, cardBlueprint, 1); - else - _defaultCollection.addCards(blueprintId, cardBlueprint, 4); - } catch (IllegalArgumentException exp) { - - } - } - } - } - _playerDao = new PlayerDAO(dbAccess); _deckDao = new DeckDAO(dbAccess); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java index 71eec4d94..dea21836e 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java @@ -21,18 +21,20 @@ public abstract class DefaultLotroFormat implements LotroFormat { private boolean _validateShadowFPCount = true; private int _maximumSameName = 4; private boolean _mulliganRule; + private boolean _canCancelRingBearerSkirmish; private int _minimumDeckSize = 60; private Set _bannedCards = new HashSet(); private Set _restrictedCards = new HashSet(); private Set _validSets = new HashSet(); - public DefaultLotroFormat(LotroCardBlueprintLibrary library, Block siteBlock, boolean validateShadowFPCount, int minimumDeckSize, int maximumSameName, boolean mulliganRule) { + public DefaultLotroFormat(LotroCardBlueprintLibrary library, Block siteBlock, boolean validateShadowFPCount, int minimumDeckSize, int maximumSameName, boolean mulliganRule, boolean canCancelRingBearerSkirmish) { _library = library; _siteBlock = siteBlock; _validateShadowFPCount = validateShadowFPCount; _minimumDeckSize = minimumDeckSize; _maximumSameName = maximumSameName; _mulliganRule = mulliganRule; + _canCancelRingBearerSkirmish = canCancelRingBearerSkirmish; } @Override @@ -40,6 +42,11 @@ public abstract class DefaultLotroFormat implements LotroFormat { return _mulliganRule; } + @Override + public boolean canCancelRingBearerSkirmish() { + return _canCancelRingBearerSkirmish; + } + protected void addBannedCard(String baseBlueprintId) { _bannedCards.add(baseBlueprintId); } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FotRBlockFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FotRBlockFormat.java index 8742cd526..668ce0bdb 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FotRBlockFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FotRBlockFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class FotRBlockFormat extends DefaultLotroFormat { public FotRBlockFormat(LotroCardBlueprintLibrary library, boolean mulliganRule) { - super(library, Block.FELLOWSHIP, true, 60, 4, mulliganRule); + super(library, Block.FELLOWSHIP, true, 60, 4, mulliganRule, true); addRestrictedCard("1_248"); addValidSet(1); addValidSet(2); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FreeFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FreeFormat.java index 8461a4b24..f4abff101 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FreeFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/FreeFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class FreeFormat extends DefaultLotroFormat { public FreeFormat(LotroCardBlueprintLibrary library) { - super(library, Block.FELLOWSHIP, false, 0, Integer.MAX_VALUE, false); + super(library, Block.FELLOWSHIP, false, 0, Integer.MAX_VALUE, false, true); } @Override diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/KingBlockFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/KingBlockFormat.java index 4659f83b4..759b7bcb9 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/KingBlockFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/KingBlockFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class KingBlockFormat extends DefaultLotroFormat { public KingBlockFormat(LotroCardBlueprintLibrary library, boolean mulliganRule) { - super(library, Block.KING, true, 60, 4, mulliganRule); + super(library, Block.KING, true, 60, 4, mulliganRule, true); addRestrictedCard("7_49"); addValidSet(7); addValidSet(8); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/MovieFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/MovieFormat.java index 9fece9204..e23a541de 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/MovieFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/MovieFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class MovieFormat extends DefaultLotroFormat { public MovieFormat(LotroCardBlueprintLibrary library) { - super(library, Block.KING, true, 60, 4, true); + super(library, Block.KING, true, 60, 4, true, false); addBannedCard("8_1"); addBannedCard("3_38"); addBannedCard("3_106"); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TTTBlockFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TTTBlockFormat.java index 92196d7c9..e735236b2 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TTTBlockFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TTTBlockFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class TTTBlockFormat extends DefaultLotroFormat { public TTTBlockFormat(LotroCardBlueprintLibrary library, boolean mulliganRule) { - super(library, Block.TWO_TOWERS, true, 60, 4, mulliganRule); + super(library, Block.TWO_TOWERS, true, 60, 4, mulliganRule, true); addValidSet(4); addValidSet(5); addValidSet(6); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TowersStandardFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TowersStandardFormat.java index 072d45b03..c05ed9eb3 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TowersStandardFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/TowersStandardFormat.java @@ -5,7 +5,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; public class TowersStandardFormat extends DefaultLotroFormat { public TowersStandardFormat(LotroCardBlueprintLibrary library) { - super(library, Block.TWO_TOWERS, true, 60, 4, true); + super(library, Block.TWO_TOWERS, true, 60, 4, true, true); addBannedCard("1_40"); addBannedCard("1_45"); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueFormat.java index 74aa6bceb..942dba253 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/league/LeagueFormat.java @@ -8,7 +8,7 @@ public class LeagueFormat extends DefaultLotroFormat { private boolean _orderedSites; public LeagueFormat(LotroCardBlueprintLibrary library, boolean orderedSites) { - super(library, Block.FELLOWSHIP, true, 60, Integer.MAX_VALUE, true); + super(library, Block.FELLOWSHIP, true, 60, Integer.MAX_VALUE, true, true); _orderedSites = orderedSites; } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index 19c2cb822..213ab781c 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -4,6 +4,8 @@ - "Nine-fingered Frodo and the Ring of Doom" no longer freezes the game if removing threats is used. - "Corsair Marauder" and all similar minions from Siege of Gondor now put the tokens on the card with tokens, rather than on itself. +- Added set 09 (Reflections). +- Added "Movie block" format. 17 Nov. 2011 - "Foul Things" allows to play only MORIA minions now. diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/formatRules.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/formatRules.html index 57d1ad6e2..f0bd209cb 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/formatRules.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/formatRules.html @@ -66,3 +66,18 @@
  • R-list has one card - Steadfast Champion,
  • Mulligan rule IS in effect.
  • +Movie block +
      +
    • cards from sets 01-10 are legal,
    • +
    • sites from King block are used,
    • +
    • Ring-bearer skirmish CAN NOT be cancelled,
    • +
    • X-list contains following cards: Aggression, Aragorn, Heir to the White City, Bill the + Pony, Elrond, Lord of Rivendell, Flaming Brand, Forces of Mordor, Frying Pan, + Galadriel, Lady of Light, Gondorian Captain, Horn of Boromir, Memories of Darkness, + Mordor Fiend, No Stranger to the Shadows, Ottar, Man of Laketown, The Palantir + of Orthanc, Relics of Moria, Saruman, Keeper of Isengard, Savagery to Match Their + Numbers, Steadfast Champion, Sting, Ulaire Nertea, Messenger of Dol Guldur, +
    • +
    • there is no R-list,
    • +
    • Mulligan rule IS in effect.
    • +