diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-04-12 18:27:27 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-04-12 18:27:27 +0200 |
commit | 8bf0d40a2649326f5da78c17342c60ab96b3dc18 (patch) | |
tree | 9b533cd1b0a8573d66cff09d0933e6511493dcdf | |
parent | ddd0520b63316ed91fe70b6981402fda9aafb2eb (diff) | |
download | vijayanagara-8bf0d40a2649326f5da78c17342c60ab96b3dc18.tar.gz |
Allow shorter routes for campaign.
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | events.txt | 2 | ||||
-rw-r--r-- | play.css | 2 | ||||
-rw-r--r-- | rules.js | 14 |
4 files changed, 16 insertions, 8 deletions
@@ -1,6 +1,8 @@ -default: rules.js +default: rules.js data.js +data.js: tools/gendata.js + node tools/gendata.js rules.js: events.txt sed -i -ne '/\/\/ === CONST ===/ {p; r const.js' -e ':a; n; /\/\/ === CONST ===/ {p; b}; ba}; p' rules.js sed '/const CODE /,$$d' < rules.js > /tmp/rules.js node tools/gencode.js >> /tmp/rules.js - cp /tmp/rules.js rules.js
\ No newline at end of file + cp /tmp/rules.js rules.js @@ -804,7 +804,7 @@ SUCC 0 log_succ DS "The Sultanate reimposes its dominance." campaign force_current BK - prompt "Gain Cavalry tokens equal to Influence and Forts." + prompt "Gain Cavalry equal to Influence and Forts." log_succ BK "Military labor market thrives." gain_cavalry (game.inf[BK] + count_pieces_on_map(BK, DISC)) force_current VE @@ -289,6 +289,8 @@ path.campaign { stroke: black; stroke-dasharray: 4 4; } .space.box { border-radius: 0%; } +.space.campaign { border-style: dotted; border-color: black; } + .space.action { border-color: lightgreen; box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black; background-color: rgb(144, 238, 144, 0.3); } .space.box.action.ds { border-color: rgb(88, 88, 88); box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black; background-color: rgba(168, 168, 167, 0.5); } .space.box.action.bk { border-color: rgb(15, 202, 187); box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black; background-color: rgba(17, 219, 199, 0.5); } @@ -2178,10 +2178,10 @@ function is_n_from_warangal(n, s) { states.campaign = { inactive: "Campaign", prompt() { - view.campaign_spaces = [...game.decree.campaign].sort((a, b) => a - b) + view.campaign_spaces = game.decree.campaign.slice().sort((a, b) => a - b) if (game.vm && game.vm.fp === 13) { - view.prompt = "Campaign: Select four contiguous spaces, finishing adjacent to Warangal." + view.prompt = "Campaign: Select a route up to four spaces long, finishing adjacent to Warangal." if (game.decree.campaign.length === 0) { for (let s = first_space; s <= last_space; ++s) { if (can_start_campaign_in_space(s) && is_n_from_warangal(3, s)) @@ -2192,9 +2192,11 @@ states.campaign = { if (!game.decree.campaign.includes(s) && is_n_from_warangal(3-game.decree.campaign.length, s)) gen_action_space(s) } + if (game.decree.campaign.length > 1 && is_n_from_warangal(1, game.decree.campaign.at(-1))) + view.actions.next = 1 } } else { - view.prompt = "Campaign: Select four contiguous spaces, from start to finish." + view.prompt = "Campaign: Select a route up to four spaces long, from start to finish." if (game.decree.campaign.length === 0) { for (let s = first_space; s <= last_space; ++s) { if (can_start_campaign_in_space(s) && is_campaign_succ(s)) @@ -2205,6 +2207,8 @@ states.campaign = { if (!game.decree.campaign.includes(s) && is_campaign_succ(s) && has_valid_campaign_connection(s)) gen_action_space(s) } + if (game.decree.campaign.length > 1) + view.actions.next = 1 } } @@ -2231,12 +2235,12 @@ states.campaign_moves = { inactive: "Campaign", prompt() { view.prompt = "Campaign: Move units along the campaign trail." - view.campaign_spaces = [...game.decree.campaign].sort((a, b) => a - b) + view.campaign_spaces = game.decree.campaign.slice().sort((a, b) => a - b) view.who = game.decree.selected for_each_movable(DS, p => { if ( - [...game.decree.campaign.slice(0, -1)].includes(piece_space(p)) && + game.decree.campaign.slice(0, -1).includes(piece_space(p)) && !set_has(game.decree.pieces, p) ) gen_action_piece(p) |