A few fixes, here and there.

This commit is contained in:
marcins78@gmail.com
2011-09-14 18:21:14 +00:00
parent 14aa919996
commit 3c4c3add3a
5 changed files with 53 additions and 55 deletions

View File

@@ -20,6 +20,6 @@ public class RequiredTriggerAction extends DefaultCostToEffectAction {
@Override @Override
protected String getMessage() { protected String getMessage() {
return _physicalCard.getBlueprint().getName() + " optional triggered effect is used"; return _physicalCard.getBlueprint().getName() + " required triggered effect is used";
} }
} }

View File

@@ -27,7 +27,7 @@ public class KillEffect extends AbstractEffect {
@Override @Override
public String getText() { public String getText() {
return "Kills character"; return "Kill " + _card.getBlueprint().getName();
} }
@Override @Override

View File

@@ -34,7 +34,7 @@ public class OverwhelmedEffect extends AbstractEffect {
@Override @Override
public EffectResult playEffect(LotroGame game) { public EffectResult playEffect(LotroGame game) {
game.getGameState().sendMessage("Skirmish finishes with an overwhelming"); game.getGameState().sendMessage("Skirmish finishes with an overwhelm");
return new OverwhelmSkirmishResult(_winners, _losers); return new OverwhelmSkirmishResult(_winners, _losers);
} }
} }

View File

@@ -127,17 +127,21 @@ public class DefaultLotroGame implements LotroGame {
// Ring-bearer death // Ring-bearer death
if (!Filters.canSpot(gameState, getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER))) { if (!Filters.canSpot(gameState, getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER))) {
playerLost(getGameState().getCurrentPlayerId(), "The Ring-Bearer is dead"); playerLost(getGameState().getCurrentPlayerId(), "The Ring-Bearer is dead");
} return;
// Ring-bearer corruption } else {
PhysicalCard ringBearer = Filters.findFirstActive(getGameState(), getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER)); // Ring-bearer corruption
int ringBearerResistance = ringBearer.getBlueprint().getResistance(); PhysicalCard ringBearer = Filters.findFirstActive(getGameState(), getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER));
if (getGameState().getBurdens() >= ringBearerResistance) { int ringBearerResistance = ringBearer.getBlueprint().getResistance();
playerLost(getGameState().getCurrentPlayerId(), "The Ring-Bearer is corrupted"); if (getGameState().getBurdens() >= ringBearerResistance) {
playerLost(getGameState().getCurrentPlayerId(), "The Ring-Bearer is corrupted");
return;
}
} }
// Fellowship in regroup at the last site // Fellowship in regroup at the last site
if (getGameState().getCurrentPhase() == Phase.REGROUP if (getGameState().getCurrentPhase() == Phase.REGROUP
&& getGameState().getCurrentSiteNumber() == 9) { && getGameState().getCurrentSiteNumber() == 9) {
playerWon(getGameState().getCurrentPlayerId(), "Surviving to Regroup phase on site 9"); playerWon(getGameState().getCurrentPlayerId(), "Surviving to Regroup phase on site 9");
return;
} }
} }
} }

View File

@@ -90,7 +90,7 @@ var GempLotrGameUI = Class.extend({
this.specialGroup = new NormalCardGroup(this.dialogInstance, function(card) { this.specialGroup = new NormalCardGroup(this.dialogInstance, function(card) {
return (card.zone == "SPECIAL"); return (card.zone == "SPECIAL");
}, false); }, false);
this.specialGroup.setBounds(this.padding, this.padding, 400, 200); this.specialGroup.setBounds(this.padding, this.padding, this.dialogInstance.width() + 20, this.dialogInstance.height() + 20);
this.gameStateElem = $("<div class='ui-widget-content'></div>"); this.gameStateElem = $("<div class='ui-widget-content'></div>");
this.gameStateElem.css({"border-radius": "7px"}); this.gameStateElem.css({"border-radius": "7px"});
@@ -167,31 +167,34 @@ var GempLotrGameUI = Class.extend({
initializeDialogs: function() { initializeDialogs: function() {
this.dialogInstance = $("<div></div>") this.dialogInstance = $("<div></div>")
.dialog({ .dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
resizable: true, resizable: true,
minHeight: 80 width: 600,
}); height: 300
});
this.dialogInstance.bind("resize", function() { var that = this;
var width = $(this).width();
var height = $(this).height(); this.dialogInstance.bind("dialogresize", function() {
this.specialGroup.setBounds(this.padding, this.padding, width - 2 * this.padding, height - 2 * this.padding); var width = $(this).width() + 20;
var height = $(this).height() + 20;
that.specialGroup.setBounds(that.padding, that.padding, width - 2 * that.padding, height - 2 * that.padding);
}); });
$(".ui-dialog-titlebar-close").hide(); $(".ui-dialog-titlebar-close").hide();
this.infoDialog = $("<div></div>") this.infoDialog = $("<div></div>")
.dialog({ .dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: true, closeOnEscape: true,
resizable: true, resizable: true,
title: "Card information", title: "Card information",
minHeight: 80, minHeight: 80,
minWidth: 200, minWidth: 200,
width: 600, width: 600,
height: 300 height: 300
}); });
}, },
@@ -484,7 +487,7 @@ var GempLotrGameUI = Class.extend({
if (index != -1) if (index != -1)
cardData.attachedCards.splice(index, 1); cardData.attachedCards.splice(index, 1);
} }
); );
var card = $(".card:cardId(" + cardId + ")"); var card = $(".card:cardId(" + cardId + ")");
var cardData = card.data("card"); var cardData = card.data("card");
@@ -547,7 +550,7 @@ var GempLotrGameUI = Class.extend({
if (index != -1) if (index != -1)
cardData.attachedCards.splice(index, 1); cardData.attachedCards.splice(index, 1);
} }
); );
} }
card.remove(); card.remove();
@@ -614,16 +617,13 @@ var GempLotrGameUI = Class.extend({
this.dialogInstance this.dialogInstance
.html(text + "<br /><input id='integerDecision' type='text' value='0'>") .html(text + "<br /><input id='integerDecision' type='text' value='0'>")
.dialog("option", "buttons", .dialog("option", "buttons",
{ {
"OK": function() { "OK": function() {
$(this).dialog("close"); $(this).dialog("close");
that.decisionFunction(id, $("#integerDecision").val()); that.decisionFunction(id, $("#integerDecision").val());
} }
} }
) );
.dialog("option", "width", "400")
.dialog("option", "height", "auto");
;
$("#integerDecision").SpinnerControl({ type: 'range', $("#integerDecision").SpinnerControl({ type: 'range',
typedata: { typedata: {
@@ -654,15 +654,13 @@ var GempLotrGameUI = Class.extend({
this.dialogInstance this.dialogInstance
.html(html) .html(html)
.dialog("option", "buttons", .dialog("option", "buttons",
{ {
"OK": function() { "OK": function() {
$(this).dialog("close"); $(this).dialog("close");
that.decisionFunction(id, $("#multipleChoiceDecision").val()); that.decisionFunction(id, $("#multipleChoiceDecision").val());
} }
} }
) );
.dialog("option", "width", "400")
.dialog("option", "height", "auto");
this.dialogInstance.dialog("open"); this.dialogInstance.dialog("open");
}, },
@@ -712,9 +710,7 @@ var GempLotrGameUI = Class.extend({
this.dialogInstance this.dialogInstance
.html("<div id='arbitraryChoice'></div>") .html("<div id='arbitraryChoice'></div>")
.dialog("option", "title", text) .dialog("option", "title", text)
.dialog("option", "buttons", {}) .dialog("option", "buttons", {});
.dialog("option", "width", "600")
.dialog("option", "height", "300");
var finishChoice = function() { var finishChoice = function() {
that.dialogInstance.dialog("close"); that.dialogInstance.dialog("close");
@@ -852,9 +848,7 @@ var GempLotrGameUI = Class.extend({
this.dialogInstance this.dialogInstance
.html("<div id='arbitraryChoice'></div>") .html("<div id='arbitraryChoice'></div>")
.dialog("option", "title", text) .dialog("option", "title", text)
.dialog("option", "buttons", {}) .dialog("option", "buttons", {});
.dialog("option", "width", "600")
.dialog("option", "height", "300");
var cardIds = new Array(); var cardIds = new Array();