diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/packs/LeagueBoosterBox.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/packs/LeagueBoosterBox.java index cadb32403..176bd0f8e 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/packs/LeagueBoosterBox.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/packs/LeagueBoosterBox.java @@ -7,7 +7,7 @@ import com.gempukku.lotro.game.LotroCardBlueprintLibrary; import java.util.*; public class LeagueBoosterBox { - private Random _random = new Random(); + private Random _random = new Random(0); private LotroCardBlueprintLibrary _library; private List _leagueRares; 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 1cf46fa9a..a6a95bd87 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 @@ -91,7 +91,7 @@ public class EventSerializer { Map charVitalities = gameStats.getCharVitalities(); Map charSiteNumbers = gameStats.getSiteNumbers(); - Map charResistances = gameStats.getCharResistances(); + Map charResistances = gameStats.getCharResistances(); StringBuilder charStr = new StringBuilder(); for (Map.Entry characters : gameStats.getCharStrengths().entrySet()) { 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 5ab6f70e1..a7990b1c3 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 @@ -1,8 +1,10 @@ package com.gempukku.lotro.logic.timing; import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Signet; import com.gempukku.lotro.common.Zone; import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.LotroCardBlueprint; import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.Skirmish; @@ -32,7 +34,7 @@ public class GameStats { private Map _charStrengths = new HashMap(); private Map _charVitalities = new HashMap(); private Map _siteNumbers = new HashMap(); - private Map _charResistances = new HashMap(); + private Map _charResistances = new HashMap(); /** * @return If the stats have changed @@ -124,14 +126,33 @@ public class GameStats { Map newCharStrengths = new HashMap(); Map newCharVitalities = new HashMap(); Map newSiteNumbers = new HashMap(); - Map newCharResistances = new HashMap(); + Map newCharResistances = new HashMap(); for (PhysicalCard character : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.or(CardType.COMPANION, CardType.ALLY, CardType.MINION))) { newCharStrengths.put(character.getCardId(), game.getModifiersQuerying().getStrength(game.getGameState(), character)); newCharVitalities.put(character.getCardId(), game.getModifiersQuerying().getVitality(game.getGameState(), character)); - if (character.getBlueprint().getCardType() == CardType.MINION) + final LotroCardBlueprint blueprint = character.getBlueprint(); + if (blueprint.getCardType() == CardType.MINION) newSiteNumbers.put(character.getCardId(), game.getModifiersQuerying().getMinionSiteNumber(game.getGameState(), character)); - else - newCharResistances.put(character.getCardId(), game.getModifiersQuerying().getResistance(game.getGameState(), character)); + else { + final int resistance = game.getModifiersQuerying().getResistance(game.getGameState(), character); + if (blueprint.getCardType() == CardType.COMPANION) { + Signet signet = blueprint.getSignet(); + String resistanceStr; + if (signet == Signet.ARAGORN) + resistanceStr = "A" + resistance; + else if (signet == Signet.FRODO) + resistanceStr = "F" + resistance; + else if (signet == Signet.GANDALF) + resistanceStr = "G" + resistance; + else if (signet == Signet.THÉODEN) + resistanceStr = "T" + resistance; + else + resistanceStr = String.valueOf(resistance); + newCharResistances.put(character.getCardId(), resistanceStr); + } else { + newCharResistances.put(character.getCardId(), String.valueOf(resistance)); + } + } } if (!newCharStrengths.equals(_charStrengths)) { @@ -224,7 +245,7 @@ public class GameStats { return _siteNumbers; } - public Map getCharResistances() { + public Map getCharResistances() { return _charResistances; } 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 50af8ca8a..0fbf91436 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html @@ -120,6 +120,38 @@ body { color: #ffffff; } +.cardResistance.aragorn { + text-align: center; + background-color: #ffffff; + opacity: 1; + font-weight: bolder; + color: #000000; +} + +.cardResistance.frodo { + text-align: center; + background-color: #00ff00; + opacity: 1; + font-weight: bolder; + color: #000000; +} + +.cardResistance.gandalf { + text-align: center; + background-color: #ffc73d; + opacity: 1; + font-weight: bolder; + color: #000000; +} + +.cardResistance.theoden { + text-align: center; + background-color: purple; + opacity: 1; + font-weight: bolder; + color: #ffffff; +} + .selectableCard > .borderOverlay { border-color: #00af00; cursor: pointer; diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameAnimations.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameAnimations.js index 2d9e5156c..5ddbd2aeb 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameAnimations.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameAnimations.js @@ -71,40 +71,40 @@ var GameAnimations = Class.extend({ var cardWidth = card.getWidthForHeight(cardHeight); $(cardDiv).css( - { - position: "absolute", - left: (gameWidth / 2 - cardWidth / 4), - top: gameHeight * (3 / 8), - width: cardWidth / 2, - height: cardHeight / 2, - "z-index": 100, - opacity: 0}); + { + position: "absolute", + left: (gameWidth / 2 - cardWidth / 4), + top: gameHeight * (3 / 8), + width: cardWidth / 2, + height: cardHeight / 2, + "z-index": 100, + opacity: 0}); $(cardDiv).animate( - { - left: "-=" + cardWidth / 4, - top: "-=" + (gameHeight / 8), - width: "+=" + (cardWidth / 2), - height: "+=" + (cardHeight / 2), - opacity: 1}, - { - duration: that.getAnimationLength(that.playEventDuration / 8), - easing: "linear", - queue: false, - complete: next}); + { + left: "-=" + cardWidth / 4, + top: "-=" + (gameHeight / 8), + width: "+=" + (cardWidth / 2), + height: "+=" + (cardHeight / 2), + opacity: 1}, + { + duration: that.getAnimationLength(that.playEventDuration / 8), + easing: "linear", + queue: false, + complete: next}); }).queue( function(next) { setTimeout(next, that.getAnimationLength(that.playEventDuration * (5 / 8))); }).queue( function(next) { $(cardDiv).animate( - { - opacity: 0}, - { - duration: that.getAnimationLength(that.playEventDuration / 4), - easing: "easeOutQuart", - queue: false, - complete: next}); + { + opacity: 0}, + { + duration: that.getAnimationLength(that.playEventDuration / 4), + easing: "easeOutQuart", + queue: false, + complete: next}); }).queue( function(next) { $(cardDiv).remove(); @@ -158,26 +158,26 @@ var GameAnimations = Class.extend({ } $(cardDiv).css( - { - position: "absolute", - left: shadowStartPosX, - top: shadowStartPosY, - width: shadowWidth, - height: shadowHeight, - "z-index": 100, - opacity: 1}); + { + position: "absolute", + left: shadowStartPosX, + top: shadowStartPosY, + width: shadowWidth, + height: shadowHeight, + "z-index": 100, + opacity: 1}); $(cardDiv).animate( - { - opacity: 0, - left: "-=" + (shadowWidth / 2), - top: "-=" + (shadowHeight / 2), - width: "+=" + shadowWidth, - height: "+=" + shadowHeight}, - { - duration: that.getAnimationLength(that.cardAffectsCardDuration), - easing: "easeInQuart", - queue: false, - complete: null}); + { + opacity: 0, + left: "-=" + (shadowWidth / 2), + top: "-=" + (shadowHeight / 2), + width: "+=" + shadowWidth, + height: "+=" + shadowHeight}, + { + duration: that.getAnimationLength(that.cardAffectsCardDuration), + easing: "easeInQuart", + queue: false, + complete: null}); } } @@ -191,7 +191,7 @@ var GameAnimations = Class.extend({ $(this).remove(); } } - ); + ); next(); }); } @@ -267,29 +267,29 @@ var GameAnimations = Class.extend({ var cardWidth = card.getWidthForHeight(cardHeight); $(cardDiv).css( - { - position: "absolute", - left: (gameWidth / 2 - cardWidth / 4), - top: gameHeight * (3 / 8), - width: cardWidth / 2, - height: cardHeight / 2, - "z-index": 100, - opacity: 0}); + { + position: "absolute", + left: (gameWidth / 2 - cardWidth / 4), + top: gameHeight * (3 / 8), + width: cardWidth / 2, + height: cardHeight / 2, + "z-index": 100, + opacity: 0}); $(cardDiv).animate( - { - opacity: 1}, - { - duration: that.getAnimationLength(that.putCardIntoPlayDuration / 8), - easing: "linear", - step: function(now, fx) { - layoutCardElem(cardDiv, - (gameWidth / 2 - cardWidth / 4) - now * (cardWidth / 4), - gameHeight * (3 / 8) - now * (gameHeight / 8), - cardWidth / 2 + now * (cardWidth / 2), - cardHeight / 2 + now * (cardHeight / 2), 100); - }, - complete: next}); + { + opacity: 1}, + { + duration: that.getAnimationLength(that.putCardIntoPlayDuration / 8), + easing: "linear", + step: function(now, fx) { + layoutCardElem(cardDiv, + (gameWidth / 2 - cardWidth / 4) - now * (cardWidth / 4), + gameHeight * (3 / 8) - now * (gameHeight / 8), + cardWidth / 2 + now * (cardWidth / 2), + cardHeight / 2 + now * (cardHeight / 2), 100); + }, + complete: next}); }).queue( function(next) { setTimeout(next, that.getAnimationLength(that.putCardIntoPlayDuration * (5 / 8))); @@ -304,20 +304,20 @@ var GameAnimations = Class.extend({ var startHeight = cardDiv.height(); $(cardDiv).animate( - { - left: oldValues["left"]}, - { - duration: that.getAnimationLength(that.putCardIntoPlayDuration / 4), - easing: "linear", - step: function(now, fx) { - var state = fx.state; - layoutCardElem(cardDiv, - startLeft + (oldValues["left"] - startLeft) * state, - startTop + (oldValues["top"] - startTop) * state, - startWidth + (oldValues["width"] - startWidth) * state, - startHeight + (oldValues["height"] - startHeight) * state, 100); - }, - complete: next}); + { + left: oldValues["left"]}, + { + duration: that.getAnimationLength(that.putCardIntoPlayDuration / 4), + easing: "linear", + step: function(now, fx) { + var state = fx.state; + layoutCardElem(cardDiv, + startLeft + (oldValues["left"] - startLeft) * state, + startTop + (oldValues["top"] - startTop) * state, + startWidth + (oldValues["width"] - startWidth) * state, + startHeight + (oldValues["height"] - startHeight) * state, 100); + }, + complete: next}); }).queue( function(next) { var cardDiv = $(".card:cardId(" + cardId + ")"); @@ -353,7 +353,7 @@ var GameAnimations = Class.extend({ if (index != -1) cardData.attachedCards.splice(index, 1); } - ); + ); var card = $(".card:cardId(" + cardId + ")"); var cardData = card.data("card"); @@ -389,12 +389,12 @@ var GameAnimations = Class.extend({ function(next) { $(".card:cardId(" + cardRemovedIds + ")") .animate( - { - opacity: 0}, - { - duration: that.getAnimationLength(that.removeCardFromPlayDuration), - easing: "easeOutQuart", - queue: false}); + { + opacity: 0}, + { + duration: that.getAnimationLength(that.removeCardFromPlayDuration), + easing: "easeOutQuart", + queue: false}); setTimeout(next, that.getAnimationLength(that.removeCardFromPlayDuration)); }); } @@ -419,7 +419,7 @@ var GameAnimations = Class.extend({ if (index != -1) cardData.attachedCards.splice(index, 1); } - ); + ); } card.remove(); @@ -725,9 +725,24 @@ var GameAnimations = Class.extend({ $(".cardStrength", cardDiv).html(cardStatArr[0]).css({display: ""}); $(".cardVitality", cardDiv).html(cardStatArr[1]).css({display: ""}); if (cardStatArr.length > 2) { - if (cardStatArr[2].indexOf("R") == 0) - $(".cardResistance", cardDiv).html(cardStatArr[2].substring(1)).css({display: ""}); - else + if (cardStatArr[2].indexOf("R") == 0) { + var resistanceDiv = $(".cardResistance", cardDiv); + var resistance = cardStatArr[2].substring(1); + if (resistance.indexOf("A") == 0) { + resistanceDiv.addClass("aragorn"); + resistance = resistance.substring(1); + } else if (resistance.indexOf("F") == 0) { + resistanceDiv.addClass("frodo"); + resistance = resistance.substring(1); + } else if (resistance.indexOf("G") == 0) { + resistanceDiv.addClass("gandalf"); + resistance = resistance.substring(1); + } else if (resistance.indexOf("T") == 0) { + resistanceDiv.addClass("theoden"); + resistance = resistance.substring(1); + } + resistanceDiv.html(resistance).css({display: ""}); + } else $(".cardSiteNumber", cardDiv).html(cardStatArr[2]).css({display: ""}); } }