Preparation for deck building.

This commit is contained in:
marcins78@gmail.com
2011-09-03 20:42:06 +00:00
parent 82e9f4b9f0
commit f3603f5a97
4 changed files with 19 additions and 20 deletions

View File

@@ -2,12 +2,12 @@ package com.gempukku.lotro.cards.set1.isengard;
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.timing.Action;
@@ -37,7 +37,7 @@ public class Card1_126 extends AbstractLotroCardBlueprint {
@Override
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canPlayShadowCardDuringPhase(game, Phase.MANEUVER, self)) {
final CostToEffectAction action = new CostToEffectAction(self, Keyword.MANEUVER, "Make an Uruk-hai fierce until the regroup phase.");
final PlayEventAction action = new PlayEventAction(self);
action.addEffect(
new ChooseActiveCardEffect(playerId, "Choose an Uruk-hai", Filters.keyword(Keyword.URUK_HAI)) {
@Override

View File

@@ -98,9 +98,7 @@
$(document).ready(
function () {
ui = new GempLotrUI();
communication = new GempLotrCommunication("/gemp-lotr/server/game/" + getUrlParam("gameId"),
communication = new GempLotrCommunication("/gemp-lotr/server",
function(xml) {
ui.processXml(xml);
},

View File

@@ -103,17 +103,18 @@
ui = new GempLotrUI();
communication = new GempLotrCommunication("/gemp-lotr/server",
function(xml) {
ui.processXml(xml);
},
function() {
ui.processError();
});
ui.setUpdateState(function() {
communication.updateGameState();
communication.updateGameState(function(xml) {
ui.processXml(xml);
});
});
ui.setDecisionFunction(function(decisionId, result) {
communication.gameDecisionMade(decisionId, result);
communication.gameDecisionMade(decisionId, result, function(xml) {
ui.processXml(xml);
});
});
ui.setGetCardModifiers(function(cardId, func) {
communication.getGameCardModifiers(cardId, func);
@@ -124,7 +125,9 @@
ui.layoutUI();
});
communication.startGameSession();
communication.startGameSession(function(xml) {
ui.processXml(xml);
});
});
</script>

View File

@@ -1,32 +1,30 @@
var GempLotrCommunication = Class.extend({
url: null,
success: null,
failure: null,
init: function(url, success, failure) {
init: function(url, failure) {
this.url = url;
this.success = success;
this.failure = failure;
},
startGameSession: function() {
startGameSession: function(callback) {
$.ajax({
type: "GET",
url: this.url + "/game/" + getUrlParam("gameId"),
cache: false,
data: { participantId: getUrlParam("participantId") },
success: this.success,
success: callback,
error: this.failure,
dataType: "xml"
});
},
updateGameState: function() {
updateGameState: function(callback) {
$.ajax({
type: "POST",
url: this.url + "/game/" + getUrlParam("gameId"),
cache: false,
data: { participantId: getUrlParam("participantId") },
success: this.success,
success: callback,
error: this.failure,
dataType: "xml"
});
@@ -43,7 +41,7 @@ var GempLotrCommunication = Class.extend({
dataType: "html"
});
},
gameDecisionMade: function(decisionId, response) {
gameDecisionMade: function(decisionId, response, callback) {
$.ajax({
type: "POST",
url: this.url + "/game/" + getUrlParam("gameId"),
@@ -52,7 +50,7 @@ var GempLotrCommunication = Class.extend({
participantId: getUrlParam("participantId"),
decisionId: decisionId,
decisionValue: response},
success: this.success,
success: callback,
error: this.failure,
dataType: "xml"
});