summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-06 00:24:30 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-21 00:28:20 +0200
commit088861114cf3620507c8de8b6c0a7e5d26644b46 (patch)
treea8862894480c897b9a2bebb6abac8627361184a9
parent38062a15ba3981f8b8f6d8775075ec903d5250f4 (diff)
downloadwashingtons-war-088861114cf3620507c8de8b6c0a7e5d26644b46.tar.gz
inactive prompts
-rw-r--r--about.html7
-rw-r--r--rules.js62
2 files changed, 66 insertions, 3 deletions
diff --git a/about.html b/about.html
index 0b1cf2f..41f1cfd 100644
--- a/about.html
+++ b/about.html
@@ -1,6 +1,9 @@
<p>
-Unlicensed game prototype!
-
+Washington's War is a two player, strategic level simulation of the American
+Revolution. By way of the game mechanics, the players attempt to initiate,
+control, weather or exploit a wide variety of diplomatic, political, cultural
+and military events in order to either help the United States win its
+independence or to retain the 13 colonies as British dominions.
<ul>
<li><a href="/washingtons-war/info/rulebook.html">Rulebook</a>
diff --git a/rules.js b/rules.js
index b1227d5..46c727e 100644
--- a/rules.js
+++ b/rules.js
@@ -1093,6 +1093,7 @@ function goto_start_year() {
}
states.british_declare_first = {
+ inactive: "to declare first player",
prompt() {
view.prompt = "Declare yourself as the first player by playing a campaign card?"
view.actions.pass = 1
@@ -1121,6 +1122,7 @@ states.british_declare_first = {
}
states.choose_first_player = {
+ inactive: "to declare first player",
prompt() {
view.prompt = "Choose who will play the first strategy card."
view.actions.america_first = 1
@@ -1369,6 +1371,7 @@ function end_strategy_card() {
}
states.end_strategy_card = {
+ inactive: "to finish the card play",
prompt() {
view.prompt = "Card play done."
view.actions.next = 1
@@ -1411,6 +1414,7 @@ function clear_queue() {
/* DISCARD EVENT CARD FOR PC ACTION */
states.discard_event_pc_action = {
+ inactive: "to take a PC action",
prompt() {
view.prompt = "Place, flip, or remove PC marker."
view.actions.pass = 1
@@ -1482,6 +1486,7 @@ function goto_ops_pc(count) {
}
states.ops_pc = {
+ inactive: "to take a PC action",
prompt() {
view.prompt = "Place or flip PC markers. " + game.count + " left."
view.actions.pass = 1
@@ -1636,6 +1641,7 @@ function goto_ops_reinforcements(c) {
}
states.ops_british_reinforcements_who = {
+ inactive: "to reinforce",
prompt() {
view.prompt = "Reinforcements: Choose an available general."
view.prompt += " " + game.count + " British CU."
@@ -1665,6 +1671,7 @@ states.ops_british_reinforcements_who = {
}
states.ops_british_reinforcements_where = {
+ inactive: "to reinforce",
prompt() {
view.prompt = "Reinforcements: Choose a port space."
view.prompt += " " + game.count + " British CU."
@@ -1691,6 +1698,7 @@ states.ops_british_reinforcements_where = {
}
states.ops_american_reinforcements_who = {
+ inactive: "to reinforce",
prompt() {
view.prompt = "Reinforcements: Choose an available general."
view.move = { from: AMERICAN_REINFORCEMENTS, to: AMERICAN_REINFORCEMENTS, who: NOBODY, carry_american: game.count }
@@ -1710,6 +1718,7 @@ states.ops_american_reinforcements_who = {
}
states.ops_american_reinforcements_where = {
+ inactive: "to reinforce",
prompt() {
view.prompt = "Reinforcements: Choose a space."
view.move = { from: AMERICAN_REINFORCEMENTS, to: AMERICAN_REINFORCEMENTS, who: game.who, carry_american: game.count }
@@ -1788,6 +1797,7 @@ function goto_ops_general(c) {
}
states.ops_general_who = {
+ inactive: "to move",
prompt() {
let land = can_use_landing_party()
if (land)
@@ -1818,6 +1828,7 @@ states.ops_general_who = {
}
states.landing_party = {
+ inactive: "to move",
prompt() {
view.prompt = "Campaign: Flip or place a PC in a port."
gen_landing_party()
@@ -1884,6 +1895,7 @@ function goto_remove_general(where) {
}
states.remove_general = {
+ inactive: "to remove a general",
prompt() {
view.prompt = "Remove a general to the reinforcements box."
gen_remove_general(game.where)
@@ -1904,6 +1916,7 @@ function goto_remove_general_after_intercept() {
}
states.remove_general_after_intercept = {
+ inactive: "to remove a general",
prompt() {
view.prompt = "Remove a general to the reinforcements box."
gen_remove_general(game.move.to)
@@ -1919,6 +1932,7 @@ states.remove_general_after_intercept = {
}
states.remove_general_after_intercept_confirm = {
+ inactive: "to remove a general",
prompt() {
view.prompt = "Intercept done."
view.actions.next = 1
@@ -1935,6 +1949,7 @@ function goto_remove_general_after_retreat(where) {
}
states.remove_general_after_retreat = {
+ inactive: "to remove a general",
prompt() {
view.prompt = "Remove a general to the reinforcements box."
gen_remove_general(game.where)
@@ -2028,6 +2043,7 @@ function format_move_prompt() {
}
states.ops_general_move = {
+ inactive: "to move",
prompt() {
format_move_prompt()
view.prompt += " " + game.move.count + " MP left."
@@ -2140,6 +2156,7 @@ states.ops_general_move = {
}
states.confirm_move_intercept = {
+ inactive: "to move",
prompt() {
format_move_prompt()
view.prompt += " You may be intercepted."
@@ -2152,6 +2169,7 @@ states.confirm_move_intercept = {
}
states.confirm_move_battle = {
+ inactive: "to move",
prompt() {
format_move_prompt()
view.prompt += " Approach battle?"
@@ -2335,6 +2353,7 @@ function goto_intercept() {
}
states.intercept_who = {
+ inactive: "to intercept",
prompt() {
view.prompt = "Intercept " + general_name(game.move.who) + " at " + space_name(game.move.to) + "?"
view.actions.pass = 1
@@ -2363,6 +2382,7 @@ states.intercept_who = {
}
states.intercept_roll = {
+ inactive: "to intercept",
prompt() {
view.prompt = "Intercept " + general_name(game.move.who) + " at " + space_name(game.move.to) + " with " + general_name(game.intercept.who) + "?"
view.selected_general = game.intercept.who
@@ -2456,6 +2476,7 @@ function goto_retreat_before_battle() {
}
states.retreat_before_battle = {
+ inactive: "to retreat before battle",
prompt() {
view.prompt = "Attempt retreat before battle?"
view.selected_general = find_american_or_french_general(game.move.to)
@@ -2480,6 +2501,7 @@ states.retreat_before_battle = {
}
states.retreat_before_battle_roll = {
+ inactive: "to retreat before battle",
prompt() {
view.prompt = "Attempt retreat before battle?"
view.selected_general = find_american_or_french_general(game.move.to)
@@ -2521,6 +2543,7 @@ function goto_remove_general_after_retreat_before_battle(where) {
}
states.remove_general_after_retreat_before_battle = {
+ inactive: "to remove a general",
prompt() {
view.prompt = "Remove a general to the reinforcements box."
gen_remove_general(game.where)
@@ -2562,6 +2585,7 @@ function remove_benedict_arnold() {
}
states.remove_benedict_arnold_attacker = {
+ inactive: "to remove Arnold",
prompt() {
view.prompt = "Remove Benedict Arnold from the game!"
gen_action_general(ARNOLD)
@@ -2573,6 +2597,7 @@ states.remove_benedict_arnold_attacker = {
}
states.remove_benedict_arnold_defender = {
+ inactive: "to remove Arnold",
prompt() {
view.prompt = "Remove Benedict Arnold from the game!"
gen_action_general(ARNOLD)
@@ -2590,6 +2615,7 @@ function goto_play_attacker_battle_card() {
}
states.play_attacker_battle_card = {
+ inactive: "to play a battle card",
prompt() {
view.prompt = "Attack: Play or discard event for DRM."
view.actions.pass = 1
@@ -2634,6 +2660,7 @@ states.play_attacker_battle_card = {
}
states.play_attacker_battle_card_confirm = {
+ inactive: "to play a battle card",
prompt() {
let drm = (game.active === P_BRITAIN) ? game.combat.b_bonus : game.combat.a_bonus
view.prompt = `Attack: +${drm} DRM.`
@@ -2660,6 +2687,7 @@ function goto_play_defender_battle_card() {
}
states.play_defender_battle_card = {
+ inactive: "to play a battle card",
prompt() {
view.prompt = "Defend: Play or discard event for DRM."
view.actions.pass = 1
@@ -2704,6 +2732,7 @@ states.play_defender_battle_card = {
}
states.play_defender_battle_card_confirm = {
+ inactive: "to play a battle card",
prompt() {
let drm = (game.active === P_BRITAIN) ? game.combat.b_bonus : game.combat.a_bonus
if (drm > 1)
@@ -3084,6 +3113,7 @@ function goto_retreat_after_battle(victor) {
}
states.retreat_after_battle = {
+ inactive: "to retreat after battle",
prompt() {
view.prompt = "Retreat after battle."
if (game.active === game.combat.attacker)
@@ -3124,6 +3154,7 @@ states.retreat_after_battle = {
}
states.retreat_after_battle_confirm = {
+ inactive: "to retreat after battle",
prompt() {
view.prompt = "Retreat after battle: Done."
view.actions.next = 1
@@ -3217,8 +3248,9 @@ events.baron_von_steuben_trains_the_continental_army = function (c, card) {
}
states.baron_von_steuben_trains_the_continental_army = {
+ inactive: "to execute event",
prompt() {
- view.prompt = "Baron von Steuben. Place 2 CU with Washington."
+ view.prompt = "Baron von Steuben: Place 2 CU with Washington."
gen_action_general(WASHINGTON)
// TODO: lose regulars manual?
},
@@ -3251,6 +3283,7 @@ events.remove_british_pc_from = function (c, card) {
}
states.remove_british_pc_from = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove British PC markers from " + game.where.map(colony_name).join(", ") + ". " + game.count + " left."
view.actions.pass = 1
@@ -3280,6 +3313,7 @@ events.remove_american_pc = function (c, card) {
}
states.remove_american_pc = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove American PC markers. " + game.count + " left."
view.actions.pass = 1
@@ -3307,6 +3341,7 @@ events.remove_american_pc_from = function (c, card) {
}
states.remove_american_pc_from = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove American PC markers from " + game.where.map(colony_name).join(", ") + ". " + game.count + " left."
for (let colony of game.where)
@@ -3337,6 +3372,7 @@ events.remove_american_pc_from_non_port = function (c, card) {
}
states.remove_american_pc_from_non_port = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove American PC markers from non-Port space in " + game.where.map(colony_name).join(", ") + ". " + game.count + " left."
for (let colony of game.where) {
@@ -3390,6 +3426,7 @@ function gen_remove_american_pc_within_two_spaces_of_a_british_general() {
}
states.remove_american_pc_within_two_spaces_of_a_british_general = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove American PC markers within two spaces of a British general. " + game.count + " left."
view.actions.pass = 1
@@ -3416,6 +3453,7 @@ events.place_american_pc = function (c, card) {
}
states.place_american_pc = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Place American PC markers. " + game.count + " left."
for (let space of all_spaces)
@@ -3441,6 +3479,7 @@ events.place_american_pc_in = function (c, card) {
}
states.place_american_pc_in = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Place American PC markers in " + game.where.join(", ") + ". " + game.count + " left."
view.actions.pass = 1
@@ -3466,6 +3505,7 @@ events.lord_sandwich_coastal_raids = function (c, card) {
}
states.lord_sandwich_coastal_raids = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove two or flip one American PC in a port space."
view.actions.pass = 1
@@ -3502,6 +3542,7 @@ events.remove_american_cu = function (c, card) {
}
states.remove_american_cu = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove one American CU from any space."
for (let space of all_spaces)
@@ -3527,6 +3568,7 @@ events.remove_british_cu = function (c, card) {
}
states.remove_british_cu = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove " + game.count + " British CU from any space."
for (let space of all_spaces)
@@ -3552,6 +3594,7 @@ events.pennsylvania_and_new_jersey_line_mutinies = function (c, card) {
}
states.pennsylvania_and_new_jersey_line_mutinies = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Remove two American CUs from the map, one each from two different spaces."
view.actions.pass = 1
@@ -3585,6 +3628,7 @@ events.john_glovers_marblehead_regiment = function (c, card) {
}
states.john_glovers_marblehead_regiment_who = {
+ inactive: "to execute event",
prompt() {
view.prompt = "Activate an American general."
gen_activate_general()
@@ -3602,6 +3646,7 @@ events.declaration_of_independence = function (c, card) {
}
states.declaration_of_independence = {
+ inactive: "to place PC markers",
prompt() {
if (game.colonies.length > 0) {
view.prompt = "Declaration of Independence: Place a PC marker in "
@@ -3667,6 +3712,7 @@ function goto_george_washington_captured() {
}
states.george_washington_captured = {
+ inactive: "to remove PC markers",
prompt() {
view.prompt = "George Washington captured! Remove American PC markers. " + game.count + " left."
for (let space of all_spaces)
@@ -3687,6 +3733,7 @@ states.george_washington_captured = {
}
states.george_washington_captured_done = {
+ inactive: "to remove PC markers",
prompt() {
view.prompt = "George Washington captured! Remove American PC markers. Done."
view.actions.next = 1
@@ -3716,6 +3763,7 @@ function goto_george_washington_captured_during_move() {
}
states.george_washington_captured_during_move = {
+ inactive: "to remove PC markers",
prompt() {
view.prompt = "George Washington captured! Remove American PC markers. " + game.count + " left."
for (let space of all_spaces)
@@ -3829,6 +3877,7 @@ function end_british_winter_attrition() {
}
states.american_winter_attrition = {
+ inactive: "to take winter attrition",
prompt() {
if (game.attrition.length > 0) {
view.prompt = "Winter Attrition."
@@ -3891,6 +3940,7 @@ states.american_winter_attrition = {
}
states.british_winter_attrition = {
+ inactive: "to take winter attrition",
prompt() {
if (game.attrition.length > 0) {
view.prompt = "Winter Attrition."
@@ -3944,6 +3994,7 @@ const ZONE_NAME = [
]
states.place_french_navy_trigger = {
+ inactive: "to place French navy",
prompt() {
view.prompt = "Place the French Navy in a blockade zone."
gen_place_french_navy()
@@ -3974,6 +4025,7 @@ function goto_place_rochambeau() {
}
states.place_rochambeau = {
+ inactive: "to place Rochambeau",
prompt() {
view.prompt = "Place Rochambeau in a port."
view.move = { who: ROCHAMBEAU, from: FRENCH_REINFORCEMENTS, to: FRENCH_REINFORCEMENTS, carry_american: 0, carry_french: 5 }
@@ -3996,6 +4048,7 @@ states.place_rochambeau = {
}
states.remove_general_rochambeau = {
+ inactive: "to remove a general",
prompt() {
let where = location_of_general(ROCHAMBEAU)
view.prompt = "Remove a general to the reinforcements box."
@@ -4013,6 +4066,7 @@ states.remove_general_rochambeau = {
}
states.end_place_rochambeau = {
+ inactive: "to place Rochambeau",
prompt() {
let where = location_of_general(ROCHAMBEAU)
view.move = { who: ROCHAMBEAU, from: where, to: where, carry_american: 0, carry_french: 5 }
@@ -4031,6 +4085,7 @@ function end_place_rochambeau() {
}
states.place_french_navy = {
+ inactive: "to place French navy",
prompt() {
view.prompt = "Place the French Navy in a blockade zone."
gen_place_french_navy()
@@ -4068,6 +4123,7 @@ function gen_place_continental_congress() {
}
states.return_continental_congress = {
+ inactive: "to return the continental congress",
prompt() {
view.prompt = "Return Continental Congress to a space in the 13 colonies."
if (gen_place_continental_congress() === 0)
@@ -4129,6 +4185,7 @@ function resume_place_pc_markers_segment() {
}
states.place_american_pc_markers_segment = {
+ inactive: "to place PC markers",
prompt() {
let done = true
for (let space of all_spaces) {
@@ -4159,6 +4216,7 @@ states.place_american_pc_markers_segment = {
}
states.place_british_pc_markers_segment = {
+ inactive: "to place PC markers",
prompt() {
let done = true
for (let space of all_spaces) {
@@ -4304,6 +4362,7 @@ function goto_remove_isolated_british_pc_segment() {
}
states.remove_isolated_pc_segment = {
+ inactive: "to remove isolated PC markers",
prompt() {
if (game.isolated.length > 0) {
view.prompt = "Remove isolated PC markers. " + game.isolated.length + " left."
@@ -4363,6 +4422,7 @@ function goto_end_phase() {
/* END PHASE: EUROPEAN WAR */
states.european_war = {
+ inactive: "to remove 2 British CUs",
prompt() {
view.prompt = "European War: Remove 2 British CU from any spaces. " + game.count + " left."
for (let space of all_spaces)