Signet color on resistance.

This commit is contained in:
marcins78@gmail.com
2011-11-21 16:34:03 +00:00
parent b7734f2476
commit 019274f0d7
5 changed files with 168 additions and 100 deletions

View File

@@ -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<String> _leagueRares;

View File

@@ -91,7 +91,7 @@ public class EventSerializer {
Map<Integer, Integer> charVitalities = gameStats.getCharVitalities();
Map<Integer, Integer> charSiteNumbers = gameStats.getSiteNumbers();
Map<Integer, Integer> charResistances = gameStats.getCharResistances();
Map<Integer, String> charResistances = gameStats.getCharResistances();
StringBuilder charStr = new StringBuilder();
for (Map.Entry<Integer, Integer> characters : gameStats.getCharStrengths().entrySet()) {

View File

@@ -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<Integer, Integer> _charStrengths = new HashMap<Integer, Integer>();
private Map<Integer, Integer> _charVitalities = new HashMap<Integer, Integer>();
private Map<Integer, Integer> _siteNumbers = new HashMap<Integer, Integer>();
private Map<Integer, Integer> _charResistances = new HashMap<Integer, Integer>();
private Map<Integer, String> _charResistances = new HashMap<Integer, String>();
/**
* @return If the stats have changed
@@ -124,14 +126,33 @@ public class GameStats {
Map<Integer, Integer> newCharStrengths = new HashMap<Integer, Integer>();
Map<Integer, Integer> newCharVitalities = new HashMap<Integer, Integer>();
Map<Integer, Integer> newSiteNumbers = new HashMap<Integer, Integer>();
Map<Integer, Integer> newCharResistances = new HashMap<Integer, Integer>();
Map<Integer, String> newCharResistances = new HashMap<Integer, String>();
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<Integer, Integer> getCharResistances() {
public Map<Integer, String> getCharResistances() {
return _charResistances;
}

View File

@@ -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;

View File

@@ -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: ""});
}
}