diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/EventSerializer.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/EventSerializer.java index 7977e3386..f2a587628 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/EventSerializer.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/EventSerializer.java @@ -57,6 +57,8 @@ public class EventSerializer { eventElem.setAttribute("message", gameEvent.getMessage()); if (gameEvent.getGameStats() != null) { GameStats gameStats = gameEvent.getGameStats(); + if (gameStats.getWearingRing() != null) + eventElem.setAttribute("wearingRing", String.valueOf(gameStats.getWearingRing())); eventElem.setAttribute("fellowshipArchery", String.valueOf(gameStats.getFellowshipArchery())); eventElem.setAttribute("shadowArchery", String.valueOf(gameStats.getShadowArchery())); 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 11716a4f8..aee9f6dfd 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 @@ -16,6 +16,8 @@ import java.util.HashMap; import java.util.Map; public class GameStats { + private Integer wearingRing; + private Integer _fellowshipArchery; private Integer _shadowArchery; @@ -42,6 +44,16 @@ public class GameStats { */ public boolean updateGameStats(LotroGame game) { boolean changed = false; + PlayerOrder playerOrder = game.getGameState().getPlayerOrder(); + + final PhysicalCard ringBearer = game.getGameState().getRingBearer(game.getGameState().getCurrentPlayerId()); + if (game.getGameState().isWearingRing() && (wearingRing == null || wearingRing != ringBearer.getCardId())) { + changed = true; + wearingRing = ringBearer.getCardId(); + } else if (!game.getGameState().isWearingRing() && wearingRing != null) { + changed = true; + wearingRing = null; + } if (game.getGameState().getCurrentPhase() == Phase.ARCHERY) { int newFellowshipArcheryTotal = RuleUtils.calculateFellowshipArcheryTotal(game); @@ -115,7 +127,6 @@ public class GameStats { } Map> newZoneSizes = new HashMap>(); - PlayerOrder playerOrder = game.getGameState().getPlayerOrder(); if (playerOrder != null) { for (String player : playerOrder.getAllPlayers()) { final HashMap playerZoneSizes = new HashMap(); @@ -199,6 +210,10 @@ public class GameStats { return changed; } + public Integer getWearingRing() { + return wearingRing; + } + public Integer getFellowshipArchery() { return _fellowshipArchery; } @@ -261,6 +276,7 @@ public class GameStats { public GameStats makeACopy() { GameStats copy = new GameStats(); + copy.wearingRing = wearingRing; copy._fellowshipArchery = _fellowshipArchery; copy._fellowshipSkirmishStrength = _fellowshipSkirmishStrength; copy._fellowshipSkirmishDamageBonus = _fellowshipSkirmishDamageBonus;