summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js79
1 files changed, 41 insertions, 38 deletions
diff --git a/rules.js b/rules.js
index eea6e48..d41cef4 100644
--- a/rules.js
+++ b/rules.js
@@ -595,7 +595,7 @@ states.confirm_card = {
inactive: 'play a card',
prompt() {
let scoring_cards_count = count_scoring_cards()
- view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?`
+ view.prompt = `${pluralize(scoring_cards_count, 'scoring card')} in hand with ${pluralize(8-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?`
gen_action('continue')
},
continue() {
@@ -1076,7 +1076,7 @@ states.end_round = {
states.draw_power_cards = {
inactive: 'draw cards',
prompt() {
- view.prompt = `${card_name[this_card()]}: draw cards.`
+ prompt_event(`Draw Power Struggle cards.`)
gen_action('draw')
},
draw() {
@@ -2982,7 +2982,7 @@ function get_value(country) {
}
function get_end_infl_prompt() {
- view.prompt = `${card_name[this_card()]}. Add SPs: done.`
+ prompt_event(`Add SPs done.`)
if (!game.vm_infl_to_do) {
gen_action('end_round')
} else {
@@ -4364,6 +4364,10 @@ function vm_goto(op, nop, dir, step) {
vm_exec()
}
+function prompt_event(str) {
+ view.prompt = card_name[this_card()] + ": " + str
+}
+
function event_prompt(str) {
if (typeof str === "undefined")
str = CODE[game.vm.fp][game.vm.prompt][1]
@@ -5856,7 +5860,7 @@ states.vm_end_event = {
return `resolve ${card_name[this_card()]}.`
},
prompt() {
- view.prompt = `${card_name[this_card()]}: done.`
+ prompt_event("Done.")
if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') {
gen_action('done')
} else {
@@ -5880,15 +5884,15 @@ states.vm_take_control = {
},
prompt() {
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}: all spaces controlled. Continue.`
+ prompt_event("All spaces controlled.")
gen_action('done')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: take control of ${event_prompt()}.`
+ prompt_event(`Take control of ${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}
} else {
- view.prompt = `${card_name[this_card()]}. Take control: done.`
+ prompt_event("Take control done.")
if (game.vm_infl_to_do) {
gen_action('done')
} else {
@@ -5919,10 +5923,10 @@ states.vm_add_infl = {
inactive: 'add Support Points',
prompt() {
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}. No available spaces remaining. Add SPs: done.`
+ prompt_event("No available spaces remaining.")
gen_action('done')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`
+ prompt_event(`Add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -5960,10 +5964,10 @@ states.vm_add_infl_free = {
},
prompt() {
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}. No available spaces remaining. Add SPs: done.`
+ prompt_event("No available spaces remaining.")
gen_action('done')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: add ${game.vm_available_ops} SPs to ${event_prompt()}.`
+ prompt_event(`Add ${game.vm_available_ops} SPs to ${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -6003,10 +6007,10 @@ states.vm_add_x_infl = {
},
prompt() {
if (game.vm_event === 101 && game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}: the Romanian Elite space no longer exists.`
+ prompt_event("The Romanian Elite space no longer exists.")
gen_action('done')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.`
+ prompt_event(`Add ${game.vm_available_ops} SPs to ${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -6035,10 +6039,10 @@ states.vm_add_limited_infl = {
prompt() {
if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) {
if (game.vm_max_infl === 1) {
- view.prompt = `${card_name[this_card()]}: add ${pluralize(game.vm_max_infl,'SP')} ${event_prompt()}.`
+ prompt_event(`Add ${pluralize(game.vm_max_infl,'SP')} ${event_prompt()}.`)
}
else {
- view.prompt = `${card_name[this_card()]}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.`
+ prompt_event(`Add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.`)
}
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -6061,20 +6065,20 @@ states.vm_remove_infl = {
prompt() {
// Keep this so that there is an undo option in, e.g., Scare Tactics
if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: no further SPs to remove.`
+ prompt_event("No SPs to remove.")
gen_action('done')
return
}
if (game.vm_available_ops === 0) {
- view.prompt = `${card_name[this_card()]}. Remove SPs: done.`
+ prompt_event("Remove SPs done.")
gen_action('done')
return
}
if (game.remove_opponent_infl) {
- view.prompt = `${card_name[this_card()]}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.`
+ prompt_event(`Remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.`)
}
else {
- view.prompt = `${card_name[this_card()]}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`
+ prompt_event(`Remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`)
}
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -6107,11 +6111,11 @@ states.vm_remove_x_infl = {
},
prompt() {
if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: no SPs to remove.`
+ prompt_event("No SPs to remove.")
gen_action('done')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.`
+ prompt_event(`Remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}
@@ -6134,13 +6138,13 @@ states.vm_remove_limited_infl = {
inactive: 'remove SP',
prompt() {
if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) {
- view.prompt = `${card_name[this_card()]}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}, no more than ${game.vm_max_infl} per space.`
+ prompt_event(`Remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}, no more than ${game.vm_max_infl} per space.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}
} else if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: no further SP to remove.`
+ prompt_event("No further SP to remove.")
gen_action('done')
}
},
@@ -6163,10 +6167,10 @@ states.vm_remove_all_infl = {
inactive: 'remove Support Points',
prompt() {
if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: no SPs to remove.`
+ prompt_event("No SPs to remove.")
gen_action('pass')
} else if (game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: remove all SPs from ${event_prompt()}.`
+ prompt_event(`Remove all SPs from ${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}
@@ -6189,13 +6193,13 @@ states.vm_support_check_prep = {
inactive: 'do Support Checks',
prompt() {
if (game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}: no valid targets for Support Check.`
+ prompt_event(`No valid targets for Support Check.`)
gen_action('done')
} else {
if (event_prompt() === "") {
- view.prompt = `${card_name[this_card()]}: select a space. ${pluralize(game.vm_available_ops, 'Support Check')} remaining.`
+ prompt_event(`Select a space. ${pluralize(game.vm_available_ops, 'Support Check')} remaining.`)
} else {
- view.prompt = `${card_name[this_card()]}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'Support Check')} remaining.`
+ prompt_event(`${event_prompt()}. ${pluralize(game.vm_available_ops, 'Support Check')} remaining.`)
}
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
@@ -6311,10 +6315,10 @@ states.vm_1_support_check_prep = {
inactive: 'do Support Checks',
prompt() {
if (game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}: no valid targets for Support Check.`
+ prompt_event("No valid targets for Support Check.")
gen_action('done')
} else {
- view.prompt = `${card_name[this_card()]}: ${event_prompt()}.`
+ prompt_event(event_prompt())
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}
@@ -6575,7 +6579,6 @@ states.vm_dash_for_the_west = {
let roll = roll_d6()
log(`Roll: D${roll}`)
let com_control = check_presence('East_Germany').com_spaces
-
if (roll > com_control) {
log(`Success. More than the ${com_control} Communist controlled spaces in East Germany`)
log('+1 VP')
@@ -6598,10 +6601,10 @@ states.vm_play_event_from_discard = {
},
prompt() {
if (game.valid_cards.length === 0) {
- view.prompt = `${card_name[this_card()]}: no valid cards in discard.`
+ prompt_event(`No valid cards in discard.`)
gen_action('pass')
} else {
- view.prompt = `${event_prompt()}.`
+ view.prompt = event_prompt() + "."
for (let card of game.valid_cards) {
gen_action('pass')
gen_action_card(card)
@@ -6837,7 +6840,7 @@ states.vm_goodbye_lenin = {
gen_action('ops')
}
} else {
- view.prompt = `Communist has no red events. Play ${quoted_card_name[C_GOODBYE_LENIN]} for operations.'
+ view.prompt = `Communist has no red events. Play ${quoted_card_name[C_GOODBYE_LENIN]} for operations.`
gen_action('ops')
}
},
@@ -7271,7 +7274,7 @@ states.vm_switch_infl = {
},
prompt() {
if (game.valid_spaces.length === 0) {
- view.prompt = `${card_name[this_card()]}: No SPs to remove.`
+ prompt_event(`No SPs to remove.`)
gen_action("pass")
} else {
view.prompt = `${card_name[game.played_card]}: ${event_prompt()}.`
@@ -8262,16 +8265,16 @@ states.vm_scare_tactics = {
inactive: 'remove a Support Point',
prompt() {
if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
- view.prompt = `${card_name[this_card()]}: no SPs to remove.`
+ prompt_event(`No SPs to remove.`)
gen_action('done')
return
}
if (game.vm_available_ops === 0) {
- view.prompt = `${card_name[this_card()]}. Remove SPs: done.`
+ prompt_event(`Remove SPs done.`)
gen_action('done')
return
}
- view.prompt = `${card_name[this_card()]}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.`
+ prompt_event(`Remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.`)
for (let space_id of game.valid_spaces) {
gen_action_space(space_id)
}