diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_126.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_126.java index 090130058..e42fc7691 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_126.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_126.java @@ -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 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 diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html index 8989ca6e9..2bd64933a 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html @@ -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); }, 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 f62710449..43407dc0d 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html @@ -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); + }); }); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js index ec9f26d5c..a76794c4c 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js @@ -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" });