diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-12 14:21:30 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-12 14:21:30 +0100 |
commit | 6e7a3c69a79ecca8e45df60b59a22de504e1a2f5 (patch) | |
tree | a7e77ca67b34b1ce10e47048c81d4219f584878e /rules.js | |
parent | db5c4c7f8e937b6527a04b097f1c4c61f94ae9c5 (diff) | |
download | 1989-dawn-of-freedom-6e7a3c69a79ecca8e45df60b59a22de504e1a2f5.tar.gz |
Updates to events handling
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 591 |
1 files changed, 351 insertions, 240 deletions
@@ -107,8 +107,9 @@ function start_game() { //starting influence
// Draw cards
- /* const card_numbers = cards.filter(card => card !== null && card !== undefined).map(card => card.number);
- console.log('card numbers: ', card_numbers) */
+
+ console.log('start game')
+
game.strategy_deck = draw_deck(cards)
reset_power()
@@ -225,7 +226,7 @@ exports.view = function(state, player) { } else if (player === COM) {
view.hand = game.communist_hand
- view.opp_hand = game.dem_pwr_hand.sort((a, b) => a - b) /*Does the Communist ever see Democrat hand? */
+ view.opp_hand = game.dem_pwr_hand.sort((a, b) => a - b)
view.power_hand = game.com_pwr_hand.sort((a, b) => a - b)
}
@@ -267,7 +268,7 @@ exports.view = function(state, player) { // === ACTIONS ===========
function gen_action(action, argument) {
-//console.log('gen_action called with ', action, ' and ', argument)
+console.log('gen_action called with ', action, ' and ', argument)
if (argument === undefined) {
//console.log('argument undefined')
view.actions[action] = 1
@@ -316,6 +317,7 @@ exports.action = function (state, player, action, arg) { states.com_init = {
inactive: 'place starting SPs',
prompt() {
+ console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces)
if (game.available_ops == 0) {
view.prompt = 'Place starting SPs: done.';
gen_action("done");
@@ -362,6 +364,7 @@ states.com_init = { states.dem_init = {
inactive: 'place starting SPs.',
prompt() {
+ console.log('state:', game.state)
if (game.available_ops == 0) {
view.prompt = 'Place starting SPs: done.';
gen_action("done");
@@ -400,6 +403,7 @@ states.dem_init = { states.start_game = {
inactive: 'start Turn 1.',
prompt() {
+ console.log('state:', game.state)
view.prompt = 'Start Turn 1.'
gen_action('start')
},
@@ -413,6 +417,7 @@ states.start_game = { states.choose_card = {
inactive: 'choose a card.',
prompt() {
+ console.log('state:', game.state)
if ((game.active===DEM && game.democrat_hand.length === 0) || game.active === COM && game.communist_hand.length === 0) {
view.prompt = 'No cards remaining: you must pass.'
gen_action('pass')
@@ -431,6 +436,7 @@ states.choose_card = { },
card(card) {
push_undo()
+
//Check if player is at risk of losing game due to held scoring card
if (!scoring_cards.includes(card)) {
let scoring_cards_count = count_scoring_cards()
@@ -480,16 +486,6 @@ states.play_card ={ return
}
-
- //Check for Tiananmen Square Track awards special abilities
- if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){
- gen_action('tst_7')
- }
-
- if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){
- gen_action('tst_8')
- }
-
// Check for Reformer Rehabilitated
//console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable)
@@ -503,26 +499,32 @@ states.play_card ={ gen_action('event')
}
}
+
+ //Check for events
+ console.log('event_is_playable(game.played_card)', event_is_playable(game.played_card))
+ if (event_is_playable(game.played_card)) {
+ console.log('card is playable')
+ //Check for Tiananmen Square Track awards special abilities
+ console.log('game.tst_7', game.tst_7)
+ if ((game.active === DEM && cards[game.played_card].side === 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[game.played_card].side === 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){
+ gen_action('tst_7')
+ }
- //Continue with normal logic
-
- //Check if it is a card with an event which is always playable
-
- if (cards[game.played_card].playable) {
- get_events(game.played_card)
- }
-
- // Resolve cards with variable events (not Reformer)
+ if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){
+ gen_action('tst_8')
+ }
- if (game.played_card !== 67 && game.playable_cards.includes(game.played_card)) {
+ //Continue with normal logic
get_events(game.played_card)
}
gen_action('influence')
- if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 && game.dem_tst_position <=8 || game.active === COM && game.com_tst_attempted_this_turn === 0 && game.com_tst_position <= 8) {
- gen_action('tst')
- }
gen_action('support_check')
+
+ if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 && game.dem_tst_position < 8 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 && game.com_tst_position < 8)) {
+ gen_action('tst')
+ }
+
},
event() {
push_undo()
@@ -610,7 +612,7 @@ states.play_card ={ },
tst_7() { /*Cancel opponent event */
push_undo()
- log('Event cancelled using Tiananmen Square Track Award')
+ log(`Played C${game.played_card}. Event cancelled using TST Award`)
game.tst_7 = true
game.vm_infl_to_do = true
game.state = 'resolve_opponent_event'
@@ -685,7 +687,7 @@ states.resolve_opponent_event = { },
tst_7() {
push_undo()
- log('Event cancelled using Tiananmen Square Track Award')
+ log('Event cancelled using TST Award')
game.tst_7 = true
game.vm_event_to_do = false
},
@@ -1230,6 +1232,7 @@ states.raise_stakes_1 = { game.raised_stakes_discard ++
if (game.raised_stakes_discard === 3) {
game.raised_stakes++
+ game.valid_cards = []
}
@@ -1244,6 +1247,7 @@ states.raise_stakes_1 = { log_gap('Raised the stakes')
game.raised_stakes_discard = 0
next_player()
+ game.valid_cards = [...all_power_cards]
game.state = 'raise_stakes_2'
}
}
@@ -1278,6 +1282,7 @@ states.raise_stakes_2 = { game.raised_stakes_discard ++
if (game.raised_stakes_discard === 3) {
game.raised_stakes++
+ game.valid_cards = []
}
},
@@ -1406,7 +1411,7 @@ states.power_struggle = { },
roll () {
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
if (roll >= power_cards[game.played_power_card].value) {
log('Initiative roll successful')
game.phase = 0
@@ -1516,7 +1521,7 @@ states.support_loss ={ let roll = Math.floor(Math.random() * 6) + 1
let rally_win = 0
let petition_win = 0
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) { rally_win = 2}
if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) { petition_win = 2}
let modified_roll = roll + game.raised_stakes + rally_win - petition_win
@@ -1585,7 +1590,7 @@ states.vp_roll = { },
roll () {
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
let rally_win = 0
let petition_win = 0
if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {rally_win = 2}
@@ -1785,11 +1790,22 @@ states.end_turn_4_5_4 = { } else {
game.return_state = ''
- new_turn()
+ game.state = 'end_turn'
}
}
}
+states.end_turn = {
+ inactive: 'end the turn.',
+ prompt() {
+ view.prompt = 'End Turn: done.'
+ gen_action('done')
+ },
+ done() {
+ new_turn()
+ }
+}
+
states.final_scoring_held = {
inactive: 'resolve final scoring.',
prompt() {
@@ -1883,7 +1899,7 @@ states.general_strike = { view.prompt = 'General Strike: done.'
gen_action('done')
} else if (game.played_card > 0 ) {
- view.prompt = 'Roll a die.'
+ view.prompt = 'General Strike: roll a die.'
gen_action('roll')
}
},
@@ -1906,12 +1922,12 @@ states.general_strike = { roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
- log(`+${game.available_ops} ops`)
+ logi(`+${game.available_ops} ops`)
let total = roll + game.available_ops
- log(`TOTAL: ${total}`)
+ log(`Total: ${total}`)
if (total > 5) {
log('The strike is over.')
@@ -2110,7 +2126,7 @@ states.stasi_play_card = { game.available_ops = get_card_ops(card)
game.stasi_card = 0
- if (game.democrat_hand.includes(21)) {
+ if (game.democrat_hand.includes(21) && cards[card].side === "C") {
game.state = 'stasi_resolve_common_european_home'
} else {
game.state = 'play_card'
@@ -2139,7 +2155,7 @@ states.stasi_resolve_common_european_home = { gen_action('no')
},
yes() {
- log(`${clean_name(cards[game.played_card].name)}} played with Common European Home`)
+ log(`Played with Common European Home`)
silent_discard(21)
game.vm_infl_to_do = true
game.vm_event_to_do = false
@@ -2285,7 +2301,7 @@ function do_sc(space) { // Continue with Support Check Logic
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
console.log('game.vm_event', game.vm_event)
console.log('game.is_pwr_struggle', game.is_pwr_struggle)
/*
@@ -2382,7 +2398,7 @@ function do_sc(space) { logi(`+${adj.dem_adj} adjacency`)
}
if (adj.com_adj > 0) {
- logi(`-${adj.com_adj} opponenet adjacency`)
+ logi(`-${adj.com_adj} opponent adjacency`)
}
} else {
roll += adj.com_adj
@@ -2391,7 +2407,7 @@ function do_sc(space) { logi(`+${adj.com_adj} adjacency`)
}
if (adj.dem_adj > 0) {
- logi(`-${adj.dem_adj} opponenet adjacency`)
+ logi(`-${adj.dem_adj} opponent adjacency`)
}
}
}
@@ -2399,12 +2415,12 @@ function do_sc(space) { }
// Support check calcs
- log(`TOTAL: ${roll}`)
+ log(`Total: ${roll}`)
const stability = spaces[find_space_index(space)].stability
logi(`-${stability*2} (stability * 2)`)
const change_infl = Math.max(0, roll - stability*2)
if (change_infl > 0) {
- log_msg_gap(`CHANGE: ${change_infl} SP`)
+ log_msg_gap(`Change: ${change_infl} SP`)
let clicked_space = find_space_index(space)
if(game.active === DEM) {
if (change_infl > game.comInfl[clicked_space]) {
@@ -2432,7 +2448,7 @@ function do_sc(space) { check_control_change(clicked_space)
} else {
- log_msg_gap('CHANGE: 0 SP')
+ log_msg_gap('Change: 0 SP')
}
if (game.active === COM && game.persistent_events.includes(39) && spaces[clicked_space].space_id === 66) {
log_msg_gap('+1 VP from C39')
@@ -2456,8 +2472,8 @@ function do_sc(space) { function valid_spaces_setup() {
game.valid_spaces = []
let valid_spaces_set = new Set();
- console.log('in vs setup, state', game.state)
- for (let i =1 ; i < 75 ; i++) {
+ //console.log('in vs setup, state', game.state)
+ for (let i =1 ; i <= 75 ; i++) {
space = spaces[i]
if (game.state === 'com_init') {
@@ -2482,7 +2498,7 @@ function valid_spaces_sc() { let valid_spaces_set = new Set();
console.log('valid spaces sc, persistent events', game.persistent_events)
- for (let i = 1 ; i < 75; i++) {
+ for (let i = 1 ; i <= 75; i++) {
space = spaces[i]
if (game.active === DEM) {
@@ -2761,34 +2777,34 @@ function check_com_control(space_id) { function do_tst_attempt() {
let roll = Math.floor(Math.random() * 6) + 1;
- log(`ROLL: D${roll}`);
+ log(`Roll: D${roll}`);
roll += game.available_ops
- log(`+${game.available_ops} from card ops`)
+ logi(`+${game.available_ops} from card ops`)
// TIANANMEN SQUARE MODIFIERS
if (game.active === DEM && game.dem_tst_attempted === 1 || game.active === COM && game.com_tst_attempted === 1) {
roll ++;
- log('+1 modifier from previous Tiananmen Square Track attempts')
+ logi('+1 from previous TST attempts')
}
if (game.active === DEM && game.dem_tst_position >= 1 && game.com_tst_position === 0) {
roll ++
- log('+1 from TST award')
+ logi('+1 from TST award')
}
if (game.active === COM && game.com_tst_position >= 1 && game.dem_tst_position === 0) {
roll ++
- log('+1 from TST award')
+ logi('+1 from TST award')
}
if ((game.active === DEM && cards[game.played_card].side === 'D') || (game.active === COM && cards[game.played_card].side === 'C')) {
roll ++;
- log('+1 for playing own card');
+ logi('+1 for playing own card');
}
if (game.active === COM && game.persistent_events.includes(53)) {
roll ++
- log('+1 from C53')
+ logi('+1 from C53')
}
- log(`TOTAL: ${roll}`)
+ log(`Total: ${roll}`)
// TIANANMEN SQUARE ATTEMPT
game.return = game.active
@@ -2830,21 +2846,27 @@ function do_tst_attempt() { if (roll >= com_tst_req[game.com_tst_position]) {
log(`${com_tst_req[game.com_tst_position]} required: success`)
game.com_tst_position++
+
+ //Check if they have reached the final box - Chinese Solution playable
+ if (game.com_tst_position === 8) {
+ game.playable_cards.push(96)
+ }
+
game.com_tst_attempted = 0
//Check if they have reached box 7 or 8 first
- if (game.dem_tst_position === 7 && game.com_tst_position < 7) {
+ if (game.com_tst_position === 7 && game.dem_tst_position < 7) {
game.tst_7 = false
}
- if (game.dem_tst_position === 8 && game.com_tst_position < 8) {
+ if (game.com_tst_position === 8 && game.dem_tst_position < 8) {
game.tst_8 = false
}
//Check if they have caught up to box 7 or 8
- if (game.dem_tst_position >= 7 && game.com_tst_position >= 7) {
+ if (game.com_tst_position >= 7 && game.dem_tst_position >= 7) {
delete game.tst_7
}
- if (game.dem_tst_position >= 8 && game.com_tst_position >= 8) {
+ if (game.com_tst_position >= 8 && game.dem_tst_position >= 8) {
delete game.tst_8
}
@@ -3092,17 +3114,18 @@ function get_value(country) { }
function permanently_remove(card) {
- console.log('card:', card)
+ console.log('permanently removing card:', card)
+ if (game.strategy_removed.includes(card)) {return}
log_msg_gap(`C${cards[card].number} permanently removed`)
remove_from_discard(card)
card_index = game.table_cards.indexOf(card)
if (card_index !== -1) {
- console.log('sub 2 called')
+ //console.log('sub 2 called')
game.table_cards.splice(card_index, 1)
}
game.strategy_removed.push(card)
- console.log('game.strategy_removed', game.strategy_removed)
+ //console.log('game.strategy_removed', game.strategy_removed)
}
function check_vp() {
@@ -3206,15 +3229,37 @@ function find_event(card) { }
function get_events(card){
- if (cards[card].side === 'D') {
- if (game.active === DEM) {gen_action('event')}
- if (game.active === COM) {gen_action('opp_event')}
- }
- else if (cards[card].side === 'C') {
- if (game.active === COM) {gen_action('event')}
- if (game.active === DEM) {gen_action('opp_event')}
+ if (event_is_playable(card)) {
+ if (cards[card].side === 'D') {
+ if (game.active === DEM) {gen_action('event')}
+ if (game.active === COM) {gen_action('opp_event')}
+ }
+ else if (cards[card].side === 'C') {
+ if (game.active === COM) {gen_action('event')}
+ if (game.active === DEM) {gen_action('opp_event')}
+ }
+ else {
+ gen_action('event')
+ }
+ }
+}
+
+function event_is_playable(card) {
+ //Reformer never playable here
+ if (card === 67) {
+ return false
+ }
+ //Check for Common European Hmme under Stasi
+ else if (game.persistent_events.includes(13) && card === 21 && game.active === DEM) {
+ return false
+ }
+ //Then check normally
+ else if (cards[card].playable) {
+ return true
+ } else if (game.playable_cards.includes(card)) {
+ return true
} else {
- gen_action('event')
+ return false
}
}
@@ -3616,11 +3661,11 @@ function new_turn() { //permanently_remove(65)
game.persistent_events = game.persistent_events.filter(n => n !== 65)
}
- console.log('deck', game.strategy_deck)
- console.log('game.com_hand_limit', game.com_hand_limit, 'communist hand before draw', game.communist_hand)
+ //console.log('deck', game.strategy_deck)
+ //console.log('game.com_hand_limit', game.com_hand_limit, 'communist hand before draw', game.communist_hand)
draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit)
game.com_hand_limit = 8
- console.log('communist hand after draw', game.communist_hand)
+ //console.log('communist hand after draw', game.communist_hand)
}
@@ -3693,7 +3738,7 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han //console.log('game.valid_cards at start of draw cards: ', game.valid_cards)
let turn = 'communist'; // Start with the communist player
//console.log('game.strategy_deck', game.strategy_deck)
- console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit)
+ //console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit)
while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) {
//console.log('deck.length: ', deck.length)
//console.log('discard.length', game.strategy_discard )
@@ -3871,19 +3916,9 @@ function reset_power() { }
function check_control_change(space_id) {
- /*game.pieces[space_id].demCtrl = 0
- game.pieces[space_id].comCtrl = 0
-
- if ((game.demInfl[space_id] - game.comInfl[space_id]) >= game.pieces[space_id].stability) {
- game.pieces[space_id].demCtrl = 1
- }
- if ((game.comInfl[space_id] - game.demInfl[space_id]) >= game.pieces[space_id].stability) {
- game.pieces[space_id].comCtrl = 1
- }*/
// Check if the Tyrant is Gone has been fulfilled
- console.log('check control change_player, game.the_tyrant_is_gone', game.the_tyrant_is_gone)
- //console.log('dem control', check_dem_control(game.the_tyrant_is_gone))
+
if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) {
console.log('in tyrant')
log('+2 VP from C97')
@@ -4287,6 +4322,8 @@ function pop_vm_prompt() { function vm_return() {
+ console.log('in vm_return')
+
//Remove temporary vm variables
delete game.support_check_modifier
delete game.vm_max_infl
@@ -4299,10 +4336,14 @@ function vm_return() { }
//Check if end event state is needed
- if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) {
- game.state = 'vm_end_event'
- } else {
+ if (game.is_pwr_struggle || game.state === 'vm_tst_6') {
vm_end_event()
+ } else {
+ if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) {
+ game.state = 'vm_end_event'
+ } else {
+ vm_end_event()
+ }
}
}
@@ -5155,15 +5196,11 @@ function vm_domino_theory() { function vm_eco_glasnost() {
game.persistent_events.push(39)
- permanently_remove(39)
vm_next()
}
function vm_elena(){
game.persistent_events.push(101)
- permanently_remove(101)
- //game.table_cards.push(101)
- //remove_from_discard(101)
vm_next()
}
@@ -5377,7 +5414,7 @@ function vm_inflationary_currency_discard() { }
} else {
for (let card of game.democrat_hand){
- if (get_cards_ops(card) >= 3) {
+ if (get_card_ops(card) >= 3) {
game.valid_cards.push(card)
}
}
@@ -5520,7 +5557,6 @@ function vm_peasant_parties_revolt() { function vm_perestroika() {
game.persistent_events.push(25)
log_msg_gap('C25 in effect')
- permanently_remove(25)
vm_next()
}
@@ -5667,7 +5703,6 @@ function vm_solidarity_legalised() { function vm_st_nicholas_church () {
game.persistent_events.push(24)
game.playable_cards.push(61)
- permanently_remove(24)
vm_next()
}
@@ -5760,10 +5795,7 @@ function vm_the_tyrant_is_gone() { game.valid_spaces.push(space.space_id)
}
}
- /*game.playable_cards[10].playable = 0
- game.playable_cards[41].playable = 0
- game.playable_cards[101].playable = 0
- game.playable_cards[107].playable = 0*/
+
console.log('game.vm_event', game.vm_event, 'game.played_card', game.played_card)
game.state = 'vm_the_tyrant_is_gone'
}
@@ -5775,6 +5807,10 @@ function vm_the_tyrant_is_gone_prep() { vm_next()
}
+function vm_tyrant_block() {
+ game.state = 'vm_tyrant_block'
+}
+
function vm_the_wall () {
game.persistent_events.push(9)
//game.strategy_removed.push(9)
@@ -5883,7 +5919,7 @@ function vm_scare_tactics() { vm_next()
}
function vm_support_surges() {
- game.state = 'vm_support_surges'
+ game.state = 'vm_support_surges_1'
}
function vm_support_falters() {
@@ -5940,9 +5976,6 @@ states.vm_take_control = { push_undo()
vm_take_control(space)
game.vm_available_ops--
- if (game.vm_available_ops === 0) {
- vm_next()
- }
},
done() {
vm_next()
@@ -5954,7 +5987,7 @@ states.vm_add_infl = { 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 SPs: done.'
+ view.prompt = `${clean_name(cards[this_card()].name)}. No available spaces remaining. Add SPs: done.`
gen_action('done')
}
else if (game.vm_available_ops > 0 ) {
@@ -5964,12 +5997,15 @@ states.vm_add_infl = { gen_action_infl(spaces[space_id].name_unique)
}
} else {
- view.prompt = 'Add SP: done.'
+ view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.`
gen_action('done')
}
},
infl(space) {
vm_do_add_infl(space)
+ if (game.vm_available_ops === 0) {
+ game.valid_spaces = []
+ }
},
done () {
if (game.summary.length > 0) {
@@ -5988,7 +6024,7 @@ states.vm_add_infl_free = { },
prompt () {
if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) {
- view.prompt = 'No available spaces remaining. Add SPs: done.'
+ view.prompt = `${clean_name(cards[this_card()].name)}. No available spaces remaining. Add SPs: done.`
gen_action('done')
}
else if (game.vm_available_ops > 0 ) {
@@ -5998,15 +6034,15 @@ states.vm_add_infl_free = { gen_action_infl(spaces[space_id].name_unique);
}
} else {
- view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.`
+ view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.`
gen_action('done')
}
},
infl(space) {
vm_do_add_infl_free(space)
- /*if (game.vm_available_ops === 0 ) {
-
- }*/
+ if (game.vm_available_ops === 0) {
+ game.valid_spaces = []
+ }
},
done () {
game.valid_spaces = []
@@ -6032,7 +6068,7 @@ states.vm_add_x_infl = { gen_action_infl(spaces[space_id].name_unique)
}
} else {
- view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.`
+ view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.`
gen_action('done')
}
},
@@ -6070,22 +6106,9 @@ states.vm_add_limited_infl = { },
infl(space) {
vm_do_add_limited_infl(space, game.vm_max_infl)
- /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) {
- game.vm_event_done = true
- if (game.summary.length > 0) {
- pop_summary()
- log_br()
- }
- vm_next()
- }*/
- /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) {
- if (game.summary.length > 0) {
- pop_summary()
- log_br()
- }
- game.vm_event_done = true
- vm_next()
- }*/
+ if (game.vm_available_ops === 0) {
+ game.valid_spaces = []
+ }
},
done () {
if (game.summary.length > 0) {
@@ -6156,7 +6179,7 @@ states.vm_remove_x_infl = { gen_action_infl(spaces[space_id].name_unique);
}
} else {
- 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')
}
},
@@ -6175,14 +6198,17 @@ states.vm_remove_limited_infl = { inactive: 'remove SP.',
prompt () {
if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) {
- view.prompt = `${clean_name(cards[this_card()].name)}: remove ${game.vm_available_ops} SP${event_prompt()}, no more than ${game.vm_max_infl} per space.`
+ view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}, no more than ${game.vm_max_infl} per space.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}
- } else if (game.valid_spaces.length === 0) {
+ } else if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) {
view.prompt = `${clean_name(cards[this_card()].name)}: no further SP to remove.`
gen_action('done')
+ } else {
+ view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.`
+ gen_action('done')
}
},
infl(space) {
@@ -6436,7 +6462,7 @@ states.vm_adamec = { roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
let worker_spaces = spaces.filter(space => space && space.country === 'Czechoslovakia' && space.socio === 4 && check_dem_control(space.space_id)).length
if (worker_spaces > 0) {
log(`-${worker_spaces} from Democrat controlled worker spaces`)
@@ -6503,7 +6529,7 @@ states.vm_central_committee_reshuffle = { return `resolve ${clean_name(cards[57].name)}.`
},
prompt() {
- view.prompt = 'Choose a country to add SP.'
+ view.prompt = 'Central Committee Reshuffle: choose a country to add SPs.'
if (!game.revolutions[0]) {gen_action('poland')}
if (!game.revolutions[1]) {gen_action('hungary')}
if (!game.revolutions[2]) {gen_action('east_germany')}
@@ -6623,7 +6649,7 @@ states.vm_dash_for_the_west = { roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
let com_control = check_presence('East_Germany').com_spaces
if (roll > com_control) {
@@ -6819,10 +6845,10 @@ states.vm_exit_visas_finish = { },
prompt() {
if (game.temp > 0 ) {
- view.prompt = 'Draw replacement cards.'
+ view.prompt = 'Exit Visas: draw replacement cards.'
gen_action('draw')
} else {
- view.prompt = 'Exit Visas: done.'
+ view.prompt = 'Exit Visas. Draw cards: done.'
gen_action('done')
}
},
@@ -6907,6 +6933,9 @@ states.vm_goodbye_lenin = { goto_vm(card)
},
ops() {
+ if (game.valid_cards.length === 0) {
+ logi('No red events')
+ }
log('C46 played for operations')
game.view_opp_hand = false
game.state = 'vm_goodbye_lenin_ops'
@@ -7270,7 +7299,7 @@ states.vm_kremlin_coup_sc_prep = { return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- view.prompt = `Kremlin Coup! Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.`
+ view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.`
gen_action_sc(spaces[game.selected_space].name_unique);
},
sc(space) {
@@ -7301,7 +7330,7 @@ states.vm_kremlin_coup_end = { return `resolve ${clean_name(cards[this_card()].name)}.`
},
prompt() {
- view.prompt = `${clean_name(cards[this_card()].name)}: done.`
+ view.prompt = `${clean_name(cards[this_card()].name)} Support checks: done.`
gen_action('done')
},
done() {
@@ -7388,7 +7417,7 @@ states.vm_malta_summit = { roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
if (game.stability > 0) {
log(`+${game.stability} from USSR Stability Track`)
log(`Modified roll: ${roll + game.stability}`)
@@ -7434,11 +7463,11 @@ states.vm_modrow = { let roll = Math.floor(Math.random() * 6) + 1
let dem_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length
if (roll > dem_spaces) {
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
log(`Success. More than the ${dem_spaces} Democratically controlled spaces`)
vm_next()
} else {
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
log(`Fail. More than ${dem_spaces} required`)
permanently_remove(83)
vm_return()
@@ -7463,13 +7492,13 @@ states.vm_nepotism = { clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
if (roll < 3) {
- log(`ROLL: D${roll} adds 4 SPs`)
+ log(`Roll: D${roll} adds 4 SPs`)
game.vm_available_ops = 4}
else if (roll < 5 ) {
- log(`ROLL: D${roll} adds 3 SPs`)
+ log(`Roll: D${roll} adds 3 SPs`)
game.vm_available_ops = 3}
else {
- log(`ROLL: D${roll} adds 1 SP`)
+ log(`Roll: D${roll} adds 1 SP`)
game.vm_available_ops = 1}
//game.phase = 2
vm_next()
@@ -7557,7 +7586,7 @@ states.vm_nomenklatura_remove = { },
prompt() {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) {
- view.prompt = 'Remove SPs: done.'
+ view.prompt = 'Nomenklatura. Remove SPs: done.'
gen_action('done')
} else {
view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.'
@@ -7570,9 +7599,9 @@ states.vm_nomenklatura_remove = { infl(space) {
push_undo()
vm_do_remove_all_infl(space)
- if (game.vm_available_ops === 0) {
+ /*if (game.vm_available_ops === 0) {
vm_next()
- }
+ }*/
},
done() {
vm_next()
@@ -7585,7 +7614,7 @@ states.vm_nomenklatura_add = { },
prompt() {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) {
- view.prompt = 'Add SPs: done.'
+ view.prompt = 'Nomenklatura. Add SPs: done.'
gen_action('done')
} else {
view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.`
@@ -7719,7 +7748,7 @@ states.vm_shock_therapy = { worker_farmer++
}
}
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
log(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`)
log(`Modified roll: ${roll - worker_farmer}`)
if ((roll - worker_farmer) > 2) {
@@ -7817,7 +7846,7 @@ states.vm_the_chinese_solution = { 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.'
+ view.prompt = 'The Chinese Solution: you may give up 3 VP to conduct support checks in a country where you hold power.'
if (!game.revolutions[0]) {gen_action('poland')}
if (!game.revolutions[1]) {gen_action('hungary')}
if (!game.revolutions[2]) {gen_action('east_germany')}
@@ -7925,13 +7954,28 @@ states.vm_the_tyrant_is_gone = { }
}
+states.vm_tyrant_block ={
+ get inactive() {
+ return `resolve ${clean_name(cards[this_card()].name)}.`
+ },
+ prompt() {
+ view.prompt = `${clean_name(cards[this_card()].name)} has no effect after The Tyrant Has Gone.`
+ gen_action('done')
+ },
+ done() {
+ push_undo()
+ vm_next()
+ }
+}
+
+
states.vm_the_wall_must_go = {
get inactive() {
return `resolve ${clean_name(cards[this_card()].name)}.`
},
prompt() {
if (game.the_wall_must_go['dem_wins'] === 2 || game.the_wall_must_go['com_wins'] === 2) {
- view.prompt = 'The Wall Must Go! Done.'
+ view.prompt = '"The Wall Must Go!" Rolls: done.'
gen_action('done')
} else {
view.prompt = ('The Wall Must Go! Roll a die.')
@@ -7946,7 +7990,7 @@ states.vm_the_wall_must_go = { }
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
if (game.active === DEM) {
let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length
if (controlled_spaces > 0) {
@@ -8066,7 +8110,7 @@ states.vm_we_are_the_people_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- if (game.demInfl[6] === 0) {
+ if (game.demInfl[6] === 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 ) {
@@ -8076,7 +8120,7 @@ states.vm_we_are_the_people_remove = { gen_action_infl(spaces[space_id].name_unique);
}
} else {
- view.prompt = 'Remove SPs: done.'
+ view.prompt = '"We are the People!" Remove SPs: done.'
gen_action('done')
}
},
@@ -8103,7 +8147,7 @@ states.vm_we_are_the_people_add = { },
prompt() {
if (!game.vm_influence_added[6]) {
- view.prompt = '"We are the People!": done.'
+ view.prompt = '"We are the People!" Add SPs: done.'
gen_action('done')
return
}
@@ -8115,7 +8159,6 @@ states.vm_we_are_the_people_add = { }
},
infl(space) {
- push_undo()
vm_do_add_infl_free(space)
game.vm_influence_added[6]--
if (game.vm_influence_added[6] === 0 ) {game.valid_spaces = []}
@@ -8164,7 +8207,7 @@ states.vm_workers_revolt_finish = { roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
- log(`ROLL: D${roll}`)
+ log(`Roll: D${roll}`)
let adj = count_adj(spaces[game.selected_space].name_unique)
if (game.active === DEM) {
log(`-${adj.com_adj} from opponent controlled spaces`)
@@ -8238,7 +8281,7 @@ states.vm_tst_4 = { inactive: 'remove SPs',
prompt () {
if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) {
- view.prompt = 'Remove SPs: done.'
+ view.prompt = 'Tiananmen Square Track award. Remove SPs: done.'
gen_action('done')
return
}
@@ -8380,19 +8423,72 @@ states.vm_tst_8_ops = { // ========================= POWER STRUGGLE STATES ========================
-states.vm_support_surges = {
+states.vm_support_surges_1 = {
inactive: 'draw cards.',
prompt() {
- view.prompt = 'Support Surges: draw 2 cards.'
+ view.prompt = 'Support Surges: draw a card.'
gen_action('draw')
},
draw() {
if (game.active === DEM) {
- draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+2, game.com_pwr_hand.length)
+ console.log('hand before', game.dem_pwr_hand)
+ draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+1, game.com_pwr_hand.length)
+ game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length-1]
+ console.log('hand before', game.dem_pwr_hand, 'game.temp', game.temp)
} else {
- draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+2)
+ draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+1)
+ game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length-1]
}
+ game.state = 'vm_support_surges_2'
+
+ //game.phase = 0
+ //log('Drew 2 cards')
+ //log('Surrenders initiative')
+ //vm_next()
+ }
+}
+
+states.vm_support_surges_2 = {
+ inactive: 'draw cards.',
+ prompt() {
+ if (numberless_cards.includes(game.temp)) {
+ view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name}. Draw a second card.`
+ } else {
+ view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name} ${power_cards[game.temp].value}. Draw a second card.`
+ }
+ gen_action('draw')
+ },
+ draw() {
+ if (game.active === DEM) {
+ console.log('hand before', game.dem_pwr_hand)
+ draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+1, game.com_pwr_hand.length)
+ game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length - 1]
+ console.log('hand before', game.dem_pwr_hand, 'game.temp', game.temp)
+ } else {
+ draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+1)
+ game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length - 1]
+ }
+ game.state = 'vm_support_surges_3'
+ /*game.phase = 0
+ log('Drew 2 cards')
+ log('Surrenders initiative')
+ vm_next()*/
+ }
+}
+
+states.vm_support_surges_3 = {
+ inactive: 'draw cards.',
+ prompt() {
+ if (numberless_cards.includes(game.temp)) {
+ view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name}. Done.`
+ } else {
+ view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name} ${power_cards[game.temp].value}. Done.`
+ }
+ gen_action('done')
+ },
+ done() {
game.phase = 0
+ delete game.temp
log('Drew 2 cards')
log('Surrenders initiative')
vm_next()
@@ -8437,41 +8533,41 @@ states.vm_support_falters = { const CODE = []
CODE[1] = [ // Legacy of Martial Law*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country_opp, 'Poland' ],
[ vm_prompt, 'replace 1 Democratic SP in Poland with a Communist SP' ],
[ vm_legacy_of_martial_law ],
[ vm_valid_spaces_country_sc, 'Poland' ],
[ vm_prompt, 'make a Support Check in Poland' ],
[ vm_1_support_check ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[2] = [ // Solidarity Legalised*
+ [ vm_permanently_remove ],
[ vm_solidarity_legalised ],
[ vm_valid_spaces_solidarity_legalised ],
[ vm_prompt, 'to every uncontrolled Worker and Farmer space in Poland' ],
[ vm_add_limited_infl, 9, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[3] = [ // Walesa
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Poland' ],
[ vm_prompt, 'any space(s) in Poland' ],
[ vm_add_infl_free, 4 ],
[ vm_valid_spaces_country_sc, 'Poland' ],
[ vm_prompt, 'make Support Checks in Poland' ],
[ vm_support_check, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[4] = [ // Michnik
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 26 ],
[ vm_prompt, 'the Polish Intellectuals space' ],
[ vm_add_x_infl, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8486,9 +8582,9 @@ CODE[6] = [ // Brought in for Questioning ]
CODE[7] = [ // State Run Media*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_opponent ],
[ vm_remove_limited_opp_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8498,18 +8594,20 @@ CODE[8] = [ // Prudence ]
CODE[9] = [ // The Wall*
- [ vm_the_wall ],
[ vm_permanently_remove ],
+ [ vm_the_wall ],
[ vm_return ],
]
CODE[10] = [ // Cult of Personality
+ [ vm_permanently_remove ],
[ vm_if, ()=>!game.the_tyrant_is_gone ],
[ vm_valid_spaces_country_socio_2, 'Romania', 3, 4 ],
[ vm_prompt, 'Worker or Farmer spaces in Romania, no more than 2 per space' ],
[ vm_add_limited_infl, 4, 2 ],
+ [ vm_else ],
+ [ vm_tyrant_block ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8521,16 +8619,16 @@ CODE[11] = [ // Dissident arrested ]
CODE[12] = [ // Apparatchicks
+ [ vm_permanently_remove ],
[ vm_valid_spaces_socio, 2 ],
[ vm_prompt, ' to any Bureaucratic space(s)' ],
[ vm_add_infl_free, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[13] = [ // Stasi
- [ vm_stasi ],
[ vm_permanently_remove ],
+ [ vm_stasi ],
[ vm_return ],
]
@@ -8550,8 +8648,8 @@ CODE[15] = [ // Honecker ]
CODE[16] = [ // Nomenklatura*
- [ vm_nomenklatura ],
[ vm_permanently_remove ],
+ [ vm_nomenklatura ],
[ vm_return ],
]
@@ -8561,18 +8659,18 @@ CODE[17] = [ // Roundtable talks ]
CODE[18] = [ // Poszgay Defends the Revolution
+ [ vm_permanently_remove ],
[ vm_poszgay ],
[ vm_prompt, 'to 4 spaces in Hungary not under Democratic control' ],
[ vm_add_limited_infl, 4, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[19] = [ // Papal vist
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 20, 35, 38 ],
[ vm_prompt, 'any Catholic Church space' ],
[ vm_add_x_infl, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8598,6 +8696,7 @@ CODE[23] = [ // Power Struggle - Hungary ]
CODE[24] = [ // St Nicolas Church
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 6 ],
[ vm_prompt, 'the Lutheran Church' ],
[ vm_take_control_prep, 1 ],
@@ -8606,13 +8705,14 @@ CODE[24] = [ // St Nicolas Church ]
CODE[25] = [ // Perestroika
+ [ vm_permanently_remove ],
[ vm_perestroika ],
[ vm_return ],
]
CODE[26] = [ // Helsinki Final Act*
- [ vm_helsinki_final_act ],
[ vm_permanently_remove ],
+ [ vm_helsinki_final_act ],
[ vm_return ],
]
@@ -8635,10 +8735,10 @@ CODE[28] = [ // Factory Party Cells ]
CODE[29] = [ // Jan Palach Week*
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 30 ],
[ vm_prompt, 'the Charles University space' ],
[ vm_add_x_infl, 6 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8655,33 +8755,33 @@ CODE[31] = [ // Intelligentsia ]
CODE[32] = [ // Peasant Parties*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_socio, 3 ],
[ vm_prompt, 'Farmer spaces, no more than 2 per space' ],
[ vm_add_limited_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[33] = [ // Sajudis*
+ [ vm_permanently_remove ],
[ vm_sajudis_check ],
[ vm_prompt, 'any Minorities space' ],
[ vm_take_control_prep, 1 ],
[ vm_sajudis ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[34] = [ // Fidesz*
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 47 ],
[ vm_prompt, 'the Hungary students space' ],
[ vm_add_x_infl, 5 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[35] = [ // Heal our Bleeding Wounds*
- [ vm_heal_our_bleeding_wounds ],
[ vm_permanently_remove ],
+ [ vm_heal_our_bleeding_wounds ],
[ vm_return ],
]
@@ -8693,25 +8793,26 @@ CODE[36] = [ // Dash for the West* ]
CODE[37] = [ // Nagy Reburied*
+ [ vm_permanently_remove ],
[ vm_nagy_reburied ],
[ vm_prompt, 'the Hungary Elite space' ],
[ vm_remove_all_infl, 1 ],
[ vm_valid_spaces_country, 'Hungary' ],
[ vm_prompt, 'Hungary, no more than 2 per space' ],
[ vm_add_limited_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[38] = [ // July Concept
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Bulgaria' ],
[ vm_prompt, 'Bulgaria' ],
[ vm_add_infl_free, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[39] = [ // Eco-Glasnost*
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 66 ],
[ vm_prompt, 'Ruse' ],
[ vm_add_x_infl, 4 ],
@@ -8720,17 +8821,18 @@ CODE[39] = [ // Eco-Glasnost* ]
CODE[40] = [ // Hungarian Democratic Forum
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Hungary' ],
[ vm_prompt, 'Hungary' ],
[ vm_add_infl_free, 3 ],
[ vm_valid_spaces_country_sc, 'Hungary' ],
[ vm_prompt, 'make a Support Check in Hungary' ],
[ vm_1_support_check ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[41] = [ // Ceausescu*
+ [ vm_permanently_remove ],
[ vm_if, ()=>!game.the_tyrant_is_gone ],
[ vm_valid_spaces_country_opp, 'Romania' ],
[ vm_prompt, ' from Romania' ],
@@ -8740,8 +8842,9 @@ CODE[41] = [ // Ceausescu* [ vm_1_support_check ],
[ vm_prompt, ' from Bucharesti' ],
[ vm_ceausescu ],
+ [ vm_else ],
+ [ vm_tyrant_block ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8756,6 +8859,7 @@ CODE[43] = [ // Power Struggle - Bulgaria ]
CODE[44] = [ // Inflationary Currency
+ [ vm_permanently_remove ],
[ vm_inflationary_currency ],
[ vm_valid_spaces_country_opp ],
[ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ],
@@ -8766,71 +8870,70 @@ CODE[44] = [ // Inflationary Currency [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ],
[ vm_1_support_check ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[45] = [ // Soviet Troop Withdrawals*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_region_opp, 'Eastern Europe' ],
[ vm_prompt, ' from Eastern Europe' ],
[ vm_remove_limited_opp_infl, 5, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[46] = [ // Goodbye Lenin!*
- [ vm_goodbye_lenin ],
[ vm_permanently_remove ],
+ [ vm_goodbye_lenin ],
[ vm_return ],
]
CODE[47] = [ // Bulgarian Turks Expelled*
+ [ vm_permanently_remove ],
[ vm_bulgarian_turks_expelled ],
[ vm_prompt, 'Razgrad' ],
[ vm_remove_all_infl, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[48] = [ // We are the People!*
- [ vm_we_are_the_people ],
[ vm_permanently_remove ],
+ [ vm_we_are_the_people ],
[ vm_return ],
]
CODE[49] = [ // Foreign Currency Debt Burden*
- [ vm_foreign_currency_debt_burden ],
[ vm_permanently_remove ],
+ [ vm_foreign_currency_debt_burden ],
[ vm_return ],
]
CODE[50] = [ // The Sinatra Doctrine*
- [ vm_the_sinatra_doctrine ],
[ vm_permanently_remove ],
+ [ vm_the_sinatra_doctrine ],
[ vm_return ],
]
CODE[51] = [ // 40th Anniversary Celebration*
+ [ vm_permanently_remove ],
[ vm_40th_anniversary_celebration ],
[ vm_valid_spaces_country, 'East_Germany' ],
[ vm_prompt, 'East Germany' ],
[ vm_add_infl_free ],
[ vm_40th_anniversary_celebration_vp ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[52] = [ // Normalisation
+ [ vm_permanently_remove ],
[ vm_normalisation ],
[ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ],
[ vm_remove_all_infl, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[53] = [ // Li Peng*
- [ vm_li_peng ],
[ vm_permanently_remove ],
+ [ vm_li_peng ],
[ vm_return ],
]
@@ -8845,17 +8948,17 @@ CODE[55] = [ // Power Struggle - Czechoslovakia ]
CODE[56] = [ // Foreign Television
+ [ vm_permanently_remove ],
[ vm_foreign_television ],
[ vm_remove_limited_opp_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[57] = [ // Central Committee Reshuffle*
+ [ vm_permanently_remove ],
[ vm_central_committee_reshuffle ],
[ vm_prompt, ()=>`${country_name(game.vm_active_country)}` ],
[ vm_add_infl_free, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8870,21 +8973,21 @@ CODE[59] = [ // GrenzTruppen* ]
CODE[60] = [ // Toxic Waste*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_socio, 4 ],
[ vm_prompt, 'any Worker space(s)' ],
[ vm_add_infl_free, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[61] = [ // The Monday Demonstrations*
+ [ vm_permanently_remove ],
[ vm_the_monday_demonstrations ],
[ vm_prompt, 'the Lutheran Church Space and Leipzig' ],
[ vm_take_control_prep, 2 ],
[ vm_valid_spaces_country_sc, 'East_Germany' ],
[ vm_prompt, 'make 5 Support Checks in East Germany' ],
[ vm_support_check, 5 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8899,24 +9002,24 @@ CODE[63] = [ // Genscher* ]
CODE[64] = [ // Legacy of 1968*
+ [ vm_permanently_remove ],
[ vm_legacy_of_1968 ],
[ vm_prompt, 'all spaces in Czechoslovakia not controlled by the Communist Player' ],
[ vm_add_limited_infl, 11, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[65] = [ // Presidential Visit*
- [ vm_presidential_visit ],
[ vm_permanently_remove ],
+ [ vm_presidential_visit ],
[ vm_return ],
]
CODE[66] = [ // New Forum
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'East_Germany' ],
[ vm_prompt, '3 spaces in East Germany' ],
[ vm_add_limited_infl, 3, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8927,19 +9030,19 @@ CODE[67] = [ // Reformer Rehabilitated* ]
CODE[68] = [ // Klaus and Komarek*
+ [ vm_permanently_remove ],
[ vm_klaus_and_komarek ],
[ vm_prompt, 'Prague' ],
[ vm_remove_x_opp_infl, 2 ],
[ vm_valid_spaces, 29 ],
[ vm_add_x_infl, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[69] = [ // Systematization*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Romania' ],
[ vm_systematization ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8960,6 +9063,7 @@ CODE[72] = [ // Peasant Parties Revolt ]
CODE[73] = [ // Laszlo Tokes*
+ [ vm_permanently_remove ],
[ vm_valid_spaces, 50, 56 ],
[ vm_prompt, 'in Timisoara and Harghita/Covasna' ],
[ vm_add_limited_infl, 2, 1 ],
@@ -8971,7 +9075,6 @@ CODE[73] = [ // Laszlo Tokes* [ vm_prompt, 'make 2 Support Checks in Romania' ],
[ vm_support_check, 2 ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -8981,12 +9084,13 @@ CODE[74] = [ // FRG Embassies ]
CODE[75] = [ // Exit Visas*
- [ vm_exit_visas ],
[ vm_permanently_remove ],
+ [ vm_exit_visas ],
[ vm_return ],
]
CODE[76] = [ // Warsaw Pact Summit
+ [ vm_permanently_remove ],
[ vm_warsaw_pact_summit ],
[ vm_if, ()=>game.phase === 3 ],
[ vm_prompt, ' spaces with no Democratic SPs' ],
@@ -8996,13 +9100,12 @@ CODE[76] = [ // Warsaw Pact Summit [ vm_valid_spaces_country_socio_2, 3,, 4 ],
[ vm_support_check_modified, 2, 2 ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[77] = [ // Samizdat
- [ vm_samizdat ],
[ vm_permanently_remove ],
+ [ vm_samizdat ],
[ vm_return ],
]
@@ -9012,95 +9115,96 @@ CODE[78] = [ // Workers Revolt ]
CODE[79] = [ // The Third Way*
+ [ vm_permanently_remove ],
[ vm_the_third_way ],
[ vm_valid_spaces, 4 ],
[ vm_prompt, 'the East German Writers space' ],
[ vm_add_x_infl, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[80] = [ // Nepotism*
+ [ vm_permanently_remove ],
[ vm_nepotism ],
[ vm_valid_spaces_region_socio, 'Balkans', 4 ],
[ vm_prompt, 'Worker spaces in the Balkans' ],
[ vm_add_infl_free ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[81] = [ // The Baltic Way*
+ [ vm_permanently_remove ],
[ vm_the_baltic_way ],
[ vm_prompt, 'any Minorities space' ],
[ vm_take_control_prep, 1 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[82] = [ // Spitzel*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country_opp, 'East_Germany' ],
[ vm_prompt, ' from East Germany' ],
[ vm_remove_opp_infl, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[83] = [ // Modrow*
+ [ vm_permanently_remove ],
[ vm_modrow ],
[ vm_valid_spaces_country, 'East_Germany' ],
[ vm_prompt, 'East Germany' ],
[ vm_add_limited_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[84] = [ // Breakaway Baltic Republics*
+ [ vm_permanently_remove ],
[ vm_breakaway_baltic_republics ],
[ vm_prompt, 'any Minorities space' ],
[ vm_take_control_prep, 1 ],
[ vm_valid_spaces_sc ],
[ vm_prompt, 'select a space for the support check' ],
[ vm_1_support_check ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[85] = [ // Tank Column/Tank Man*
- [ vm_tank_column ],
[ vm_permanently_remove ],
+ [ vm_tank_column ],
[ vm_return ],
]
CODE[86] = [ // The Wall Must Go!*
+ [ vm_permanently_remove ],
[ vm_the_wall_must_go ],
[ vm_remove_infl, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[87] = [ // Kohl Proposes Reunification*
- [ vm_kohl_proposes_reunification ],
[ vm_permanently_remove ],
+ [ vm_kohl_proposes_reunification ],
[ vm_return ],
]
CODE[88] = [ // Adamec*
+ [ vm_permanently_remove ],
[ vm_adamec ],
[ vm_valid_spaces_country, 'Czechoslovakia' ],
[ vm_prompt, 'Czechoslovakia' ],
[ vm_add_limited_infl, 4, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[89] = [ // Domino Theory*
- [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile.' ],
- [ vm_domino_theory ],
+ [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ],
[ vm_permanently_remove ],
+ [ vm_domino_theory ],
[ vm_return ],
]
CODE[90] = [ // Civic Forum*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country, 'Czechoslovakia' ],
[ vm_prompt, 'Czechoslovakia' ],
[ vm_add_infl_free, 4 ],
@@ -9108,45 +9212,44 @@ CODE[90] = [ // Civic Forum* [ vm_valid_spaces_country_sc, 'Czechoslovakia' ],
[ vm_prompt, 'Select a space in Czechoslovakia' ],
[ vm_support_check, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[91] = [ // My First Banana*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country_opp, 'East_Germany' ],
[ vm_prompt, ' from East Germany' ],
[ vm_remove_opp_infl, 2 ],
[ vm_valid_spaces_country_sc, 'East_Germany' ],
[ vm_prompt, 'select a space in East Germany' ],
[ vm_support_check, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[92] = [ // Betrayal
+ [ vm_permanently_remove ],
[ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ],
[ vm_betrayal ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[93] = [ // Shock Therapy*
+ [ vm_permanently_remove ],
[ vm_shock_therapy ],
[ vm_valid_spaces_country ],
[ vm_prompt, ()=>` ${country_name(game.vm_active_country)}` ],
[ vm_add_infl_free, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[94] = [ // Union of Democratic Forces*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country_opp, 'Bulgaria' ],
[ vm_prompt, ' from Bulgaria' ],
[ vm_remove_opp_infl, 4 ],
[ vm_valid_spaces_country_sc, 'Bulgaria' ],
[ vm_prompt, 'Make 2 Support Checks in Bulgaria' ],
[ vm_support_check, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
@@ -9156,16 +9259,16 @@ CODE[95] = [ // Power Struggle - Romania ]
CODE[96] = [ // The Chinese Solution*
+ [ vm_permanently_remove ],
[ vm_the_chinese_solution ],
[ vm_valid_spaces_country_sc ],
- [ vm_prompt, ()=>`Make 5 Support Checks in ${country_name(game.vm_active_country)}` ],
+ [ vm_prompt, ()=>`make 5 Support Checks in ${country_name(game.vm_active_country)}` ],
[ vm_support_check_modified, 5, 3 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[97] = [ // The Tyrant is Gone*
- [ vm_if, ()=>game.persistent_events['the_crowd_turns_against_ceausescu'] ],
+ [ vm_if, ()=>game.persistent_events.includes(54) ],
[ vm_valid_spaces, 51 ],
[ vm_prompt, 'the Romanian Elite Space' ],
[ vm_remove_x_opp_infl, 4 ],
@@ -9178,35 +9281,38 @@ CODE[97] = [ // The Tyrant is Gone* ]
CODE[98] = [ // Politburo Intrigue*
+ [ vm_permanently_remove ],
[ vm_valid_spaces_country_opp, 'Bulgaria' ],
[ vm_prompt, ' from Bulgaria' ],
[ vm_remove_limited_opp_infl, 3, 2 ],
[ vm_valid_spaces_country_sc, 'Bulgaria' ],
[ vm_prompt, 'make a support check in Bulgaria' ],
[ vm_1_support_check ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[99] = [ // Ligachev*
- [ vm_ligachev ],
[ vm_permanently_remove ],
+ [ vm_ligachev ],
[ vm_return ],
]
CODE[100] = [ // Stand Fast*
- [ vm_stand_fast ],
[ vm_permanently_remove ],
+ [ vm_stand_fast ],
[ vm_return ],
]
CODE[101] = [ // Elena*
+ [ vm_permanently_remove ],
[ vm_if, ()=>!game.the_tyrant_is_gone ],
[ vm_valid_spaces, 51 ],
[ vm_prompt, 'the Romania Elite Space' ],
[ vm_add_x_infl, 2 ],
- [ vm_endif ],
[ vm_elena ],
+ [ vm_else ],
+ [ vm_tyrant_block ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -9229,19 +9335,21 @@ CODE[104] = [ // New Year's Eve Party* ]
CODE[105] = [ // Public Against Violence*
- [ vm_valid_spaces, 36, 37 ],
- [ vm_prompt, 'Kosice and Presov' ],
+ [ vm_permanently_remove ],
+ [ vm_valid_spaces, 36 ],
+ [ vm_prompt, 'Kosice' ],
[ vm_add_x_infl, 2 ],
- [ vm_valid_spaces, 36, 37 ],
+ [ vm_valid_spaces, 37 ],
+ [ vm_prompt, 'Presov' ],
[ vm_add_x_infl, 2 ],
[ vm_public_against_violence ],
[ vm_prompt, 'Make a Support Check in Bratislava' ],
[ vm_support_check_modified, 1, 2 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[106] = [ // Social Democratic Platform Adopted*
+ [ vm_permanently_remove ],
[ vm_social_democratic_platform_adopted ],
[ vm_valid_spaces_country ],
[ vm_prompt, ()=>`${country_name(game.vm_active_country)}` ],
@@ -9249,43 +9357,46 @@ CODE[106] = [ // Social Democratic Platform Adopted* [ vm_valid_spaces_country_sc ],
[ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ],
[ vm_1_support_check ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[107] = [ // Massacre in Timisoara*
+ [ vm_permanently_remove ],
[ vm_if, ()=>!game.the_tyrant_is_gone ],
[ vm_massacre_in_timisoara ],
[ vm_valid_spaces_country_sc, 'Romania' ],
[ vm_prompt, 'Make Support Checks in Romania' ],
[ vm_support_check_modified, 2, 2 ],
+ [ vm_else ],
+ [ vm_tyrant_block ],
[ vm_endif ],
- [ vm_permanently_remove ],
[ vm_return ],
]
CODE[108] = [ // Army Backs Revolution*
- [ vm_army_backs_revolution ],
[ vm_permanently_remove ],
+ [ vm_army_backs_revolution ],
[ vm_return ],
]
CODE[109] = [ // Kremlin Coup*
- [ vm_kremlin_coup ],
[ vm_permanently_remove ],
+ [ vm_kremlin_coup ],
[ vm_return ],
]
CODE[110] = [ // Malta Summit*
+ [ vm_permanently_remove ],
[ vm_malta_summit ],
[ vm_prompt, ' from Elite spaces' ],
[ vm_remove_opp_infl, 5 ],
- [ vm_permanently_remove ],
[ vm_return ],
]
// #endregion
+
+
// ============= TIANANMEN SQUARE TRACK AWARDS ====================
CODE[203] = [//Tiananmen Square space 3 award
[vm_tst_3],
|