summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css65
-rw-r--r--play.js161
-rw-r--r--rules.js202
3 files changed, 335 insertions, 93 deletions
diff --git a/play.css b/play.css
index 728ac3a..f2de63c 100644
--- a/play.css
+++ b/play.css
@@ -33,7 +33,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); }
#log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; }
#log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; }
#log .h3 { text-align: center; }
-#log .h4 { text-decoration: underline; }
+#log .h4 { text-align: center; text-decoration: underline; }
#log .h5 { text-decoration: underline; }
#log { background-color: floralwhite }
@@ -73,6 +73,20 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); }
#log .card_name:hover { text-decoration: underline; }
#log .space_tip:hover { cursor: pointer; text-decoration: underline; }
+#log .number {
+ display: inline-block;
+ margin: 0;
+ text-indent: 0;
+ text-align: center;
+ width: 12px;
+ height: 12px;
+ line-height: 12px;
+ border: 1px solid #444;
+}
+
+#log .number.d_tst { background-color: hsl(206, 85%, 80%); }
+#log .number.c_tst { background-color: hsl(355, 70%, 80%); }
+
#log .icon {
display: inline-block;
vertical-align: -2px;
@@ -85,24 +99,18 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); }
background-repeat: no-repeat;
}
+#log .icon.number {
+ background-color: white;
+ border: 1px solid #444;
+ width: 10px;
+ height: 10px;
+}
+
#log .com_nc { background-image: url(images/SVd_blank.gif);}
#log .com_c {background-image: url(images/SV_blank.gif);}
#log .dem_nc { background-image: url(images/USd_blank.gif);}
#log .dem_c {background-image: url(images/favicon_dem.svg);}
-#log .number {
- display: inline-block;
- margin: 0;
- text-indent: 0;
- text-align: center;
- width: 12px;
- height: 12px;
- line-height: 12px;
- border: 1px solid #444;
-}
-
-#log .number.d_tst { background-color: hsl(206, 85%, 80%); }
-#log .number.c_tst { background-color: hsl(355, 70%, 80%); }
/* MAP */
@@ -165,6 +173,35 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); }
#marker_com_tst { background-color: #f26649; border-color: #ff9273 #c2391c #c2391c #ff9273; box-shadow: 0 0 0 1px #640000, 1px 2px 4px #0008; }
#marker_dem_tst { background-color: #c4e2f4; border-color: #e6ffff #8ca8ba #8ca8ba #e6ffff; box-shadow: 0 0 0 1px #27404f, 1px 2px 4px #0008; }
+.box {
+ position: absolute;
+ border: solid 1px black;
+ height: 15px;
+ width: 100px;
+}
+
+.box.d_pres { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, transparent 100%); }
+
+.box.c_pres { background: linear-gradient(to right, transparent 0%, transparent 80%,rgba(255, 0, 0, 0.75) 80%, rgba(255, 0, 0, 0.75) 100%); }
+
+.box.c_pres.d_pres { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, transparent 80%, rgba(255, 0, 0, 0.75) 80%,rgba(255,0,0,0.75) 100%); }
+
+.box.d_pres.d_dom { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 50%, transparent 50%); }
+
+.box.d_pres.d_dom.c_pres { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 50%, transparent 50%, transparent 80%, rgba(255, 0, 0, 0.75) 80%, rgba(255, 0, 0, 0.75) 100%); }
+
+.box.d_pres.d_ctrl { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 80%, transparent 80%); }
+
+.box.d_pres.d_ctrl.c_pres { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 80%, rgba(255, 0, 0, 0.75) 80%), rgba(255, 0, 0, 0.75) 100%; }
+
+.box.c_pres.c_dom { background: linear-gradient(to right, transparent 50%, rgba(255, 0, 0, 0.75) 50%, rgba(255, 0, 0, 0.75) 100%); }
+
+.box.d_pres.c_pres.c_dom { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, transparent 50%, rgba(255, 0, 0, 0.75) 50%, rgba(255, 0, 0, 0.75) 100%); }
+
+.box.c_pres.c_ctrl { background: linear-gradient(to right, transparent 20%, rgba(255, 0, 0, 0.75) 20%, rgba(255, 0, 0, 0.75) 100%); }
+
+.box.d_pres.c_pres.c_ctrl { background: linear-gradient(to right, rgba(0, 0, 255, 0.75) 0%, rgba(0, 0, 255, 0.75) 20%, transparent 20%, rgba(255, 0, 0, 0.75) 20%, rgba(255, 0, 0, 0.75) 100%); }
+
#event_reminder_list {
position: absolute;
display: flex;
diff --git a/play.js b/play.js
index 5dbf88d..3bc336f 100644
--- a/play.js
+++ b/play.js
@@ -279,6 +279,12 @@ var LAYOUT = {
"Wroclaw": [595,565,127,75],
"action_1": [708,143,48,44],
"action_8": [1080,143,47,43],
+ "box_bulgaria": [935,2101,15,100],
+ "box_czechoslovakia": [473,736,15,100],
+ "box_east_germany": [578,262,15,100],
+ "box_hungary": [1054,1421,15,100],
+ "box_poland": [1202,400,15,100],
+ "box_romania": [1307,1450,15,100],
"country_bulgaria": [915,1999,46,41],
"country_czechoslovakia": [463,624,44,39],
"country_east_germany": [560,160,43,37],
@@ -398,6 +404,22 @@ function create_country(id, name) {
ui.countries[id] = e
document.getElementById("markers").appendChild(e)
}
+/*
+function create_score_box(id, name) {
+ let [ x, y, w, h ] = LAYOUT[name]
+ let xc = Math.round(x + w / 2)
+ let yc = Math.round(y + h / 2)
+
+ //Create dynamic scoring box
+ let b = document.createElement("div")
+ b.className = "box"
+ b.style.left = xc - 110 + "px"
+ b.style.top = yc - 76 + "px"
+ b.id = name
+ ui.score_box[id] = b
+
+ document.getElementById("markers").appendChild(b)
+}*/
const INF_DX = 33
const INF_DY = 10
@@ -507,12 +529,19 @@ function create_ui() {
}
ui.countries = []
+ ui.score_box = []
create_country(0, "country_poland")
create_country(1, "country_hungary")
create_country(2, "country_east_germany")
create_country(3, "country_bulgaria")
create_country(4, "country_czechoslovakia")
create_country(5, "country_romania")
+ /*create_score_box(0, "box_poland")
+ create_score_box(1, "box_hungary")
+ create_score_box(2, "box_east_germany")
+ create_score_box(3, "box_bulgaria")
+ create_score_box(4, "box_czechoslovakia")
+ create_score_box(5, "box_romania")*/
}
function layout_turn_marker() {
@@ -595,15 +624,32 @@ function layout_vp_marker() {
}
function layout_country(id) {
- for (let i = 0; i < 6; i++) {
// TODO: what number to display?
- if (view.revolutions[id])
- ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id]
- else if (view.times_held[id] > 0)
- ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id]
- else
- ui.countries[id].className = "marker hide"
- }
+ if (view.revolutions[id])
+ ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id]
+ else if (view.times_held[id] > 0)
+ ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id]
+ else
+ ui.countries[id].className = "marker hide"
+}
+
+function layout_score_box(id) {
+ console.log('ui.score_box[i]', ui.score_box[id])
+ let country = ui.score_box[id].id.replace(/^box_/,'')
+ let status = check_presence(country)
+ ui.score_box[id].className = 'box'
+ if (status.dem_spaces > 0)
+ ui.score_box[id].classList.add('d_pres')
+ if (status.com_spaces >0)
+ ui.score_box[id].classList.add('c_pres')
+ if (status.dem_domination)
+ ui.score_box[id].classList.add('d_dom')
+ if (status.com_domination)
+ ui.score_box[id].classList.add('c_dom')
+ if (status.dem_control)
+ ui.score_box[id].classList.add('d_ctrl')
+ if (status.com_control)
+ ui.score_box[id].classList.add('c_ctrl')
}
function layout_inf_markers(cn, one, two, three, v, ctl) {
@@ -628,6 +674,80 @@ function layout_inf_markers(cn, one, two, three, v, ctl) {
}
}
+
+function check_presence(country) {
+
+ let dem_spaces = 0
+ let com_spaces = 0
+ let dem_battlegrounds = 0
+ let com_battlegrounds = 0
+ //console.log('checking country', country)
+ for (let i = 0; i < spaces.length; i++) {
+ let space = spaces[i]
+ //console.log('checking space', space.ascii_name, 'space.country', space.country.toLowerCase)
+ if (space.country.toLowerCase() === country) {
+ //console.log('space', space.ascii_name, 'is in', country)
+ if (check_dem_control(i)) {
+ dem_spaces++
+ if (space.battleground === 1)
+ dem_battlegrounds++
+ }
+ if (check_com_control(i)) {
+ com_spaces++
+ if (space.battleground === 1)
+ com_battlegrounds++
+ }
+ }
+ }
+
+ // Determine domination
+ let dem_domination = dem_battlegrounds > com_battlegrounds && dem_spaces > com_spaces && dem_spaces - dem_battlegrounds > 0
+ let com_domination = com_battlegrounds > dem_battlegrounds && com_spaces > dem_spaces && com_spaces - com_battlegrounds > 0
+
+ // Determine control
+ let total_battlegrounds = battlegrounds(country)
+ let dem_control = dem_battlegrounds === total_battlegrounds && dem_spaces > com_spaces
+ let com_control = com_battlegrounds === total_battlegrounds && com_spaces > dem_spaces
+ console.log(country, 'dem_battlegrounds', dem_battlegrounds, 'total_battlegrounds', total_battlegrounds, 'dem_spaces', dem_spaces, 'com_spaces', com_spaces)
+ return {
+ dem_spaces: dem_spaces,
+ com_spaces: com_spaces,
+ dem_domination: dem_domination,
+ com_domination: com_domination,
+ dem_control: dem_control,
+ com_control: com_control,
+ }
+}
+
+function battlegrounds(country) {
+ let battlegrounds = 0
+ if (country === 'hungary') {
+ battlegrounds = 4
+ } else if (country === 'bulgaria') {
+ battlegrounds = 5
+ } else {
+ battlegrounds = 6
+ }
+ return battlegrounds
+}
+
+function check_dem_control(space_id) {
+ if ((view.demInfl[space_id] - view.comInfl[space_id]) >= spaces[space_id].stability) {
+ return true
+ } else {
+ return false
+ }
+}
+
+function check_com_control(space_id) {
+ if ((view.comInfl[space_id] - view.demInfl[space_id]) >= spaces[space_id].stability) {
+ return true
+ } else {
+ return false
+ }
+}
+
+
function on_update() {
if (!ui.spaces)
create_ui()
@@ -713,9 +833,10 @@ function on_update() {
// UPDATE COUNTRY MARKERS
- for (let i = 0; i < 6; ++i)
+ for (let i = 0; i < 6; ++i) {
layout_country(i)
-
+ /*layout_score_box(i)*/
+ }
// UPDATE CARD DISPLAYS
ui.samizdat_card.replaceChildren()
@@ -864,12 +985,11 @@ function sub_die(match) {
}
function sub_icon(match) {
- console.log('sub_icon called, match', match)
return ICONS[match] || match
}
function sub_arrow(match) {
- return '<span>&#8594</span>'
+ return '<span>&nbsp&#8594&nbsp</span>'
}
const ICONS = {
@@ -877,6 +997,7 @@ const ICONS = {
'£CU': '<span class="icon com_nc"></span>',
'£DC': '<span class="icon dem_c"></span>',
'£DU': '<span class="icon dem_nc"></span>',
+ '£UU': '<span class="number icon"></span>',
'.dT5': '<span class="number d_tst">5</span>',
'.dT6': '<span class="number d_tst">6</span>',
'.dT7': '<span class="number d_tst">7</span>',
@@ -901,7 +1022,7 @@ const die = {
function on_log(text, ix) {
let p = document.createElement("div")
- console.log('text', text)
+ //console.log('text', text)
let event_string = text.match(/^C(\d+)/)
if (event_string)
event_n = parseInt(event_string[1])
@@ -915,18 +1036,16 @@ function on_log(text, ix) {
p.className = "i"
}
- console.log('text', text)
-
text = text.replace(/_/g, " ")
text = text.replace(/C(\d+)/g, sub_card_name)
text = text.replace(/P(\d+)/g, sub_power_card_name)
text = text.replace(/V(\d+)/g, sub_power_card_value)
text = text.replace(/%(\d+)/g, sub_space_name)
text = text.replace(/D[1-6]/g, sub_die)
- text = text.replace(/£[CD][CU]\b/g, sub_icon)
+ text = text.replace(/£[CDU][CU]\b/g, sub_icon)
text = text.replace(/\.cT(\d+)/g, sub_icon)
text = text.replace(/\.dT(\d+)/g, sub_icon)
- text = text.replace(/\.to/g, sub_arrow)
+ text = text.replace(/\s\.to\s/g, sub_arrow)
if (text.match(/^\.h1/)) {
text = text.substring(4)
@@ -980,6 +1099,14 @@ function on_log(text, ix) {
text = text.substring(4)
p.className = "h3"
log_event = 0
+ } else if (text.match(/^\.h4/)) {
+ text = text.substring(4)
+ p.className = "h4"
+ log_event = 0
+ } else if (text.match(/^\.h5/)) {
+ text = text.substring(4)
+ p.className = "h5"
+ log_event = 0
}
//Group events
diff --git a/rules.js b/rules.js
index 7f62a07..e3bc05e 100644
--- a/rules.js
+++ b/rules.js
@@ -1071,7 +1071,7 @@ states.support_check_prep = {
if (game.return !== game.active) {
next_player()
}
- log_h3('Raise the Stakes')
+ log_h5('Raise the Stakes')
log(`${game.active}:`)
game.state = 'raise_stakes_1'
return
@@ -1091,6 +1091,8 @@ states.do_support_check = {
clear_undo()
do_sc(game.selected_space)
game.available_ops--
+ if (game.available_ops > 0)
+ log_br()
if (game.available_ops === 0) {
game.valid_spaces = []
}
@@ -1220,7 +1222,7 @@ states.draw_power_cards = {
game.persistent_events.push(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)
game.state = 'the_crowd_turns_against_ceausescu_prep'
} else {
- log_h3('Raise the Stakes')
+ log_h5('Raise the Stakes')
log(`${game.active}:`)
game.state = 'raise_stakes_1'
}
@@ -1296,7 +1298,7 @@ states.the_crowd_turns_against_ceausescu_infl = {
if (game.return !== game.active) {
change_player()
}
- log_h3('Raise the Stakes')
+ log_h5('Raise the Stakes')
log(`${game.active}:`)
game.state = 'raise_stakes_1'
},
@@ -1349,7 +1351,7 @@ states.raise_stakes_1 = {
} else {
game.valid_cards = [...game.com_pwr_hand]
}
- game.state = 'raise_stakes_2'
+ end_raise_stakes()
},
done() {
logi(`Raised the stakes.`)
@@ -1361,7 +1363,7 @@ states.raise_stakes_1 = {
} else {
game.valid_cards = [...game.com_pwr_hand]
}
- game.state = 'raise_stakes_2'
+ end_raise_stakes()
},
}
@@ -1559,8 +1561,8 @@ states.power_struggle = {
delete game.power_card_1
delete game.power_card_2
log(`${game.active} conceded.`)
- log_h2('Aftermath')
- log_h3('Support Loss')
+ log_h4('Aftermath')
+ log_h5('Support Loss')
if (game.phase === 0) {
game.played_power_card = 0
game.proxy_power_card = 0 /* If conceded when held the initiative but had no playable cards, ignore the last played card */
@@ -1637,7 +1639,7 @@ states.support_loss = {
done() {
do_log_summary()
change_player()
- log_h3('Victory Point')
+ log_h5('Victory Point')
game.phase = 0
game.state = 'vp_roll'
},
@@ -1937,8 +1939,9 @@ states.general_strike = {
silent_discard(card)
game.available_ops = get_card_ops(card)
if (scoring_cards.includes(card)) {
+ game.played_card = card
game.vm_event = card
- log(`Played C${card} for the event`)
+ log(`Played C${card} for the event.`)
game.return_state = 'end_round'
goto_vm(game.vm_event)
} else {
@@ -1960,7 +1963,7 @@ states.general_strike_roll = {
log(`Roll: D${roll}`)
logi(`+${game.available_ops} ops`)
let total = roll + game.available_ops
- log(`Modified roll: ${total}`)
+ //log(`Modified roll: ${total}`)
if (total > 5) {
log(`Success: ${total} > 5.`)
log('The strike is over.')
@@ -2196,19 +2199,53 @@ states.stasi_resolve_common_european_home = {
},
yes() {
push_undo()
- log(`Played C${game.played_card} with C${C_COMMON_EUROPEAN_HOME}.`)
+ //log(`Played C${game.played_card} with C${C_COMMON_EUROPEAN_HOME}.`)
silent_discard(C_COMMON_EUROPEAN_HOME)
game.vm_infl_to_do = true
game.vm_event_to_do = false
- game.state = 'resolve_opponent_event'
+ game.state = 'stasi_play_ceh'
},
no() {
push_undo()
- log(`Played C${game.played_card}.`)
+ //log(`Played C${game.played_card}.`)
game.state = 'play_card'
},
}
+states.stasi_play_ceh = {
+ get inactive() {
+ return `play ${quoted_card_name[game.played_card]}.`
+ },
+ prompt() {
+ view.prompt = "Play " + quoted_card_name[game.played_card]
+ gen_action('influence')
+ gen_action('support_check')
+ },
+ influence() {
+ push_undo()
+ log_ops_banner()
+ log(`Played C${game.played_card} with C${C_COMMON_EUROPEAN_HOME}.`)
+ check_ligachev_non_event()
+ log('Placed SP:')
+ // If ABHR - Set AHBR tracker to true
+ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
+ game.austria_hungary_border_reopened_tracker = true
+ }
+ game.state = 'add_influence'
+ valid_spaces_infl()
+ },
+ support_check() {
+ push_undo()
+ log_ops_banner()
+ log(`Played C${game.played_card} with C${C_COMMON_EUROPEAN_HOME}.`)
+ check_ligachev_non_event()
+ log('Support Checks:')
+ game.available_ops = 2
+ game.state = 'support_check_prep'
+ valid_spaces_sc()
+ },
+}
+
// ==================== SUPPORTING STATE FUNCTIONS =============================
function add_infl(space, ops) {
@@ -2349,7 +2386,7 @@ function do_sc(space) {
clear_undo()
let tear_gas_start = game.persistent_events.includes(C_TEAR_GAS)
let the_wall_start = game.persistent_events.includes(C_THE_WALL)
- log(`Support Check, %${space}:`)
+ logi(`%${space}:`)
let starting_control = check_control(space)
let roll = roll_d6()
@@ -2771,35 +2808,44 @@ function check_control(space) {
}
function get_icons(starting_control, end_control) {
- console.log('starting_control', starting_control, 'end_control', end_control)
- if (starting_control !== end_control) {
- console.log('in long bit')
- if (starting_control === DEM && end_control === COM)
- return ' (£DC .to £CC)'
- else if (starting_control === COM && end_control === COM)
- return ' (£CC .to £DC)'
- else if (starting_control === 'd_ahead' && end_control === DEM)
- return ' (£DU .to £DC)'
- else if (starting_control === 'd_ahead' && end_control === COM)
- return ' (£DU .to £DC)'
- else if (starting_control === 'c_ahead' && end_control === DEM)
- return ' (£CU .to £DC)'
- else if (starting_control === 'c_ahead' && end_control === COM)
- return ' (£CU .to £CC)'
- else if (starting_control === DEM && (end_control === 'd_ahead' || 'none'))
- return ' (£DC .to £DU)'
- else if (starting_control === DEM && end_control === 'c_ahead')
- return ' (£DC .to £CU)'
- else if (starting_control === COM && (end_control === 'c_ahead' || 'none'))
- return ' (£CC .to £CU)'
- else if (starting_control === COM && end_control === 'd_ahead')
- return ' (£CC .to £DU)'
- else if (starting_control === 'none' && end_control === DEM)
- return ' (£DU .to £DC)'
- else if (starting_control === 'none' && end_control === COM)
- return ' (£CU .to £CC)'
- else
- return ''
+ if (game.state !== 'place_starting_infl') {
+ if (starting_control !== end_control) {
+ console.log('in long bit')
+ if (starting_control === DEM && end_control === COM)
+ return ' (£DC .to £CC)'
+ else if (starting_control === COM && end_control === COM)
+ return ' (£CC .to £DC)'
+ else if (starting_control === 'd_ahead' && end_control === DEM)
+ return ' (£DU .to £DC)'
+ else if (starting_control === 'd_ahead' && end_control === COM)
+ return ' (£DU .to £DC)'
+ else if (starting_control === 'c_ahead' && end_control === DEM)
+ return ' (£CU .to £DC)'
+ else if (starting_control === 'c_ahead' && end_control === COM)
+ return ' (£CU .to £CC)'
+ else if (starting_control === DEM && end_control === 'd_ahead')
+ return ' (£DC .to £DU)'
+ else if (starting_control === DEM && end_control === 'none')
+ return ' (£DC .to £UU)'
+ else if (starting_control === DEM && end_control === 'c_ahead')
+ return ' (£DC .to £CU)'
+ else if (starting_control === COM && end_control === 'c_ahead')
+ return ' (£CC .to £CU)'
+ else if (starting_control === COM && end_control === 'none')
+ return ' (£CC .to £UU)'
+ else if (starting_control === COM && end_control === 'd_ahead')
+ return ' (£CC .to £DU)'
+ else if (starting_control === 'none' && end_control === DEM)
+ return ' (£UU .to £DC)'
+ else if (starting_control === 'none' && end_control === COM)
+ return ' (£UU .to £CC)'
+ /*else if (starting_control === 'none' && end_control === 'd_ahead')
+ return ' (£UU .to £DU)'
+ else if (starting_control === 'none' && end_control === 'c_ahead')
+ return ' (£UU .to £CU)'*/
+ else
+ return ''
+ }
} else
return ''
}
@@ -3001,7 +3047,7 @@ function retain_power(country) {
}
function score_country(country) {
- log_h3(`Scoring: ${country}`)
+ log_h4(`Scoring: ${country}`)
// Get scoring values
let value_presence = get_value(country)
@@ -3222,7 +3268,7 @@ function goto_game_over(result, victory) {
function goto_struggle() {
game.raised_stakes_discard = 0
game.valid_cards = []
- log_h3('Play Cards')
+ log_h5('Play Cards')
change_player()
game.state = 'power_struggle'
do_valid_cards()
@@ -3269,6 +3315,24 @@ function end_goddess() {
}
}
+function end_raise_stakes(){
+ if (game.active === DEM){
+ if (game.dem_pwr_hand.length >= 3)
+ game.state = 'raise_stakes_2'
+ else {
+ logi('Could not raise the stakes.')
+ goto_struggle()
+ }
+ } else {
+ if (game.com_pwr_hand.length >= 3)
+ game.state = 'raise_stakes_2'
+ else {
+ logi('Could not raise the stakes.')
+ goto_struggle()
+ }
+ }
+}
+
function check_reformer() {
/* Is this function still used? */
if (game.dem_tst_position !== game.com_tst_position) {
@@ -3304,9 +3368,11 @@ function select_card(card) {
game.state = 'play_card'
}
function finish_select_card() {
- if (!scoring_cards.includes(game.played_card))
+ if (!scoring_cards.includes(game.played_card)) {
game.available_ops = get_card_ops(game.played_card)
- log(`Played C${game.played_card}.`)
+ if (game.state !== 'stasi_play_ceh')
+ log(`Played C${game.played_card}.`)
+ }
}
function check_ligachev_non_event() {
@@ -4360,6 +4426,16 @@ function log_h3(msg) {
log(".h3 " + msg)
}
+function log_h4(msg) {
+ log_br()
+ log(".h4 " + msg)
+}
+
+function log_h5(msg) {
+ log_br()
+ log(".h5 " + msg)
+}
+
function log_gap(msg) {
log_br()
game.log.push(msg)
@@ -5187,7 +5263,7 @@ function vm_replace_all_infl(space_id) {
function vm_1_support_check() {
game.vm_available_ops = 1
- //log('Support Check:')
+ log('Support Check:')
if (game.valid_spaces.length === 0)
logi('None')
game.state = 'vm_1_support_check_prep'
@@ -5195,20 +5271,20 @@ function vm_1_support_check() {
function vm_support_check() {
game.vm_available_ops = vm_operand(1)
- /*if (game.vm_available_ops > 1)
+ if (game.vm_available_ops > 1)
log('Support Checks:')
else
- log('Support Check:')*/
+ log('Support Check:')
game.state = 'vm_support_check_prep'
}
function vm_support_check_modified() {
game.vm_available_ops = vm_operand(1)
game.support_check_modifier = vm_operand(2)
-/* if (game.vm_available_ops > 1)
+ if (game.vm_available_ops > 1)
log('Support Checks:')
else
- log('Support Check:')*/
+ log('Support Check:')
game.state = 'vm_support_check_prep'
}
@@ -5808,7 +5884,7 @@ function vm_power_struggle() {
log(`C${C_SECURITATE}: Democrat reveals Power Struggle cards.`)
game.opp_power_hand = true
}
- log_h3('Deal Cards')
+ log_h5('Deal Cards')
game.state = 'draw_power_cards'
}
@@ -6615,6 +6691,8 @@ states.vm_ceh_do_support_check = {
clear_undo()
do_sc(game.selected_space)
game.vm_available_ops--
+ if (check_vp())
+ return
if (game.vm_available_ops === 0) {
game.valid_spaces = []
vm_next()
@@ -6707,13 +6785,13 @@ states.vm_adamec = {
roll() {
clear_undo()
let roll = roll_d6()
- log(`Roll: D${roll}`)
+ logi(`D${roll} from roll`)
let worker_spaces = spaces.filter(space => space && space.country === 'Czechoslovakia' && space.socio === SOCIO_WORKER && check_dem_control(space.space_id)).length
if (worker_spaces > 0) {
logi(`-${worker_spaces} from Democrat controlled worker spaces`)
roll -= worker_spaces
}
- log(`Modified roll: ${Math.max(roll, 0)}`)
+ //log(`Modified roll: ${Math.max(roll, 0)}`)
if (roll > 2) {
log(`Success: ${roll} >= 3`)
vm_next()
@@ -7487,7 +7565,7 @@ states.vm_kremlin_coup_sc_prep = {
},
space(_space) {
push_undo()
- //log('Support check:')
+ log('Support check:')
game.state = 'vm_kremlin_coup_sc'
},
}
@@ -7567,10 +7645,10 @@ states.vm_malta_summit = {
roll() {
clear_undo()
let roll = roll_d6()
- log(`Roll: D${roll}`)
+ logi(`D${roll} from roll`)
if (game.stability > 0) {
logi(`+${Math.min(game.stability, 3)} from USSR Stability Track`)
- log(`Modified roll: ${roll + Math.min(game.stability, 3)}`)
+ //log(`Modified roll: ${roll + Math.min(game.stability, 3)}`)
}
if (roll + game.stability > 3) {
log(`Success: ${roll + game.stability} >= 4`)
@@ -7854,9 +7932,9 @@ states.vm_shock_therapy = {
worker_farmer++
}
}
- log(`Roll: D${roll}`)
+ logi(`D${roll} from roll`)
logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`)
- log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`)
+ //log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`)
if ((roll - worker_farmer) > 2) {
log(`Success: ${roll - worker_farmer} >= 3`)
log('+3 VP')
@@ -8241,7 +8319,7 @@ states.vm_workers_revolt_finish = {
roll() {
clear_undo()
let roll = roll_d6()
- log(`Roll: D${roll}`)
+ logi(`D${roll} from roll`)
let adj = count_adj(game.selected_space)
if (game.active === DEM) {
logi(`-${adj.com_adj} from opponent controlled spaces`)
@@ -8250,7 +8328,7 @@ states.vm_workers_revolt_finish = {
logi(`-${adj.dem_adj} from opponent controlled spaces`)
roll -= adj.dem_adj
}
- log(`Modified roll: ${Math.max(roll, 0)}`)
+ //log(`Modified roll: ${Math.max(roll, 0)}`)
if (roll >= 4) {
log(`Success: ${roll} >= 4`)
vm_replace_all_infl(game.selected_space)