summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-05-01 01:03:10 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:31:29 +0100
commit000afc92225d617239f3173183a92a63ef345075 (patch)
tree1deae0d1ee408cbd7b1ebd4e4afc6638e6f7fc51
parentd49a2f4e69decb2d1afa78431b5b69cd7d51be77 (diff)
downloadpax-pamir-000afc92225d617239f3173183a92a63ef345075.tar.gz
Nation building.
-rw-r--r--rules.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 9e1e2ef..453f530 100644
--- a/rules.js
+++ b/rules.js
@@ -5,7 +5,6 @@
// TODO: safe house passive
-// TODO: nation building - player or global?
// TODO: confidence failure
let cards = require("./cards.js");
@@ -1227,6 +1226,8 @@ const card_action_table = {
Build() {
game.count = Math.min(3, Math.floor(player.coins / 2));
+ if (player.events.nation_building)
+ game.count *= 2;
game.selected = select_available_block();
game.state = 'build';
},
@@ -1370,7 +1371,8 @@ states.build = {
prompt() {
view.prompt = `Build up to ${game.count} armies and/or roads.`;
gen_action('next');
- if (player.coins >= 2) {
+ let must_pay = !player.events.nation_building || (game.count & 1) === 0;
+ if (!must_pay || player.coins >= 2) {
if (game.selected < 0) {
gen_select_block();
} else {
@@ -1390,7 +1392,11 @@ states.build = {
},
space(s) {
push_undo();
- pay_action_cost(2);
+
+ let must_pay = !player.events.nation_building || (game.count & 1) === 0;
+ if (must_pay)
+ pay_action_cost(2);
+
if (s <= last_region)
log(`${player.loyalty} army to ${region_names[s]}.`);
else
@@ -1398,7 +1404,10 @@ states.build = {
game.pieces[game.selected] = s;
game.used_pieces.push(game.selected);
game.selected = -1;
- if (--game.count === 0)
+ --game.count;
+
+ must_pay = !player.events.nation_building || (game.count & 1) === 0;
+ if (game.count === 0 || (must_pay && player.coins < 2))
end_build_action();
else
game.selected = select_available_block();