summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js365
1 files changed, 179 insertions, 186 deletions
diff --git a/rules.js b/rules.js
index a65383e..467a33d 100644
--- a/rules.js
+++ b/rules.js
@@ -209,6 +209,8 @@ const dem_tst_req = [5, 5, 6, 6, 7, 8, 9, 10]
const com_tst_req = [6, 6, 7, 7, 8, 7, 6, 5]
const scoring_cards = [22, 23, 42, 43, 55, 95]
const leader_cards = [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48]
+const wildcards = [49, 50, 51, 52]
+const elite_leaders = [37, 38, 39, 40]
const leaders = [1, 4, 5, 6, 7]
const support_loss_roll = [0, 0, 1, 1, 2, 2, 3, 4]
const vp_roll = [0, 0, 1, 1, 2, 2, 3, 4]
@@ -219,6 +221,15 @@ const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45,
const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108]
const switch_events = [6, 20, 71]
+// COUNTRY CONSTANTS
+
+const S_EAST_GERMANY = [0,1,2,3,4,5,6,7,8,9,10,11]
+const S_POLAND = [12,13,14,15,16,17,18,19,20,21,22,23,24,25]
+const S_CZECHOSLOVAKIA = [26,27,28,29,30,31,32,33,34,35,36]
+const S_HUNGARY = [37,38,39,40,41,42,43,44,45,46,47,48]
+const S_ROMANIA = [49,50,51,52,53,54,55,56,57,58,59,60,61,62]
+const S_BULGARIA = [63,64,65,66,67,68,69,70,71,72,73,74]
+
exports.scenarios = [ "Standard" ]
exports.roles = [ DEM, COM ]
@@ -324,7 +335,7 @@ function start_game() {
// Set variable event cards where event is playable at start of game
- game.playable_cards = [14, 15, 21, 70]
+ game.playable_cards = [C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE]
//console.log('game.strategy_deck: ', game.strategy_deck[1])
draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit)
@@ -759,7 +770,7 @@ states.play_card ={
// Check if Common European Home played for influence
- if (game.played_card === 21) {
+ if (game.played_card === C_COMMON_EUROPEAN_HOME) {
if (game.active === DEM) {
game.vp --
log('-1 VP')
@@ -2305,12 +2316,12 @@ states.honecker ={
push_undo()
game.round++
game.round_player = COM
- game.persistent_events = game.persistent_events.filter(n => n !== 15)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER)
game.state = 'choose_card'
},
pass() {
- log('C15: passed')
- game.persistent_events = game.persistent_events.filter(n => n !== 15)
+ log(`C${C_HONECKER}: passed`)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER)
//end_round()
game.state = 'end_round'
}
@@ -2422,7 +2433,7 @@ states.stasi_end_round = {
},
end_round() {
push_undo()
- if (game.stasi_card === 21) {
+ if (game.stasi_card === C_COMMON_EUROPEAN_HOME) {
game.state = 'stasi_confirm'
} else {
end_stasi_choose_card()
@@ -2438,7 +2449,7 @@ states.stasi_finish = {
},
done() {
push_undo()
- if (game.stasi_card === 21) {
+ if (game.stasi_card === C_COMMON_EUROPEAN_HOME) {
game.state = 'stasi_confirm'
} else {
end_stasi_choose_card()
@@ -2449,13 +2460,13 @@ states.stasi_finish = {
states.stasi_confirm = {
inactive: 'choose next card due to Stasi.',
prompt() {
- if (game.stasi_card === 21 ) {
+ if (game.stasi_card === C_COMMON_EUROPEAN_HOME ) {
view.prompt = `If Common European Home selected, it must be played for Operations. Otherwise select the opponent's card instead.`
gen_action('done')
}
},
done() {
- game.playable_cards = game.playable_cards.filter( n => n !== 21)
+ game.playable_cards = game.playable_cards.filter( n => n !== C_COMMON_EUROPEAN_HOME)
end_stasi_choose_card()
}
}
@@ -2489,7 +2500,7 @@ states.stasi_play_card = {
game.democrat_hand.splice(find_card, 1);
game.available_ops = get_card_ops(card)
- if (game.democrat_hand.includes(21) && cards[card].side === "C") {
+ if (game.democrat_hand.includes(C_COMMON_EUROPEAN_HOME) && cards[card].side === "C") {
game.state = 'stasi_resolve_common_european_home'
} else {
game.state = 'play_card'
@@ -2503,7 +2514,7 @@ states.stasi_play_card = {
},
done () {
//game.stasi_card = 0
- if (game.democrat_hand.includes(21)) {
+ if (game.democrat_hand.includes(C_COMMON_EUROPEAN_HOME)) {
game.state = 'stasi_resolve_common_european_home'
} else {
game.state = 'play_card'
@@ -2520,7 +2531,7 @@ states.stasi_resolve_common_european_home = {
},
yes() {
log(`Played with Common European Home`)
- silent_discard(21)
+ silent_discard(C_COMMON_EUROPEAN_HOME)
game.vm_infl_to_do = true
game.vm_event_to_do = false
game.state = 'resolve_opponent_event'
@@ -2573,7 +2584,7 @@ function add_infl(space) {
check_control_change(space)
// Check Austria Hungary Border Reopened is true and condition has been met
- if (game.available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) {
+ if (game.available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) {
game.available_ops ++
log('+1 op from C58')
game.austria_hungary_border_reopened_tracker = false
@@ -2867,16 +2878,16 @@ function valid_spaces_sc() {
infl = game.demInfl[i]
if (infl !== 0 ) {
// Check Solidarity Legalised
- if (game.persistent_events.includes(2) && space.space_id === 13) {continue}
+ if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue}
// Check Civic Forum
- if (game.persistent_events.includes(90) && space.space_id === 29) {continue}
+ if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue}
// Check We Are the People
- if (game.persistent_events.includes(48) && space.space_id === 8) {continue}
+ if (game.persistent_events.includes(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue}
//Check for Foreign Currency Debt Burden
- if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} {
+ if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && space.country === game.foreign_currency_debt_burden) {continue} {
valid_spaces_set.add(space.space_id);
@@ -3576,7 +3587,7 @@ function select_card(card){
game.available_ops = get_card_ops(card)
//Check Ligachev
- if (game.active === DEM && game.persistent_events.includes(99) && card !== 14) {
+ if (game.active === DEM && game.persistent_events.includes(99) && card !== C_GORBACHEV_CHARMS_THE_WEST) {
log('-3 VP from C99')
game.vp -= 3
if (check_vp()) {
@@ -3604,7 +3615,7 @@ function is_auto_resolve(card) {
else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) {
return true
}
- else if (card === 87 && !game.persistent_events.includes(86)) {
+ else if (card === 87 && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) {
return true
}
else if (auto_resolve_events.includes(card)) {
@@ -3637,7 +3648,7 @@ function event_is_playable(card) {
return false
}
//Check for Common European Hmme under Stasi
- else if (game.stasi_card === 21 && card === 21 && game.active === DEM) {
+ else if (game.stasi_card === C_COMMON_EUROPEAN_HOME && card === C_COMMON_EUROPEAN_HOME && game.active === DEM) {
return false
}
//Check for The Chinese Solution
@@ -3788,7 +3799,7 @@ function finish_the_wall() {
// =========== MOVING THROUGH TURNS ============
function end_round() {
-// console.log('end round, game.persistent_events.includes(13)', game.persistent_events.includes(13))
+
//Check if the game is over!
if (game.state === 'game_over') {
// console.log('in end')
@@ -3815,7 +3826,6 @@ function end_round() {
game.valid_cards = []
game.valid_spaces = []
check_common_european_home()
- //game.playable_cards[find_event(21)] = true
reset_austria_hungary_border_reopened() /*This should be redundant! */
@@ -3867,7 +3877,7 @@ function end_round() {
// Check if last round and if so resolve end turn events
if (game.round_player === DEM && game.round === 7) {
- if(game.persistent_events.includes(15)) {
+ if(game.persistent_events.includes(C_HONECKER)) {
if (game.active !== COM) {
next_player()
}
@@ -3946,7 +3956,7 @@ function end_round() {
return
}
if (game.round_player === DEM) {
- // console.log('checking stasi', game.persistent_events.includes(13))
+
if(game.persistent_events.includes(13)) {
// console.log('stasi sub function')
if (game.active !== DEM) {
@@ -4022,7 +4032,7 @@ function new_turn() {
game.persistent_events = game.persistent_events.filter(n => n !== 25) /*Perestroika*/
game.persistent_events = game.persistent_events.filter(n => n !== 50) /*Sinatra Doctrine*/
game.persistent_events = game.persistent_events.filter(n => n !== 13) /*Stasi*/
- game.persistent_events = game.persistent_events.filter(n => n !== 15) /*Honecker*/
+ game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) /*Honecker*/
delete game.prudence
delete game.stasi_card
@@ -4357,10 +4367,10 @@ function reset_power() {
//game.table_cards = game.table_cards.filter(card => card !== 54)
}
- if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(70)){
- //permanently_remove(70)
- //game.table_cards = game.table_cards.filter(card => card !== 70)
- game.persistent_events = game.persistent_events.filter(n => n !== 70)
+ if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)){
+ //permanently_remove(C_SECURITATE)
+ //game.table_cards = game.table_cards.filter(card => card !== C_SECURITATE)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE)
}
}
@@ -4374,7 +4384,7 @@ function check_control_change(space_id) {
if (check_vp()) {
return
}
- game.persistent_events = game.persistent_events.filter(n => n !== 97)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_THE_TYRANT_IS_GONE)
delete game.the_tyrant_is_gone
}
}
@@ -4387,8 +4397,8 @@ function check_systematization() {
}
function check_common_european_home() {
- if (!game.playable_cards.includes(21)) {
- game.playable_cards.push(21)
+ if (!game.playable_cards.includes(C_COMMON_EUROPEAN_HOME)) {
+ game.playable_cards.push(C_COMMON_EUROPEAN_HOME)
}
}
@@ -4993,13 +5003,13 @@ function vm_valid_spaces_country_sc () {
} else {
if (space.country === country && game.demInfl[space.space_id] >0) {
//Check Solidarity Legalised
- if (game.persistent_events.includes(2) && space.space_id === 13) {continue}
+ if (game.persistent_events.includes(2) && space.space_id === S_GDANSK) {continue}
//Check Civic Forum
- if (game.persistent_events.includes(90) && space.space_id === 29) {continue}
+ if (game.persistent_events.includes(90) && space.space_id === S_CHARLES_UNIVERSITY) {continue}
//Check We are the People
- if (game.persistent_events.includes(48) && space.space_id === 8) {continue}
+ if (game.persistent_events.includes(48) && space.space_id === S_LEIPZIG) {continue}
valid_spaces.push(space.space_id);
//Check Foreign Currency Debt Burden
@@ -5507,10 +5517,10 @@ function vm_adamec() {
}
function vm_army_backs_revolution() {
- game.persistent_events = game.persistent_events.filter(n => n !== 70)
- game.playable_cards = game.playable_cards.filter(n => n !== 70)
- /*if (game.table_cards.includes(70)) {
- permanently_remove(70)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE)
+ game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE)
+ /*if (game.table_cards.includes(C_SECURITATE)) {
+ permanently_remove(C_SECURITATE)
}*/
vm_next()
}
@@ -5539,9 +5549,9 @@ function vm_breakaway_baltic_republics() {
return
}
game.playable_cards.push(109)
- game.playable_cards = game.playable_cards.filter(n => n !== 14)
- if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)}
- if (!check_dem_control(69)) {game.valid_spaces.push(69)}
+ game.playable_cards = game.playable_cards.filter(n => n !== C_GORBACHEV_CHARMS_THE_WEST)
+ if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)}
+ if (!check_dem_control(S_RAZGRAD)) {game.valid_spaces.push(S_RAZGRAD)}
vm_next()
}
@@ -5561,25 +5571,20 @@ function vm_bulgarian_turks_expelled(){
if (check_vp()) {
return
}
- if (game.demInfl[70] > 0) {game.valid_spaces = [70]}
+ if (game.demInfl[S_RAZGRAD] > 0) {game.valid_spaces = [S_RAZGRAD]}
vm_next()
}
function vm_ceausescu() {
let adj_cluj = false
- let Timisoara = spaces.find(space => space.ascii_name === "Timisoara").space_id
- let Babes = spaces.find(space => space.ascii_name === "Babes-Bolyai University").space_id
- let Church = spaces.find(space => space.ascii_name === "Orthodox Church, Romania").space_id
- let Bucuresti = spaces.find(space => space.ascii_name === "Bucuresti").space_id
-
- if (game.demInfl[Timisoara] > 0 ) {adj_cluj = true}
- if (game.demInfl[Babes] > 0 ) {adj_cluj = true}
- if (game.demInfl[Church] > 0 ) {adj_cluj = true}
- if (game.demInfl[Bucuresti] > 0 ) {adj_cluj = true}
+ if (game.demInfl[S_TIMISOARA] > 0 ) {adj_cluj = true}
+ if (game.demInfl[S_BABES_BOLYAI_UNIVERSITY] > 0 ) {adj_cluj = true}
+ if (game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] > 0 ) {adj_cluj = true}
+ if (game.demInfl[S_BUCURESTI] > 0 ) {adj_cluj = true}
- if (adj_cluj && game.comInfl[Bucuresti]>0) {
- game.valid_spaces = [60]
+ if (adj_cluj && game.comInfl[S_BUCURESTI]>0) {
+ game.valid_spaces = [S_BUCURESTI]
game.vm_available_ops = 1
//next_player()
game.remove_opponent_infl = false
@@ -5598,11 +5603,11 @@ function vm_civic_forum() {
if (check_vp()) {
return
}
- game.persistent_events.push(90)
- if (check_dem_control(30)) {
+ game.persistent_events.push(C_CIVIC_FORUM)
+ if (check_dem_control(S_CZECH_WRITERS)) {
vm_next()
} else {
- permanently_remove(90)
+ permanently_remove(C_CIVIC_FORUM)
vm_return()
}
}
@@ -5675,23 +5680,21 @@ function vm_eliminate(space_id) {
log(`Eliminated %${space_id}`)
const adjacent_spaces = spaces[space_id].adjacent.filter(Number.isInteger);
- //console.log('adjacency before: Iasi', game.pieces[53].adjacent, 'Ploesti:', game.pieces[59].adjacent, 'Bucharesti:', game.pieces[61].adjacent)
-
- // Eliminate the democrat influence and move the communist influence to Bucuresti
- if (space_id === 60) {
+ // Eliminate the democrat influence and move the communist influence to Bucuresti
+ if (space_id === S_BUCURESTI) {
game.demInfl[space_id] = 0
game.comInfl[space_id] = 0
} else {
game.demInfl[space_id] = 0
- game.comInfl[60] += game.comInfl[space_id]
+ game.comInfl[S_BUCURESTI] += game.comInfl[space_id]
if (game.comInfl[space_id] > 0 ) {
- log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %60`)
+ log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %${S_BUCURESTI}`)
}
game.comInfl[space_id] = 0
}
//Update control in the eliminated space and in Bucuresti
check_control_change(space_id)
- check_control_change(60)
+ check_control_change(S_BUCURESTI)
}
@@ -5737,7 +5740,7 @@ function vm_foreign_currency_debt_burden() {
function vm_foreign_television() {
for (let i = 0 ; i < spaces.length; i++) {
- if (i === 11) {continue} /*Does not apply to Dresden*/
+ if (i === S_DRESDEN) {continue} /*Does not apply to Dresden*/
if (game.comInfl[i] > 0 ) {
game.valid_spaces.push(i)
}
@@ -5828,7 +5831,7 @@ function vm_helsinki_final_act() {
}
function vm_honecker() {
- game.persistent_events.push(15)
+ game.persistent_events.push(C_HONECKER)
game.valid_cards = []
for (let c of game.strategy_discard) {
if (scoring_cards.includes(c)) {
@@ -5870,7 +5873,7 @@ function vm_kiss_of_death() {
}
function vm_klaus_and_komarek() {
- if (game.comInfl[28] > 0 ) {game.valid_spaces = [28]}
+ if (game.comInfl[S_PRAHA] > 0 ) {game.valid_spaces = [S_PRAHA]}
vm_next()
}
@@ -5910,8 +5913,8 @@ function vm_kremlin_coup() {
}
function vm_laszlo_tokes() {
- game.persistent_events.push(73)
- game.playable_cards.push(107)
+ game.persistent_events.push(C_LASZLO_TOKES)
+ game.playable_cards.push(C_MASSACRE_IN_TIMISOARA)
game.state = 'vm_laszlo_tokes'
}
@@ -5921,7 +5924,7 @@ function vm_legacy_of_martial_law() {
}
function vm_legacy_of_1968() {
- for (let i = 0; i < spaces.length; i++) {
+ for (let i = 0; i <= spaces.length; i++) {
let space = spaces[i]
if ((!check_com_control(i) && space.country === 'Czechoslovakia')) {
game.valid_spaces.push(space.space_id);
@@ -5947,18 +5950,18 @@ function vm_malta_summit() {
}
function vm_massacre_in_timisoara() {
- game.persistent_events = game.persistent_events.filter(n => n !== 73)
+ game.persistent_events = game.persistent_events.filter(n => n !== C_LASZLO_TOKES)
vm_next()
}
function vm_modrow() {
- game.playable_cards.push(15)
+ game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER)
game.state = 'vm_modrow'
}
function vm_nagy_reburied(){
- if (game.comInfl[42] > 0) {
- game.valid_spaces.push(42)
+ if (game.comInfl[S_SZOMBATHELY] > 0) {
+ game.valid_spaces.push(S_SZOMBATHELY)
}
vm_next()
}
@@ -5983,8 +5986,8 @@ function vm_nomenklatura() {
}
function vm_normalisation() {
- if (game.demInfl[26] >0) {game.valid_spaces.push(26)}
- if (game.demInfl[28] > 0) {game.valid_spaces.push(28)}
+ if (game.demInfl[S_PLZEN] >0) {game.valid_spaces.push(S_PLZEN)}
+ if (game.demInfl[S_PRAHA] > 0) {game.valid_spaces.push(S_PRAHA)}
game.remove_opponent_infl = true
vm_next()
}
@@ -6036,8 +6039,8 @@ function vm_power_struggle() {
//Check for Securitate
- if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(70)) {
- log('C70: Democrat reveals Power Struggle cards')
+ if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)) {
+ log(`C${C_SECURITATE}: Democrat reveals Power Struggle cards`)
game.view_opp_hand = true
}
log_h2('Deal Cards')
@@ -6067,7 +6070,7 @@ function vm_prudence() {
function vm_public_against_violence() {
game.valid_spaces = []
- if (game.comInfl[33] > 0 ) {game.valid_spaces.push(33)}
+ if (game.comInfl[S_BRATISLAVA] > 0 ) {game.valid_spaces.push(S_BRATISLAVA)}
vm_next()
}
@@ -6094,17 +6097,17 @@ function vm_roundtable_talks() {
}
function vm_sajudis_check() {
- if (!check_dem_control(55)) {
- game.valid_spaces.push(55)
+ if (!check_dem_control(S_RAZGRAD)) {
+ game.valid_spaces.push(S_RAZGRAD)
}
- if (!check_dem_control(69)) {
- game.valid_spaces.push(69)
+ if (!check_dem_control(S_HARGHITA_COVASNA)) {
+ game.valid_spaces.push(S_HARGHITA_COVASNA)
}
vm_next()
}
function vm_sajudis() {
- game.playable_cards.push(81)
+ game.playable_cards.push(C_THE_BALTIC_WAY)
game.stability++
log('+1 VP')
game.vp++
@@ -6119,9 +6122,9 @@ function vm_samizdat() {
}
function vm_securitate() {
- game.persistent_events.push(70)
- permanently_remove(70)
- //game.table_cards.push(70)
+ game.persistent_events.push(C_SECURITATE)
+ permanently_remove(C_SECURITATE)
+ //game.table_cards.push(C_SECURITATE)
vm_next()
}
@@ -6135,25 +6138,25 @@ function vm_social_democratic_platform_adopted() {
function vm_solidarity_legalised() {
log_msg_gap(`C2 in effect`)
- game.playable_cards.push(3)
- game.persistent_events.push(2)
+ game.playable_cards.push(C_WALESA)
+ game.persistent_events.push(C_SOLIDARITY_LEGALIZED)
vm_next()
}
function vm_st_nicholas_church () {
- game.persistent_events.push(24)
- game.playable_cards.push(61)
+ game.persistent_events.push(C_ST_NICHOLAS_CHURCH)
+ game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS)
vm_next()
}
function vm_stasi() {
log_msg_gap('C13 in effect')
- game.persistent_events.push(13)
+ game.persistent_events.push(C_STASI)
vm_next()
}
function vm_stand_fast() {
- game.persistent_events.push(100)
+ game.persistent_events.push(C_STAND_FASTd)
if (game.active === DEM) {
game.stand_fast = DEM
} else {game.stand_fast = COM}
@@ -6177,18 +6180,18 @@ function vm_tank_column() {
}
function vm_tear_gas () {
- game.persistent_events.push(30)
- game.table_cards.push(30)
- remove_from_discard(30)
+ game.persistent_events.push(C_TEAR_GAS)
+ game.table_cards.push(C_TEAR_GAS)
+ remove_from_discard(C_TEAR_GAS)
log_msg_gap('C30 in effect')
vm_next()
}
function vm_the_baltic_way() {
- game.playable_cards.push(84)
+ game.playable_cards.push(C_BREAKAWAY_BALTIC_REPUBLICS)
game.stability++
- if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)}
- if (!check_dem_control(69) ) {game.valid_spaces.push(69)}
+ if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)}
+ if (!check_dem_control(S_RAZGRAD) ) {game.valid_spaces.push(S_RAZGRAD)}
log('+3 VP')
game.vp += 3
if (check_vp()) {
@@ -6202,20 +6205,20 @@ function vm_the_chinese_solution() {
}
function vm_the_crowd_turns_against_ceausescu() {
- game.table_cards.push(54)
- remove_from_discard(54)
- game.playable_cards.push(97)
+ game.table_cards.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)
+ remove_from_discard(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)
+ game.playable_cards.push(C_THE_TYRANT_IS_GONE)
vm_next()
}
function vm_the_monday_demonstrations() {
- if (!check_dem_control(5)) {game.valid_spaces.push(5)}
- if (!check_dem_control(8)) {game.valid_spaces.push(8)}
+ if (!check_dem_control(S_LUTHERAN_CHURCH)) {game.valid_spaces.push(S_LUTHERAN_CHURCH)}
+ if (!check_dem_control(S_LEIPZIG)) {game.valid_spaces.push(S_LEIPZIG)}
vm_next()
}
function vm_the_sinatra_doctrine() {
- game.persistent_events.push(50)
+ game.persistent_events.push(C_THE_SINATRA_DOCTRINE)
log_msg_gap('C50 in effect')
vm_next()
}
@@ -6239,19 +6242,19 @@ function vm_the_tyrant_is_gone() {
function vm_the_tyrant_is_gone_prep() {
- game.table_cards.push(97)
- remove_from_discard(97)
+ game.table_cards.push(C_THE_TYRANT_IS_GONE)
+ remove_from_discard(C_THE_TYRANT_IS_GONE)
vm_next()
}
function vm_tyrant_block() {
- logi(`Has no effect after C97`)
+ logi(`Has no effect after C${C_THE_TYRANT_IS_GONE}`)
vm_next()
//game.state = 'vm_tyrant_block'
}
function vm_the_wall () {
- game.persistent_events.push(9)
+ game.persistent_events.push(C_THE_WALL)
//game.strategy_removed.push(9)
//game.table_cards.push(9)
log_msg_gap('C9 in effect')
@@ -6273,12 +6276,12 @@ function vm_warsaw_pact_summit() {
}
function vm_we_are_the_people() {
- if (game.demInfl[5] > 0) {game.valid_spaces = [5]}
- game.persistent_events.push(48)
+ if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]}
+ game.persistent_events.push(C_WE_ARE_THE_PEOPLE)
if (!game.vm_influence_added) {
game.vm_influence_added = {};
}
- game.vm_influence_added[5] = 0
+ game.vm_influence_added[S_LUTHERAN_CHURCH] = 0
game.vm_available_ops = 4
game.state = 'vm_we_are_the_people_remove'
}
@@ -6305,10 +6308,10 @@ function vm_workers_revolt() {
}
function vm_yakovlev_counsels_gorbachev() {
- game.persistent_events.push(62)
+ game.persistent_events.push(C_YAKOVLEV_COUNSELS_GORBACHEV)
log_msg_gap('C62 in effect')
- game.table_cards.push(62)
- remove_from_discard(62)
+ game.table_cards.push(C_YAKOVLEV_COUNSELS_GORBACHEV)
+ remove_from_discard(C_YAKOVLEV_COUNSELS_GORBACHEV)
vm_next()
}
@@ -6576,14 +6579,6 @@ states.vm_add_x_infl = {
game.vm_event_done = true
vm_next()
}
- /*if (game.vm_event === (105 || 68) {
- vm_next()
- return
- } */
-
-
- //game.vm_event_done = true
- //vm_next()
},
done () {
push_undo()
@@ -6663,7 +6658,7 @@ states.vm_remove_infl = {
push_undo()
vm_do_remove_infl(space)
game.vm_active_country = spaces[space].country
- if (game.vm_event !== 44) {
+ if (game.vm_event !== C_INFLATIONARY_CURRENCY) {
if (game.vm_available_ops === 0 ) {
if (game.summary.length > 0) {
pop_summary()
@@ -6829,7 +6824,7 @@ states.vm_support_check_prep = {
// Check for Austria-Hungary Border Reopened - check on first support check only
//First check for Monday Demonstrations - support checks will always be in East Germany
- if (game.vm_event === 61 && game.persistent_events.includes(58)) {
+ if (game.vm_event === C_THE_MONDAY_DEMONSTRATIONS && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
game.austria_hungary_border_reopened_tracker = true
game.state = 'vm_do_support_check'
return
@@ -6837,9 +6832,9 @@ states.vm_support_check_prep = {
//Then check Austria-Hungary Border Reopened normally
//console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked)
- if (game.persistent_events.includes(58)) {
+ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
if (game.active === DEM && game.vm_available_ops > 1) {
- if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) {
+ if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.active === DEM) {
game.state = 'vm_austria_hungary_border_reopened_check'
return
}
@@ -6877,7 +6872,7 @@ states.vm_ceh_support_check_prep = {
//Then check Austria-Hungary Border Reopened normally
//console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked)
- if (game.persistent_events.includes(58)) {
+ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
if (game.active === DEM && game.vm_available_ops > 1) {
if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) {
@@ -7007,7 +7002,7 @@ states.vm_tiananmen_square_attempt = {
states.vm_adamec = {
get inactive() {
- return `resolve ${clean_name(cards[88].name)}.`
+ return `resolve ${clean_name(cards[C_ADAMEC].name)}.`
},
prompt() {
view.prompt = 'Adamec: roll a die.'
@@ -7029,7 +7024,7 @@ states.vm_adamec = {
return
}
log('Adamec fails: 3 or more required')
- permanently_remove(88)
+ permanently_remove(C_ADAMEC)
vm_return()
}
}
@@ -7082,7 +7077,7 @@ states.vm_brought_in_for_questioning = {
states.vm_central_committee_reshuffle = {
get inactive() {
- return `resolve ${clean_name(cards[57].name)}.`
+ return `resolve ${clean_name(cards[C_CENTRAL_COMMITTEE_RESHUFFLE].name)}.`
},
prompt() {
if (game.revolutions.every(n => n === true)) {
@@ -7102,35 +7097,35 @@ states.vm_central_committee_reshuffle = {
push_undo()
game.vm_active_country = "East_Germany"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [0,1,2,3,4,5,6,7,8,9,10,11]
+ game.valid_spaces = [...S_EAST_GERMANY]
vm_next()
},
poland() {
push_undo()
game.vm_active_country = "Poland"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [12,13,14,15,16,17,18,19,20,21,22,23,24,25]
+ game.valid_spaces = [...S_POLAND]
vm_next()
},
czechoslovakia() {
push_undo()
game.vm_active_country = "Czechoslovakia"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [26,27,28,29,30,31,32,33,34,35,36]
+ game.valid_spaces = [...S_CZECHOSLOVAKIA]
vm_next()
},
hungary() {
push_undo()
game.vm_active_country = "Hungary"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [37,38,39,40,41,42,43,44,45,46,47,48]
+ game.valid_spaces = [...S_HUNGARY]
vm_next()
},
romania() {
push_undo()
game.vm_active_country = "Romania"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [49,50,51,52,53,54,55,56,57,58,59,60,61,62]
+ game.valid_spaces = [...S_ROMANIA]
game.valid_spaces = game.valid_spaces.filter(space => space !== game.systematization)
vm_next()
},
@@ -7138,7 +7133,7 @@ states.vm_central_committee_reshuffle = {
push_undo()
game.vm_active_country = "Bulgaria"
log(`Chose ${country_name(game.vm_active_country)}`)
- game.valid_spaces = [63,64,65,66,67,68,69,70,71,72,73,74]
+ game.valid_spaces = [...S_BULGARIA]
vm_next()
},
pass() {
@@ -7176,7 +7171,7 @@ states.vm_common_european_home_play = {
view.prompt = `Play ${clean_name(cards[this_card()].name)} for:`
gen_action('influence')
gen_action('support_check')
- if (game.active === DEM && game.vm_event === 87 ) {
+ if (game.active === DEM && game.vm_event === C_KOHL_PROPOSES_REUNIFICATION ) {
return /*Special condition if card is actually Kohl Proposes Reunification*/
}
/*if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 || game.active === COM && game.com_tst_attempted_this_turn === 0) {
@@ -7189,7 +7184,7 @@ states.vm_common_european_home_play = {
game.vm_available_ops = cards[game.vm_event].ops
valid_spaces_infl()
// If ABHR - Set AHBR tracker to true
- if (game.persistent_events.includes(58)) {
+ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
game.austria_hungary_border_reopened_tracker = true
}
game.state = 'vm_add_infl'
@@ -7210,7 +7205,7 @@ states.vm_common_european_home_play = {
states.vm_dash_for_the_west = {
get inactive() {
- return `resolve ${clean_name(cards[36].name)}.`
+ return `resolve ${clean_name(cards[C_DASH_FOR_THE_WEST].name)}.`
},
prompt() {
/* if (game.phase === 1) {*/
@@ -7338,7 +7333,7 @@ states.vm_deutsche_marks_confirm = {
states.vm_deutsche_marks = {
get inactive() {
- return `resolve ${clean_name(cards[20].name)}.`
+ return `resolve ${clean_name(cards[C_DEUTSCHE_MARKS].name)}.`
},
prompt() {
if(cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) {
@@ -7390,7 +7385,7 @@ states.vm_deutsche_marks = {
states.vm_exit_visas = {
get inactive() {
- return `resolve ${clean_name(cards[75].name)}.`
+ return `resolve ${clean_name(cards[C_EXIT_VISAS].name)}.`
},
prompt() {
view.prompt = 'Exit Visas: you may discard cards from your hand and draw replacements.'
@@ -7420,7 +7415,7 @@ states.vm_exit_visas = {
states.vm_exit_visas_finish = {
get inactive() {
- return `resolve ${clean_name(cards[75].name)}.`
+ return `resolve ${clean_name(cards[C_EXIT_VISAS].name)}.`
},
prompt() {
if (game.temp > 0 ) {
@@ -7740,7 +7735,7 @@ states.vm_kiss_of_death = {
clear_undo()
game.vm_event = discard_card(game.communist_hand)
//Only switch player if a playable non-communist event. Common European Home is not playable here
- if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== 21) {
+ if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) {
next_player()
game.state = 'vm_kiss_of_death_finish'
} else {
@@ -7759,7 +7754,7 @@ states.vm_kiss_of_death_finish = {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- if (game.vm_event > 0 && game.vm_event !== 21 && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) {
+ if (game.vm_event > 0 && game.vm_event !== C_COMMON_EUROPEAN_HOME && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) {
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')
@@ -7867,22 +7862,22 @@ states.vm_kremlin_coup_take_control = {
space(space) {
push_undo()
vm_take_control(space)
- if (game.vm_active_country === 'East_Germany') {game.selected_space = 2 }
- if (game.vm_active_country === 'Poland') {game.selected_space = 16}
- if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 28}
- if (game.vm_active_country === 'Hungary') {game.selected_space = 44}
- if (game.vm_active_country === 'Romania') {game.selected_space = 60}
- if (game.vm_active_country === 'Bulgaria') {game.selected_space = 67}
+ if (game.vm_active_country === 'East_Germany') {game.selected_space = S_BERLIN }
+ if (game.vm_active_country === 'Poland') {game.selected_space = S_WARSZAWA}
+ if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = S_PRAHA}
+ if (game.vm_active_country === 'Hungary') {game.selected_space = S_BUDAPEST}
+ if (game.vm_active_country === 'Romania') {game.selected_space = S_BUCURESTI}
+ if (game.vm_active_country === 'Bulgaria') {game.selected_space = S_SOFIA}
game.state = 'vm_kremlin_coup_sc_prep'
},
done() {
push_undo()
- if (game.vm_active_country === 'East_Germany') {game.selected_space = 2 }
- if (game.vm_active_country === 'Poland') {game.selected_space = 16}
- if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 28}
- if (game.vm_active_country === 'Hungary') {game.selected_space = 44}
- if (game.vm_active_country === 'Romania') {game.selected_space = 60}
- if (game.vm_active_country === 'Bulgaria') {game.selected_space = 67}
+ if (game.vm_active_country === 'East_Germany') {game.selected_space = S_BERLIN }
+ if (game.vm_active_country === 'Poland') {game.selected_space = S_WARSZAWA}
+ if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = S_PRAHA}
+ if (game.vm_active_country === 'Hungary') {game.selected_space = S_BUDAPEST}
+ if (game.vm_active_country === 'Romania') {game.selected_space = S_BUCURESTI}
+ if (game.vm_active_country === 'Bulgaria') {game.selected_space = S_SOFIA}
game.state = 'vm_kremlin_coup_sc_prep'
}
}
@@ -7944,7 +7939,7 @@ states.vm_laszlo_tokes = {
},
influence(){
push_undo()
- game.vm_available_ops = get_card_ops(73)
+ game.vm_available_ops = get_card_ops(C_LASZLO_TOKES)
valid_spaces_infl()
game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania')
game.phase = 3
@@ -8024,12 +8019,12 @@ states.vm_malta_summit = {
if (check_vp()) {
return
}
- if (game.comInfl[11] > 0 ) {game.valid_spaces.push(11)}
- if (game.comInfl[14] > 0 ) {game.valid_spaces.push(14)}
- if (game.comInfl[26] > 0 ) {game.valid_spaces.push(26)}
- if (game.comInfl[42] > 0 ) {game.valid_spaces.push(42)}
- if (game.comInfl[50] > 0 ) {game.valid_spaces.push(50)}
- if (game.comInfl[68] > 0 ) {game.valid_spaces.push(68)}
+ if (game.comInfl[S_DRESDEN] > 0 ) {game.valid_spaces.push(S_DRESDEN)}
+ if (game.comInfl[S_BYDGOSZCZ] > 0 ) {game.valid_spaces.push(S_BYDGOSZCZ)}
+ if (game.comInfl[S_PLZEN] > 0 ) {game.valid_spaces.push(S_PLZEN)}
+ if (game.comInfl[S_SZOMBATHELY] > 0 ) {game.valid_spaces.push(S_SZOMBATHELY)}
+ if (game.comInfl[S_CLUJ_NAPOCA] > 0 ) {game.valid_spaces.push(S_CLUJ_NAPOCA)}
+ if (game.comInfl[S_STARA_ZAGORA] > 0 ) {game.valid_spaces.push(S_STARA_ZAGORA)}
//game.vm_available_ops = 5
game.remove_opponent_infl = true
vm_next()
@@ -8064,7 +8059,7 @@ states.vm_modrow = {
} else {
log(`Roll: D${roll}`)
log(`Fail. More than ${dem_spaces} required`)
- permanently_remove(83)
+ permanently_remove(C_MODROW)
vm_return()
}
}
@@ -8105,7 +8100,7 @@ states.vm_nepotism = {
states.vm_new_years_eve_party = {
get inactive() {
- return `resolve ${clean_name(cards[104].name)}.`
+ return `resolve ${clean_name(cards[C_NEW_YEARS_EVE_PARTY].name)}.`
},
prompt() {
view.prompt = 'Choose whether the game ends at the end of this turn.'
@@ -8114,7 +8109,7 @@ states.vm_new_years_eve_party = {
},
end() {
push_undo()
- game.persistent_events.push(104)
+ game.persistent_events.push(C_NEW_YEARS_EVE_PARTY)
log('Chooses to end the game. There will be no final scoring')
let power = game.revolutions.filter(value => value === false).length
if (power > 3) {
@@ -8128,13 +8123,13 @@ states.vm_new_years_eve_party = {
return
}
//game.table_cards.push(104)
- permanently_remove(104)
+ permanently_remove(C_NEW_YEARS_EVE_PARTY)
vm_next()
},
continue() {
push_undo()
log('Chooses to continue')
- permanently_remove(104)
+ permanently_remove(C_NEW_YEARS_EVE_PARTY)
vm_next()
}
}
@@ -8462,7 +8457,7 @@ states.vm_systematization = {
vm_eliminate(space)
game.valid_spaces = []
game.systematization = space
- game.persistent_events.push(69)
+ game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED?*/
vm_next()
},
/* done() {
@@ -8578,7 +8573,7 @@ states.vm_the_tyrant_is_gone = {
log(`The Ceausescus flee to %${space}`)
game.the_tyrant_is_gone = space
game.valid_spaces = []
- game.persistent_events.push(97)
+ game.persistent_events.push(C_THE_TYRANT_IS_GONE)
// vm_next()
},
@@ -8714,7 +8709,7 @@ states.vm_warsaw_pact_summit = {
},
influence(){
push_undo()
- for (let i = 0; i < spaces.length; i++) {
+ for (let i = 0; i <= spaces.length; i++) {
let space = spaces[i]
if (game.demInfl[i] === 0) {
game.valid_spaces.push(space.space_id);
@@ -8727,7 +8722,7 @@ states.vm_warsaw_pact_summit = {
},
support_check(){
push_undo()
- for (let i = 0; i < spaces.length; i++) {
+ for (let i = 0; i <= spaces.length; i++) {
let space = spaces[i]
if (game.demInfl[i] > 0 && (space.socio === 5 || space.socio === 6)) {
game.valid_spaces.push(space.space_id)
@@ -8744,7 +8739,7 @@ states.vm_we_are_the_people_remove = {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- if (game.demInfl[5] === 0 && game.vm_available_ops > 0) {
+ if (game.demInfl[S_LUTHERAN_CHURCH] === 0 && game.vm_available_ops > 0) {
view.prompt = '"We are the People!": no SPs to remove.'
gen_action('done')
} else if (game.vm_available_ops > 0 ) {
@@ -8766,11 +8761,11 @@ states.vm_we_are_the_people_remove = {
pop_summary()
log_br()
}
- if (!game.vm_influence_added[5]) {
+ if (!game.vm_influence_added[S_LUTHERAN_CHURCH]) {
log('No SPs removed')
vm_next()
} else {
- game.valid_spaces = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
+ game.valid_spaces = [...S_EAST_GERMANY]
game.state = 'vm_we_are_the_people_add'
}
}
@@ -8786,15 +8781,15 @@ states.vm_we_are_the_people_add = {
return
}*/
- view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[5],'SP')} to spaces in Germany.`
+ view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[S_LUTHERAN_CHURCH],'SP')} to spaces in Germany.`
for (let space_id of game.valid_spaces) {
gen_action_space(space_id);
}
},
space(space) {
vm_do_add_infl_free(space)
- game.vm_influence_added[5]--
- if (game.vm_influence_added[5] === 0 ) {
+ game.vm_influence_added[S_LUTHERAN_CHURCH]--
+ if (game.vm_influence_added[S_LUTHERAN_CHURCH] === 0 ) {
game.valid_spaces = []
if (game.summary.length > 0) {
pop_summary()
@@ -8982,7 +8977,7 @@ states.vm_tst_6 = {
space(space) {
push_undo()
game.selected_space = space
- if (game.active === DEM && game.persistent_events.includes(58) && spaces[space].country === "East_Germany") {
+ if (game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && spaces[space].country === "East_Germany") {
game.austria_hungary_border_reopened_tracker = true
}
game.state = 'vm_tst_6_sc'
@@ -9071,7 +9066,7 @@ states.vm_tst_8_ops = {
game.vm_available_ops = cards[game.played_card].ops
valid_spaces_infl()
// If ABHR - Set AHBR tracker to true
- if (game.persistent_events.includes(58)) {
+ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
game.austria_hungary_border_reopened_tracker = true
}
game.state = 'vm_add_infl'
@@ -9149,13 +9144,11 @@ states.vm_support_surges_1 = {
states.vm_support_surges_2 = {
inactive: 'draw cards.',
- prompt() {
- let special = [49,50,51,52]
- let elite_leader = [37,38,39,40]
- if (special.includes(game.temp)) {
+ prompt() {
+ if (wildcards.includes(game.temp)) {
view.prompt = `Support Surges: you drew ${power_cards[game.temp].name}. Draw a second card.`
}
- else if (elite_leader.includes(game.temp)) {
+ else if (elite_leaders.includes(game.temp)) {
view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Draw a second card.`
}
else if (numberless_cards.includes(game.temp)) {