From 705c52e7310736e17c152081fa9640dea4ddcc78 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:49:59 +0100 Subject: campaigning prompt improvement --- rules.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 20703de..b270820 100644 --- a/rules.js +++ b/rules.js @@ -1482,7 +1482,7 @@ states.campaigning_assign = { inactive: "do Campaigning.", prompt() { let die = game.roll[game.campaigning.dice_idx] - view.prompt = `Campaigning: Assign ${die} to a Campaigner.` + view.prompt = `Campaigning: Assign ${pluralize(die, 'cube')} to a Campaigner.` for_each_player_campaigner(c => { if (!set_has(game.campaigning.assigned, c)) @@ -1535,7 +1535,7 @@ function filter_us_states(us_states) { states.campaigning_add_cubes = { inactive: "do Campaigning.", prompt() { - let has_opponent_cubes = false + // let has_opponent_cubes = false let can_move = false if (!game.campaigning.added && player_buttons() > 0 && !game.campaigning.moved) { gen_action("move") @@ -1547,7 +1547,7 @@ states.campaigning_add_cubes = { for (let s of us_states) { if (opponent_cubes(s)) { - has_opponent_cubes = true + // has_opponent_cubes = true if (game.active === SUF) { gen_action_red_cube(s) } else { @@ -1563,13 +1563,14 @@ states.campaigning_add_cubes = { if (us_states.length) { - view.prompt = `Campaigning: Add a ${COLOR_NAMES[campaigner_color(game.selected_campaigner)]} cube.` - if (has_opponent_cubes) - view.prompt += " or remove an Opponent's cube" + view.prompt = `Campaigning: Add a ${COLOR_NAMES[campaigner_color(game.selected_campaigner)]} cube` + // if (has_opponent_cubes) + // view.prompt += " or remove an Opponent's cube" if (can_move) { view.prompt += " or Move to another Region" } - view.prompt += "." + let remaining = game.campaigning.count - game.campaigning.added + view.prompt += `. ${pluralize(remaining, 'cube')} remaining.` } else { view.prompt = `Campaigning: No available States to add a ${COLOR_NAMES[campaigner_color(game.selected_campaigner)]} cube.` gen_action("done") @@ -2418,10 +2419,10 @@ states.vm_add_cubes = { }) } - let has_opponent_cubes = false + // let has_opponent_cubes = false for (let s of game.vm.us_states) { if (opponent_cubes(s)) { - has_opponent_cubes = true + // has_opponent_cubes = true if (game.active === SUF) { gen_action_red_cube(s) } else { @@ -2436,15 +2437,13 @@ states.vm_add_cubes = { } if (!game.vm.cube_color) { - if (!has_opponent_cubes) - event_prompt("Choose a cube color to add.") - else - event_prompt("Choose a cube color to add or remove an Opponent's cube.") + event_prompt("Choose a cube color to add.") + // if (has_opponent_cubes) + // event_prompt("Choose a cube color to add or remove an Opponent's cube.") } else { - if (!has_opponent_cubes) - event_prompt(`Add a ${COLOR_NAMES[game.vm.cube_color]} cube.`) - else - event_prompt(`Add a ${COLOR_NAMES[game.vm.cube_color]} cube or remove an Opponent's cube.`) + event_prompt(`Add a ${COLOR_NAMES[game.vm.cube_color]} cube.`) + // if (has_opponent_cubes) + // event_prompt(`Add a ${COLOR_NAMES[game.vm.cube_color]} cube or remove an Opponent's cube.`) } }, purple() { -- cgit v1.2.3