summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js248
1 files changed, 127 insertions, 121 deletions
diff --git a/rules.js b/rules.js
index da3cc3f..e41e632 100644
--- a/rules.js
+++ b/rules.js
@@ -146,7 +146,7 @@ function start_game() {
game.valid_spaces = valid_spaces_setup()
game.available_ops = 2
game.phase = 0
- log_h1("Place starting influence")
+ log_h1("Place starting Support Points")
log_side()
}
@@ -306,16 +306,16 @@ exports.action = function (state, player, action, arg) {
// ============= GAME STATES =======================
states.com_init = {
- inactive: 'place starting influence',
+ inactive: 'place starting SPs',
prompt() {
if (game.available_ops == 0) {
- view.prompt = 'Place starting influence: done.';
+ view.prompt = 'Place starting SPs: done.';
gen_action("done");
return;
} else if (game.starting_infl.dem_starting_infl === 2) {
- view.prompt = `Place your last ${game.available_ops} starting influence.`
+ view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.`
} else {
- view.prompt = `Place ${game.available_ops} starting influence.`
+ view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.`
}
for (let space_id of game.valid_spaces) {
if (space_id) {
@@ -328,8 +328,6 @@ states.com_init = {
},
done() {
- view.prompt='Influence added.'
-
if (game.summary.length > 0) {
pop_summary()
log_br()
@@ -354,16 +352,16 @@ states.com_init = {
}
states.dem_init = {
- inactive: 'place starting influence.',
+ inactive: 'place starting SPs.',
prompt() {
if (game.available_ops == 0) {
- view.prompt = 'Place starting influence: done.';
+ view.prompt = 'Place starting SPs: done.';
gen_action("done");
return;
} else if (game.starting_infl.com_starting_infl === 2) {
- view.prompt = `Place your last ${game.available_ops} starting influence.`
+ view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.`
} else {
- view.prompt = `Place ${game.available_ops} starting influence`
+ view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.`
}
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -374,8 +372,6 @@ states.dem_init = {
},
done() {
- view.prompt='Influence added.'
-
if (game.summary.length > 0) {
pop_summary()
log_br()
@@ -555,7 +551,7 @@ states.play_card ={
},
influence() {
push_undo()
- log_gap(`Played C${cards[game.played_card].number} for influence`)
+ log_gap(`Played C${cards[game.played_card].number} to place SPs`)
// Check if Common European Home played for influence
@@ -694,15 +690,15 @@ states.resolve_opponent_event = {
}
states.finish_add_infl = {
- inactive: 'add influence.',
+ inactive: 'add SPs.',
prompt () {
if (game.available_ops === 0) {
- view.prompt = 'Place influence: done.'
+ view.prompt = 'Place SPs: done.'
gen_action("done")
return;
}
- view.prompt = `Add influence: ${game.available_ops} remaining`
+ view.prompt = `Add SPs: ${game.available_ops} remaining`
// Generate actions for valid spaces
for (let space_id of game.valid_spaces) {
@@ -790,15 +786,15 @@ states.finish_do_support_check = {
}
states.add_influence = {
- inactive: 'add influence.',
+ inactive: 'add SPs.',
prompt () {
if (game.available_ops <= 0) {
- view.prompt = 'Place influence: done.'
+ view.prompt = 'Place SPs: done.'
gen_action("done")
return
}
- view.prompt = `Add influence: ${game.available_ops} remaining.`
+ view.prompt = `Add SPs: ${game.available_ops} remaining.`
// Generate actions for valid spaces
for (let space_id of game.valid_spaces) {
@@ -1087,7 +1083,7 @@ states.draw_power_cards = {
states.the_crowd_turns_against_ceausescu_prep = {
get inactive() {
- return `resolve ${cards[54].name}.`
+ return `resolve ${clean_name(cards[54].name)}.`
},
prompt() {
view.prompt = 'The Crowd Turns Against Ceausescu: draw cards.'
@@ -1105,7 +1101,7 @@ states.the_crowd_turns_against_ceausescu_prep = {
states.vm_the_crowd_turns_against_ceausescu = {
get inactive() {
- return `resolve ${cards[54].name}.`
+ return `resolve ${clean_name(cards[54].name)}.`
},
prompt() {
view.prompt = `You have ${game.vm_available_ops} operations points. Play for:`
@@ -1129,16 +1125,16 @@ states.vm_the_crowd_turns_against_ceausescu = {
}
states.the_crowd_turns_against_ceausescu_infl = {
- inactive: 'add influence.',
+ inactive: 'add SPs.',
prompt () {
if (game.vm_available_ops === 0)
{
- view.prompt = 'Place influence: done.';
+ view.prompt = 'Place SPs: done.';
gen_action("done");
return;
}
- view.prompt = `Add influence: ${game.vm_available_ops} remaining`
+ view.prompt = `Add SPs: ${game.vm_available_ops} remaining`
for (let space of game.valid_spaces) {
gen_action_infl(spaces[space].name_unique)
}
@@ -1458,7 +1454,7 @@ states.support_loss ={
view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.'
gen_action('roll')
} else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) {
- view.prompt = `Support Loss: remove ${game.available_ops} influence.`
+ view.prompt = `Support Loss: remove ${pluralize(game.available_ops,'SP')}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique)
@@ -1467,7 +1463,7 @@ states.support_loss ={
view.prompt = 'Support Loss: finished.'
gen_action('done')
} else if (game.phase === 1 && game.valid_spaces.length === 0) {
- view.prompt = 'Support Loss: no remaining influence to remove.'
+ view.prompt = 'Support Loss: no remaining SPs to remove.'
gen_action('done')
}
},
@@ -1505,7 +1501,7 @@ states.support_loss ={
}
game.available_ops = support_loss_roll[modified_roll]
if (game.available_ops === 0) {
- log('Does not remove influence')
+ log('Does not remove SPs')
}
game.phase++
valid_spaces_support_loss()
@@ -2139,7 +2135,7 @@ function add_infl(space) {
console.log('clicked_space', clicked_space)
//console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker)
//log(`Added 1 influence in %${clicked_space}`)
- log_summary(`Added £ influence in %${clicked_space}`)
+ log_summary(`Added £ SP in %${clicked_space}`)
if (spaces[clicked_space].country !== 'East_Germany'){
game.austria_hungary_border_reopened_tracker = false
@@ -2207,7 +2203,7 @@ function remove_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
//log(`Removed 1 influence from %${clicked_space}.`)
- log_summary(`Removed £ influence from %${clicked_space}.`)
+ log_summary(`Removed £ SP from %${clicked_space}.`)
if (game.remove_opponent_infl === true) {
if (game.active === COM) {
@@ -2800,7 +2796,7 @@ function do_tst_attempt() {
// TIANANMEN SQUARE ATTEMPT
game.return = game.active
- game.return_state = 'tiananmen_square_attempt'
+ game.return_state = 'tiananmen_square_attempt_success'
if (game.active === DEM) {
game.dem_tst_attempted_this_turn = 1
if (roll >= dem_tst_req[game.dem_tst_position]) {
@@ -2809,8 +2805,8 @@ function do_tst_attempt() {
game.dem_tst_position++
game.dem_tst_attempted = 0
if (game.dem_tst_position === 3 && game.com_tst_position < 3) {goto_vm(203)}
- if (game.dem_tst_position === 4 && game.com_tst_position < 4) {goto_vm(204)}
- game.state = 'tiananmen_square_attempt_success'
+ else if (game.dem_tst_position === 4 && game.com_tst_position < 4) {goto_vm(204)}
+ else {game.state = 'tiananmen_square_attempt_success'}
} else {
log(`${dem_tst_req[game.dem_tst_position]} required: fail`)
game.dem_tst_attempted = 1
@@ -2823,8 +2819,8 @@ function do_tst_attempt() {
game.com_tst_position++
game.com_tst_attempted = 0
if (game.com_tst_position === 3 && game.dem_tst_position < 3) {goto_vm(203)}
- if (game.com_tst_position === 4 && game.dem_tst_position < 4) {goto_vm(204)}
- game.state = 'tiananmen_square_attempt_success'
+ else if (game.com_tst_position === 4 && game.dem_tst_position < 4) {goto_vm(204)}
+ else {game.state = 'tiananmen_square_attempt_success'}
} else {
log(`${com_tst_req[game.com_tst_position]} required: fail`)
game.com_tst_attempted = 1
@@ -3375,6 +3371,8 @@ function end_round() {
game.round_player = DEM
if (game.active !== DEM) {
next_player()
+ } else {
+ log_h3('Democratic Action Round')
}
game.state = 'choose_card'
return
@@ -3927,7 +3925,11 @@ function log_summary(msg) {
function pop_summary() {
if (game.summary.length > 0) {
for (let [n, msg] of game.summary) {
- log(msg.replace("£", String(n)))
+ if (n > 1) {
+ log(msg.replace("£ SP", `${n} SPs`));
+ } else {
+ log(msg.replace("£ SP", `${n} SP`));
+ }
}
}
game.summary = []
@@ -4468,7 +4470,7 @@ function vm_do_add_infl(space) {
//console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker)
//log(`Added 1 influence in %${clicked_space}.`)
- log_summary(`Added £ influence in %${clicked_space}.`)
+ log_summary(`Added £ SP in %${clicked_space}.`)
if (spaces[clicked_space].country !== 'East_Germany'){
game.austria_hungary_border_reopened_tracker = false
@@ -4500,7 +4502,7 @@ function vm_do_add_infl(space) {
// Check Austria Hungary Border Reopened is true and condition has been met
if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events['austria_hungary_border_reopened'] && game.austria_hungary_border_reopened_tracker) {
game.vm_available_ops ++
- log('+1 influence from C58')
+ log('+1 Op from C58')
game.austria_hungary_border_reopened_tracker = false
game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany')
}
@@ -4535,7 +4537,7 @@ function vm_do_add_infl_free(space) {
const clicked_space = find_space_index(space)
//log(`Added 1 influence in %${clicked_space}.`)
- log_summary(`Added £ influence in %${clicked_space}.`)
+ log_summary(`Added £ SP in %${clicked_space}.`)
// Update influence values
if (game.active === COM) {
@@ -4569,7 +4571,7 @@ function vm_add_x_infl() {
function vm_do_add_x_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Added ${game.vm_available_ops} influence in %${clicked_space}.`)
+ log(`Added ${game.vm_available_ops} SPs in %${clicked_space}.`)
if (game.active === COM) {
@@ -4593,7 +4595,7 @@ function vm_do_add_limited_infl(space, max_infl) {
const clicked_space = find_space_index(space)
//log(`Added 1 influence in %${clicked_space}.`)
- log_summary(`Added £ influence in %${clicked_space}.`)
+ log_summary(`Added £ SP in %${clicked_space}.`)
game.vm_available_ops --
if (!game.vm_influence_added) {
@@ -4642,7 +4644,7 @@ function vm_do_remove_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
//log(`Removed 1 influence from %${clicked_space}.`)
- log_summary(`Removed £ influence from %${clicked_space}.`)
+ log_summary(`Removed £ SP from %${clicked_space}.`)
if (!game.vm_influence_added) {
game.vm_influence_added = {};
@@ -4722,7 +4724,7 @@ function vm_do_remove_x_infl(space) {
}
}
- log(`Removed ${game.vm_available_ops} influence from %${clicked_space}`)
+ log(`Removed ${game.vm_available_ops} SPs from %${clicked_space}`)
check_control_change(clicked_space)
game.vm_available_ops = 0
@@ -4739,7 +4741,7 @@ function vm_remove_limited_opp_infl() {
function vm_do_remove_limited_infl(space, max_infl) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Removed influence from %${clicked_space}.`)
+ log(`Removed SP from %${clicked_space}.`)
game.vm_available_ops --
@@ -4781,7 +4783,7 @@ function vm_remove_all_infl() {
function vm_do_remove_all_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Removed all influence from %${clicked_space}.`)
+ log(`Removed all SP from %${clicked_space}.`)
if (game.remove_opponent_infl === true) {
if (game.active === COM) {
@@ -4835,7 +4837,7 @@ function vm_switch_infl(space){
let clicked_space = find_space_index(space)
game.demInfl[clicked_space] -= game.vm_available_ops
game.comInfl[clicked_space] += game.vm_available_ops
- log(`Replaced ${game.vm_available_ops} influence in ${spaces[clicked_space].name_unique}`)
+ log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in ${spaces[clicked_space].name_unique}`)
game.vm_available_ops = 0
check_control_change(clicked_space)
}
@@ -5780,21 +5782,21 @@ states.vm_take_control = {
}
states.vm_add_infl = {
- inactive: 'add influence.',
+ inactive: 'add Support Points.',
prompt () {
console.log('in vm add infl')
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) {
- view.prompt = 'No available spaces remaining. Add influence: done.'
+ view.prompt = 'No available spaces remaining. Add SPs: done.'
gen_action('done')
}
else if (game.vm_available_ops > 0 ) {
- view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} influence${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique)
}
} else {
- view.prompt = 'Add influence: done.'
+ view.prompt = 'Add SP: done.'
gen_action('done')
}
},
@@ -5814,15 +5816,15 @@ states.vm_add_infl = {
states.vm_add_infl_free = {
get inactive() {
- return `resolve ${clean_name(cards[this_card()].name)}: add influence.`
+ return `resolve ${clean_name(cards[this_card()].name)}: add SPs.`
},
prompt () {
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) {
- view.prompt = 'No available spaces remaining. Add influence: done.'
+ view.prompt = 'No available spaces remaining. Add SPs: done.'
gen_action('done')
}
else if (game.vm_available_ops > 0 ) {
- view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} influence to ${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -5852,12 +5854,12 @@ states.vm_add_infl_free = {
states.vm_add_x_infl = {
get inactive() {
- return `resolve ${clean_name(cards[this_card()].name)}: add influence.`
+ return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.`
},
// inactive: `resolve ${cards[this_card()].name}: add influence.`,
prompt () {
if (game.vm_available_ops > 0 ) {
- view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} influence to ${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique)
@@ -5880,15 +5882,15 @@ states.vm_add_x_infl = {
states.vm_add_limited_infl = {
get inactive() {
- return `resolve ${clean_name(cards[this_card()].name)}: add influence.`
+ return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.`
},
prompt () {
if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) {
if (game.vm_max_infl === 1) {
- view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_max_infl} influence ${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_max_infl,'SP')} ${event_prompt()}.`
}
else {
- view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} influence to ${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.`
}
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -5920,16 +5922,16 @@ states.vm_add_limited_infl = {
}
states.vm_remove_infl = {
- inactive: 'remove influence.',
+ inactive: 'remove Support Points.',
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 = `${clean_name(cards[this_card()].name)}: no further influence to remove.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.`
gen_action('done')
return
}
if (game.vm_available_ops === 0 ) {
- view.prompt = `${clean_name(cards[this_card()].name)}. Remove influence: done.`
+ view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.`
gen_action('done')
return
}
@@ -5937,7 +5939,7 @@ states.vm_remove_infl = {
view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.`
}
else {
- view.prompt = `${clean_name(cards[this_card()].name)}: remove ${game.vm_available_ops} SP${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.`
}
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -5968,11 +5970,11 @@ states.vm_remove_x_infl = {
},
prompt () {
if (game.valid_spaces.length === 0) {
- view.prompt = `${clean_name(cards[this_card()].name)}: no influence to remove.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.`
gen_action('done')
} else {
- view.prompt = `${clean_name(cards[this_card()].name)}: remove ${game.vm_available_ops} SP from ${event_prompt()}.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -6025,10 +6027,10 @@ states.vm_remove_limited_infl = {
}
states.vm_remove_all_infl = {
- inactive: 'remove influence',
+ inactive: 'remove Support Points',
prompt () {
if (game.valid_spaces.length === 0) {
- view.prompt = `${clean_name(cards[this_card()].name)}: no SP to remove.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.`
gen_action('done')
return
}
@@ -6306,7 +6308,7 @@ states.vm_central_committee_reshuffle = {
states.vm_common_european_home = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.vm_event === 0) {
@@ -6391,7 +6393,7 @@ states.vm_dash_for_the_west = {
states.vm_play_event_from_discard = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.valid_cards.length === 0) {
@@ -6462,7 +6464,7 @@ states.vm_deutsche_marks_prep = {
states.vm_deutsche_marks = {
get inactive() {
- return `resolve ${cards[20].name}.`
+ return `resolve ${clean_name(cards[20].name)}.`
},
prompt() {
if(cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) {
@@ -6479,12 +6481,16 @@ states.vm_deutsche_marks = {
},
event() {
log(`Played C${cards[game.vm_event].number} for the event`)
- game.return === game.active
+ console.log('game.active', game.active)
+ if (!game.vm_infl_to_do) {
+ game.return = game.active
+ }
+ console.log('DM Event played, game.return', game.return)
goto_vm(game.vm_event)
},
influence() {
push_undo()
- log(`Played C${cards[game.vm_event].number} for influence`)
+ log(`Played C${cards[game.vm_event].number} to place SPs`)
game.vm_available_ops = cards[game.vm_event].ops
if (game.persistent_events['perestroika']) {game.vm_available_ops++ }
game.vm_available_ops += game.persistent_events['prudence'].COM
@@ -6507,7 +6513,7 @@ states.vm_deutsche_marks = {
states.vm_exit_visas = {
get inactive() {
- return `resolve ${cards[75].name}.`
+ return `resolve ${clean_name(cards[75].name)}.`
},
prompt() {
view.prompt = 'Exit Visas: you may discard cards from your hand and draw replacements.'
@@ -6529,7 +6535,7 @@ states.vm_exit_visas = {
states.vm_exit_visas_finish = {
get inactive() {
- return `resolve ${cards[75].name}.`
+ return `resolve ${clean_name(cards[75].name)}.`
},
prompt() {
if (game.temp > 0 ) {
@@ -6552,7 +6558,7 @@ states.vm_exit_visas_finish = {
states.vm_foreign_currency_debt_burden = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'Choose a country. The Communist may not make support checks there for the rest of the turn.'
@@ -6664,7 +6670,7 @@ states.vm_goodbye_lenin_ops = {
states.vm_honecker = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.valid_cards.length === 0 && game.temp === 0) {
@@ -6767,7 +6773,7 @@ states.vm_inflationary_currency = {
states.vm_inflationary_currency_discard = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.valid_cards.length === 0 ) {
@@ -6804,7 +6810,7 @@ states.vm_inflationary_currency_discard = {
states.vm_kiss_of_death = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.communist_hand.length === 0) {
@@ -6828,12 +6834,12 @@ states.vm_kiss_of_death = {
states.vm_kiss_of_death_finish = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
console.log('game.vm_event', game.vm_event)
if (game.vm_event > 0 && game.vm_event !== 21 && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) {
- view.prompt = `Play ${cards[game.vm_event].name} for the event.`
+ view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.`
console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard)
gen_action('event')
} else {
@@ -6857,7 +6863,7 @@ states.vm_kiss_of_death_finish = {
states.vm_kremlin_coup_choose_country = {
get inactive() {
- return `resolve ${cards[this_card()].name}.`
+ return `resolve ${clean_name(cards[this_card()].name)}.`
},
prompt() {
if (game.temp.length > 0) {
@@ -6924,7 +6930,7 @@ states.vm_kremlin_coup_choose_country = {
states.vm_kremlin_coup_take_control = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.valid_spaces.length === 0){
@@ -6955,7 +6961,7 @@ states.vm_kremlin_coup_take_control = {
states.vm_kremlin_coup_sc_prep = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = `Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.`
@@ -7016,7 +7022,7 @@ states.vm_laszlo_tokes = {
states.vm_switch_infl = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.valid_spaces.length === 0) {
@@ -7051,7 +7057,7 @@ states.vm_switch_infl = {
states.vm_malta_summit = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
/*if (game.phase === 1) {*/
@@ -7100,7 +7106,7 @@ states.vm_malta_summit = {
states.vm_modrow = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = `Modrow: roll a die.`
@@ -7125,7 +7131,7 @@ states.vm_modrow = {
states.vm_nepotism = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
//if (game.phase === 1 ) {
@@ -7140,13 +7146,13 @@ states.vm_nepotism = {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
if (roll < 3) {
- log(`Rolled a ${roll}: adds 4 influence`)
+ log(`Rolled a ${roll}: adds 4 SPs`)
game.vm_available_ops = 4}
else if (roll < 5 ) {
- log(`Rolled a ${roll}: adds 3 influence`)
+ log(`Rolled a ${roll}: adds 3 SPs`)
game.vm_available_ops = 3}
else {
- log(`Rolled a ${roll}: adds 1 influence`)
+ log(`Rolled a ${roll}: adds 1 SP`)
game.vm_available_ops = 1}
//game.phase = 2
vm_next()
@@ -7158,7 +7164,7 @@ states.vm_nepotism = {
states.vm_new_years_eve_party = {
get inactive() {
- return `resolve ${cards[104].name}.`
+ return `resolve ${clean_name(cards[104].name)}.`
},
prompt() {
view.prompt = 'Choose whether the game ends at the end of this turn.'
@@ -7193,10 +7199,10 @@ states.vm_new_years_eve_party = {
states.vm_nomenklatura = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- view.prompt = 'Nomenklatura: choose to remove all Democratic influence from Elite spaces or add 3 influence to any Elite space(s).'
+ view.prompt = 'Nomenklatura: choose to remove all Democratic SPs from Elite spaces or add 3 SPs to any Elite space(s).'
gen_action('remove')
gen_action('add')
},
@@ -7230,14 +7236,14 @@ states.vm_nomenklatura = {
states.vm_nomenklatura_remove = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) {
- view.prompt = 'Remove influence: done.'
+ view.prompt = 'Remove SPs: done.'
gen_action('done')
} else {
- view.prompt = 'Nomenklatura: remove all Democratic influence from Elite spaces.'
+ view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.'
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -7258,14 +7264,14 @@ states.vm_nomenklatura_remove = {
states.vm_nomenklatura_add = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) {
- view.prompt = 'Add influence: done.'
+ view.prompt = 'Add SPs: done.'
gen_action('done')
} else {
- view.prompt = `Nomenklatura: add 3 influence to any Elite space(s). ${game.vm_available_ops} influence remaining.`
+ view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}
@@ -7287,7 +7293,7 @@ states.vm_nomenklatura_add = {
states.vm_samizdat = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'Samizdat: you may set aside a card from your hand and draw a replacement.'
@@ -7314,7 +7320,7 @@ states.vm_samizdat = {
states.vm_samizdat_finish = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.phase === 2) {
@@ -7337,7 +7343,7 @@ states.vm_samizdat_finish = {
states.vm_shock_therapy = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.vm_active_country === '' ) {
@@ -7414,7 +7420,7 @@ states.vm_shock_therapy = {
states.vm_social_democratic_platform_adopted = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'Select a country where the Democrat holds Power.'
@@ -7462,7 +7468,7 @@ states.vm_social_democratic_platform_adopted = {
states.vm_systematization = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
/*if (game.persistent_events['systematization'] === 0) { */
@@ -7489,7 +7495,7 @@ states.vm_systematization = {
states.vm_the_chinese_solution = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'You may give up 3 VP to conduct support checks in a country where you hold power.'
@@ -7575,7 +7581,7 @@ states.vm_the_chinese_solution = {
states.vm_the_tyrant_is_gone = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.persistent_events['the_tyrant_is_gone']=== 0) {
@@ -7692,7 +7698,7 @@ states.vm_the_wall_must_go = {
states.vm_warsaw_pact_summit = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'Choose to play for support checks or place SPs.'
@@ -7729,20 +7735,20 @@ states.vm_warsaw_pact_summit = {
states.vm_we_are_the_people_remove = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.demInfl[6] === 0) {
- view.prompt = '"We are the People!": no influence to remove.'
+ view.prompt = '"We are the People!": no SPs to remove.'
gen_action('done')
} else if (game.vm_available_ops > 0 ) {
- view.prompt = '"We are the People!": remove up to 4 influence from the Lutherian Church.'
+ view.prompt = '"We are the People!": remove up to 4 SPs from the Lutherian Church.'
gen_action('done')
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}
} else {
- view.prompt = 'Remove influence: done.'
+ view.prompt = 'Remove SPs: done.'
gen_action('done')
}
},
@@ -7755,7 +7761,7 @@ states.vm_we_are_the_people_remove = {
log_br()
}
if (!game.vm_influence_added[6]) {
- log('No influence removed')
+ log('No SPs removed')
vm_next()
} else {
game.valid_spaces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
@@ -7765,7 +7771,7 @@ states.vm_we_are_the_people_remove = {
}
states.vm_we_are_the_people_add = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (!game.vm_influence_added[6]) {
@@ -7774,7 +7780,7 @@ states.vm_we_are_the_people_add = {
return
}
- view.prompt = `"We are the People!": you must add the ${game.vm_influence_added[6]} influence to spaces in Germany.`
+ view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.`
gen_action('done')
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -7797,7 +7803,7 @@ states.vm_we_are_the_people_add = {
states.vm_workers_revolt = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.'
@@ -7815,11 +7821,11 @@ states.vm_workers_revolt = {
states.vm_workers_revolt_finish = {
get inactive() {
- return `resolve ${cards[game.played_card].name}.`
+ return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
if (game.selected_space > 0) {
- view.prompt = `Target: ${spaces[game.selected_space].name}. Roll a die.`
+ view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.`
gen_action('roll')
} else {
view.prompt = 'Workers Revolt: done.'
@@ -7901,14 +7907,14 @@ states.vm_tst_3 = {
}
states.vm_tst_4 = {
- inactive: 'remove influence',
+ inactive: 'remove SPs',
prompt () {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) {
- view.prompt = 'Remove influence: done.'
+ view.prompt = 'Remove SPs: done.'
gen_action('done')
return
}
- view.prompt = 'Tiananmen Square Track award: select a space to remove influence'
+ view.prompt = 'Tiananmen Square Track award: select a space to remove SPs'
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
@@ -8014,7 +8020,7 @@ states.vm_tst_8 = {
states.vm_tst_8_ops = {
inactive: 'play card for operations.',
prompt() {
- view.prompt = `Play ${cards[game.played_card].name} for:`
+ view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:`
gen_action('influence')
gen_action('support_check')
if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 )) {
@@ -8640,7 +8646,7 @@ CODE[75] = [ // Exit Visas*
CODE[76] = [ // Warsaw Pact Summit
[ vm_warsaw_pact_summit ],
[ vm_if, ()=>game.phase === 3 ],
- [ vm_prompt, ' spaces with no Democratic influence' ],
+ [ vm_prompt, ' spaces with no Democratic SPs' ],
[ vm_add_infl_free, 4 ],
[ vm_else ],
[ vm_prompt, 'Select a Student or Intellectual space' ],