summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-02 10:28:04 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:17 +0100
commit9a5318d4cdc5a18748e733975d57697d04dcc1ce (patch)
treeea5d49c155f3640032a3b2525c238f83113cd296
parentfc5a07b315414f1c34e702841a70e4621b51fe0a (diff)
downloadhammer-of-the-scots-9a5318d4cdc5a18748e733975d57697d04dcc1ce.tar.gz
Show turn info bar on all block games.
-rw-r--r--play.html2
-rw-r--r--rules.js1
-rw-r--r--ui.js1
3 files changed, 4 insertions, 0 deletions
diff --git a/play.html b/play.html
index 1d46bc5..e621218 100644
--- a/play.html
+++ b/play.html
@@ -21,6 +21,7 @@
.grid_top.your_turn { background-color: orange; }
.one .role_name { background-color: salmon; }
.two .role_name { background-color: skyblue; }
+.turn_info { background-color: gainsboro; }
.card {
width: 225px;
@@ -389,6 +390,7 @@ div.card_3{background-image:url('cards/card_3.jpg')}
</div>
</div>
+ <div class="turn_info">-</div>
</div>
<div class="grid_log">
diff --git a/rules.js b/rules.js
index 8d1bb82..13c3816 100644
--- a/rules.js
+++ b/rules.js
@@ -2887,6 +2887,7 @@ exports.view = function(state, current) {
let view = {
log: game.log,
year: game.year,
+ turn: 6 - (game.e_hand.length + (game.e_card ? 1 : 0)),
edward: game.edward,
e_vp: count_english_nobles(),
s_vp: count_scottish_nobles(),
diff --git a/ui.js b/ui.js
index f6dd5b0..592de2e 100644
--- a/ui.js
+++ b/ui.js
@@ -721,6 +721,7 @@ function on_update() {
document.getElementById("england_vp").textContent = game.e_vp;
document.getElementById("scotland_vp").textContent = game.s_vp;
+ document.querySelector(".turn_info").textContent = `Turn ${game.turn} of Year ${game.year}`;
update_cards();
update_map();