Ring is no longer needed (for Hobbit format games)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user