Commit ce03aec6 authored by Stuart John Watson's avatar Stuart John Watson

Started newGoal effect - added client selecting goal

parent e6cc9077
......@@ -134,6 +134,13 @@ Grid.prototype.doEffect = function(card,action){
return [card1.id,card2.id];
});
});
case "newGoal":
var goalOptions = goals.map(function(g,n){
return {text:g.name,value:g.id};
});
return getUserSelection("Select goal to replace",goalOptions).then(function(cardId){
return [cardId];
});
default:
return Promise.resolve([]);
}
......
......@@ -72,8 +72,8 @@ handlers.gridState = function(data){
game.grid.addCard(n.position,n.id);
});
data.goals.forEach(function(n) {
goals[n] = n.id;
var card = game.cardList[n.id];
goals[n.position] = card;
document.querySelectorAll("#demo-goals div")[n.position].innerHTML = "<strong>"+card.name+" ("+card.score+")</strong></br>"+card.condition;
});
game.render();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment