summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.js12
-rw-r--r--rules.js5
-rw-r--r--ui.js13
3 files changed, 24 insertions, 6 deletions
diff --git a/data.js b/data.js
index 780dd50..c6a7ad8 100644
--- a/data.js
+++ b/data.js
@@ -103,13 +103,13 @@ const TOWNS = {
"England1":{"x":139,"y":873},
"England2":{"x":140,"y":961},
"England3":{"x":138,"y":1047},
- "FP":{"x":120,"y":2150},
- "SP":{"x":120,"y":2150},
- "Dead":{"x":120,"y":2150},
*/
"Germania":{"x":139,"y":273},
"France":{"x":140,"y":573},
"England":{"x":139,"y":873},
+ "FP":{"x":50,"y":2150},
+ "SP":{"x":50,"y":2150},
+ "Dead":{"x":50,"y":80},
};
const PORTS = [];
@@ -252,10 +252,12 @@ const PORTS = [];
town('X', 0, 0, 0, "Staging", "Germania1", 0, "staging");
town('X', 0, 0, 0, "Staging", "Germania2", 0, "staging");
town('X', 0, 0, 0, "Staging", "Germania3", 0, "staging");
- town('X', 0, 0, 0, "Pool", "FP", 0, "pool", "N", 12);
- town('X', 0, 0, 0, "Pool", "SP", 0, "pool", "N", 12);
*/
+ town('Y', 0.0, 0.0, 30, "Pool", "FP", 0, "pool");
+ town('Y', 0.0, 0.0, 30, "Pool", "SP", 0, "pool");
+ town('Y', 1.0, 1.0, 30, "Pool", "Dead", 0, "pool");
+
town('X', 0.5, 0.5, 3, "Staging", "England", 0, "staging");
town('X', 0.5, 0.5, 3, "Staging", "France", 0, "staging");
town('X', 0.5, 0.5, 3, "Staging", "Germania", 0, "staging");
diff --git a/rules.js b/rules.js
index 02f4398..3ae1924 100644
--- a/rules.js
+++ b/rules.js
@@ -49,6 +49,11 @@ const RESERVE_MARK_1 = "\u2020";
const RESERVE_MARK_2 = "\u2021";
const NO_MARK = "";
+// Only used by UI layer for layout. remove from game logic.
+delete TOWNS[DEAD];
+delete TOWNS[F_POOL];
+delete TOWNS[S_POOL];
+
let states = {};
let game = null;
diff --git a/ui.js b/ui.js
index b5a0e02..e9c1d11 100644
--- a/ui.js
+++ b/ui.js
@@ -537,8 +537,20 @@ function update_map() {
let info = BLOCKS[b];
let element = ui.blocks[b];
let town = game.location[b];
+
+ if ((town == F_POOL && player != FRANKS) || (town == S_POOL && player != SARACENS)) {
+ hide_block(element);
+ continue;
+ }
+ if (town == DEAD && player != info.owner) {
+ hide_block(element)
+ continue;
+ }
+
if (town in TOWNS) {
let moved = game.moved[b] ? " moved" : "";
+ if (town == DEAD)
+ moved = " moved";
if (info.owner == player || info.owner == ASSASSINS) {
let image = " known block_" + info.image;
let steps = " r" + (info.steps - game.steps[b]);
@@ -584,7 +596,6 @@ function update_map() {
}
function update_card_display(element, card, prior_card) {
- console.log("update_card_display", element, card, prior_card);
if (!card && !prior_card) {
element.className = "small_card card_back";
} else if (prior_card) {