Ring is no longer needed (for Hobbit format games)

This commit is contained in:
marcin.sciesinski
2017-06-12 12:38:19 -07:00
parent f623c2bad7
commit 6707c2a7b3
3 changed files with 8 additions and 6 deletions

View File

@@ -105,7 +105,9 @@ public class GameState {
addPlayerCards(playerId, decks, library);
try {
_ringBearers.put(playerId, createPhysicalCardImpl(playerId, library, ringBearers.get(playerId)));
_rings.put(playerId, createPhysicalCardImpl(playerId, library, rings.get(playerId)));
String ringBlueprintId = rings.get(playerId);
if (ringBlueprintId != null)
_rings.put(playerId, createPhysicalCardImpl(playerId, library, ringBlueprintId));
} catch (CardNotFoundException exp) {
throw new RuntimeException("Unable to create game, due to either ring-bearer or ring being invalid cards");
}

View File

@@ -26,7 +26,8 @@ public class PlayRingBearerRingAndAddBurdersGameProcess implements GameProcess {
gameState.addCardToZone(game, ringBearer, Zone.FREE_CHARACTERS);
PhysicalCard ring = game.getGameState().getRing(playerId);
gameState.attachCard(game, ring, ringBearer);
if (ring != null)
gameState.attachCard(game, ring, ringBearer);
gameState.startPlayerTurn(playerId);
gameState.addBurdens(_bids.get(playerId));

View File

@@ -376,12 +376,11 @@ public class DefaultLotroFormat implements LotroFormat {
}
private void validateRing(LotroDeck deck) throws DeckInvalidException, CardNotFoundException {
// No Ring needed for Hobbit
if (_siteBlock == Block.HOBBIT)
return;
if (deck.getRing() == null)
//Additional Hobbit Draft exception
if (_siteBlock == Block.HOBBIT) {
} else {
throw new DeckInvalidException("Deck doesn't have a Ring");
}
LotroCardBlueprint ring = _library.getLotroCardBlueprint(deck.getRing());
if (ring.getCardType() != CardType.THE_ONE_RING)
throw new DeckInvalidException("Card assigned as Ring is not The One Ring");