summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.html2
-rw-r--r--rules.js10
-rw-r--r--ui.js2
3 files changed, 8 insertions, 6 deletions
diff --git a/play.html b/play.html
index 89ad1bb..655c230 100644
--- a/play.html
+++ b/play.html
@@ -298,10 +298,12 @@
<div class="grid_role">
<div class="role one">
+ <div class="role_vp" id="tr_score">0</div>
<div class="role_name">Tripolitania (<span class="role_user">$USER</span>)</div>
<div class="role_info" id="tr_info">0 cards in hand</div>
</div>
<div class="role two">
+ <div class="role_vp" id="us_score">30</div>
<div class="role_name">United States (<span class="role_user">$USER</span>)</div>
<div class="role_info" id="us_info">0 cards in hand</div>
</div>
diff --git a/rules.js b/rules.js
index 04571a5..ca2d8a5 100644
--- a/rules.js
+++ b/rules.js
@@ -1,11 +1,5 @@
"use strict";
-// [x]: summarize naval movements
-// [x]: summarize pirate raids
-// [ ]: summarize naval bombardments
-// [ ]: summarize naval combat
-// [ ]: summarize ground combat
-
const US = "United States";
const TR = "Tripolitania";
@@ -2782,6 +2776,8 @@ exports.resign = function (state, current) {
exports.view = function(state, current) {
game = state;
+ let tr_score = count_american_frigates(TRIPOLITAN_SUPPLY) * 3 + game.tr.gold;
+
let view = {
log: game.log,
year: game.year,
@@ -2797,12 +2793,14 @@ exports.view = function(state, current) {
discard: game.tr.discard.length + (game.tr.queue ? game.tr.queue.length : 0),
hand: game.tr.hand.length,
gold: game.tr.gold,
+ score: tr_score,
},
us: {
core: game.us.core,
draw: game.us.draw.length,
discard: game.us.discard.length + (game.us.queue ? game.us.queue.length : 0),
hand: game.us.hand.length,
+ score: 30 - tr_score,
},
card: game.active_card,
removed: game.removed,
diff --git a/ui.js b/ui.js
index e5adacf..32b1a33 100644
--- a/ui.js
+++ b/ui.js
@@ -184,6 +184,8 @@ function on_update() {
show_action_button("#button_next", "next");
show_action_button("#button_undo", "undo");
+ document.getElementById("tr_score").textContent = game.tr.score;
+ document.getElementById("us_score").textContent = game.us.score;
document.getElementById("tr_info").textContent = tr_info();
document.getElementById("us_info").textContent = us_info();