From 7396312cd495803df67a2e8ca17cf7b01927cfdb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 10 Oct 2024 22:29:33 +0100 Subject: Adding undo steps --- events.txt | 2 +- rules.js | 119 ++++++++++++++++++++++++++++++++++--------------------------- 2 files changed, 67 insertions(+), 54 deletions(-) diff --git a/events.txt b/events.txt index b95fa7c..5855621 100644 --- a/events.txt +++ b/events.txt @@ -486,7 +486,7 @@ permanently_remove CARD 67 - Reformer Rehabilitated* # If you are ahead on the Tiananmen Square track, draw any card in the discard pile. The event takes place immediately. -prompt 'Chose any non-scoring card in the discard pile. Event takes place immediately' +prompt 'Reformer Rehabilitated: chose any non-scoring card in the discard pile. Event takes place immediately' reformer_rehabilitated diff --git a/rules.js b/rules.js index 6d15377..6a8501a 100644 --- a/rules.js +++ b/rules.js @@ -3585,7 +3585,7 @@ function get_card_ops(card) { ops ++ } if (game.persistent_events.includes(50) && game.active === DEM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { log('+1 op from C50') } ops ++ @@ -3599,7 +3599,7 @@ function get_card_ops(card) { } if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { if (ops > 2) { log(`${pluralize(game.prudence.DEM,'op')} from C8`) } else { @@ -4683,7 +4683,6 @@ function vm_opp_hand_false() { } function vm_valid_spaces() { - //vm_assert_argcount(6) let space_1 = vm_operand(1) let space_2 = vm_operand(2) let space_3 = vm_operand(3) @@ -6330,27 +6329,26 @@ states.vm_add_infl_free = { for (let space_id of game.valid_spaces) { gen_action_infl(spaces[space_id].name_unique); } - } /* else { - view.prompt = 'Add influence: done.' + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.` gen_action('done') - } */ + } }, infl(space) { vm_do_add_infl_free(space) - if (game.vm_available_ops === 0 ) { - game.valid_spaces = [] - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } + /*if (game.vm_available_ops === 0 ) { + + }*/ }, - /*done () { + done () { + game.valid_spaces = [] game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } vm_next() - }*/ + } } states.vm_add_x_infl = { @@ -6365,20 +6363,21 @@ states.vm_add_x_infl = { for (let space_id of game.valid_spaces) { gen_action_infl(spaces[space_id].name_unique) } - } /*else { - view.prompt = 'Add influence: done.' + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.` gen_action('done') - }*/ + } }, infl(space) { + push_undo() vm_do_add_x_infl(space) - game.vm_event_done = true - vm_next() + //game.vm_event_done = true + //vm_next() }, - /*done () { + done () { game.vm_event_done = true vm_next() - }*/ + } } states.vm_add_limited_infl = { @@ -6397,7 +6396,7 @@ states.vm_add_limited_infl = { gen_action_infl(spaces[space_id].name_unique); } } else { - view.prompt = `${clean_name(cards[this_card()].name)}: done.` + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') } }, @@ -6411,14 +6410,14 @@ states.vm_add_limited_infl = { } vm_next() }*/ - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { + /*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() - } + }*/ }, done () { if (game.summary.length > 0) { @@ -6478,25 +6477,25 @@ states.vm_remove_x_infl = { return `resolve ${clean_name(cards[this_card()].name)}: remove SP from ${event_prompt()}.` }, prompt () { - if (game.valid_spaces.length === 0) { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` gen_action('done') - } else { + } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` for (let space_id of game.valid_spaces) { gen_action_infl(spaces[space_id].name_unique); } - } /*else { - view.prompt = 'Remove influence: done.' + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove influence: done.` gen_action('done') - }*/ + } }, infl(space) { vm_do_remove_x_infl(space) - game.vm_event_done = true - vm_next() + /*game.vm_event_done = true + vm_next()*/ }, done () { game.vm_event_done = true @@ -6520,17 +6519,16 @@ states.vm_remove_limited_infl = { }, infl(space) { vm_do_remove_limited_infl(space, game.vm_max_infl) - if (game.vm_available_ops === 0) { + /*if (game.vm_available_ops === 0) { game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } + } */ }, done () { game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } vm_next() } } @@ -6538,24 +6536,26 @@ states.vm_remove_limited_infl = { states.vm_remove_all_infl = { inactive: 'remove Support Points', prompt () { - if (game.valid_spaces.length === 0) { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` gen_action('done') - return - } - view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + } else if (game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(spaces[space_id].name_unique); + } + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') } }, infl(space) { vm_do_remove_all_infl(space) const clicked_space = find_space_index(space) game.vm_active_country = spaces[clicked_space].country - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { + /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { vm_next() - } + }*/ }, done() { vm_next() @@ -7037,11 +7037,12 @@ states.vm_deutsche_marks_prep = { } }, card(card) { + push_undo() log(`Gave C${cards[card].number}`) game.valid_cards = [] silent_discard(card) - next_player() - game.state = 'vm_deutsche_marks' + //next_player() + game.state = 'vm_deutsche_marks_confirm' game.vm_event = card }, pass() { @@ -7049,6 +7050,18 @@ states.vm_deutsche_marks_prep = { } } +states.vm_deutsche_marks_confirm = { + inactive: 'choose a card.', + prompt() { + view.prompt = `Deutsche Marks: gave ${cards[game.vm_event].name}.` + gen_action('done') + }, + done() { + next_player() + game.state = 'vm_deutsche_marks' + } +} + states.vm_deutsche_marks = { get inactive() { return `resolve ${clean_name(cards[20].name)}.` @@ -9240,7 +9253,7 @@ CODE[66] = [ // New Forum ] CODE[67] = [ // Reformer Rehabilitated* - [ vm_prompt, 'Chose any non-scoring card in the discard pile. Event takes place immediately' ], + [ vm_prompt, 'Reformer Rehabilitated: chose any non-scoring card in the discard pile. Event takes place immediately' ], [ vm_reformer_rehabilitated ], [ vm_return ], ] -- cgit v1.2.3 From a93ef46743251516b3ad4075fdd518ed45d0776d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 11 Oct 2024 08:21:08 +0100 Subject: Revert to old view --- play.html | 59 --------- play.js | 103 ++-------------- rules.js | 402 ++++---------------------------------------------------------- 3 files changed, 32 insertions(+), 532 deletions(-) diff --git a/play.html b/play.html index a9026e6..8e25b8c 100644 --- a/play.html +++ b/play.html @@ -21,65 +21,6 @@
- -
  • TITLE -
  • -
  • 🎴 Event -
  • Place SPs -
  • 💪 Support Check -
  • Tiananmen Square Track -
  • - - -
  • TITLE -
  • -
  • 🎴 Resolve Opponent Event -
  • Place SPs -
  • 💪 Support Check -
  • Tiananmen Square Track -
  • - - -
  • TITLE -
  • -
  • 🎴 Play with Common European Home -
  • 🎴 Resolve Opponent Event -
  • Place SPs -
  • 💪 Support Check -
  • 🛤 Tiananmen Square Track -
  • - - -
  • TITLE -
  • -
  • 🎴 Cancel Opponent Event -
  • 🎴 Resolve Opponent Event -
  • Place SPs -
  • 💪 Support Check -
  • Tiananmen Square Track -
  • - - -
  • TITLE -
  • -
  • 🎴 Event and Operations -
  • 🎴 Event -
  • Place SPs -
  • 💪 Support Check -
  • Tiananmen Square Track -
  • - - -
  • TITLE -
  • -
  • 🎴 Cancel Opponent Event -
  • 🎴 Resolve Opponent Event -
  • 🎴 Event and Operations -
  • Place SPs -
  • 💪 Support Check -
  • Tiananmen Square Track -
  • -
    diff --git a/play.js b/play.js index 7b18e6e..99dd5f6 100644 --- a/play.js +++ b/play.js @@ -162,73 +162,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi } } -// POP UP CARD MENU - -var card_action_menu = Array.from(document.getElementById("popup").querySelectorAll("li[data-action]")).map(e => e.dataset.action) - -console.log('card_action_menu', card_action_menu) - -function show_popup_menu(evt, menu_id, target_id, title) { - let menu = document.getElementById(menu_id) - console.log('show_popup_menu called with evt',evt, 'menu_id',menu_id, 'target_id', target_id, 'title', title) - - let show = false - console.log(`menu.querySelectorAll("li")`, menu.querySelectorAll("li")) - for (let item of menu.querySelectorAll("li")) { - let action = item.dataset.action - console.log('item', item, 'action', action) - if (action) { - //console.log('in if action') - if (is_card_action(action, target_id)) { - console.log('in is_card_action',) - show = true - item.classList.add("action") - item.classList.remove("disabled") - item.onclick = function () { - send_action(action, target_id) - hide_popup_menu() - evt.stopPropagation() - } - } else { - item.classList.remove("action") - item.classList.add("disabled") - item.onclick = null - } - } - } - if (show) { - menu.onmouseleave = hide_popup_menu - menu.style.display = "block" - if (title) { - let item = menu.querySelector("li.title") - if (item) { - item.onclick = hide_popup_menu - item.textContent = title - } - } - - let w = menu.clientWidth - let h = menu.clientHeight - let x = Math.max(5, Math.min(evt.clientX - w / 2, window.innerWidth - w - 5)) - let y = Math.max(5, Math.min(evt.clientY - 12, window.innerHeight - h - 40)) - menu.style.left = x + "px" - menu.style.top = y + "px" - - evt.stopPropagation() - } else { - menu.style.display = "none" - } -} - -function hide_popup_menu() { - document.getElementById("popup").style.display = "none" - document.getElementById("popup_ceh_check").style.display = "none" - document.getElementById("popup_opp_event").style.display = "none" - document.getElementById("popup_tst_7").style.display = "none" - document.getElementById("popup_tst_8").style.display = "none" - document.getElementById("popup_tst_7_8").style.display = "none" -} function is_card_enabled(card) { @@ -262,37 +196,16 @@ function on_click_space(evt) { } function on_click_card(evt) { - const card = evt.target.my_card; - console.log('on_click_card_called with card:', card); - if (is_action('card', card)) { - console.log('in action card') - if (send_action('card', card)) { - evt.stopPropagation(); - } - } - //First check for TST special powers - else if (is_card_action('card_tst_7', card)) { - if (is_card_action('card_tst_8', card)) { - show_popup_menu(evt, "popup_tst_7_8", card, cards[card].name) - } else { - show_popup_menu(evt, "popup_tst_7", card, cards[card].name) + if (evt.button === 0) { + const card = evt.target.my_card; + console.log('on_click_card_called with card:', card); + if (is_action('card', card)) { + console.log('in action card') + if (send_action('card', card)) { + evt.stopPropagation(); + } } } - else if (is_card_action('card_tst_8', card)) { - show_popup_menu(evt, "popup_tst_8", card, cards[card].name) - } - - //Check for Common European Home - else if (is_card_action('card_ceh', card)) { - show_popup_menu(evt, "popup_ceh_check", card, cards[card].name) - } else if (is_card_action('card_opp_event', card)) { - console.log('in action card_opp_event') - show_popup_menu(evt, "popup_opp_event", card, cards[card].name) - } - else { - console.log('in action card_my_event') - show_popup_menu(evt, "popup", card, cards[card].name) - } } function is_action(action) { diff --git a/rules.js b/rules.js index 6a8501a..ac5f93f 100644 --- a/rules.js +++ b/rules.js @@ -413,17 +413,11 @@ states.start_game = { states.choose_card = { inactive: 'choose a card.', prompt() { - /*if (game.played_card > 0) { - game.state = 'play_card' - view.prompt = 'Choose a card: done.' - gen_action("done"); - return; - } */ 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') } else { - view.prompt = 'Play a card.' + view.prompt = 'Choose a card.' let available_cards if (game.active === DEM) { available_cards = game.democrat_hand @@ -431,66 +425,11 @@ states.choose_card = { available_cards = game.communist_hand } for (let card of available_cards) { - //gen_action('card_event', card) - - if (scoring_cards.includes(card)) { - /*view.prompt = 'Play for:'*/ - gen_action('card_event', card) - } - - - //Check for Tiananmen Square Track awards special abilities - - if ((game.active === DEM && cards[card].side !== 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[card].side !== 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ - gen_action('card_tst_7', card) - } - - console.log('game.tst_8', game.tst_8) - if ((game.active === DEM && cards[card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){ - gen_action('card_tst_8', card) - } - - // Check for Reformer Rehabilitated - - //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) - - - if (card === 67 && game.playable_cards.includes(67)){ - if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { - gen_action('card_event', card) - } - if (game.active === COM && (game.dem_tst_position < game.com_tst_position)) { - gen_action('card_event', card) - } - } - - //Continue with normal logic - - //Check if it is a card with an event which is always playable - - if (cards[card].playable) { - get_events(card) - } - - // Resolve cards with variable events (not Reformer) - - if (card !== 67 && game.playable_cards.includes(card)) { - get_events(card) - } - - //Actions for non-scoring cards - - if (!scoring_cards.includes(card)) { - gen_action('card_influence', card) - 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('card_tst', card) - } - gen_action('card_support_check', card) - } + gen_action_card(card) } } }, - /*card_event(card) { + card(card) { push_undo() //Check if player is at risk of losing game due to held scoring card if (!scoring_cards.includes(card)) { @@ -503,120 +442,11 @@ states.choose_card = { } } select_card(card) - },*/ + }, pass() { log('No cards remaining. Passed') end_round() - }, - card_event(card) { - push_undo() - select_card(card) - console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - log_gap(`Played C${cards[game.played_card].number} for the event`) - if (scoring_cards.includes(game.played_card)) {game.phase = 0} - else {game.phase = 1} - game.return = game.active - if (switch_events.includes(game.played_card)) {next_player()} - game.vm_event = game.played_card - goto_vm(game.vm_event) - }, - card_opp_event(card) { - push_undo() - select_card(card) - log_gap(`Played C${cards[game.played_card].number} for the event`) - game.phase = 1 /*Do I still need this?*/ - game.vm_infl_to_do = true - game.return = game.active - game.vm_event = game.played_card - if (auto_resolve_events.includes(game.played_card) || switch_events.includes(game.played_card)) { - goto_vm(game.vm_event)} - else { - next_player() - log(`C${game.vm_event}`) - goto_vm(game.vm_event) - } - }, - card_influence(card) { - push_undo() - select_card(card) - log_gap(`Played C${cards[game.played_card].number} to place SPs`) - - - // Check if Common European Home played for influence - if (game.played_card === 21) { - if (game.active === DEM) { - game.vp -- - log('-1 VP') - if (check_vp()) { - return - } - } else { - game.vp ++ - log('+1 VP') - if (check_vp()) { - return - } - } - } - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - //game.phase = 1 /*Do I need this? */ - game.vm_event_to_do = true - } - } - - // If ABHR - Set AHBR tracker to true - if (game.persistent_events.includes(58)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state='add_influence' - valid_spaces_infl() - }, - card_tst(card) { - push_undo() - select_card(card) - log_gap(`Played C${cards[game.played_card].number} to the Tiananmen Square Track`) - game.state='tiananmen_square_attempt' - }, - card_support_check(card) { - push_undo() - select_card(card) - log_gap(`Played C${cards[game.played_card].number} for support checks`) - - // Check if card is opponent card with event that needs to be resolved - /*if (game.phase === 0 && game.active === DEM && cards[game.played_card].side === "C" && game.playable_cards[game.played_card].playable === 1 || game.phase === 0 && game.active === COM && cards[game.played_card].side === "D" && game.playable_cards[game.played_card].playable === 1 ) { - game.vm_event_to_do = true - }*/ - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - game.vm_event_to_do = true - } - } - - game.available_ops = 2 - game.state='support_check_prep' - valid_spaces_sc() - }, - card_tst_7() { - select_card(card) - game.vm_infl_to_do = true - game.tst_7 = true - game.state = 'resolve_opponent_event' - }, - card_tst_8(card) { /*Play card for ops and event */ - select_card(card) - game.vm_event_to_do = true - game.vm_infl_to_do = true - game.tst_8 = true - game.state = 'vm_tst_8' - }, - - /*done () { - game.state = 'play_card' - } */ + } } states.confirm_card = { @@ -652,6 +482,10 @@ states.play_card ={ //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') } @@ -682,12 +516,7 @@ states.play_card ={ if (game.played_card !== 67 && game.playable_cards.includes(game.played_card)) { get_events(game.played_card) - } /* - if ((game.active === DEM && cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable === 1) || (game.active === COM && cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1) || (cards[game.played_card].side === 'N'&& game.playable_cards[game.played_card].playable ===1)) { - gen_action('event') - } else if ((game.active === DEM && (cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1)) || game.active === COM && (cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable ===1)) { - gen_action('opp_event') - } */ + } 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) { @@ -768,9 +597,6 @@ states.play_card ={ log_gap(`Played C${cards[game.played_card].number} for support checks`) // Check if card is opponent card with event that needs to be resolved - /*if (game.phase === 0 && game.active === DEM && cards[game.played_card].side === "C" && game.playable_cards[game.played_card].playable === 1 || game.phase === 0 && game.active === COM && cards[game.played_card].side === "D" && game.playable_cards[game.played_card].playable === 1 ) { - game.vm_event_to_do = true - }*/ if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { @@ -778,13 +604,19 @@ states.play_card ={ } } - - game.available_ops = 2 game.state='support_check_prep' valid_spaces_sc() }, + tst_7() { /*Cancel opponent event */ + push_undo() + log('Event cancelled using Tiananmen Square Track Award') + game.tst_7 = true + game.vm_infl_to_do = true + game.state = 'resolve_opponent_event' + }, tst_8() { /*Play card for ops and event */ + push_undo() game.vm_event_to_do = true game.vm_infl_to_do = true game.tst_8 = true @@ -2262,77 +2094,10 @@ states.stasi_play_card = { gen_action('pass') } else { view.prompt = `Stasi: you must play ${clean_name(cards[game.stasi_card].name)}.` - /*let available_cards = [game.stasi_card] - for (let card of available_cards) { - gen_action_card(card) - }*/ let available_cards = [game.stasi_card] - for (let card of available_cards) { - - if (scoring_cards.includes(card)) { - /*view.prompt = 'Play for:'*/ - gen_action('card_event', card) - return - } - - //Check if Player has Common European Home in hand - if (game.active === DEM) { - if (game.democrat_hand.includes(21) && cards[card].side === "C" && card !== 21) { - gen_action('card_ceh', card) - } - } else { - if (game.communist_hand.includes(21) && cards[card].side === "D" && card !== 21) { - gen_action('card_ceh', card) - } - } - - //Check for Tiananmen Square Track awards special abilities - if ((game.active === DEM && cards[card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){ - gen_action('card_tst_8', card) - } - - // Check for Reformer Rehabilitated - - //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) - - - if (card === 67 && game.playable_cards.includes(67)){ - if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { - gen_action('card_event', card) - } - if (game.active === COM && (game.dem_tst_position < game.com_tst_position)) { - gen_action('card_event', card) - } - } - - //Continue with normal logic - - //Check if it is a card with an event which is always playable. May not play Common European Home for event in Stasi - - if (cards[card].playable && card !== 21) { - console.log('get events called normally for card', card) - get_events(card) + gen_action_card(card) } - - // Resolve cards with variable events (not Reformer, not Common European Home in Stasi) - - if (card !== 67 && card !== 21 && game.playable_cards.includes(card)) { - console.log('get events called variable for card', card) - get_events(card) - } /* - if ((game.active === DEM && cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable === 1) || (game.active === COM && cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1) || (cards[game.played_card].side === 'N'&& game.playable_cards[game.played_card].playable ===1)) { - gen_action('event') - } else if ((game.active === DEM && (cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1)) || game.active === COM && (cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable ===1)) { - gen_action('opp_event') - } */ - - gen_action('card_influence', card) - 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('card_tst', card) - } - gen_action('card_support_check', card) - } } }, card(card) { @@ -2356,120 +2121,6 @@ states.stasi_play_card = { log('No cards remaining. Passed') end_round() }, - card_ceh(card) { - push_undo() - select_card(card) - game.stasi_card = 0 - log(`${clean_name(cards[game.played_card].name)} played with Common European Home`) - //silent_discard(21) - game.vm_infl_to_do = true - game.vm_event_to_do = false - game.state = 'resolve_opponent_event' - }, - - card_event(card) { - push_undo() - select_card(card) - game.stasi_card = 0 - console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - log_gap(`Played C${cards[game.played_card].number} for the event`) - if (scoring_cards.includes(game.played_card)) {game.phase = 0} - else {game.phase = 1} - game.return = game.active - if (switch_events.includes(game.played_card)) {next_player()} - game.vm_event = game.played_card - goto_vm(game.vm_event) - }, - card_opp_event(card) { - push_undo() - select_card(card) - game.stasi_card = 0 - log_gap(`Played C${cards[game.played_card].number} for the event`) - game.phase = 1 /*Do I still need this?*/ - game.vm_infl_to_do = true - game.return = game.active - game.vm_event = game.played_card - if (auto_resolve_events.includes(game.played_card) || switch_events.includes(game.played_card)) { - goto_vm(game.vm_event)} - else { - next_player() - log(`C${game.vm_event}`) - goto_vm(game.vm_event) - } - }, - card_influence(card) { - push_undo() - select_card(card) - game.stasi_card = 0 - log_gap(`Played C${cards[game.played_card].number} to place SPs`) - - - // Check if Common European Home played for influence - if (game.played_card === 21) { - if (game.active === DEM) { - game.vp -- - log('-1 VP') - if (check_vp()) { - return - } - } else { - game.vp ++ - log('+1 VP') - if (check_vp()) { - return - } - } - } - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - //game.phase = 1 /*Do I need this? */ - game.vm_event_to_do = true - } - } - - // If ABHR - Set AHBR tracker to true - if (game.persistent_events.includes(58)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state='add_influence' - valid_spaces_infl() - }, - card_tst(card) { - push_undo() - select_card(card) - game.stasi_card = 0 - log_gap(`Played C${cards[game.played_card].number} to the Tiananmen Square Track`) - game.state='tiananmen_square_attempt' - }, - card_support_check(card) { - push_undo() - select_card(card) - log_gap(`Played C${cards[game.played_card].number} for support checks`) - - // Check if card is opponent card with event that needs to be resolved - /*if (game.phase === 0 && game.active === DEM && cards[game.played_card].side === "C" && game.playable_cards[game.played_card].playable === 1 || game.phase === 0 && game.active === COM && cards[game.played_card].side === "D" && game.playable_cards[game.played_card].playable === 1 ) { - game.vm_event_to_do = true - }*/ - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - game.vm_event_to_do = true - } - } - - game.available_ops = 2 - game.state='support_check_prep' - valid_spaces_sc() - }, - card_tst_8(card) { /*Play card for ops and event */ - select_card(card) - game.vm_event_to_do = true - game.vm_infl_to_do = true - game.tst_8 = true - game.state = 'vm_tst_8' - }, done () { game.stasi_card = 0 if (game.democrat_hand.includes(21)) { @@ -3445,11 +3096,6 @@ function permanently_remove(card) { log_msg_gap(`C${cards[card].number} permanently removed`) remove_from_discard(card) - /*let card_index = game.strategy_discard.indexOf(card) - if (card_index !== -1) { - console.log('sub 1 called') - game.strategy_discard.splice(card_index, 1) - }*/ card_index = game.table_cards.indexOf(card) if (card_index !== -1) { console.log('sub 2 called') @@ -3561,14 +3207,14 @@ function find_event(card) { function get_events(card){ if (cards[card].side === 'D') { - if (game.active === DEM) {gen_action('card_event', card)} - if (game.active === COM) {gen_action('card_opp_event', card)} + 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('card_event', card)} - if (game.active === DEM) {gen_action('card_opp_event', card)} + if (game.active === COM) {gen_action('event')} + if (game.active === DEM) {gen_action('opp_event')} } else { - gen_action('card_event', card) + gen_action('event') } } -- cgit v1.2.3 From d53aa3d5af6950d0ac4bfbcb5ab214a083c28e3a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 11 Oct 2024 08:32:59 +0100 Subject: Added die images --- images/die_black_pips.svg | 37 +++++++++++++++++++++++++++++++++++++ play.css | 24 +++++++++++++++++++----- play.js | 28 ++++++++++------------------ rules.js | 34 +++++++++++++++++----------------- 4 files changed, 83 insertions(+), 40 deletions(-) create mode 100644 images/die_black_pips.svg diff --git a/images/die_black_pips.svg b/images/die_black_pips.svg new file mode 100644 index 0000000..d641f28 --- /dev/null +++ b/images/die_black_pips.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play.css b/play.css index 9171d3d..8b3f266 100644 --- a/play.css +++ b/play.css @@ -18,7 +18,6 @@ header.your_turn { background-color: orange; } } #deck_stat {padding-left: 5px; padding-bottom: 5px;} -#tank {margin-right: 0;} #log { background-color: whitesmoke; } #log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } @@ -43,10 +42,25 @@ header.your_turn { background-color: orange; } #log .card_name:hover { text-decoration: underline; } #log .space_tip:hover { cursor: pointer; text-decoration: underline; } -/* Below currently not used -#log .lord_tip:hover { cursor: pointer; text-decoration: underline; } - -#log .way_tip:hover { cursor: pointer; text-decoration: underline; } */ +#log .die { + display: inline-block; + vertical-align: -3px; + width: 12px; + height: 12px; + background-size: 600% 100%; + background-repeat: no-repeat; + background-image: url(images/die_black_pips.svg); + background-color: #fff; + border: 1px solid #444; +} + +#log .d0 { background-position: -100% 0 } +#log .d1 { background-position: 0% 0; } +#log .d2 { background-position: 20% 0; } +#log .d3 { background-position: 40% 0; } +#log .d4 { background-position: 60% 0; } +#log .d5 { background-position: 80% 0; } +#log .d6 { background-position: 100% 0; } .selected { cursor: pointer; diff --git a/play.js b/play.js index 99dd5f6..9f4c107 100644 --- a/play.js +++ b/play.js @@ -228,17 +228,6 @@ function on_log(text) { // eslint-disable-line no-unused-vars let p = document.createElement("div") - -/* - let last_text = last_log_entry ? last_log_entry.split(' ') : [] - console.log('last text', last_text, 'text', text.split(' ')[3]) - if (last_text[0] === 'Added' && last_text[4] === text.split(' ')[4]) { - let new_influence = parseInt(last_text[1]) + 1 - new_text = `Added ${new_influence} influence in ${last_text[4]}` - console.log('new_influence', new_influence, 'new_text', new_text) - } */ - - if (text.match(/^>/)) { text = text.substring(1) p.className = 'i' @@ -249,6 +238,7 @@ function on_log(text) { // eslint-disable-line no-unused-vars text = text.replace(/P(\d+)/g, sub_power_card_name) text = text.replace(/V(\d+)/g, sub_power_card_value) text = text.replace(/%(\d+)/g, sub_space_name) + text = text.replace(/\b[D][1-6]\b/g, sub_die) if (text.match(/^\.h1/)) { @@ -272,13 +262,6 @@ function on_log(text) { // eslint-disable-line no-unused-vars p.className = 'h3' } - //console.log('view.log', view.log) - /*console.log('new text', text) - if (last_log_entry_text) { - console.log('log = text', last_log_entry_text === text) - } - -*/ p.innerHTML = text return p } @@ -741,6 +724,15 @@ function sub_die(match) { return die[match] || match } +const die = { + D1: '', + D2: '', + D3: '', + D4: '', + D5: '', + D6: '' +} + // =========================== VISUAL FUNCTIONS ==========================================# function on_focus_card_tip(card_number) { diff --git a/rules.js b/rules.js index ac5f93f..a00f77f 100644 --- a/rules.js +++ b/rules.js @@ -1406,7 +1406,7 @@ states.power_struggle = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { log('Initiative roll successful') game.phase = 0 @@ -1516,7 +1516,7 @@ states.support_loss ={ let roll = Math.floor(Math.random() * 6) + 1 let rally_win = 0 let petition_win = 0 - log(`Rolled a ${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 +1585,7 @@ states.vp_roll = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${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} @@ -1906,7 +1906,7 @@ states.general_strike = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) log(`+${game.available_ops} from card ops`) @@ -2285,7 +2285,7 @@ function do_sc(space) { // Continue with Support Check Logic let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) console.log('game.vm_event', game.vm_event) console.log('game.is_pwr_struggle', game.is_pwr_struggle) /* @@ -2761,7 +2761,7 @@ function check_com_control(space_id) { function do_tst_attempt() { let roll = Math.floor(Math.random() * 6) + 1; - log(`Rolled a ${roll}`); + log(`Roll: D${roll}`); roll += game.available_ops log(`+${game.available_ops} from card ops`) @@ -6414,7 +6414,7 @@ states.vm_adamec = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${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`) @@ -6601,7 +6601,7 @@ states.vm_dash_for_the_west = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) let com_control = check_presence('East_Germany').com_spaces if (roll > com_control) { @@ -7366,7 +7366,7 @@ states.vm_malta_summit = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) if (game.stability > 0) { log(`+${game.stability} from USSR Stability Track`) log(`Modified roll: ${roll + game.stability}`) @@ -7412,11 +7412,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(`Rolled a ${roll}`) + log(`Roll: D${roll}`) log(`Success. More than the ${dem_spaces} Democratically controlled spaces`) vm_next() } else { - log(`Rolled a ${roll}`) + log(`Roll: D${roll}`) log(`Fail. More than ${dem_spaces} required`) permanently_remove(83) vm_return() @@ -7441,13 +7441,13 @@ states.vm_nepotism = { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 if (roll < 3) { - log(`Rolled a ${roll}: adds 4 SPs`) + log(`Roll: D${roll} adds 4 SPs`) game.vm_available_ops = 4} else if (roll < 5 ) { - log(`Rolled a ${roll}: adds 3 SPs`) + log(`Roll: D${roll} adds 3 SPs`) game.vm_available_ops = 3} else { - log(`Rolled a ${roll}: adds 1 SP`) + log(`Roll: D${roll} adds 1 SP`) game.vm_available_ops = 1} //game.phase = 2 vm_next() @@ -7697,7 +7697,7 @@ states.vm_shock_therapy = { worker_farmer++ } } - log(`Rolled a ${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) { @@ -7924,7 +7924,7 @@ states.vm_the_wall_must_go = { } let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${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) { @@ -8142,7 +8142,7 @@ states.vm_workers_revolt_finish = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Rolled a ${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`) -- cgit v1.2.3 From db5c4c7f8e937b6527a04b097f1c4c61f94ae9c5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 11 Oct 2024 09:05:28 +0100 Subject: Updates to SC log --- events.txt | 2 +- play.js | 2 +- rules.js | 106 +++++++++++++++++++++++++++++++++++++------------------------ 3 files changed, 66 insertions(+), 44 deletions(-) diff --git a/events.txt b/events.txt index 5855621..7f83643 100644 --- a/events.txt +++ b/events.txt @@ -25,7 +25,7 @@ valid_spaces_country 'Poland' prompt 'any space(s) in Poland' add_infl_free 4 valid_spaces_country_sc 'Poland' -prompt 'Make Support Checks in Poland' +prompt 'make Support Checks in Poland' support_check 2 permanently_remove diff --git a/play.js b/play.js index 9f4c107..be10507 100644 --- a/play.js +++ b/play.js @@ -238,7 +238,7 @@ function on_log(text) { // eslint-disable-line no-unused-vars text = text.replace(/P(\d+)/g, sub_power_card_name) text = text.replace(/V(\d+)/g, sub_power_card_value) text = text.replace(/%(\d+)/g, sub_space_name) - text = text.replace(/\b[D][1-6]\b/g, sub_die) + text = text.replace(/D[1-6]/g, sub_die) if (text.match(/^\.h1/)) { diff --git a/rules.js b/rules.js index a00f77f..8250dfc 100644 --- a/rules.js +++ b/rules.js @@ -1406,7 +1406,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 +1516,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 +1585,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} @@ -1906,12 +1906,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} from card ops`) + log(`+${game.available_ops} ops`) let total = roll + game.available_ops - log(`Modified total: ${total}`) + log(`TOTAL: ${total}`) if (total > 5) { log('The strike is over.') @@ -2285,7 +2285,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) /* @@ -2300,7 +2300,7 @@ function do_sc(space) { //else if (game.is_pwr_struggle) { roll += game.vm_available_ops - log(`+${game.vm_available_ops} from Ceausescu`) + logi(`+${game.vm_available_ops} from Ceausescu`) } // Check if in Tiananmen Square Track Award @@ -2308,53 +2308,53 @@ function do_sc(space) { else if (game.state === 'vm_tst_6_sc') { roll += get_tst_6_ops() roll += 2 - log('+2 from Tiananmen Square Track award') + logi('+2 TST award') } else { //let modifier = 0 let card_ops = get_card_ops(this_card()) roll += card_ops - log(`+${card_ops} from card ops`) + logi(`+${card_ops} ops`) } if (game.support_check_modifier > 0) { roll += game.support_check_modifier - log(`+${game.support_check_modifier} from event`) + logi(`+${game.support_check_modifier} event`) } // Events which modify SC rolls //Tear Gas if (game.active === COM && game.persistent_events.includes(30) && spaces[clicked_space].socio === 6) { roll ++ - log('+1 from C30') + logi('+1 C30') permanently_remove(30) game.persistent_events = game.persistent_events.filter(n => n !== 30) } //FRG Embassies if (game.active === DEM && spaces[clicked_space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { roll++ - log('+1 from C74') + logi('+1 C74') } //GrenzTruppen if (game.active === DEM && spaces[clicked_space].country === 'East_Germany' && game.persistent_events.includes(59)) { roll-- - log('-1 from C59') + logi('-1 C59') } //Stand Fast if ((game.active === COM && game.stand_fast === DEM && check_dem_control(clicked_space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(clicked_space))){ roll-- - log('-1 from C100') + logi('-1 C100') } //Elena if (game.active === DEM && game.persistent_events.includes(101) && spaces[clicked_space].country === 'Romania') { roll-- - log('-1 from C101') + logi('-1 C101') } //Austria Hungary Border Reopened if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { roll++ - log(`+1 from C58`) + logi(`+1 C58`) } // Continue with logic - check for adjacency @@ -2364,11 +2364,11 @@ function do_sc(space) { const adj = count_adj(space) console.log('adj', adj) if (game.active === COM && game.persistent_events.includes(9) && spaces[clicked_space].country === 'East_Germany') { - log('No adjacency for Democrats due to C9') - log('C9 no longer in effect') + logi('No adjacency for Democrats due to C9') + logi('C9 no longer in effect') roll += adj.com_adj if (adj.com_adj > 0) { - log(`+${adj.com_adj} from adjacent control`) + logi(`+${adj.com_adj} adjacency`) } game.persistent_events = game.persistent_events.filter(n => n !== 9) @@ -2379,19 +2379,19 @@ function do_sc(space) { roll += adj.dem_adj roll -= adj.com_adj if (adj.dem_adj > 0) { - log(`+${adj.dem_adj} from adjacent control`) + logi(`+${adj.dem_adj} adjacency`) } if (adj.com_adj > 0) { - log(`-${adj.com_adj} from adjacent opponent control`) + logi(`-${adj.com_adj} opponenet adjacency`) } } else { roll += adj.com_adj roll -= adj.dem_adj if (adj.com_adj > 0) { - log(`+${adj.com_adj} from adjacent control`) + logi(`+${adj.com_adj} adjacency`) } if (adj.dem_adj > 0) { - log(`-${adj.dem_adj} from adjacent opponent control`) + logi(`-${adj.dem_adj} opponenet adjacency`) } } } @@ -2399,12 +2399,12 @@ function do_sc(space) { } // Support check calcs - log(`Total support check strength: ${roll}`) + log(`TOTAL: ${roll}`) const stability = spaces[find_space_index(space)].stability - log(`Stability is ${stability}. Defence is ${stability*2}`) + logi(`-${stability*2} (stability * 2)`) const change_infl = Math.max(0, roll - stability*2) if (change_infl > 0) { - log_msg_gap(`${change_infl} point swing`) + 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 +2432,7 @@ function do_sc(space) { check_control_change(clicked_space) } else { - log_msg_gap('No change in influence') + 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') @@ -2761,7 +2761,7 @@ 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`) @@ -2788,7 +2788,7 @@ function do_tst_attempt() { roll ++ log('+1 from C53') } - log(`Modified die roll: ${roll}`) + log(`TOTAL: ${roll}`) // TIANANMEN SQUARE ATTEMPT game.return = game.active @@ -4298,6 +4298,15 @@ function vm_return() { reset_austria_hungary_border_reopened() } + //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 { + vm_end_event() + } +} + +function vm_end_event() { //game.view_opp_hand = false console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { @@ -5895,6 +5904,19 @@ function vm_kremlin_coup_elite() { /* ================== VM STATES ============================== */ +states.vm_end_event = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt () { + view.prompt = `${clean_name(cards[this_card()].name)}: done.` + gen_action('done') + }, + done(){ + vm_end_event() + } +} + states.vm_take_control = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -6414,7 +6436,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`) @@ -6601,7 +6623,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) { @@ -7366,7 +7388,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}`) @@ -7412,11 +7434,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() @@ -7441,13 +7463,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() @@ -7697,7 +7719,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) { @@ -7924,7 +7946,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) { @@ -8142,7 +8164,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`) @@ -8439,7 +8461,7 @@ CODE[3] = [ // Walesa [ 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_prompt, 'make Support Checks in Poland' ], [ vm_support_check, 2 ], [ vm_permanently_remove ], [ vm_return ], -- cgit v1.2.3 From 6e7a3c69a79ecca8e45df60b59a22de504e1a2f5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 12 Oct 2024 14:21:30 +0100 Subject: Updates to events handling --- events.txt | 175 +++++++++--------- play.css | 2 +- play.js | 10 +- rules.js | 591 ++++++++++++++++++++++++++++++++++++------------------------- 4 files changed, 453 insertions(+), 325 deletions(-) diff --git a/events.txt b/events.txt index 7f83643..85b50bf 100644 --- a/events.txt +++ b/events.txt @@ -1,41 +1,41 @@ CARD 1 - Legacy of Martial Law* # Replace 1 Democratic SP with a Communist SP in Poland and make a Support Check using the Ops value of this card in Poland. +permanently_remove valid_spaces_country_opp 'Poland' prompt 'replace 1 Democratic SP in Poland with a Communist SP' legacy_of_martial_law valid_spaces_country_sc 'Poland' prompt 'make a Support Check in Poland' 1_support_check -permanently_remove CARD 2 - Solidarity Legalised* # Place a Democratic SP in every uncontrolled Worker and Farmer space in Poland. Allows play of Walesa. +permanently_remove solidarity_legalised valid_spaces_solidarity_legalised prompt 'to every uncontrolled Worker and Farmer space in Poland' add_limited_infl 9 1 -permanently_remove CARD 3 - Walesa # Place a total of 4 SPs in any spaces(s) in Poland. The Democratic Player may then may Support Checks in Poland using the Ops value of this card. Requires Solidarity Legalized* to be played as event. +permanently_remove valid_spaces_country 'Poland' prompt 'any space(s) in Poland' add_infl_free 4 valid_spaces_country_sc 'Poland' prompt 'make Support Checks in Poland' support_check 2 -permanently_remove CARD 4 - Michnik # Place 3 Democratic SPs in the Polish Intellectuals space. +permanently_remove valid_spaces 26 prompt 'the Polish Intellectuals space' add_x_infl 3 -permanently_remove CARD 5 - General strike @@ -50,9 +50,9 @@ brought_in_for_questioning CARD 7 - State Run Media* # Remove four Democratic SPs, no more than 2 per space. +permanently_remove valid_spaces_opponent remove_limited_opp_infl 4 2 -permanently_remove CARD 8 - Prudence @@ -62,18 +62,20 @@ prudence CARD 9 - The Wall* # Place in front of the Communist Player. In his next Support Check in Germany cancel drm for any adjacent spaces controlled by the Democratic Player. -the_wall permanently_remove +the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. +permanently_remove if !game.the_tyrant_is_gone valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 +else +tyrant_block endif -permanently_remove CARD 11 - Dissident arrested @@ -85,16 +87,16 @@ remove_x_opp_infl 2 CARD 12 - Apparatchicks # Place 3 Communist SPs in any Bureaucratic space(s). +permanently_remove valid_spaces_socio 2 prompt ' to any Bureaucratic space(s)' add_infl_free 3 -permanently_remove CARD 13 - Stasi # For the rest this turn the Democratic Player must reveal the card he will play this action round before the Communist plays his card. -stasi permanently_remove +stasi CARD 14 - Gorbachev Charms the West @@ -114,8 +116,8 @@ honecker CARD 16 - Nomenklatura* # Place 3 SPs in any Elite space(s), or remove all Democratic SPs from Elite spaces. -nomenklatura permanently_remove +nomenklatura CARD 17 - Roundtable talks @@ -125,18 +127,18 @@ roundtable_talks CARD 18 - Poszgay Defends the Revolution # Place Communist SPs in 4 spaces in Hungary not under Democratic control. +permanently_remove poszgay prompt 'to 4 spaces in Hungary not under Democratic control' add_limited_infl 4 1 -permanently_remove CARD 19 - Papal vist # Place 3 SPs in any Catholic Church space. +permanently_remove valid_spaces 20 35 38 prompt 'any Catholic Church space' add_x_infl 3 -permanently_remove CARD 20 - Deutsche Marks* @@ -162,6 +164,7 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. +permanently_remove valid_spaces 6 prompt 'the Lutheran Church' take_control_prep 1 @@ -170,13 +173,14 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. +permanently_remove perestroika CARD 26 - Helsinki Final Act* # +1 VP for every Support Check die roll by the Communist Player in Student or Intellectual spaces the rest of the game. -helsinki_final_act permanently_remove +helsinki_final_act CARD 27 - Consumerism @@ -199,10 +203,10 @@ remove_limited_opp_infl 3 2 CARD 29 - Jan Palach Week* # Place 6 Democratic SPs in the Charles University space. +permanently_remove valid_spaces 30 prompt 'the Charles University space' add_x_infl 6 -permanently_remove CARD 30 - Tear Gas @@ -219,33 +223,33 @@ add_limited_infl 4 2 CARD 32 - Peasant Parties* # Place 4 Communist SPs in Farmer spaces, no more than 2 per space. +permanently_remove valid_spaces_socio 3 prompt 'Farmer spaces, no more than 2 per space' add_limited_infl 4 2 -permanently_remove CARD 33 - Sajudis* # +1 VP. Reduce USSR stability by 1. Place sufficient Democratic support in any Minorities space for control. Allows play of The Baltic Way. +permanently_remove sajudis_check prompt 'any Minorities space' take_control_prep 1 sajudis -permanently_remove CARD 34 - Fidesz* # Place 5 Democratic SPs in Hungary Student space. +permanently_remove valid_spaces 47 prompt 'the Hungary students space' add_x_infl 5 -permanently_remove CARD 35 - Heal our Bleeding Wounds* # If played in Early Year, -3 VPs. If played in Mid Year, -1 VP. If played in Late Year, +3 VPs. -heal_our_bleeding_wounds permanently_remove +heal_our_bleeding_wounds CARD 36 - Dash for the West* @@ -255,28 +259,28 @@ prompt 'Dash for the West: select any Democratic event with an asterix(*) from t dash_for_the_west - CARD 37 - Nagy Reburied* # Remove all Communist SPs from the Hungary Elite space. Then place 4 Communist SPs in Hungary, no more than 2 per space. +permanently_remove nagy_reburied prompt 'the Hungary Elite space' remove_all_infl 1 valid_spaces_country 'Hungary' prompt 'Hungary, no more than 2 per space' add_limited_infl 4 2 -permanently_remove CARD 38 - July Concept # Place 3 Communist SPs in Bulgaria +permanently_remove valid_spaces_country 'Bulgaria' prompt 'Bulgaria' add_infl_free 3 -permanently_remove CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. +permanently_remove valid_spaces 66 prompt 'Ruse' add_x_infl 4 @@ -285,17 +289,18 @@ eco_glasnost CARD 40 - Hungarian Democratic Forum # Place 3 Democratic SPs in Hungary and make one Support Check in Hungary. +permanently_remove valid_spaces_country 'Hungary' prompt 'Hungary' add_infl_free 3 valid_spaces_country_sc 'Hungary' prompt 'make a Support Check in Hungary' 1_support_check -permanently_remove CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. +permanently_remove if !game.the_tyrant_is_gone valid_spaces_country_opp 'Romania' prompt ' from Romania' @@ -305,8 +310,9 @@ prompt 'make a support check in Romania' 1_support_check prompt ' from Bucharesti' ceausescu +else +tyrant_block endif -permanently_remove CARD 42 - Power Struggle - East Germany @@ -321,6 +327,7 @@ power_struggle CARD 44 - Inflationary Currency # Target any Country where your opponent has Power. Place 2 SPs and make 1 Support Check in the Country using the Ops value of this card. Your opponent may cancel the Support Check by discarding a 3 Ops value card. +permanently_remove inflationary_currency valid_spaces_country_opp prompt ()=>` from ${country_name(game.vm_active_country)}` @@ -331,71 +338,70 @@ valid_spaces_country_sc prompt `make a Support Check in ${country_name(game.vm_active_country)}` 1_support_check endif -permanently_remove CARD 45 - Soviet Troop Withdrawals* # The Democratic Player may remove 5 Communist SPs from Eastern Europe, no more than 2 per space. +permanently_remove valid_spaces_region_opp 'Eastern Europe' prompt ' from Eastern Europe' remove_limited_opp_infl 5 2 -permanently_remove CARD 46 - Goodbye Lenin!* # The Communist Player must reveal all his events with title written in red. The Democrat may exchange this card for any of them with the event occurring immediately, or he may play this card for Operations. -goodbye_lenin permanently_remove +goodbye_lenin CARD 47 - Bulgarian Turks Expelled* # -2 VP. Remove any Democratic SPs in Razgrad. +permanently_remove bulgarian_turks_expelled prompt 'Razgrad' remove_all_infl 1 -permanently_remove CARD 48 - We are the People!* # The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig. -we_are_the_people permanently_remove +we_are_the_people CARD 49 - Foreign Currency Debt Burden* # The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country. -foreign_currency_debt_burden permanently_remove +foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -the_sinatra_doctrine permanently_remove +the_sinatra_doctrine CARD 51 - 40th Anniversary Celebration* # Place 2 Communist SPs in Germany. If Communist is ahead add 4 SPs. Then subtract 1 VP. +permanently_remove 40th_anniversary_celebration valid_spaces_country 'East_Germany' prompt 'East Germany' add_infl_free 40th_anniversary_celebration_vp -permanently_remove CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. +permanently_remove normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 -permanently_remove CARD 53 - Li Peng* # +1 modifier to all Communist Tiananmen Square track attempts for the rest of the game -li_peng permanently_remove +li_peng CARD 54 - The Crowd Turns Against Ceausescu* @@ -410,17 +416,17 @@ power_struggle CARD 56 - Foreign Television # Remove 4 Communist SPs no more than 2 per space. +permanently_remove foreign_television remove_limited_opp_infl 4 2 -permanently_remove CARD 57 - Central Committee Reshuffle* # Place 3 Communist SPs in any Country where the Communist holds Power. +permanently_remove central_committee_reshuffle prompt `${country_name(game.vm_active_country)}` add_infl_free 3 -permanently_remove CARD 58 - Austria-Hungary Border Reopened* @@ -435,21 +441,21 @@ grenztruppen CARD 60 - Toxic Waste* # Add 3 Democratic SPs in any Worker space(s). +permanently_remove valid_spaces_socio 4 prompt 'any Worker space(s)' add_infl_free 3 -permanently_remove CARD 61 - The Monday Demonstrations* # Place sufficient SPs in the Lutheran Church Space and Leipzig for Democratic control. Then the Democratic Player may make FIVE support checks in Germany using the Ops value of this card. Requires play of St. Nicholas Church as an event. +permanently_remove the_monday_demonstrations prompt 'the Lutheran Church Space and Leipzig' take_control_prep 2 valid_spaces_country_sc 'East_Germany' prompt 'make 5 Support Checks in East Germany' support_check 5 -permanently_remove CARD 62 - Yakovlev Counsels Gorbachev* @@ -464,24 +470,24 @@ genscher CARD 64 - Legacy of 1968* # The Democratic Player may place 1 SP in all spaces in Czechoslovakia not controlled by the Communist Player +permanently_remove legacy_of_1968 prompt 'all spaces in Czechoslovakia not controlled by the Communist Player' add_limited_infl 11 1 -permanently_remove CARD 65 - Presidential Visit* # The Communist's hand size is reduced to 7 next turn. -presidential_visit permanently_remove +presidential_visit CARD 66 - New Forum # Place a Democratic SP in 3 spaces in Germany +permanently_remove valid_spaces_country 'East_Germany' prompt '3 spaces in East Germany' add_limited_infl 3 1 -permanently_remove CARD 67 - Reformer Rehabilitated* @@ -492,19 +498,19 @@ reformer_rehabilitated CARD 68 - Klaus and Komarek* # Remove 2 Communist SPs and add 2 Democratic SPs in Prague. +permanently_remove klaus_and_komarek prompt 'Prague' remove_x_opp_infl 2 valid_spaces 29 add_x_infl 2 -permanently_remove CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. +permanently_remove valid_spaces_country 'Romania' systematization -permanently_remove CARD 70 - Securitate* @@ -525,6 +531,7 @@ peasant_parties_revolt CARD 73 - Laszlo Tokes* # Place 1 Democratic SP in Timisoara and Harghita/Covasna. The Democratic may then place SPs or make Support Check rolls in Romania using the Ops value of this card. Allows play of Massacre in Timisoara. +permanently_remove valid_spaces 50 56 prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 @@ -536,8 +543,6 @@ else prompt 'make 2 Support Checks in Romania' support_check 2 endif -permanently_remove - CARD 74 - FRG Embassies @@ -547,12 +552,13 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. -exit_visas permanently_remove +exit_visas CARD 76 - Warsaw Pact Summit # The Warsaw Pact holds a summit in Bucharest. The Communist player chooses who dominates the summit, the hardliners or the reformers. The Communist may either make 2 Support Checks with a +2 drm against Student and intellectual spaces, or place 4 SPs in spaces with no influence that are not controlled by the Democratic player. +permanently_remove warsaw_pact_summit if game.phase === 3 prompt ' spaces with no Democratic SPs' @@ -562,13 +568,12 @@ prompt 'Select a Student or Intellectual space' valid_spaces_country_socio_2 3, 4 support_check_modified 2 2 endif -permanently_remove CARD 77 - Samizdat # The Democratic Player can put a card in his hand aside for next turn and draw a replacement card from the deck. -samizdat permanently_remove +samizdat CARD 78 - Workers Revolt @@ -578,95 +583,99 @@ workers_revolt CARD 79 - The Third Way* # -2 VP. Place 3 Communist SPs in the German writers space. +permanently_remove the_third_way valid_spaces 4 prompt 'the East German Writers space' add_x_infl 3 -permanently_remove CARD 80 - Nepotism* # Roll a die. 1-2: Place 4 Communist SPs in Worker spaces in the Balkans. 3-4: add 3 SPs in Worker spaces in the Balkans. 5-6: add 1 SP to a Worker space in the Balkans. +permanently_remove nepotism valid_spaces_region_socio 'Balkans', 4 prompt 'Worker spaces in the Balkans' add_infl_free -permanently_remove CARD 81 - The Baltic Way* # +2 VP. Reduce USSR stability by 1. Place sufficient Democratic SPs in any Minorities space for control. .Requires play of Sajudis. Allows play of Breakaway Baltic Republics. +permanently_remove the_baltic_way prompt 'any Minorities space' take_control_prep 1 -permanently_remove CARD 82 - Spitzel* # Remove 2 Democratic SPs in Germany. +permanently_remove valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 -permanently_remove CARD 83 - Modrow* # Roll a die. If the die roll exceeds the number of Democratically controlled spaces in Germany, then place 4 Communist SPs in Germany, no more than 2 per space. +permanently_remove modrow valid_spaces_country 'East_Germany' prompt 'East Germany' add_limited_infl 4 2 -permanently_remove CARD 84 - Breakaway Baltic Republics* # +3 VPs. Reduce USSR stability by 2. Place sufficient Democratic SPs in any Minorities space for control. Cancels the effect of Gorbachev Charms the West for the rest of the game. Make 1 Support Check using the Ops value of this card. Requires play of The Baltic Way as an event. +permanently_remove breakaway_baltic_republics prompt 'any Minorities space' take_control_prep 1 valid_spaces_sc prompt 'select a space for the support check' 1_support_check -permanently_remove CARD 85 - Tank Column/Tank Man* # Advance 1 space on the Tiananmen Square track. -tank_column permanently_remove +tank_column CARD 86 - The Wall Must Go!* # Reduce USSR stability by 1. The Democratic Player attempts to tear down the Berlin Wall. Each player rolls a die and adds the number of spaces in Germany they control. Higher total wins. This is best 2 out of 3. If successful +3 VPs and the Communist must remove 3 SPs from Germany. +permanently_remove the_wall_must_go remove_infl 3 -permanently_remove CARD 87 - Kohl Proposes Reunification* # +2 VP. The Democratic Player may place SPs or make Support Checks using the Ops value of this card if The Wall Must Go! has been played as an event successfully. -kohl_proposes_reunification permanently_remove +kohl_proposes_reunification + CARD 88 - Adamec* # Roll a die. On a 4-6 add 4 Communist SPs in Czechoslovakia, no more than 2 per space. -1 drm for every Worker or Farmer space in Czechoslovakia that is controlled by the Democratic Player. +permanently_remove adamec valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_limited_infl 4 2 -permanently_remove + CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. -prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile.' -domino_theory +prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' permanently_remove +domino_theory + CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. +permanently_remove valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 @@ -674,45 +683,44 @@ civic_forum valid_spaces_country_sc 'Czechoslovakia' prompt 'Select a space in Czechoslovakia' support_check 2 -permanently_remove CARD 91 - My First Banana* # Remove 2 Communist SPs and make two Support Checks in Germany using the Ops value of this card. +permanently_remove valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 valid_spaces_country_sc 'East_Germany' prompt 'select a space in East Germany' support_check 2 -permanently_remove CARD 92 - Betrayal # Choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs. +permanently_remove prompt 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' betrayal -permanently_remove CARD 93 - Shock Therapy* # Target country must be one where the Communist has been toppled from power. Successful 3-6. -1 for every Communist Worker or Farmer space. +2 VPs and place 3 SPs in the country +permanently_remove shock_therapy valid_spaces_country prompt ` ${country_name(game.vm_active_country)}` add_infl_free 3 -permanently_remove CARD 94 - Union of Democratic Forces* # Remove 4 Communist SPs from Bulgaria. Democratic Player may make Support Checks in Bulgaria using the Ops value of this card if the Bulgarian writers space is Democratically controlled. +permanently_remove valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_opp_infl 4 valid_spaces_country_sc 'Bulgaria' prompt 'Make 2 Support Checks in Bulgaria' support_check 2 -permanently_remove CARD 95 - Power Struggle - Romania @@ -722,16 +730,16 @@ power_struggle CARD 96 - The Chinese Solution* # Can only take place if the Communist has reached the Protesters Massacred space on the Tiananmen Square track. The Communist may choose 1 country where he retains Power and conduct 5 Support Checks with a +3 modifier, but suffers a penalty of +3 VPs. +permanently_remove the_chinese_solution valid_spaces_country_sc -prompt `Make 5 Support Checks in ${country_name(game.vm_active_country)}` +prompt `make 5 Support Checks in ${country_name(game.vm_active_country)}` support_check_modified 5 3 -permanently_remove CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu -if game.persistent_events['the_crowd_turns_against_ceausescu'] +if game.persistent_events.includes(54) valid_spaces 51 prompt 'the Romanian Elite Space' remove_x_opp_infl 4 @@ -744,35 +752,38 @@ endif CARD 98 - Politburo Intrigue* # Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card. +permanently_remove valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_limited_opp_infl 3 2 valid_spaces_country_sc 'Bulgaria' prompt 'make a support check in Bulgaria' 1_support_check -permanently_remove CARD 99 - Ligachev* # -3 VP if the Democrat does not play Gorbachev Charms the West for the event his next action round. -3 VPs take effect as soon as the Democrat plays his card but before the effect of the Democrat's card takes place. -ligachev permanently_remove +ligachev CARD 100 - Stand Fast* # -1 to opponent Support Checks in spaces you control for the rest of this turn. -stand_fast permanently_remove +stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone +permanently_remove if !game.the_tyrant_is_gone valid_spaces 51 prompt 'the Romania Elite Space' add_x_infl 2 -endif elena +else +tyrant_block +endif CARD 102 - National Salvation Front* @@ -795,19 +806,21 @@ new_years_eve_party CARD 105 - Public Against Violence* # Place 2 Democratic SPs each in Kosice and Presov. Make one Support Check in Bratislava using the Ops value of this card. -valid_spaces 36 37 -prompt 'Kosice and Presov' +permanently_remove +valid_spaces 36 +prompt 'Kosice' add_x_infl 2 -valid_spaces 36 37 +valid_spaces 37 +prompt 'Presov' add_x_infl 2 public_against_violence prompt 'Make a Support Check in Bratislava' support_check_modified 1 2 -permanently_remove CARD 106 - Social Democratic Platform Adopted* # Play as an event in a Country where the Democrat has Power. Add 2 SPs and make 1 Support Check in the Country using the Ops value of this card. +permanently_remove social_democratic_platform_adopted valid_spaces_country prompt `${country_name(game.vm_active_country)}` @@ -815,36 +828,38 @@ add_infl_free 2 valid_spaces_country_sc prompt `make a Support Check in ${country_name(game.vm_active_country)}` 1_support_check -permanently_remove CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. +permanently_remove if !game.the_tyrant_is_gone massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' support_check_modified 2 2 +else +tyrant_block endif -permanently_remove CARD 108 - Army Backs Revolution* # Place in front of the Democratic Player. Cancels effects of Securitate* event. -army_backs_revolution permanently_remove +army_backs_revolution CARD 109 - Kremlin Coup* # Can only take place if Breakaway Baltic Republics has been played as an event. -3 VPs. In all countries where the Communist retains Power, place sufficient SPs in Elite space for Communist control, then make a support check against the bureaucratic space with a +1 modifier, even if there are no Democratic SPs in the space. -kremlin_coup permanently_remove +kremlin_coup CARD 110 - Malta Summit* # Roll a die. The summit is successful 4-6. If successful, +3VPs and remove 5 Communist SPs from elite space(s). The Democrat receives a modifier based on the USSR Stability Track: +1 if Sajudis +2 if The Baltic Way +3 if Breakaway Baltic Republics Not playable for the event after Kremlin Coup. +permanently_remove malta_summit prompt ' from Elite spaces' remove_opp_infl 5 -permanently_remove + diff --git a/play.css b/play.css index 8b3f266..0e7ef68 100644 --- a/play.css +++ b/play.css @@ -143,7 +143,7 @@ header.your_turn { background-color: orange; } display: none; } -#events_panel, #played_card_panel, #table_panel { +#events_panel, #played_card_panel, #table_panel, #samizdat_panel { min-width: 200px; width: auto; /*display: inline-block;*/ diff --git a/play.js b/play.js index be10507..f8d5cf5 100644 --- a/play.js +++ b/play.js @@ -405,8 +405,8 @@ function on_update() { ui.dem_hand_count.innerText = `${view.democrat_power_hand} Power cards` ui.com_hand_count.innerText = `${view.communist_power_hand} Power cards` } else{ - ui.dem_hand_count.innerText = `${view.democrat_hand} cards in hand` - ui.com_hand_count.innerText = `${view.communist_hand} cards in hand` + ui.dem_hand_count.innerText = `${view.democrat_hand} cards` + ui.com_hand_count.innerText = `${view.communist_hand} cards` } ui.deck_length.innerText = `${view.strategy_deck} cards` @@ -516,7 +516,8 @@ if (!view.is_pwr_struggle) { document.getElementById("opp_hand_panel").classList.add("hide") } } else { - if (view.show_opp_hand && view.opp_hand.length >0) { + console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) + if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { document.getElementById("opp_hand_panel").classList.remove("hide") for (let c of view.opp_hand) { let card = ui.power_cards[c] @@ -537,6 +538,7 @@ if (!view.is_pwr_struggle) { for (let c of view.power_hand) { let power_card = ui.power_cards[c] document.getElementById("power_hand").appendChild(power_card); + power_card.classList.remove('discard_card') if (view.valid_cards.includes(c)) { power_card.classList.add('selected'); } @@ -682,7 +684,7 @@ if (view.persistent_events.includes(97)) { action_button("concede", "Concede") action_button("struggle", "Begin power struggle") action_button("raise", "Raise the stakes") - action_button("draw", "Draw cards") + action_button("draw", "Draw") action_button("scoring", "Scoring") action_button("event", "Event") action_button("opp_event", "Resolve opponent event") diff --git a/rules.js b/rules.js index 8250dfc..617dcb6 100644 --- a/rules.js +++ b/rules.js @@ -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], -- cgit v1.2.3 From 48c6287c7a4251b9043877265cca98970e8f88be Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 12 Oct 2024 16:51:29 +0100 Subject: Removed name unique from actions --- data.js | 2 +- play.css | 4 +- play.js | 17 +- rules.js | 558 +++++++++++++++++++++++++++++++-------------------------------- 4 files changed, 292 insertions(+), 289 deletions(-) diff --git a/data.js b/data.js index 897de39..a4a64a8 100644 --- a/data.js +++ b/data.js @@ -83,7 +83,7 @@ const cards = [ {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, playable: true, red: true}, {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, playable: false, red: false}, {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, playable: true, red: false}, - {number: 5, period: 1, side: 'D', name: 'General Strike', ops: 3, remove: 0, playable: true, red: false}, + {number: 5, period: 1, side: 'D', name: 'General Strike*', ops: 3, remove: 0, playable: true, red: false}, {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false}, {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false}, {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false}, diff --git a/play.css b/play.css index 0e7ef68..535ba84 100644 --- a/play.css +++ b/play.css @@ -143,7 +143,7 @@ header.your_turn { background-color: orange; } display: none; } -#events_panel, #played_card_panel, #table_panel, #samizdat_panel { +#hand_panel, #events_panel, #played_card_panel, #table_panel, #samizdat_panel, #opp_hand_panel, #power_panel, #ceausescu_panel { min-width: 200px; width: auto; /*display: inline-block;*/ @@ -571,7 +571,7 @@ left: 660px} .discard_card, .event_card { background-size: contain; height: 150px; - padding: 5px; + margin: 5px; border-radius: 5px; transition: transform .3s ease; } diff --git a/play.js b/play.js index f8d5cf5..f90e207 100644 --- a/play.js +++ b/play.js @@ -71,7 +71,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi spaceArea.style.width = width + 'px'; spaceArea.style.height = height + 'px'; spaceArea.style.zIndex = 2; - spaceArea.my_space = space.name_unique; + spaceArea.my_space = space.space_id; spaceArea.addEventListener('mousedown', on_click_space); //CREATE DEMOCRATIC INFLUENCE MARKERS FOR EACH SPACE @@ -80,7 +80,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi dem_img.style.display = 'none' dem_img.id=`${space.name_unique}_demInfl` dem_img.style.zIndex = 1 - dem_img.my_space = space.name_unique; + dem_img.my_space = space.space_id; dem_img.addEventListener('mousedown', on_click_space); spaceArea.appendChild(dem_img) @@ -91,7 +91,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi demInflValue.id=`${space.name_unique}_demInflValue` demInflValue.innerText=space.demInfl demInflValue.style.zIndex = 1 - demInflValue.my_space = space.name_unique; + demInflValue.my_space = space.space_id; demInflValue.addEventListener('mousedown', on_click_space); spaceArea.appendChild(demInflValue) @@ -101,7 +101,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi com_img.style.display='none' com_img.id=`${space.name_unique}_comInfl` com_img.style.zIndex = 1 - com_img.my_space = space.name_unique; + com_img.my_space = space.space_id; com_img.addEventListener('mousedown', on_click_space); spaceArea.appendChild(com_img) @@ -112,7 +112,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi comInflValue.id=`${space.name_unique}_comInflValue` comInflValue.innerText=space.comInfl comInflValue.style.zIndex = 1 - comInflValue.my_space = space.name_unique; + comInflValue.my_space = space.space_id; comInflValue.addEventListener('mousedown', on_click_space); spaceArea.appendChild(comInflValue) //} @@ -182,11 +182,12 @@ function is_card_enabled(card) { function on_click_space(evt) { if (evt.button === 0) { const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); + console.log('on_click_space_called with space:', space); if (send_action('infl', space)) { + console.log('send_action with infl:', space); evt.stopPropagation(); } else if (send_action('sc', space)) { - //console.log('send_action with sc:', space); + console.log('send_action with sc:', space); evt.stopPropagation(); } else { // console.log('send_action failed for space:', space); @@ -554,6 +555,8 @@ if (view.ceausescu_cards && view.ceausescu_cards.length > 0 && view.is_pwr_strug for (let c of view.ceausescu_cards) { let power_card = ui.power_cards[c] document.getElementById("ceausescu_hand").appendChild(power_card); + power_card.classList.remove('discard_card') + } } else { document.getElementById("ceausescu_panel").classList.add("hide") diff --git a/rules.js b/rules.js index 617dcb6..cf074d3 100644 --- a/rules.js +++ b/rules.js @@ -230,9 +230,9 @@ exports.view = function(state, player) { view.power_hand = game.com_pwr_hand.sort((a, b) => a - b) } - if (game.active === DEM) { + if (player === DEM) { view.samizdat = game.samizdat_card - } + } if (game.state === "game_over") { view.prompt = game.victory @@ -268,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 @@ -315,7 +315,7 @@ exports.action = function (state, player, action, arg) { // ============= GAME STATES ======================= states.com_init = { - inactive: 'place starting SPs', + inactive: 'place starting SPs.', prompt() { console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) if (game.available_ops == 0) { @@ -328,9 +328,7 @@ states.com_init = { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` } for (let space_id of game.valid_spaces) { - if (space_id) { - gen_action_infl(spaces[space_id].name_unique); - } + gen_action_infl(space_id); } }, infl(space) { @@ -375,7 +373,7 @@ states.dem_init = { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } }, infl(space) { @@ -714,7 +712,7 @@ states.finish_add_infl = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique) + gen_action_infl(space_id) } }, infl(space) { @@ -740,13 +738,13 @@ states.finish_support_check_prep = { } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(spaces[space_id].name_unique) + gen_action_sc(space_id) } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space // Check for Austria-Hungary Border Reopened - check on first support check only //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) if (game.persistent_events.includes(58)){ @@ -789,7 +787,7 @@ states.finish_do_support_check = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) game.available_ops-- if (game.available_ops === 0) { game.valid_spaces = [] @@ -812,7 +810,7 @@ states.add_influence = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } }, infl(space) { @@ -847,11 +845,19 @@ states.tiananmen_square_attempt = { states.tiananmen_square_attempt_success = { inactive: 'do Tiananmen Square Attempt.', prompt () { - view.prompt = 'Tiananmen Square Track attempt successful.' + if (game.vm_event > 200) { + view.prompt = 'Tiananmen Square Track attempt successful. Go to TST Award.' + } else { + view.prompt = 'Tiananmen Square Track attempt successful.' + } gen_action('done') }, done () { - end_round() + if (game.vm_event > 200) { + goto_vm(game.vm_event) + } else { + game.state = 'tiananmen_square_attempt_done' + } } } @@ -861,6 +867,17 @@ states.tiananmen_square_attempt_fail = { view.prompt = 'Tiananmen Square Track attempt failed.' gen_action('done') }, + done () { + game.state = 'tiananmen_square_attempt_done' + } +} + +states.tiananmen_square_attempt_done = { + inactive: 'do Tiananmen Square Attempt.', + prompt () { + view.prompt = 'Tiananmen Square Track attempt: done.' + gen_action('done') + }, done () { end_round() } @@ -964,13 +981,13 @@ states.support_check_prep = { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(spaces[space_id].name_unique) + gen_action_sc(space_id) } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space // Check for Austria-Hungary Border Reopened - check on first support check only //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) @@ -1014,7 +1031,7 @@ states.do_support_check = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) game.available_ops-- if (game.available_ops === 0) { game.valid_spaces = [] @@ -1182,7 +1199,7 @@ states.the_crowd_turns_against_ceausescu_infl = { view.prompt = `Add SPs: ${game.vm_available_ops} remaining` for (let space of game.valid_spaces) { - gen_action_infl(spaces[space].name_unique) + gen_action_infl(space) } }, infl(space) { @@ -1506,7 +1523,7 @@ states.support_loss ={ view.prompt = `Support Loss: remove ${pluralize(game.available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique) + gen_action_infl(space_id) } } else if (game.phase === 1 && game.available_ops === 0 ) { view.prompt = 'Support Loss: finished.' @@ -1712,6 +1729,11 @@ states.the_tyrant_is_gone ={ if (game.active !== DEM) { next_player() } + if (game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } log_h3(`C97`) game.vm_event = 97 goto_vm(game.vm_event) @@ -1726,7 +1748,7 @@ states.finish_scoring ={ } , done() { console.log('game.return_state', game.return_state) - log('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ + log_msg_gap('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ if (game.persistent_events.includes(111)) { game.state = 'new_years_eve_party' return @@ -2173,24 +2195,22 @@ states.stasi_resolve_common_european_home = { function add_infl(space) { push_undo() console.log('adding infl to', space) - const clicked_space = find_space_index(space) - console.log('clicked_space', clicked_space) //console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker) - //log(`Added 1 influence in %${clicked_space}`) - log_summary(`Added £ SP in %${clicked_space}`) + //log(`Added 1 influence in %${space}`) + log_summary(`Added £ SP in %${space}`) //If AHBR - check AHBR conditions if (game.persistent_events.includes(58)) { - if (spaces[clicked_space].country !== 'East_Germany'){ + if (spaces[space].country !== 'East_Germany'){ game.austria_hungary_border_reopened_tracker = false } } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[clicked_space].country === 'East_Germany') { + if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { game.available_ops-- log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(clicked_space)) { + } else if (check_opp_control(space)) { game.available_ops -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative if (game.available_ops < 0) { @@ -2202,13 +2222,13 @@ function add_infl(space) { // Update influence values if (game.active === COM) { - game.comInfl[clicked_space]++ + game.comInfl[space]++ } else { - game.demInfl[clicked_space]++ + game.demInfl[space]++ } // Check whether spaces are controlled - check_control_change(clicked_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) { @@ -2246,49 +2266,47 @@ function add_infl(space) { function remove_infl(space) { push_undo() - const clicked_space = find_space_index(space) - //log(`Removed 1 influence from %${clicked_space}.`) - log_summary(`Removed £ SP from %${clicked_space}.`) + //log(`Removed 1 influence from %${space}.`) + log_summary(`Removed £ SP from %${space}.`) if (game.remove_opponent_infl === true) { if (game.active === COM) { - game.demInfl[clicked_space]-- - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } else { - game.comInfl[clicked_space]-- - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(clicked_space) + check_control_change(space) } else { if (game.active === COM) { - game.comInfl[clicked_space]-- - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } else { - game.demInfl[clicked_space]-- - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(clicked_space) + check_control_change(space) } game.available_ops-- } function do_sc(space) { clear_undo() - let clicked_space = find_space_index(space) - log_gap(`Support check: %${clicked_space}`) + log_gap(`Support check: %${space}`) //Check Helsinki Final Act - if (game.active === COM && game.persistent_events.includes(26) && (spaces[clicked_space].socio === 5 || spaces[clicked_space].socio === 6) ) { + if (game.active === COM && game.persistent_events.includes(26) && (spaces[space].socio === 5 || spaces[space].socio === 6) ) { log('+1 VP from C26') game.vp ++ if (check_vp()) { @@ -2341,29 +2359,29 @@ function do_sc(space) { // Events which modify SC rolls //Tear Gas - if (game.active === COM && game.persistent_events.includes(30) && spaces[clicked_space].socio === 6) { + if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { roll ++ logi('+1 C30') permanently_remove(30) game.persistent_events = game.persistent_events.filter(n => n !== 30) } //FRG Embassies - if (game.active === DEM && spaces[clicked_space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { + if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { roll++ logi('+1 C74') } //GrenzTruppen - if (game.active === DEM && spaces[clicked_space].country === 'East_Germany' && game.persistent_events.includes(59)) { + if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { roll-- logi('-1 C59') } //Stand Fast - if ((game.active === COM && game.stand_fast === DEM && check_dem_control(clicked_space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(clicked_space))){ + if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ roll-- logi('-1 C100') } //Elena - if (game.active === DEM && game.persistent_events.includes(101) && spaces[clicked_space].country === 'Romania') { + if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { roll-- logi('-1 C101') } @@ -2379,7 +2397,7 @@ function do_sc(space) { const adj = count_adj(space) console.log('adj', adj) - if (game.active === COM && game.persistent_events.includes(9) && spaces[clicked_space].country === 'East_Germany') { + if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { logi('No adjacency for Democrats due to C9') logi('C9 no longer in effect') roll += adj.com_adj @@ -2416,41 +2434,40 @@ function do_sc(space) { // Support check calcs log(`Total: ${roll}`) - const stability = spaces[find_space_index(space)].stability + const stability = spaces[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`) - let clicked_space = find_space_index(space) if(game.active === DEM) { - if (change_infl > game.comInfl[clicked_space]) { - const residual = change_infl - game.comInfl[clicked_space] - game.comInfl[clicked_space] = 0 - game.demInfl[clicked_space] += residual + if (change_infl > game.comInfl[space]) { + const residual = change_infl - game.comInfl[space] + game.comInfl[space] = 0 + game.demInfl[space] += residual } else { - game.comInfl[clicked_space] -= change_infl + game.comInfl[space] -= change_infl } - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } else { - if (change_infl > game.demInfl[clicked_space]) { - const residual = change_infl - game.demInfl[clicked_space] - game.demInfl[clicked_space] = 0 - game.comInfl[clicked_space] += residual + if (change_infl > game.demInfl[space]) { + const residual = change_infl - game.demInfl[space] + game.demInfl[space] = 0 + game.comInfl[space] += residual } else { - game.demInfl[clicked_space] -= change_infl + game.demInfl[space] -= change_infl } - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } - check_control_change(clicked_space) + check_control_change(space) } else { log_msg_gap('Change: 0 SP') } - if (game.active === COM && game.persistent_events.includes(39) && spaces[clicked_space].space_id === 66) { + if (game.active === COM && game.persistent_events.includes(39) && spaces[space].space_id === 66) { log_msg_gap('+1 VP from C39') game.vp++ if (check_vp()) { @@ -2677,8 +2694,8 @@ function do_valid_cards() { valid_cards(game.com_pwr_hand, presence.com_leaders)} } -function count_adj(name_unique) { - const space = spaces[find_space_index(name_unique)] +function count_adj(id) { + const space = spaces[id] let dem_adj = 0 let com_adj = 0 @@ -2808,7 +2825,7 @@ function do_tst_attempt() { // TIANANMEN SQUARE ATTEMPT game.return = game.active - game.return_state = 'tiananmen_square_attempt_success' + game.return_state = 'tiananmen_square_attempt_done' if (game.active === DEM) { game.dem_tst_attempted_this_turn = 1 if (roll >= dem_tst_req[game.dem_tst_position]) { @@ -2833,9 +2850,9 @@ function do_tst_attempt() { } //Check if TST events occur - if (game.dem_tst_position === 3 && game.com_tst_position < 3) {goto_vm(203)} - else if (game.dem_tst_position === 4 && game.com_tst_position < 4) {goto_vm(204)} - else {game.state = 'tiananmen_square_attempt_success'} + if (game.dem_tst_position === 3 && game.com_tst_position < 3) {game.vm_event = 203} + else if (game.dem_tst_position === 4 && game.com_tst_position < 4) {game.vm_event = 204} + game.state = 'tiananmen_square_attempt_success' } else { log(`${dem_tst_req[game.dem_tst_position]} required: fail`) game.dem_tst_attempted = 1 @@ -2846,12 +2863,6 @@ 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 @@ -2871,9 +2882,9 @@ function do_tst_attempt() { } //Check if TST events occur - if (game.com_tst_position === 3 && game.dem_tst_position < 3) {goto_vm(203)} - else if (game.com_tst_position === 4 && game.dem_tst_position < 4) {goto_vm(204)} - else {game.state = 'tiananmen_square_attempt_success'} + if (game.com_tst_position === 3 && game.dem_tst_position < 3) {game.vm_event = 203} + else if (game.com_tst_position === 4 && game.dem_tst_position < 4) {game.vm_event = 204} + game.state = 'tiananmen_square_attempt_success' } else { log(`${com_tst_req[game.com_tst_position]} required: fail`) game.com_tst_attempted = 1 @@ -3253,6 +3264,10 @@ function event_is_playable(card) { else if (game.persistent_events.includes(13) && card === 21 && game.active === DEM) { return false } + //Check for The Chinese Solution + else if (game.com_tst_position === 8 && card === 96) { + return true + } //Then check normally else if (cards[card].playable) { return true @@ -3482,6 +3497,13 @@ function end_round() { // Resolve end action round //Stasi check if(game.round_player === COM && game.persistent_events.includes(13)) { + //If in Honecker, turn ends + if (game.round === 8) { + clear_undo() + game.state = 'end_turn_4_5_4' + return + } + //Otherwise go to Stasi game.round_player = DEM if (game.active !== DEM) { next_player() @@ -4610,54 +4632,52 @@ function vm_take_control_prep() { } function vm_take_control(space) { - let clicked_space = find_space_index(space) if (game.active === DEM) { - let current_infl = game.demInfl[clicked_space] - let opponent_infl = game.comInfl[clicked_space] - let stability = spaces[clicked_space].stability + let current_infl = game.demInfl[space] + let opponent_infl = game.comInfl[space] + let stability = spaces[space].stability if ((current_infl - opponent_infl) < stability) { - game.demInfl[clicked_space] += stability - current_infl + opponent_infl - //game.pieces[clicked_space].demCtrl = 1 - //game.pieces[clicked_space].comCtrl = 0 + game.demInfl[space] += stability - current_infl + opponent_infl + //game.pieces[space].demCtrl = 1 + //game.pieces[space].comCtrl = 0 } } else if (game.active === COM) { - let current_infl = game.comInfl[clicked_space] - let opponent_infl = game.demInfl[clicked_space] - let stability = spaces[clicked_space].stability + let current_infl = game.comInfl[space] + let opponent_infl = game.demInfl[space] + let stability = spaces[space].stability if ((current_infl - opponent_infl) < stability) { - game.comInfl[clicked_space] += stability - current_infl + opponent_infl - //game.pieces[clicked_space].comCtrl = 1 - //game.pieces[clicked_space].demCtrl = 0 + game.comInfl[space] += stability - current_infl + opponent_infl + //game.pieces[space].comCtrl = 1 + //game.pieces[space].demCtrl = 0 } } - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) - log(`Took control of %${clicked_space}`) + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + log(`Took control of %${space}`) } function vm_do_add_infl(space) { push_undo() console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) - const clicked_space = find_space_index(space) - //log(`Added 1 influence in %${clicked_space}.`) + //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${clicked_space}.`) + log_summary(`Added £ SP in %${space}.`) //If AHBR - check AHBR condition if (game.persistent_events.includes(58)) { - if (spaces[clicked_space].country !== 'East_Germany'){ + if (spaces[space].country !== 'East_Germany'){ game.austria_hungary_border_reopened_tracker = false } } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[clicked_space].country === 'East_Germany') { + if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { game.vm_available_ops-- log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(clicked_space)) { + } else if (check_opp_control(space)) { game.vm_available_ops -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative if (game.vm_available_ops < 0) { @@ -4669,13 +4689,13 @@ function vm_do_add_infl(space) { // Update influence values if (game.active === COM) { - game.comInfl[clicked_space]++ + game.comInfl[space]++ } else { - game.demInfl[clicked_space]++ + game.demInfl[space]++ } // Check whether spaces are controlled - check_control_change(clicked_space) + check_control_change(space) console.log('before check, ahbr in events', game.persistent_events.includes(58), 'tracker', game.austria_hungary_border_reopened_tracker) // Check Austria Hungary Border Reopened is true and condition has been met @@ -4715,23 +4735,22 @@ function vm_do_add_infl(space) { function vm_do_add_infl_free(space) { push_undo() - const clicked_space = find_space_index(space) - //log(`Added 1 influence in %${clicked_space}.`) + //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${clicked_space}.`) + log_summary(`Added £ SP in %${space}.`) // Update influence values if (game.active === COM) { - game.comInfl[clicked_space]++ + game.comInfl[space]++ } else { - game.demInfl[clicked_space]++ + game.demInfl[space]++ } game.vm_available_ops-- // Check whether spaces are controlled - check_control_change(clicked_space) + check_control_change(space) - //console.log('game pieces:', game.pieces[clicked_space]) + //console.log('game pieces:', game.pieces[space]) } function vm_add_infl() { @@ -4751,16 +4770,15 @@ function vm_add_x_infl() { function vm_do_add_x_infl(space) { push_undo() - const clicked_space = find_space_index(space) - log(`Added ${game.vm_available_ops} SPs in %${clicked_space}.`) + log(`Added ${game.vm_available_ops} SPs in %${space}.`) if (game.active === COM) { - game.comInfl[clicked_space] += game.vm_available_ops + game.comInfl[space] += game.vm_available_ops } else { - game.demInfl[clicked_space] += game.vm_available_ops + game.demInfl[space] += game.vm_available_ops } - check_control_change(clicked_space) + check_control_change(space) game.vm_available_ops = 0 game.valid_spaces = [] } @@ -4773,34 +4791,33 @@ function vm_add_limited_infl() { function vm_do_add_limited_infl(space, max_infl) { push_undo() - const clicked_space = find_space_index(space) - //log(`Added 1 influence in %${clicked_space}.`) + //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${clicked_space}.`) + log_summary(`Added £ SP in %${space}.`) game.vm_available_ops -- if (!game.vm_influence_added) { game.vm_influence_added = {}; } - if (!game.vm_influence_added[clicked_space]) { - game.vm_influence_added[clicked_space] = 0; + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; } if (game.active === COM) { - game.comInfl[clicked_space] ++ + game.comInfl[space] ++ } else { - game.demInfl[clicked_space] ++ + game.demInfl[space] ++ } - game.vm_influence_added[clicked_space] ++ + game.vm_influence_added[space] ++ //console.log('valid_spaces before update', game.valid_spaces) - //console.log('influence added:', game.vm_influence_added[clicked_space], 'max infl', max_infl) - if (game.vm_influence_added[clicked_space] === max_infl) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + //console.log('influence added:', game.vm_influence_added[space], 'max infl', max_infl) + if (game.vm_influence_added[space] === max_infl) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(clicked_space) + check_control_change(space) if (game.vm_available_ops === 0) {game.valid_spaces = [] } } @@ -4823,90 +4840,88 @@ function vm_remove_x_opp_infl() { function vm_do_remove_infl(space) { push_undo() - const clicked_space = find_space_index(space) - //log(`Removed 1 influence from %${clicked_space}.`) - log_summary(`Removed £ SP from %${clicked_space}.`) + //log(`Removed 1 influence from %${space}.`) + log_summary(`Removed £ SP from %${space}.`) if (!game.vm_influence_added) { game.vm_influence_added = {}; } - if (!game.vm_influence_added[clicked_space]) { - game.vm_influence_added[clicked_space] = 0; + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; } if (game.remove_opponent_infl === true) { if (game.active === COM) { - game.demInfl[clicked_space]-- - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } else { - game.comInfl[clicked_space]-- - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } } else { if (game.active === COM) { - game.comInfl[clicked_space]-- - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } else { - game.demInfl[clicked_space]-- - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } } - check_control_change(clicked_space) - game.vm_influence_added[clicked_space]++ + check_control_change(space) + game.vm_influence_added[space]++ game.vm_available_ops-- if (game.vm_available_ops===0) {game.valid_spaces = []} } function vm_do_remove_x_infl(space) { push_undo() - const clicked_space = find_space_index(space) if (game.remove_opponent_infl) { if (game.active === COM) { - if (game.demInfl[clicked_space] >= game.vm_available_ops) { - game.demInfl[clicked_space] -= game.vm_available_ops + if (game.demInfl[space] >= game.vm_available_ops) { + game.demInfl[space] -= game.vm_available_ops } else { - game.vm_available_ops = game.demInfl[clicked_space] - game.demInfl[clicked_space] -= game.vm_available_ops + game.vm_available_ops = game.demInfl[space] + game.demInfl[space] -= game.vm_available_ops } } else { - if (game.comInfl[clicked_space] >= game.vm_available_ops) { - game.comInfl[clicked_space] -= game.vm_available_ops + if (game.comInfl[space] >= game.vm_available_ops) { + game.comInfl[space] -= game.vm_available_ops } else { - game.vm_available_ops = game.comInfl[clicked_space] - game.comInfl[clicked_space] -= game.vm_available_ops + game.vm_available_ops = game.comInfl[space] + game.comInfl[space] -= game.vm_available_ops } } } else { if (game.active === COM) { - if (game.comInfl[clicked_space] >= game.vm_available_ops) { - game.comInfl[clicked_space] -= game.vm_available_ops + if (game.comInfl[space] >= game.vm_available_ops) { + game.comInfl[space] -= game.vm_available_ops } else { - game.vm_available_ops = game.comInfl[clicked_space] - game.comInfl[clicked_space] -= game.vm_available_ops + game.vm_available_ops = game.comInfl[space] + game.comInfl[space] -= game.vm_available_ops } } else { - if (game.demInfl[clicked_space] >= game.vm_available_ops) { - game.demInfl[clicked_space] -= game.vm_available_ops + if (game.demInfl[space] >= game.vm_available_ops) { + game.demInfl[space] -= game.vm_available_ops } else { - game.vm_available_ops = game.demInfl[clicked_space] - game.demInfl[clicked_space] -= game.vm_available_ops + game.vm_available_ops = game.demInfl[space] + game.demInfl[space] -= game.vm_available_ops } } } - log(`Removed ${game.vm_available_ops} SPs from %${clicked_space}`) - check_control_change(clicked_space) + log(`Removed ${game.vm_available_ops} SPs from %${space}`) + check_control_change(space) game.vm_available_ops = 0 game.valid_spaces = [] @@ -4921,8 +4936,7 @@ function vm_remove_limited_opp_infl() { function vm_do_remove_limited_infl(space, max_infl) { push_undo() - const clicked_space = find_space_index(space) - log(`Removed SP from %${clicked_space}.`) + log(`Removed SP from %${space}.`) game.vm_available_ops -- @@ -4930,29 +4944,29 @@ function vm_do_remove_limited_infl(space, max_infl) { game.vm_influence_added = {}; } - if (!game.vm_influence_added[clicked_space]) { - game.vm_influence_added[clicked_space] = 0; + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; } if (game.active === COM) { - game.demInfl[clicked_space] -- - if (game.demInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) + game.demInfl[space] -- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } else { - game.comInfl[clicked_space] -- - if (game.comInfl[clicked_space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) + game.comInfl[space] -- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } - game.vm_influence_added[clicked_space] ++ + game.vm_influence_added[space] ++ - if (game.vm_influence_added[clicked_space] === max_infl) { - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space); + if (game.vm_influence_added[space] === max_infl) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(clicked_space) + check_control_change(space) if (game.vm_available_ops === 0) {game.valid_spaces = []} } @@ -4963,27 +4977,26 @@ function vm_remove_all_infl() { function vm_do_remove_all_infl(space) { push_undo() - const clicked_space = find_space_index(space) - log(`Removed all SP from %${clicked_space}.`) + log(`Removed all SP from %${space}.`) if (game.remove_opponent_infl === true) { if (game.active === COM) { - game.demInfl[clicked_space] = 0 + game.demInfl[space] = 0 } else { - game.comInfl[clicked_space] = 0 + game.comInfl[space] = 0 } - check_control_change(clicked_space) + check_control_change(space) } else { if (game.active === COM) { - game.comInfl[clicked_space] = 0 + game.comInfl[space] = 0 } else { - game.demInfl[clicked_space] = 0 + game.demInfl[space] = 0 } - check_control_change(clicked_space) + check_control_change(space) } game.vm_available_ops -- - game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) + game.valid_spaces = game.valid_spaces.filter(id => id !== space) } function vm_replace_all_infl(space_id) { @@ -5013,14 +5026,14 @@ function vm_support_check_modified() { game.state = 'vm_support_check_prep' } -function vm_switch_infl(space){ +function vm_switch_infl(id){ push_undo() - let clicked_space = find_space_index(space) - game.demInfl[clicked_space] -= game.vm_available_ops - game.comInfl[clicked_space] += game.vm_available_ops - log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in ${spaces[clicked_space].name_unique}`) + + game.demInfl[id] -= game.vm_available_ops + game.comInfl[id] += game.vm_available_ops + log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${id}`) game.vm_available_ops = 0 - check_control_change(clicked_space) + check_control_change(id) } /* ===================== EVENT SPECIFIC FUNCTIONS ========== */ @@ -5210,37 +5223,11 @@ function vm_eliminate(space_id) { //console.log('adjacency before: Iasi', game.pieces[53].adjacent, 'Ploesti:', game.pieces[59].adjacent, 'Bucharesti:', game.pieces[61].adjacent) - // Remove clicked_space from the adjacency lists of its adjacent spaces - /* adjacent_spaces.forEach(s => { - game.pieces[s].adjacent = spaces[s].adjacent.filter(id => id !== space_id); - }); - - //console.log('adjacency after: Iasi', game.pieces[53].adjacent, 'Ploesti:', game.pieces[59].adjacent, 'Bucharesti:', game.pieces[61].adjacent) - - // Connect adjacent spaces to each other - // No longer used - spaces done dynamically -/* - for (let i = 0; i < adjacent_spaces.length; i++) { - for (let j = i + 1; j < adjacent_spaces.length; j++) { - console.log(' checking i,', spaces[adjacent_spaces[i]].name, 'j', spaces[adjacent_spaces[j]].name) - if (!game.pieces[adjacent_spaces[i]].adjacent.includes(adjacent_spaces[j])) { - game.pieces[adjacent_spaces[i]].adjacent.push(adjacent_spaces[j]); - } - if (!game.pieces[adjacent_spaces[j]].adjacent.includes(adjacent_spaces[i])) { - game.pieces[adjacent_spaces[j]].adjacent.push(adjacent_spaces[i]); - } - } - } - - console.log('adjacency after addition: Iasi', game.pieces[53].adjacent, 'Ploesti:', game.pieces[59].adjacent, 'Bucharesti:', game.pieces[61].adjacent) - // Clear the adjacency list of the clicked space - game.pieces[space_id].adjacent = []; -*/ // Eliminate the democrat influence and move the communist influence to Bucuresti game.demInfl[space_id] = 0 game.comInfl[61] += game.comInfl[space_id] if (game.comInfl[space_id] > 0 ) { - log(`${game.comInfl[space_id]} Communist SP relocated to Bucuresti`) + log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) } game.comInfl[space_id] = 0 @@ -5965,7 +5952,7 @@ states.vm_take_control = { } else if (game.vm_available_ops > 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}: take control of ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Take control: done.` @@ -5994,7 +5981,7 @@ states.vm_add_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique) + gen_action_infl(space_id) } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` @@ -6031,7 +6018,7 @@ states.vm_add_infl_free = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` @@ -6065,7 +6052,7 @@ states.vm_add_x_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique) + gen_action_infl(space_id) } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` @@ -6075,6 +6062,9 @@ states.vm_add_x_infl = { infl(space) { push_undo() vm_do_add_x_infl(space) + if (game.vm_event === 105) { + vm_next() + } //game.vm_event_done = true //vm_next() }, @@ -6097,7 +6087,7 @@ states.vm_add_limited_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` @@ -6141,14 +6131,13 @@ states.vm_remove_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } }, infl(space) { push_undo() vm_do_remove_infl(space) - const clicked_space = find_space_index(space) - game.vm_active_country = spaces[clicked_space].country + game.vm_active_country = spaces[space].country /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { vm_next() }*/ @@ -6176,7 +6165,7 @@ states.vm_remove_x_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` @@ -6201,7 +6190,7 @@ states.vm_remove_limited_infl = { 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); + gen_action_infl(space_id); } } 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.` @@ -6236,7 +6225,7 @@ states.vm_remove_all_infl = { } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` @@ -6245,8 +6234,7 @@ states.vm_remove_all_infl = { }, infl(space) { vm_do_remove_all_infl(space) - const clicked_space = find_space_index(space) - game.vm_active_country = spaces[clicked_space].country + game.vm_active_country = spaces[space].country /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { vm_next() }*/ @@ -6272,13 +6260,13 @@ states.vm_support_check_prep = { } for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_sc(spaces[space_id].name_unique); + gen_action_sc(space_id); } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space // 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 @@ -6319,13 +6307,13 @@ states.vm_ceh_support_check_prep = { view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(spaces[space_id].name_unique) + gen_action_sc(space_id) } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space //Then check Austria-Hungary Border Reopened normally //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) @@ -6355,7 +6343,7 @@ states.vm_ceh_do_support_check = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) game.vm_available_ops-- if (game.vm_available_ops === 0) { @@ -6396,13 +6384,13 @@ states.vm_1_support_check_prep = { for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_sc(spaces[space_id].name_unique); + gen_action_sc(space_id); } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space game.state = 'vm_do_support_check' }, done () { @@ -6419,7 +6407,7 @@ states.vm_do_support_check = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) game.vm_available_ops-- if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -7263,13 +7251,17 @@ states.vm_kremlin_coup_take_control = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.valid_spaces.length === 0){ + if (game.valid_spaces.includes(game.systematization)) { + view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space no longer exists.` + gen_action('done') + } + else if (game.valid_spaces.length === 0){ view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space is already controlled.` gen_action('done') } else { view.prompt = `Kremlin Coup! Take control of the Elite space in ${country_name(game.vm_active_country)}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } }, @@ -7300,10 +7292,10 @@ states.vm_kremlin_coup_sc_prep = { }, prompt() { 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); + gen_action_sc(game.selected_space); }, sc(space) { - //game.selected_space = find_space_index(space) + //game.selected_space = space game.state = 'vm_kremlin_coup_sc' } } @@ -7316,7 +7308,7 @@ states.vm_kremlin_coup_sc = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) if (game.temp.length > 0 ){ game.state = 'vm_kremlin_coup_choose_country' } else { @@ -7378,7 +7370,7 @@ states.vm_switch_infl = { /*if (game.vm_available_ops > 0 ) {*/ view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } /*else { view.prompt = 'Influence replaced.' @@ -7592,7 +7584,7 @@ states.vm_nomenklatura_remove = { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } }, @@ -7619,7 +7611,7 @@ states.vm_nomenklatura_add = { } else { view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } }, @@ -7821,7 +7813,7 @@ states.vm_systematization = { /*if (game.systematization === 0) { */ view.prompt = 'Systematization: eliminate a space in Romania.' for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } /*} else { view.prompt = 'Systematization: done.' @@ -7830,9 +7822,9 @@ states.vm_systematization = { }, infl(space) { push_undo() - vm_eliminate(find_space_index(space)) + vm_eliminate(space) game.valid_spaces = [] - game.systematization = find_space_index(space) + game.systematization = space game.persistent_events.push(69) vm_next() }, @@ -7936,7 +7928,7 @@ states.vm_the_tyrant_is_gone = { view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = 'Select a space: done.' @@ -7945,8 +7937,9 @@ states.vm_the_tyrant_is_gone = { }, infl(space) { push_undo() - log(`The Ceausescus flee to %${find_space_index(space)}`) - game.the_tyrant_is_gone = find_space_index(space) + log(`The Ceausescus flee to %${space}`) + game.the_tyrant_is_gone = space + game.valid_spaces = [] game.persistent_events.push(97) }, done () { @@ -8117,7 +8110,7 @@ states.vm_we_are_the_people_remove = { view.prompt = '"We are the People!": remove up to 4 SPs from the Lutherian Church.' gen_action('done') for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } } else { view.prompt = '"We are the People!" Remove SPs: done.' @@ -8155,7 +8148,7 @@ states.vm_we_are_the_people_add = { view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` gen_action('done') for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } }, infl(space) { @@ -8177,13 +8170,22 @@ states.vm_workers_revolt = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { + if (game.valid_spaces.length === 0 ) { + view.prompt = 'Workers Revolt: no valid spaces to select.' + gen_action('pass') + return + } view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.' for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique) + gen_action_infl(space_id) } }, + pass() { + push_undo() + vm_next() + }, infl(space) { - game.selected_space = find_space_index(space) + game.selected_space = space log(`Chose %${game.selected_space}`) game.state = 'vm_workers_revolt_finish' } @@ -8208,7 +8210,7 @@ states.vm_workers_revolt_finish = { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 log(`Roll: D${roll}`) - let adj = count_adj(spaces[game.selected_space].name_unique) + let adj = count_adj(game.selected_space) if (game.active === DEM) { log(`-${adj.com_adj} from opponent controlled spaces`) roll -= adj.com_adj @@ -8285,10 +8287,10 @@ states.vm_tst_4 = { gen_action('done') return } - view.prompt = 'Tiananmen Square Track award: select a space to remove SPs' + view.prompt = `Tiananmen Square Track award: remove ${pluralize(game.vm_available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_infl(spaces[space_id].name_unique); + gen_action_infl(space_id); } }, infl(space) { @@ -8314,14 +8316,14 @@ states.vm_tst_6 = { view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' for (let space_id of game.valid_spaces) { if (space_id) { - gen_action_sc(spaces[space_id].name_unique); + gen_action_sc(space_id); } } } }, sc(space) { push_undo() - game.selected_space = find_space_index(space) + game.selected_space = space if (game.active === DEM && game.persistent_events.includes(58) && spaces[space].country === "East_Germany") { game.austria_hungary_border_reopened_tracker = true } @@ -8340,7 +8342,7 @@ states.vm_tst_6_sc = { }, roll() { clear_undo() - do_sc(spaces[game.selected_space].name_unique) + do_sc(game.selected_space) game.vm_available_ops-- game.valid_spaces = [] game.state = 'vm_tst_6' @@ -9395,8 +9397,6 @@ CODE[110] = [ // Malta Summit* // #endregion - - // ============= TIANANMEN SQUARE TRACK AWARDS ==================== CODE[203] = [//Tiananmen Square space 3 award [vm_tst_3], -- cgit v1.2.3 From a7af708bc617267d3498e273a4f30f0b6ac04106 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 14 Oct 2024 22:39:17 +0100 Subject: Updates to end action round --- play.js | 1 + rules.js | 118 +++++++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 85 insertions(+), 34 deletions(-) diff --git a/play.js b/play.js index f90e207..dd38b44 100644 --- a/play.js +++ b/play.js @@ -696,6 +696,7 @@ if (view.persistent_events.includes(97)) { action_button("tst", "Tiananmen Square Track") action_button("roll", "Roll a die") action_button("done", "Done") + action_button("end_round", "End Round") action_button("undo", "Undo") console.log('view.strategy_deck', view.strategy_deck) diff --git a/rules.js b/rules.js index cf074d3..0259fda 100644 --- a/rules.js +++ b/rules.js @@ -449,7 +449,8 @@ states.choose_card = { }, pass() { log('No cards remaining. Passed') - end_round() + //end_round() + game.state = 'end_round' } } @@ -470,9 +471,10 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { - if (game.phase >= 1) { - view.prompt = `${clean_name(cards[game.played_card].name)}: done.` - gen_action('done') + if (game.phase >= 1) { /*Finish here when playing your own event */ + console.log('in play card') + view.prompt = `${clean_name(cards[game.played_card].name)}: done. End the Action Round.` + gen_action('end_round') return } @@ -528,11 +530,13 @@ states.play_card ={ push_undo() console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) log_gap(`Played C${cards[game.played_card].number} for the event`) + game.vm_infl_to_do = false if (scoring_cards.includes(game.played_card)) {game.phase = 0} else {game.phase = 1} game.return = game.active if (switch_events.includes(game.played_card)) {next_player()} game.vm_event = game.played_card + console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) goto_vm(game.vm_event) }, opp_event() { @@ -622,7 +626,7 @@ states.play_card ={ game.tst_8 = true game.state = 'vm_tst_8' }, - done () { + end_round () { end_round() } @@ -647,7 +651,7 @@ states.resolve_opponent_event = { gen_action('opp_event') } else { view.prompt = 'Event resolved. End the action round.' - gen_action('done') + gen_action('end_round') } }, influence(){ @@ -689,7 +693,7 @@ states.resolve_opponent_event = { game.tst_7 = true game.vm_event_to_do = false }, - done() { + end_round() { /*if(game.round_player === COM && game.active === DEM) { log_h3('End of Communist Action Round') change_player() @@ -724,7 +728,8 @@ states.finish_add_infl = { log_br() } - end_round() + //end_round() + game.state = 'end_round' } } @@ -759,7 +764,8 @@ states.finish_support_check_prep = { game.state = 'finish_do_support_check' }, done () { - end_round() + //end_round() + game.state = 'end_round' } } @@ -826,7 +832,9 @@ states.add_influence = { reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event'} else { - end_round()} + //end_round() + game.state = 'end_round' + } } } @@ -853,6 +861,7 @@ states.tiananmen_square_attempt_success = { gen_action('done') }, done () { + push_undo() if (game.vm_event > 200) { goto_vm(game.vm_event) } else { @@ -868,6 +877,7 @@ states.tiananmen_square_attempt_fail = { gen_action('done') }, done () { + push_undo() game.state = 'tiananmen_square_attempt_done' } } @@ -875,11 +885,12 @@ states.tiananmen_square_attempt_fail = { states.tiananmen_square_attempt_done = { inactive: 'do Tiananmen Square Attempt.', prompt () { - view.prompt = 'Tiananmen Square Track attempt: done.' + view.prompt = 'Tiananmen Square Track attempt: done. End the Action Round.' gen_action('done') }, done () { end_round() + //game.state = 'end_round' } } @@ -1017,7 +1028,8 @@ states.support_check_prep = { reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event' } else { - end_round() + //end_round() + game.state = 'end_round' } } } @@ -1042,7 +1054,7 @@ states.do_support_check = { } states.austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened', + inactive: 'decide Austria-Hungary Border Reopened.', prompt() { view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' gen_action('yes') @@ -1057,6 +1069,17 @@ states.austria_hungary_border_reopened_check = { } } +states.end_round = { + inactive: 'finish playing a card.', + prompt() { + view.prompt = 'End the Action Round.' + gen_action('end_round') + }, + end_round() { + end_round() + } +} + //======================= POWER STRUGGLE =============================== states.draw_power_cards = { @@ -1757,7 +1780,8 @@ states.finish_scoring ={ return } reset_power() - end_round() + //end_round() + game.state = 'end_round' } } @@ -1961,7 +1985,8 @@ states.general_strike = { game.phase = 1 }, done () { - end_round() + //end_round() + game.state = 'end_round' } } @@ -1982,7 +2007,8 @@ states.honecker ={ pass() { log('C15: passed') game.persistent_events = game.persistent_events.filter(n => n !== 15) - end_round() + //end_round() + game.state = 'end_round' } } @@ -2157,10 +2183,11 @@ states.stasi_play_card = { }, pass () { log('No cards remaining. Passed') - end_round() + //end_round() + game.state = 'end_round' }, done () { - game.stasi_card = 0 + //game.stasi_card = 0 if (game.democrat_hand.includes(21)) { game.state = 'stasi_resolve_common_european_home' } else { @@ -2315,13 +2342,12 @@ function do_sc(space) { return } } - console.log('continue support check, game.state', game.state) + // Continue with Support Check Logic let roll = Math.floor(Math.random() * 6) + 1 log(`Roll: D${roll}`) - console.log('game.vm_event', game.vm_event) - console.log('game.is_pwr_struggle', game.is_pwr_struggle) + /* //Check if support check is being done with game.played_card or a subsequent card (e.g. Common European Home, Dash for the West, etc) if (game.vm_event > 0) { @@ -2704,7 +2730,7 @@ function count_adj(id) { for (let adj_space_id of adjacent_spaces) { if (adj_space_id) { const adj_piece = spaces.find(piece => piece && piece.space_id === adj_space_id); - console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) + //console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) if (adj_piece && adj_piece.space_id !== space.space_id) { if (check_dem_control(adj_piece.space_id)) { console.log('added DEM space', spaces[adj_piece.space_id].name) @@ -3261,7 +3287,7 @@ function event_is_playable(card) { return false } //Check for Common European Hmme under Stasi - else if (game.persistent_events.includes(13) && card === 21 && game.active === DEM) { + else if (game.stasi_card === 21 && card === 21 && game.active === DEM) { return false } //Check for The Chinese Solution @@ -3382,6 +3408,7 @@ function get_tst_6_ops() { // =========== 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') @@ -4344,7 +4371,7 @@ function pop_vm_prompt() { function vm_return() { - console.log('in vm_return') + console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do) //Remove temporary vm variables delete game.support_check_modifier @@ -4361,9 +4388,14 @@ function vm_return() { 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' + if (!game.vm_infl_to_do) { + /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { + game.state = 'vm_end_event' + } else {*/ + game.state = 'vm_end_event' + //} } else { + console.log('vm_infl_to_do true') vm_end_event() } } @@ -4389,8 +4421,11 @@ function vm_end_event() { game.state = game.return_state console.log( 'game.state', game.state) } - else if (game.vm_infl_to_do) {game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ - else {game.state = "play_card"} + else if (game.vm_infl_to_do) { + game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ + //else {game.state = "play_card"} + else{ + end_round()} } /* ================== VM ACTIONS =========================== */ @@ -5460,6 +5495,7 @@ function vm_laszlo_tokes() { } function vm_legacy_of_martial_law() { + console.log('in martial law, game.vm_infl_to_do', game.vm_infl_to_do) game.vm_available_ops = 1 game.state = 'vm_switch_infl' } @@ -5932,10 +5968,15 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { - view.prompt = `${clean_name(cards[this_card()].name)}: done.` - gen_action('done') + console.log('in vm_end_event') + view.prompt = `${clean_name(cards[this_card()].name)}: done. End the Action Round.` + gen_action('end_round') }, - done(){ + end_round(){ + console.log('end round clicked - vm_end_event called') + if (!game.vm_infl_to_do) { + game.return_state = '' + } vm_end_event() } } @@ -5995,6 +6036,7 @@ states.vm_add_infl = { } }, done () { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() @@ -6032,6 +6074,7 @@ states.vm_add_infl_free = { } }, done () { + push_undo() game.valid_spaces = [] game.vm_event_done = true if (game.summary.length > 0) { @@ -6069,6 +6112,7 @@ states.vm_add_x_infl = { //vm_next() }, done () { + push_undo() game.vm_event_done = true vm_next() } @@ -6101,6 +6145,7 @@ states.vm_add_limited_infl = { } }, done () { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() @@ -6290,6 +6335,7 @@ states.vm_support_check_prep = { game.state = 'vm_do_support_check' }, done () { + push_undo() game.vm_available_ops = 0 vm_next () } @@ -6394,6 +6440,7 @@ states.vm_1_support_check_prep = { game.state = 'vm_do_support_check' }, done () { + push_undo() game.vm_available_ops = 0 vm_next () } @@ -7621,6 +7668,7 @@ states.vm_nomenklatura_add = { if (game.vm_available_ops === 0 ) {game.valid_spaces = []} }, done() { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() @@ -8157,6 +8205,7 @@ states.vm_we_are_the_people_add = { if (game.vm_influence_added[6] === 0 ) {game.valid_spaces = []} }, done() { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() @@ -8330,6 +8379,7 @@ states.vm_tst_6 = { game.state = 'vm_tst_6_sc' }, done () { + push_undo() vm_next() } } @@ -8367,8 +8417,8 @@ states.vm_tst_8 = { gen_action('event') } else if (!game.vm_event_to_do && !game.vm_infl_to_do) { - view.prompt = 'Event and operations: done.' - gen_action('done') + view.prompt = 'Event and operations: done. End the Action Round' + gen_action('end_round') } }, event() { @@ -8386,7 +8436,7 @@ states.vm_tst_8 = { game.return_state = 'vm_tst_8' goto_vm(208) }, - done() { + end_round() { game.tst_8 = true end_round() } -- cgit v1.2.3 From bb272b0887a5e4b4e8a7380d02e441874c48ff24 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 15 Oct 2024 08:37:51 +0100 Subject: Tidying up End Action Round --- rules.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index 0259fda..a063005 100644 --- a/rules.js +++ b/rules.js @@ -863,6 +863,7 @@ states.tiananmen_square_attempt_success = { done () { push_undo() if (game.vm_event > 200) { + console.log('going to tst award, game.return_state', game.return_state) goto_vm(game.vm_event) } else { game.state = 'tiananmen_square_attempt_done' @@ -4371,7 +4372,7 @@ function pop_vm_prompt() { function vm_return() { - console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do) + console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) //Remove temporary vm variables delete game.support_check_modifier @@ -4385,14 +4386,15 @@ function vm_return() { } //Check if end event state is needed - if (game.is_pwr_struggle || game.state === 'vm_tst_6') { + if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { vm_end_event() } else { if (!game.vm_infl_to_do) { /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { game.state = 'vm_end_event' } else {*/ - game.state = 'vm_end_event' + game.state = 'vm_end_event' + //} } else { console.log('vm_infl_to_do true') @@ -5914,6 +5916,7 @@ function discarded_card() { // =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== function vm_tst_3() { + console.log('function vm_tst_3, game.return_state', game.return_state) log_gap('Tiananmen Square Track award') game.state = 'vm_tst_3_prep' } @@ -6219,8 +6222,11 @@ states.vm_remove_x_infl = { }, infl(space) { vm_do_remove_x_infl(space) + if (game.vm_event === 68) { + vm_next() + } /*game.vm_event_done = true - vm_next()*/ + vm_next()*/ }, done () { game.vm_event_done = true @@ -8284,6 +8290,7 @@ states.vm_workers_revolt_finish = { states.vm_tst_3_prep = { inactive: 'resolve Tiananmen Square Track award.', prompt() { + console.log('tst award prep, game.return_state', game.return_state) view.prompt = 'Tiananmen Square Track award: draw 3 cards.' gen_action('draw') }, @@ -8305,8 +8312,9 @@ states.vm_tst_3_prep = { states.vm_tst_3 = { inactive: 'resolve Tiananmen Square Track bonus.', prompt() { + console.log('tst award, game.return_state', game.return_state) if (game.temp < 2) { - view.prompt = `Discard 2 of the drawn cards` + view.prompt = `Discard 2 of the drawn cards.` for (let card of game.valid_cards) { gen_action_card(card) } -- cgit v1.2.3 From 5b644b34cc90ae93b0b074c1b58becd0f91b2a03 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 17 Oct 2024 13:31:59 +0100 Subject: Updates for new flow --- rules.js | 699 ++++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 469 insertions(+), 230 deletions(-) diff --git a/rules.js b/rules.js index a063005..c3a603b 100644 --- a/rules.js +++ b/rules.js @@ -318,7 +318,10 @@ states.com_init = { inactive: 'place starting SPs.', prompt() { console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) - if (game.available_ops == 0) { + if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { + view.prompt = 'Place starting SPs: done. Start Turn 1.'; + gen_action("start"); + } else if (game.available_ops === 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; @@ -356,6 +359,11 @@ states.com_init = { delete game.starting_infl game.state = 'start_game' } + }, + start() { + new_turn() + clear_undo() + game.state = 'choose_card' } } @@ -398,19 +406,6 @@ states.dem_init = { } } -states.start_game = { - inactive: 'start Turn 1.', - prompt() { - console.log('state:', game.state) - view.prompt = 'Start Turn 1.' - gen_action('start') - }, - start() { - new_turn() - clear_undo() - game.state = 'choose_card' - } -} states.choose_card = { inactive: 'choose a card.', @@ -471,12 +466,12 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { - if (game.phase >= 1) { /*Finish here when playing your own event */ + /*if (game.phase >= 1) { /*Finish here when playing your own event console.log('in play card') view.prompt = `${clean_name(cards[game.played_card].name)}: done. End the Action Round.` gen_action('end_round') return - } + }*/ view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` @@ -694,6 +689,7 @@ states.resolve_opponent_event = { game.vm_event_to_do = false }, end_round() { + push_undo() /*if(game.round_player === COM && game.active === DEM) { log_h3('End of Communist Action Round') change_player() @@ -708,11 +704,11 @@ states.finish_add_infl = { prompt () { if (game.available_ops === 0) { view.prompt = 'Place SPs: done.' - gen_action("done") + gen_action("end_round") return; } - view.prompt = `Add SPs: ${game.available_ops} remaining` + view.prompt = `Add SPs: ${game.available_ops} remaining.` // Generate actions for valid spaces for (let space_id of game.valid_spaces) { @@ -722,14 +718,15 @@ states.finish_add_infl = { infl(space) { add_infl(space) }, - done() { + end_round() { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() } - //end_round() - game.state = 'end_round' + end_round() + //game.state = 'end_round' } } @@ -738,7 +735,7 @@ states.finish_support_check_prep = { prompt () { if (game.available_ops === 0) { view.prompt = 'Support checks: done.' - gen_action('done') + gen_action('end_round') //return } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` @@ -763,9 +760,9 @@ states.finish_support_check_prep = { } game.state = 'finish_do_support_check' }, - done () { - //end_round() - game.state = 'end_round' + end_round () { + end_round() + //game.state = 'end_round' } } @@ -806,35 +803,41 @@ states.finish_do_support_check = { states.add_influence = { inactive: 'add SPs.', prompt () { - if (game.available_ops <= 0) { - view.prompt = 'Place SPs: done.' - gen_action("done") - return - } + if (game.available_ops <= 0) { + view.prompt = 'Place SPs: done.' + if (!game.vm_event_to_do) { + gen_action("end_round") + } else { + gen_action('done') + } + } else { - view.prompt = `Add SPs: ${game.available_ops} remaining.` + view.prompt = `Add SPs: ${game.available_ops} remaining.` - // Generate actions for valid spaces - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + // Generate actions for valid spaces + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } } }, infl(space) { add_infl(space) }, - done() { + end_round() { + push_undo() if (game.summary.length > 0) { pop_summary() log_br() } - - if(game.vm_event_to_do) { - reset_austria_hungary_border_reopened() - game.state = 'resolve_opponent_event'} - else { - //end_round() - game.state = 'end_round' + end_round() + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() } + reset_austria_hungary_border_reopened() + game.state = 'resolve_opponent_event' } } @@ -855,19 +858,21 @@ states.tiananmen_square_attempt_success = { prompt () { if (game.vm_event > 200) { view.prompt = 'Tiananmen Square Track attempt successful. Go to TST Award.' + gen_action('done') } else { view.prompt = 'Tiananmen Square Track attempt successful.' + gen_action('end_round') } - gen_action('done') + }, done () { push_undo() - if (game.vm_event > 200) { - console.log('going to tst award, game.return_state', game.return_state) - goto_vm(game.vm_event) - } else { - game.state = 'tiananmen_square_attempt_done' - } + console.log('going to tst award, game.return_state', game.return_state) + goto_vm(game.vm_event) + }, + end_round () { + push_undo() + end_round() } } @@ -875,18 +880,19 @@ states.tiananmen_square_attempt_fail = { inactive: 'do Tiananmen Square Attempt.', prompt () { view.prompt = 'Tiananmen Square Track attempt failed.' - gen_action('done') + gen_action('end_round') }, - done () { + end_round () { push_undo() - game.state = 'tiananmen_square_attempt_done' + end_round() + //game.state = 'tiananmen_square_attempt_done' } } states.tiananmen_square_attempt_done = { inactive: 'do Tiananmen Square Attempt.', prompt () { - view.prompt = 'Tiananmen Square Track attempt: done. End the Action Round.' + view.prompt = 'Tiananmen Square Track attempt: done.' gen_action('done') }, done () { @@ -984,12 +990,15 @@ states.tst_goddess_draw = { states.support_check_prep = { inactive: 'do support checks', prompt () { - if (game.available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('done') - //return - } - if (game.available_ops > 0) { + if (game.available_ops === 0) { /*Needs another check for Support Checks done during Crowd Turns against Ceausescu*/ + if (!game.vm_event_to_do) { + view.prompt = 'Support checks: done.' + gen_action('end_round') + } else { + view.prompt = 'Support checks: done.' + gen_action('done') + } + } else if (game.available_ops > 0) { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { @@ -1016,7 +1025,12 @@ states.support_check_prep = { console.log('game.state after space selected:', game.state) //} }, - done () { + end_round() { + push_undo() + end_round() + }, + done() { + push_undo() if (game.is_pwr_struggle) {/*Crowd Turns Against Ceausescu should be the only time you end up here during a power struggle */ if (game.return !== game.active) { next_player() @@ -1024,14 +1038,8 @@ states.support_check_prep = { game.state = 'raise_stakes_1' return } - - if (game.vm_event_to_do) { - reset_austria_hungary_border_reopened() - game.state = 'resolve_opponent_event' - } else { - //end_round() - game.state = 'end_round' - } + reset_austria_hungary_border_reopened() + game.state = 'resolve_opponent_event' } } @@ -1077,6 +1085,7 @@ states.end_round = { gen_action('end_round') }, end_round() { + push_undo() end_round() } } @@ -1086,7 +1095,7 @@ states.end_round = { states.draw_power_cards = { inactive: 'draw cards.', prompt() { - view.prompt = 'Draw cards.' + view.prompt = `${clean_name(cards[this_card()].name)}: draw cards.` gen_action('draw') }, draw() { @@ -1248,6 +1257,11 @@ states.raise_stakes_1 = { prompt () { console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + view.prompt = 'Raise the stakes: you must pass.' + gen_action('pass') + return + } if (game.raised_stakes_discard === 3) { view.prompt = 'Raise the stakes: done.' gen_action('done') @@ -1297,7 +1311,11 @@ states.raise_stakes_2 = { inactive: 'raise the stakes', prompt () { - + if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + view.prompt = 'Raise the stakes: you must pass.' + gen_action('pass') + return + } if (game.raised_stakes_discard === 3) { view.prompt = 'Raise the stakes: done.' gen_action('done') @@ -1616,16 +1634,16 @@ states.support_loss ={ } states.vp_roll = { - inactive: 'do VP Roll', + inactive: 'do VP Roll.', prompt () { if (game.phase === 0) { - view.prompt = 'Roll a die for Victory.' + view.prompt = `${clean_name(cards[this_card()].name)}: roll a die for Victory.` gen_action('roll') } else if (game.phase === 1) { - view.prompt = 'Take power.' + view.prompt = `${clean_name(cards[this_card()].name)}: take power.` gen_action('take') } else if (game.phase === 2) { - view.prompt = 'Proceed to scoring.' + view.prompt = `${clean_name(cards[this_card()].name)}: proceed to scoring.` gen_action('scoring') } }, @@ -1781,8 +1799,8 @@ states.finish_scoring ={ return } reset_power() - //end_round() - game.state = 'end_round' + end_round() + //game.state = 'end_round' } } @@ -2094,33 +2112,45 @@ states.stasi_end_round = { inactive: 'choose next card due to Stasi.', prompt() { console.log('game.stasi_card', game.stasi_card) - if (!game.stasi_card || game.stasi_card === 0 ) { - let available_cards = game.democrat_hand - if (available_cards.length === 0) { - view.prompt = 'Stasi: no cards remaining.' - gen_action('pass') - return - } - view.prompt = 'Stasi: you must select your next card to play.' - - for (let card of available_cards) { - gen_action_card(card) - } - } else { - view.prompt = 'Stasi. Choose card: done.' - gen_action('done') + let available_cards = game.democrat_hand + if (available_cards.length === 0) { + view.prompt = 'Stasi: no cards remaining.' + gen_action('pass') + return } + view.prompt = 'Stasi: you must select your next card to play.' + + for (let card of available_cards) { + gen_action_card(card) + } }, card(card) { push_undo() log_gap(`Stasi: selected C${cards[card].number}`) game.stasi_card = card + game.state = 'stasi_finish' }, pass() { log('Stasi: Democrat has no remaining cards') game.stasi_card = 0 end_stasi_choose_card() }, + end_round() { + push_undo() + if (game.stasi_card === 21) { + game.state = 'stasi_confirm' + } else { + end_stasi_choose_card() + } + } +} + +states.stasi_finish = { + inactive: 'choose next card due to Stasi.', + prompt() { + view.prompt = 'Stasi. Choose card: done.' + gen_action('done') + }, done() { push_undo() if (game.stasi_card === 21) { @@ -2154,7 +2184,7 @@ states.stasi_play_card = { gen_action("done"); return;*/ //} else - if (game.stasi_card === 0) { + if (game.democrat_hand.length === 0) { view.prompt = 'Stasi: you must pass.' gen_action('pass') } else { @@ -2174,7 +2204,6 @@ states.stasi_play_card = { game.democrat_hand.splice(find_card, 1); game.available_ops = get_card_ops(card) - game.stasi_card = 0 if (game.democrat_hand.includes(21) && cards[card].side === "C") { game.state = 'stasi_resolve_common_european_home' } else { @@ -2734,17 +2763,17 @@ function count_adj(id) { //console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) if (adj_piece && adj_piece.space_id !== space.space_id) { if (check_dem_control(adj_piece.space_id)) { - console.log('added DEM space', spaces[adj_piece.space_id].name) + //console.log('added DEM space', spaces[adj_piece.space_id].name) dem_adj++ } if (check_com_control(adj_piece.space_id)) { - console.log('added COM space', spaces[adj_piece.space_id].name) + //console.log('added COM space', spaces[adj_piece.space_id].name) com_adj++ } } } } - console.log('dem_adj: ', dem_adj, 'com_adj: ', com_adj) + //console.log('dem_adj: ', dem_adj, 'com_adj: ', com_adj) return {dem_adj, com_adj} } @@ -3151,6 +3180,15 @@ function get_value(country) { return value } +function get_end_infl_prompt() { + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` + if (!game.vm_infl_to_do) { + gen_action('end_round') + } else { + gen_action('done') + } +} + function permanently_remove(card) { console.log('permanently removing card:', card) if (game.strategy_removed.includes(card)) {return} @@ -3283,6 +3321,7 @@ function get_events(card){ } function event_is_playable(card) { + console.log('game.stasi_card', game.stasi_card, 'card', card) //Reformer never playable here if (card === 67) { return false @@ -3405,6 +3444,36 @@ function get_tst_6_ops() { return ops } +function finish_the_wall() { + if (game.the_wall_must_go['dem_wins'] === 2) { + game.persistent_events.push(86) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (space.country === 'East_Germany' && game.comInfl[i] > 0){ + game.valid_spaces.push(space.space_id) + } + } + if (!game.vm_infl_to_do) { + if (game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + if (game.active === DEM) {next_player()} + vm_next () + } else { + permanently_remove(86) + delete game.the_wall_must_go + vm_return() + } +} + // =========== MOVING THROUGH TURNS ============ @@ -4388,18 +4457,25 @@ function vm_return() { //Check if end event state is needed if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { vm_end_event() - } else { - if (!game.vm_infl_to_do) { + } + //Check if auto-resolve opponent event + else if (auto_resolve_events.includes(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { + vm_end_event() + } + else { + + game.state = 'vm_end_event' + /*if (!game.vm_infl_to_do) { /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { game.state = 'vm_end_event' - } else {*/ + } else { game.state = 'vm_end_event' - + //end_round() //} } else { console.log('vm_infl_to_do true') vm_end_event() - } + }*/ } } @@ -5972,14 +6048,21 @@ states.vm_end_event = { }, prompt () { console.log('in vm_end_event') - view.prompt = `${clean_name(cards[this_card()].name)}: done. End the Action Round.` - gen_action('end_round') + view.prompt = `${clean_name(cards[this_card()].name)}: done.` + if (game.vm_infl_to_do) { + gen_action('done') + } else { + gen_action('end_round') + } + }, + done() { + push_undo() + vm_end_event() }, - end_round(){ + end_round() { console.log('end round clicked - vm_end_event called') - if (!game.vm_infl_to_do) { - game.return_state = '' - } + push_undo() + game.return_state = '' vm_end_event() } } @@ -6000,15 +6083,27 @@ states.vm_take_control = { } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Take control: done.` - gen_action('done') + if (game.vm_infl_to_do) { + gen_action('done') + } else { + gen_action('end_round') + } } }, infl(space) { push_undo() vm_take_control(space) game.vm_available_ops-- + if (game.vm_available_ops === 0) { + vm_next() + } }, done() { + push_undo() + vm_next() + }, + end_round() { + push_undo() vm_next() } } @@ -6028,14 +6123,20 @@ states.vm_add_infl = { gen_action_infl(space_id) } } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') + get_end_infl_prompt() } }, infl(space) { vm_do_add_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() } }, done () { @@ -6045,6 +6146,16 @@ states.vm_add_infl = { log_br() } + game.vm_event_done = true + vm_next() + }, + end_round() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + game.vm_event_done = true vm_next() } @@ -6058,22 +6169,27 @@ states.vm_add_infl_free = { if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { 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 ) { + } else if (game.vm_available_ops > 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') + get_end_infl_prompt() } }, infl(space) { vm_do_add_infl_free(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() } }, done () { @@ -6085,6 +6201,16 @@ states.vm_add_infl_free = { log_br() } vm_next() + }, + end_round () { + push_undo() + game.valid_spaces = [] + game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() } } @@ -6100,25 +6226,32 @@ states.vm_add_x_infl = { for (let space_id of game.valid_spaces) { gen_action_infl(space_id) } - } else { + } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') - } + }*/ }, infl(space) { push_undo() vm_do_add_x_infl(space) - if (game.vm_event === 105) { + if (game.vm_available_ops === 0) { + game.vm_event_done = true vm_next() } + /*if (game.vm_event === (105 || 68) { + vm_next() + return + } */ + + //game.vm_event_done = true //vm_next() - }, - done () { + } + /*done () { push_undo() game.vm_event_done = true vm_next() - } + }*/ } states.vm_add_limited_infl = { @@ -6136,18 +6269,24 @@ states.vm_add_limited_infl = { for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } - } else { + } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') - } + }*/ }, infl(space) { vm_do_add_limited_infl(space, game.vm_max_infl) - if (game.vm_available_ops === 0) { + if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + game.vm_event_done = true + vm_next() } }, - done () { + /*done () { push_undo() if (game.summary.length > 0) { pop_summary() @@ -6155,23 +6294,30 @@ states.vm_add_limited_infl = { } game.vm_event_done = true vm_next() - } + }*/ } states.vm_remove_infl = { inactive: 'remove Support Points.', prompt () { // Keep this so that there is an undo option in, e.g., Scare Tactics + console.log('in vm_remove infl, vm_infl_to_do', game.vm_infl_to_do) if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` gen_action('done') return } - if (game.vm_available_ops === 0 ) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } + /*if (game.vm_available_ops === 0 ) { + if (game.vm_infl_to_do) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + }*/ if (game.remove_opponent_infl) { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` } @@ -6186,9 +6332,14 @@ states.vm_remove_infl = { push_undo() vm_do_remove_infl(space) game.vm_active_country = spaces[space].country - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { + + if (game.vm_available_ops === 0 ) { vm_next() - }*/ + if (game.summary.length > 0) { + pop_summary() + log_br() + } + } }, done() { if (game.summary.length > 0) { @@ -6215,14 +6366,26 @@ states.vm_remove_x_infl = { for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - } + } /*else { + if (game.vm_infl_to_do) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` + gen_action('done') + return + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + }*/ }, infl(space) { vm_do_remove_x_infl(space) - if (game.vm_event === 68) { + /*if (game.vm_event === 68) { + vm_next() + return + }*/ + if (game.vm_available_ops === 0) { + game.vm_event_done = true vm_next() } /*game.vm_event_done = true @@ -6246,16 +6409,28 @@ states.vm_remove_limited_infl = { } 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') - } + } /*else { + if (game.vm_infl_to_do) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` + gen_action('done') + return + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + }*/ }, infl(space) { vm_do_remove_limited_infl(space, game.vm_max_infl) - /*if (game.vm_available_ops === 0) { + if (game.vm_available_ops === 0) { game.vm_event_done = true - } */ + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } }, done () { game.vm_event_done = true @@ -6278,19 +6453,20 @@ states.vm_remove_all_infl = { for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } - } else { + } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` gen_action('done') - } + }*/ }, infl(space) { vm_do_remove_all_infl(space) game.vm_active_country = spaces[space].country - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { + if (game.vm_available_ops === 0) { vm_next() - }*/ + } }, done() { + push_undo() vm_next() } } @@ -6299,16 +6475,17 @@ states.vm_support_check_prep = { inactive: 'do support checks.', prompt () { console.log('in states.vm_support_check_prep, game.vm_available_ops: ', game.vm_available_ops) - if (game.vm_available_ops === 0) { + /*if (game.vm_available_ops === 0) { view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` gen_action('done') - } else if (game.valid_spaces.length === 0) { + } else */ + if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') } else { - if (game.vm_available_ops > 0) { + //if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` - } + //} for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_sc(space_id); @@ -6350,11 +6527,11 @@ states.vm_support_check_prep = { states.vm_ceh_support_check_prep = { inactive: 'do support checks.', prompt () { - if (game.vm_available_ops === 0) { + /*if (game.vm_available_ops === 0) { view.prompt = 'Support checks: done.' gen_action('done') - //return - } + return + }*/ if (game.vm_available_ops > 0) { view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` @@ -6381,9 +6558,9 @@ states.vm_ceh_support_check_prep = { } game.state = 'vm_ceh_do_support_check' }, - done () { + /*done () { vm_next () - } + }*/ } @@ -6400,9 +6577,11 @@ states.vm_ceh_do_support_check = { game.vm_available_ops-- if (game.vm_available_ops === 0) { game.valid_spaces = [] + vm_next() + } else { + game.state = 'vm_ceh_support_check_prep' + return } - game.state = 'vm_ceh_support_check_prep' - return } } @@ -6425,10 +6604,10 @@ states.vm_austria_hungary_border_reopened_check = { states.vm_1_support_check_prep = { inactive: 'do support checks.', prompt () { - if (game.vm_available_ops === 0) { + /*if (game.vm_available_ops === 0) { view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` gen_action('done') - } else if (game.valid_spaces.length === 0) { + } else */if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') } else { @@ -6462,32 +6641,36 @@ states.vm_do_support_check = { clear_undo() do_sc(game.selected_space) game.vm_available_ops-- + console.log('game.vm_available_ops', game.vm_available_ops) if (game.vm_available_ops === 0) { game.valid_spaces = [] + vm_next() + return + } else { + game.state = 'vm_support_check_prep' + return } - game.state = 'vm_support_check_prep' - return } } states.vm_tiananmen_square_attempt = { inactive: 'do Tiananmen Square', prompt () { - if (game.active === DEM && game.dem_tst_attempted_this_turn > 0 || game.active === COM && game.com_tst_attempted_this_turn > 0) { + /*if (game.active === DEM && game.dem_tst_attempted_this_turn > 0 || game.active === COM && game.com_tst_attempted_this_turn > 0) { view.prompt = 'Tiananmen Square Track attempt: done.' gen_action('done') return - } - view.prompt = 'Roll a die' + }*/ + view.prompt = 'Tiananmen Square: roll a die' gen_action('roll') }, roll() { clear_undo() do_tst_attempt () }, - done () { + /*done () { vm_next() - } + }*/ } //================================== EVENT SPECIFIC STATES ====================================== @@ -6579,30 +6762,35 @@ states.vm_central_committee_reshuffle = { if (!game.revolutions[5]) {gen_action('romania')} }, east_germany() { + push_undo() game.vm_active_country = "East_Germany" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [1,2,3,4,5,6,7,8,9,10,11,12] vm_next() }, poland() { + push_undo() game.vm_active_country = "Poland" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [13,14,15,16,17,18,19,20,21,22,23,24,25,26] vm_next() }, czechoslovakia() { + push_undo() game.vm_active_country = "Czechoslovakia" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [27,28,29,30,31,32,33,34,35,36,37] vm_next() }, hungary() { + push_undo() game.vm_active_country = "Hungary" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [38,39,40,41,42,43,44,45,46,47,48,49] vm_next() }, romania() { + push_undo() game.vm_active_country = "Romania" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [50,51,52,53,54,55,56,57,58,59,60,61,62,63] @@ -6610,6 +6798,7 @@ states.vm_central_committee_reshuffle = { vm_next() }, bulgaria () { + push_undo() game.vm_active_country = "Bulgaria" log(`Chose ${country_name(game.vm_active_country)}`) game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] @@ -6670,6 +6859,7 @@ states.vm_common_european_home_play = { valid_spaces_sc() }, tst() { + push_undo() game.state = 'vm_tiananmen_square_attempt' } } @@ -6727,10 +6917,10 @@ states.vm_play_event_from_discard = { gen_action('pass') gen_action_card(card) } - } else { + } /*else { view.prompt = 'Choose a card: done.' gen_action('done') - } + }*/ }, card(card) { push_undo() @@ -6752,10 +6942,11 @@ states.vm_play_event_from_discard = { } vm_next() }, - done(){ +/* done(){ + push_undo() game.discard = false vm_next() - } + }*/ } states.vm_deutsche_marks_prep = { @@ -6781,6 +6972,7 @@ states.vm_deutsche_marks_prep = { game.vm_event = card }, pass() { + push_undo() vm_next() } } @@ -6815,6 +7007,7 @@ states.vm_deutsche_marks = { } }, event() { + push_undo() log(`Played C${cards[game.vm_event].number} for the event`) console.log('game.active', game.active) if (!game.vm_infl_to_do) { @@ -6888,19 +7081,20 @@ states.vm_exit_visas_finish = { if (game.temp > 0 ) { view.prompt = 'Exit Visas: draw replacement cards.' gen_action('draw') - } else { + } /*else { view.prompt = 'Exit Visas. Draw cards: done.' gen_action('done') - } + } */ }, draw() { clear_undo() draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length + game.temp, game.communist_hand.length) game.temp = 0 + vm_next() }, - done() { + /*done() { vm_next() - } + }*/ } states.vm_foreign_currency_debt_burden = { @@ -6974,6 +7168,7 @@ states.vm_goodbye_lenin = { goto_vm(card) }, ops() { + push_undo() if (game.valid_cards.length === 0) { logi('No red events') } @@ -7018,6 +7213,7 @@ states.vm_goodbye_lenin_ops = { valid_spaces_sc() }, tst() { + push_undo() game.state = 'vm_tiananmen_square_attempt' } } @@ -7036,10 +7232,10 @@ states.vm_honecker = { gen_action_card(card) gen_action('pass') } - } else { + } /*else { view.prompt = 'Honecker. Choose a card: done.' gen_action('done') - } + }*/ }, card(card) { push_undo() @@ -7050,18 +7246,20 @@ states.vm_honecker = { game.strategy_discard.splice(card_index, 1) game.communist_hand.push(card) console.log('removed after honecker', game.strategy_removed) + vm_next() }, pass(){ log('Did not take a card') + game.discard = false vm_next() }, - done(){ + /*done(){ if (game.temp === 0) { log('Did not take a card') } game.discard = false vm_next() - } + } */ } @@ -7071,7 +7269,7 @@ states.vm_inflationary_currency = { }, prompt() { console.log('game.revolutions', game.revolutions, 'length', game.revolutions.length) - if (game.revolutions.every(n => n === false)) { + if ((game.active === COM && game.revolutions.every(n => n === false)) || (game.active === DEM && game.revolutions.every(n => n === true))) { view.prompt = 'Inflationary Currency: no countries to choose.' gen_action('pass') } else { @@ -7158,8 +7356,10 @@ states.vm_inflationary_currency_discard = { push_undo() discard(card) game.temp = card + }, pass() { + push_undo() log('Did not discard') next_player() game.vm_available_ops = 1 @@ -7319,6 +7519,7 @@ states.vm_kremlin_coup_take_control = { } }, infl(space) { + push_undo() vm_take_control(space) if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } if (game.vm_active_country === 'Poland') {game.selected_space = 17} @@ -7329,6 +7530,7 @@ states.vm_kremlin_coup_take_control = { game.state = 'vm_kremlin_coup_sc_prep' }, done() { + push_undo() if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } if (game.vm_active_country === 'Poland') {game.selected_space = 17} if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} @@ -7349,6 +7551,7 @@ states.vm_kremlin_coup_sc_prep = { }, sc(space) { //game.selected_space = space + push_undo() game.state = 'vm_kremlin_coup_sc' } } @@ -7365,11 +7568,12 @@ states.vm_kremlin_coup_sc = { if (game.temp.length > 0 ){ game.state = 'vm_kremlin_coup_choose_country' } else { - game.state = 'vm_kremlin_coup_end' + //game.state = 'vm_kremlin_coup_end' + vm_next() } } } - +/* states.vm_kremlin_coup_end = { get inactive() { return `resolve ${clean_name(cards[this_card()].name)}.` @@ -7382,7 +7586,7 @@ states.vm_kremlin_coup_end = { vm_next() } } - +*/ states.vm_laszlo_tokes = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -7582,6 +7786,7 @@ states.vm_new_years_eve_party = { vm_next() }, continue() { + push_undo() log('Chooses to continue') permanently_remove(104) vm_next() @@ -7630,8 +7835,8 @@ states.vm_nomenklatura_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - view.prompt = 'Nomenklatura. Remove SPs: done.' + if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { + view.prompt = 'Nomenklatura. No SPs to remove: done.' gen_action('done') } else { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' @@ -7644,9 +7849,9 @@ states.vm_nomenklatura_remove = { infl(space) { push_undo() vm_do_remove_all_infl(space) - /*if (game.vm_available_ops === 0) { + if (game.valid_spaces.length === 0) { vm_next() - }*/ + } }, done() { vm_next() @@ -7658,29 +7863,36 @@ states.vm_nomenklatura_add = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { + /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { view.prompt = 'Nomenklatura. Add SPs: done.' gen_action('done') - } else { + } else { */ view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.` for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } - } + //} }, infl(space) { push_undo() vm_do_add_infl_free(space) - if (game.vm_available_ops === 0 ) {game.valid_spaces = []} + if (game.vm_available_ops === 0 ) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } }, - done() { +/* done() { push_undo() if (game.summary.length > 0) { pop_summary() log_br() } vm_next() - } + }*/ } states.vm_samizdat = { @@ -7702,6 +7914,7 @@ states.vm_samizdat = { game.state = 'vm_samizdat_finish' }, pass() { + push_undo() //if (game.samizdat_card > 0) {game.state = 'vm_samizdat_finish'} /*else { */ log('Did not set aside a card') @@ -7747,10 +7960,11 @@ states.vm_shock_therapy = { if (game.revolutions[3]) {gen_action('bulgaria')} if (game.revolutions[4]) {gen_action('czechoslovakia')} if (game.revolutions[5]) {gen_action('romania')} - } else if (game.phase === 2) { + } /*else if (game.phase === 2) { view.prompt = 'Shock Therapy: done.' gen_action('done') - } else { + } */ + else { view.prompt = 'Shock Therapy: roll a die.' gen_action('roll') } @@ -7802,13 +8016,15 @@ states.vm_shock_therapy = { vm_next() } else { log('C93 is unsuccessful. Required 3 or more') - game.phase++ + //game.phase++ + permanently_remove(93) + vm_return() } }, - done() { + /*done() { permanently_remove(93) vm_return() - } + }*/ } states.vm_social_democratic_platform_adopted = { @@ -7968,6 +8184,7 @@ states.vm_the_chinese_solution = { vm_next() }, pass() { + push_undo() permanently_remove(96) vm_return() } @@ -7978,16 +8195,16 @@ states.vm_the_tyrant_is_gone = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (!game.the_tyrant_is_gone) { + //if (!game.the_tyrant_is_gone) { view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_infl(space_id); } - } else { + /* } else { view.prompt = 'Select a space: done.' gen_action('done') - } + }*/ }, infl(space) { push_undo() @@ -7995,10 +8212,11 @@ states.vm_the_tyrant_is_gone = { game.the_tyrant_is_gone = space game.valid_spaces = [] game.persistent_events.push(97) + vm_next() }, - done () { + /*done () { vm_next() - } + }*/ } states.vm_tyrant_block ={ @@ -8021,13 +8239,13 @@ states.vm_the_wall_must_go = { 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) { + /*if (game.the_wall_must_go['dem_wins'] === 2 || game.the_wall_must_go['com_wins'] === 2) { view.prompt = '"The Wall Must Go!" Rolls: done.' gen_action('done') - } else { + } else { */ view.prompt = ('The Wall Must Go! Roll a die.') gen_action('roll') - } + //} }, roll() { clear_undo() @@ -8071,10 +8289,12 @@ states.vm_the_wall_must_go = { } if (game.the_wall_must_go['dem_wins'] === 2) { log('The Democrat wins C86') + finish_the_wall() return } if (game.the_wall_must_go['com_wins'] === 2) { log('The Communist wins C86') + finish_the_wall() return } if (game.the_wall_must_go['dem_roll'] === 0 || game.the_wall_must_go['com_roll'] === 0) { @@ -8084,7 +8304,7 @@ states.vm_the_wall_must_go = { game.the_wall_must_go['com_roll'] = 0 } }, - done() { + /*done() { if (game.the_wall_must_go['dem_wins'] === 2) { game.persistent_events.push(86) log('+3 VP') @@ -8112,7 +8332,7 @@ states.vm_the_wall_must_go = { delete game.the_wall_must_go vm_return() } - } + }*/ } states.vm_warsaw_pact_summit = { @@ -8193,14 +8413,13 @@ states.vm_we_are_the_people_add = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (!game.vm_influence_added[6]) { + /* if (!game.vm_influence_added[6]) { view.prompt = '"We are the People!" Add SPs: done.' gen_action('done') return - } + }*/ view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` - gen_action('done') for (let space_id of game.valid_spaces) { gen_action_infl(space_id); } @@ -8208,16 +8427,23 @@ states.vm_we_are_the_people_add = { infl(space) { vm_do_add_infl_free(space) game.vm_influence_added[6]-- - if (game.vm_influence_added[6] === 0 ) {game.valid_spaces = []} + if (game.vm_influence_added[6] === 0 ) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } }, - done() { + /*done() { push_undo() if (game.summary.length > 0) { pop_summary() log_br() } vm_next() - } + }*/ } states.vm_workers_revolt = { @@ -8240,6 +8466,7 @@ states.vm_workers_revolt = { vm_next() }, infl(space) { + push_undo() game.selected_space = space log(`Chose %${game.selected_space}`) game.state = 'vm_workers_revolt_finish' @@ -8252,13 +8479,13 @@ states.vm_workers_revolt_finish = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.selected_space > 0) { + //if (game.selected_space > 0) { view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') - } else { + /* } else { view.prompt = 'Workers Revolt: done.' gen_action('done') - } + }*/ }, roll() { @@ -8279,10 +8506,11 @@ states.vm_workers_revolt_finish = { vm_replace_all_infl(game.temp) } else {log('Workers Revolt fails. Required 4 or more')} game.selected_space = 0 + vm_next() }, - done() { + /*done() { vm_next() - } + }*/ } // ==================== TIANANMEN SQUARE TRACK STATES ===================== @@ -8318,10 +8546,10 @@ states.vm_tst_3 = { for (let card of game.valid_cards) { gen_action_card(card) } - } else { + } /*else { view.prompt = 'Discard cards: done.' gen_action('done') - } + }*/ }, card(card) { push_undo() @@ -8329,11 +8557,12 @@ states.vm_tst_3 = { game.temp ++ if (game.temp === 2) { game.valid_cards = [] + vm_next() } }, - done() { + /*done() { vm_next() - } + }*/ } states.vm_tst_4 = { @@ -8352,6 +8581,13 @@ states.vm_tst_4 = { }, infl(space) { vm_do_remove_infl(space) + if (game.vm_available_ops === 0) { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } }, done() { if (game.summary.length > 0) { @@ -8365,18 +8601,18 @@ states.vm_tst_4 = { states.vm_tst_6 = { inactive: 'make their free support check.', prompt() { - if (game.vm_available_ops === 0) { + /* if (game.vm_available_ops === 0) { view.prompt = 'Tiananmen Square Track award support check: done.' gen_action('done') return - } else { + } else {*/ view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' for (let space_id of game.valid_spaces) { if (space_id) { gen_action_sc(space_id); } } - } + //} }, sc(space) { push_undo() @@ -8386,10 +8622,10 @@ states.vm_tst_6 = { } game.state = 'vm_tst_6_sc' }, - done () { + /*done () { push_undo() vm_next() - } + }*/ } states.vm_tst_6_sc = { @@ -8403,7 +8639,8 @@ states.vm_tst_6_sc = { do_sc(game.selected_space) game.vm_available_ops-- game.valid_spaces = [] - game.state = 'vm_tst_6' + vm_next() + //game.state = 'vm_tst_6' return } } @@ -8425,7 +8662,7 @@ states.vm_tst_8 = { gen_action('event') } else if (!game.vm_event_to_do && !game.vm_infl_to_do) { - view.prompt = 'Event and operations: done. End the Action Round' + view.prompt = 'Event and operations: done.' gen_action('end_round') } }, @@ -8445,6 +8682,7 @@ states.vm_tst_8 = { goto_vm(208) }, end_round() { + push_undo() game.tst_8 = true end_round() } @@ -8477,6 +8715,7 @@ states.vm_tst_8_ops = { game.state = 'vm_support_check_prep' }, tst() { + push_undo() game.state = 'vm_tiananmen_square_attempt' } } -- cgit v1.2.3 From b8fd0a468328c0706d24e5a2250594dcae53d5f0 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 17 Oct 2024 22:32:38 +0100 Subject: Updates to flow --- rules.js | 233 ++++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 157 insertions(+), 76 deletions(-) diff --git a/rules.js b/rules.js index c3a603b..6ea9327 100644 --- a/rules.js +++ b/rules.js @@ -619,6 +619,7 @@ states.play_card ={ game.vm_event_to_do = true game.vm_infl_to_do = true game.tst_8 = true + log(`Played C${game.played_card} for event and operations`) game.state = 'vm_tst_8' }, end_round () { @@ -893,9 +894,9 @@ states.tiananmen_square_attempt_done = { inactive: 'do Tiananmen Square Attempt.', prompt () { view.prompt = 'Tiananmen Square Track attempt: done.' - gen_action('done') + gen_action('end_round') }, - done () { + end_round () { end_round() //game.state = 'end_round' } @@ -991,7 +992,10 @@ states.support_check_prep = { inactive: 'do support checks', prompt () { if (game.available_ops === 0) { /*Needs another check for Support Checks done during Crowd Turns against Ceausescu*/ - if (!game.vm_event_to_do) { + if (game.is_pwr_struggle) { + view.prompt = 'The Crowd Turns Against Ceausescu. Support checks: done.' + gen_action('done') + } else if (!game.vm_event_to_do) { view.prompt = 'Support checks: done.' gen_action('end_round') } else { @@ -1153,7 +1157,12 @@ states.draw_power_cards = { game.is_pwr_struggle = true console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) - game.valid_cards = all_power_cards + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } + //game.valid_cards = all_power_cards log(`Communist: ${game.com_pwr_hand.length} cards`) log(`Democrat: ${game.dem_pwr_hand.length} cards`) @@ -1253,16 +1262,16 @@ states.the_crowd_turns_against_ceausescu_infl = { } states.raise_stakes_1 = { - inactive: 'raise the stakes', + inactive: 'raise the stakes.', prompt () { + console.log('raise stakes 1 - valid cards', game.valid_cards) console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') - return } - if (game.raised_stakes_discard === 3) { + else if (game.raised_stakes_discard === 3) { view.prompt = 'Raise the stakes: done.' gen_action('done') } else { @@ -1289,26 +1298,35 @@ states.raise_stakes_1 = { game.raised_stakes++ game.valid_cards = [] } - - }, pass(){ log('Did not raise the stakes') game.raised_stakes_discard = 0 next_player() + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } game.state = 'raise_stakes_2' }, done () { log_gap('Raised the stakes') game.raised_stakes_discard = 0 next_player() - game.valid_cards = [...all_power_cards] + console.log('game.active', game.active) + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } + console.log('game.valid_cards', game.valid_cards) game.state = 'raise_stakes_2' } } states.raise_stakes_2 = { - inactive: 'raise the stakes', + inactive: 'raise the stakes.', prompt () { if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { @@ -1484,6 +1502,7 @@ states.power_struggle = { }, concede () { push_undo() + game.valid_cards = [] log('Conceded') log_h2('Aftermath') log_h3('Support Loss') @@ -1739,6 +1758,9 @@ states.choose_power = { //Check if The Tyrant is Gone occurs if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { game.return_state = 'finish_scoring' + if (game.active !== DEM) { + next_player() + } game.state = 'the_tyrant_is_gone' } else { game.state = 'finish_scoring' @@ -1840,6 +1862,9 @@ states.end_turn_4_5_4 = { log(`Communist receives 2 VP from C97`) } game.persistent_events.push(111) + if (game.active !== DEM) { + next_player() + } game.state = 'new_years_eve_party' } else if(game.turn === 10) { @@ -1892,10 +1917,10 @@ states.final_scoring = { inactive: 'score countries.', prompt() { if (game.temp['East_Germany'] && game.temp['Poland'] && game.temp['Czechoslovakia'] && game.temp['Hungary'] && game.temp['Romania'] && game.temp['Bulgaria']) { - view.prompt = 'Country scoring: done.' - gen_action('done') + view.prompt = 'Final scoring: done.' + gen_action('end') } else { - view.prompt = 'Choose a country to score' + view.prompt = 'Choose a country to score:' if (!game.temp['East_Germany']) {gen_action('east_germany')} if (!game.temp['Poland']) {gen_action('poland')} if (!game.temp['Czechoslovakia']) {gen_action('czechoslovakia')} @@ -1928,7 +1953,7 @@ states.final_scoring = { score_country('Bulgaria') game.temp['Bulgaria'] = true }, - done() { + end() { delete game.temp if (game.vp > 0) { goto_game_over(DEM, `${DEM} wins on Victory Point Track!`) @@ -1960,10 +1985,10 @@ states.general_strike = { for (let card of available_cards) { gen_action_card(card) } - } else if (game.phase >= 1) { + } /*else if (game.phase >= 1) { view.prompt = 'General Strike: done.' gen_action('done') - } else if (game.played_card > 0 ) { + } */ else if (game.played_card > 0 ) { view.prompt = 'General Strike: roll a die.' gen_action('roll') } @@ -2001,12 +2026,13 @@ states.general_strike = { } else { log('The strike continues. Required 6 or more') } - game.phase = 1 - }, + //game.phase = 1 + game.state = 'end_round' + }, /* done () { //end_round() game.state = 'end_round' - } + }*/ } states.honecker ={ @@ -2090,20 +2116,20 @@ states.new_years_eve_party = { push_undo() log('No final power struggle') if (game.vp > 0) { - goto_game_over(DEM, `C104: ${DEM} wins on Victory Point Track!`) + goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) } else if (game.vp < 0) { - goto_game_over(COM, `C104: ${COM} wins on Victory Point Track!`) + goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) } else if (game.vp === 0) { - goto_game_over('', `C104: The game is tied!`) /*Not sure what to pass for result */ + goto_game_over('', `New Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ } }, end() { if (game.vp > 0) { - goto_game_over(DEM, `C104: ${DEM} wins on Victory Point Track!`) + goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) } else if (game.vp < 0) { - goto_game_over(COM, `C104: ${COM} wins on Victory Point Track!`) + goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) } else if (game.vp === 0) { - goto_game_over('', `C104: The game is tied!`) /*Not sure what to pass for result */ + goto_game_over('', `CNew Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ } } } @@ -2264,7 +2290,7 @@ function add_infl(space) { } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { + if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { game.available_ops-- log_summary(`(-1 op due to C63)`) } else if (check_opp_control(space)) { @@ -3192,7 +3218,7 @@ function get_end_infl_prompt() { function permanently_remove(card) { console.log('permanently removing card:', card) if (game.strategy_removed.includes(card)) {return} - log_msg_gap(`C${cards[card].number} permanently removed`) + //log_msg_gap(`C${cards[card].number} permanently removed`) remove_from_discard(card) card_index = game.table_cards.indexOf(card) @@ -4942,7 +4968,11 @@ function vm_remove_infl() { function vm_remove_opp_infl() { game.vm_available_ops = vm_operand(1) game.remove_opponent_infl = true - game.state = 'vm_remove_infl' + if (game.is_pwr_struggle) { + game.state = 'vm_scare_tactics' + } else { + game.state = 'vm_remove_infl' + } } function vm_remove_x_opp_infl() { @@ -5337,13 +5367,17 @@ function vm_eliminate(space_id) { //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 - game.demInfl[space_id] = 0 - game.comInfl[61] += game.comInfl[space_id] - if (game.comInfl[space_id] > 0 ) { - log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) + if (space_id === 61) { + game.demInfl[space_id] = 0 + game.comInfl[space_id] = 0 + } else { + game.demInfl[space_id] = 0 + game.comInfl[61] += game.comInfl[space_id] + if (game.comInfl[space_id] > 0 ) { + log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) + } + game.comInfl[space_id] = 0 } - game.comInfl[space_id] = 0 - //Update control in the eliminated space and in Bucuresti check_control_change(space_id) check_control_change(61) @@ -5550,6 +5584,7 @@ function vm_kohl_proposes_reunification() { function vm_kremlin_coup() { log('-3 VP') game.vp -= 3 + game.stability ++ if (check_vp()) { return } @@ -6047,9 +6082,9 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { - console.log('in vm_end_event') + console.log('in vm_end_event, game.vm_infl_to_do', game.vm_infl_to_do, 'game.return_state', game.return_state) view.prompt = `${clean_name(cards[this_card()].name)}: done.` - if (game.vm_infl_to_do) { + if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { gen_action('done') } else { gen_action('end_round') @@ -6307,17 +6342,11 @@ states.vm_remove_infl = { gen_action('done') return } - /*if (game.vm_available_ops === 0 ) { - if (game.vm_infl_to_do) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } else { + if (game.vm_available_ops === 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` gen_action('done') return - } - }*/ + } if (game.remove_opponent_infl) { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` } @@ -6332,12 +6361,13 @@ states.vm_remove_infl = { push_undo() vm_do_remove_infl(space) game.vm_active_country = spaces[space].country - - if (game.vm_available_ops === 0 ) { - vm_next() - if (game.summary.length > 0) { - pop_summary() - log_br() + if (game.vm_event !== 44) { + if (game.vm_available_ops === 0 ) { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() } } }, @@ -6707,10 +6737,11 @@ states.vm_adamec = { states.vm_brought_in_for_questioning = { inactive: 'discard a card.', prompt() { - if (game.phase === 1) { + /*if (game.phase === 1) { view.prompt = 'Discard a card: done.' gen_action('done') - } else if (game.democrat_hand.length === 0) { + } else */ + if (game.democrat_hand.length === 0) { view.prompt = 'Brought in for Questioning. No cards to discard.' gen_action('pass') } else { @@ -6737,15 +6768,16 @@ states.vm_brought_in_for_questioning = { goto_vm(game.vm_event) } else { game.return = DEM + vm_return() } }, pass() { log('No cards to discard') vm_return() }, - done() { + /*done() { vm_return() - } + }*/ } states.vm_central_committee_reshuffle = { @@ -6838,9 +6870,9 @@ states.vm_common_european_home_play = { if (game.active === DEM && game.vm_event === 87 ) { 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) { + /*if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 || game.active === COM && game.com_tst_attempted_this_turn === 0) { gen_action('tst') - } + } */ }, influence(){ push_undo() @@ -7154,7 +7186,7 @@ states.vm_goodbye_lenin = { gen_action('ops') } } else { - view.prompt = 'Communist has no valid cards. Play Goodbye Lenin for operations.' + view.prompt = 'Communist has no red events. Play Goodbye Lenin for operations.' gen_action('ops') } }, @@ -7225,7 +7257,7 @@ states.vm_honecker = { prompt() { if (game.valid_cards.length === 0 && game.temp === 0) { view.prompt = 'Honecker: no valid cards to choose.' - gen_action('done') + gen_action('pass') } else if (game.temp === 0) {view.prompt = 'Honecker: choose a card to add to your hand.' for (let card of game.valid_cards) { @@ -7347,16 +7379,23 @@ states.vm_inflationary_currency_discard = { for (let card of game.valid_cards) { gen_action_card(card) } - } else { - view.prompt = 'Discard a card: done.' + } /*else { + view.prompt = 'Inflationary Currency. Discard a card: done.' gen_action('done') - } + } */ }, card(card) { push_undo() discard(card) game.temp = card - + if (!game.vm_infl_to_do) { + if(game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + vm_next() }, pass() { push_undo() @@ -7394,8 +7433,13 @@ states.vm_kiss_of_death = { }, discard() { game.vm_event = discard_card(game.communist_hand) - next_player() - game.state = 'vm_kiss_of_death_finish' + if (cards[game.vm_event].side !== "C") { + next_player() + game.state = 'vm_kiss_of_death_finish' + } else { + log('Event does not occur') + vm_next() + } }, pass() { log('No card to discard') @@ -7835,9 +7879,10 @@ states.vm_nomenklatura_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { - view.prompt = 'Nomenklatura. No SPs to remove: done.' - gen_action('done') + console.log('in nomenklatura, game.valid_spaces.length', game.valid_spaces.length) + if (game.valid_spaces.length === 0 ) { + view.prompt = 'Nomenklatura. No SPs to remove: pass.' + gen_action('pass') } else { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' @@ -7853,7 +7898,8 @@ states.vm_nomenklatura_remove = { vm_next() } }, - done() { + pass() { + push_undo() vm_next() } } @@ -8639,8 +8685,8 @@ states.vm_tst_6_sc = { do_sc(game.selected_space) game.vm_available_ops-- game.valid_spaces = [] + game.state = 'vm_tst_6' vm_next() - //game.state = 'vm_tst_6' return } } @@ -8668,6 +8714,7 @@ states.vm_tst_8 = { }, event() { push_undo() + log('Event') game.vm_event_to_do = false game.return_state = 'vm_tst_8' game.return = game.active @@ -8676,6 +8723,7 @@ states.vm_tst_8 = { }, ops() { push_undo() + log('Operations') game.vm_infl_to_do = false game.return = game.active game.return_state = 'vm_tst_8' @@ -8722,6 +8770,37 @@ states.vm_tst_8_ops = { // ========================= POWER STRUGGLE STATES ======================== +states.vm_scare_tactics = { + inactive: 'remove a Support Point.', + prompt () { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` + gen_action('done') + return + } + if (game.vm_available_ops === 0 ) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + push_undo() + vm_do_remove_infl(space) + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + states.vm_support_surges_1 = { inactive: 'draw cards.', prompt() { @@ -8733,10 +8812,12 @@ states.vm_support_surges_1 = { 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) + console.log('hand after', game.dem_pwr_hand, 'game.temp', game.temp) } else { + console.log('hand before', game.com_pwr_hand) 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.temp = game.com_pwr_hand[game.com_pwr_hand.length-1] + console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) } game.state = 'vm_support_surges_2' @@ -8751,7 +8832,7 @@ 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.` + view.prompt = `Support Surges: you drew ${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.` } @@ -8765,7 +8846,7 @@ states.vm_support_surges_2 = { 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.temp = game.com_pwr_hand[game.com_pwr_hand.length - 1] } game.state = 'vm_support_surges_3' /*game.phase = 0 @@ -8779,7 +8860,7 @@ 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.` + view.prompt = `Support Surges: you drew ${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.` } @@ -9451,7 +9532,7 @@ CODE[83] = [ // Modrow* [ vm_permanently_remove ], [ vm_modrow ], [ vm_valid_spaces_country, 'East_Germany' ], - [ vm_prompt, 'East Germany' ], + [ vm_prompt, 'East Germany, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], [ vm_return ], ] -- cgit v1.2.3 From 6d8ac00db1366e7b0c790e679bc439c8fcac5fed Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 18 Oct 2024 10:23:34 +0100 Subject: Added action toggles --- play.css | 15 +++++++-------- play.js | 29 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/play.css b/play.css index 535ba84..f9ed02e 100644 --- a/play.css +++ b/play.css @@ -194,10 +194,10 @@ header.your_turn { background-color: orange; } background-image: url(images/USd_blank.gif); background-size: contain; } - +/* .demInfl:hover { cursor: pointer; -} +}*/ .comInfl { position: absolute; @@ -207,10 +207,10 @@ header.your_turn { background-color: orange; } height: 35px; width: 35px; } - +/* .comInfl:hover { cursor: pointer; -} +}*/ .comInfl.controlled { background-image: url(images/SV_blank.gif); @@ -551,11 +551,10 @@ left: 660px} border-radius: 5px; transition: transform .3s ease 0.5s; } - +/* .hand_card:hover { cursor: pointer; - /*transform: scale(1.75);*/ -} +}*/ .zoom { transform: scale(1.75) @@ -577,7 +576,7 @@ left: 660px} } .discard_card:hover, .event_card:hover { - cursor: pointer; + /*cursor: pointer;*/ transform: scale(2); } diff --git a/play.js b/play.js index dd38b44..61e841f 100644 --- a/play.js +++ b/play.js @@ -182,12 +182,12 @@ function is_card_enabled(card) { function on_click_space(evt) { if (evt.button === 0) { const space = evt.target.my_space; - console.log('on_click_space_called with space:', space); + //console.log('on_click_space_called with space:', space); if (send_action('infl', space)) { - console.log('send_action with infl:', space); + //console.log('send_action with infl:', space); evt.stopPropagation(); } else if (send_action('sc', space)) { - console.log('send_action with sc:', space); + //console.log('send_action with sc:', space); evt.stopPropagation(); } else { // console.log('send_action failed for space:', space); @@ -199,9 +199,9 @@ function on_click_space(evt) { function on_click_card(evt) { if (evt.button === 0) { const card = evt.target.my_card; - console.log('on_click_card_called with card:', card); + //console.log('on_click_card_called with card:', card); if (is_action('card', card)) { - console.log('in action card') + //console.log('in action card') if (send_action('card', card)) { evt.stopPropagation(); } @@ -211,15 +211,15 @@ function on_click_card(evt) { function is_action(action) { //console.log('is_action called with: ', action) - console.log('view.actions', view.actions) + //console.log('view.actions', view.actions) if (view.actions && view.actions[action]) return true return false } function is_card_action(action, card) { - console.log('is_card_action called with action', action, 'card', card) - console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action]) + //console.log('is_card_action called with action', action, 'card', card) + //console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action]) if (view.actions && view.actions[action] && view.actions[action].includes(card)) return true return false @@ -417,9 +417,15 @@ function on_update() { if (view.hand.length && view.is_pwr_struggle === false) { document.getElementById("hand_panel").classList.remove("hide") + //console.log('view.actions.card', view.actions.card) for (let c of view.hand) { let card = ui.cards[c] document.getElementById("hand").appendChild(card); + if (view.actions && view.actions.card && view.actions.card.includes(c)) { + card.classList.add('action') + } else { + card.classList.remove('action') + } if (view.valid_cards.includes(c)) { card.classList.add('selected') } else { @@ -450,7 +456,7 @@ if (!view.is_pwr_struggle) { } // DISCARD FOR EVENTS -console.log('view.discard',view.discard) +//console.log('view.discard',view.discard) if(view.discard) { //document.getElementById("discard").replaceChildren() document.getElementById("discard_panel").classList.remove("hide") @@ -484,6 +490,7 @@ for (let c of view.strategy_removed) { if (view.played_card > 0) { document.getElementById("played_card_panel").classList.remove("hide") document.getElementById("played_card").appendChild(ui.cards[view.played_card]); + document.getElementById("played_card").classList.remove("hand_card") } else { document.getElementById("played_card_panel").classList.add("hide") } @@ -517,7 +524,7 @@ if (!view.is_pwr_struggle) { document.getElementById("opp_hand_panel").classList.add("hide") } } else { - console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) + //console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { document.getElementById("opp_hand_panel").classList.remove("hide") for (let c of view.opp_hand) { @@ -699,7 +706,7 @@ if (view.persistent_events.includes(97)) { action_button("end_round", "End Round") action_button("undo", "Undo") -console.log('view.strategy_deck', view.strategy_deck) +console.log('view.actions', view.actions) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From 02e68e9059d5302901705dbf0bf8631d996d4f9a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 20 Oct 2024 17:20:28 +0100 Subject: Teisuru comments set 1 --- play.js | 8 +- rules.js | 302 ++++++++++++++++++++++++++++++--------------------------------- 2 files changed, 149 insertions(+), 161 deletions(-) diff --git a/play.js b/play.js index 61e841f..a98c671 100644 --- a/play.js +++ b/play.js @@ -516,9 +516,15 @@ if (!view.is_pwr_struggle) { document.getElementById("opp_hand_panel").classList.remove("hide") for (let c of view.opp_hand) { let card = ui.cards[c] - //console.log('power_card:', power_card) document.getElementById("opp_hand").appendChild(card); card.classList.remove('discard_card') + if (!view.is_pwr_struggle) { + if (view.valid_cards.includes(c)) { + card.classList.add('selected') + } else { + card.classList.remove('selected') + } + } } } else { document.getElementById("opp_hand_panel").classList.add("hide") diff --git a/rules.js b/rules.js index 6ea9327..1e68bea 100644 --- a/rules.js +++ b/rules.js @@ -108,7 +108,7 @@ function start_game() { // Draw cards - console.log('start game') + //console.log('start game') game.strategy_deck = draw_deck(cards) reset_power() @@ -222,12 +222,12 @@ exports.view = function(state, player) { view.opp_hand = game.communist_hand_red } view.set_aside = game.democrat_set_aside /*Is this being used? */ - view.power_hand = game.dem_pwr_hand.sort((a, b) => a - b) + view.power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) } else if (player === COM) { view.hand = game.communist_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) + view.opp_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) + view.power_hand = [...game.com_pwr_hand].sort((a, b) => a - b) } if (player === DEM) { @@ -317,7 +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) + //console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { view.prompt = 'Place starting SPs: done. Start Turn 1.'; gen_action("start"); @@ -370,7 +370,7 @@ states.com_init = { states.dem_init = { inactive: 'place starting SPs.', prompt() { - console.log('state:', game.state) + //console.log('state:', game.state) if (game.available_ops == 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); @@ -410,7 +410,6 @@ states.dem_init = { 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') @@ -496,11 +495,11 @@ states.play_card ={ } //Check for events - console.log('event_is_playable(game.played_card)', event_is_playable(game.played_card)) + //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') + //console.log('card is playable') //Check for Tiananmen Square Track awards special abilities - console.log('game.tst_7', game.tst_7) + //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') } @@ -523,7 +522,7 @@ states.play_card ={ }, event() { push_undo() - console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + //console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) log_gap(`Played C${cards[game.played_card].number} for the event`) game.vm_infl_to_do = false if (scoring_cards.includes(game.played_card)) {game.phase = 0} @@ -531,7 +530,7 @@ states.play_card ={ game.return = game.active if (switch_events.includes(game.played_card)) {next_player()} game.vm_event = game.played_card - console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) + //console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) goto_vm(game.vm_event) }, opp_event() { @@ -633,7 +632,7 @@ states.resolve_opponent_event = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('in resolve opponent event: discard', game.strategy_discard) + //console.log('in resolve opponent event: discard', game.strategy_discard) if (game.vm_infl_to_do) { view.prompt = 'Event resolved. Choose to play card for:' gen_action('influence') @@ -868,7 +867,7 @@ states.tiananmen_square_attempt_success = { }, done () { push_undo() - console.log('going to tst award, game.return_state', game.return_state) + //console.log('going to tst award, game.return_state', game.return_state) goto_vm(game.vm_event) }, end_round () { @@ -1026,7 +1025,6 @@ states.support_check_prep = { } /*else { */ } game.state = 'do_support_check' - console.log('game.state after space selected:', game.state) //} }, end_round() { @@ -1039,6 +1037,7 @@ states.support_check_prep = { if (game.return !== game.active) { next_player() } + log_h2('Raise the Stakes') game.state = 'raise_stakes_1' return } @@ -1050,7 +1049,7 @@ states.support_check_prep = { states.do_support_check = { inactive: 'do support checks.', prompt () { - console.log('in do_support_check') + // console.log('in do_support_check') view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') }, @@ -1105,11 +1104,11 @@ states.draw_power_cards = { draw() { push_undo() game.power_struggle_deck = [...all_power_cards] - console.log('game.power_struggle_deck.length', game.power_struggle_deck.length) - console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - console.log('test3') + // console.log('game.power_struggle_deck.length', game.power_struggle_deck.length) + //console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + //console.log('test3') let presence = check_presence(game.pwr_struggle_in) - console.log('test2') + //console.log('test2') if (presence.dem_spaces > 0) { game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1) } else { @@ -1155,7 +1154,7 @@ states.draw_power_cards = { //Draw Power Cards game.is_pwr_struggle = true - console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) + //console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) if (game.active === DEM) { game.valid_cards = [...game.dem_pwr_hand] @@ -1169,18 +1168,18 @@ states.draw_power_cards = { //Check if The Crowd Turns Against Ceausescu occurs if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { - console.log('draw cards: crowd subcheck, game.active', game.active) + //console.log('draw cards: crowd subcheck, game.active', game.active) if (game.active === COM) { game.return = COM next_player() } - log_h3('The Crowd Turns Against Ceausescu') + log_h3('C54') game.persistent_events.push(54) game.state = 'the_crowd_turns_against_ceausescu_prep' } else { log_h2('Raise the Stakes') game.state = 'raise_stakes_1' - console.log('game.state', game.state, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + //console.log('game.state', game.state, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) } } } @@ -1196,10 +1195,11 @@ states.the_crowd_turns_against_ceausescu_prep = { draw() { game.ceausescu_cards = [] draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) - console.log('game.ceausescu_cards', game.ceausescu_cards) + //console.log('game.ceausescu_cards', game.ceausescu_cards) game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) game.vm_available_ops = game.temp * 3 + log(`Democrat takes a ${game.vm_available_ops} Action Round`) game.state = 'vm_the_crowd_turns_against_ceausescu' } } @@ -1265,8 +1265,8 @@ states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - console.log('raise stakes 1 - valid cards', game.valid_cards) - console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + // console.log('raise stakes 1 - valid cards', game.valid_cards) + // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') @@ -1314,13 +1314,13 @@ states.raise_stakes_1 = { log_gap('Raised the stakes') game.raised_stakes_discard = 0 next_player() - console.log('game.active', game.active) + //console.log('game.active', game.active) if (game.active === DEM) { game.valid_cards = [...game.dem_pwr_hand] } else { game.valid_cards = [...game.com_pwr_hand] } - console.log('game.valid_cards', game.valid_cards) + // console.log('game.valid_cards', game.valid_cards) game.state = 'raise_stakes_2' } } @@ -1396,7 +1396,7 @@ states.begin_power_struggle = { states.power_struggle = { inactive: 'play a card.', prompt () { - console.log('game.tactics_fails', game.tactics_fails) + //console.log('game.tactics_fails', game.tactics_fails) if (game.phase === 0) { if (game.valid_cards.length > 0) { view.prompt = "Play a card." @@ -1576,7 +1576,7 @@ states.power_struggle = { states.support_loss ={ inactive: 'do Support Loss.', prompt () { - console.log('game.played_power_card', game.played_power_card) + //console.log('game.played_power_card', game.played_power_card) if (game.phase === 0) { view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' gen_action('roll') @@ -1631,7 +1631,9 @@ states.support_loss ={ log('Does not remove SPs') } game.phase++ - valid_spaces_support_loss() + if (game.available_ops > 0) { + valid_spaces_support_loss() + } }, infl (space) { game.remove_opponent_infl = false /* Don't know why this is needed... */ @@ -1700,10 +1702,10 @@ states.vp_roll = { log(`-${vp_change} VP`) } if (roll >= 4) - console.log('VP before', game.vp) + //console.log('VP before', game.vp) if (game.active === DEM) {game.vp += vp_change} else {game.vp -= vp_change} - console.log('VP after', game.vp) + //console.log('VP after', game.vp) if (game.active === DEM && modified_roll >= 4) { game.phase = 1 } else { @@ -1811,7 +1813,7 @@ states.finish_scoring ={ gen_action('done') } , done() { - console.log('game.return_state', game.return_state) + //console.log('game.return_state', game.return_state) log_msg_gap('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ if (game.persistent_events.includes(111)) { game.state = 'new_years_eve_party' @@ -1903,7 +1905,7 @@ states.final_scoring_held = { gen_action('bonus') }, bonus() { - console.log('game.revolutions: ', game.revolutions) + // console.log('game.revolutions: ', game.revolutions) const held_countries = game.revolutions.filter(value => value === false).length let vp_gain = 4*held_countries log(`Communist holds ${held_countries} countries: -${vp_gain} VP`) @@ -2137,7 +2139,7 @@ states.new_years_eve_party = { states.stasi_end_round = { inactive: 'choose next card due to Stasi.', prompt() { - console.log('game.stasi_card', game.stasi_card) + //console.log('game.stasi_card', game.stasi_card) let available_cards = game.democrat_hand if (available_cards.length === 0) { view.prompt = 'Stasi: no cards remaining.' @@ -2152,7 +2154,7 @@ states.stasi_end_round = { }, card(card) { push_undo() - log_gap(`Stasi: selected C${cards[card].number}`) + log_gap(`Democract selected C${cards[card].number} as next card.`) game.stasi_card = card game.state = 'stasi_finish' }, @@ -2223,7 +2225,7 @@ states.stasi_play_card = { }, card(card) { push_undo() - log_msg_gap(`Stasi: played C${card}`) + //log_msg_gap(`Stasi: played C${card}`) game.played_card = card let find_card find_card = game.democrat_hand.indexOf(card); @@ -2277,7 +2279,7 @@ states.stasi_resolve_common_european_home = { function add_infl(space) { push_undo() - console.log('adding infl to', space) + //console.log('adding infl to', space) //console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker) //log(`Added 1 influence in %${space}`) log_summary(`Added £ SP in %${space}`) @@ -2329,14 +2331,14 @@ function add_infl(space) { //console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher']) if (game.active === DEM) { if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { - console.log('in gensher subcheck - remove non-East German controlled ') + //console.log('in gensher subcheck - remove non-East German controlled ') game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) } else { - console.log('remove all controlled spaces') + //console.log('remove all controlled spaces') game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) } } else { - console.log('remove all dem controlled spaces') + //console.log('remove all dem controlled spaces') game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) } } @@ -2394,7 +2396,7 @@ function do_sc(space) { game.vp ++ if (check_vp()) { game.state = 'game.over' - console.log('after check_vp, game.state', game.state) + //console.log('after check_vp, game.state', game.state) return } } @@ -2431,46 +2433,46 @@ function do_sc(space) { let card_ops = get_card_ops(this_card()) roll += card_ops - logi(`+${card_ops} ops`) + logi(`+${card_ops} from card ops`) } if (game.support_check_modifier > 0) { roll += game.support_check_modifier - logi(`+${game.support_check_modifier} event`) + logi(`+${game.support_check_modifier} from event`) } // Events which modify SC rolls //Tear Gas if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { roll ++ - logi('+1 C30') + logi('+1 from C30') permanently_remove(30) game.persistent_events = game.persistent_events.filter(n => n !== 30) } //FRG Embassies if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { roll++ - logi('+1 C74') + logi('+1 from C74') } //GrenzTruppen if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { roll-- - logi('-1 C59') + logi('-1 from C59') } //Stand Fast if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ roll-- - logi('-1 C100') + logi('-1 from C100') } //Elena if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { roll-- - logi('-1 C101') + logi('-1 from C101') } //Austria Hungary Border Reopened if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { roll++ - logi(`+1 C58`) + logi(`+1 from C58`) } // Continue with logic - check for adjacency @@ -2478,7 +2480,7 @@ function do_sc(space) { // Events which affect adjacency - The Wall const adj = count_adj(space) - console.log('adj', adj) + //console.log('adj', adj) if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { logi('No adjacency for Democrats due to C9') logi('C9 no longer in effect') @@ -2495,19 +2497,19 @@ function do_sc(space) { roll += adj.dem_adj roll -= adj.com_adj if (adj.dem_adj > 0) { - logi(`+${adj.dem_adj} adjacency`) + logi(`+${adj.dem_adj} from adjacency`) } if (adj.com_adj > 0) { - logi(`-${adj.com_adj} opponent adjacency`) + logi(`-${adj.com_adj} from opponent adjacency`) } } else { roll += adj.com_adj roll -= adj.dem_adj if (adj.com_adj > 0) { - logi(`+${adj.com_adj} adjacency`) + logi(`+${adj.com_adj} from adjacency`) } if (adj.dem_adj > 0) { - logi(`-${adj.dem_adj} opponent adjacency`) + logi(`-${adj.dem_adj} from opponent adjacency`) } } } @@ -2515,12 +2517,12 @@ function do_sc(space) { } // Support check calcs - log(`Total: ${roll}`) + log(`Modified total: ${roll}`) const stability = spaces[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 influence: ${change_infl} SP`) if(game.active === DEM) { if (change_infl > game.comInfl[space]) { const residual = change_infl - game.comInfl[space] @@ -2547,7 +2549,7 @@ function do_sc(space) { check_control_change(space) } else { - log_msg_gap('Change: 0 SP') + log_msg_gap('Change influence: 0 SP') } if (game.active === COM && game.persistent_events.includes(39) && spaces[space].space_id === 66) { log_msg_gap('+1 VP from C39') @@ -2567,7 +2569,6 @@ function do_sc(space) { } - function valid_spaces_setup() { game.valid_spaces = [] let valid_spaces_set = new Set(); @@ -2595,7 +2596,7 @@ function valid_spaces_setup() { function valid_spaces_sc() { let valid_spaces_set = new Set(); - console.log('valid spaces sc, persistent events', game.persistent_events) + //console.log('valid spaces sc, persistent events', game.persistent_events) for (let i = 1 ; i <= 75; i++) { space = spaces[i] @@ -2903,7 +2904,7 @@ function do_tst_attempt() { roll ++ logi('+1 from C53') } - log(`Total: ${roll}`) + log(`Modified total: ${roll}`) // TIANANMEN SQUARE ATTEMPT game.return = game.active @@ -3079,7 +3080,7 @@ function score_country(country) { let com_vp = 0 //Check for presence let presence = check_presence(country) - console.log('presence: ', presence) +// console.log('presence: ', presence) //If one side has domination or control if (presence.dem_control || presence.dem_domination) { @@ -3216,7 +3217,7 @@ function get_end_infl_prompt() { } function permanently_remove(card) { - console.log('permanently removing 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) @@ -3233,7 +3234,7 @@ function permanently_remove(card) { function check_vp() { if (game.vp >= 20) { goto_game_over(DEM, `${DEM} won an Automatic Victory!`) - console.log('after goto_game_over, game.state', game.state) + //console.log('after goto_game_over, game.state', game.state) return true } else if(game.vp <= -20) { goto_game_over(COM, `${COM} won an Automatic Victory!`) @@ -3255,7 +3256,7 @@ function goto_game_over(result, victory) { game.victory = victory log_h1("Game Over") log(game.victory) - console.log('game over, game.state', game.state) + //console.log('game over, game.state', game.state) return } @@ -3323,7 +3324,7 @@ function select_card(card){ game.persistent_events = game.persistent_events.filter(n => n !== 99) } game.state = 'play_card' - console.log('game.state', game.state) + //console.log('game.state', game.state) } function find_event(card) { @@ -3347,7 +3348,7 @@ function get_events(card){ } function event_is_playable(card) { - console.log('game.stasi_card', game.stasi_card, 'card', card) +// console.log('game.stasi_card', game.stasi_card, 'card', card) //Reformer never playable here if (card === 67) { return false @@ -3504,10 +3505,10 @@ function finish_the_wall() { // =========== MOVING THROUGH TURNS ============ function end_round() { - console.log('end round, game.persistent_events.includes(13)', game.persistent_events.includes(13)) +// 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') + // console.log('in end') return} //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. @@ -3552,16 +3553,17 @@ function end_round() { return [...new Set(duplicates)]; } - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) if (check_duplicates(card_check)) { + console.log('card check', card_check) const duplicates = find_duplicates(card_check) - console.log('discard', game.strategy_discard, 'removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'com hand', game.communist_hand, 'dem hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) } - console.log('cards in game', card_check.length) + //console.log('cards in game', card_check.length) card_check = card_check.sort((a, b) => a - b) - console.log('cards in game', card_check) + //console.log('cards in game', card_check) if (game.turn <= 3) { if (card_check.length !== 40) { throw new Error(`Wrong number of cards: ${card_check.length}`) @@ -3576,7 +3578,7 @@ function end_round() { - console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) + //console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) //Check if the Reformer is playable check_reformer() @@ -3632,9 +3634,10 @@ function end_round() { next_player() } else { log_h3('Democratic Action Round') - log_h3('C13') + } if (game.democrat_hand.includes(game.stasi_card)) { + log_h3('C13') game.state = 'stasi_play_card' } else { game.stasi_card = 0 @@ -3660,12 +3663,13 @@ function end_round() { return } if (game.round_player === DEM) { - console.log('checking stasi', game.persistent_events.includes(13)) + // console.log('checking stasi', game.persistent_events.includes(13)) if(game.persistent_events.includes(13)) { - console.log('stasi sub function') + // console.log('stasi sub function') if (game.active !== DEM) { next_player() } + log_h3('C13') game.state = 'stasi_end_round' return } else if(game.round_player === DEM && game.persistent_events.includes(5)){ @@ -3935,6 +3939,7 @@ function discard(card) { //console.log('in discard(card)') let find_card if (!game.is_pwr_struggle) { + if (game.active === COM) { find_card = game.communist_hand.indexOf(card) game.communist_hand.splice(find_card, 1) @@ -3942,9 +3947,10 @@ function discard(card) { find_card = game.democrat_hand.indexOf(card) game.democrat_hand.splice(find_card, 1) } - game.strategy_discard.push(card) - log(`Discarded C${cards[card].number}`) - + if (!game.strategy_discard.includes(card)) { + game.strategy_discard.push(card) + log(`Discarded C${cards[card].number}`) + } } else if (game.is_pwr_struggle) { if (game.active === COM) { find_card = game.com_pwr_hand.indexOf(card); @@ -3953,6 +3959,7 @@ function discard(card) { find_card = game.dem_pwr_hand.indexOf(card); game.dem_pwr_hand.splice(find_card, 1); } + game.power_struggle_discard.push(card) //log(`Discarded P${power_cards[card].number}`) } @@ -3968,8 +3975,9 @@ function silent_discard(card) { find_card = game.democrat_hand.indexOf(card) game.democrat_hand.splice(find_card, 1) } - game.strategy_discard.push(card) - + if (!game.strategy_discard.includes(card)) { + game.strategy_discard.push(card) + } } else if (game.is_pwr_struggle) { if (game.active === COM) { find_card = game.com_pwr_hand.indexOf(card); @@ -4065,7 +4073,6 @@ function check_control_change(space_id) { // Check if the Tyrant is Gone has been fulfilled if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { - console.log('in tyrant') log('+2 VP from C97') game.vp += 2 if (check_vp()) { @@ -4225,7 +4232,6 @@ function log_summary(msg) { } function pop_summary() { - console.log('summary', game.summary) if (game.summary.length > 0) { for (let [n, msg] of game.summary) { if (n > 1) { @@ -4340,13 +4346,13 @@ function vm_exec() { } function vm_inst(a) { - console.log('game.vm.fp', game.vm.fp, 'game.vm.ip', game.vm.ip) + //console.log('game.vm.fp', game.vm.fp, 'game.vm.ip', game.vm.ip) return CODE[game.vm.fp][game.vm.ip][a] } function vm_next() { game.vm.ip++; - console.log('vm_next called, game.vm.ip', game.vm.ip) + //console.log('vm_next called, game.vm.ip', game.vm.ip) vm_exec(); } @@ -4369,8 +4375,8 @@ function vm_log() { } function vm_if() { - console.log('game.temp', game.temp) - console.log('vm_operand(1)', vm_operand(1)) + //console.log('game.temp', game.temp) +// console.log('vm_operand(1)', vm_operand(1)) if (!vm_operand(1)) { let balance = 1 while (balance > 0) { @@ -4403,11 +4409,11 @@ function vm_endif() { } function vm_goto_step(step) { - console.log('vm_goto_step called, target:', step) - console.log('game.vm.ip', game.vp.ip) + // console.log('vm_goto_step called, target:', step) + //console.log('game.vm.ip', game.vp.ip) for (let i = game.vm.ip; i < CODE[game.vm.fp].length; i++) { - console.log('i', i) - console.log('step', CODE[game.vm.fp][i][0]) + //console.log('i', i) + //console.log('step', CODE[game.vm.fp][i][0]) if (CODE[game.vm.fp][i][0] === step) { game.vm.ip = i; vm_exec(); @@ -4420,8 +4426,8 @@ function vm_goto_step(step) { function vm_goto(op, nop, dir, step) { - console.log('vm_inst(0)', vm_inst(0), op, nop) - console.log('vm_inst(0)', vm_inst(1), op, nop) + //console.log('vm_inst(0)', vm_inst(0), op, nop) +// console.log('vm_inst(0)', vm_inst(1), op, nop) let balance = 1 while (balance > 0) { game.vm.ip += dir @@ -4467,7 +4473,7 @@ function pop_vm_prompt() { function vm_return() { - console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) + //console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) //Remove temporary vm variables delete game.support_check_modifier @@ -4507,7 +4513,7 @@ function vm_return() { function vm_end_event() { //game.view_opp_hand = false - console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) +// console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { if (game.round_player !== game.active) { change_player() @@ -4523,7 +4529,7 @@ function vm_end_event() { } if (game.return_state && game.return_state !== '') { game.state = game.return_state - console.log( 'game.state', game.state) + //console.log( 'game.state', game.state) } else if (game.vm_infl_to_do) { game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ @@ -4573,7 +4579,7 @@ function vm_valid_spaces_opponent () { } } game.valid_spaces = valid_spaces - console.log('game.valid_spaces', game.valid_spaces) +// console.log('game.valid_spaces', game.valid_spaces) vm_next() } @@ -4668,7 +4674,7 @@ function vm_valid_spaces_country_opp () { function vm_valid_spaces_country_sc () { let valid_spaces = [] let country = '' - console.log('in vm_valid_spaces_country_sc') + //console.log('in vm_valid_spaces_country_sc') if (vm_operand(1)) { country = vm_operand(1) } else { @@ -4767,7 +4773,6 @@ function vm_active_country () { function vm_take_control_prep() { game.vm_available_ops = vm_operand(1) game.state = 'vm_take_control' - console.log('in vm_take_control_prep game.state', game.state) } function vm_take_control(space) { @@ -4799,7 +4804,7 @@ function vm_take_control(space) { function vm_do_add_infl(space) { push_undo() - console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) + //console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) //log(`Added 1 influence in %${space}.`) @@ -4836,10 +4841,9 @@ function vm_do_add_infl(space) { // Check whether spaces are controlled check_control_change(space) - console.log('before check, ahbr in events', game.persistent_events.includes(58), 'tracker', game.austria_hungary_border_reopened_tracker) // Check Austria Hungary Border Reopened is true and condition has been met if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { - console.log('in award extra op') + //console.log('in award extra op') game.vm_available_ops ++ log('+1 Op from C58') game.austria_hungary_border_reopened_tracker = false @@ -4855,10 +4859,8 @@ function vm_do_add_infl(space) { if (game.active === DEM) { //Check Genscher and AHBR if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { - console.log('in gensher subcheck - remove non-East German controlled ') game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) } else { - console.log('remove all controlled spaces') game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) } } else { @@ -5244,7 +5246,6 @@ function vm_brought_in_for_questioning() { game.active = DEM } //game.return = game.active - console.log('in bifg, game.return', game.return) game.phase = 0 game.state = 'vm_brought_in_for_questioning' } @@ -5462,7 +5463,6 @@ function vm_goodbye_lenin() { game.communist_hand_red = [] // Select Red cards to show for (let card of game.communist_hand) { - console.log('checking card ', card, 'red', cards[card].red) if (cards[card].red) { game.communist_hand_red.push(card) } @@ -5488,7 +5488,6 @@ function vm_government_resigns() { } function vm_grenztruppen() { - console.log('in grenztruppen - player active:', game.active) game.persistent_events.push(59) permanently_remove(59) //game.table_cards.push(59) @@ -5597,7 +5596,6 @@ function vm_kremlin_coup() { game.temp.push(country) } }) - console.log('game.temp', game.temp) game.state = 'vm_kremlin_coup_choose_country' } @@ -5608,7 +5606,6 @@ function vm_laszlo_tokes() { } function vm_legacy_of_martial_law() { - console.log('in martial law, game.vm_infl_to_do', game.vm_infl_to_do) game.vm_available_ops = 1 game.state = 'vm_switch_infl' } @@ -5708,7 +5705,7 @@ function vm_poszgay() { } function vm_power_struggle() { - console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + //console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) game.is_pwr_struggle = true /* TO DELETE? @@ -5716,7 +5713,6 @@ function vm_power_struggle() { */ if (game.vm_event > 0) { - console.log('vm_power_struggle, in game.vm_event check') game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) } @@ -5731,13 +5727,11 @@ function vm_power_struggle() { //Check for Securitate if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(70)) { - console.log('in Securitate subcheck') log('C70: Democrat reveals Power Struggle cards') game.view_opp_hand = true } log_h2('Deal Cards') game.state = 'draw_power_cards' - console.log('game.state',game.state) } function vm_presidential_visit() { @@ -5771,6 +5765,7 @@ function vm_reformer_rehabilitated () { permanently_remove(67) game.discard = true for (let card of game.strategy_discard) { + if (!event_is_playable(card)) continue if (card === game.played_card) continue if (game.table_cards.includes(card)) continue if (scoring_cards.includes(card)) continue @@ -5832,7 +5827,6 @@ function vm_solidarity_legalised() { log_msg_gap(`C2 in effect`) game.playable_cards.push(3) game.persistent_events.push(2) - console.log('game.persistent_events', game.persistent_events) vm_next() } @@ -5890,7 +5884,6 @@ function vm_the_baltic_way() { if (check_vp()) { return } - console.log('game.state', game.state) vm_next() } @@ -5931,8 +5924,6 @@ function vm_the_tyrant_is_gone() { game.valid_spaces.push(space.space_id) } } - - console.log('game.vm_event', game.vm_event, 'game.played_card', game.played_card) game.state = 'vm_the_tyrant_is_gone' } @@ -6027,7 +6018,6 @@ function discarded_card() { // =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== function vm_tst_3() { - console.log('function vm_tst_3, game.return_state', game.return_state) log_gap('Tiananmen Square Track award') game.state = 'vm_tst_3_prep' } @@ -6082,7 +6072,6 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { - console.log('in vm_end_event, game.vm_infl_to_do', game.vm_infl_to_do, 'game.return_state', game.return_state) view.prompt = `${clean_name(cards[this_card()].name)}: done.` if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { gen_action('done') @@ -6095,7 +6084,6 @@ states.vm_end_event = { vm_end_event() }, end_round() { - console.log('end round clicked - vm_end_event called') push_undo() game.return_state = '' vm_end_event() @@ -6107,7 +6095,6 @@ states.vm_take_control = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt () { - console.log('game.vm_available_ops', game.vm_available_ops) if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: all spaces controlled. Continue.` gen_action('done') @@ -6130,6 +6117,7 @@ states.vm_take_control = { vm_take_control(space) game.vm_available_ops-- if (game.vm_available_ops === 0) { + game.valid_spaces = [] vm_next() } }, @@ -6146,7 +6134,6 @@ states.vm_take_control = { states.vm_add_infl = { inactive: 'add Support Points.', prompt () { - console.log('in vm add infl') if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}. No available spaces remaining. Add SPs: done.` gen_action('done') @@ -6255,7 +6242,11 @@ states.vm_add_x_infl = { }, // inactive: `resolve ${cards[this_card()].name}: add influence.`, prompt () { - if (game.vm_available_ops > 0 ) { + if (game.vm_event === 101 && game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: the Romanian Elite space no longer exists.` + gen_action('done') + } + else if (game.vm_available_ops > 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { @@ -6281,12 +6272,12 @@ states.vm_add_x_infl = { //game.vm_event_done = true //vm_next() - } - /*done () { + }, + done () { push_undo() game.vm_event_done = true vm_next() - }*/ + } } states.vm_add_limited_infl = { @@ -6336,7 +6327,6 @@ states.vm_remove_infl = { inactive: 'remove Support Points.', prompt () { // Keep this so that there is an undo option in, e.g., Scare Tactics - console.log('in vm_remove infl, vm_infl_to_do', game.vm_infl_to_do) if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` gen_action('done') @@ -6504,7 +6494,6 @@ states.vm_remove_all_infl = { states.vm_support_check_prep = { inactive: 'do support checks.', prompt () { - console.log('in states.vm_support_check_prep, game.vm_available_ops: ', game.vm_available_ops) /*if (game.vm_available_ops === 0) { view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` gen_action('done') @@ -6578,7 +6567,7 @@ states.vm_ceh_support_check_prep = { //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) if (game.persistent_events.includes(58)) { if (game.active === DEM && game.vm_available_ops > 1) { - console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events.includes(58)) + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { game.state = 'vm_austria_hungary_border_reopened_check' return @@ -6671,7 +6660,6 @@ states.vm_do_support_check = { clear_undo() do_sc(game.selected_space) game.vm_available_ops-- - console.log('game.vm_available_ops', game.vm_available_ops) if (game.vm_available_ops === 0) { game.valid_spaces = [] vm_next() @@ -6750,6 +6738,7 @@ states.vm_brought_in_for_questioning = { } }, discard() { + clear_undo() game.vm_event = discard_card(game.democrat_hand) game.phase = 1 if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { @@ -6761,7 +6750,6 @@ states.vm_brought_in_for_questioning = { game.return = DEM } } - console.log('BIFQ discard: game.return', game.return) if (!auto_resolve_events.includes(game.vm_event) && !switch_events.includes(game.vm_event)) { next_player() } @@ -6851,7 +6839,7 @@ states.vm_common_european_home_choose = { }, card(card) { push_undo() - log(`Played with C${cards[card].number}`) + //log(`Played with C${cards[card].number}`) game.valid_cards = [] silent_discard(card) game.vm_event = card @@ -6876,6 +6864,7 @@ states.vm_common_european_home_play = { }, influence(){ push_undo() + log_gap(`Played C${cards[game.vm_event].number} to place SPs`) game.vm_available_ops = cards[game.vm_event].ops valid_spaces_infl() // If ABHR - Set AHBR tracker to true @@ -6886,12 +6875,14 @@ states.vm_common_european_home_play = { }, support_check() { push_undo() + log_gap(`Played C${cards[game.vm_event].number} for support checks`) game.vm_available_ops = 2 game.state = 'vm_ceh_support_check_prep' valid_spaces_sc() }, tst() { push_undo() + log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) game.state = 'vm_tiananmen_square_attempt' } } @@ -6961,7 +6952,6 @@ states.vm_play_event_from_discard = { game.vm_available_ops = cards[card].ops game.discard = false //game.return = game.active Does turning this off cause problems? - console.log('card:', card) if (switch_events.includes(card)) {next_player()} goto_vm(card) }, @@ -7041,11 +7031,9 @@ states.vm_deutsche_marks = { event() { push_undo() log(`Played C${cards[game.vm_event].number} for the event`) - console.log('game.active', game.active) if (!game.vm_infl_to_do) { game.return = game.active } - console.log('DM Event played, game.return', game.return) goto_vm(game.vm_event) }, influence() { @@ -7178,9 +7166,8 @@ states.vm_goodbye_lenin = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('in vm_goodbye lenin') if (game.valid_cards.length > 0 ) { - view.prompt = 'Choose a card to play for the event, or play Goodbye Lenin for operations' + view.prompt = `Play a red event from your opponent's hand, or play Goodbye Lenin for operations.` for (let card of game.valid_cards) { gen_action_card(card) gen_action('ops') @@ -7229,7 +7216,6 @@ states.vm_goodbye_lenin_ops = { log(`+1 from C50`) game.vm_available_ops++ }*/ - console.log('goodbye lenin: influence selected') valid_spaces_infl() // If ABHR - Set AHBR tracker to true @@ -7277,7 +7263,6 @@ states.vm_honecker = { let card_index = game.strategy_discard.indexOf(card) game.strategy_discard.splice(card_index, 1) game.communist_hand.push(card) - console.log('removed after honecker', game.strategy_removed) vm_next() }, pass(){ @@ -7300,7 +7285,6 @@ states.vm_inflationary_currency = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('game.revolutions', game.revolutions, 'length', game.revolutions.length) if ((game.active === COM && game.revolutions.every(n => n === false)) || (game.active === DEM && game.revolutions.every(n => n === true))) { view.prompt = 'Inflationary Currency: no countries to choose.' gen_action('pass') @@ -7432,6 +7416,7 @@ states.vm_kiss_of_death = { } }, discard() { + clear_undo() game.vm_event = discard_card(game.communist_hand) if (cards[game.vm_event].side !== "C") { next_player() @@ -7452,7 +7437,6 @@ states.vm_kiss_of_death_finish = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('game.vm_event', game.vm_event) if (game.vm_event > 0 && game.vm_event !== 21 && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) { view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.` console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard) @@ -7464,10 +7448,8 @@ states.vm_kiss_of_death_finish = { }, event() { //game.return = game.active - console.log('kiss of death event section, discard', game.strategy_discard) // Remove game.vm_event from the discard //game.strategy_discard = game.strategy_discard.filter(n => n !== game.vm_event) - console.log('kiss of death event section 2, discard', game.strategy_discard) goto_vm(game.vm_event) }, @@ -7484,9 +7466,7 @@ states.vm_kremlin_coup_choose_country = { if (game.temp.length > 0) { view.prompt = 'Kremlin Coup! Select a country where the Communist retains power.' for (let country of countries) { - console.log(`checking`, country) if (game.temp.includes(country)) { - console.log('country in game.temp') gen_action(`${country.toLowerCase()}`) } } @@ -7869,6 +7849,7 @@ states.vm_nomenklatura = { game.valid_spaces.push(space.space_id) } } + check_systematization() game.vm_available_ops = 3 game.state = 'vm_nomenklatura_add' } @@ -7879,7 +7860,6 @@ states.vm_nomenklatura_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('in nomenklatura, game.valid_spaces.length', game.valid_spaces.length) if (game.valid_spaces.length === 0 ) { view.prompt = 'Nomenklatura. No SPs to remove: pass.' gen_action('pass') @@ -8413,7 +8393,6 @@ states.vm_warsaw_pact_summit = { } game.vm_available_ops = 2 //game.state = 'vm_support_check_prep' - console.log('game.phase',game.phase) vm_next() } } @@ -8564,7 +8543,6 @@ states.vm_workers_revolt_finish = { states.vm_tst_3_prep = { inactive: 'resolve Tiananmen Square Track award.', prompt() { - console.log('tst award prep, game.return_state', game.return_state) view.prompt = 'Tiananmen Square Track award: draw 3 cards.' gen_action('draw') }, @@ -8586,7 +8564,6 @@ states.vm_tst_3_prep = { states.vm_tst_3 = { inactive: 'resolve Tiananmen Square Track bonus.', prompt() { - console.log('tst award, game.return_state', game.return_state) if (game.temp < 2) { view.prompt = `Discard 2 of the drawn cards.` for (let card of game.valid_cards) { @@ -8809,15 +8786,15 @@ states.vm_support_surges_1 = { }, draw() { if (game.active === DEM) { - console.log('hand before', game.dem_pwr_hand) + //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 after', game.dem_pwr_hand, 'game.temp', game.temp) + //console.log('hand after', game.dem_pwr_hand, 'game.temp', game.temp) } else { - console.log('hand before', game.com_pwr_hand) + //console.log('hand before', game.com_pwr_hand) 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.com_pwr_hand[game.com_pwr_hand.length-1] - console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) + //console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) } game.state = 'vm_support_surges_2' @@ -8831,8 +8808,16 @@ states.vm_support_surges_1 = { states.vm_support_surges_2 = { inactive: 'draw cards.', prompt() { - if (numberless_cards.includes(game.temp)) { + let special = [49,50,51,52] + let elite_leader = [37,38,39,40] + if (special.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)) { + view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Draw a second card.` + } + else 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.` } @@ -8840,10 +8825,8 @@ states.vm_support_surges_2 = { }, 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.com_pwr_hand[game.com_pwr_hand.length - 1] @@ -8890,7 +8873,6 @@ states.vm_support_falters = { } }, discard() { - console.log('game.com_pwr_hand', game.com_pwr_hand) if (game.active === DEM) {discard_card(game.dem_pwr_hand)} else {discard_card(game.com_pwr_hand)} game.vm_available_ops -- -- cgit v1.2.3 From 3e87e69e775ce87d619ac8c8ab2eb93cdab1582a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 23 Oct 2024 17:58:09 +0100 Subject: Updates to Ceausescu events after Tyrant --- rules.js | 73 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/rules.js b/rules.js index 1e68bea..aa8cb3a 100644 --- a/rules.js +++ b/rules.js @@ -540,7 +540,7 @@ states.play_card ={ game.vm_infl_to_do = true game.return = game.active game.vm_event = game.played_card - if (auto_resolve_events.includes(game.played_card) || switch_events.includes(game.played_card)) { + if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { goto_vm(game.vm_event)} else { next_player() @@ -667,7 +667,7 @@ states.resolve_opponent_event = { opp_event() { game.vm_event_to_do = false game.return_state = 'resolve_opponent_event' - if (auto_resolve_events.includes(game.played_card) || switch_events.includes(game.played_card)) { + if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { game.return = game.active log(`Played C${game.played_card} for the event`) goto_vm(game.played_card)} @@ -1726,7 +1726,17 @@ states.vp_roll = { push_undo() log_h2('Scoring') score_country(game.pwr_struggle_in) - game.state = 'finish_scoring' + + //Check if The Tyrant is Gone occurs + if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + game.return_state = 'finish_scoring' + if (game.active !== DEM) { + next_player() + } + game.state = 'the_tyrant_is_gone' + } else { + game.state = 'finish_scoring' + } }, } @@ -2154,7 +2164,7 @@ states.stasi_end_round = { }, card(card) { push_undo() - log_gap(`Democract selected C${cards[card].number} as next card.`) + log_gap(`Democrat selected C${cards[card].number} as next card.`) game.stasi_card = card game.state = 'stasi_finish' }, @@ -3331,6 +3341,25 @@ function find_event(card) { return variable_events.indexOf(card) } +function is_auto_resolve(card) { + //Check for the Tyrant is Gone + let ceausecu_events = [10, 41, 101, 107] + + if (card === 97) { + if (!game.persistent_events.includes(54)) { + return true + } + } + else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { + return true + } + else if (auto_resolve_events.includes(card)) { + return true + } else { + return false + } +} + function get_events(card){ if (event_is_playable(card)) { if (cards[card].side === 'D') { @@ -4491,7 +4520,7 @@ function vm_return() { vm_end_event() } //Check if auto-resolve opponent event - else if (auto_resolve_events.includes(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { + else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { vm_end_event() } else { @@ -5935,7 +5964,9 @@ function vm_the_tyrant_is_gone_prep() { } function vm_tyrant_block() { - game.state = 'vm_tyrant_block' + logi(`Has no effect after C97`) + vm_next() + //game.state = 'vm_tyrant_block' } function vm_the_wall () { @@ -6467,7 +6498,7 @@ states.vm_remove_all_infl = { prompt () { if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` - gen_action('done') + gen_action('pass') } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` for (let space_id of game.valid_spaces) { @@ -6485,7 +6516,7 @@ states.vm_remove_all_infl = { vm_next() } }, - done() { + pass() { push_undo() vm_next() } @@ -6750,7 +6781,7 @@ states.vm_brought_in_for_questioning = { game.return = DEM } } - if (!auto_resolve_events.includes(game.vm_event) && !switch_events.includes(game.vm_event)) { + if (!is_auto_resolve(game.vm_event) && !switch_events.includes(game.vm_event)) { next_player() } goto_vm(game.vm_event) @@ -7418,7 +7449,8 @@ states.vm_kiss_of_death = { discard() { clear_undo() game.vm_event = discard_card(game.communist_hand) - if (cards[game.vm_event].side !== "C") { + //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) { next_player() game.state = 'vm_kiss_of_death_finish' } else { @@ -8221,16 +8253,16 @@ states.vm_the_tyrant_is_gone = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - //if (!game.the_tyrant_is_gone) { + if (!game.the_tyrant_is_gone) { view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_infl(space_id); } - /* } else { - view.prompt = 'Select a space: done.' + } else { + view.prompt = 'The Tyrant is Gone: done.' gen_action('done') - }*/ + } }, infl(space) { push_undo() @@ -8238,13 +8270,14 @@ states.vm_the_tyrant_is_gone = { game.the_tyrant_is_gone = space game.valid_spaces = [] game.persistent_events.push(97) - vm_next() + + // vm_next() }, - /*done () { + done () { vm_next() - }*/ + } } - +/* states.vm_tyrant_block ={ get inactive() { return `resolve ${clean_name(cards[this_card()].name)}.` @@ -8257,7 +8290,7 @@ states.vm_tyrant_block ={ push_undo() vm_next() } -} +}*/ states.vm_the_wall_must_go = { @@ -8883,7 +8916,7 @@ states.vm_support_falters = { vm_next() }, done() { - log_msg_gap('Takes initiative') + log_gap('Takes initiative') game.return = game.active vm_next() } -- cgit v1.2.3 From e1b09f952f52a0163a969b9c200d8b5fc3c50090 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 23 Oct 2024 20:23:23 +0100 Subject: Tweaks to New Years Eve Party --- rules.js | 89 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/rules.js b/rules.js index aa8cb3a..4112e7f 100644 --- a/rules.js +++ b/rules.js @@ -21,7 +21,7 @@ const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslova const elite_spaces = [12, 15, 27, 43, 51, 69] const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] -const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 99, 102, 108] +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] exports.scenarios = [ "Standard" ] @@ -1396,7 +1396,7 @@ states.begin_power_struggle = { states.power_struggle = { inactive: 'play a card.', prompt () { - //console.log('game.tactics_fails', game.tactics_fails) + console.log('game.vm_event', game.vm_event) if (game.phase === 0) { if (game.valid_cards.length > 0) { view.prompt = "Play a card." @@ -1576,22 +1576,40 @@ states.power_struggle = { states.support_loss ={ inactive: 'do Support Loss.', prompt () { - //console.log('game.played_power_card', game.played_power_card) - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + if (!game.vm_event === 104) { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') + } + } else { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = 'Support Loss: finished.' - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = 'Support Loss: no remaining SPs to remove.' - gen_action('done') } }, roll () { @@ -1657,15 +1675,28 @@ states.support_loss ={ states.vp_roll = { inactive: 'do VP Roll.', prompt () { - if (game.phase === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `${clean_name(cards[this_card()].name)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `${clean_name(cards[this_card()].name)}: proceed to scoring.` - gen_action('scoring') + if (!game.vm_event === 104) { + if (game.phase === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } + } else { + if (game.phase === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } } }, roll () { @@ -1868,6 +1899,7 @@ states.end_turn_4_5_4 = { } else if (game.persistent_events.includes(104)) { log_h1(`New Year's Eve Party`) + game.vm_event = 104 //Check if the Communist receives VP from The Tyrant is Gone if (game.persistent_events.includes(97)) { game.vp -= 2 @@ -3342,7 +3374,7 @@ function find_event(card) { } function is_auto_resolve(card) { - //Check for the Tyrant is Gone + let ceausecu_events = [10, 41, 101, 107] if (card === 97) { @@ -3353,6 +3385,9 @@ 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)) { + return true + } else if (auto_resolve_events.includes(card)) { return true } else { -- cgit v1.2.3 From 61cccf6066db2628b151c185d875381575dfb422 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 23 Oct 2024 20:38:09 +0100 Subject: Updates for events with edge cases when all countries are/are not in revolution --- rules.js | 74 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/rules.js b/rules.js index 4112e7f..3c927eb 100644 --- a/rules.js +++ b/rules.js @@ -6839,13 +6839,18 @@ states.vm_central_committee_reshuffle = { return `resolve ${clean_name(cards[57].name)}.` }, prompt() { - 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')} - if (!game.revolutions[3]) {gen_action('bulgaria')} - if (!game.revolutions[4]) {gen_action('czechoslovakia')} - if (!game.revolutions[5]) {gen_action('romania')} + if (game.revolutions.every(n => n === true)) { + view.prompt = 'Central Committee Reshuffle: no countries to choose.' + gen_action('pass') + } else { + 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')} + if (!game.revolutions[3]) {gen_action('bulgaria')} + if (!game.revolutions[4]) {gen_action('czechoslovakia')} + if (!game.revolutions[5]) {gen_action('romania')} + } }, east_germany() { push_undo() @@ -6890,6 +6895,10 @@ states.vm_central_committee_reshuffle = { game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] vm_next() }, + pass() { + log('Passed') + vm_return() + } } @@ -8045,21 +8054,26 @@ states.vm_shock_therapy = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.vm_active_country === '' ) { - view.prompt = 'Shock Therapy: choose 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')} - if (game.revolutions[3]) {gen_action('bulgaria')} - if (game.revolutions[4]) {gen_action('czechoslovakia')} - if (game.revolutions[5]) {gen_action('romania')} - } /*else if (game.phase === 2) { - view.prompt = 'Shock Therapy: done.' - gen_action('done') - } */ - else { - view.prompt = 'Shock Therapy: roll a die.' - gen_action('roll') + if (game.revolutions.every(n => n === false)) { + view.prompt = 'Shock Therapy: no countries to choose.' + gen_action('pass') + } else { + if (game.vm_active_country === '' ) { + view.prompt = 'Shock Therapy: choose 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')} + if (game.revolutions[3]) {gen_action('bulgaria')} + if (game.revolutions[4]) {gen_action('czechoslovakia')} + if (game.revolutions[5]) {gen_action('romania')} + } /*else if (game.phase === 2) { + view.prompt = 'Shock Therapy: done.' + gen_action('done') + } */ + else { + view.prompt = 'Shock Therapy: roll a die.' + gen_action('roll') + } } }, east_germany() { @@ -8114,6 +8128,10 @@ states.vm_shock_therapy = { vm_return() } }, + pass() { + log('Passed') + vm_return() + } /*done() { permanently_remove(93) vm_return() @@ -8125,6 +8143,10 @@ states.vm_social_democratic_platform_adopted = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { + if (game.revolutions.every(n => n === false)) { + view.prompt = 'Social Democratic Platform Adopted: no countries to choose.' + gen_action('pass') + } else { view.prompt = 'Select a country where the Democrat holds Power.' if (game.revolutions[0]) {gen_action('poland')} if (game.revolutions[1]) {gen_action('hungary')} @@ -8132,6 +8154,7 @@ states.vm_social_democratic_platform_adopted = { if (game.revolutions[3]) {gen_action('bulgaria')} if (game.revolutions[4]) {gen_action('czechoslovakia')} if (game.revolutions[5]) {gen_action('romania')} + } }, east_germany() { push_undo() @@ -8165,7 +8188,12 @@ states.vm_social_democratic_platform_adopted = { push_undo() game.vm_active_country = 'Bulgaria' log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()} + vm_next() + }, + pass() { + log('Passed') + vm_return() + } } states.vm_systematization = { -- cgit v1.2.3 From c8b701953f1b0a6349d738895df738d4899ab1f5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 24 Oct 2024 19:53:51 +0100 Subject: Fix for Power Struggle incorrectly showing NYE Party --- rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 3c927eb..91818c9 100644 --- a/rules.js +++ b/rules.js @@ -1576,7 +1576,7 @@ states.power_struggle = { states.support_loss ={ inactive: 'do Support Loss.', prompt () { - if (!game.vm_event === 104) { + if (!game.persistent_events.includes(111)) { if (game.phase === 0) { view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' gen_action('roll') @@ -1675,7 +1675,7 @@ states.support_loss ={ states.vp_roll = { inactive: 'do VP Roll.', prompt () { - if (!game.vm_event === 104) { + if (!game.persistent_events.includes(111)) { if (game.phase === 0) { view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` gen_action('roll') @@ -8192,7 +8192,7 @@ states.vm_social_democratic_platform_adopted = { }, pass() { log('Passed') - vm_return() + vm_return() } } -- cgit v1.2.3 From bf856d132261e7ca91ca6f8fbe5cecef6ba939d6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 12:06:40 +0200 Subject: Normalize line endings. Added .gitattributes with text=auto setting. Ran `git add --renormalize .` to update all the checked in files. --- .gitattributes | 3 + data.js | 506 +- play.css | 1482 ++--- play.html | 420 +- play.js | 1628 ++--- rules.js | 19784 +++++++++++++++++++++++++++---------------------------- 6 files changed, 11913 insertions(+), 11910 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..aee666c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto +*.jpg binary +*.png binary diff --git a/data.js b/data.js index a4a64a8..17e7530 100644 --- a/data.js +++ b/data.js @@ -1,253 +1,253 @@ -const spaces = [ - null, - {name_unique: 'Schwerin', space_id: 1, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 111, y: 61}, adjacent: [2, 3, , , ]}, - {name_unique: 'Rostock', space_id: 2, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 228, y: 41}, adjacent: [1, 3, , , ]}, - {name_unique: 'Berlin', space_id: 3, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 251, y: 113}, adjacent: [1, 2, 5, 9, ]}, - {name_unique: 'German Writers', space_id: 4, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 185}, adjacent: [5, , , , ]}, - {name_unique: 'Walter Ulbricht Academy', space_id: 5, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 187}, adjacent: [3, 4, , , ]}, - {name_unique: 'Lutherian Church', space_id: 6, socio: 7, stability: 5, battleground: 1, demInfl: 1, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 300, y: 212}, adjacent: [9, , , , ]}, - {name_unique: 'Magdeburg', space_id: 7, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 275}, adjacent: [8, 10, 11, , ]}, - {name_unique: 'Halle', space_id: 8, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 278}, adjacent: [7, 9, 11, , ]}, - {name_unique: 'Leipzig', space_id: 9, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 297, y: 297}, adjacent: [3, 6, 8, 11, 12]}, - {name_unique: 'Erfurt', space_id: 10, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 23, y: 356}, adjacent: [7, , , , ]}, - {name_unique: 'Karl-Marx-Stadt', space_id: 11, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 138, y: 385}, adjacent: [7, 8, 9, 12, ]}, - {name_unique: 'Dresden', space_id: 12, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 262, y: 375}, adjacent: [9, 11, 19, 27, ]}, - {name_unique: 'Szczecin', space_id: 13, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 434, y: 204}, adjacent: [14, 16, , , ]}, - {name_unique: 'Gdańsk', space_id: 14, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 699, y: 215}, adjacent: [13, 15, 16, 17, 18]}, - {name_unique: 'Bydgoszcz', space_id: 15, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 304}, adjacent: [14, 17, , , ]}, - {name_unique: 'Poznań', space_id: 16, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 521, y: 355}, adjacent: [13, 14, 19, 20, ]}, - {name_unique: 'Warszawa', space_id: 17, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 806, y: 383}, adjacent: [14, 15, 18, 21, 24]}, - {name_unique: 'Białystok', space_id: 18, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 940, y: 342}, adjacent: [14, 17, 24, , ]}, - {name_unique: 'Wrocław', space_id: 19, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 462, y: 443}, adjacent: [12, 16, 20, 22, ]}, - {name_unique: 'Catholic Church, Poland', space_id: 20, socio: 7, stability: 5, battleground: 0, demInfl: 5, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 625, y: 437}, adjacent: [16, 19, 21, 22, 23]}, - {name_unique: 'Łódź', space_id: 21, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 749, y: 486}, adjacent: [17, 20, 23, 24, ]}, - {name_unique: 'Katowice', space_id: 22, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 570, y: 569}, adjacent: [19, 20, 23, 33, ]}, - {name_unique: 'Kraków', space_id: 23, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 711, y: 598}, adjacent: [20, 21, 22, 25, ]}, - {name_unique: 'Lublin', space_id: 24, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 879, y: 603}, adjacent: [17, 18, 21, , ]}, - {name_unique: 'Jagiellian University', space_id: 25, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 681}, adjacent: [23, 26, , , ]}, - {name_unique: 'Polish Writers', space_id: 26, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 832, y: 694}, adjacent: [25, , , , ]}, - {name_unique: 'Plzeň', space_id: 27, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 159, y: 483}, adjacent: [12, 28, 29, , ]}, - {name_unique: 'České Budĕjovice', space_id: 28, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 196, y: 601}, adjacent: [27, 29, , , ]}, - {name_unique: 'Praha', space_id: 29, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 317, y: 614}, adjacent: [27, 28, 30, 32, ]}, - {name_unique: 'Charles University', space_id: 30, socio: 6, stability: 1, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 380, y: 532}, adjacent: [29, 31, , , ]}, - {name_unique: 'Czech Writers', space_id: 31, socio: 5, stability: 2, battleground: 1, demInfl: 2, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 444, y: 607}, adjacent: [30, , , , ]}, - {name_unique: 'Brno', space_id: 32, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 403, y: 711}, adjacent: [29, 33, 34, , ]}, - {name_unique: 'Ostrava', space_id: 33, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 523, y: 681}, adjacent: [22, 32, 34, 35, ]}, - {name_unique: 'Bratislava', space_id: 34, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 417, y: 797}, adjacent: [32, 33, 35, , ]}, - {name_unique: 'Catholic Church, Czechoslovakia', space_id: 35, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 538, y: 794}, adjacent: [33, 34, 36, , ]}, - {name_unique: 'Prešov', space_id: 36, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 658, y: 794}, adjacent: [35, 37, , , ]}, - {name_unique: 'Košice', space_id: 37, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 777, y: 815}, adjacent: [36, 42, , , ]}, - {name_unique: 'Catholic Church, Hungary', space_id: 38, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 314, y: 886}, adjacent: [39, 43, , , ]}, - {name_unique: 'Győr', space_id: 39, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 434, y: 887}, adjacent: [38, 40, 43, 44, ]}, - {name_unique: 'Tatabánya', space_id: 40, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 549, y: 886}, adjacent: [39, 41, 45, , ]}, - {name_unique: 'Miskolc', space_id: 41, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 664, y: 901}, adjacent: [40, 42, 45, , ]}, - {name_unique: 'Debrecen', space_id: 42, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 781, y: 938}, adjacent: [37, 41, , , ]}, - {name_unique: 'Szombathely', space_id: 43, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Hungary', region: 'Eastern Europe', box: {x: 316, y: 963}, adjacent: [38, 39, 44, , ]}, - {name_unique: 'Székesfehérvár', space_id: 44, socio: 4, stability: 3, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 442, y: 962}, adjacent: [39, 43, 45, , ]}, - {name_unique: 'Budapest', space_id: 45, socio: 2, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 630, y: 983}, adjacent: [40, 41, 44, 47, 48]}, - {name_unique: 'Hungarian Writers', space_id: 46, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 348, y: 1040}, adjacent: [47, , , , ]}, - {name_unique: 'Eötvös Loránd University', space_id: 47, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 512, y: 1034}, adjacent: [46, 45, , , ]}, - {name_unique: 'Szeged', space_id: 48, socio: 3, stability: 4, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 632, y: 1073}, adjacent: [45, 49, 50, , ]}, - {name_unique: 'Pécs', space_id: 49, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 486, y: 1105}, adjacent: [48, , , , ]}, - {name_unique: 'Timişoara', space_id: 50, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 597, y: 1204}, adjacent: [48, 51, 60, , ]}, - {name_unique: 'Cluj-Napoca', space_id: 51, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 756, y: 1125}, adjacent: [50, 54, 58, 61, ]}, - {name_unique: 'Târgu Mureş', space_id: 52, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 915, y: 1136}, adjacent: [53, 56, , , ]}, - {name_unique: 'Iaşi', space_id: 53, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1072, y: 1097}, adjacent: [52, 57, 62, , ]}, - {name_unique: 'Babeş-Bolyai University', space_id: 54, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 746, y: 1203}, adjacent: [51, 55, , , ]}, - {name_unique: 'Romanian Writers', space_id: 55, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 739, y: 1278}, adjacent: [54, , , , ]}, - {name_unique: 'Hargita/Covasna', space_id: 56, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 928, y: 1227}, adjacent: [52, , , , ]}, - {name_unique: 'Braşov', space_id: 57, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1049, y: 1225}, adjacent: [53, 59, 61, , ]}, - {name_unique: 'Orthodox Church Romania', space_id: 58, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 855, y: 1338}, adjacent: [51, 60, , , ]}, - {name_unique: 'Ploieşti', space_id: 59, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1061, y: 1316}, adjacent: [57, 61, 62, , ]}, - {name_unique: 'Craiova', space_id: 60, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 763, y: 1411}, adjacent: [50, 58, 61, , ]}, - {name_unique: 'Bucureşti', space_id: 61, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 929, y: 1445}, adjacent: [51, 57, 59, 60, 63]}, - {name_unique: 'Galaţi', space_id: 62, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1104, y: 1399}, adjacent: [53, 59, 63, , ]}, - {name_unique: 'Constanţa', space_id: 63, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1130, y: 1517}, adjacent: [61, 62, 72, , ]}, - {name_unique: 'Pleven', space_id: 64, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 764, y: 1534}, adjacent: [68, , , , ]}, - {name_unique: 'Orthodox Church Bulgaria', space_id: 65, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 882, y: 1540}, adjacent: [66, 68, , , ]}, - {name_unique: 'Ruse', space_id: 66, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 998, y: 1540}, adjacent: [65, 69, 70, 71, 72]}, - {name_unique: 'Sofia University', space_id: 67, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 645, y: 1650}, adjacent: [68, 73, , , ]}, - {name_unique: 'Sofia', space_id: 68, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Bulgaria', region: 'Balkans', box: {x: 768, y: 1653}, adjacent: [64, 65, 67, 69, 74]}, - {name_unique: 'Stara Zagora', space_id: 69, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Bulgaria', region: 'Balkans', box: {x: 886, y: 1694}, adjacent: [66, 68, 71, , ]}, - {name_unique: 'Razgrad', space_id: 70, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 954, y: 1620}, adjacent: [66, , , , ]}, - {name_unique: 'Burgas', space_id: 71, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1004, y: 1695}, adjacent: [66, 69, 72, , ]}, - {name_unique: 'Varna', space_id: 72, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [63, 66, 71, , ]}, - {name_unique: 'Bulgarian Writers', space_id: 73, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [67, , , , ]}, - {name_unique: 'Plovdiv', space_id: 74, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [68, 75, , , ]}, - {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]} -] - -const cards = [ - null, - {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, - {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, playable: true, red: true}, - {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, playable: false, red: false}, - {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, playable: true, red: false}, - {number: 5, period: 1, side: 'D', name: 'General Strike*', ops: 3, remove: 0, playable: true, red: false}, - {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false}, - {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false}, - {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false}, - {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: true, red: false}, - {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, playable: true, red: false}, - {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false}, - {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false}, - {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, playable: true, red: false}, - {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: true, red: false}, - {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, playable: true, red: false}, - {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, playable: true, red: false}, - {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, playable: true, red: false}, - {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: 1, playable: true, red: false}, - {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: 1, playable: true, red: false}, - {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: 1, playable: true, red: false}, - {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: 0, playable: true, red: false}, - {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: 0, playable: true, red: false}, - {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: 0, playable: true, red: false}, - {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: 1, playable: true, red: true}, - {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: 1, playable: true, red: false}, - {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: 1, playable: true, red: true}, - {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: 0, playable: true, red: false}, - {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: 0, playable: true, red: false}, - {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: 1, playable: true, red: false}, - {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: 1, playable: true, red: false}, - {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: 0, playable: true, red: false}, - {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: 1, playable: true, red: false}, - {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: 1, playable: true, red: true}, - {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: 1, playable: true, red: false}, - {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: 1, playable: true, red: false}, - {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: 1, playable: true, red: false}, - {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: 1, playable: true, red: false}, - {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: 1, playable: true, red: false}, - {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: 1, playable: true, red: false}, - {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: 1, playable: true, red: false}, - {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: 1, playable: true, red: false}, - {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: 0, playable: true, red: false}, - {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: 0, playable: true, red: false}, - {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: 1, playable: true, red: false}, - {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: 1, playable: true, red: false}, - {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: 1, playable: true, red: false}, - {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: 1, playable: true, red: false}, - {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: 1, playable: true, red: false}, - {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: 1, playable: true, red: false}, - {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: 1, playable: true, red: false}, - {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: 1, playable: true, red: false}, - {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: 1, playable: true, red: false}, - {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: 1, playable: true, red: false}, - {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: 1, playable: true, red: true}, - {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: 0, playable: true, red: false}, - {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: 1, playable: true, red: false}, - {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: 1, playable: true, red: false}, - {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: 1, playable: true, red: false}, - {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: 1, playable: true, red: false}, - {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: 1, playable: true, red: false}, - {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: 1, playable: false, red: false}, - {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: 1, playable: true, red: false}, - {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: 1, playable: true, red: false}, - {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: 1, playable: true, red: false}, - {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: 1, playable: true, red: false}, - {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: 1, playable: true, red: false}, - {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: 1, playable: false, red: false}, - {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: 1, playable: true, red: false}, - {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: 1, playable: true, red: false}, - {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: 1, playable: true, red: false}, - {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: 1, playable: true, red: false}, - {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: 1, playable: true, red: false}, - {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: 1, playable: true, red: true}, - {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: 1, playable: true, red: false}, - {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: 1, playable: true, red: false}, - {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: 1, playable: true, red: false}, - {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: 1, playable: true, red: false}, - {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: 0, playable: true, red: false}, - {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: 1, playable: true, red: false}, - {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: 1, playable: true, red: false}, - {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: 1, playable: false, red: true}, - {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: 1, playable: true, red: false}, - {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: 1, playable: true, red: false}, - {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: 1, playable: false, red: true}, - {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: 1, playable: true, red: false}, - {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: 1, playable: true, red: false}, - {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: 1, playable: true, red: false}, - {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: 1, playable: true, red: false}, - {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: 1, playable: true, red: false}, - {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: 1, playable: true, red: false}, - {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: 1, playable: true, red: false}, - {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: 1, playable: true, red: false}, - {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: 1, playable: true, red: false}, - {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: 1, playable: true, red: false}, - {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: 0, playable: true, red: false}, - {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: 1, playable: false, red: false}, - {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: 1, playable: false, red: false}, - {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: 1, playable: true, red: false}, - {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: 1, playable: true, red: false}, - {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: 1, playable: true, red: false}, - {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: 1, playable: true, red: false}, - {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: 1, playable: true, red: false}, - {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: 1, playable: true, red: false}, - {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: 1, playable: true, red: false}, - {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: 1, playable: true, red: false}, - {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: 1, playable: true, red: false}, - {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: 1, playable: false, red: false}, - {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: 1, playable: true, red: false}, - {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: 1, playable: false, red: false}, - {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: 1, playable: true, red: false}, -] - -const power_cards = [ -null, -{number: 1, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 2, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 3, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 4, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 5, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 6, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 7, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 8, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 9, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 10, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 11, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 12, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 13, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 14, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 15, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 16, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 17, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 18, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 19, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 20, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 21, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 22, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 23, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 24, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 25, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 26, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 27, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 28, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 29, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 30, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 31, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 32, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 33, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 34, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 35, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 36, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 37, name: 'Elite Leader', value: 3, socio: 1, url: 'ps16'}, -{number: 38, name: 'Elite Leader', value: 3, socio: 1, url: 'ps17'}, -{number: 39, name: 'Elite Leader', value: 3, socio: 1, url: 'ps18'}, -{number: 40, name: 'Elite Leader', value: 3, socio: 1, url: 'ps19'}, -{number: 41, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps12'}, -{number: 42, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps13'}, -{number: 43, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps14'}, -{number: 44, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps15'}, -{number: 45, name: 'Worker Leader', value: 3, socio: 4, url: 'ps20'}, -{number: 46, name: 'Worker Leader', value: 3, socio: 4, url: 'ps21'}, -{number: 47, name: 'Church Leader', value: 3, socio: 7, url: 'ps23'}, -{number: 48, name: 'Student Leader', value: 3, socio: 6, url: 'ps22'}, -{number: 49, name: 'Scare Tactics', value: '', socio: 0, url: 'ps26'}, -{number: 50, name: 'Support Surges', value: '', socio: 0, url: 'ps25'}, -{number: 51, name: 'Support Falters', value: '', socio: 0, url: 'ps24'}, -{number: 52, name: 'Tactic Fails', value: '', socio: 0, url: 'ps27'}, -{number: 53, name: 'Rally in the Square', value: 3, socio: 0, url: 'ps1'}, -{number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, -] - - -if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } +const spaces = [ + null, + {name_unique: 'Schwerin', space_id: 1, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 111, y: 61}, adjacent: [2, 3, , , ]}, + {name_unique: 'Rostock', space_id: 2, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 228, y: 41}, adjacent: [1, 3, , , ]}, + {name_unique: 'Berlin', space_id: 3, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 251, y: 113}, adjacent: [1, 2, 5, 9, ]}, + {name_unique: 'German Writers', space_id: 4, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 185}, adjacent: [5, , , , ]}, + {name_unique: 'Walter Ulbricht Academy', space_id: 5, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 187}, adjacent: [3, 4, , , ]}, + {name_unique: 'Lutherian Church', space_id: 6, socio: 7, stability: 5, battleground: 1, demInfl: 1, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 300, y: 212}, adjacent: [9, , , , ]}, + {name_unique: 'Magdeburg', space_id: 7, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 275}, adjacent: [8, 10, 11, , ]}, + {name_unique: 'Halle', space_id: 8, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 278}, adjacent: [7, 9, 11, , ]}, + {name_unique: 'Leipzig', space_id: 9, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 297, y: 297}, adjacent: [3, 6, 8, 11, 12]}, + {name_unique: 'Erfurt', space_id: 10, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 23, y: 356}, adjacent: [7, , , , ]}, + {name_unique: 'Karl-Marx-Stadt', space_id: 11, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 138, y: 385}, adjacent: [7, 8, 9, 12, ]}, + {name_unique: 'Dresden', space_id: 12, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 262, y: 375}, adjacent: [9, 11, 19, 27, ]}, + {name_unique: 'Szczecin', space_id: 13, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 434, y: 204}, adjacent: [14, 16, , , ]}, + {name_unique: 'Gdańsk', space_id: 14, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 699, y: 215}, adjacent: [13, 15, 16, 17, 18]}, + {name_unique: 'Bydgoszcz', space_id: 15, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 304}, adjacent: [14, 17, , , ]}, + {name_unique: 'Poznań', space_id: 16, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 521, y: 355}, adjacent: [13, 14, 19, 20, ]}, + {name_unique: 'Warszawa', space_id: 17, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 806, y: 383}, adjacent: [14, 15, 18, 21, 24]}, + {name_unique: 'Białystok', space_id: 18, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 940, y: 342}, adjacent: [14, 17, 24, , ]}, + {name_unique: 'Wrocław', space_id: 19, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 462, y: 443}, adjacent: [12, 16, 20, 22, ]}, + {name_unique: 'Catholic Church, Poland', space_id: 20, socio: 7, stability: 5, battleground: 0, demInfl: 5, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 625, y: 437}, adjacent: [16, 19, 21, 22, 23]}, + {name_unique: 'Łódź', space_id: 21, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 749, y: 486}, adjacent: [17, 20, 23, 24, ]}, + {name_unique: 'Katowice', space_id: 22, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 570, y: 569}, adjacent: [19, 20, 23, 33, ]}, + {name_unique: 'Kraków', space_id: 23, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 711, y: 598}, adjacent: [20, 21, 22, 25, ]}, + {name_unique: 'Lublin', space_id: 24, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 879, y: 603}, adjacent: [17, 18, 21, , ]}, + {name_unique: 'Jagiellian University', space_id: 25, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 681}, adjacent: [23, 26, , , ]}, + {name_unique: 'Polish Writers', space_id: 26, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 832, y: 694}, adjacent: [25, , , , ]}, + {name_unique: 'Plzeň', space_id: 27, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 159, y: 483}, adjacent: [12, 28, 29, , ]}, + {name_unique: 'České Budĕjovice', space_id: 28, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 196, y: 601}, adjacent: [27, 29, , , ]}, + {name_unique: 'Praha', space_id: 29, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 317, y: 614}, adjacent: [27, 28, 30, 32, ]}, + {name_unique: 'Charles University', space_id: 30, socio: 6, stability: 1, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 380, y: 532}, adjacent: [29, 31, , , ]}, + {name_unique: 'Czech Writers', space_id: 31, socio: 5, stability: 2, battleground: 1, demInfl: 2, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 444, y: 607}, adjacent: [30, , , , ]}, + {name_unique: 'Brno', space_id: 32, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 403, y: 711}, adjacent: [29, 33, 34, , ]}, + {name_unique: 'Ostrava', space_id: 33, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 523, y: 681}, adjacent: [22, 32, 34, 35, ]}, + {name_unique: 'Bratislava', space_id: 34, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 417, y: 797}, adjacent: [32, 33, 35, , ]}, + {name_unique: 'Catholic Church, Czechoslovakia', space_id: 35, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 538, y: 794}, adjacent: [33, 34, 36, , ]}, + {name_unique: 'Prešov', space_id: 36, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 658, y: 794}, adjacent: [35, 37, , , ]}, + {name_unique: 'Košice', space_id: 37, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 777, y: 815}, adjacent: [36, 42, , , ]}, + {name_unique: 'Catholic Church, Hungary', space_id: 38, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 314, y: 886}, adjacent: [39, 43, , , ]}, + {name_unique: 'Győr', space_id: 39, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 434, y: 887}, adjacent: [38, 40, 43, 44, ]}, + {name_unique: 'Tatabánya', space_id: 40, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 549, y: 886}, adjacent: [39, 41, 45, , ]}, + {name_unique: 'Miskolc', space_id: 41, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 664, y: 901}, adjacent: [40, 42, 45, , ]}, + {name_unique: 'Debrecen', space_id: 42, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 781, y: 938}, adjacent: [37, 41, , , ]}, + {name_unique: 'Szombathely', space_id: 43, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Hungary', region: 'Eastern Europe', box: {x: 316, y: 963}, adjacent: [38, 39, 44, , ]}, + {name_unique: 'Székesfehérvár', space_id: 44, socio: 4, stability: 3, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 442, y: 962}, adjacent: [39, 43, 45, , ]}, + {name_unique: 'Budapest', space_id: 45, socio: 2, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 630, y: 983}, adjacent: [40, 41, 44, 47, 48]}, + {name_unique: 'Hungarian Writers', space_id: 46, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 348, y: 1040}, adjacent: [47, , , , ]}, + {name_unique: 'Eötvös Loránd University', space_id: 47, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 512, y: 1034}, adjacent: [46, 45, , , ]}, + {name_unique: 'Szeged', space_id: 48, socio: 3, stability: 4, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 632, y: 1073}, adjacent: [45, 49, 50, , ]}, + {name_unique: 'Pécs', space_id: 49, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 486, y: 1105}, adjacent: [48, , , , ]}, + {name_unique: 'Timişoara', space_id: 50, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 597, y: 1204}, adjacent: [48, 51, 60, , ]}, + {name_unique: 'Cluj-Napoca', space_id: 51, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 756, y: 1125}, adjacent: [50, 54, 58, 61, ]}, + {name_unique: 'Târgu Mureş', space_id: 52, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 915, y: 1136}, adjacent: [53, 56, , , ]}, + {name_unique: 'Iaşi', space_id: 53, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1072, y: 1097}, adjacent: [52, 57, 62, , ]}, + {name_unique: 'Babeş-Bolyai University', space_id: 54, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 746, y: 1203}, adjacent: [51, 55, , , ]}, + {name_unique: 'Romanian Writers', space_id: 55, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 739, y: 1278}, adjacent: [54, , , , ]}, + {name_unique: 'Hargita/Covasna', space_id: 56, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 928, y: 1227}, adjacent: [52, , , , ]}, + {name_unique: 'Braşov', space_id: 57, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1049, y: 1225}, adjacent: [53, 59, 61, , ]}, + {name_unique: 'Orthodox Church Romania', space_id: 58, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 855, y: 1338}, adjacent: [51, 60, , , ]}, + {name_unique: 'Ploieşti', space_id: 59, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1061, y: 1316}, adjacent: [57, 61, 62, , ]}, + {name_unique: 'Craiova', space_id: 60, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 763, y: 1411}, adjacent: [50, 58, 61, , ]}, + {name_unique: 'Bucureşti', space_id: 61, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 929, y: 1445}, adjacent: [51, 57, 59, 60, 63]}, + {name_unique: 'Galaţi', space_id: 62, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1104, y: 1399}, adjacent: [53, 59, 63, , ]}, + {name_unique: 'Constanţa', space_id: 63, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1130, y: 1517}, adjacent: [61, 62, 72, , ]}, + {name_unique: 'Pleven', space_id: 64, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 764, y: 1534}, adjacent: [68, , , , ]}, + {name_unique: 'Orthodox Church Bulgaria', space_id: 65, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 882, y: 1540}, adjacent: [66, 68, , , ]}, + {name_unique: 'Ruse', space_id: 66, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 998, y: 1540}, adjacent: [65, 69, 70, 71, 72]}, + {name_unique: 'Sofia University', space_id: 67, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 645, y: 1650}, adjacent: [68, 73, , , ]}, + {name_unique: 'Sofia', space_id: 68, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Bulgaria', region: 'Balkans', box: {x: 768, y: 1653}, adjacent: [64, 65, 67, 69, 74]}, + {name_unique: 'Stara Zagora', space_id: 69, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Bulgaria', region: 'Balkans', box: {x: 886, y: 1694}, adjacent: [66, 68, 71, , ]}, + {name_unique: 'Razgrad', space_id: 70, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 954, y: 1620}, adjacent: [66, , , , ]}, + {name_unique: 'Burgas', space_id: 71, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1004, y: 1695}, adjacent: [66, 69, 72, , ]}, + {name_unique: 'Varna', space_id: 72, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [63, 66, 71, , ]}, + {name_unique: 'Bulgarian Writers', space_id: 73, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [67, , , , ]}, + {name_unique: 'Plovdiv', space_id: 74, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [68, 75, , , ]}, + {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]} +] + +const cards = [ + null, + {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, + {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, playable: true, red: true}, + {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, playable: false, red: false}, + {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, playable: true, red: false}, + {number: 5, period: 1, side: 'D', name: 'General Strike*', ops: 3, remove: 0, playable: true, red: false}, + {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false}, + {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false}, + {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false}, + {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: true, red: false}, + {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, playable: true, red: false}, + {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false}, + {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false}, + {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, playable: true, red: false}, + {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: true, red: false}, + {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, playable: true, red: false}, + {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, playable: true, red: false}, + {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, playable: true, red: false}, + {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: 1, playable: true, red: false}, + {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: 1, playable: true, red: false}, + {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: 1, playable: true, red: false}, + {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: 0, playable: true, red: false}, + {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: 0, playable: true, red: false}, + {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: 0, playable: true, red: false}, + {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: 1, playable: true, red: true}, + {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: 1, playable: true, red: false}, + {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: 1, playable: true, red: true}, + {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: 0, playable: true, red: false}, + {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: 0, playable: true, red: false}, + {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: 1, playable: true, red: false}, + {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: 1, playable: true, red: false}, + {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: 0, playable: true, red: false}, + {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: 1, playable: true, red: false}, + {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: 1, playable: true, red: true}, + {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: 1, playable: true, red: false}, + {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: 1, playable: true, red: false}, + {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: 1, playable: true, red: false}, + {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: 1, playable: true, red: false}, + {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: 1, playable: true, red: false}, + {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: 1, playable: true, red: false}, + {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: 1, playable: true, red: false}, + {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: 1, playable: true, red: false}, + {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: 0, playable: true, red: false}, + {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: 0, playable: true, red: false}, + {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: 1, playable: true, red: false}, + {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: 1, playable: true, red: false}, + {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: 1, playable: true, red: false}, + {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: 1, playable: true, red: false}, + {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: 1, playable: true, red: false}, + {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: 1, playable: true, red: false}, + {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: 1, playable: true, red: false}, + {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: 1, playable: true, red: false}, + {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: 1, playable: true, red: false}, + {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: 1, playable: true, red: false}, + {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: 1, playable: true, red: true}, + {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: 0, playable: true, red: false}, + {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: 1, playable: true, red: false}, + {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: 1, playable: true, red: false}, + {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: 1, playable: true, red: false}, + {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: 1, playable: true, red: false}, + {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: 1, playable: true, red: false}, + {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: 1, playable: false, red: false}, + {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: 1, playable: true, red: false}, + {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: 1, playable: true, red: false}, + {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: 1, playable: true, red: false}, + {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: 1, playable: true, red: false}, + {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: 1, playable: true, red: false}, + {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: 1, playable: false, red: false}, + {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: 1, playable: true, red: false}, + {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: 1, playable: true, red: false}, + {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: 1, playable: true, red: false}, + {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: 1, playable: true, red: false}, + {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: 1, playable: true, red: false}, + {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: 1, playable: true, red: true}, + {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: 1, playable: true, red: false}, + {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: 1, playable: true, red: false}, + {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: 1, playable: true, red: false}, + {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: 1, playable: true, red: false}, + {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: 0, playable: true, red: false}, + {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: 1, playable: true, red: false}, + {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: 1, playable: true, red: false}, + {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: 1, playable: false, red: true}, + {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: 1, playable: true, red: false}, + {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: 1, playable: true, red: false}, + {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: 1, playable: false, red: true}, + {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: 1, playable: true, red: false}, + {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: 1, playable: true, red: false}, + {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: 1, playable: true, red: false}, + {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: 1, playable: true, red: false}, + {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: 1, playable: true, red: false}, + {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: 1, playable: true, red: false}, + {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: 1, playable: true, red: false}, + {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: 1, playable: true, red: false}, + {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: 1, playable: true, red: false}, + {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: 1, playable: true, red: false}, + {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: 0, playable: true, red: false}, + {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: 1, playable: false, red: false}, + {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: 1, playable: false, red: false}, + {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: 1, playable: true, red: false}, + {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: 1, playable: true, red: false}, + {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: 1, playable: true, red: false}, + {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: 1, playable: true, red: false}, + {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: 1, playable: true, red: false}, + {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: 1, playable: true, red: false}, + {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: 1, playable: true, red: false}, + {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: 1, playable: true, red: false}, + {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: 1, playable: true, red: false}, + {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: 1, playable: false, red: false}, + {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: 1, playable: true, red: false}, + {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: 1, playable: false, red: false}, + {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: 1, playable: true, red: false}, +] + +const power_cards = [ +null, +{number: 1, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, +{number: 2, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, +{number: 3, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, +{number: 4, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, +{number: 5, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, +{number: 6, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, +{number: 7, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, +{number: 8, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, +{number: 9, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, +{number: 10, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, +{number: 11, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, +{number: 12, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, +{number: 13, name: 'March', value: 6, socio: 0, url: 'ps6'}, +{number: 14, name: 'March', value: 6, socio: 0, url: 'ps6'}, +{number: 15, name: 'March', value: 5, socio: 0, url: 'ps7'}, +{number: 16, name: 'March', value: 5, socio: 0, url: 'ps7'}, +{number: 17, name: 'March', value: 4, socio: 0, url: 'ps8'}, +{number: 18, name: 'March', value: 4, socio: 0, url: 'ps8'}, +{number: 19, name: 'March', value: 4, socio: 0, url: 'ps8'}, +{number: 20, name: 'March', value: 4, socio: 0, url: 'ps8'}, +{number: 21, name: 'March', value: 3, socio: 0, url: 'ps9'}, +{number: 22, name: 'March', value: 3, socio: 0, url: 'ps9'}, +{number: 23, name: 'March', value: 3, socio: 0, url: 'ps9'}, +{number: 24, name: 'March', value: 3, socio: 0, url: 'ps9'}, +{number: 25, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 26, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 27, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 28, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 29, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 30, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, +{number: 31, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, +{number: 32, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, +{number: 33, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, +{number: 34, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, +{number: 35, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, +{number: 36, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, +{number: 37, name: 'Elite Leader', value: 3, socio: 1, url: 'ps16'}, +{number: 38, name: 'Elite Leader', value: 3, socio: 1, url: 'ps17'}, +{number: 39, name: 'Elite Leader', value: 3, socio: 1, url: 'ps18'}, +{number: 40, name: 'Elite Leader', value: 3, socio: 1, url: 'ps19'}, +{number: 41, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps12'}, +{number: 42, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps13'}, +{number: 43, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps14'}, +{number: 44, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps15'}, +{number: 45, name: 'Worker Leader', value: 3, socio: 4, url: 'ps20'}, +{number: 46, name: 'Worker Leader', value: 3, socio: 4, url: 'ps21'}, +{number: 47, name: 'Church Leader', value: 3, socio: 7, url: 'ps23'}, +{number: 48, name: 'Student Leader', value: 3, socio: 6, url: 'ps22'}, +{number: 49, name: 'Scare Tactics', value: '', socio: 0, url: 'ps26'}, +{number: 50, name: 'Support Surges', value: '', socio: 0, url: 'ps25'}, +{number: 51, name: 'Support Falters', value: '', socio: 0, url: 'ps24'}, +{number: 52, name: 'Tactic Fails', value: '', socio: 0, url: 'ps27'}, +{number: 53, name: 'Rally in the Square', value: 3, socio: 0, url: 'ps1'}, +{number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, +] + + +if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } diff --git a/play.css b/play.css index f9ed02e..2a65885 100644 --- a/play.css +++ b/play.css @@ -1,741 +1,741 @@ -main { background-color: dimgray; } -header { background-color: silver; } -header.your_turn { background-color: orange; } -#role_Democrat { background-color: hsl(200, 80%, 80%); } -#role_Communist { background-color: hsl(0, 80%, 80%); } -#turn_info { background-color: white; } -/*.aside_events { - font-family: "Source Sans"; - font-style: normal; - font-size: 16px; - line-height: 1.5; -}*/ -#deck_data { - font-family: "Source Sans"; - font-style: normal; - font-size: 16px; - line-height: 1.5; -} -#deck_stat {padding-left: 5px; padding-bottom: 5px;} - - -#log { background-color: whitesmoke; } -#log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } -#log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } -#log .h3 { text-align: center; } -#log .h4 { text-decoration: underline; } -#log .h5 { text-decoration: underline; } - -#log .h2 { background-color: hsl(0,0%,80%);} -#log .h1 { background-color: hsl(0,0%,80%); } -#log .h2.dem { background-color: hsl(200, 80%, 80%); } -#log .h2.com { background-color: hsl(0, 80%, 80%); } -#log .h3.democrat { background-color: hsl(210,30%,90%); } -#log .h3.h2.communist { background-color: hsl(35,40%,90%); } - -#log div { padding-left: 20px; text-indent: -12px; } -#log div.i { padding-left: 32px; text-indent: -12px; } -#log div.ii { padding-left: 44px; text-indent: -12px; } - - -#log .card_name { font-style: italic; } -#log .card_name:hover { text-decoration: underline; } -#log .space_tip:hover { cursor: pointer; text-decoration: underline; } - -#log .die { - display: inline-block; - vertical-align: -3px; - width: 12px; - height: 12px; - background-size: 600% 100%; - background-repeat: no-repeat; - background-image: url(images/die_black_pips.svg); - background-color: #fff; - border: 1px solid #444; -} - -#log .d0 { background-position: -100% 0 } -#log .d1 { background-position: 0% 0; } -#log .d2 { background-position: 20% 0; } -#log .d3 { background-position: 40% 0; } -#log .d4 { background-position: 60% 0; } -#log .d5 { background-position: 80% 0; } -#log .d6 { background-position: 100% 0; } - -.selected { - cursor: pointer; -} - -#log { - font-variant-numeric: tabular-nums; -} - -/* TOOLBAR */ - -#toolbar { - justify-content: space-evenly; -} - -#prompt { - display: flex; - margin-left: auto; -} - -#button { - display: flex; - margin-left: auto; -} -/* MAP */ - -#map { - margin: 0 auto ; - position: relative; - background-repeat: no-repeat; - background-size: cover; - width: 1275px; /* was 1275*/ - height: 2000px; - /*border: solid black;*/ - overflow: clip; - box-shadow: 0px 1px 10px #0008; - /*z-index: 3;*/ -} - -#map { background-image: url(1989_map.jpg) } - -/* Containers to appear on hover*/ - #overlay { - position: relative; - top: 0; - left: 0; - width: 100%; - height: 100%; - /* background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent overlay */ - /* display: none;*/ - justify-content: center; - align-items: center; - text-align: left; - } - -/* SPACES */ - -.space-area { - position: absolute; - box-sizing: border-box; - border: transparent red 2px; -} - -/* PANELS AND HANDS */ - -.panel { - background-color: #555; - display: inline-block; -} - -.panel_header { - background-color: #444; - color: hsl(40, 60%, 90%); - font-weight: bold; - text-align: center; - padding: 3px 1em; -} - -.hide { - display: none; -} - -#hand_panel, #events_panel, #played_card_panel, #table_panel, #samizdat_panel, #opp_hand_panel, #power_panel, #ceausescu_panel { - min-width: 200px; - width: auto; - /*display: inline-block;*/ - margin: 10px; - border-radius: 5px; -} - -#events { - display: flex; -} - -#discard_panel, #removed_panel { - min-width: 200px; - width: auto; - display: inline-block; - margin: 10px; - border-radius: 5px; -} - -#discard_panel.hide, #removed_panel.hide { - display: none; -} - -#hand_panel { - margin: 10px; - border-radius: 5px; -} - -/* INFLUENCE MARKERS */ - -.demInfl { - position: absolute; - box-sizing: border-box; - bottom: 1px; - left: 6px; - height: 35px; - width: 35px; - border-radius: 5px; -} - -.demInfl.controlled { - background-image: url(images/US_blank.gif); - background-size: contain; -} - - -.demInfl.uncontrolled { - background-image: url(images/USd_blank.gif); - background-size: contain; -} -/* -.demInfl:hover { - cursor: pointer; -}*/ - -.comInfl { - position: absolute; - box-sizing: border-box; - bottom: 1px; - right: 6px; - height: 35px; - width: 35px; -} -/* -.comInfl:hover { - cursor: pointer; -}*/ - -.comInfl.controlled { - background-image: url(images/SV_blank.gif); - background-size: contain; -} - - -.comInfl.uncontrolled { - background-image: url(images/SVd_blank.gif); - background-size: contain; -} - -.demInflValue { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 10px; - left: 16px; -} - -.demInflValue_10 { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 10px; - left: 10px; -} - -.comInflValue { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 12px; - left: 74px; -} - -.comInflValue_10 { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 12px; - left: 68px; -} - -.comInflValue.controlled, .held { - color: whitesmoke; - text-shadow: - 1px 1px 0 #c2272d, /* Right bottom */ - -1px 1px 0 #c2272d, /* Left bottom */ - 1px -1px 0 #c2272d, /* Right top */ - -1px -1px 0 #c2272d; /* Left top */ -} - -.comInflValue.uncontrolled { - color: #c2272d; - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} - -.comInflValue_10.controlled, .held { - color: whitesmoke; - text-shadow: - 1px 1px 0 #c2272d, /* Right bottom */ - -1px 1px 0 #c2272d, /* Left bottom */ - 1px -1px 0 #c2272d, /* Right top */ - -1px -1px 0 #c2272d; /* Left top */ -} - -.comInflValue_10.uncontrolled { - color: #c2272d; - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} - - -/* GAME MARKERS */ - -.t0 {left: 511px} -.t1 {left: 511px} -.t2 {left: 553px} -.t3 {left: 595px} -.t4 {left: 637px} -.t5 {left: 679px} -.t6 {left: 721px} -.t7 {left: 763px} -.t8 {left: 805px} -.t9 {left: 847px} -.t10 {left: 889px} - -#turn-tracker { - position:absolute; - top: 65px; - height: 35px; - width: 36px; - /*display: block;*/ -} - -.r0 {left: 554px} -.r1 {left: 554px} -.r2 {left: 596px} -.r3 {left: 638px} -.r4 {left: 680px} -.r5 {left: 722px} -.r6 {left: 764px} -.r7 {left: 806px} -.r8 {left: 848px} - -.dem-action-round-tracker { background-image: url(images/US_Action_Round.gif);} -.com-action-round-tracker { background-image: url(images/SV_Action_Round.gif);} - -#action-round-tracker { - position: absolute; - top: 114px; - height: 30px; - width: 35px; - background-size: cover; -} - - - -#stability-track { - position:absolute; - left: 1085px; - height: 35px; - width: 35px; -} - -.s0 {top: 853px} -.s1 {top: 896px} -.s2 {top: 939px} -.s3 {top: 982px} -.s4 {top: 1025px} - - -.tst0 {left: 0} -.tst1 {left: 38px} -.tst2 {left: 93px} -.tst3 {left: 148px} -.tst4 {left: 203px} -.tst5 {left: 258px} -.tst6 {left: 313px} -.tst7 {left: 368px} -.tst8 {left: 436px} - -#dem-TST { - position: absolute; - top: 1680px; - height: 35px; - width: 35px; -} - -#com-TST { - position: absolute; - top: 1782px; - height: 35px; - width: 35px; -} - -.vp0 {top: 1913px; -left: 660px} - -.vp-20, .vp-18, .vp-16, .vp-14, .vp-12, .vp-10, .vp-8, .vp-6, .vp-4, .vp-2, .vp1, .vp3, .vp5, .vp7, .vp9, .vp11, .vp13, .vp15, .vp17, .vp19 {top: 1889px} -.vp-19, .vp-17, .vp-15, .vp-13, .vp-11, .vp-9, .vp-7, .vp-5, .vp-3, .vp-1, .vp2, .vp4, .vp6, .vp8, .vp10, .vp12, .vp14, .vp16, .vp18, .vp20 {top: 1938px} - -.vp-21 {top: 1912px; left: 117px} -.vp21 {top: 1912px; left: 1182px} - -.vp-20 {left: 165px} -.vp-19 {left: 189px} -.vp-18 {left: 214px} -.vp-17 {left: 238px} -.vp-16 {left: 263px} -.vp-15 {left: 287px} -.vp-14 {left: 312px} -.vp-13 {left: 336px} -.vp-12 {left: 361px} -.vp-11 {left: 385px} -.vp-10 {left: 410px} -.vp-9 {left: 434px} -.vp-8 {left: 459px} -.vp-7 {left: 483px} -.vp-6 {left: 508px} -.vp-5 {left: 532px} -.vp-4 {left: 557px} -.vp-3 {left: 581px} -.vp-2 {left: 606px} -.vp-1 {left: 630px} -.vp1 {left: 692px} -.vp2 {left: 717px} -.vp3 {left: 741px} -.vp4 {left: 766px} -.vp5 {left: 790px} -.vp6 {left: 815px} -.vp7 {left: 839px} -.vp8 {left: 864px} -.vp9 {left: 888px} -.vp10 {left: 913px} -.vp11 {left: 937px} -.vp12 {left: 962px} -.vp13 {left: 986px} -.vp14 {left: 1011px} -.vp15 {left: 1035px} -.vp16 {left: 1060px} -.vp17 {left: 1084px} -.vp18 {left: 1109px} -.vp19 {left: 1133px} -.vp20 {left: 1158px} - -#vp { - position: absolute; - height: 40px; - width: 40px; -} - -.marker { - position: absolute; - height: 30px; - width: 30px; -} - -.revolution {background-image: url(images/US_blank.gif); background-size: contain} -.held {background-image: url(images/SV_blank.gif); background-size: contain} - -.germany {top: 127px; left: 439px} -.poland { top: 232px; left: 934px} -.czech {top: 494px; left: 362px} -.hungary {top: 1041px; left: 813px} -.romania {top: 1063px; left: 1012px} -.bulgaria {top: 1578px; left: 720px} - -.times_held { - position: absolute; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: -18px; - left: 8px -} - -.outlined_text { - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} - -/* ============= EVENT MARKERS ========== */ - -.event-marker { - display: none; - position: absolute; - height: 30px; - width: 30px; - transition: transform 0.3s ease; -} - -.event-marker:hover { - cursor: pointer; - transform: scale(2); - z-index: 1; -} - -.event-marker.aside { - border: solid black 1.5px; - margin: 3px; - position: relative; -} - -#turn_info { - display: flex; - flex-direction: column; - align-items: flex-start; -} - -#turn_info > div { - display: flex; - margin-bottom: 8px; - gap: 4px; -} - -#turn_info > img { - display: block; - -} - -/*Solidarity legalised*/ -#event_2 { - top: 216px; - left: 612px; -} - -/*Systematisation*/ -#event_69 { - height: 65px; - width: 65px; -} - -/*The Tyrant is Gone*/ -#event_97 { - height: 40px; - width: 40px; -} - -/*The Wall*/ -#event_9 { - top: 143px; - left: 170px; -} - - -/* =========== CARDS ================= */ -/* -.playedCard { - display: flex; - margin: auto; - height: 300px; -}*/ - -.hand_card { - background-size: contain; - height: 250px; - margin: 10px; - border-radius: 5px; - transition: transform .3s ease 0.5s; -} -/* -.hand_card:hover { - cursor: pointer; -}*/ - -.zoom { - transform: scale(1.75) -} - -.power_card { - background-size: contain; - height: 250px; - margin: 10px; - border-radius: 5px; -} - -.discard_card, .event_card { - background-size: contain; - height: 150px; - margin: 5px; - border-radius: 5px; - transition: transform .3s ease; -} - -.discard_card:hover, .event_card:hover { - /*cursor: pointer;*/ - transform: scale(2); -} - -.selected.space-area { - background-color: #0002; - outline: solid white 2px; - /*box-shadow: 0 0 4px white; */ - border-radius: 10px 10px 0 0; -} - -.space-area.tip { - background-color: #ff08; - outline: solid white 2px; - box-shadow: 0 0 8px #ff08; - border-radius: 10px 10px 0 0; -} - -.selected.hand_card { - outline: solid silver 3px; - /*box-shadow: 0 0 4px white; */ - border-radius: 18px; -} - - -.selected.power_card { - outline: solid silver 3px; - /*box-shadow: 0 0 4px white; */ - border-radius: 18px; -} - -/* =============== OTHER ===============*/ -#space-characteristics {display: none} - -/* =============== CARD IMAGES =========*/ - -#tooltip { - position: fixed; - pointer-events: none; - z-index: 600; - right: 240px; - top: 60px; -} - -.card { - background-size: cover; - background-repeat: no-repeat; - width: 250px; - height: 350px; - border-radius: 16px; - box-shadow: 1px 2px 4px #0004; -} - -.card_1 {background-image: url(cards/e1.gif)} -.card_2 {background-image: url(cards/e2.gif)} -.card_3 {background-image: url(cards/e3.gif)} -.card_4 {background-image: url(cards/e4.gif)} -.card_5 {background-image: url(cards/e5.gif)} -.card_6 {background-image: url(cards/e6.gif)} -.card_7 {background-image: url(cards/e7.gif)} -.card_8 {background-image: url(cards/e8.gif)} -.card_9 {background-image: url(cards/e9.gif)} -.card_10 {background-image: url(cards/e10.gif)} -.card_11 {background-image: url(cards/e11.gif)} -.card_12 {background-image: url(cards/e12.gif)} -.card_13 {background-image: url(cards/e13.gif)} -.card_14 {background-image: url(cards/e14.gif)} -.card_15 {background-image: url(cards/e15.gif)} -.card_16 {background-image: url(cards/e16.gif)} -.card_17 {background-image: url(cards/e17.gif)} -.card_18 {background-image: url(cards/e18.gif)} -.card_19 {background-image: url(cards/e19.gif)} -.card_20 {background-image: url(cards/e20.gif)} -.card_21 {background-image: url(cards/e21.gif)} -.card_22 {background-image: url(cards/e22.gif)} -.card_23 {background-image: url(cards/e23.gif)} -.card_24 {background-image: url(cards/e24.gif)} -.card_25 {background-image: url(cards/e25.gif)} -.card_26 {background-image: url(cards/e26.gif)} -.card_27 {background-image: url(cards/e27.gif)} -.card_28 {background-image: url(cards/e28.gif)} -.card_29 {background-image: url(cards/e29.gif)} -.card_30 {background-image: url(cards/e30.gif)} -.card_31 {background-image: url(cards/e31.gif)} -.card_32 {background-image: url(cards/e32.gif)} -.card_33 {background-image: url(cards/e33.gif)} -.card_34 {background-image: url(cards/e34.gif)} -.card_35 {background-image: url(cards/e35.gif)} -.card_36 {background-image: url(cards/e36.gif)} -.card_37 {background-image: url(cards/e37.gif)} -.card_38 {background-image: url(cards/e38.gif)} -.card_39 {background-image: url(cards/e39.gif)} -.card_40 {background-image: url(cards/e40.gif)} -.card_41 {background-image: url(cards/e41.gif)} -.card_42 {background-image: url(cards/e42.gif)} -.card_43 {background-image: url(cards/e43.gif)} -.card_44 {background-image: url(cards/e44.gif)} -.card_45 {background-image: url(cards/e45.gif)} -.card_46 {background-image: url(cards/e46.gif)} -.card_47 {background-image: url(cards/e47.gif)} -.card_48 {background-image: url(cards/e48.gif)} -.card_49 {background-image: url(cards/e49.gif)} -.card_50 {background-image: url(cards/e50.gif)} -.card_51 {background-image: url(cards/e51.gif)} -.card_52 {background-image: url(cards/e52.gif)} -.card_53 {background-image: url(cards/e53.gif)} -.card_54 {background-image: url(cards/e54.gif)} -.card_55 {background-image: url(cards/e55.gif)} -.card_56 {background-image: url(cards/e56.gif)} -.card_57 {background-image: url(cards/e57.gif)} -.card_58 {background-image: url(cards/e58.gif)} -.card_59 {background-image: url(cards/e59.gif)} -.card_60 {background-image: url(cards/e60.gif)} -.card_61 {background-image: url(cards/e61.gif)} -.card_62 {background-image: url(cards/e62.gif)} -.card_63 {background-image: url(cards/e63.gif)} -.card_64 {background-image: url(cards/e64.gif)} -.card_65 {background-image: url(cards/e65.gif)} -.card_66 {background-image: url(cards/e66.gif)} -.card_67 {background-image: url(cards/e67.gif)} -.card_68 {background-image: url(cards/e68.gif)} -.card_69 {background-image: url(cards/e69.gif)} -.card_70 {background-image: url(cards/e70.gif)} -.card_71 {background-image: url(cards/e71.gif)} -.card_72 {background-image: url(cards/e72.gif)} -.card_73 {background-image: url(cards/e73.gif)} -.card_74 {background-image: url(cards/e74.gif)} -.card_75 {background-image: url(cards/e75.gif)} -.card_76 {background-image: url(cards/e76.gif)} -.card_77 {background-image: url(cards/e77.gif)} -.card_78 {background-image: url(cards/e78.gif)} -.card_79 {background-image: url(cards/e79.gif)} -.card_80 {background-image: url(cards/e80.gif)} -.card_81 {background-image: url(cards/e81.gif)} -.card_82 {background-image: url(cards/e82.gif)} -.card_83 {background-image: url(cards/e83.gif)} -.card_84 {background-image: url(cards/e84.gif)} -.card_85 {background-image: url(cards/e85.gif)} -.card_86 {background-image: url(cards/e86.gif)} -.card_87 {background-image: url(cards/e87.gif)} -.card_88 {background-image: url(cards/e88.gif)} -.card_89 {background-image: url(cards/e89.gif)} -.card_90 {background-image: url(cards/e90.gif)} -.card_91 {background-image: url(cards/e91.gif)} -.card_92 {background-image: url(cards/e92.gif)} -.card_93 {background-image: url(cards/e93.gif)} -.card_94 {background-image: url(cards/e94.gif)} -.card_95 {background-image: url(cards/e95.gif)} -.card_96 {background-image: url(cards/e96.gif)} -.card_97 {background-image: url(cards/e97.gif)} -.card_98 {background-image: url(cards/e98.gif)} -.card_99 {background-image: url(cards/e99.gif)} -.card_100 {background-image: url(cards/e100.gif)} -.card_101 {background-image: url(cards/e101.gif)} -.card_102 {background-image: url(cards/e102.gif)} -.card_103 {background-image: url(cards/e103.gif)} -.card_104 {background-image: url(cards/e104.gif)} -.card_105 {background-image: url(cards/e105.gif)} -.card_106 {background-image: url(cards/e106.gif)} -.card_107 {background-image: url(cards/e107.gif)} -.card_108 {background-image: url(cards/e108.gif)} -.card_109 {background-image: url(cards/e109.gif)} -.card_110 {background-image: url(cards/e110.gif)} +main { background-color: dimgray; } +header { background-color: silver; } +header.your_turn { background-color: orange; } +#role_Democrat { background-color: hsl(200, 80%, 80%); } +#role_Communist { background-color: hsl(0, 80%, 80%); } +#turn_info { background-color: white; } +/*.aside_events { + font-family: "Source Sans"; + font-style: normal; + font-size: 16px; + line-height: 1.5; +}*/ +#deck_data { + font-family: "Source Sans"; + font-style: normal; + font-size: 16px; + line-height: 1.5; +} +#deck_stat {padding-left: 5px; padding-bottom: 5px;} + + +#log { background-color: whitesmoke; } +#log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } +#log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } +#log .h3 { text-align: center; } +#log .h4 { text-decoration: underline; } +#log .h5 { text-decoration: underline; } + +#log .h2 { background-color: hsl(0,0%,80%);} +#log .h1 { background-color: hsl(0,0%,80%); } +#log .h2.dem { background-color: hsl(200, 80%, 80%); } +#log .h2.com { background-color: hsl(0, 80%, 80%); } +#log .h3.democrat { background-color: hsl(210,30%,90%); } +#log .h3.h2.communist { background-color: hsl(35,40%,90%); } + +#log div { padding-left: 20px; text-indent: -12px; } +#log div.i { padding-left: 32px; text-indent: -12px; } +#log div.ii { padding-left: 44px; text-indent: -12px; } + + +#log .card_name { font-style: italic; } +#log .card_name:hover { text-decoration: underline; } +#log .space_tip:hover { cursor: pointer; text-decoration: underline; } + +#log .die { + display: inline-block; + vertical-align: -3px; + width: 12px; + height: 12px; + background-size: 600% 100%; + background-repeat: no-repeat; + background-image: url(images/die_black_pips.svg); + background-color: #fff; + border: 1px solid #444; +} + +#log .d0 { background-position: -100% 0 } +#log .d1 { background-position: 0% 0; } +#log .d2 { background-position: 20% 0; } +#log .d3 { background-position: 40% 0; } +#log .d4 { background-position: 60% 0; } +#log .d5 { background-position: 80% 0; } +#log .d6 { background-position: 100% 0; } + +.selected { + cursor: pointer; +} + +#log { + font-variant-numeric: tabular-nums; +} + +/* TOOLBAR */ + +#toolbar { + justify-content: space-evenly; +} + +#prompt { + display: flex; + margin-left: auto; +} + +#button { + display: flex; + margin-left: auto; +} +/* MAP */ + +#map { + margin: 0 auto ; + position: relative; + background-repeat: no-repeat; + background-size: cover; + width: 1275px; /* was 1275*/ + height: 2000px; + /*border: solid black;*/ + overflow: clip; + box-shadow: 0px 1px 10px #0008; + /*z-index: 3;*/ +} + +#map { background-image: url(1989_map.jpg) } + +/* Containers to appear on hover*/ + #overlay { + position: relative; + top: 0; + left: 0; + width: 100%; + height: 100%; + /* background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent overlay */ + /* display: none;*/ + justify-content: center; + align-items: center; + text-align: left; + } + +/* SPACES */ + +.space-area { + position: absolute; + box-sizing: border-box; + border: transparent red 2px; +} + +/* PANELS AND HANDS */ + +.panel { + background-color: #555; + display: inline-block; +} + +.panel_header { + background-color: #444; + color: hsl(40, 60%, 90%); + font-weight: bold; + text-align: center; + padding: 3px 1em; +} + +.hide { + display: none; +} + +#hand_panel, #events_panel, #played_card_panel, #table_panel, #samizdat_panel, #opp_hand_panel, #power_panel, #ceausescu_panel { + min-width: 200px; + width: auto; + /*display: inline-block;*/ + margin: 10px; + border-radius: 5px; +} + +#events { + display: flex; +} + +#discard_panel, #removed_panel { + min-width: 200px; + width: auto; + display: inline-block; + margin: 10px; + border-radius: 5px; +} + +#discard_panel.hide, #removed_panel.hide { + display: none; +} + +#hand_panel { + margin: 10px; + border-radius: 5px; +} + +/* INFLUENCE MARKERS */ + +.demInfl { + position: absolute; + box-sizing: border-box; + bottom: 1px; + left: 6px; + height: 35px; + width: 35px; + border-radius: 5px; +} + +.demInfl.controlled { + background-image: url(images/US_blank.gif); + background-size: contain; +} + + +.demInfl.uncontrolled { + background-image: url(images/USd_blank.gif); + background-size: contain; +} +/* +.demInfl:hover { + cursor: pointer; +}*/ + +.comInfl { + position: absolute; + box-sizing: border-box; + bottom: 1px; + right: 6px; + height: 35px; + width: 35px; +} +/* +.comInfl:hover { + cursor: pointer; +}*/ + +.comInfl.controlled { + background-image: url(images/SV_blank.gif); + background-size: contain; +} + + +.comInfl.uncontrolled { + background-image: url(images/SVd_blank.gif); + background-size: contain; +} + +.demInflValue { + position: absolute; + box-sizing: border-box; + font-family: 'Open Sans'; + font-size: 20px; + font-weight: bold; + top: 10px; + left: 16px; +} + +.demInflValue_10 { + position: absolute; + box-sizing: border-box; + font-family: 'Open Sans'; + font-size: 20px; + font-weight: bold; + top: 10px; + left: 10px; +} + +.comInflValue { + position: absolute; + box-sizing: border-box; + font-family: 'Open Sans'; + font-size: 20px; + font-weight: bold; + top: 12px; + left: 74px; +} + +.comInflValue_10 { + position: absolute; + box-sizing: border-box; + font-family: 'Open Sans'; + font-size: 20px; + font-weight: bold; + top: 12px; + left: 68px; +} + +.comInflValue.controlled, .held { + color: whitesmoke; + text-shadow: + 1px 1px 0 #c2272d, /* Right bottom */ + -1px 1px 0 #c2272d, /* Left bottom */ + 1px -1px 0 #c2272d, /* Right top */ + -1px -1px 0 #c2272d; /* Left top */ +} + +.comInflValue.uncontrolled { + color: #c2272d; + text-shadow: + 1px 1px 0 #ffffff, /* Right bottom */ + -1px 1px 0 #ffffff, /* Left bottom */ + 1px -1px 0 #ffffff, /* Right top */ + -1px -1px 0 #ffffff; /* Left top */ +} + +.comInflValue_10.controlled, .held { + color: whitesmoke; + text-shadow: + 1px 1px 0 #c2272d, /* Right bottom */ + -1px 1px 0 #c2272d, /* Left bottom */ + 1px -1px 0 #c2272d, /* Right top */ + -1px -1px 0 #c2272d; /* Left top */ +} + +.comInflValue_10.uncontrolled { + color: #c2272d; + text-shadow: + 1px 1px 0 #ffffff, /* Right bottom */ + -1px 1px 0 #ffffff, /* Left bottom */ + 1px -1px 0 #ffffff, /* Right top */ + -1px -1px 0 #ffffff; /* Left top */ +} + + +/* GAME MARKERS */ + +.t0 {left: 511px} +.t1 {left: 511px} +.t2 {left: 553px} +.t3 {left: 595px} +.t4 {left: 637px} +.t5 {left: 679px} +.t6 {left: 721px} +.t7 {left: 763px} +.t8 {left: 805px} +.t9 {left: 847px} +.t10 {left: 889px} + +#turn-tracker { + position:absolute; + top: 65px; + height: 35px; + width: 36px; + /*display: block;*/ +} + +.r0 {left: 554px} +.r1 {left: 554px} +.r2 {left: 596px} +.r3 {left: 638px} +.r4 {left: 680px} +.r5 {left: 722px} +.r6 {left: 764px} +.r7 {left: 806px} +.r8 {left: 848px} + +.dem-action-round-tracker { background-image: url(images/US_Action_Round.gif);} +.com-action-round-tracker { background-image: url(images/SV_Action_Round.gif);} + +#action-round-tracker { + position: absolute; + top: 114px; + height: 30px; + width: 35px; + background-size: cover; +} + + + +#stability-track { + position:absolute; + left: 1085px; + height: 35px; + width: 35px; +} + +.s0 {top: 853px} +.s1 {top: 896px} +.s2 {top: 939px} +.s3 {top: 982px} +.s4 {top: 1025px} + + +.tst0 {left: 0} +.tst1 {left: 38px} +.tst2 {left: 93px} +.tst3 {left: 148px} +.tst4 {left: 203px} +.tst5 {left: 258px} +.tst6 {left: 313px} +.tst7 {left: 368px} +.tst8 {left: 436px} + +#dem-TST { + position: absolute; + top: 1680px; + height: 35px; + width: 35px; +} + +#com-TST { + position: absolute; + top: 1782px; + height: 35px; + width: 35px; +} + +.vp0 {top: 1913px; +left: 660px} + +.vp-20, .vp-18, .vp-16, .vp-14, .vp-12, .vp-10, .vp-8, .vp-6, .vp-4, .vp-2, .vp1, .vp3, .vp5, .vp7, .vp9, .vp11, .vp13, .vp15, .vp17, .vp19 {top: 1889px} +.vp-19, .vp-17, .vp-15, .vp-13, .vp-11, .vp-9, .vp-7, .vp-5, .vp-3, .vp-1, .vp2, .vp4, .vp6, .vp8, .vp10, .vp12, .vp14, .vp16, .vp18, .vp20 {top: 1938px} + +.vp-21 {top: 1912px; left: 117px} +.vp21 {top: 1912px; left: 1182px} + +.vp-20 {left: 165px} +.vp-19 {left: 189px} +.vp-18 {left: 214px} +.vp-17 {left: 238px} +.vp-16 {left: 263px} +.vp-15 {left: 287px} +.vp-14 {left: 312px} +.vp-13 {left: 336px} +.vp-12 {left: 361px} +.vp-11 {left: 385px} +.vp-10 {left: 410px} +.vp-9 {left: 434px} +.vp-8 {left: 459px} +.vp-7 {left: 483px} +.vp-6 {left: 508px} +.vp-5 {left: 532px} +.vp-4 {left: 557px} +.vp-3 {left: 581px} +.vp-2 {left: 606px} +.vp-1 {left: 630px} +.vp1 {left: 692px} +.vp2 {left: 717px} +.vp3 {left: 741px} +.vp4 {left: 766px} +.vp5 {left: 790px} +.vp6 {left: 815px} +.vp7 {left: 839px} +.vp8 {left: 864px} +.vp9 {left: 888px} +.vp10 {left: 913px} +.vp11 {left: 937px} +.vp12 {left: 962px} +.vp13 {left: 986px} +.vp14 {left: 1011px} +.vp15 {left: 1035px} +.vp16 {left: 1060px} +.vp17 {left: 1084px} +.vp18 {left: 1109px} +.vp19 {left: 1133px} +.vp20 {left: 1158px} + +#vp { + position: absolute; + height: 40px; + width: 40px; +} + +.marker { + position: absolute; + height: 30px; + width: 30px; +} + +.revolution {background-image: url(images/US_blank.gif); background-size: contain} +.held {background-image: url(images/SV_blank.gif); background-size: contain} + +.germany {top: 127px; left: 439px} +.poland { top: 232px; left: 934px} +.czech {top: 494px; left: 362px} +.hungary {top: 1041px; left: 813px} +.romania {top: 1063px; left: 1012px} +.bulgaria {top: 1578px; left: 720px} + +.times_held { + position: absolute; + font-family: 'Open Sans'; + font-size: 20px; + font-weight: bold; + top: -18px; + left: 8px +} + +.outlined_text { + text-shadow: + 1px 1px 0 #ffffff, /* Right bottom */ + -1px 1px 0 #ffffff, /* Left bottom */ + 1px -1px 0 #ffffff, /* Right top */ + -1px -1px 0 #ffffff; /* Left top */ +} + +/* ============= EVENT MARKERS ========== */ + +.event-marker { + display: none; + position: absolute; + height: 30px; + width: 30px; + transition: transform 0.3s ease; +} + +.event-marker:hover { + cursor: pointer; + transform: scale(2); + z-index: 1; +} + +.event-marker.aside { + border: solid black 1.5px; + margin: 3px; + position: relative; +} + +#turn_info { + display: flex; + flex-direction: column; + align-items: flex-start; +} + +#turn_info > div { + display: flex; + margin-bottom: 8px; + gap: 4px; +} + +#turn_info > img { + display: block; + +} + +/*Solidarity legalised*/ +#event_2 { + top: 216px; + left: 612px; +} + +/*Systematisation*/ +#event_69 { + height: 65px; + width: 65px; +} + +/*The Tyrant is Gone*/ +#event_97 { + height: 40px; + width: 40px; +} + +/*The Wall*/ +#event_9 { + top: 143px; + left: 170px; +} + + +/* =========== CARDS ================= */ +/* +.playedCard { + display: flex; + margin: auto; + height: 300px; +}*/ + +.hand_card { + background-size: contain; + height: 250px; + margin: 10px; + border-radius: 5px; + transition: transform .3s ease 0.5s; +} +/* +.hand_card:hover { + cursor: pointer; +}*/ + +.zoom { + transform: scale(1.75) +} + +.power_card { + background-size: contain; + height: 250px; + margin: 10px; + border-radius: 5px; +} + +.discard_card, .event_card { + background-size: contain; + height: 150px; + margin: 5px; + border-radius: 5px; + transition: transform .3s ease; +} + +.discard_card:hover, .event_card:hover { + /*cursor: pointer;*/ + transform: scale(2); +} + +.selected.space-area { + background-color: #0002; + outline: solid white 2px; + /*box-shadow: 0 0 4px white; */ + border-radius: 10px 10px 0 0; +} + +.space-area.tip { + background-color: #ff08; + outline: solid white 2px; + box-shadow: 0 0 8px #ff08; + border-radius: 10px 10px 0 0; +} + +.selected.hand_card { + outline: solid silver 3px; + /*box-shadow: 0 0 4px white; */ + border-radius: 18px; +} + + +.selected.power_card { + outline: solid silver 3px; + /*box-shadow: 0 0 4px white; */ + border-radius: 18px; +} + +/* =============== OTHER ===============*/ +#space-characteristics {display: none} + +/* =============== CARD IMAGES =========*/ + +#tooltip { + position: fixed; + pointer-events: none; + z-index: 600; + right: 240px; + top: 60px; +} + +.card { + background-size: cover; + background-repeat: no-repeat; + width: 250px; + height: 350px; + border-radius: 16px; + box-shadow: 1px 2px 4px #0004; +} + +.card_1 {background-image: url(cards/e1.gif)} +.card_2 {background-image: url(cards/e2.gif)} +.card_3 {background-image: url(cards/e3.gif)} +.card_4 {background-image: url(cards/e4.gif)} +.card_5 {background-image: url(cards/e5.gif)} +.card_6 {background-image: url(cards/e6.gif)} +.card_7 {background-image: url(cards/e7.gif)} +.card_8 {background-image: url(cards/e8.gif)} +.card_9 {background-image: url(cards/e9.gif)} +.card_10 {background-image: url(cards/e10.gif)} +.card_11 {background-image: url(cards/e11.gif)} +.card_12 {background-image: url(cards/e12.gif)} +.card_13 {background-image: url(cards/e13.gif)} +.card_14 {background-image: url(cards/e14.gif)} +.card_15 {background-image: url(cards/e15.gif)} +.card_16 {background-image: url(cards/e16.gif)} +.card_17 {background-image: url(cards/e17.gif)} +.card_18 {background-image: url(cards/e18.gif)} +.card_19 {background-image: url(cards/e19.gif)} +.card_20 {background-image: url(cards/e20.gif)} +.card_21 {background-image: url(cards/e21.gif)} +.card_22 {background-image: url(cards/e22.gif)} +.card_23 {background-image: url(cards/e23.gif)} +.card_24 {background-image: url(cards/e24.gif)} +.card_25 {background-image: url(cards/e25.gif)} +.card_26 {background-image: url(cards/e26.gif)} +.card_27 {background-image: url(cards/e27.gif)} +.card_28 {background-image: url(cards/e28.gif)} +.card_29 {background-image: url(cards/e29.gif)} +.card_30 {background-image: url(cards/e30.gif)} +.card_31 {background-image: url(cards/e31.gif)} +.card_32 {background-image: url(cards/e32.gif)} +.card_33 {background-image: url(cards/e33.gif)} +.card_34 {background-image: url(cards/e34.gif)} +.card_35 {background-image: url(cards/e35.gif)} +.card_36 {background-image: url(cards/e36.gif)} +.card_37 {background-image: url(cards/e37.gif)} +.card_38 {background-image: url(cards/e38.gif)} +.card_39 {background-image: url(cards/e39.gif)} +.card_40 {background-image: url(cards/e40.gif)} +.card_41 {background-image: url(cards/e41.gif)} +.card_42 {background-image: url(cards/e42.gif)} +.card_43 {background-image: url(cards/e43.gif)} +.card_44 {background-image: url(cards/e44.gif)} +.card_45 {background-image: url(cards/e45.gif)} +.card_46 {background-image: url(cards/e46.gif)} +.card_47 {background-image: url(cards/e47.gif)} +.card_48 {background-image: url(cards/e48.gif)} +.card_49 {background-image: url(cards/e49.gif)} +.card_50 {background-image: url(cards/e50.gif)} +.card_51 {background-image: url(cards/e51.gif)} +.card_52 {background-image: url(cards/e52.gif)} +.card_53 {background-image: url(cards/e53.gif)} +.card_54 {background-image: url(cards/e54.gif)} +.card_55 {background-image: url(cards/e55.gif)} +.card_56 {background-image: url(cards/e56.gif)} +.card_57 {background-image: url(cards/e57.gif)} +.card_58 {background-image: url(cards/e58.gif)} +.card_59 {background-image: url(cards/e59.gif)} +.card_60 {background-image: url(cards/e60.gif)} +.card_61 {background-image: url(cards/e61.gif)} +.card_62 {background-image: url(cards/e62.gif)} +.card_63 {background-image: url(cards/e63.gif)} +.card_64 {background-image: url(cards/e64.gif)} +.card_65 {background-image: url(cards/e65.gif)} +.card_66 {background-image: url(cards/e66.gif)} +.card_67 {background-image: url(cards/e67.gif)} +.card_68 {background-image: url(cards/e68.gif)} +.card_69 {background-image: url(cards/e69.gif)} +.card_70 {background-image: url(cards/e70.gif)} +.card_71 {background-image: url(cards/e71.gif)} +.card_72 {background-image: url(cards/e72.gif)} +.card_73 {background-image: url(cards/e73.gif)} +.card_74 {background-image: url(cards/e74.gif)} +.card_75 {background-image: url(cards/e75.gif)} +.card_76 {background-image: url(cards/e76.gif)} +.card_77 {background-image: url(cards/e77.gif)} +.card_78 {background-image: url(cards/e78.gif)} +.card_79 {background-image: url(cards/e79.gif)} +.card_80 {background-image: url(cards/e80.gif)} +.card_81 {background-image: url(cards/e81.gif)} +.card_82 {background-image: url(cards/e82.gif)} +.card_83 {background-image: url(cards/e83.gif)} +.card_84 {background-image: url(cards/e84.gif)} +.card_85 {background-image: url(cards/e85.gif)} +.card_86 {background-image: url(cards/e86.gif)} +.card_87 {background-image: url(cards/e87.gif)} +.card_88 {background-image: url(cards/e88.gif)} +.card_89 {background-image: url(cards/e89.gif)} +.card_90 {background-image: url(cards/e90.gif)} +.card_91 {background-image: url(cards/e91.gif)} +.card_92 {background-image: url(cards/e92.gif)} +.card_93 {background-image: url(cards/e93.gif)} +.card_94 {background-image: url(cards/e94.gif)} +.card_95 {background-image: url(cards/e95.gif)} +.card_96 {background-image: url(cards/e96.gif)} +.card_97 {background-image: url(cards/e97.gif)} +.card_98 {background-image: url(cards/e98.gif)} +.card_99 {background-image: url(cards/e99.gif)} +.card_100 {background-image: url(cards/e100.gif)} +.card_101 {background-image: url(cards/e101.gif)} +.card_102 {background-image: url(cards/e102.gif)} +.card_103 {background-image: url(cards/e103.gif)} +.card_104 {background-image: url(cards/e104.gif)} +.card_105 {background-image: url(cards/e105.gif)} +.card_106 {background-image: url(cards/e106.gif)} +.card_107 {background-image: url(cards/e107.gif)} +.card_108 {background-image: url(cards/e108.gif)} +.card_109 {background-image: url(cards/e109.gif)} +.card_110 {background-image: url(cards/e110.gif)} diff --git a/play.html b/play.html index 8e25b8c..e09e214 100644 --- a/play.html +++ b/play.html @@ -1,210 +1,210 @@ - - - - - - - -1989 - - - - - - - - - - - - - -
    - -
    -
    -
    - - -
  • Rules of Play -
  • Background Book -
  • Reference Sheets - -
  • -
    - - - -
    -
    - - - -
    - - -
    - -
    -
    -
    -

    - -
    - - - - -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    -
    -
    Event Markers
    -
    - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -
    -
    Cards on the Table
    -
    -
    -
    - - -
    -
    -
    Played Card
    -
    -
    - -
    - - -
    -
    -
    Discard
    -
    -
    -
    - - -
    -
    -
    Permanently Removed Events
    -
    -
    -
    - - -
    -
    -
    Ceausescu Cards
    -
    -
    -
    -
    Power Struggle Hand
    -
    -
    -
    - - - - -
    - -
    -
    Opponent Hand
    -
    -
    - -
    - - -
    -
    -
    Set aside card
    -
    -
    -
    - - - -
    - -
    -
    Hand
    -
    -
    - -
    - -
    - -
    - - - - + + + + + + + +1989 + + + + + + + + + + + + + +
    + +
    +
    +
    + + +
  • Rules of Play +
  • Background Book +
  • Reference Sheets + +
  • +
    + + + +
    +
    + + + +
    + + +
    + +
    +
    +
    +

    + +
    + + + + +
    +

    1

    +
    +

    1

    +
    +

    1

    +
    +

    1

    +
    +

    1

    +
    +

    1

    + + + + + + + + + +
    +
    +
    +
    +
    + + + +
    +
    +
    Event Markers
    +
    + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    +
    Cards on the Table
    +
    +
    +
    + + +
    +
    +
    Played Card
    +
    +
    + +
    + + +
    +
    +
    Discard
    +
    +
    +
    + + +
    +
    +
    Permanently Removed Events
    +
    +
    +
    + + +
    +
    +
    Ceausescu Cards
    +
    +
    +
    +
    Power Struggle Hand
    +
    +
    +
    + + + + +
    + +
    +
    Opponent Hand
    +
    +
    + +
    + + +
    +
    +
    Set aside card
    +
    +
    +
    + + + +
    + +
    +
    Hand
    +
    +
    + +
    + +
    + +
    + + + + diff --git a/play.js b/play.js index a98c671..f0f4390 100644 --- a/play.js +++ b/play.js @@ -1,814 +1,814 @@ - -const seed = 'none' -const scenario = 'standard' -const options = 'none' -//const rules = require("./rules") - -const last_card = 110 -const last_power_card = 52 -let hover_timeout -const height = 65 -const width = 105 -const toolbar = document.getElementById('toolbar') -const vpMarker = document.getElementById('vp') -const counters = document.getElementById('counters') - -const countries= ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] - -/*const aside_events = [ - "honecker", - "st_nicholas_church", - "helsinki_final_act", - "eco_glasnost", - "we_are_the_people", - "foreign_currency_debt_burden", - "li_peng", - "austria_hungary_border_reopened", - "grenztruppen", - "presidential_visit", - "securitate", - "laslzo_tokes", - "stand_fast", - "elena", - "new_years_eve_party" -]*/ -const board_events = [2, 9, 69, 97] -const box_events = [ 15, 24, 26, 39, 48, 49, 53, 58, 59, 65, 70, 73, 100, 101, 104 ] -let box_events_showing = false -let show_discard = false - -const overlay = document.getElementById('overlay'); -const spaceNameElement = document.getElementById('space-name'); -const spaceCharacteristicsElement = document.getElementById('space-characteristics'); - - -// Event listener to track mouse movement over the map - document.querySelector('.map').addEventListener('mousemove', function(event) { - const x = event.offsetX; // X-coordinate of mouse relative to container - const y = event.offsetY; // Y-coordinate of mouse relative to container - spaceCharacteristicsElement.innerText = `X: ${x}, Y: ${y}`; - }) - - - // Create map areas dynamically based on coordinates - - function create_ui() { - -// CREATE MAP - - spaces.forEach((space) => { - - - if (space && space.box) { - - //CREATE SPACES - const { x, y} = space.box; - const spaceArea = document.createElement('div'); - spaceArea.classList.add('space-area', space.country) - spaceArea.id=`space_${space.space_id}`; - spaceArea.style.left = x + 'px'; - spaceArea.style.top = y + 'px'; - spaceArea.style.width = width + 'px'; - spaceArea.style.height = height + 'px'; - spaceArea.style.zIndex = 2; - spaceArea.my_space = space.space_id; - spaceArea.addEventListener('mousedown', on_click_space); - - //CREATE DEMOCRATIC INFLUENCE MARKERS FOR EACH SPACE - const dem_img = document.createElement('div') - dem_img.classList.add('demInfl', space.country) - dem_img.style.display = 'none' - dem_img.id=`${space.name_unique}_demInfl` - dem_img.style.zIndex = 1 - dem_img.my_space = space.space_id; - dem_img.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(dem_img) - - //CREATE DEMOCRATIC INFLUENCE VALUES - const demInflValue = document.createElement('p') - demInflValue.className='demInflValue' - demInflValue.style.display = 'none' - demInflValue.id=`${space.name_unique}_demInflValue` - demInflValue.innerText=space.demInfl - demInflValue.style.zIndex = 1 - demInflValue.my_space = space.space_id; - demInflValue.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(demInflValue) - - //CREATE COMMUNIST INFLUENCE MARKERS FOR EACH SPACE - const com_img = document.createElement('div') - com_img.className='comInfl' - com_img.style.display='none' - com_img.id=`${space.name_unique}_comInfl` - com_img.style.zIndex = 1 - com_img.my_space = space.space_id; - com_img.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(com_img) - - //CREATE COMMUNIST INFLUENCE VALUES - const comInflValue = document.createElement('p') - comInflValue.className='comInflValue' - comInflValue.style.display='none' - comInflValue.id=`${space.name_unique}_comInflValue` - comInflValue.innerText=space.comInfl - comInflValue.style.zIndex = 1 - comInflValue.my_space = space.space_id; - comInflValue.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(comInflValue) - //} - - counters.appendChild(spaceArea); - } - }); - -// CREATE CARDS - - const is_mobile = window.matchMedia("(pointer: coarse)").matches - - for (let c = 1; c <= last_card; ++c) { - - const hand_card = document.createElement('img'); - hand_card.classList.add('hand_card') - hand_card.id=`card_${c}`; - hand_card.src = `cards/e${c}.gif` - hand_card.my_card = c; - hand_card.addEventListener('click', on_click_card); - - if(!is_mobile) { - hand_card.addEventListener('mouseenter', () => { - hover_timeout = setTimeout(() => { - hand_card.classList.add('zoom'); - }, 500) }) - hand_card.addEventListener('mouseleave', () => { - clearTimeout(hover_timeout); - hand_card.classList.remove('zoom'); - }); - } - - ui.cards.push(hand_card); - } - - - - for (let card of power_cards) { - if (!card) continue; - const power_card = document.createElement('img'); - power_card.classList.add('power_card'); - power_card.id = `power_card_${card.number}`; - power_card.src = `cards_2/${card.url}.gif`; - power_card.my_card = card.number; - power_card.addEventListener('mousedown', on_click_card); - ui.power_cards.push(power_card); - } -} - - - - -function is_card_enabled(card) { - if (view.actions) { - if (card_action_menu.some(a => view.actions[a] && view.actions[a].includes(card))) - return true - if (view.actions.card_select && view.actions.card_select.includes(card)) - return true - if (view.actions.card && view.actions.card.includes(card)) - return true - } - return false -} - -// SUPPORTING FUNCTIONS - -function on_click_space(evt) { - if (evt.button === 0) { - const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); - if (send_action('infl', space)) { - //console.log('send_action with infl:', space); - evt.stopPropagation(); - } else if (send_action('sc', space)) { - //console.log('send_action with sc:', space); - evt.stopPropagation(); - } else { - // console.log('send_action failed for space:', space); - } - } - //hide_popup_menu(); -} - -function on_click_card(evt) { - if (evt.button === 0) { - const card = evt.target.my_card; - //console.log('on_click_card_called with card:', card); - if (is_action('card', card)) { - //console.log('in action card') - if (send_action('card', card)) { - evt.stopPropagation(); - } - } - } -} - -function is_action(action) { - //console.log('is_action called with: ', action) - //console.log('view.actions', view.actions) - if (view.actions && view.actions[action]) - return true - return false -} - -function is_card_action(action, card) { - //console.log('is_card_action called with action', action, 'card', card) - //console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action]) - if (view.actions && view.actions[action] && view.actions[action].includes(card)) - return true - return false -} - -function on_log(text) { // eslint-disable-line no-unused-vars - - let p = document.createElement("div") - - if (text.match(/^>/)) { - text = text.substring(1) - p.className = 'i' - } - - text = text.replace(/_/g, ' ') - text = text.replace(/C(\d+)/g, sub_card_name) - text = text.replace(/P(\d+)/g, sub_power_card_name) - text = text.replace(/V(\d+)/g, sub_power_card_value) - text = text.replace(/%(\d+)/g, sub_space_name) - text = text.replace(/D[1-6]/g, sub_die) - - - if (text.match(/^\.h1/)) { - text = text.substring(4) - p.className = 'h1' - } - else if (text.match(/^\.h2d/)) { - text = text.substring(5) - p.className = 'h2 dem' - } - else if (text.match(/^\.h2c/)) { - text = text.substring(5) - p.className = 'h2 com' - } - else if (text.match(/^\.h2/)) { - text = text.substring(4) - p.className = 'h2' - } - else if (text.match(/^\.h3/)) { - text = text.substring(4) - p.className = 'h3' - } - - p.innerHTML = text - return p -} - -let ui = { - favicon: document.getElementById('favicon'), - player: [ - document.getElementById("role_Democrat"), - document.getElementById("role_Communist"), - ], - cards: [ null ], - power_cards: [null], - dem_hand_count: document.getElementById("role_stat_dem"), - com_hand_count: document.getElementById("role_stat_com"), - deck_length: document.getElementById("deck_length"), - played_card: 0, - table_panel: document.getElementById("table_panel"), - hand_panel: document.getElementById("hand_panel"), - turn: document.getElementById("turn-tracker"), - round: document.getElementById("action-round-tracker"), - stability: document.getElementById("stability-track"), - dem_TST: document.getElementById("dem-TST"), - com_TST: document.getElementById("com-TST"), - vp: document.getElementById("vp"), - spaces: document.getElementsByClassName("space-area") - -} - - -function on_update() { - //console.log('on_update called') - //console.log('view.valid_spaces: ', view.valid_spaces) - //console.log('view.actions: ', view.actions) - //console.log('view.power_cards:', view.power_cards) - document.querySelectorAll('[id^="space_"].selected').forEach(spaceElement => {spaceElement.classList.remove('selected');}); - document.getElementById("power_hand")?.querySelectorAll('.selected').forEach(cardElement => {cardElement.classList.remove('selected');}); - view.valid_spaces.forEach(space_id => { - const spaceElementId = `space_${space_id}`; - const spaceElement = document.getElementById(spaceElementId); - - if (spaceElement) { - spaceElement.classList.add('selected'); - } - }); - - //Check influence values - - for (let i = 1; i < spaces.length; i ++) { - - const space = spaces[i] - const demInfl = view.demInfl[i] - const comInfl = view.comInfl[i] - //console.log('piece', piece) - //console.log('space', space) - const dem_marker = document.getElementById(`${space.name_unique}_demInfl`); - const dem_number = document.getElementById(`${space.name_unique}_demInflValue`); - const com_marker = document.getElementById(`${space.name_unique}_comInfl`); - const com_number = document.getElementById(`${space.name_unique}_comInflValue`); - - dem_number.innerText=demInfl - if (demInfl > 0) { - dem_marker.style.display = 'block'; - dem_number.style.display = 'block'; - - if (demInfl > 9) { - dem_number.classList.remove('demInflValue') - dem_number.classList.add('demInflValue_10') - } else { - dem_number.classList.add('demInflValue') - dem_number.classList.remove('demInflValue_10') - } - - if(check_dem_control(demInfl, comInfl, space)){ - dem_marker.classList.add('controlled') - dem_number.classList.add('outlined_text') - dem_marker.classList.remove('uncontrolled') - } else { - dem_marker.classList.add('uncontrolled') - dem_marker.classList.remove('controlled') - dem_number.classList.remove('outlined_text') - } - } else { - dem_marker.style.display = 'none'; - dem_number.style.display = 'none'; - } - com_number.innerText=comInfl - if (comInfl > 0) { - com_marker.style.display = 'block'; - com_number.style.display = 'block'; - - if (comInfl > 9) { - com_number.classList.remove('comInflValue') - com_number.classList.add('comInflValue_10') - } else { - com_number.classList.add('comInflValue') - com_number.classList.remove('comInflValue_10') - } - - if(check_com_control(demInfl, comInfl, space)){ - com_marker.classList.add('controlled') - com_number.classList.add('controlled') - com_marker.classList.remove('uncontrolled') - com_number.classList.remove('uncontrolled') - } else { - com_marker.classList.add('uncontrolled') - com_number.classList.add('uncontrolled') - com_marker.classList.remove('controlled') - com_number.classList.remove('controlled') - } - } else { - com_marker.style.display = 'none'; - com_number.style.display = 'none'; - } - - } - -// UPDATE COUNTRY MARKERS - for (let i = 0; i < countries.length; i++) { - const country = countries[i]; - const marker = document.getElementById(country) - const times_held = document.getElementById(`${country}_times_held`) - - if (view.revolutions[find_country_index(country)]) { - marker.classList.add('revolution') - marker.classList.remove('held') - marker.style.display = 'block' - times_held.classList.add('outlined_text') - times_held.classList.remove('hide') - } else if (view.times_held[find_country_index(country)] > 0 ) { - //console.log('setting ', country) - marker.classList.add('held') - marker.style.display = 'block' - times_held.classList.remove('hide') - times_held.innerHTML = view.times_held[find_country_index(country)] - } - else {marker.style.display = 'none'} - } - -// UPDATE ASIDE - if (view.is_pwr_struggle) { - ui.dem_hand_count.innerText = `${view.democrat_power_hand} Power cards` - ui.com_hand_count.innerText = `${view.communist_power_hand} Power cards` - } else{ - ui.dem_hand_count.innerText = `${view.democrat_hand} cards` - ui.com_hand_count.innerText = `${view.communist_hand} cards` - } - ui.deck_length.innerText = `${view.strategy_deck} cards` - -// UPDATE HAND - document.getElementById("hand").replaceChildren() - document.getElementById("played_card").replaceChildren() - - if (view.hand.length && view.is_pwr_struggle === false) { - document.getElementById("hand_panel").classList.remove("hide") - //console.log('view.actions.card', view.actions.card) - for (let c of view.hand) { - let card = ui.cards[c] - document.getElementById("hand").appendChild(card); - if (view.actions && view.actions.card && view.actions.card.includes(c)) { - card.classList.add('action') - } else { - card.classList.remove('action') - } - if (view.valid_cards.includes(c)) { - card.classList.add('selected') - } else { - card.classList.remove('selected') - } - card.classList.remove('discard_card') - } - } else { - document.getElementById("hand_panel").classList.add("hide") - } - -// UPDATE DISCARD -document.getElementById("discard").replaceChildren() -if (!view.is_pwr_struggle) { - for (let c of view.strategy_discard) { - let discard_card = ui.cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') - } -} else if (view.is_pwr_struggle) { - for (let c of view.strategy_discard) { - let discard_card = ui.power_cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') - } -} - -// DISCARD FOR EVENTS -//console.log('view.discard',view.discard) -if(view.discard) { - //document.getElementById("discard").replaceChildren() - document.getElementById("discard_panel").classList.remove("hide") - for (let c of view.strategy_discard) { - let discard_card = ui.cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - if (view.valid_cards.includes(c)) { - discard_card.classList.add('selected') - } else { - discard_card.classList.remove('selected') - } - } -} else { - if (!show_discard) { - document.getElementById("discard_panel").classList.add("hide") - } -} - -// UPDATE PERMANENTLY REMOVED CARDS -document.getElementById("removed").replaceChildren() -for (let c of view.strategy_removed) { - let discard_card = ui.cards[c] - document.getElementById("removed").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') -} - - -// PLAYED CARD PANEL -if (view.played_card > 0) { - document.getElementById("played_card_panel").classList.remove("hide") - document.getElementById("played_card").appendChild(ui.cards[view.played_card]); - document.getElementById("played_card").classList.remove("hand_card") -} else { - document.getElementById("played_card_panel").classList.add("hide") -} - -// TABLE CARDS PANEL -document.getElementById("table_cards").replaceChildren() -if (view.table_cards.length > 0) { - document.getElementById("table_panel").classList.remove("hide") - for (let c of view.table_cards) { - let card = ui.cards[c] - document.getElementById("table_cards").appendChild(card); - card.classList.remove("hand_card") - card.classList.add('event_card'); - } - } else { - document.getElementById("table_panel").classList.add("hide") -} - -// OPPONENT HAND -document.getElementById("opp_hand").replaceChildren() -if (!view.is_pwr_struggle) { - if (view.show_opp_hand && view.opp_hand.length >0) { - document.getElementById("opp_hand_panel").classList.remove("hide") - for (let c of view.opp_hand) { - let card = ui.cards[c] - document.getElementById("opp_hand").appendChild(card); - card.classList.remove('discard_card') - if (!view.is_pwr_struggle) { - if (view.valid_cards.includes(c)) { - card.classList.add('selected') - } else { - card.classList.remove('selected') - } - } - } - } else { - document.getElementById("opp_hand_panel").classList.add("hide") - } -} else { - //console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) - if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { - document.getElementById("opp_hand_panel").classList.remove("hide") - for (let c of view.opp_hand) { - let card = ui.power_cards[c] - //console.log('power_card:', power_card) - document.getElementById("opp_hand").appendChild(card); - card.classList.remove('discard_card') - } - } else { - document.getElementById("opp_hand_panel").classList.add("hide") - } -} - -// POWER STRUGGLE HAND - document.getElementById("power_hand").replaceChildren() - - if (view.power_hand.length && view.is_pwr_struggle) { - document.getElementById("power_panel").classList.remove("hide") - for (let c of view.power_hand) { - let power_card = ui.power_cards[c] - document.getElementById("power_hand").appendChild(power_card); - power_card.classList.remove('discard_card') - if (view.valid_cards.includes(c)) { - power_card.classList.add('selected'); - } - } - } else { - document.getElementById("power_panel").classList.add("hide") - } - -// CEAUSESCU - -if (view.ceausescu_cards && view.ceausescu_cards.length > 0 && view.is_pwr_struggle === true) { - document.getElementById("ceausescu_panel").classList.remove("hide") - for (let c of view.ceausescu_cards) { - let power_card = ui.power_cards[c] - document.getElementById("ceausescu_hand").appendChild(power_card); - power_card.classList.remove('discard_card') - - } -} else { - document.getElementById("ceausescu_panel").classList.add("hide") -} - -// SAMIZDAT CARD -if (view.samizdat > 0 ) { - let samizdat_card = ui.cards[view.samizdat] - document.getElementById("samizdat_panel").classList.remove("hide") - document.getElementById("samizdat_card").appendChild(samizdat_card) -} else { - document.getElementById("samizdat_panel").classList.add("hide") -} - -// UPDATE BOARD MARKERS - ui.turn.className = `t${view.turn}` - if (view.round_player === 'Democrat') { - ui.round.className = `dem-action-round-tracker r${view.round}` - } else { - ui.round.className = `com-action-round-tracker r${view.round}` - } - ui.stability.className = `s${view.stability}` - ui.dem_TST.className = `tst${view.dem_tst}` - ui.com_TST.className = `tst${view.com_tst}` - if (view.vp >= -20 && view.vp <= 20) { - ui.vp.className = `vp${view.vp}` - } else if (view.vp > 20) { - ui.vp.className = `vp21` - } else if (view.vp < -20) { - ui.vp.className = `vp-21` - } - -//console.log('strategy discard: ', view.strategy_discard) -//console.log('valid spaces: ', view.valid_spaces) - -//console.log('view.persistent_events', view.persistent_events) - -// UPDATE EVENT MARKERS ON THE BOARD - -for (let id of board_events) { - let marker = document.getElementById(`event_${id}`) - //console.log('event', id, marker) - if (view.persistent_events.includes(id)) { - marker.style.display = 'block' - } else { - marker.style.display = 'none' - } -} - - -// UPDATE EVENT MARKERS BELOW THE BOARD - -for (let id of box_events) { - let marker = document.getElementById(`event_${id}`) - //console.log('event', id, marker) - if (view.persistent_events.includes(id)) { - marker.style.display = 'block' - } else { - marker.style.display = 'none' - } -} - - -// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE EVENTS BOX -box_events_showing = false -for (let id of box_events) { - if (view.persistent_events.includes(id)) { - box_events_showing = true; - } -/* - //Special check for events which are not true/false - if (view.persistent_events['foreign_currency_debt_burden'] !== '') { - aside_events_showing = true - } - if (view.persistent_events['stand_fast'] !== '') { - aside_events_showing = true - } - */ -} - -if (box_events_showing) { - document.getElementById('events_panel').classList.remove("hide") -} else { - document.getElementById('events_panel').classList.add("hide") -} - -let systematization = document.getElementById('event_69') -if (view.persistent_events.includes(69)) { - systematization.style.left = (spaces[view.systematization].box.x +20) + 'px'; - systematization.style.top = spaces[view.systematization].box.y + 'px'; -} - -let tyrant = document.getElementById('event_97') -if (view.persistent_events.includes(97)) { - tyrant.style.left = (spaces[view.the_tyrant_is_gone].box.x - 41) + 'px'; - tyrant.style.top = (spaces[view.the_tyrant_is_gone].box.y + 23) + 'px'; -} else {tyrant.style.display = 'none'} - - action_button("yes", "Yes") - action_button("no", "No") - action_button("start", "Start") - action_button("check", "Check held cards") - action_button("tst_7", "Cancel opponent event") - action_button("tst_8", "Event and operations") - action_button("end", "End Game") - action_button("continue", "Continue playing") - action_button("east_germany", "East Germany") - action_button("poland", "Poland") - action_button("czechoslovakia", "Czechoslovakia") - action_button("hungary", "Hungary") - action_button("romania", "Romania") - action_button("bulgaria", "Bulgaria") - action_button("extra", "Take action round") - action_button("pass", "Pass") - action_button("remove", "Remove SPs") - action_button("add", "Add SPs") - action_button("ops", "Operations") - action_button("discard", "Discard") - action_button("strike", "Strike") - action_button("march", "March") - action_button("rally", "Rally in the Square") - action_button("petition", "Petition") - action_button("bonus", "Calculate VP bonus") - action_button("scoring", "Score country") - action_button("retain", "Retain Power") - action_button("surrender", "Surrender Power") - action_button("take", "Take Power") - action_button("concede", "Concede") - action_button("struggle", "Begin power struggle") - action_button("raise", "Raise the stakes") - action_button("draw", "Draw") - action_button("scoring", "Scoring") - action_button("event", "Event") - action_button("opp_event", "Resolve opponent event") - action_button("influence", "Place SPs") - action_button("support_check", "Support Checks") - action_button("tst", "Tiananmen Square Track") - action_button("roll", "Roll a die") - action_button("done", "Done") - action_button("end_round", "End Round") - action_button("undo", "Undo") - -console.log('view.actions', view.actions) -} - -// =========================== LOG FUNCTIONS ============================================== - -function sub_card_name(match, p1) { - let x = p1 | 0 - return `${cards[x].name}` -} - -function sub_power_card_name(match, p1) { - let x = p1 | 0 - return `${power_cards[x].name}` -} - -function sub_power_card_value(match, p1) { - let x = p1 | 0 - return `${x}` -} - -function sub_space_name(match, p1) { - let x = p1 | 0 - let id = spaces[x].space_id - let name = spaces[x].name_unique - return `${name}` -} - -function sub_die(match) { - return die[match] || match -} - -const die = { - D1: '', - D2: '', - D3: '', - D4: '', - D5: '', - D6: '' -} - -// =========================== VISUAL FUNCTIONS ==========================================# - -function on_focus_card_tip(card_number) { - document.getElementById("tooltip").className = "card card_" + card_number -} - -function on_blur_card_tip() { - document.getElementById("tooltip").classList = "card hide" -} - -function on_focus_space_tip(id) { - space = document.getElementById(`space_${id}`) - space.classList.add("tip") -} - -function on_click_space_tip(id) { - space = document.getElementById(`space_${id}`) - scroll_into_view(space) -} - -function on_blur_space_tip(id) { - space = document.getElementById(`space_${id}`) - space.classList.remove("tip") -} - -function toggle_pieces() { - document.getElementById("pieces").classList.toggle("hide") -} - - -function toggle_discard() { - if (show_discard) { - show_discard = false - } else { - show_discard = true - } - document.getElementById("discard_panel").classList.toggle("hide") -} - -function toggle_removed() { - document.getElementById("removed_panel").classList.toggle("hide") -} - -function check_dem_control(demInfl, comInfl, space) { - if ((demInfl - comInfl) >= space.stability) { - return true - } else{ false} -} - -function check_com_control(demInfl, comInfl, space) { - if ((comInfl - demInfl) >= space.stability) { - return true - } else{ false} -} - -function find_country_index(country) { - return countries.indexOf(country) -} - -create_ui() + +const seed = 'none' +const scenario = 'standard' +const options = 'none' +//const rules = require("./rules") + +const last_card = 110 +const last_power_card = 52 +let hover_timeout +const height = 65 +const width = 105 +const toolbar = document.getElementById('toolbar') +const vpMarker = document.getElementById('vp') +const counters = document.getElementById('counters') + +const countries= ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] + +/*const aside_events = [ + "honecker", + "st_nicholas_church", + "helsinki_final_act", + "eco_glasnost", + "we_are_the_people", + "foreign_currency_debt_burden", + "li_peng", + "austria_hungary_border_reopened", + "grenztruppen", + "presidential_visit", + "securitate", + "laslzo_tokes", + "stand_fast", + "elena", + "new_years_eve_party" +]*/ +const board_events = [2, 9, 69, 97] +const box_events = [ 15, 24, 26, 39, 48, 49, 53, 58, 59, 65, 70, 73, 100, 101, 104 ] +let box_events_showing = false +let show_discard = false + +const overlay = document.getElementById('overlay'); +const spaceNameElement = document.getElementById('space-name'); +const spaceCharacteristicsElement = document.getElementById('space-characteristics'); + + +// Event listener to track mouse movement over the map + document.querySelector('.map').addEventListener('mousemove', function(event) { + const x = event.offsetX; // X-coordinate of mouse relative to container + const y = event.offsetY; // Y-coordinate of mouse relative to container + spaceCharacteristicsElement.innerText = `X: ${x}, Y: ${y}`; + }) + + + // Create map areas dynamically based on coordinates + + function create_ui() { + +// CREATE MAP + + spaces.forEach((space) => { + + + if (space && space.box) { + + //CREATE SPACES + const { x, y} = space.box; + const spaceArea = document.createElement('div'); + spaceArea.classList.add('space-area', space.country) + spaceArea.id=`space_${space.space_id}`; + spaceArea.style.left = x + 'px'; + spaceArea.style.top = y + 'px'; + spaceArea.style.width = width + 'px'; + spaceArea.style.height = height + 'px'; + spaceArea.style.zIndex = 2; + spaceArea.my_space = space.space_id; + spaceArea.addEventListener('mousedown', on_click_space); + + //CREATE DEMOCRATIC INFLUENCE MARKERS FOR EACH SPACE + const dem_img = document.createElement('div') + dem_img.classList.add('demInfl', space.country) + dem_img.style.display = 'none' + dem_img.id=`${space.name_unique}_demInfl` + dem_img.style.zIndex = 1 + dem_img.my_space = space.space_id; + dem_img.addEventListener('mousedown', on_click_space); + spaceArea.appendChild(dem_img) + + //CREATE DEMOCRATIC INFLUENCE VALUES + const demInflValue = document.createElement('p') + demInflValue.className='demInflValue' + demInflValue.style.display = 'none' + demInflValue.id=`${space.name_unique}_demInflValue` + demInflValue.innerText=space.demInfl + demInflValue.style.zIndex = 1 + demInflValue.my_space = space.space_id; + demInflValue.addEventListener('mousedown', on_click_space); + spaceArea.appendChild(demInflValue) + + //CREATE COMMUNIST INFLUENCE MARKERS FOR EACH SPACE + const com_img = document.createElement('div') + com_img.className='comInfl' + com_img.style.display='none' + com_img.id=`${space.name_unique}_comInfl` + com_img.style.zIndex = 1 + com_img.my_space = space.space_id; + com_img.addEventListener('mousedown', on_click_space); + spaceArea.appendChild(com_img) + + //CREATE COMMUNIST INFLUENCE VALUES + const comInflValue = document.createElement('p') + comInflValue.className='comInflValue' + comInflValue.style.display='none' + comInflValue.id=`${space.name_unique}_comInflValue` + comInflValue.innerText=space.comInfl + comInflValue.style.zIndex = 1 + comInflValue.my_space = space.space_id; + comInflValue.addEventListener('mousedown', on_click_space); + spaceArea.appendChild(comInflValue) + //} + + counters.appendChild(spaceArea); + } + }); + +// CREATE CARDS + + const is_mobile = window.matchMedia("(pointer: coarse)").matches + + for (let c = 1; c <= last_card; ++c) { + + const hand_card = document.createElement('img'); + hand_card.classList.add('hand_card') + hand_card.id=`card_${c}`; + hand_card.src = `cards/e${c}.gif` + hand_card.my_card = c; + hand_card.addEventListener('click', on_click_card); + + if(!is_mobile) { + hand_card.addEventListener('mouseenter', () => { + hover_timeout = setTimeout(() => { + hand_card.classList.add('zoom'); + }, 500) }) + hand_card.addEventListener('mouseleave', () => { + clearTimeout(hover_timeout); + hand_card.classList.remove('zoom'); + }); + } + + ui.cards.push(hand_card); + } + + + + for (let card of power_cards) { + if (!card) continue; + const power_card = document.createElement('img'); + power_card.classList.add('power_card'); + power_card.id = `power_card_${card.number}`; + power_card.src = `cards_2/${card.url}.gif`; + power_card.my_card = card.number; + power_card.addEventListener('mousedown', on_click_card); + ui.power_cards.push(power_card); + } +} + + + + +function is_card_enabled(card) { + if (view.actions) { + if (card_action_menu.some(a => view.actions[a] && view.actions[a].includes(card))) + return true + if (view.actions.card_select && view.actions.card_select.includes(card)) + return true + if (view.actions.card && view.actions.card.includes(card)) + return true + } + return false +} + +// SUPPORTING FUNCTIONS + +function on_click_space(evt) { + if (evt.button === 0) { + const space = evt.target.my_space; + //console.log('on_click_space_called with space:', space); + if (send_action('infl', space)) { + //console.log('send_action with infl:', space); + evt.stopPropagation(); + } else if (send_action('sc', space)) { + //console.log('send_action with sc:', space); + evt.stopPropagation(); + } else { + // console.log('send_action failed for space:', space); + } + } + //hide_popup_menu(); +} + +function on_click_card(evt) { + if (evt.button === 0) { + const card = evt.target.my_card; + //console.log('on_click_card_called with card:', card); + if (is_action('card', card)) { + //console.log('in action card') + if (send_action('card', card)) { + evt.stopPropagation(); + } + } + } +} + +function is_action(action) { + //console.log('is_action called with: ', action) + //console.log('view.actions', view.actions) + if (view.actions && view.actions[action]) + return true + return false +} + +function is_card_action(action, card) { + //console.log('is_card_action called with action', action, 'card', card) + //console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action]) + if (view.actions && view.actions[action] && view.actions[action].includes(card)) + return true + return false +} + +function on_log(text) { // eslint-disable-line no-unused-vars + + let p = document.createElement("div") + + if (text.match(/^>/)) { + text = text.substring(1) + p.className = 'i' + } + + text = text.replace(/_/g, ' ') + text = text.replace(/C(\d+)/g, sub_card_name) + text = text.replace(/P(\d+)/g, sub_power_card_name) + text = text.replace(/V(\d+)/g, sub_power_card_value) + text = text.replace(/%(\d+)/g, sub_space_name) + text = text.replace(/D[1-6]/g, sub_die) + + + if (text.match(/^\.h1/)) { + text = text.substring(4) + p.className = 'h1' + } + else if (text.match(/^\.h2d/)) { + text = text.substring(5) + p.className = 'h2 dem' + } + else if (text.match(/^\.h2c/)) { + text = text.substring(5) + p.className = 'h2 com' + } + else if (text.match(/^\.h2/)) { + text = text.substring(4) + p.className = 'h2' + } + else if (text.match(/^\.h3/)) { + text = text.substring(4) + p.className = 'h3' + } + + p.innerHTML = text + return p +} + +let ui = { + favicon: document.getElementById('favicon'), + player: [ + document.getElementById("role_Democrat"), + document.getElementById("role_Communist"), + ], + cards: [ null ], + power_cards: [null], + dem_hand_count: document.getElementById("role_stat_dem"), + com_hand_count: document.getElementById("role_stat_com"), + deck_length: document.getElementById("deck_length"), + played_card: 0, + table_panel: document.getElementById("table_panel"), + hand_panel: document.getElementById("hand_panel"), + turn: document.getElementById("turn-tracker"), + round: document.getElementById("action-round-tracker"), + stability: document.getElementById("stability-track"), + dem_TST: document.getElementById("dem-TST"), + com_TST: document.getElementById("com-TST"), + vp: document.getElementById("vp"), + spaces: document.getElementsByClassName("space-area") + +} + + +function on_update() { + //console.log('on_update called') + //console.log('view.valid_spaces: ', view.valid_spaces) + //console.log('view.actions: ', view.actions) + //console.log('view.power_cards:', view.power_cards) + document.querySelectorAll('[id^="space_"].selected').forEach(spaceElement => {spaceElement.classList.remove('selected');}); + document.getElementById("power_hand")?.querySelectorAll('.selected').forEach(cardElement => {cardElement.classList.remove('selected');}); + view.valid_spaces.forEach(space_id => { + const spaceElementId = `space_${space_id}`; + const spaceElement = document.getElementById(spaceElementId); + + if (spaceElement) { + spaceElement.classList.add('selected'); + } + }); + + //Check influence values + + for (let i = 1; i < spaces.length; i ++) { + + const space = spaces[i] + const demInfl = view.demInfl[i] + const comInfl = view.comInfl[i] + //console.log('piece', piece) + //console.log('space', space) + const dem_marker = document.getElementById(`${space.name_unique}_demInfl`); + const dem_number = document.getElementById(`${space.name_unique}_demInflValue`); + const com_marker = document.getElementById(`${space.name_unique}_comInfl`); + const com_number = document.getElementById(`${space.name_unique}_comInflValue`); + + dem_number.innerText=demInfl + if (demInfl > 0) { + dem_marker.style.display = 'block'; + dem_number.style.display = 'block'; + + if (demInfl > 9) { + dem_number.classList.remove('demInflValue') + dem_number.classList.add('demInflValue_10') + } else { + dem_number.classList.add('demInflValue') + dem_number.classList.remove('demInflValue_10') + } + + if(check_dem_control(demInfl, comInfl, space)){ + dem_marker.classList.add('controlled') + dem_number.classList.add('outlined_text') + dem_marker.classList.remove('uncontrolled') + } else { + dem_marker.classList.add('uncontrolled') + dem_marker.classList.remove('controlled') + dem_number.classList.remove('outlined_text') + } + } else { + dem_marker.style.display = 'none'; + dem_number.style.display = 'none'; + } + com_number.innerText=comInfl + if (comInfl > 0) { + com_marker.style.display = 'block'; + com_number.style.display = 'block'; + + if (comInfl > 9) { + com_number.classList.remove('comInflValue') + com_number.classList.add('comInflValue_10') + } else { + com_number.classList.add('comInflValue') + com_number.classList.remove('comInflValue_10') + } + + if(check_com_control(demInfl, comInfl, space)){ + com_marker.classList.add('controlled') + com_number.classList.add('controlled') + com_marker.classList.remove('uncontrolled') + com_number.classList.remove('uncontrolled') + } else { + com_marker.classList.add('uncontrolled') + com_number.classList.add('uncontrolled') + com_marker.classList.remove('controlled') + com_number.classList.remove('controlled') + } + } else { + com_marker.style.display = 'none'; + com_number.style.display = 'none'; + } + + } + +// UPDATE COUNTRY MARKERS + for (let i = 0; i < countries.length; i++) { + const country = countries[i]; + const marker = document.getElementById(country) + const times_held = document.getElementById(`${country}_times_held`) + + if (view.revolutions[find_country_index(country)]) { + marker.classList.add('revolution') + marker.classList.remove('held') + marker.style.display = 'block' + times_held.classList.add('outlined_text') + times_held.classList.remove('hide') + } else if (view.times_held[find_country_index(country)] > 0 ) { + //console.log('setting ', country) + marker.classList.add('held') + marker.style.display = 'block' + times_held.classList.remove('hide') + times_held.innerHTML = view.times_held[find_country_index(country)] + } + else {marker.style.display = 'none'} + } + +// UPDATE ASIDE + if (view.is_pwr_struggle) { + ui.dem_hand_count.innerText = `${view.democrat_power_hand} Power cards` + ui.com_hand_count.innerText = `${view.communist_power_hand} Power cards` + } else{ + ui.dem_hand_count.innerText = `${view.democrat_hand} cards` + ui.com_hand_count.innerText = `${view.communist_hand} cards` + } + ui.deck_length.innerText = `${view.strategy_deck} cards` + +// UPDATE HAND + document.getElementById("hand").replaceChildren() + document.getElementById("played_card").replaceChildren() + + if (view.hand.length && view.is_pwr_struggle === false) { + document.getElementById("hand_panel").classList.remove("hide") + //console.log('view.actions.card', view.actions.card) + for (let c of view.hand) { + let card = ui.cards[c] + document.getElementById("hand").appendChild(card); + if (view.actions && view.actions.card && view.actions.card.includes(c)) { + card.classList.add('action') + } else { + card.classList.remove('action') + } + if (view.valid_cards.includes(c)) { + card.classList.add('selected') + } else { + card.classList.remove('selected') + } + card.classList.remove('discard_card') + } + } else { + document.getElementById("hand_panel").classList.add("hide") + } + +// UPDATE DISCARD +document.getElementById("discard").replaceChildren() +if (!view.is_pwr_struggle) { + for (let c of view.strategy_discard) { + let discard_card = ui.cards[c] + document.getElementById("discard").appendChild(discard_card) + discard_card.classList.add('discard_card') + discard_card.classList.remove('selected') + } +} else if (view.is_pwr_struggle) { + for (let c of view.strategy_discard) { + let discard_card = ui.power_cards[c] + document.getElementById("discard").appendChild(discard_card) + discard_card.classList.add('discard_card') + discard_card.classList.remove('selected') + } +} + +// DISCARD FOR EVENTS +//console.log('view.discard',view.discard) +if(view.discard) { + //document.getElementById("discard").replaceChildren() + document.getElementById("discard_panel").classList.remove("hide") + for (let c of view.strategy_discard) { + let discard_card = ui.cards[c] + document.getElementById("discard").appendChild(discard_card) + discard_card.classList.add('discard_card') + if (view.valid_cards.includes(c)) { + discard_card.classList.add('selected') + } else { + discard_card.classList.remove('selected') + } + } +} else { + if (!show_discard) { + document.getElementById("discard_panel").classList.add("hide") + } +} + +// UPDATE PERMANENTLY REMOVED CARDS +document.getElementById("removed").replaceChildren() +for (let c of view.strategy_removed) { + let discard_card = ui.cards[c] + document.getElementById("removed").appendChild(discard_card) + discard_card.classList.add('discard_card') + discard_card.classList.remove('selected') +} + + +// PLAYED CARD PANEL +if (view.played_card > 0) { + document.getElementById("played_card_panel").classList.remove("hide") + document.getElementById("played_card").appendChild(ui.cards[view.played_card]); + document.getElementById("played_card").classList.remove("hand_card") +} else { + document.getElementById("played_card_panel").classList.add("hide") +} + +// TABLE CARDS PANEL +document.getElementById("table_cards").replaceChildren() +if (view.table_cards.length > 0) { + document.getElementById("table_panel").classList.remove("hide") + for (let c of view.table_cards) { + let card = ui.cards[c] + document.getElementById("table_cards").appendChild(card); + card.classList.remove("hand_card") + card.classList.add('event_card'); + } + } else { + document.getElementById("table_panel").classList.add("hide") +} + +// OPPONENT HAND +document.getElementById("opp_hand").replaceChildren() +if (!view.is_pwr_struggle) { + if (view.show_opp_hand && view.opp_hand.length >0) { + document.getElementById("opp_hand_panel").classList.remove("hide") + for (let c of view.opp_hand) { + let card = ui.cards[c] + document.getElementById("opp_hand").appendChild(card); + card.classList.remove('discard_card') + if (!view.is_pwr_struggle) { + if (view.valid_cards.includes(c)) { + card.classList.add('selected') + } else { + card.classList.remove('selected') + } + } + } + } else { + document.getElementById("opp_hand_panel").classList.add("hide") + } +} else { + //console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) + if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { + document.getElementById("opp_hand_panel").classList.remove("hide") + for (let c of view.opp_hand) { + let card = ui.power_cards[c] + //console.log('power_card:', power_card) + document.getElementById("opp_hand").appendChild(card); + card.classList.remove('discard_card') + } + } else { + document.getElementById("opp_hand_panel").classList.add("hide") + } +} + +// POWER STRUGGLE HAND + document.getElementById("power_hand").replaceChildren() + + if (view.power_hand.length && view.is_pwr_struggle) { + document.getElementById("power_panel").classList.remove("hide") + for (let c of view.power_hand) { + let power_card = ui.power_cards[c] + document.getElementById("power_hand").appendChild(power_card); + power_card.classList.remove('discard_card') + if (view.valid_cards.includes(c)) { + power_card.classList.add('selected'); + } + } + } else { + document.getElementById("power_panel").classList.add("hide") + } + +// CEAUSESCU + +if (view.ceausescu_cards && view.ceausescu_cards.length > 0 && view.is_pwr_struggle === true) { + document.getElementById("ceausescu_panel").classList.remove("hide") + for (let c of view.ceausescu_cards) { + let power_card = ui.power_cards[c] + document.getElementById("ceausescu_hand").appendChild(power_card); + power_card.classList.remove('discard_card') + + } +} else { + document.getElementById("ceausescu_panel").classList.add("hide") +} + +// SAMIZDAT CARD +if (view.samizdat > 0 ) { + let samizdat_card = ui.cards[view.samizdat] + document.getElementById("samizdat_panel").classList.remove("hide") + document.getElementById("samizdat_card").appendChild(samizdat_card) +} else { + document.getElementById("samizdat_panel").classList.add("hide") +} + +// UPDATE BOARD MARKERS + ui.turn.className = `t${view.turn}` + if (view.round_player === 'Democrat') { + ui.round.className = `dem-action-round-tracker r${view.round}` + } else { + ui.round.className = `com-action-round-tracker r${view.round}` + } + ui.stability.className = `s${view.stability}` + ui.dem_TST.className = `tst${view.dem_tst}` + ui.com_TST.className = `tst${view.com_tst}` + if (view.vp >= -20 && view.vp <= 20) { + ui.vp.className = `vp${view.vp}` + } else if (view.vp > 20) { + ui.vp.className = `vp21` + } else if (view.vp < -20) { + ui.vp.className = `vp-21` + } + +//console.log('strategy discard: ', view.strategy_discard) +//console.log('valid spaces: ', view.valid_spaces) + +//console.log('view.persistent_events', view.persistent_events) + +// UPDATE EVENT MARKERS ON THE BOARD + +for (let id of board_events) { + let marker = document.getElementById(`event_${id}`) + //console.log('event', id, marker) + if (view.persistent_events.includes(id)) { + marker.style.display = 'block' + } else { + marker.style.display = 'none' + } +} + + +// UPDATE EVENT MARKERS BELOW THE BOARD + +for (let id of box_events) { + let marker = document.getElementById(`event_${id}`) + //console.log('event', id, marker) + if (view.persistent_events.includes(id)) { + marker.style.display = 'block' + } else { + marker.style.display = 'none' + } +} + + +// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE EVENTS BOX +box_events_showing = false +for (let id of box_events) { + if (view.persistent_events.includes(id)) { + box_events_showing = true; + } +/* + //Special check for events which are not true/false + if (view.persistent_events['foreign_currency_debt_burden'] !== '') { + aside_events_showing = true + } + if (view.persistent_events['stand_fast'] !== '') { + aside_events_showing = true + } + */ +} + +if (box_events_showing) { + document.getElementById('events_panel').classList.remove("hide") +} else { + document.getElementById('events_panel').classList.add("hide") +} + +let systematization = document.getElementById('event_69') +if (view.persistent_events.includes(69)) { + systematization.style.left = (spaces[view.systematization].box.x +20) + 'px'; + systematization.style.top = spaces[view.systematization].box.y + 'px'; +} + +let tyrant = document.getElementById('event_97') +if (view.persistent_events.includes(97)) { + tyrant.style.left = (spaces[view.the_tyrant_is_gone].box.x - 41) + 'px'; + tyrant.style.top = (spaces[view.the_tyrant_is_gone].box.y + 23) + 'px'; +} else {tyrant.style.display = 'none'} + + action_button("yes", "Yes") + action_button("no", "No") + action_button("start", "Start") + action_button("check", "Check held cards") + action_button("tst_7", "Cancel opponent event") + action_button("tst_8", "Event and operations") + action_button("end", "End Game") + action_button("continue", "Continue playing") + action_button("east_germany", "East Germany") + action_button("poland", "Poland") + action_button("czechoslovakia", "Czechoslovakia") + action_button("hungary", "Hungary") + action_button("romania", "Romania") + action_button("bulgaria", "Bulgaria") + action_button("extra", "Take action round") + action_button("pass", "Pass") + action_button("remove", "Remove SPs") + action_button("add", "Add SPs") + action_button("ops", "Operations") + action_button("discard", "Discard") + action_button("strike", "Strike") + action_button("march", "March") + action_button("rally", "Rally in the Square") + action_button("petition", "Petition") + action_button("bonus", "Calculate VP bonus") + action_button("scoring", "Score country") + action_button("retain", "Retain Power") + action_button("surrender", "Surrender Power") + action_button("take", "Take Power") + action_button("concede", "Concede") + action_button("struggle", "Begin power struggle") + action_button("raise", "Raise the stakes") + action_button("draw", "Draw") + action_button("scoring", "Scoring") + action_button("event", "Event") + action_button("opp_event", "Resolve opponent event") + action_button("influence", "Place SPs") + action_button("support_check", "Support Checks") + action_button("tst", "Tiananmen Square Track") + action_button("roll", "Roll a die") + action_button("done", "Done") + action_button("end_round", "End Round") + action_button("undo", "Undo") + +console.log('view.actions', view.actions) +} + +// =========================== LOG FUNCTIONS ============================================== + +function sub_card_name(match, p1) { + let x = p1 | 0 + return `${cards[x].name}` +} + +function sub_power_card_name(match, p1) { + let x = p1 | 0 + return `${power_cards[x].name}` +} + +function sub_power_card_value(match, p1) { + let x = p1 | 0 + return `${x}` +} + +function sub_space_name(match, p1) { + let x = p1 | 0 + let id = spaces[x].space_id + let name = spaces[x].name_unique + return `${name}` +} + +function sub_die(match) { + return die[match] || match +} + +const die = { + D1: '', + D2: '', + D3: '', + D4: '', + D5: '', + D6: '' +} + +// =========================== VISUAL FUNCTIONS ==========================================# + +function on_focus_card_tip(card_number) { + document.getElementById("tooltip").className = "card card_" + card_number +} + +function on_blur_card_tip() { + document.getElementById("tooltip").classList = "card hide" +} + +function on_focus_space_tip(id) { + space = document.getElementById(`space_${id}`) + space.classList.add("tip") +} + +function on_click_space_tip(id) { + space = document.getElementById(`space_${id}`) + scroll_into_view(space) +} + +function on_blur_space_tip(id) { + space = document.getElementById(`space_${id}`) + space.classList.remove("tip") +} + +function toggle_pieces() { + document.getElementById("pieces").classList.toggle("hide") +} + + +function toggle_discard() { + if (show_discard) { + show_discard = false + } else { + show_discard = true + } + document.getElementById("discard_panel").classList.toggle("hide") +} + +function toggle_removed() { + document.getElementById("removed_panel").classList.toggle("hide") +} + +function check_dem_control(demInfl, comInfl, space) { + if ((demInfl - comInfl) >= space.stability) { + return true + } else{ false} +} + +function check_com_control(demInfl, comInfl, space) { + if ((comInfl - demInfl) >= space.stability) { + return true + } else{ false} +} + +function find_country_index(country) { + return countries.indexOf(country) +} + +create_ui() diff --git a/rules.js b/rules.js index 91818c9..44bbef6 100644 --- a/rules.js +++ b/rules.js @@ -1,9892 +1,9892 @@ -//"use strict" - -const { spaces, cards, power_cards } = require("./data.js") - -var game, view, states = {} - -const DEM = "Democrat" -const COM = "Communist" - -const first_strategy_card = 1 -const last_strategy_card = 110 - -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 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] -const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] -const elite_spaces = [12, 15, 27, 43, 51, 69] -const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] -const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] -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] - -exports.scenarios = [ "Standard" ] - -exports.roles = [ DEM, COM ] - -// --- SET UP --- - -exports.setup = function (seed, scenario, options) { - game = { - seed: seed, - log: [], - undo: [], - summary: [], - active: null, - state: "com_init", - return: '', - vm: null, - vm_event: 0, - vm_event_to_do: false, - vm_infl_to_do: false, - - played_card: 0, - table_cards: [], - available_ops: 0, - vm_available_ops: 0, - valid_spaces: [], - valid_cards: [], - - vp: 0, - turn: 0, - round: 0, - round_player: COM, - stability: 0, - dem_tst_position: 0, - com_tst_position: 0, - dem_tst_attempted: 0, - com_tst_attempted: 0, - dem_tst_attempted_this_turn: 0, - com_tst_attempted_this_turn: 0, - - demInfl: [], - comInfl: [], - - strategy_deck: [], - strategy_discard: [], - discard: false, - view_opp_hand: false, - strategy_removed: [], - persistent_events: [], - power_struggle_deck: [], - power_struggle_discard: [], - dem_hand_limit: 8, - com_hand_limit: 8, - democrat_hand: [], - communist_hand: [], - - pwr_struggle_in: [], - is_pwr_struggle: false, - dem_pwr_hand_limit: 0, - com_pwr_hand_limit: 0, - dem_pwr_hand: [], - com_pwr_hand: [], - raised_stakes_discard: 0, - raised_stakes: 0, - raised_stakes_round: 0, - phase: 0, - times_held: [0, 0, 0, 0, 0, 0], - revolutions: [false, false, false, false, false, false], - remove_opponent_infl: false, - tactics_fails: '', - } - - log_h1("1989 Dawn of Freedom") - - game.active = COM - start_game() - - return game -} - -function start_game() { - //starting influence - - // Draw cards - - //console.log('start game') - - game.strategy_deck = draw_deck(cards) - reset_power() - - //Set starting influence - spaces.forEach((space, index) => { - if (space !== null) { - game.demInfl[index] = space.demInfl - game.comInfl[index] = space.comInfl - } - }) - - //Set starting placement ops - game.starting_infl = { - com_starting_infl: 0, - dem_starting_infl: 0 - }, - - // Set variable event cards where event is playable at start of game - - game.playable_cards = [14, 15, 21, 70] - - //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) - //.log('game.strategy_deck: ', game.strategy_deck[1], 'democrat_hand:', game.democrat_hand) - - game.valid_spaces = valid_spaces_setup() - game.available_ops = 2 - game.phase = 0 - log_h1("Place starting Support Points") - log_side() -} - - -exports.view = function(state, player) { - game = state - - view = { - log: game.log, - active: game.active, - prompt: null, - actions: null, - - played_card: game.played_card, - table_cards: game.table_cards, - valid_spaces: game.valid_spaces, - valid_cards: game.valid_cards, - - demInfl: game.demInfl, - comInfl: game.comInfl, - turn: game.turn, - round: game.round, - round_player: game.round_player, - vp: game.vp, - stability: game.stability, - dem_tst: game.dem_tst_position, - com_tst: game.com_tst_position, - persistent_events: game.persistent_events, - systematization: game.systematization, - the_tyrant_is_gone: game.the_tyrant_is_gone, - - strategy_deck: game.strategy_deck.length, - strategy_removed: game.strategy_removed, - discard: game.discard, - show_opp_hand: game.view_opp_hand, - - democrat_hand: game.democrat_hand.length, - communist_hand: game.communist_hand.length, - democrat_power_hand: game.dem_pwr_hand.length, - communist_power_hand: game.com_pwr_hand.length, - ceausescu_cards: game.ceausescu_cards, - is_pwr_struggle: game.is_pwr_struggle, - times_held: game.times_held, - revolutions: game.revolutions, - - hand: [], - set_aside: [], - pwr_hand: [], - - - } - - if (game.is_pwr_struggle) { - view.strategy_discard = game.power_struggle_discard - } else { - view.strategy_discard = game.strategy_discard - } - - if (player === game.active && game.vm && game.vm.draw) - view.drawn = game.vm.draw - - if (player === game.active) { - if (game.selected_space > 0 ) { - view.valid_spaces = [game.selected_space] - } else { - view.valid_spaces = game.valid_spaces - } - } else { - view.valid_spaces = [] - } - - if (player === game.active) { - view.valid_cards = game.valid_cards - } else { - view.valid_cards = [] - } - - if (player === DEM) { - view.hand = game.democrat_hand - if (game.communist_hand_red) { - view.opp_hand = game.communist_hand_red - } - view.set_aside = game.democrat_set_aside /*Is this being used? */ - view.power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) - - } else if (player === COM) { - view.hand = game.communist_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) - } - - if (player === DEM) { - view.samizdat = game.samizdat_card - } - - if (game.state === "game_over") { - view.prompt = game.victory - } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { - if (states[game.state]) { - let inactive = states[game.state].inactive - if (typeof inactive === "function") - view.prompt = `Waiting for ${game.active} ${inactive()}` - else - view.prompt = `Waiting for ${game.active} to ${inactive}` - } else { - view.prompt = "A Unknown state: " + game.state - } - } else { - view.actions = {} - - if (states[game.state]) - states[game.state].prompt(player) - else - view.prompt = "B Unknown state: " + game.state - if (view.actions.undo === undefined) { - if (game.undo && game.undo.length > 0) - view.actions.undo = 1 - else - view.actions.undo = 0 - } - } - - return view -} - - -// === ACTIONS =========== - -function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) - if (argument === undefined) { - //console.log('argument undefined') - view.actions[action] = 1 - } else { - if (!(action in view.actions)) { - //console.log('push argument') - view.actions[action] = [] - } - view.actions[action].push(argument) - } - //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) -} - -function gen_action_infl(space){ - gen_action("infl", space) -} - -function gen_action_card(card){ - gen_action("card", card) -} - -function gen_action_sc(space){ - gen_action("sc", space) -} - -function gen_action_scoring(){ - gen_action("scoring") -} - -exports.action = function (state, player, action, arg) { - //console.log('exports.action called with state:' , state, 'player:', player, 'action: ', action, 'arg: ', arg) - game = state - if (states[game.state] && action in states[game.state]) { - states[game.state][action](arg, player) - } else { - if (action === "undo" && game.undo && game.undo.length > 0) - pop_undo() - else - throw new Error("Invalid action: " + action) - } - return game -} - -// ============= GAME STATES ======================= - -states.com_init = { - inactive: 'place starting SPs.', - prompt() { - //console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) - if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { - view.prompt = 'Place starting SPs: done. Start Turn 1.'; - gen_action("start"); - } else if (game.available_ops === 0) { - view.prompt = 'Place starting SPs: done.'; - gen_action("done"); - return; - } else if (game.starting_infl.dem_starting_infl === 2) { - view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` - } else { - view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` - } - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - add_infl(space) - - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.starting_infl.com_starting_infl++ - if (game.starting_infl.com_starting_infl == 1){ - game.available_ops = 3 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 2) { - game.available_ops = 4 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 3) { - delete game.starting_infl - game.state = 'start_game' - } - }, - start() { - new_turn() - clear_undo() - game.state = 'choose_card' - } -} - -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"); - return; - } else if (game.starting_infl.com_starting_infl === 2) { - view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` - } else { - view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` - } - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - add_infl(space) - }, - - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.starting_infl.dem_starting_infl++ - if (game.starting_infl.dem_starting_infl == 1){ - game.available_ops = 3 - } else if (game.starting_infl.dem_starting_infl == 2) { - game.available_ops = 2 - } - game.state = 'com_init' - valid_spaces_setup() - next_player() - } -} - - -states.choose_card = { - inactive: 'choose a card.', - prompt() { - 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') - } else { - view.prompt = 'Choose a card.' - let available_cards - if (game.active === DEM) { - available_cards = game.democrat_hand - } else { - available_cards = game.communist_hand - } - for (let card of available_cards) { - gen_action_card(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() - - if (game.round !== 8 && scoring_cards_count >= (8-game.round)){ - game.temp = card - game.state = 'confirm_card' - return - } - } - select_card(card) - }, - pass() { - log('No cards remaining. Passed') - //end_round() - game.state = 'end_round' - } -} - -states.confirm_card = { - inactive: 'choose a card.', - prompt() { - let scoring_cards_count = count_scoring_cards() - view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` - gen_action('continue') - }, - continue() { - select_card(game.temp) - } -} - -states.play_card ={ - get inactive() { - return `play ${clean_name(cards[game.played_card].name)}.` - }, - prompt () { - /*if (game.phase >= 1) { /*Finish here when playing your own event - console.log('in play card') - view.prompt = `${clean_name(cards[game.played_card].name)}: done. End the Action Round.` - gen_action('end_round') - return - }*/ - - view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` - - if (scoring_cards.includes(game.played_card)) { - /*view.prompt = 'Play for:'*/ - gen_action('event') - return - } - - // Check for Reformer Rehabilitated - - //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) - - - if (game.played_card === 67 && game.playable_cards.includes(67)){ - if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { - gen_action('event') - } - if (game.active === COM && (game.dem_tst_position < game.com_tst_position)) { - 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') - } - - 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') - } - - //Continue with normal logic - get_events(game.played_card) - } - - gen_action('influence') - 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() - //console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - log_gap(`Played C${cards[game.played_card].number} for the event`) - game.vm_infl_to_do = false - if (scoring_cards.includes(game.played_card)) {game.phase = 0} - else {game.phase = 1} - game.return = game.active - if (switch_events.includes(game.played_card)) {next_player()} - game.vm_event = game.played_card - //console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) - goto_vm(game.vm_event) - }, - opp_event() { - push_undo() - log_gap(`Played C${cards[game.played_card].number} for the event`) - game.phase = 1 /*Do I still need this?*/ - game.vm_infl_to_do = true - game.return = game.active - game.vm_event = game.played_card - if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { - goto_vm(game.vm_event)} - else { - next_player() - log(`C${game.vm_event}`) - goto_vm(game.vm_event) - } - }, - influence() { - push_undo() - log_gap(`Played C${cards[game.played_card].number} to place SPs`) - - - // Check if Common European Home played for influence - if (game.played_card === 21) { - if (game.active === DEM) { - game.vp -- - log('-1 VP') - if (check_vp()) { - return - } - } else { - game.vp ++ - log('+1 VP') - if (check_vp()) { - return - } - } - } - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - //game.phase = 1 /*Do I need this? */ - game.vm_event_to_do = true - } - } - - // If ABHR - Set AHBR tracker to true - if (game.persistent_events.includes(58)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state='add_influence' - valid_spaces_infl() - }, - tst() { - push_undo() - log_gap(`Played C${cards[game.played_card].number} to the Tiananmen Square Track`) - game.state='tiananmen_square_attempt' - }, - support_check() { - push_undo() - log_gap(`Played C${cards[game.played_card].number} for support checks`) - - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - game.vm_event_to_do = true - } - } - - game.available_ops = 2 - game.state='support_check_prep' - valid_spaces_sc() - }, - tst_7() { /*Cancel opponent event */ - push_undo() - 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' - }, - tst_8() { /*Play card for ops and event */ - push_undo() - game.vm_event_to_do = true - game.vm_infl_to_do = true - game.tst_8 = true - log(`Played C${game.played_card} for event and operations`) - game.state = 'vm_tst_8' - }, - end_round () { - end_round() - } - -} - -states.resolve_opponent_event = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - //console.log('in resolve opponent event: discard', game.strategy_discard) - if (game.vm_infl_to_do) { - view.prompt = 'Event resolved. Choose to play card for:' - gen_action('influence') - gen_action('support_check') - } else if (game.vm_event_to_do) { - // Check for Tiananmen Square Track ability - play opponent card without triggering event - if ((game.active === DEM && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ - gen_action('tst_7') - } - view.prompt = `${clean_name(cards[game.played_card].name)}: you must resolve the opponent event.` - gen_action('opp_event') - } else { - view.prompt = 'Event resolved. End the action round.' - gen_action('end_round') - } - }, - influence(){ - push_undo() - // If ABHR - Set AHBR tracker to true - if (game.persistent_events.includes(58)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state = 'finish_add_infl' - valid_spaces_infl() - }, - support_check() { - push_undo() - game.available_ops = 2 - game.state = 'finish_support_check_prep' - valid_spaces_sc() - }, - opp_event() { - game.vm_event_to_do = false - game.return_state = 'resolve_opponent_event' - if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { - game.return = game.active - log(`Played C${game.played_card} for the event`) - goto_vm(game.played_card)} - else { - if (game.active === DEM) { - game.return = COM - } else { - game.return = DEM - } - next_player() - log(`C${game.played_card}`) - goto_vm(game.played_card) - } - }, - tst_7() { - push_undo() - log('Event cancelled using TST Award') - game.tst_7 = true - game.vm_event_to_do = false - }, - end_round() { - push_undo() - /*if(game.round_player === COM && game.active === DEM) { - log_h3('End of Communist Action Round') - change_player() - } */ - end_round() - } -} - - -states.finish_add_infl = { - inactive: 'add SPs.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Place SPs: done.' - gen_action("end_round") - return; - } - - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - }, - infl(space) { - add_infl(space) - }, - end_round() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - end_round() - //game.state = 'end_round' - } -} - -states.finish_support_check_prep = { - inactive: 'do support checks.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('end_round') - //return - } else { - view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) - } - } - }, - sc(space) { - push_undo() - game.selected_space = space - // Check for Austria-Hungary Border Reopened - check on first support check only - //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) - if (game.persistent_events.includes(58)){ - if (game.active === DEM && game.available_ops > 1) { - //console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', 'austria_hungary_border_reopened']) - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'finish_austria_hungary_border_reopened_check' - return - } - } - } - game.state = 'finish_do_support_check' - }, - end_round () { - end_round() - //game.state = 'end_round' - } -} - -states.finish_austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened', - prompt() { - view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' - gen_action('yes') - gen_action('no') - }, - yes() { - game.austria_hungary_border_reopened_tracker = true - game.state = 'finish_do_support_check' - }, - no() { - game.state = 'finish_do_support_check' - } -} - -states.finish_do_support_check = { - inactive: 'do support checks', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.available_ops-- - if (game.available_ops === 0) { - game.valid_spaces = [] - } - game.state = 'finish_support_check_prep' - return - } -} - -states.add_influence = { - inactive: 'add SPs.', - prompt () { - if (game.available_ops <= 0) { - view.prompt = 'Place SPs: done.' - if (!game.vm_event_to_do) { - gen_action("end_round") - } else { - gen_action('done') - } - } else { - - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } - }, - infl(space) { - add_infl(space) - }, - end_round() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - end_round() - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - reset_austria_hungary_border_reopened() - game.state = 'resolve_opponent_event' - } -} - -states.tiananmen_square_attempt = { - inactive: 'do Tiananmen Square Attempt.', - prompt () { - view.prompt = 'Tiananmen Square Track attempt: Roll a die.' - gen_action('roll') - }, - roll() { - clear_undo() - do_tst_attempt () - } -} - -states.tiananmen_square_attempt_success = { - inactive: 'do Tiananmen Square Attempt.', - prompt () { - if (game.vm_event > 200) { - view.prompt = 'Tiananmen Square Track attempt successful. Go to TST Award.' - gen_action('done') - } else { - view.prompt = 'Tiananmen Square Track attempt successful.' - gen_action('end_round') - } - - }, - done () { - push_undo() - //console.log('going to tst award, game.return_state', game.return_state) - goto_vm(game.vm_event) - }, - end_round () { - push_undo() - end_round() - } -} - -states.tiananmen_square_attempt_fail = { - inactive: 'do Tiananmen Square Attempt.', - prompt () { - view.prompt = 'Tiananmen Square Track attempt failed.' - gen_action('end_round') - }, - end_round () { - push_undo() - end_round() - //game.state = 'tiananmen_square_attempt_done' - } -} - -states.tiananmen_square_attempt_done = { - inactive: 'do Tiananmen Square Attempt.', - prompt () { - view.prompt = 'Tiananmen Square Track attempt: done.' - gen_action('end_round') - }, - end_round () { - end_round() - //game.state = 'end_round' - } -} - -states.tst_goddess = { - inactive: 'choose whether to discard a card.', - prompt() { - //if (game.phase === 0) { - view.prompt = 'Tiananmen Square Track award: you may discard a non-Power Struggle Card and draw a replacement.' - for (let card of game.valid_cards) { - gen_action_card(card) - } - gen_action('pass') - /*} else { - view.prompt = 'Discard a card: done.' - gen_action('done') - }*/ - }, - card(card) { - push_undo() - discard(card) - game.valid_cards = [] - game.state = 'tst_goddess_draw' - //game.phase++ - /*if (game.active === DEM) { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length +1, game.communist_hand.length) - } else { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) - }*/ - }, - pass() { - log('Did not discard') - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } - }, - done() { - - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } - } -} - -states.tst_goddess_draw = { - inactive: 'choose whether to discard a card.', - prompt() { - view.prompt = 'Draw a replacement card.' - gen_action('draw') - }, - draw() { - if (game.active === DEM) { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length +1, game.communist_hand.length) - } else { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) - } - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } - } -} - - - -states.support_check_prep = { - inactive: 'do support checks', - prompt () { - if (game.available_ops === 0) { /*Needs another check for Support Checks done during Crowd Turns against Ceausescu*/ - if (game.is_pwr_struggle) { - view.prompt = 'The Crowd Turns Against Ceausescu. Support checks: done.' - gen_action('done') - } else if (!game.vm_event_to_do) { - view.prompt = 'Support checks: done.' - gen_action('end_round') - } else { - view.prompt = 'Support checks: done.' - gen_action('done') - } - } else if (game.available_ops > 0) { - view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - - for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) - } - } - }, - sc(space) { - push_undo() - game.selected_space = space - - // Check for Austria-Hungary Border Reopened - check on first support check only - //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) - if (game.persistent_events.includes(58)) { - if (game.active === DEM && game.available_ops > 1) { - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'austria_hungary_border_reopened_check' - return - } - //game.state = 'do_support_check' - } /*else { */ - } - game.state = 'do_support_check' - //} - }, - end_round() { - push_undo() - end_round() - }, - done() { - push_undo() - if (game.is_pwr_struggle) {/*Crowd Turns Against Ceausescu should be the only time you end up here during a power struggle */ - if (game.return !== game.active) { - next_player() - } - log_h2('Raise the Stakes') - game.state = 'raise_stakes_1' - return - } - reset_austria_hungary_border_reopened() - game.state = 'resolve_opponent_event' - } -} - -states.do_support_check = { - inactive: 'do support checks.', - prompt () { - // console.log('in do_support_check') - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.available_ops-- - if (game.available_ops === 0) { - game.valid_spaces = [] - } - game.state = 'support_check_prep' - return - } -} - -states.austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened.', - prompt() { - view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' - gen_action('yes') - gen_action('no') - }, - yes() { - game.austria_hungary_border_reopened_tracker = true - game.state = 'do_support_check' - }, - no() { - game.state = 'do_support_check' - } -} - -states.end_round = { - inactive: 'finish playing a card.', - prompt() { - view.prompt = 'End the Action Round.' - gen_action('end_round') - }, - end_round() { - push_undo() - end_round() - } -} - -//======================= POWER STRUGGLE =============================== - -states.draw_power_cards = { - inactive: 'draw cards.', - prompt() { - view.prompt = `${clean_name(cards[this_card()].name)}: draw cards.` - gen_action('draw') - }, - draw() { - push_undo() - game.power_struggle_deck = [...all_power_cards] - // console.log('game.power_struggle_deck.length', game.power_struggle_deck.length) - //console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - //console.log('test3') - let presence = check_presence(game.pwr_struggle_in) - //console.log('test2') - if (presence.dem_spaces > 0) { - game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1) - } else { - game.dem_pwr_hand_limit = 0 - } - if (presence.com_spaces > 0 ) { - game.com_pwr_hand_limit = 6 + 2*(presence.com_spaces - 1) - } else { - game.com_pwr_hand_limit = 0 - } - // Events which affect cards drawn - if (game.persistent_events.includes(17) && game.com_pwr_hand_limit >= 2) { - log('Democrat receives 2 cards from Communist due to C17') - game.dem_pwr_hand_limit += 2 - game.com_pwr_hand_limit -= 2 - discard_from_table(17) - game.persistent_events = game.persistent_events.filter(n => n !== 17) - } - - if (game.persistent_events.includes(72)) { - let farmer_check - for (let space of spaces) { - if (space && space.country === game.pwr_struggle_in && space.socio === 3 && check_dem_control(space.space_id)) { - farmer_check = true - } - } - if (farmer_check && game.com_pwr_hand_limit > 0) { - log('Democrat receives 1 cards from Communist due to C72') - game.dem_pwr_hand_limit += 1 - game.com_pwr_hand_limit -= 1 - permanently_remove(72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) - } - } - - if (game.persistent_events.includes(102) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { - log('Communist receives 2 cards from Democrat due to C102') - game.dem_pwr_hand_limit -= 2 - game.com_pwr_hand_limit += 2 - permanently_remove(102) - game.persistent_events = game.persistent_events.filter(n => n !== 102) - } - - //Draw Power Cards - game.is_pwr_struggle = true - //console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) - draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) - if (game.active === DEM) { - game.valid_cards = [...game.dem_pwr_hand] - } else { - game.valid_cards = [...game.com_pwr_hand] - } - //game.valid_cards = all_power_cards - - log(`Communist: ${game.com_pwr_hand.length} cards`) - log(`Democrat: ${game.dem_pwr_hand.length} cards`) - - //Check if The Crowd Turns Against Ceausescu occurs - if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { - //console.log('draw cards: crowd subcheck, game.active', game.active) - if (game.active === COM) { - game.return = COM - next_player() - } - log_h3('C54') - game.persistent_events.push(54) - game.state = 'the_crowd_turns_against_ceausescu_prep' - } else { - log_h2('Raise the Stakes') - game.state = 'raise_stakes_1' - //console.log('game.state', game.state, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - } - } -} - -states.the_crowd_turns_against_ceausescu_prep = { - get inactive() { - return `resolve ${clean_name(cards[54].name)}.` - }, - prompt() { - view.prompt = 'The Crowd Turns Against Ceausescu: draw cards.' - gen_action('draw') - }, - draw() { - game.ceausescu_cards = [] - draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) - //console.log('game.ceausescu_cards', game.ceausescu_cards) - game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length - log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) - game.vm_available_ops = game.temp * 3 - log(`Democrat takes a ${game.vm_available_ops} Action Round`) - game.state = 'vm_the_crowd_turns_against_ceausescu' - } -} - -states.vm_the_crowd_turns_against_ceausescu = { - get inactive() { - return `resolve ${clean_name(cards[54].name)}.` - }, - prompt() { - view.prompt = `You have ${game.vm_available_ops} operations points. Play for:` - gen_action('influence') - gen_action('support_check') - }, - influence() { - push_undo() - delete game.ceausescu_cards - valid_spaces_infl() - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') - game.state = 'the_crowd_turns_against_ceausescu_infl' /* Send this to add_infl. Add check at end of add_infl similar to valid_spaces*/ - }, - support_check() { - push_undo() - delete game.ceausescu_cards - valid_spaces_sc() - game.available_ops = 2 - game.state = 'support_check_prep' - } -} - -states.the_crowd_turns_against_ceausescu_infl = { - inactive: 'add SPs.', - prompt () { - if (game.vm_available_ops === 0) - { - view.prompt = 'Place SPs: done.'; - gen_action("done"); - return; - } - - view.prompt = `Add SPs: ${game.vm_available_ops} remaining` - for (let space of game.valid_spaces) { - gen_action_infl(space) - } - }, - infl(space) { - vm_do_add_infl(space) - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - if (game.return !== game.active) { - next_player() - } - log_h2('Raise the Stakes') - game.state = 'raise_stakes_1' - } -} - -states.raise_stakes_1 = { - inactive: 'raise the stakes.', - - prompt () { - // console.log('raise stakes 1 - valid cards', game.valid_cards) - // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { - view.prompt = 'Raise the stakes: you must pass.' - gen_action('pass') - } - else if (game.raised_stakes_discard === 3) { - view.prompt = 'Raise the stakes: done.' - gen_action('done') - } else { - view.prompt = `Discard ${3-game.raised_stakes_discard} cards to raise the stakes.` - if (game.raised_stakes_discard === 0) { - gen_action('pass') - } - for (let card of game.valid_cards) { - gen_action_card(card) - } - } - }, - card(card) { - push_undo() - if (numberless_cards.includes(card)) { - log(`Discarded: P${card}`) - } else { - log(`Discarded: P${card} V${power_cards[card].value}`) - } - discard(card) - - game.raised_stakes_discard ++ - if (game.raised_stakes_discard === 3) { - game.raised_stakes++ - game.valid_cards = [] - } - }, - pass(){ - log('Did not raise the stakes') - game.raised_stakes_discard = 0 - next_player() - if (game.active === DEM) { - game.valid_cards = [...game.dem_pwr_hand] - } else { - game.valid_cards = [...game.com_pwr_hand] - } - game.state = 'raise_stakes_2' - }, - done () { - log_gap('Raised the stakes') - game.raised_stakes_discard = 0 - next_player() - //console.log('game.active', game.active) - if (game.active === DEM) { - game.valid_cards = [...game.dem_pwr_hand] - } else { - game.valid_cards = [...game.com_pwr_hand] - } - // console.log('game.valid_cards', game.valid_cards) - game.state = 'raise_stakes_2' - } -} - -states.raise_stakes_2 = { - inactive: 'raise the stakes.', - - prompt () { - if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { - view.prompt = 'Raise the stakes: you must pass.' - gen_action('pass') - return - } - if (game.raised_stakes_discard === 3) { - view.prompt = 'Raise the stakes: done.' - gen_action('done') - } else { - view.prompt = `Discard ${3-game.raised_stakes_discard} cards to raise the stakes.` - if (game.raised_stakes_discard === 0) { - gen_action('pass') - } - for (let card of game.valid_cards) { - gen_action_card(card) - } - } - }, - card(card) { - push_undo() - if (numberless_cards.includes(card)) { - log(`Discarded: P${card}`) - } else { - log(`Discarded: P${card} V${power_cards[card].value}`) - } - discard(card) - - game.raised_stakes_discard ++ - if (game.raised_stakes_discard === 3) { - game.raised_stakes++ - game.valid_cards = [] - } - - }, - pass() { - log('Did not raise the stakes') - game.raised_stakes_discard = 0 - game.valid_cards = [] - log_h2('Play Cards') - next_player() - game.state = 'begin_power_struggle' - }, - done () { - log_gap('Raised the stakes') - game.raised_stakes_discard = 0 - game.valid_cards = [] - log_h2('Play Cards') - next_player() - game.state = 'begin_power_struggle' - }, -} - -states.begin_power_struggle = { - inactive: 'begin power struggle.', - prompt() { - view.prompt = 'Begin power struggle.' - gen_action('struggle') - }, - struggle () { - do_valid_cards() - game.state = 'power_struggle' - } -} - -states.power_struggle = { - inactive: 'play a card.', - prompt () { - console.log('game.vm_event', game.vm_event) - if (game.phase === 0) { - if (game.valid_cards.length > 0) { - view.prompt = "Play a card." - for (let card of game.valid_cards) { - gen_action_card(card) - } - } else if ( game.valid_cards.length === 0) { - view.prompt = 'No valid cards. You must concede.' - gen_action('concede') - } - } - if (game.phase === 1) { - if (game.valid_cards.length > 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - gen_action('concede') - for (let card of game.valid_cards) { - gen_action_card(card) - } - } else if (game.valid_cards.length === 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` - gen_action('concede') - } - } - else if (game.phase === 2) { - view.prompt = 'You matched. Roll a die.' - gen_action('roll') - } - else if (game.phase === 3) { - view.prompt = 'Play leader as:' - if (game.tactics_fails !== "Strike") {gen_action('strike')} - if (game.tactics_fails !== "March") {gen_action('march')} - if (game.tactics_fails !== "Rally in the Square") {gen_action('rally')} - if (game.tactics_fails !== "Petition") {gen_action('petition')} - } - }, - card(card) { - push_undo() - discard(card) - game.valid_cards=[] - game.return_state = 'power_struggle' - if (card === 52) { - log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) - - } else { - if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ - else if (numberless_cards.includes(card)) { - log_gap(`Played: P${card}`) - } else { - log_gap(`Played: P${card} V${power_cards[card].value}`) - } - } - if (game.phase === 0) { - if (card >= 37 && card <= 48) { /*When a leader is played */ - game.played_power_card = card - game.phase = 3 - } else if (card === 49){ /*Scare Tactics */ - game.return = '' - goto_vm(349) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ - } else if (card === 50) { /*Support Surges */ - if (game.active === DEM) { - game.return = COM - } else { - game.return = DEM - } - goto_vm(350) - } else if (game.phase === 0 && card === 51) { /*Support Falters */ - next_player() - goto_vm(351) - } else { - game.played_power_card = card - game.phase = 1 - next_player() - do_valid_cards() - } - } else if (game.phase === 1) { - if (card === 52) { - game.tactics_fails = power_cards[game.played_power_card].name - game.phase = 0 - next_player() - do_valid_cards() - } else if (power_cards[game.played_power_card].value === 1) { - log('Takes initiative') - game.phase = 0 - do_valid_cards() - } else { - game.phase = 2 - } - } - }, - roll () { - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - if (roll >= power_cards[game.played_power_card].value) { - log('Initiative roll successful') - game.phase = 0 - do_valid_cards() - } else { - log(`Initiative roll failed. Required ${power_cards[game.played_power_card].value} or more`) - game.phase = 0 - next_player() - do_valid_cards() - } - }, - concede () { - push_undo() - game.valid_cards = [] - log('Conceded') - log_h2('Aftermath') - log_h3('Support Loss') - //if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {game.rally_win = 2} - //if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {game.petition_win = 2} - if (game.phase === 0) { - game.played_power_card = 0 /*If conceded when held the initiative but had no playable cards, ignore the last played card */ - } - game.phase = 0 - game.state = 'support_loss' - }, - strike () { - log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) - game.played_power_card = 9 - game.phase = 1 - next_player() - do_valid_cards() - }, - march () { - log(`Played: P${power_cards[game.played_power_card].number} as a March`) - game.played_power_card = 21 - game.phase = 1 - next_player() - do_valid_cards() - }, - rally () { - log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) - game.played_power_card = 53 - game.phase = 1 - next_player() - do_valid_cards() - }, - petition () { - log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) - game.played_power_card = 54 - game.phase = 1 - next_player() - do_valid_cards() - }, - /*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) - } 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)} - game.phase = 0 - next_player() - do_valid_cards() - },*/ - /*infl(space) { - game.remove_opponent_infl = true - remove_infl(space) - game.phase = 6 - }, - discard () { /*Is this still needed? - if (game.active === DEM) {discard_card(game.dem_pwr_hand)} - else {discard_card(game.com_pwr_hand)} - game.available_ops -- - }, */ - done () { - if (game.phase === 7) { /*Is this ever called anymore? */ - game.phase = 0 - log_msg_gap('Takes initiative') - do_valid_cards() - } else { - game.phase = 0 - next_player() - do_valid_cards() - } - } -} - -states.support_loss ={ - inactive: 'do Support Loss.', - prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') - } - } else { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') - } - } - }, - roll () { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - let rally_win = 0 - let petition_win = 0 - 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 - - // Roll modifiers - if (game.active === COM && game.persistent_events.includes(62)) { - log('+1 from C62') - modified_roll ++ - } - - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P25') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - game.available_ops = support_loss_roll[modified_roll] - if (game.available_ops === 0) { - log('Does not remove SPs') - } - game.phase++ - if (game.available_ops > 0) { - valid_spaces_support_loss() - } - }, - infl (space) { - game.remove_opponent_infl = false /* Don't know why this is needed... */ - remove_infl(space) - if (game.available_ops === 0 ) { - game.valid_spaces = [] - } - }, - done () { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - next_player() - log_h3('Victory Point') - game.phase = 0 - game.state = 'vp_roll' - } -} - -states.vp_roll = { - inactive: 'do VP Roll.', - prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } - } else { - if (game.phase === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } - } - }, - roll () { - let roll = Math.floor(Math.random() * 6) + 1 - 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} - 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 - if (game.active === DEM && game.persistent_events.includes(62)) { - log('+1 from C62') - modified_roll ++ - } - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P25') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - let vp_change = vp_roll[modified_roll] - if (game.active === DEM) { - log(`+${vp_change} VP`) - } else { - log(`-${vp_change} VP`) - } - if (roll >= 4) - //console.log('VP before', game.vp) - if (game.active === DEM) {game.vp += vp_change} - else {game.vp -= vp_change} - //console.log('VP after', game.vp) - if (game.active === DEM && modified_roll >= 4) { - game.phase = 1 - } else { - game.phase = 0 - if (game.active === DEM) {next_player()} - game.state = 'choose_power' - } - }, - take () { - push_undo() - //Find name of scoring card - let scoring_card = scoring_cards[countries.indexOf(game.pwr_struggle_in)] - permanently_remove(scoring_card) - take_power(game.pwr_struggle_in) - game.phase = 2 - }, - scoring () { - push_undo() - log_h2('Scoring') - score_country(game.pwr_struggle_in) - - //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { - game.return_state = 'finish_scoring' - if (game.active !== DEM) { - next_player() - } - game.state = 'the_tyrant_is_gone' - } else { - game.state = 'finish_scoring' - } - }, -} - -states.choose_power = { - inactive: 'choose whether to remain in power.', - prompt () { - if (game.phase === 0) { - view.prompt = 'Choose whether to remain in power.' - gen_action('retain') - gen_action('surrender') - } else if (game.phase === 1) { - view.prompt = 'Proceed to scoring.' - gen_action('scoring') - } - }, - retain() { - push_undo() - retain_power(game.pwr_struggle_in) - game.phase = 1 - }, - surrender () { - push_undo() - take_power(game.pwr_struggle_in) - permanently_remove(game.played_card) - game.phase = 1 - }, - scoring () { - push_undo() - score_country(game.pwr_struggle_in) - - //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { - game.return_state = 'finish_scoring' - if (game.active !== DEM) { - next_player() - } - game.state = 'the_tyrant_is_gone' - } else { - game.state = 'finish_scoring' - } - } -} -/* -states.score_country = { - inactive: `score country`, - prompt () { - view.prompt = 'Scoring: done.' - gen_action('done') - }, - done () { - reset_power() - /*if (game.return !== game.active) { - next_player()} - game.state = 'finish_scoring' - } -} -*/ - -states.the_tyrant_is_gone ={ - inactive: 'resolve The Tyrant is Gone.', - prompt() { - view.prompt = 'Play The Tyrant is Gone for the event.' - gen_action('event') - }, - event() { - if (game.active !== DEM) { - next_player() - } - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - log_h3(`C97`) - game.vm_event = 97 - goto_vm(game.vm_event) - } -} - -states.finish_scoring ={ - inactive: 'finish scoring.', - prompt() { - view.prompt = 'End power struggle.' - gen_action('done') - } , - done() { - //console.log('game.return_state', game.return_state) - log_msg_gap('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ - if (game.persistent_events.includes(111)) { - game.state = 'new_years_eve_party' - return - } - if (check_vp()) { - return - } - reset_power() - end_round() - //game.state = 'end_round' - } -} - -// ======================================= END TURN STATES ========================================== - -states.end_turn_4_5_4 = { - inactive: 'verify held cards.', - prompt() { - view.prompt = 'End Turn: verify held cards.' - gen_action('check') - }, - check() { - log_h2('Verify held cards') - const dem_has_scoring_card = game.democrat_hand.some(card => scoring_cards.includes(card)) - const com_has_scoring_card = game.communist_hand.some(card => scoring_cards.includes(card)) - if (!dem_has_scoring_card && !com_has_scoring_card) { - log('No held scoring cards') - } - - if (dem_has_scoring_card && com_has_scoring_card) { - log('Both players have held scoring cards') - game.state = 'game_end_tie' - } - else if (dem_has_scoring_card) { - log('Democrat player has a held scoring card') - goto_game_over(COM, `${COM} won by held scoring card!`) - } - else if (com_has_scoring_card) { - log('Communist player has a held scoring card') - goto_game_over(DEM, `${DEM} won by held scoring card!`) - } - else if (game.persistent_events.includes(104)) { - log_h1(`New Year's Eve Party`) - game.vm_event = 104 - //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { - game.vp -= 2 - log(`Communist receives 2 VP from C97`) - } - game.persistent_events.push(111) - if (game.active !== DEM) { - next_player() - } - game.state = 'new_years_eve_party' - } - else if(game.turn === 10) { - clear_undo() - log_h2('Final Scoring') - - //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { - game.vp -= 2 - log(`Communist receives 2 VP from C97`) - } - game.state = 'final_scoring_held' - - } else { - game.return_state = '' - 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() { - view.prompt = 'Final Scoring: Communist scores VP bonus for the number of countries they retain power.' - gen_action('bonus') - }, - bonus() { - // console.log('game.revolutions: ', game.revolutions) - const held_countries = game.revolutions.filter(value => value === false).length - let vp_gain = 4*held_countries - log(`Communist holds ${held_countries} countries: -${vp_gain} VP`) - game.vp -= 4*held_countries - game.temp = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} - game.state = 'final_scoring' - } -} - -states.final_scoring = { - inactive: 'score countries.', - prompt() { - if (game.temp['East_Germany'] && game.temp['Poland'] && game.temp['Czechoslovakia'] && game.temp['Hungary'] && game.temp['Romania'] && game.temp['Bulgaria']) { - view.prompt = 'Final scoring: done.' - gen_action('end') - } else { - view.prompt = 'Choose a country to score:' - if (!game.temp['East_Germany']) {gen_action('east_germany')} - if (!game.temp['Poland']) {gen_action('poland')} - if (!game.temp['Czechoslovakia']) {gen_action('czechoslovakia')} - if (!game.temp['Hungary']) {gen_action('hungary')} - if (!game.temp['Romania']) {gen_action('romania')} - if (!game.temp['Bulgaria']) {gen_action('bulgaria')} - } - }, - east_germany() { - score_country('East_Germany') - game.temp['East_Germany'] = true - }, - poland() { - score_country('Poland') - game.temp['Poland'] = true - }, - czechoslovakia() { - score_country('Czechoslovakia') - game.temp['Czechoslovakia'] = true - }, - hungary() { - score_country('Hungary') - game.temp['Hungary'] = true - }, - romania() { - score_country('Romania') - game.temp['Romania'] = true - }, - bulgaria() { - score_country('Bulgaria') - game.temp['Bulgaria'] = true - }, - end() { - delete game.temp - if (game.vp > 0) { - goto_game_over(DEM, `${DEM} wins on Victory Point Track!`) - } else if (game.vp < 0) { - goto_game_over(COM, `${COM} wins on Victory Point Track!`) - } else if (game.vp === 0) { - goto_game_over('', `The game is tied!`) /*Not sure what to pass for result */ - } - } -} - -states.game_over = { - get inactive() { - return game.victory - }, - prompt() { - view.prompt = game.victory - }, -} - -// ========================== EVENT SPECIFIC STATES ================================= - -states.general_strike = { - inactive: 'discard a card.', - prompt() { - if (game.played_card === 0 ) { - view.prompt = 'General Strike: you must discard a card or play a Scoring Card.' - available_cards = game.communist_hand - for (let card of available_cards) { - gen_action_card(card) - } - } /*else if (game.phase >= 1) { - view.prompt = 'General Strike: done.' - gen_action('done') - } */ else if (game.played_card > 0 ) { - view.prompt = 'General Strike: roll a die.' - gen_action('roll') - } - }, - card (card) { - push_undo() - game.played_card = card - let find_card - find_card = game.communist_hand.indexOf(card) - game.communist_hand.splice(find_card, 1) - game.available_ops = get_card_ops(card) - if (scoring_cards.includes(card)) { - game.vm_event = card - log(`Played C${card} for the event`) - game.return_state = 'general_strike' - goto_vm(game.vm_event) - } else { - log(`Discarded C${cards[card].number}`) - } - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - - logi(`+${game.available_ops} ops`) - - let total = roll + game.available_ops - log(`Total: ${total}`) - - if (total > 5) { - log('The strike is over.') - permanently_remove(5) - game.persistent_events = game.persistent_events.filter(n => n !== 5) - } else { - log('The strike continues. Required 6 or more') - } - //game.phase = 1 - game.state = 'end_round' - }, /* - done () { - //end_round() - game.state = 'end_round' - }*/ -} - -states.honecker ={ - inactive: 'resolve Honecker.', - prompt() { - view.prompt = 'Honecker: you may take an extra action round.' - gen_action('extra') - gen_action('pass') - }, - extra() { - push_undo() - game.round++ - game.round_player = COM - game.persistent_events = game.persistent_events.filter(n => n !== 15) - game.state = 'choose_card' - }, - pass() { - log('C15: passed') - game.persistent_events = game.persistent_events.filter(n => n !== 15) - //end_round() - game.state = 'end_round' - } -} - -states.new_years_eve_party = { - get inactive() { - return `resolve ${clean_name(cards[104].name)}.` - }, - prompt() { - if (!game.is_pwr_struggle) { - view.prompt = `New Year's Eve Party: you may choose a country to have a final power struggle.` - if (!game.revolutions[0]) {gen_action('poland')} - if (!game.revolutions[1]) {gen_action('hungary')} - if (!game.revolutions[2]) {gen_action('east_germany')} - if (!game.revolutions[3]) {gen_action('bulgaria')} - if (!game.revolutions[4]) {gen_action('czechoslovakia')} - if (!game.revolutions[5]) {gen_action('romania')} - gen_action('pass') - } else { - view.prompt = `New Year's Eve Party: done.` - gen_action('end') - } - }, - east_germany() { - push_undo() - log('Chose to score East Germany') - game.vm_event = 42 - goto_vm(42) - }, - poland() { - push_undo() - log('Chose to score Poland') - game.vm_event = 22 - goto_vm(22) - }, - czechoslovakia() { - push_undo() - log('Chose to score Czechoslovakia') - game.vm_event = 55 - goto_vm(55) - }, - hungary() { - push_undo() - log('Chose to score Hungary') - game.vm_event = 23 - goto_vm(23) - }, - romania() { - push_undo() - log('Chose to score Romania') - game.vm_event = 95 - goto_vm(95) - }, - bulgaria () { - push_undo() - log('Chose to score Bulgaria') - game.vm_event = 43 - goto_vm(43) - }, - pass() { - push_undo() - log('No final power struggle') - if (game.vp > 0) { - goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) - } else if (game.vp < 0) { - goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) - } else if (game.vp === 0) { - goto_game_over('', `New Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ - } - }, - end() { - if (game.vp > 0) { - goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) - } else if (game.vp < 0) { - goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) - } else if (game.vp === 0) { - goto_game_over('', `CNew Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ - } - } -} - -states.stasi_end_round = { - inactive: 'choose next card due to Stasi.', - prompt() { - //console.log('game.stasi_card', game.stasi_card) - let available_cards = game.democrat_hand - if (available_cards.length === 0) { - view.prompt = 'Stasi: no cards remaining.' - gen_action('pass') - return - } - view.prompt = 'Stasi: you must select your next card to play.' - - for (let card of available_cards) { - gen_action_card(card) - } - }, - card(card) { - push_undo() - log_gap(`Democrat selected C${cards[card].number} as next card.`) - game.stasi_card = card - game.state = 'stasi_finish' - }, - pass() { - log('Stasi: Democrat has no remaining cards') - game.stasi_card = 0 - end_stasi_choose_card() - }, - end_round() { - push_undo() - if (game.stasi_card === 21) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } - } -} - -states.stasi_finish = { - inactive: 'choose next card due to Stasi.', - prompt() { - view.prompt = 'Stasi. Choose card: done.' - gen_action('done') - }, - done() { - push_undo() - if (game.stasi_card === 21) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } - } -} - -states.stasi_confirm = { - inactive: 'choose next card due to Stasi.', - prompt() { - if (game.stasi_card === 21 ) { - 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) - end_stasi_choose_card() - } -} - -states.stasi_play_card = { - inactive: 'play a card.', - prompt () { /*Should get rid of the play card 'done' prompt for consistency with general play */ - /*if (game.played_card > 0) { - game.state = 'play_card' - view.prompt = 'Play card: done.' - gen_action("done"); - return;*/ - //} else - if (game.democrat_hand.length === 0) { - view.prompt = 'Stasi: you must pass.' - gen_action('pass') - } else { - view.prompt = `Stasi: you must play ${clean_name(cards[game.stasi_card].name)}.` - let available_cards = [game.stasi_card] - for (let card of available_cards) { - gen_action_card(card) - } - } - }, - card(card) { - push_undo() - //log_msg_gap(`Stasi: played C${card}`) - game.played_card = card - let find_card - find_card = game.democrat_hand.indexOf(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") { - game.state = 'stasi_resolve_common_european_home' - } else { - game.state = 'play_card' - } - - }, - pass () { - log('No cards remaining. Passed') - //end_round() - game.state = 'end_round' - }, - done () { - //game.stasi_card = 0 - if (game.democrat_hand.includes(21)) { - game.state = 'stasi_resolve_common_european_home' - } else { - game.state = 'play_card' - } - } -} - -states.stasi_resolve_common_european_home = { - inactive: 'play a card.', - prompt () { - view.prompt = `Do you wish to play ${clean_name(cards[game.played_card].name)} with Common European Home?` - gen_action('yes') - gen_action('no') - }, - yes() { - log(`Played with Common European Home`) - silent_discard(21) - game.vm_infl_to_do = true - game.vm_event_to_do = false - game.state = 'resolve_opponent_event' - }, - no() { - game.state = 'play_card' - } -} - - -// ==================== SUPPORTING STATE FUNCTIONS ============================= - - -function add_infl(space) { - push_undo() - //console.log('adding infl to', space) - //console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker) - //log(`Added 1 influence in %${space}`) - log_summary(`Added £ SP in %${space}`) - - //If AHBR - check AHBR conditions - if (game.persistent_events.includes(58)) { - if (spaces[space].country !== 'East_Germany'){ - game.austria_hungary_border_reopened_tracker = false - } - } - - // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { - game.available_ops-- - log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(space)) { - game.available_ops -= 2 - //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative - if (game.available_ops < 0) { - log_summary(`(Used +1 op from C58)`) - } - } else { - game.available_ops-- - } - - // Update influence values - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - - // Check whether spaces are controlled - 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) { - game.available_ops ++ - log('+1 op from C58') - game.austria_hungary_border_reopened_tracker = false - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') - } - - // If only 1 IP remaining, may not place in opponent controlled spaces - - // Check for Genscher & Austria Hungary Border Reopened - - if (game.available_ops === 1) { - //console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher']) - if (game.active === DEM) { - if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { - //console.log('in gensher subcheck - remove non-East German controlled ') - game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) - } else { - //console.log('remove all controlled spaces') - game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) - } - } else { - //console.log('remove all dem controlled spaces') - game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) - } - } - - //Clear valid spaces if no IP remaining. - if (game.available_ops <= 0 ) { - game.valid_spaces = [] - } -} - -function remove_infl(space) { - push_undo() - //log(`Removed 1 influence from %${space}.`) - log_summary(`Removed £ SP from %${space}.`) - - if (game.remove_opponent_infl === true) { - if (game.active === COM) { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - check_control_change(space) - - } else { - if (game.active === COM) { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - check_control_change(space) - } - game.available_ops-- -} - -function do_sc(space) { - clear_undo() - log_gap(`Support check: %${space}`) - - //Check Helsinki Final Act - - if (game.active === COM && game.persistent_events.includes(26) && (spaces[space].socio === 5 || spaces[space].socio === 6) ) { - log('+1 VP from C26') - game.vp ++ - if (check_vp()) { - game.state = 'game.over' - //console.log('after check_vp, game.state', game.state) - return - } - } - - // Continue with Support Check Logic - - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - - /* - //Check if support check is being done with game.played_card or a subsequent card (e.g. Common European Home, Dash for the West, etc) - if (game.vm_event > 0) { - roll+= cards[game.vm_event].ops - log(`+${cards[game.vm_event].ops} from card ops`) - } - */ - // Check for the Crowd Turns Against Ceausescu - - //else - if (game.is_pwr_struggle) { - roll += game.vm_available_ops - logi(`+${game.vm_available_ops} from Ceausescu`) - } - - // Check if in Tiananmen Square Track Award - - else if (game.state === 'vm_tst_6_sc') { - roll += get_tst_6_ops() - roll += 2 - logi('+2 TST award') - } - else { - //let modifier = 0 - let card_ops = get_card_ops(this_card()) - - roll += card_ops - logi(`+${card_ops} from card ops`) - } - - if (game.support_check_modifier > 0) { - roll += game.support_check_modifier - logi(`+${game.support_check_modifier} from event`) - } - - // Events which modify SC rolls - //Tear Gas - if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { - roll ++ - logi('+1 from C30') - permanently_remove(30) - game.persistent_events = game.persistent_events.filter(n => n !== 30) - } - //FRG Embassies - if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { - roll++ - logi('+1 from C74') - } - //GrenzTruppen - if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { - roll-- - logi('-1 from C59') - } - //Stand Fast - if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ - roll-- - logi('-1 from C100') - } - //Elena - if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { - roll-- - logi('-1 from C101') - } - //Austria Hungary Border Reopened - if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { - roll++ - logi(`+1 from C58`) - } - - // Continue with logic - check for adjacency - - // Events which affect adjacency - The Wall - - const adj = count_adj(space) - //console.log('adj', adj) - if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { - logi('No adjacency for Democrats due to C9') - logi('C9 no longer in effect') - roll += adj.com_adj - if (adj.com_adj > 0) { - logi(`+${adj.com_adj} adjacency`) - } - game.persistent_events = game.persistent_events.filter(n => n !== 9) - - // Standard adjacency - } else { - if (adj.dem_adj > 0 || adj.com_adj > 0 ){ - if (game.active === DEM) { - roll += adj.dem_adj - roll -= adj.com_adj - if (adj.dem_adj > 0) { - logi(`+${adj.dem_adj} from adjacency`) - } - if (adj.com_adj > 0) { - logi(`-${adj.com_adj} from opponent adjacency`) - } - } else { - roll += adj.com_adj - roll -= adj.dem_adj - if (adj.com_adj > 0) { - logi(`+${adj.com_adj} from adjacency`) - } - if (adj.dem_adj > 0) { - logi(`-${adj.dem_adj} from opponent adjacency`) - } - } - } - - } - - // Support check calcs - log(`Modified total: ${roll}`) - const stability = spaces[space].stability - logi(`-${stability*2} (stability * 2)`) - const change_infl = Math.max(0, roll - stability*2) - if (change_infl > 0) { - log_msg_gap(`Change influence: ${change_infl} SP`) - if(game.active === DEM) { - if (change_infl > game.comInfl[space]) { - const residual = change_infl - game.comInfl[space] - game.comInfl[space] = 0 - game.demInfl[space] += residual - } else { - game.comInfl[space] -= change_infl - } - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space) - } - } else { - if (change_infl > game.demInfl[space]) { - const residual = change_infl - game.demInfl[space] - game.demInfl[space] = 0 - game.comInfl[space] += residual - } else { - game.demInfl[space] -= change_infl - } - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space) - } - } - check_control_change(space) - - } else { - log_msg_gap('Change influence: 0 SP') - } - if (game.active === COM && game.persistent_events.includes(39) && spaces[space].space_id === 66) { - log_msg_gap('+1 VP from C39') - game.vp++ - if (check_vp()) { - return - } - } - - // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany - if (game.persistent_events.includes(58)){ - if (game.austria_hungary_border_reopened_tracker) { - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') - } - } - game.selected_space = 0 - -} - -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++) { - space = spaces[i] - - if (game.state === 'com_init') { - infl = game.demInfl[i] - - if (infl === 0) { - valid_spaces_set.add(space.space_id); - } - } else if (game.state === 'dem_init') { - infl = game.comInfl[i] - if (infl === 0) { - valid_spaces_set.add(space.space_id); - } - } - } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; -} - -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++) { - space = spaces[i] - - if (game.active === DEM) { - infl = game.comInfl[i] - if (infl !== 0 ) { - valid_spaces_set.add(space.space_id); - } - } else { - infl = game.demInfl[i] - if (infl !== 0 ) { - // Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === 14) {continue} - - // Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} - - // Check We Are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} - - //Check for Foreign Currency Debt Burden - if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} { - - valid_spaces_set.add(space.space_id); - - } - } - } - } - - - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - - //Check for the Crown Turns Against Ceausescu - if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') - } - return game.valid_spaces; -} - -function valid_spaces_support_loss() { - let valid_spaces_set = new Set(); - for (let i = 1; i < game.demInfl.length; i++) { - //console.log('spaces.length', game.demInfl.length, 'i', i) - space = spaces[i] - if (game.active === DEM) { - infl = game.demInfl[i] - if (infl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } else { - infl = game.comInfl[i] - if (infl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } - } - - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; -} -/* -function valid_spaces_support_falters() { - let valid_spaces_set = new Set(); - if (game.active === DEM) { - for (let piece of game.pieces) { - if (!piece) continue - let space = spaces.find(s => s && s.space_id === piece.space_id); - if (space && piece.comInfl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } - } else { - for (let piece of game.pieces) { - if (!piece) continue - let space = spaces.find(s => s && s.space_id === piece.space_id); - if (space && piece.demInfl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } - } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; -} - */ - -function valid_spaces_infl() { - /*if (game.state.startsWith('vm')) { - console.log('valid_spaces_infl called from VM') - } else { - console.log('valid_spaces_infl called not from VM') - }*/ - // Check if function is called from the VM or not, take relevant ops variable - let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; - - let valid_spaces_set = new Set(); - // Iterate over all spaces to find the ones with the player's influence - for (let i = 1; i < game.demInfl.length; i++) { - //piece = game.pieces[i] - space = spaces[i] - - let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; - - // If the piece has the player's influence, add it and its adjacent spaces to the set - if (player_influence > 0) { - valid_spaces_set.add(space.space_id); - - // Check adjacency information - let adjacent_spaces = get_adjusted_adjacency(space.space_id) - - for (let adj_space_id of adjacent_spaces) { - //console.log('adj_space_id', adj_space_id) - if (adj_space_id) { - - const adj_piece = spaces[adj_space_id]; - //console.log('adjacent piece name', adj_piece.name_unique) - - // Check if the adjacent space is controlled by the opponent - const opponent_control = check_opp_control(adj_piece.space_id) - //console.log('controlled?', opponent_control) - - //Check for Genscher. Can always place in East Germany even with 1 op - if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(63)){ - // console.log('space added with genscher') - valid_spaces_set.add(adj_piece.space_id) - } - - // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent - if (ops >= 2 || !opponent_control) { - valid_spaces_set.add(adj_piece.space_id) - } - } - } - } - } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; -} - -function valid_cards(player_hand, presence) { - const valid_cards_set= new Set(); - if (game.phase === 0) { - for (let c of player_hand) { - let card = power_cards.find(card => card && card.number === c); - if (card.number === 52) {continue} // Never add tactics fails - if (card.name === game.tactics_fails) {continue} //Cannot play the suit of Tactics Fails - if (card.socio === 0) { - valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { - valid_cards_set.add(card.number); - } - } - } else if (game.phase === 1) { - for (let c of player_hand) { - let card = power_cards.find(card => card && card.number === c); - if (card.name === power_cards[game.played_power_card].name) { - valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { - valid_cards_set.add(card.number); - } else if (card.number === 52) {valid_cards_set.add(card.number)} - } - } - game.valid_cards = Array.from(valid_cards_set); - return game.valid_cards; -} - -function do_valid_cards() { - let presence = check_presence(game.pwr_struggle_in) - if (game.active === DEM) { - valid_cards(game.dem_pwr_hand, presence.dem_leaders) - - } else { - valid_cards(game.com_pwr_hand, presence.com_leaders)} -} - -function count_adj(id) { - const space = spaces[id] - let dem_adj = 0 - let com_adj = 0 - - let adjacent_spaces = get_adjusted_adjacency(space.space_id) - - for (let adj_space_id of adjacent_spaces) { - if (adj_space_id) { - const adj_piece = spaces.find(piece => piece && piece.space_id === adj_space_id); - //console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) - if (adj_piece && adj_piece.space_id !== space.space_id) { - if (check_dem_control(adj_piece.space_id)) { - //console.log('added DEM space', spaces[adj_piece.space_id].name) - dem_adj++ - } - if (check_com_control(adj_piece.space_id)) { - //console.log('added COM space', spaces[adj_piece.space_id].name) - com_adj++ - } - } - } - } - //console.log('dem_adj: ', dem_adj, 'com_adj: ', com_adj) - return {dem_adj, com_adj} -} - -/*function count_adj_worker(space_id) { - const space = spaces[space_id] - let dem_adj = 0 - let com_adj = 0 - - for (let adj_space_id of space.adjacent) { - if (adj_space_id) { - const adj_space = spaces[adj_space_id] - if (adj_space && adj_space.socio === 4) { - const adj_piece = game.pieces.find(piece => piece && piece.space_id === adj_space_id ); - if (adj_piece) { - if (adj_piece.demCtrl === 1 ) { - dem_adj++ - } - if (adj_piece.comCtrl === 1 ) { - com_adj++ - } - } - } - } - } - return {dem_adj, com_adj} -} */ - -function check_control(space_id) { - //console.log('in check control, space', spaces[space_id].name_unique) - if ( (game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability) { - return true; - } else if ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability) { - //console.log('true') - return true; - } else { - //console.log('false') - return false; - } -} - -function check_opp_control(space_id) { - if (spaces[space_id].country === 'Romania') { - //console.log('in check opp control, space', spaces[space_id].name_unique) - } - if (game.active === DEM && ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability)) { - if (spaces[space_id].country === 'Romania') { - //console.log('control true') - } - return true; - } else if (game.active === COM && ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability)) { - //console.log('true') - return true; - } else { - //console.log('false') - return false; - } -} - -function check_dem_control(space_id) { - if ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability) { - return true; - } else { - return false; - } -} - -function check_com_control(space_id) { - if ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability) { - return true; - } else { - return false; - } -} - -function do_tst_attempt() { - let roll = Math.floor(Math.random() * 6) + 1; - log(`Roll: D${roll}`); - - roll += game.available_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 ++; - logi('+1 from previous TST attempts') - } - if (game.active === DEM && game.dem_tst_position >= 1 && game.com_tst_position === 0) { - roll ++ - logi('+1 from TST award') - } - if (game.active === COM && game.com_tst_position >= 1 && game.dem_tst_position === 0) { - roll ++ - 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 ++; - logi('+1 for playing own card'); - } - if (game.active === COM && game.persistent_events.includes(53)) { - roll ++ - logi('+1 from C53') - } - log(`Modified total: ${roll}`) - - // TIANANMEN SQUARE ATTEMPT - game.return = game.active - game.return_state = 'tiananmen_square_attempt_done' - if (game.active === DEM) { - game.dem_tst_attempted_this_turn = 1 - if (roll >= dem_tst_req[game.dem_tst_position]) { - log(`${dem_tst_req[game.dem_tst_position]} required: success`) - game.dem_tst_position++ - game.dem_tst_attempted = 0 - - //Check if they have reached box 7 or 8 first - if (game.dem_tst_position === 7 && game.com_tst_position < 7) { - game.tst_7 = false - } - if (game.dem_tst_position === 8 && game.com_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) { - delete game.tst_7 - } - if (game.dem_tst_position >= 8 && game.com_tst_position >= 8) { - delete game.tst_8 - } - - //Check if TST events occur - if (game.dem_tst_position === 3 && game.com_tst_position < 3) {game.vm_event = 203} - else if (game.dem_tst_position === 4 && game.com_tst_position < 4) {game.vm_event = 204} - game.state = 'tiananmen_square_attempt_success' - } else { - log(`${dem_tst_req[game.dem_tst_position]} required: fail`) - game.dem_tst_attempted = 1 - game.state = 'tiananmen_square_attempt_fail' - } - } else { - game.com_tst_attempted_this_turn = 1 - if (roll >= com_tst_req[game.com_tst_position]) { - log(`${com_tst_req[game.com_tst_position]} required: success`) - game.com_tst_position++ - game.com_tst_attempted = 0 - - //Check if they have reached box 7 or 8 first - if (game.com_tst_position === 7 && game.dem_tst_position < 7) { - game.tst_7 = false - } - 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.com_tst_position >= 7 && game.dem_tst_position >= 7) { - delete game.tst_7 - } - if (game.com_tst_position >= 8 && game.dem_tst_position >= 8) { - delete game.tst_8 - } - - //Check if TST events occur - if (game.com_tst_position === 3 && game.dem_tst_position < 3) {game.vm_event = 203} - else if (game.com_tst_position === 4 && game.dem_tst_position < 4) {game.vm_event = 204} - game.state = 'tiananmen_square_attempt_success' - } else { - log(`${com_tst_req[game.com_tst_position]} required: fail`) - game.com_tst_attempted = 1 - game.state = 'tiananmen_square_attempt_fail' - } - } -} - -function check_presence(country) { - - let dem_spaces = 0; - let com_spaces = 0; - let dem_battlegrounds = 0; - let com_battlegrounds = 0; - let dem_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; - let com_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; - - - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (space.country === country) { - - if (check_dem_control(i)) { - dem_spaces++; - if (space.battleground === 1) { - dem_battlegrounds++; - } - if (leaders.includes(space.socio)) { - dem_leaders[space.socio] = true; - } - } - if (check_com_control(i)) { - com_spaces++; - if (space.battleground === 1) { - com_battlegrounds++; - } - if (leaders.includes(space.socio)) { - com_leaders[space.socio] = true; - } - } - } - } - - // Determine domination - let dem_domination = dem_battlegrounds > com_battlegrounds && dem_spaces > com_spaces && dem_spaces - dem_battlegrounds > 0; - let com_domination = com_battlegrounds > dem_battlegrounds && com_spaces > dem_spaces && com_spaces - com_battlegrounds > 0; - - // Determine control - let total_battlegrounds = battlegrounds(country); - let dem_control = dem_battlegrounds === total_battlegrounds && dem_spaces > com_spaces; - let com_control = com_battlegrounds === total_battlegrounds && com_spaces > dem_spaces; - - return { - dem_spaces: dem_spaces, - com_spaces: com_spaces, - dem_battlegrounds: dem_battlegrounds, - com_battlegrounds: com_battlegrounds, - dem_domination: dem_domination, - com_domination: com_domination, - dem_control: dem_control, - com_control: com_control, - dem_leaders: dem_leaders, - com_leaders: com_leaders - }; -} - -function battlegrounds(country) { - let battlegrounds = 0; - if (country === "Hungary") { - battlegrounds = 4 - } else if (country === "Bulgaria") { - battlegrounds = 5 - } else { - battlegrounds = 6 - } - return battlegrounds; -} - -function take_power(country) { - - log(`Democrat takes power in ${game.pwr_struggle_in}`) - game.revolutions[find_country_index(country)] = true - game.times_held[find_country_index(country)] = 1 - -} - -function retain_power(country){ - game.times_held[find_country_index(country)]++ - let vp_gain = get_value(country)*game.times_held[find_country_index(country)] - log(`Chooses to retain power`) - log(`-${vp_gain} VP`) - game.vp -= vp_gain -} - -function score_country(country) { - log_h3(`Scoring: ${country}`) - -//Get scoring values - let value_presence = get_value(country) - let value_domination = value_presence*2 - let value_control - if (country !== "Hungary") { - value_control = value_presence*3 - } else { - value_control = 4 - } -//Log for scoring - - let dem_vp = 0 - let com_vp = 0 - //Check for presence - let presence = check_presence(country) -// console.log('presence: ', presence) - - //If one side has domination or control - if (presence.dem_control || presence.dem_domination) { - log(`Democrat:`) - if (presence.dem_control) { - log(`Control: +${value_control} VP`) - dem_vp += value_control - } - else { - log(`Domination: +${value_domination} VP`) - dem_vp += value_domination - } - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) - dem_vp += presence.dem_battlegrounds - log(`Total: +${dem_vp} VP`) - - log_gap('Communist:') - if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) - com_vp -= value_presence - if (presence.com_battlegrounds >0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) - com_vp -= presence.com_battlegrounds - } - log(`Total: ${com_vp} VP`) - } else { - log('No presence: 0 VP') - } - - } - else if (presence.com_control || presence.com_domination) { - log('Communist:') - if (presence.com_control) { - log(`Control: -${value_control} VP`) - com_vp -= value_control - } - else { - log(`Domination: -${value_domination} VP`) - com_vp -= value_domination - } - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) - com_vp -= presence.com_battlegrounds - log(`Total: ${com_vp} VP`) - - log_gap('Democrat:') - if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) - dem_vp += value_presence - if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) - dem_vp += presence.dem_battlegrounds - } - log (`Total: +${dem_vp} VP`) - } else { - log('No presence: 0 VP') - } - - } - - //Otherwise, presence and battlegrounds - else { - log("No domination or control") - log_gap(`Communist:`) - if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) - com_vp -= value_presence - if (presence.com_battlegrounds > 0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) - com_vp -= presence.com_battlegrounds - } else { - log('No battlegrounds') - } - log(`Total: ${com_vp} VP`) - } else { - log('No presence: 0 VP') - } - log_gap('Democrat:') - if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) - dem_vp += value_presence - if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) - dem_vp += presence.dem_battlegrounds - } else { - log('No battlegrounds') - } - log(`Total: +${dem_vp} VP`) - } else { - log('No presence: 0 VP') - } - } - - -//Calculate change VP - /*let dem_vp = 0 - if (presence.dem_spaces > 0) {dem_vp += value_presence} - if (presence.dem_domination) {dem_vp += value_presence} - if (presence.dem_control && country !== "Hungary") { - dem_vp += value_control - } - else if (presence.dem_control && country === "Hungary") {dem_vp += 2} - dem_vp += presence.dem_battlegrounds - - let com_vp = 0 - if (presence.com_spaces > 0) {com_vp += value_presence} - if (presence.com_domination) {com_vp += value_presence} - if (presence.com_control && country !== "Hungary") {com_vp += value_presence} - else if (presence.com_control && country === "Hungary") {com_vp += 2} - com_vp += presence.com_battlegrounds */ - let change_vp = dem_vp + com_vp - game.vp += change_vp - if (change_vp > 0 ) { - log_gap(`Final change VP: +${change_vp} VP`) - } else { - log_gap(`Final change VP: ${change_vp} VP`) - } -} - -function get_value(country) { - let value - if (country === "East_Germany" || country === "Poland") {value = 3} - else if (country === "Czechoslovakia" || country === "Romania") {value = 2} - else value = 1 - return value -} - -function get_end_infl_prompt() { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - if (!game.vm_infl_to_do) { - gen_action('end_round') - } else { - gen_action('done') - } -} - -function permanently_remove(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') - game.table_cards.splice(card_index, 1) - } - game.strategy_removed.push(card) - //console.log('game.strategy_removed', game.strategy_removed) -} - -function check_vp() { - if (game.vp >= 20) { - goto_game_over(DEM, `${DEM} won an Automatic Victory!`) - //console.log('after goto_game_over, game.state', game.state) - return true - } else if(game.vp <= -20) { - goto_game_over(COM, `${COM} won an Automatic Victory!`) - return true - } - return false -} - -function game_over() { - if (game.vp >= 20 || game.vp <= -20) { - return true - } else { return false} -} - -function goto_game_over(result, victory) { - game.state = "game_over" - game.active = "None" - game.result = result - game.victory = victory - log_h1("Game Over") - log(game.victory) - //console.log('game over, game.state', game.state) - return - -} - -function reset_austria_hungary_border_reopened() { - //game.austria_hungary_border_reopened_checked = false - game.austria_hungary_border_reopened_tracker = false -} - -function end_stasi_choose_card() { - game.round_player = COM - game.round ++ - log_h2(`Action Round ${game.round}`) - next_player() - game.valid_spaces = [] - if (game.persistent_events.includes(5)) { - log_h3('C5') - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } -} - -function check_reformer() { - if (game.dem_tst_position !== game.com_tst_position) { - if (!game.playable_cards.includes(67)) { - game.playable_cards.push(67) - } - } else { - game.playable_cards = game.playable_cards.filter(n => n !== 67) - } - -} - -function count_scoring_cards() { - let scoring_check - if (game.active === DEM) { - scoring_check = game.democrat_hand.filter(card => scoring_cards.includes(card)).length - } else { - scoring_check = game.communist_hand.filter(card => scoring_cards.includes(card)).length - } - return scoring_check -} - -function select_card(card){ - game.played_card = card - game.temp = 0 - let find_card - if (game.active === COM) { - find_card = game.communist_hand.indexOf(card) - game.communist_hand.splice(find_card, 1) - } else { - find_card = game.democrat_hand.indexOf(card) - game.democrat_hand.splice(find_card, 1) - } - game.available_ops = get_card_ops(card) - - //Check Ligachev - if (game.active === DEM && game.persistent_events.includes(99) && card !== 14) { - log('-3 VP from C99') - game.vp -= 3 - if (check_vp()) { - return - } - game.persistent_events = game.persistent_events.filter(n => n !== 99) - } - game.state = 'play_card' - //console.log('game.state', game.state) -} - -function find_event(card) { - return variable_events.indexOf(card) -} - -function is_auto_resolve(card) { - - let ceausecu_events = [10, 41, 101, 107] - - if (card === 97) { - if (!game.persistent_events.includes(54)) { - return true - } - } - else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { - return true - } - else if (card === 87 && !game.persistent_events.includes(86)) { - return true - } - else if (auto_resolve_events.includes(card)) { - return true - } else { - return false - } -} - -function get_events(card){ - 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) { -// console.log('game.stasi_card', game.stasi_card, 'card', card) - //Reformer never playable here - if (card === 67) { - return false - } - //Check for Common European Hmme under Stasi - else if (game.stasi_card === 21 && card === 21 && game.active === DEM) { - return false - } - //Check for The Chinese Solution - else if (game.com_tst_position === 8 && card === 96) { - return true - } - //Then check normally - else if (cards[card].playable) { - return true - } else if (game.playable_cards.includes(card)) { - return true - } else { - return false - } -} - -function get_card_ops(card) { - let ops = 0 - - if (card) { - ops = cards[card].ops - } - if (game.persistent_events.includes(25) && game.active === COM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { - log('+1 op from C25') - } - ops ++ - } - if (game.persistent_events.includes(50) && game.active === DEM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { - log('+1 op from C50') - } - ops ++ - } - - if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { - log('+1 op from Tiananmen Square Track') - } - ops ++ - } - - if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { - if (ops > 2) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) - } else { - if (ops > 1) { - log(`-1 op from C8`) - } - } - } - ops += game.prudence.DEM - - if (ops < 1) { - ops = 1 - } - } - - if (game.active === COM && game.prudence && game.prudence.COM < 0) { - if(game.state === 'choose_card') { - if (ops > 2) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) - } else if (ops > 1) { - log(`-1 op from C8`) - } - } - ops += game.prudence.COM - if (ops < 1) { - ops = 1 - } - } return ops -} - -function get_tst_6_ops() { - let ops = 0 - - if (game.persistent_events.includes(25) && game.active === COM) { - log('+1 op from C25') - ops ++ - } - if (game.persistent_events.includes(50) && game.active === DEM) { - log('+1 op from C50') - ops ++ - } - - if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { - if (ops > 0) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) - } else { - log(`-1 op from C8`) - } - - ops += game.prudence.DEM - - if (ops < -1) { - ops = -1 - } - } - - if (game.active === COM && game.prudence && game.prudence.COM < 0) { - - if (ops > 0) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) - } else { - log(`-1 op from C8`) - } - - ops += game.prudence.COM - if (ops < -1) { - ops = -1 - } - } - return ops -} - -function finish_the_wall() { - if (game.the_wall_must_go['dem_wins'] === 2) { - game.persistent_events.push(86) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (space.country === 'East_Germany' && game.comInfl[i] > 0){ - game.valid_spaces.push(space.space_id) - } - } - if (!game.vm_infl_to_do) { - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - if (game.active === DEM) {next_player()} - vm_next () - } else { - permanently_remove(86) - delete game.the_wall_must_go - vm_return() - } -} - - -// =========== 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') - return} - - //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. - if (!game.strategy_removed.includes(game.played_card) && !game.table_cards.includes(game.played_card) && game.played_card > 0) { - game.strategy_discard.push(game.played_card) - } - - //Reset - game.played_card = 0 - game.temp = 0 - game.vm_event = 0 - game.phase = 0 - game.remove_opponent_infl = false - game.is_pwr_struggle = false - game.vm_infl_to_do = false /*Can get rid of this and use game.return_state? */ - game.vm_event_to_do = false - game.vm_active_country = '' - game.return_state = '' - game.discard = false - game.return = '' - 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! */ - - - // Check for duplicate card entries - let card_check - if (game.samizdat_card > 0) { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; - } else { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand]; - } - - function check_duplicates(array) { - return new Set(array).size !== array.length; - } - - function find_duplicates(array) { - const duplicates = array.filter((item, index) => array.indexOf(item) !== index); - return [...new Set(duplicates)]; - } - - //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) - - if (check_duplicates(card_check)) { - console.log('card check', card_check) - const duplicates = find_duplicates(card_check) - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) - throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) - } - //console.log('cards in game', card_check.length) - card_check = card_check.sort((a, b) => a - b) - //console.log('cards in game', card_check) - if (game.turn <= 3) { - if (card_check.length !== 40) { - throw new Error(`Wrong number of cards: ${card_check.length}`) - } - } else if (game.turn <=7) { - if (card_check.length !== 81) { - throw new Error(`Wrong number of cards: ${card_check.length}`) - } - } else if (card_check.length !== 110) { - throw new Error(`Wrong number of cards: ${card_check.length}`) - } - - - - //console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) - //Check if the Reformer is playable - check_reformer() - - // 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.active !== COM) { - next_player() - } - game.state = 'honecker' - return - } - else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') - if (game.active !== DEM) { - next_player() - } - game.return = game.active - clear_undo() - game.return_state = 'end_turn_4_5_4' - goto_vm(206) - return - } else if (game.com_tst_position >= 6 && game.dem_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') - if (game.active !== COM) { - next_player() - } - game.return = game.active - clear_undo() - game.return_state = 'end_turn_4_5_4' - goto_vm(206) - return - } - else { - clear_undo() - game.state = 'end_turn_4_5_4' - return - } - } - - // Resolve end action round - //Stasi check - if(game.round_player === COM && game.persistent_events.includes(13)) { - //If in Honecker, turn ends - if (game.round === 8) { - clear_undo() - game.state = 'end_turn_4_5_4' - return - } - //Otherwise go to Stasi - game.round_player = DEM - if (game.active !== DEM) { - next_player() - } else { - log_h3('Democratic Action Round') - - } - if (game.democrat_hand.includes(game.stasi_card)) { - log_h3('C13') - game.state = 'stasi_play_card' - } else { - game.stasi_card = 0 - game.state = 'choose_card' - } - return - } - //Check if in extra Action Round - else if (game.round_player === COM && game.round === 8) { - clear_undo() - game.state = 'end_turn_4_5_4' - return - } - //Normal round end - else if (game.round_player===COM) { - game.round_player = DEM - if (game.active !== DEM) { - next_player() - } else { - log_h3('Democratic Action Round') - } - game.state = 'choose_card' - 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) { - next_player() - } - log_h3('C13') - game.state = 'stasi_end_round' - return - } else if(game.round_player === DEM && game.persistent_events.includes(5)){ - game.state = 'general_strike' - game.round ++ - log_h2(`Action Round ${game.round}`) - game.round_player = COM - if (game.active !== COM) { - next_player() - } - log_h3('C5') - return - } else { - game.state = 'choose_card' - game.round_player = COM - game.round ++ - log_h2(`Action Round ${game.round}`) - if (game.active !== COM) { - next_player() - } - } - } - //game.state = 'choose_card' Does this do anything any more? -} - -/* -function end_turn(){ - /*End Turn sequence - TST support check - Verify held cards - New Year's Eve Party - Advance Turn Marker - -// CHECK FOR OPTIONAL SUPPORT CHECK - if (game.dem_tst_position >=6 && game.com_tst_position <= 5) { - if (game.active !== DEM) { - next_player_() - } - game.state = 'tst_support_check' - } - if (game.com_tst_position >=6 && game.dem_tst_position <= 5) { - if (game.active !== COM) { - next_player_() - } - game.state = 'tst_support_check' - } - - -//CHECK HELD CARDS - -} */ - -function new_turn() { - clear_undo() - game.turn ++ - game.round = 1 - game.valid_spaces=[] - game.active = COM - game.round_player = COM - game.dem_tst_attempted_this_turn = 0 - game.com_tst_attempted_this_turn = 0 - if (game.tst_7) {game.tst_7 = false} - if (game.tst_8) {game.tst_8 = false} - - //Remove events that only last one 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*/ - delete game.prudence - delete game.stasi_card - - //Austria Hungary Border Reopened - if (game.persistent_events.includes(58)) { - game.persistent_events = game.persistent_events.filter(n => n !== 58) - delete game.austria_hungary_border_reopened_tracker - log(`C58 no longer in effect`) - //permanently_remove(58) - } - //Elena - if (game.persistent_events.includes(101)) { - game.persistent_events = game.persistent_events.filter(n => n !== 101) - log(`C101 no longer in effect`) - //permanently_remove(101) - } - //GrenzTruppen - if (game.persistent_events.includes(59)) { - game.persistent_events = game.persistent_events.filter(n => n !== 59) - log(`C59 no longer in effect`) - //permanently_remove(59) - } - //Foreign Currency Debt Burden - if (game.persistent_events.includes(49)) { - game.persistent_events = game.persistent_events.filter(n => n !== 49) - delete game.foreign_currency_debt_burden - log(`C49 no longer in effect`) - //permanently_remove(49) - } - //FRG Embassies - if (game.persistent_events.includes(74)) { - game.persistent_events = game.persistent_events.filter(n => n !== 74) - log(`C74 no longer in effect`) - discard_from_table(74) - permanently_remove(74) - } - //Genscher - if (game.persistent_events.includes(63)) { - game.persistent_events = game.persistent_events.filter(n => n !== 63) - log(`C63 no longer in effect`) - discard_from_table(63) - permanently_remove(63) - } - //Stand Fast - if (game.persistent_events.includes(100)) { - game.persistent_events = game.persistent_events.filter(n => n !== 100) - delete game.stand_fast - log(`C100 no longer in effect`) - //permanently_remove(100) - } - - if (game.samizdat_card > 0 ) { - game.democrat_hand.push(game.samizdat_card) - delete game.samizdat_card - } - - log_h1("Turn " + game.turn) - - if (game.turn === 4) { - add_midyear() - } - if (game.turn === 8) { - add_lateyear() - } - if (game.turn > 1) { - if (game.persistent_events.includes(65)) { - game.com_hand_limit = 7 - log('Communist draws 7 cards due to C65') - //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) - 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) - - } - - //Check if TST effects need to be resolved - if (game.dem_tst_position >=5 && game.com_tst_position <= 4) { - log_h2('Tiananmen Square Track award') - if(game.active !== DEM) { next_player() } - for (let card of game.democrat_hand) { - if (scoring_cards.includes(card)) continue - game.valid_cards.push(card) - } - game.state = 'tst_goddess' /* Goddess only name of Democrat bonus, not Communist*/ - return - } - else if (game.com_tst_position >=5 && game.dem_tst_position <= 4) { - log_h2('Tiananmen Square Track award') - if(game.active !== COM) { next_player() } - for (let card of game.communist_hand) { - if (scoring_cards.includes(card)) continue - game.valid_cards.push(card) - } - game.state = 'tst_goddess' - } else { - log_h2("Action Round " + game.round) - log_side() - //console.log('in start new AR call, game.active', game.active) - if (game.persistent_events.includes(5)) { - log_h3('C5') - game.state = 'general_strike' - } - else { - game.state = 'choose_card' - } - } -} - -function next_player() { - clear_undo() - //console.log('next player called') - if (game.active === DEM) - game.active = COM - else - game.active = DEM - - log_side() -} - -function change_player() { - clear_undo() - //console.log('next player called') - if (game.active === DEM) - game.active = COM - else - game.active = DEM -} - -function find_space_index(name_unique) { - return spaces.findIndex(space => space && space.name_unique === name_unique) -} - -function find_country_index(country) { - return countries.indexOf(country) -} - -function draw_deck(deck) { - return deck.filter(card => card && card.period === 1).map(card => card.number) -} - -function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { - //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) - 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 ) - if (deck.length === 0) { - log_h3('--- Reshuffle ---') - - deck.push(...game.strategy_discard) - game.strategy_discard = [] - } - - else if (turn === 'communist' && communist_hand.length < com_hand_limit) { - communist_hand.push(draw_card(deck)); - //console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards)); - turn = 'democrat'; - } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { - turn = 'democrat'; - } - else if (turn === 'democrat' && democrat_hand.length < dem_hand_limit) { - democrat_hand.push(draw_card(deck)); - //console.log('democrat_hand: ', democrat_hand) - - //console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards)); - turn = 'communist'; - } - else if (turn === 'democrat' && democrat_hand.length === dem_hand_limit) { - turn = 'communist'; - } - } - - clear_undo() -} - -function draw_card(deck) { - //console.log('draw card called with:', deck) - //console.log('game.strategy_deck before', game.strategy_deck) - if (deck.length === 0) { - log_h3('--- Reshuffle ---') - - deck.push(...game.strategy_discard) - game.strategy_discard = [] - } - const randomIndex = Math.floor(Math.random() * deck.length) - //console.log('card chosen:', randomIndex) - //console.log('game.strategy_deck after', game.strategy_deck) - return deck.splice(randomIndex, 1)[0]; -} - -function discard(card) { - //console.log('in discard(card)') - let find_card - if (!game.is_pwr_struggle) { - - if (game.active === COM) { - find_card = game.communist_hand.indexOf(card) - game.communist_hand.splice(find_card, 1) - } else { - find_card = game.democrat_hand.indexOf(card) - game.democrat_hand.splice(find_card, 1) - } - if (!game.strategy_discard.includes(card)) { - game.strategy_discard.push(card) - log(`Discarded C${cards[card].number}`) - } - } else if (game.is_pwr_struggle) { - if (game.active === COM) { - find_card = game.com_pwr_hand.indexOf(card); - game.com_pwr_hand.splice(find_card, 1); - } else { - find_card = game.dem_pwr_hand.indexOf(card); - game.dem_pwr_hand.splice(find_card, 1); - } - - game.power_struggle_discard.push(card) - //log(`Discarded P${power_cards[card].number}`) - } -} -function silent_discard(card) { - //console.log('in discard(card)') - let find_card - if (!game.is_pwr_struggle) { - if (game.active === COM) { - find_card = game.communist_hand.indexOf(card) - game.communist_hand.splice(find_card, 1) - } else { - find_card = game.democrat_hand.indexOf(card) - game.democrat_hand.splice(find_card, 1) - } - if (!game.strategy_discard.includes(card)) { - game.strategy_discard.push(card) - } - } else if (game.is_pwr_struggle) { - if (game.active === COM) { - find_card = game.com_pwr_hand.indexOf(card); - game.com_pwr_hand.splice(find_card, 1); - } else { - find_card = game.dem_pwr_hand.indexOf(card); - game.dem_pwr_hand.splice(find_card, 1); - } - game.power_struggle_discard.push(card) - } -} - -function remove_from_discard(card) { - let card_index = game.strategy_discard.indexOf(card) - if (card_index !== -1) { - game.strategy_discard.splice(card_index, 1) - } -} - -function discard_card(hand) { - //let find_card - let card = Math.floor(Math.random()*hand.length) - let discarded_card = hand.splice(card, 1)[0] - if (game.is_pwr_struggle) { - if (numberless_cards.includes(discarded_card)) { - log_gap(`Discarded: P${discarded_card}`) - } else { - log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) - } - } else { - log(`Discarded C${cards[discarded_card].number}`) - game.strategy_discard.push(discarded_card) - } - return discarded_card -} - -function discard_from_table(card) { - find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(card) -} - - -function add_midyear() { - const mid_year = cards.filter(card => card && card.period === 2).map(card => card.number); - game.strategy_deck.push(...mid_year); - log_h3('Mid-year cards added to draw deck') -} - - -function add_lateyear() { - const late_year = cards.filter(card => card && card.period === 3).map(card => card.number) - game.strategy_deck.push(...late_year) - log_h3('Late-year cards added to draw deck') -} - -function reset_power() { - game.power_struggle_deck = [] - game.power_struggle_discard = [] - game.dem_pwr_hand = [] - game.com_pwr_hand = [] - game.phase = 1 - game.raised_stakes_round = 0 - game.raised_stakes = 0 - game.played_power_card = 0 - game.tactics_fails = '' - game.view_opp_hand = false - - if (game.persistent_events.includes(72)){ - permanently_remove(72) - game.table_cards = game.table_cards.filter(card => card !== 72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) - } - if (game.persistent_events.includes(62)) { - permanently_remove(62) - game.table_cards = game.table_cards.filter(card => card !== 62) - game.persistent_events = game.persistent_events.filter(n => n !== 62) - } - if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ - permanently_remove(54) - //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) - } -} - -function check_control_change(space_id) { - - // Check if the Tyrant is Gone has been fulfilled - - if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { - log('+2 VP from C97') - game.vp += 2 - if (check_vp()) { - return - } - game.persistent_events = game.persistent_events.filter(n => n !== 97) - delete game.the_tyrant_is_gone - } -} - -function check_systematization() { - // Check for Systematization - may not use this space - if (game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } -} - -function check_common_european_home() { - if (!game.playable_cards.includes(21)) { - game.playable_cards.push(21) - } -} - -function this_card() { - return game.vm_event > 0 ? game.vm_event : game.played_card -} -/* -function get_ops(card) { - let ops = cards[card].ops - if (game.active === COM) { - //Check TST op bonus - if (ops === 1 && game.com_tst_position >=2 && game.dem_tst_position <=1) { - ops++ - } - //Events that influence ops - if (game.persistent_events.includes(25)) { - ops++ - } - if (game.prudence.COM && game.prudence.COM <0) { - ops += game.prudence.COM - } - - } else { - //Check TST op bonus - if (ops === 1 && game.dem_tst_position >=2 && game.com_tst_position <=1) { - ops++ - } - //Events that influence ops - if (game.persistent_events.includes(50)) { - ops++ - } - if (game.prudence.DEM && game.prudence.DEM <0) { - ops += game.prudence.DEM - } - } - //Ops can never be less than one - if (ops <1) { ops = 1 } - return ops -} - */ - -const pluralize = (count, noun, suffix = 's') => - `${count} ${noun}${Math.abs(count) !== 1 ? suffix : ''}` - -function clean_name(str) { - if (str && str.slice(-1) === '*') { - return str.slice(0, -1) - } else { - return str; - } -} - -function country_name(country) { - return country.replace(/_/g, ' ') -} - -// ======== LOG FUNCTIONS ============= - -function log(msg) { - game.log.push(msg) -} - -function log_br() { - if (game.log.length > 0 && game.log[game.log.length - 1] !== "") - game.log.push("") -} - -function logi(msg) { - game.log.push(">" + msg) -} - -function log_h1(msg) { - log_br() - log(".h1 " + msg) - log_br() -} - -function log_h2(msg) { - log_br() - log(".h2 " + msg) - log_br() -} - -function log_h3(msg) { - log_br() - log(".h3 " + msg) -} - -function log_gap(msg) { - log_br() - game.log.push(msg) -} - -function log_msg_gap(msg) { - game.log.push(msg) - log_br() -} - - -function log_side() { - log_br() - if (game.active === DEM) - log(".h2d " + game.active) - else - log(".h2c " + game.active) - log_br() -} - -function log_sep() { - log(".hr") -} - -function log_action(msg) { - log_br() - log(msg) -} - -// ============= SUMMARY FUNCTIONS ============= - -function push_summary() { - if (game.summary) - throw "TOO MANY SUMMARIES" - game.summary = [] -} - -function log_summary(msg) { - - if (msg.startsWith('Added') || msg.startsWith('Removed')) { - for (let item of game.summary) { - if (item[1] === msg) { - item[0]++ - return - } - } - } - game.summary.push([1, msg]) -} - -function pop_summary() { - if (game.summary.length > 0) { - for (let [n, msg] of game.summary) { - if (n > 1) { - log(msg.replace("£ SP", `${n} SPs`)); - } else { - log(msg.replace("£ SP", `${n} SP`)); - } - } - } - game.summary = [] -} - -function log_summary_place(p) { - let from = piece_space(p) - if (from !== AVAILABLE) - log_summary("% " + piece_name(p) + " from S" + from) - else - log_summary("% " + piece_name(p)) -} - -function log_summary_move_to_from(p, to) { - log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p)) -} - -function log_summary_remove(p) { - log_summary("Removed % " + piece_name(p)) -} - -function log_summary_activated(p) { - log_summary("Activated % " + piece_faction_name(p)) -} - -// ============ UNDO FUNCTIONS ================== - -function clear_undo() { - if (game.undo.length > 0) - game.undo = [] -} - -function push_undo() { - let copy = {} - for (let k in game) { - let v = game[k] - if (k === "undo") - continue - else if (k === "log") - v = v.length - else if (typeof v === "object" && v !== null) - v = object_copy(v) - copy[k] = v - } - game.undo.push(copy) -} - -function pop_undo() { - let save_log = game.log - let save_undo = game.undo - game = save_undo.pop() - save_log.length = game.log - game.log = save_log - game.undo = save_undo -} - -// Fast deep copy for objects without cycles -function object_copy(original) { - if (Array.isArray(original)) { - let n = original.length - let copy = new Array(n) - for (let i = 0; i < n; ++i) { - let v = original[i] - if (typeof v === "object" && v !== null) - copy[i] = object_copy(v) - else - copy[i] = v - } - return copy - } else { - let copy = {} - for (let i in original) { - let v = original[i] - if (typeof v === "object" && v !== null) - copy[i] = object_copy(v) - else - copy[i] = v - } - return copy - } -} - - -/* =================== VM FUNCTIONS ========================== */ - -function goto_vm(proc) { - let old_vm = game.vm; - - game.state = "vm"; - game.vm = { - prompt: 0, - fp: proc, - ip: 0, - }; - - if (old_vm) { - game.vm.return_vm = old_vm; - } - - vm_exec(); -} - -function vm_exec() { - vm_inst(0)(); -} - -function vm_inst(a) { - //console.log('game.vm.fp', game.vm.fp, 'game.vm.ip', game.vm.ip) - return CODE[game.vm.fp][game.vm.ip][a] -} - -function vm_next() { - game.vm.ip++; - //console.log('vm_next called, game.vm.ip', game.vm.ip) - vm_exec(); -} - -function vm_operand(a) { - let x = CODE[game.vm.fp][game.vm.ip][a] - if (a > 0 && typeof x === "function") - return x() - return x -} - -function vm_assert_argcount(n) { - const argcount = CODE[game.vm.fp][game.vm.ip].length - 1 - if (argcount !== n) - throw Error(`ASSERT Invalid number of arguments on event ${game.vm.fp}: ${argcount} instead of ${n}`) -} - -function vm_log() { - log(vm_operand(1)); - vm_next(); -} - -function vm_if() { - //console.log('game.temp', game.temp) -// console.log('vm_operand(1)', vm_operand(1)) - if (!vm_operand(1)) { - let balance = 1 - while (balance > 0) { - ++game.vm.ip - switch (vm_operand(0)) { - case vm_if: - ++balance - break - case vm_endif: - --balance - break - case vm_else: - if (balance === 1) - --balance - break - } - if (game.vm.ip < 0 || game.vm.ip > CODE[game.vm.fp].length) - throw "ERROR" - } - } - vm_next() -} - -function vm_else() { - vm_goto(vm_endif, vm_if, 1, 1) -} - -function vm_endif() { - vm_next() -} - -function vm_goto_step(step) { - // console.log('vm_goto_step called, target:', step) - //console.log('game.vm.ip', game.vp.ip) - for (let i = game.vm.ip; i < CODE[game.vm.fp].length; i++) { - //console.log('i', i) - //console.log('step', CODE[game.vm.fp][i][0]) - if (CODE[game.vm.fp][i][0] === step) { - game.vm.ip = i; - vm_exec(); - return; - } - } - - console.log("ERROR: Target operation not found in the current procedure."); -} - - -function vm_goto(op, nop, dir, step) { - //console.log('vm_inst(0)', vm_inst(0), op, nop) -// console.log('vm_inst(0)', vm_inst(1), op, nop) - let balance = 1 - while (balance > 0) { - game.vm.ip += dir - if (vm_inst(0) === op) - --balance - if (vm_inst(0) === nop) - ++balance - if (game.vm.ip < 0 || game.vm.ip > CODE[game.vm.fp].length) - throw "ERROR" - } - game.vm.ip += step - vm_exec() -} - -function event_prompt(str) { - //console.log('event_prompt called with', str) - if (typeof str === "undefined") - str = CODE[game.vm.fp][game.vm.prompt][1] - if (typeof str === "function") - str = str() - //console.log('str:', str) - if (!str) { - str = "" - } - return str -} - -function vm_prompt() { - if (game.vm.prompt) - game.vm._prompt = game.vm.prompt - game.vm.prompt = game.vm.ip - vm_next() -} - -function pop_vm_prompt() { - if (game.vm._prompt) { - game.vm.prompt = game.vm._prompt - delete game.vm._prompt - } else { - game.vm.prompt = 0 - } -} - -function vm_return() { - - //console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) - - //Remove temporary vm variables - delete game.support_check_modifier - delete game.vm_max_infl - delete game.vm_influence_added - delete game.communist_hand_red - - game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ - if (game.persistent_events.includes(58)) { - reset_austria_hungary_border_reopened() - } - - //Check if end event state is needed - if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { - vm_end_event() - } - //Check if auto-resolve opponent event - else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { - vm_end_event() - } - else { - - game.state = 'vm_end_event' - /*if (!game.vm_infl_to_do) { - /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { - game.state = 'vm_end_event' - } else { - game.state = 'vm_end_event' - //end_round() - //} - } else { - console.log('vm_infl_to_do true') - vm_end_event() - }*/ - } -} - -function vm_end_event() { - //game.view_opp_hand = false -// console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) - /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { - if (game.round_player !== game.active) { - change_player() - log_h2('End of Action Round') - } - end_round() - return - } /*Go direct to end round if card fully resolved */ - if (game.return !== game.active) { - next_player()} - if (game.return_state === 'power_struggle') { - do_valid_cards() - } - if (game.return_state && game.return_state !== '') { - game.state = game.return_state - //console.log( 'game.state', game.state) - } - else if (game.vm_infl_to_do) { - game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ - //else {game.state = "play_card"} - else{ - end_round()} -} - -/* ================== VM ACTIONS =========================== */ - -function vm_opp_hand_false() { - game.view_opp_hand = false - vm_next() -} - -function vm_valid_spaces() { - let space_1 = vm_operand(1) - let space_2 = vm_operand(2) - let space_3 = vm_operand(3) - let space_4 = vm_operand(4) - let space_5 = vm_operand(5) - let space_6 = vm_operand(6) - game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] - game.valid_spaces = game.valid_spaces.filter( n => n ) - - // Check for Systematization - may not use this space - check_systematization() - - vm_next() -} - -function vm_valid_spaces_opponent () { - let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - - if (game.active === DEM) { - let infl = game.comInfl[i] - if (infl > 0) { - valid_spaces.push(space.space_id) - } - } else { - infl = game.demInfl[i] - if (infl > 0) { - valid_spaces.push(space.space_id) - } - } - } - game.valid_spaces = valid_spaces -// console.log('game.valid_spaces', game.valid_spaces) - vm_next() -} - -function vm_valid_spaces_socio () { - let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - - if (space.socio === vm_operand(1)) { - valid_spaces.push(space.space_id) - } - } - game.valid_spaces = valid_spaces - - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } - vm_next() -} - -function vm_valid_spaces_opponent_socio () { - let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - - if (game.active === DEM) { - let infl = game.comInfl[i] - if (infl > 0 && space.socio === vm_operand(1)) { - valid_spaces.push(space.space_id) - } - } else { - let infl = game.demInfl[i] - if (infl > 0 && space.socio === vm_operand(1)) { - valid_spaces.push(space.space_id) - } - } - } - game.valid_spaces = valid_spaces - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } - vm_next() -} - -function vm_valid_spaces_country () { - let country - if (vm_operand(1)) {country = vm_operand(1)} - else {country = game.vm_active_country} - for (let space of spaces) { - if (!space) continue - if (space.country === country) { - game.valid_spaces.push(space.space_id); - } - } - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } - vm_next() -} - -function vm_valid_spaces_sc () { - valid_spaces_sc() - vm_next() -} - -function vm_valid_spaces_country_opp () { - let country = '' - - if (vm_operand(1)) { - country = vm_operand(1) } - else { - country = game.vm_active_country - } - for (let space of spaces) { - if (!space) continue - if (game.active === DEM) { - if (space.country === country && game.comInfl[space.space_id] >0) { - game.valid_spaces.push(space.space_id); - } - } else { - if (space.country === country && game.demInfl[space.space_id]>0) { - game.valid_spaces.push(space.space_id); - } - } - } - vm_next() -} - -function vm_valid_spaces_country_sc () { - let valid_spaces = [] - let country = '' - //console.log('in vm_valid_spaces_country_sc') - if (vm_operand(1)) { - country = vm_operand(1) } - else { - country = game.vm_active_country - } - for (let space of spaces) { - if (!space) continue - if (game.active === DEM) { - if (space.country === country && game.comInfl[space.space_id] >0) { - valid_spaces.push(space.space_id); - } - } else { - if (space.country === country && game.demInfl[space.space_id] >0) { - //Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === 14) {continue} - - //Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} - - //Check We are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} - valid_spaces.push(space.space_id); - - //Check Foreign Currency Debt Burden - if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} - } - } - } - game.valid_spaces = valid_spaces - - //Check for Foreign Currency Debt Burden - /*if (game.persistent_events.includes(49) && game.active === COM) { - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country !== game.foreign_currency_debt_burden) - }*/ - vm_next() -} - -function vm_valid_spaces_country_socio_2() { - for (let space of spaces) { - if (!space) continue - if (space.space_id === game.systematization) continue - if ((space.country === vm_operand(1) && space.socio === vm_operand(2)) || (space.country === vm_operand(1) && space.socio === vm_operand(3))) { - game.valid_spaces.push(space.space_id); - } - } - vm_next() -} - -function vm_valid_spaces_region_socio() { - let valid_spaces = [] - for (let space of spaces) { - if (!space) continue - if (space.space_id === game.systematization) continue - if (space.region === vm_operand(1) && space.socio === vm_operand(2)) { - valid_spaces.push(space.space_id); - } - } - game.valid_spaces = valid_spaces - vm_next() -} - -function vm_valid_spaces_region_opp() { - let valid_spaces = [] - for (let space of spaces) { - if (!space) continue - let s = space.space_id - if ((game.active === DEM && space.region === vm_operand(1) && game.comInfl[s] > 0 ) || (game.active === COM && space.region === vm_operand(1) && game.demInfl[s] > 0 )) { - valid_spaces.push(space.space_id); - } - } - game.valid_spaces = valid_spaces - vm_next() -} - -function vm_valid_spaces_solidarity_legalised() { - let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - let uncontrolled = (!check_control(i) && !check_opp_control(i)) - if ((space.country === 'Poland' && uncontrolled && space.socio === 3) || (space.country === 'Poland' && uncontrolled && space.socio === 4)) { - valid_spaces.push(space.space_id); - } - } - game.valid_spaces = valid_spaces - vm_next() -} - -function vm_active_country () { - game.valid_spaces = game.valid_spaces.filter(space_id => { - let space = spaces.find(s => s && s.space_id === space_id); - return space && space.country === game.vm_active_country; - }); - vm_next() -} - -function vm_take_control_prep() { - game.vm_available_ops = vm_operand(1) - game.state = 'vm_take_control' -} - -function vm_take_control(space) { - if (game.active === DEM) { - let current_infl = game.demInfl[space] - let opponent_infl = game.comInfl[space] - let stability = spaces[space].stability - - if ((current_infl - opponent_infl) < stability) { - game.demInfl[space] += stability - current_infl + opponent_infl - //game.pieces[space].demCtrl = 1 - //game.pieces[space].comCtrl = 0 - } - } else if (game.active === COM) { - let current_infl = game.comInfl[space] - let opponent_infl = game.demInfl[space] - let stability = spaces[space].stability - - if ((current_infl - opponent_infl) < stability) { - game.comInfl[space] += stability - current_infl + opponent_infl - //game.pieces[space].comCtrl = 1 - //game.pieces[space].demCtrl = 0 - } - } - game.valid_spaces = game.valid_spaces.filter(id => id !== space) - log(`Took control of %${space}`) -} - - -function vm_do_add_infl(space) { - push_undo() - //console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) - - //log(`Added 1 influence in %${space}.`) - - log_summary(`Added £ SP in %${space}.`) - - //If AHBR - check AHBR condition - if (game.persistent_events.includes(58)) { - if (spaces[space].country !== 'East_Germany'){ - game.austria_hungary_border_reopened_tracker = false - } - } - - // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { - game.vm_available_ops-- - log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(space)) { - game.vm_available_ops -= 2 - //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative - if (game.vm_available_ops < 0) { - log_summary(`(Used +1 op from C58)`) - } - } else { - game.vm_available_ops-- - } - - // Update influence values - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - - // Check whether spaces are controlled - check_control_change(space) - - // Check Austria Hungary Border Reopened is true and condition has been met - if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { - //console.log('in award extra op') - game.vm_available_ops ++ - log('+1 Op from C58') - game.austria_hungary_border_reopened_tracker = false - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') - } - - // If only 1 IP remaining, may not place in opponent controlled spaces - - // Check for Genscher & Austria Hungary Border Reopened - - if (game.vm_available_ops === 1) { - - if (game.active === DEM) { - //Check Genscher and AHBR - if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { - game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) - } - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_dem_control(n)) - } - } - - //Clear valid spaces if no IP remaining. - if (game.vm_available_ops <= 0 ) { - game.valid_spaces = [] - } -} - -function vm_do_add_infl_free(space) { - push_undo() - //log(`Added 1 influence in %${space}.`) - - log_summary(`Added £ SP in %${space}.`) - - // Update influence values - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - game.vm_available_ops-- - // Check whether spaces are controlled - check_control_change(space) - - - //console.log('game pieces:', game.pieces[space]) -} - -function vm_add_infl() { - if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} - game.state = 'vm_add_infl' -} - -function vm_add_infl_free() { - if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} - game.state = 'vm_add_infl_free' -} - -function vm_add_x_infl() { - game.vm_available_ops = vm_operand(1) - game.state = 'vm_add_x_infl' -} - -function vm_do_add_x_infl(space) { - push_undo() - log(`Added ${game.vm_available_ops} SPs in %${space}.`) - - - if (game.active === COM) { - game.comInfl[space] += game.vm_available_ops - } else { - game.demInfl[space] += game.vm_available_ops - } - check_control_change(space) - game.vm_available_ops = 0 - game.valid_spaces = [] -} - -function vm_add_limited_infl() { - game.vm_available_ops = vm_operand(1) - game.vm_max_infl = vm_operand(2) - game.state = 'vm_add_limited_infl' -} - -function vm_do_add_limited_infl(space, max_infl) { - push_undo() - //log(`Added 1 influence in %${space}.`) - - log_summary(`Added £ SP in %${space}.`) - game.vm_available_ops -- - - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - - if (!game.vm_influence_added[space]) { - game.vm_influence_added[space] = 0; - } - - if (game.active === COM) { - game.comInfl[space] ++ - } else { - game.demInfl[space] ++ - } - - game.vm_influence_added[space] ++ - - //console.log('valid_spaces before update', game.valid_spaces) - //console.log('influence added:', game.vm_influence_added[space], 'max infl', max_infl) - if (game.vm_influence_added[space] === max_infl) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - check_control_change(space) - if (game.vm_available_ops === 0) {game.valid_spaces = [] } -} - -function vm_remove_infl() { - game.vm_available_ops = vm_operand(1) - game.state = 'vm_remove_infl' -} - -function vm_remove_opp_infl() { - game.vm_available_ops = vm_operand(1) - game.remove_opponent_infl = true - if (game.is_pwr_struggle) { - game.state = 'vm_scare_tactics' - } else { - game.state = 'vm_remove_infl' - } -} - -function vm_remove_x_opp_infl() { - game.vm_available_ops = vm_operand(1) - game.remove_opponent_infl = true - game.state = 'vm_remove_x_infl' -} - -function vm_do_remove_infl(space) { - push_undo() - //log(`Removed 1 influence from %${space}.`) - log_summary(`Removed £ SP from %${space}.`) - - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - - if (!game.vm_influence_added[space]) { - game.vm_influence_added[space] = 0; - } - if (game.remove_opponent_infl === true) { - if (game.active === COM) { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - - - } else { - if (game.active === COM) { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - } - check_control_change(space) - game.vm_influence_added[space]++ - game.vm_available_ops-- - if (game.vm_available_ops===0) {game.valid_spaces = []} -} - -function vm_do_remove_x_infl(space) { - push_undo() - - if (game.remove_opponent_infl) { - if (game.active === COM) { - if (game.demInfl[space] >= game.vm_available_ops) { - game.demInfl[space] -= game.vm_available_ops - } else { - game.vm_available_ops = game.demInfl[space] - game.demInfl[space] -= game.vm_available_ops - } - } else { - if (game.comInfl[space] >= game.vm_available_ops) { - game.comInfl[space] -= game.vm_available_ops - } else { - game.vm_available_ops = game.comInfl[space] - game.comInfl[space] -= game.vm_available_ops - } - } - } else { - if (game.active === COM) { - if (game.comInfl[space] >= game.vm_available_ops) { - game.comInfl[space] -= game.vm_available_ops - } else { - game.vm_available_ops = game.comInfl[space] - game.comInfl[space] -= game.vm_available_ops - } - } else { - if (game.demInfl[space] >= game.vm_available_ops) { - game.demInfl[space] -= game.vm_available_ops - } else { - game.vm_available_ops = game.demInfl[space] - game.demInfl[space] -= game.vm_available_ops - } - } - } - - log(`Removed ${game.vm_available_ops} SPs from %${space}`) - check_control_change(space) - - game.vm_available_ops = 0 - game.valid_spaces = [] -} - -function vm_remove_limited_opp_infl() { - game.vm_available_ops = vm_operand(1) - game.vm_max_infl = vm_operand(2) - game.remove_opponent_infl = true - game.state = 'vm_remove_limited_infl' -} - -function vm_do_remove_limited_infl(space, max_infl) { - push_undo() - log(`Removed SP from %${space}.`) - game.vm_available_ops -- - - - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - - if (!game.vm_influence_added[space]) { - game.vm_influence_added[space] = 0; - } - - if (game.active === COM) { - game.demInfl[space] -- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space) - } - } else { - game.comInfl[space] -- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space) - } - } - - game.vm_influence_added[space] ++ - - if (game.vm_influence_added[space] === max_infl) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - - check_control_change(space) - if (game.vm_available_ops === 0) {game.valid_spaces = []} -} - -function vm_remove_all_infl() { - game.vm_available_ops = vm_operand(1) - game.state = 'vm_remove_all_infl' -} - -function vm_do_remove_all_infl(space) { - push_undo() - log(`Removed all SP from %${space}.`) - - if (game.remove_opponent_infl === true) { - if (game.active === COM) { - game.demInfl[space] = 0 - } else { - game.comInfl[space] = 0 - } - check_control_change(space) - - } else { - if (game.active === COM) { - game.comInfl[space] = 0 - } else { - game.demInfl[space] = 0 - } - check_control_change(space) - } - game.vm_available_ops -- - game.valid_spaces = game.valid_spaces.filter(id => id !== space) -} - -function vm_replace_all_infl(space_id) { - if (game.active === DEM) { - game.demInfl[space_id] += game.comInfl[space_id] - game.comInfl[space_id] = 0 - } else { - game.comInfl[space_id] += game.demInfl[space_id] - game.demInfl[space_id] = 0 - } - check_control_change(space_id) -} - -function vm_1_support_check() { - game.vm_available_ops = 1 - game.state = 'vm_1_support_check_prep' -} - -function vm_support_check() { - game.vm_available_ops = vm_operand(1) - game.state = 'vm_support_check_prep' -} - -function vm_support_check_modified() { - game.vm_available_ops = vm_operand(1) - game.support_check_modifier = vm_operand(2) - game.state = 'vm_support_check_prep' -} - -function vm_switch_infl(id){ - push_undo() - - game.demInfl[id] -= game.vm_available_ops - game.comInfl[id] += game.vm_available_ops - log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${id}`) - game.vm_available_ops = 0 - check_control_change(id) -} - -/* ===================== EVENT SPECIFIC FUNCTIONS ========== */ - -function vm_40th_anniversary_celebration() { - if (game.vp < 0 ) {game.vm_available_ops = 4} - else {game.vm_available_ops = 2} - vm_next() -} - -function vm_40th_anniversary_celebration_vp() { - game.vp -- - log('-1VP') - if (check_vp()) { - return - } - vm_next() -} - -function vm_adamec() { - game.state = '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) - }*/ - vm_next() -} - -function vm_austria_hungary_border_reopened() { - game.persistent_events.push(58) - permanently_remove(58) - game.austria_hungary_border_reopened_tracker = false - //game.table_cards.push(58) - //remove_from_discard(58) - vm_next() -} - -function vm_betrayal() { - if (game.demInfl[58] > 0 ) { game.valid_spaces.push(58) } - if (game.demInfl[65] >0 ) { game.valid_spaces.push(65) } - game.vm_available_ops = Math.max(game.demInfl[58], game.demInfl[65]) - game.state = 'vm_switch_infl' -} - -function vm_breakaway_baltic_republics() { - log('+5 VP') - game.vp += 5 - game.stability++ - if (check_vp()) { - return - } - game.playable_cards.push(109) - game.playable_cards = game.playable_cards.filter(n => n !== 14) - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70)) {game.valid_spaces.push(70)} - vm_next() -} - -function vm_brought_in_for_questioning() { - if (game.active === COM) { - game.active = DEM - } - //game.return = game.active - game.phase = 0 - game.state = 'vm_brought_in_for_questioning' -} - -function vm_bulgarian_turks_expelled(){ - game.remove_opponent_infl = true - game.vp -= 2 - log('-2VP') - if (check_vp()) { - return - } - if (game.demInfl[70] > 0) {game.valid_spaces = [70]} - vm_next() -} - -function vm_ceausescu() { - let adj_cluj = false - if (game.demInfl[50] > 0 ) {adj_cluj = true} - if (game.demInfl[54] > 0 ) {adj_cluj = true} - if (game.demInfl[58] > 0 ) {adj_cluj = true} - if (game.demInfl[61] > 0 ) {adj_cluj = true} - - if (adj_cluj && game.comInfl[61]>0) { - game.valid_spaces = [61] - game.vm_available_ops = 1 - //next_player() - game.remove_opponent_infl = false - game.state = 'vm_remove_infl' - } - else {vm_next()} -} - -function vm_central_committee_reshuffle() { - game.state = 'vm_central_committee_reshuffle' -} - -function vm_civic_forum() { - log('+1 VP') - game.vp++ - if (check_vp()) { - return - } - game.persistent_events.push(90) - if (check_dem_control(31)) { - vm_next() - } else { - permanently_remove(90) - vm_return() - } -} - -function vm_common_european_home() { - let valid_cards = []; - for (let c of cards) { - //if (c === null) {continue} - if (game.active === DEM) { - if (c && c.side === 'C') { - valid_cards.push(c.number) - } - } else { - if (c && c.side === 'D') { - valid_cards.push(c.number) - } - } - } - game.valid_cards = valid_cards - game.state = 'vm_common_european_home_choose' -} - -function vm_dash_for_the_west() { - game.valid_cards = [] - for (let c of game.strategy_discard) { - if (cards[c].side === 'D' && cards[c].remove === 1 && (cards[c].playable || game.playable_cards.includes(c))) { - game.valid_cards.push(c) - } - } - game.state = 'vm_dash_for_the_west' -} - -function vm_deutsche_marks() { - let max_value = 1; - for (let c of game.democrat_hand) { - if (cards[c].ops > max_value) { - max_value = cards[c].ops - } - } - let valid_cards = []; - for (let c of game.democrat_hand) { - if (cards[c].ops === max_value) { - valid_cards.push(c); - } - } - game.valid_cards = valid_cards - game.state = 'vm_deutsche_marks_prep' -} - -function vm_domino_theory() { - game.discard = true - for (let card of game.strategy_discard) { - if (scoring_cards.includes(card)) {game.valid_cards.push(card) } - } - game.phase = 0 - game.state = 'vm_play_event_from_discard' -} - -function vm_eco_glasnost() { - game.persistent_events.push(39) - vm_next() -} - -function vm_elena(){ - game.persistent_events.push(101) - vm_next() -} - -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 === 61) { - game.demInfl[space_id] = 0 - game.comInfl[space_id] = 0 - } else { - game.demInfl[space_id] = 0 - game.comInfl[61] += game.comInfl[space_id] - if (game.comInfl[space_id] > 0 ) { - log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) - } - game.comInfl[space_id] = 0 - } - //Update control in the eliminated space and in Bucuresti - check_control_change(space_id) - check_control_change(61) - -} - -function get_adjusted_adjacency(space_id) { - let adjacent_spaces = spaces[space_id].adjacent; - if (adjacent_spaces.includes(game.systematization)) { - //console.log('in get adjusted adjacency, systemization',game.systematization) - //console.log('adjacent_spaces', adjacent_spaces) - } - if (game.systematization !== 0) { - //console.log('in systematization check') - let eliminated_space_id = game.systematization; - - return adjacent_spaces.map(adj_space_id => { - if (adj_space_id === eliminated_space_id) { - // Replace the eliminated space with its adjacencies - //console.log('in map check, return', spaces[eliminated_space_id].adjacent) - return spaces[eliminated_space_id].adjacent; - } - //console.log('2nd check, return', adj_space_id) - return adj_space_id; - }).flat(); // Flatten in case the eliminated space has multiple adjacencies - } - //console.log('final adjacent spaces', adjacent_spaces) - return adjacent_spaces; -} - -function vm_exit_visas() { - game.state = 'vm_exit_visas' -} - -function vm_foreign_currency_debt_burden() { - log('+1VP') - game.vp++ - if (check_vp()) { - return - } - //game.table_cards.push(49) - //remove_from_discard(49) - game.persistent_events.push(49) - game.state = 'vm_foreign_currency_debt_burden' -} - -function vm_foreign_television() { - for (let i = 1 ; i < spaces.length; i++) { - if (i === 12) {continue} /*Does not apply to Dresden*/ - if (game.comInfl[i] > 0 ) { - game.valid_spaces.push(i) - } - } - vm_next() -} -function vm_frg_embassies() { - game.persistent_events.push(74) - game.table_cards.push(74) - remove_from_discard(74) - log('C74 in effect') - vm_next() -} - -function vm_general_strike() { - game.persistent_events.push(5) - game.table_cards.push(5) - remove_from_discard(5) - log('C5 in effect') - vm_next() -} - -function vm_genscher() { - game.persistent_events.push(63) - game.table_cards.push(63) - remove_from_discard(63) - log(`C63 in effect`) - vm_next() -} - -function vm_goodbye_lenin() { - game.view_opp_hand = true - game.communist_hand_red = [] - // Select Red cards to show - for (let card of game.communist_hand) { - if (cards[card].red) { - game.communist_hand_red.push(card) - } - } - //Check if these cards are playabl - for (let card of game.communist_hand_red) { - if (cards[card].playable || game.playable_cards.includes(card)) { - game.valid_cards.push(card) - } - } - game.state = 'vm_goodbye_lenin' -} - -function vm_government_resigns() { - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (space.socio === 1 && game.comInfl[i] > 0 && !check_control(i)) { - game.valid_spaces.push(i) - } - } - game.remove_opponent_infl = true - vm_next() -} - -function vm_grenztruppen() { - game.persistent_events.push(59) - permanently_remove(59) - //game.table_cards.push(59) - //remove_from_discard(59) - vm_next() -} - -function vm_heal_our_bleeding_wounds() { - let change_vp = 0 - if (game.turn <= 3) {change_vp = -3 } - else if (game.turn <= 7) {change_vp = -1} - else change_vp = 3 - if (change_vp >0) { - log(`+${change_vp} VP`) - } else { - log(`-${change_vp} VP`) - } - game.vp += change_vp - if (check_vp()) { - return - } - vm_next() -} - -function vm_helsinki_final_act() { - game.persistent_events.push(26) - vm_next() -} - -function vm_honecker() { - game.persistent_events.push(15) - game.valid_cards = [] - for (let c of game.strategy_discard) { - if (scoring_cards.includes(c)) { - continue} - else { - game.valid_cards.push(c) - } - } - game.discard = true - game.state = 'vm_honecker' -} - -function vm_inflationary_currency() { - game.state = 'vm_inflationary_currency' -} - -function vm_inflationary_currency_discard() { - // This function starts with the player who is playing Inflationary Currency for the Event - // Switch player and check the hand of their opponent to see if the have cards with ops > 3 to discard - next_player() - if (game.active === COM) { - for (let card of game.communist_hand){ - if (get_card_ops(card) >= 3) { - game.valid_cards.push(card) - } - } - } else { - for (let card of game.democrat_hand){ - if (get_card_ops(card) >= 3) { - game.valid_cards.push(card) - } - } - } - game.state = 'vm_inflationary_currency_discard' -} - -function vm_kiss_of_death() { - game.state = 'vm_kiss_of_death' -} - -function vm_klaus_and_komarek() { - if (game.comInfl[29] > 0 ) {game.valid_spaces = [29]} - vm_next() -} - -function vm_kohl_proposes_reunification() { - log('+2 VP') - game.vp += 2 - if (check_vp()) { - return - } - if (game.persistent_events.includes(86)) { - game.vm_event = 87 - game.state = 'vm_common_european_home_play' - } else { - permanently_remove(87) - vm_return() - } - -} - -function vm_kremlin_coup() { - log('-3 VP') - game.vp -= 3 - game.stability ++ - if (check_vp()) { - return - } - game.support_check_modifier = 1 - //countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] - //revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} - game.temp = [] - countries.forEach(country => { - if (!game.revolutions[find_country_index(country)]) { - game.temp.push(country) - } - }) - game.state = 'vm_kremlin_coup_choose_country' -} - -function vm_laszlo_tokes() { - game.persistent_events.push(73) - game.playable_cards.push(107) - game.state = 'vm_laszlo_tokes' -} - -function vm_legacy_of_martial_law() { - game.vm_available_ops = 1 - game.state = 'vm_switch_infl' -} - -function vm_legacy_of_1968() { - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if ((!check_com_control(i) && space.country === 'Czechoslovakia')) { - game.valid_spaces.push(space.space_id); - } - } - vm_next() -} - -function vm_li_peng() { - game.persistent_events.push(53) - //game.table_cards.push(53) - remove_from_discard(53) - vm_next() -} - -function vm_ligachev() { - game.persistent_events.push(99) - vm_next() -} - -function vm_malta_summit() { - game.state = 'vm_malta_summit' -} - -function vm_massacre_in_timisoara() { - game.persistent_events = game.persistent_events.filter(n => n !== 73) - vm_next() -} - -function vm_modrow() { - game.playable_cards.push(15) - game.state = 'vm_modrow' -} - -function vm_nagy_reburied(){ - if (game.comInfl[43] > 0) { - game.valid_spaces.push(43) - } - vm_next() -} - -function vm_national_salvation_front() { - game.persistent_events.push(102) - game.table_cards.push(102) - remove_from_discard(102) - vm_next() -} - -function vm_nepotism() { - game.state = 'vm_nepotism' -} - -function vm_new_years_eve_party() { - game.state = 'vm_new_years_eve_party' -} - -function vm_nomenklatura() { - game.state = 'vm_nomenklatura' -} - -function vm_normalisation() { - if (game.demInfl[27] >0) {game.valid_spaces.push(27)} - if (game.demInfl[29] > 0) {game.valid_spaces.push(29)} - game.remove_opponent_infl = true - vm_next() -} - -function vm_peasant_parties_revolt() { - game.persistent_events.push(72) - log_msg_gap('C72 in effect') - game.table_cards.push(72) - remove_from_discard(72) - vm_next() -} - -function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') - vm_next() -} - -function vm_poszgay() { - let valid_spaces = [] - for (let space of spaces) { - if (space && space.country === 'Hungary' && !check_dem_control(space.space_id)) { - valid_spaces.push(space.space_id); - } - } - game.valid_spaces = valid_spaces - vm_next() -} - -function vm_power_struggle() { - //console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - game.is_pwr_struggle = true - - /* TO DELETE? - //Check if Power Struggle is because of an event - */ - - if (game.vm_event > 0) { - game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] - log_h2(`C${game.vm_event}`) - } -/* - //Otherwise set Power Struggle country normally - else { - console.log('vm_power_struggle, country set normally') - game.pwr_struggle_in = countries[scoring_cards.indexOf(game.played_card)] - log_h2(`C${game.played_card}`) - }*/ - - - //Check for Securitate - if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(70)) { - log('C70: Democrat reveals Power Struggle cards') - game.view_opp_hand = true - } - log_h2('Deal Cards') - game.state = 'draw_power_cards' -} - -function vm_presidential_visit() { - game.persistent_events.push(65) - //game.table_cards.push(65) - //remove_from_discard(65) - log_msg_gap('C65 in effect') - vm_next() -} - -function vm_prudence() { - if (!game.prudence) { - game.prudence = {DEM: 0, COM: 0} - } - if (game.active === DEM) { - game.prudence.COM -- - log(`${game.prudence.COM} to Communist ops this turn`) - } else { - game.prudence.DEM -- - log(`${game.prudence.DEM} to Democrat ops this turn`)} - vm_next() -} - -function vm_public_against_violence() { - game.valid_spaces = [] - if (game.comInfl[34] > 0 ) {game.valid_spaces.push(34)} - vm_next() -} - -function vm_reformer_rehabilitated () { - permanently_remove(67) - game.discard = true - for (let card of game.strategy_discard) { - if (!event_is_playable(card)) continue - if (card === game.played_card) continue - if (game.table_cards.includes(card)) continue - if (scoring_cards.includes(card)) continue - - game.valid_cards.push(card) - } - game.state = 'vm_play_event_from_discard' -} - -function vm_roundtable_talks() { - game.persistent_events.push(17) - game.table_cards.push(17) - remove_from_discard(17) - log_msg_gap('C17 in effect') - vm_next() -} - -function vm_sajudis_check() { - if (!check_dem_control(56)) { - game.valid_spaces.push(56) - } - if (!check_dem_control(70)) { - game.valid_spaces.push(70) - } - vm_next() -} - -function vm_sajudis() { - game.playable_cards.push(81) - game.stability++ - log('+1 VP') - game.vp++ - if (check_vp()) { - return - } - vm_next() -} - -function vm_samizdat() { - game.state = 'vm_samizdat' -} - -function vm_securitate() { - game.persistent_events.push(70) - permanently_remove(70) - //game.table_cards.push(70) - vm_next() -} - -function vm_shock_therapy() { - game.state = 'vm_shock_therapy' -} - -function vm_social_democratic_platform_adopted() { - game.state = '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) - vm_next() -} - -function vm_st_nicholas_church () { - game.persistent_events.push(24) - game.playable_cards.push(61) - vm_next() -} - -function vm_stasi() { - log_msg_gap('C13 in effect') - game.persistent_events.push(13) - vm_next() -} - -function vm_stand_fast() { - game.persistent_events.push(100) - if (game.active === DEM) { - game.stand_fast = DEM - } else {game.stand_fast = COM} - //game.table_cards.push(100) - vm_next() -} - -function vm_systematization() { - game.state = 'vm_systematization' -} - -function vm_tank_column() { - if (game.active === DEM) { - game.dem_tst_position++ - game.dem_tst_attempted = 0 - } else { - game.com_tst_position++ - game.com_tst_attempted = 0 - } - vm_next() -} - -function vm_tear_gas () { - game.persistent_events.push(30) - game.table_cards.push(30) - remove_from_discard(30) - log_msg_gap('C30 in effect') - vm_next() -} - -function vm_the_baltic_way() { - game.playable_cards.push(84) - game.stability++ - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70) && game.systematization !== 70) {game.valid_spaces.push(70)} - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() -} - -function vm_the_chinese_solution() { - game.state = '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) - vm_next() -} - -function vm_the_monday_demonstrations() { - if (!check_dem_control(6)) {game.valid_spaces.push(6)} - if (!check_dem_control(9)) {game.valid_spaces.push(9)} - vm_next() -} - -function vm_the_sinatra_doctrine() { - game.persistent_events.push(50) - log_msg_gap('C50 in effect') - vm_next() -} - -function vm_the_third_way() { - log('-2VP') - vm_next() -} - -function vm_the_tyrant_is_gone() { - game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (game.demInfl[i] === 0 && space.country === 'Romania') { - if (space.space_id === game.systematization) {continue} - game.valid_spaces.push(space.space_id) - } - } - game.state = 'vm_the_tyrant_is_gone' -} - - -function vm_the_tyrant_is_gone_prep() { - game.table_cards.push(97) - remove_from_discard(97) - vm_next() -} - -function vm_tyrant_block() { - logi(`Has no effect after C97`) - vm_next() - //game.state = 'vm_tyrant_block' -} - -function vm_the_wall () { - game.persistent_events.push(9) - //game.strategy_removed.push(9) - //game.table_cards.push(9) - log_msg_gap('C9 in effect') - vm_next() -} - -function vm_the_wall_must_go() { - game.the_wall_must_go = {} - game.the_wall_must_go['dem_wins'] = 0 - game.the_wall_must_go['com_wins'] = 0 - game.the_wall_must_go['dem_roll'] = 0 - game.the_wall_must_go['com_roll'] = 0 - game.state = 'vm_the_wall_must_go' -} - -function vm_warsaw_pact_summit() { - game.warsaw_pact_summit = true /*What does this do? */ - game.state = 'vm_warsaw_pact_summit' -} - -function vm_we_are_the_people() { - if (game.demInfl[6] > 0) {game.valid_spaces = [6]} - game.persistent_events.push(48) - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - game.vm_influence_added[6] = 0 - game.vm_available_ops = 4 - game.state = 'vm_we_are_the_people_remove' -} - -function vm_workers_revolt() { - if (game.active === DEM) { - for (let space of spaces) { - if (!space) continue - let country = space.country - if (!game.revolutions[find_country_index(country)] && game.comInfl[space.space_id] > 0 && space.socio === 4) { - game.valid_spaces.push(space.space_id); - } - } - } else { - for (let space of spaces) { - if (!space) continue - let country = space.country - if (game.revolutions[find_country_index(country)] && game.demInfl[space.space_id] > 0 && space.socio === 4) { - game.valid_spaces.push(space.space_id); - } - } - } - game.state = 'vm_workers_revolt' -} - -function vm_yakovlev_counsels_gorbachev() { - game.persistent_events.push(62) - log_msg_gap('C62 in effect') - game.table_cards.push(62) - remove_from_discard(62) - vm_next() -} - -function vm_permanently_remove () { - // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! - if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { - permanently_remove(game.vm_event) - } - if (cards[game.played_card].remove ===1 && !game.strategy_removed.includes(game.played_card)) { - permanently_remove(game.played_card) - } /*This means the card that called the event being played is also removed if relevant. Think this makes sense */ - vm_next() -} - -function discarded_card() { - return game.temp > 0 -} - -// =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== - -function vm_tst_3() { - log_gap('Tiananmen Square Track award') - game.state = 'vm_tst_3_prep' -} - -function vm_tst_4() { - log_gap('Tiananmen Square Track award') - game.vm_available_ops = 2 - game.remove_opponent_infl = true - game.state = 'vm_tst_4' -} -function vm_tst_6() { - log_h3('Tiananmen Square Track award') - game.vm_available_ops = 1 - game.temp = 1 //Set temp to 1, so that Card 1 is called during the support check, which has 2 ops - game.state = 'vm_tst_6' -} - -function vm_tst_8() { - game.state = 'vm_goodbye_lenin_ops' // Use this to resolve ops. -} - -// ==================== POWER STRUGGLE FUNCTIONS ====================== - -function vm_scare_tactics() { - game.vm_active_country = game.pwr_struggle_in - vm_next() -} -function vm_support_surges() { - game.state = 'vm_support_surges_1' -} - -function vm_support_falters() { - game.vm_available_ops = 2 - game.return === game.active - game.state = 'vm_support_falters' -} - -function vm_kremlin_coup_elite() { - game.valid_spaces=[] - elite_spaces.forEach(space => { - if (spaces[space].country === game.vm_active_country && !check_com_control(space)) { - game.valid_spaces.push(space); - } - }) - game.state = 'vm_kremlin_coup_take_control' -} - -/* ================== VM STATES ============================== */ - -states.vm_end_event = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt () { - view.prompt = `${clean_name(cards[this_card()].name)}: done.` - if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { - gen_action('done') - } else { - gen_action('end_round') - } - }, - done() { - push_undo() - vm_end_event() - }, - end_round() { - push_undo() - game.return_state = '' - vm_end_event() - } -} - -states.vm_take_control = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt () { - if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: all spaces controlled. Continue.` - gen_action('done') - } else if (game.vm_available_ops > 0 ) { - view.prompt = `${clean_name(cards[this_card()].name)}: take control of ${event_prompt()}.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Take control: done.` - if (game.vm_infl_to_do) { - gen_action('done') - } else { - gen_action('end_round') - } - } - }, - infl(space) { - push_undo() - vm_take_control(space) - game.vm_available_ops-- - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - vm_next() - } - }, - done() { - push_undo() - vm_next() - }, - end_round() { - push_undo() - vm_next() - } -} - -states.vm_add_infl = { - inactive: 'add Support Points.', - prompt () { - if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { - 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 ) { - view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - } else { - get_end_infl_prompt() - } - }, - infl(space) { - vm_do_add_infl(space) - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.vm_event_done = true - vm_next() - } - }, - done () { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.vm_event_done = true - vm_next() - }, - end_round() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.vm_event_done = true - vm_next() - } -} - -states.vm_add_infl_free = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}: add SPs.` - }, - prompt () { - if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { - 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 ) { - view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } else { - get_end_infl_prompt() - } - }, - infl(space) { - vm_do_add_infl_free(space) - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - - game.vm_event_done = true - vm_next() - } - }, - done () { - push_undo() - game.valid_spaces = [] - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }, - end_round () { - push_undo() - game.valid_spaces = [] - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } -} - -states.vm_add_x_infl = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.` - }, -// inactive: `resolve ${cards[this_card()].name}: add influence.`, - prompt () { - if (game.vm_event === 101 && game.valid_spaces.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: the Romanian Elite space no longer exists.` - gen_action('done') - } - else if (game.vm_available_ops > 0 ) { - view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') - }*/ - }, - infl(space) { - push_undo() - vm_do_add_x_infl(space) - if (game.vm_available_ops === 0) { - 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() - game.vm_event_done = true - vm_next() - } -} - -states.vm_add_limited_infl = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.` - }, - prompt () { - if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) { - if (game.vm_max_infl === 1) { - view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_max_infl,'SP')} ${event_prompt()}.` - } - else { - view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.` - } - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') - }*/ - }, - infl(space) { - vm_do_add_limited_infl(space, game.vm_max_infl) - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { - game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - game.vm_event_done = true - vm_next() - } - }, - /*done () { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - game.vm_event_done = true - vm_next() - }*/ -} - -states.vm_remove_infl = { - inactive: 'remove Support Points.', - prompt () { - // Keep this so that there is an undo option in, e.g., Scare Tactics - if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` - gen_action('done') - return - } - if (game.vm_available_ops === 0 ) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - if (game.remove_opponent_infl) { - view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` - } - else { - view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` - } - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - push_undo() - vm_do_remove_infl(space) - game.vm_active_country = spaces[space].country - if (game.vm_event !== 44) { - if (game.vm_available_ops === 0 ) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } - } - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } -} - - -states.vm_remove_x_infl = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}: remove SP from ${event_prompt()}.` - }, - prompt () { - if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` - gen_action('done') - } else if (game.vm_available_ops > 0) { - - view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } /*else { - if (game.vm_infl_to_do) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` - gen_action('done') - return - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - }*/ - }, - infl(space) { - vm_do_remove_x_infl(space) - /*if (game.vm_event === 68) { - vm_next() - return - }*/ - if (game.vm_available_ops === 0) { - game.vm_event_done = true - vm_next() - } - /*game.vm_event_done = true - vm_next()*/ - }, - done () { - game.vm_event_done = true - vm_next() - } -} - -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 ${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(space_id); - } - } 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 { - if (game.vm_infl_to_do) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` - gen_action('done') - return - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - }*/ - }, - infl(space) { - vm_do_remove_limited_infl(space, game.vm_max_infl) - if (game.vm_available_ops === 0) { - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } - }, - done () { - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } -} - -states.vm_remove_all_infl = { - inactive: 'remove Support Points', - prompt () { - if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` - gen_action('pass') - } else if (game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - }*/ - }, - infl(space) { - vm_do_remove_all_infl(space) - game.vm_active_country = spaces[space].country - if (game.vm_available_ops === 0) { - vm_next() - } - }, - pass() { - push_undo() - vm_next() - } -} - -states.vm_support_check_prep = { - inactive: 'do support checks.', - prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` - gen_action('done') - } else */ - if (game.valid_spaces.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` - gen_action('done') - } else { - //if (game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` - //} - for (let space_id of game.valid_spaces) { - if (!space_id) continue - gen_action_sc(space_id); - } - } - }, - sc(space) { - push_undo() - game.selected_space = space - - // 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)) { - game.austria_hungary_border_reopened_tracker = true - game.state = 'vm_do_support_check' - return - } - - //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.active === DEM && game.vm_available_ops > 1) { - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'vm_austria_hungary_border_reopened_check' - return - } - //game.state = 'do_support_check' - } /*else { */ - } - game.state = 'vm_do_support_check' - }, - done () { - push_undo() - game.vm_available_ops = 0 - vm_next () - } -} - -states.vm_ceh_support_check_prep = { - inactive: 'do support checks.', - prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('done') - return - }*/ - if (game.vm_available_ops > 0) { - view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` - - for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) - } - } - }, - sc(space) { - push_undo() - game.selected_space = space - - //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.active === DEM && game.vm_available_ops > 1) { - - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'vm_austria_hungary_border_reopened_check' - return - } - //game.state = 'do_support_check' - } /*else { */ - } - game.state = 'vm_ceh_do_support_check' - }, - /*done () { - vm_next () - }*/ -} - - -states.vm_ceh_do_support_check = { - inactive: 'do support checks.', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - - game.vm_available_ops-- - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - vm_next() - } else { - game.state = 'vm_ceh_support_check_prep' - return - } - } -} - -states.vm_austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened', - prompt() { - view.prompt = 'Austria-Hungary Border Reopened: will all support checks be in East Germany?' - gen_action('yes') - gen_action('no') - }, - yes() { - game.austria_hungary_border_reopened_tracker = true - game.state = 'vm_do_support_check' - }, - no() { - game.state = 'vm_do_support_check' - } -} - -states.vm_1_support_check_prep = { - inactive: 'do support checks.', - prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` - gen_action('done') - } else */if (game.valid_spaces.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` - gen_action('done') - } else { - view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}.` - - for (let space_id of game.valid_spaces) { - if (!space_id) continue - gen_action_sc(space_id); - } - } - }, - sc(space) { - push_undo() - game.selected_space = space - game.state = 'vm_do_support_check' - }, - done () { - push_undo() - game.vm_available_ops = 0 - vm_next () - } -} - -states.vm_do_support_check = { - inactive: 'do support checks.', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.vm_available_ops-- - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - vm_next() - return - } else { - game.state = 'vm_support_check_prep' - return - } - } -} - -states.vm_tiananmen_square_attempt = { - inactive: 'do Tiananmen Square', - prompt () { - /*if (game.active === DEM && game.dem_tst_attempted_this_turn > 0 || game.active === COM && game.com_tst_attempted_this_turn > 0) { - view.prompt = 'Tiananmen Square Track attempt: done.' - gen_action('done') - return - }*/ - view.prompt = 'Tiananmen Square: roll a die' - gen_action('roll') - }, - roll() { - clear_undo() - do_tst_attempt () - }, - /*done () { - vm_next() - }*/ -} - -//================================== EVENT SPECIFIC STATES ====================================== - -states.vm_adamec = { - get inactive() { - return `resolve ${clean_name(cards[88].name)}.` - }, - prompt() { - view.prompt = 'Adamec: roll a die.' - gen_action('roll') - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - 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`) - roll -= worker_spaces - } - log(`Modified roll: ${roll}`) - if (roll > 2) { - log('Adamec succeeds') - vm_next() - return - } - log('Adamec fails: 3 or more required') - permanently_remove(88) - vm_return() - } -} - -states.vm_brought_in_for_questioning = { - inactive: 'discard a card.', - prompt() { - /*if (game.phase === 1) { - view.prompt = 'Discard a card: done.' - gen_action('done') - } else */ - if (game.democrat_hand.length === 0) { - view.prompt = 'Brought in for Questioning. No cards to discard.' - gen_action('pass') - } else { - view.prompt = 'Brought in for Questioning: you must discard a random card.' - gen_action('discard') - } - }, - discard() { - clear_undo() - game.vm_event = discard_card(game.democrat_hand) - game.phase = 1 - if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { - //game.return = game.active - if (!game.vm_infl_to_do) { - if(game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - if (!is_auto_resolve(game.vm_event) && !switch_events.includes(game.vm_event)) { - next_player() - } - goto_vm(game.vm_event) - } else { - game.return = DEM - vm_return() - } - }, - pass() { - log('No cards to discard') - vm_return() - }, - /*done() { - vm_return() - }*/ -} - -states.vm_central_committee_reshuffle = { - get inactive() { - return `resolve ${clean_name(cards[57].name)}.` - }, - prompt() { - if (game.revolutions.every(n => n === true)) { - view.prompt = 'Central Committee Reshuffle: no countries to choose.' - gen_action('pass') - } else { - 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')} - if (!game.revolutions[3]) {gen_action('bulgaria')} - if (!game.revolutions[4]) {gen_action('czechoslovakia')} - if (!game.revolutions[5]) {gen_action('romania')} - } - }, - east_germany() { - push_undo() - game.vm_active_country = "East_Germany" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [1,2,3,4,5,6,7,8,9,10,11,12] - vm_next() - }, - poland() { - push_undo() - game.vm_active_country = "Poland" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [13,14,15,16,17,18,19,20,21,22,23,24,25,26] - vm_next() - }, - czechoslovakia() { - push_undo() - game.vm_active_country = "Czechoslovakia" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [27,28,29,30,31,32,33,34,35,36,37] - vm_next() - }, - hungary() { - push_undo() - game.vm_active_country = "Hungary" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [38,39,40,41,42,43,44,45,46,47,48,49] - vm_next() - }, - romania() { - push_undo() - game.vm_active_country = "Romania" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [50,51,52,53,54,55,56,57,58,59,60,61,62,63] - game.valid_spaces = game.valid_spaces.filter(space => space !== game.systematization) - vm_next() - }, - bulgaria () { - push_undo() - game.vm_active_country = "Bulgaria" - log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] - vm_next() - }, - pass() { - log('Passed') - vm_return() - } - -} - -states.vm_common_european_home_choose = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = `Common European Home: play an opponent's card, event does not occur.` - for (let card of game.valid_cards) { - gen_action_card(card) - } - }, - card(card) { - push_undo() - //log(`Played with C${cards[card].number}`) - game.valid_cards = [] - silent_discard(card) - game.vm_event = card - game.state = 'vm_common_european_home_play' - } -} - -states.vm_common_european_home_play = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt() { - 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 ) { - 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) { - gen_action('tst') - } */ - }, - influence(){ - push_undo() - log_gap(`Played C${cards[game.vm_event].number} to place SPs`) - 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)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state = 'vm_add_infl' - }, - support_check() { - push_undo() - log_gap(`Played C${cards[game.vm_event].number} for support checks`) - game.vm_available_ops = 2 - game.state = 'vm_ceh_support_check_prep' - valid_spaces_sc() - }, - tst() { - push_undo() - log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) - game.state = 'vm_tiananmen_square_attempt' - } -} - -states.vm_dash_for_the_west = { - get inactive() { - return `resolve ${clean_name(cards[36].name)}.` - }, - prompt() { - /* if (game.phase === 1) {*/ - view.prompt = 'Dash for the West: roll a die' - gen_action('roll') - /*} else { - view.prompt = 'Dash for the West: roll a die. Done.' - gen_action('done') - }*/ - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - let com_control = check_presence('East_Germany').com_spaces - - if (roll > com_control) { - log(`Success. More than the ${com_control} Communist controlled spaces in East Germany`) - log('+1 VP') - game.vp++ - if (check_vp()) { - return - } - game.discard = true - game.state = 'vm_play_event_from_discard' - } else { - log(`Fail: more than a ${com_control} required`) - //game.phase++ - vm_next() - } - },/* - done() { - vm_next() - }*/ -} - -states.vm_play_event_from_discard = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_cards.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no valid cards in discard.` - gen_action('pass') - } else if (game.temp === 0) { - view.prompt = `${event_prompt()}.` - for (let card of game.valid_cards) { - gen_action('pass') - gen_action_card(card) - } - } /*else { - view.prompt = 'Choose a card: done.' - gen_action('done') - }*/ - }, - card(card) { - push_undo() - log(`Chose C${cards[card].number}`) - game.vm_event = card - game.vm_available_ops = cards[card].ops - game.discard = false - //game.return = game.active Does turning this off cause problems? - if (switch_events.includes(card)) {next_player()} - goto_vm(card) - }, - pass(){ - push_undo() - if (game.valid_cards.length === 0) { - log('No valid cards to choose') - } else{ - log('Did not choose a card') - } - vm_next() - }, -/* done(){ - push_undo() - game.discard = false - vm_next() - }*/ -} - -states.vm_deutsche_marks_prep = { - inactive: 'choose a card.', - prompt() { - if (game.valid_cards.length === 0) { - view.prompt = 'Deutsche Marks: no cards to give.' - gen_action('pass') - } else { - view.prompt = 'Deutsche Marks: choose a card to give.' - for (let card of game.valid_cards) { - gen_action_card(card) - } - } - }, - card(card) { - push_undo() - log(`Gave C${cards[card].number}`) - game.valid_cards = [] - silent_discard(card) - //next_player() - game.state = 'vm_deutsche_marks_confirm' - game.vm_event = card - }, - pass() { - push_undo() - vm_next() - } -} - -states.vm_deutsche_marks_confirm = { - inactive: 'choose a card.', - prompt() { - view.prompt = `Deutsche Marks: gave ${cards[game.vm_event].name}.` - gen_action('done') - }, - done() { - next_player() - game.state = 'vm_deutsche_marks' - } -} - -states.vm_deutsche_marks = { - get inactive() { - return `resolve ${clean_name(cards[20].name)}.` - }, - prompt() { - if(cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { - view.prompt = `Deutsche Marks: you must play ${clean_name(cards[this_card()].name)} for the event.` - gen_action('event') - } else { - view.prompt = `Deutsche Marks: play ${clean_name(cards[this_card()].name)} for:` - gen_action('influence') - gen_action('support_check') - if (game.com_tst_attempted_this_turn === 0) { - gen_action('tst') - } - } - }, - event() { - push_undo() - log(`Played C${cards[game.vm_event].number} for the event`) - if (!game.vm_infl_to_do) { - game.return = game.active - } - goto_vm(game.vm_event) - }, - influence() { - push_undo() - log(`Played C${cards[game.vm_event].number} to place SPs`) - game.vm_available_ops = get_card_ops(game.vm_event) - - /*cards[game.vm_event].ops - if (game.persistent_events.includes(25)) {game.vm_available_ops++ } - if (game.prudence.COM && game.prudence.COM < 0 ) { - game.vm_available_ops += game.prudence.COM - }*/ - valid_spaces_infl() - game.state = 'vm_add_infl' - }, - support_check() { - push_undo() - log_gap(`Played C${cards[game.vm_event].number} for support checks`) - game.vm_available_ops = 2 - game.state='vm_support_check_prep' - valid_spaces_sc() - }, - tst() { - push_undo() - log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) - game.state='vm_tiananmen_square_attempt' - } -} - -states.vm_exit_visas = { - get inactive() { - return `resolve ${clean_name(cards[75].name)}.` - }, - prompt() { - view.prompt = 'Exit Visas: you may discard cards from your hand and draw replacements.' - for (let card of game.democrat_hand) { - gen_action_card(card) - } - if (game.temp === 0) { - gen_action('pass') - } else { - gen_action('done') - } - }, - card(card){ - push_undo() - discard(card) - game.temp++ - }, - pass() { - push_undo() - game.state = 'vm_exit_visas_finish' - }, - done() { - push_undo() - game.state = 'vm_exit_visas_finish' - } -} - -states.vm_exit_visas_finish = { - get inactive() { - return `resolve ${clean_name(cards[75].name)}.` - }, - prompt() { - if (game.temp > 0 ) { - view.prompt = 'Exit Visas: draw replacement cards.' - gen_action('draw') - } /*else { - view.prompt = 'Exit Visas. Draw cards: done.' - gen_action('done') - } */ - }, - draw() { - clear_undo() - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length + game.temp, game.communist_hand.length) - game.temp = 0 - vm_next() - }, - /*done() { - vm_next() - }*/ -} - -states.vm_foreign_currency_debt_burden = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = 'Choose a country. The Communist may not make support checks there for the rest of the turn.' - gen_action('east_germany') - gen_action('poland') - gen_action('czechoslovakia') - gen_action('hungary') - gen_action('bulgaria') - }, - east_germany() { - push_undo() - game.foreign_currency_debt_burden = 'East_Germany' - log('Selected East Germany') - vm_next() - }, - poland() { - push_undo() - game.foreign_currency_debt_burden = 'Poland' - log('Selected Poland') - vm_next() - }, - czechoslovakia() { - push_undo() - game.foreign_currency_debt_burden = 'Czechoslovakia' - log('Selected Czechoslovakia') - vm_next() - }, - hungary() { - push_undo() - game.foreign_currency_debt_burden = 'Hungary' - log('Selected Hungary') - vm_next() - }, - bulgaria() { - push_undo() - game.foreign_currency_debt_burden = 'Bulgaria' - log('Selected Bulgaria') - vm_next() - } -} - -states.vm_goodbye_lenin = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_cards.length > 0 ) { - view.prompt = `Play a red event from your opponent's hand, or play Goodbye Lenin for operations.` - for (let card of game.valid_cards) { - gen_action_card(card) - gen_action('ops') - } - } else { - view.prompt = 'Communist has no red events. Play Goodbye Lenin for operations.' - gen_action('ops') - } - }, - card(card) { - push_undo() - log(`Chose to play C${card} for the event`) - let card_index = game.communist_hand.indexOf(card) - game.communist_hand.splice(card_index, 1) - game.vm_event = card - game.view_opp_hand = false - goto_vm(card) - }, - ops() { - push_undo() - 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' - } -} - -states.vm_goodbye_lenin_ops = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt() { - view.prompt = `Play ${clean_name(cards[this_card()].name)} for:` - gen_action('influence') - gen_action('support_check') - if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 )) { - gen_action('tst') - } - }, - influence(){ - push_undo() - game.vm_available_ops = get_card_ops(this_card()) - /*if (game.persistent_events.includes(50)) { - log(`+1 from C50`) - game.vm_available_ops++ - }*/ - valid_spaces_infl() - - // If ABHR - Set AHBR tracker to true - if (game.persistent_events.includes(58)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state = 'vm_add_infl' - }, - support_check() { - push_undo() - game.vm_available_ops = 2 - game.state = 'vm_support_check_prep' - valid_spaces_sc() - }, - tst() { - push_undo() - game.state = 'vm_tiananmen_square_attempt' - } -} - -states.vm_honecker = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_cards.length === 0 && game.temp === 0) { - view.prompt = 'Honecker: no valid cards to choose.' - gen_action('pass') - } else - if (game.temp === 0) {view.prompt = 'Honecker: choose a card to add to your hand.' - for (let card of game.valid_cards) { - gen_action_card(card) - gen_action('pass') - } - } /*else { - view.prompt = 'Honecker. Choose a card: done.' - gen_action('done') - }*/ - }, - card(card) { - push_undo() - game.valid_cards = [] - log(`Took C${cards[card].number} into hand`) - game.temp = card - let card_index = game.strategy_discard.indexOf(card) - game.strategy_discard.splice(card_index, 1) - game.communist_hand.push(card) - vm_next() - }, - pass(){ - log('Did not take a card') - game.discard = false - vm_next() - }, - /*done(){ - if (game.temp === 0) { - log('Did not take a card') - } - game.discard = false - vm_next() - } */ - -} - -states.vm_inflationary_currency = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if ((game.active === COM && game.revolutions.every(n => n === false)) || (game.active === DEM && game.revolutions.every(n => n === true))) { - view.prompt = 'Inflationary Currency: no countries to choose.' - gen_action('pass') - } else { - view.prompt = 'Inflationary Currency: choose a country where your opponent has power.' - if (game.active === DEM) { - if (!game.revolutions[0]) {gen_action('poland')} - if (!game.revolutions[1]) {gen_action('hungary')} - if (!game.revolutions[2]) {gen_action('east_germany')} - if (!game.revolutions[3]) {gen_action('bulgaria')} - if (!game.revolutions[4]) {gen_action('czechoslovakia')} - if (!game.revolutions[5]) {gen_action('romania')} - } else { - if (game.revolutions[0]) {gen_action('poland')} - if (game.revolutions[1]) {gen_action('hungary')} - if (game.revolutions[2]) {gen_action('east_germany')} - if (game.revolutions[3]) {gen_action('bulgaria')} - if (game.revolutions[4]) {gen_action('czechoslovakia')} - if (game.revolutions[5]) {gen_action('romania')} - } - } - }, - east_germany() { - push_undo() - game.vm_active_country = 'East_Germany' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - poland() { - push_undo() - game.vm_active_country = 'Poland' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - czechoslovakia() { - push_undo() - game.vm_active_country = 'Czechoslovakia' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - hungary() { - push_undo() - game.vm_active_country = 'Hungary' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - romania() { - push_undo() - game.vm_active_country = 'Romania' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - bulgaria () { - push_undo() - game.vm_active_country = 'Bulgaria' - log(`Chose ${country_name(game.vm_active_country)}`) - vm_next() - }, - pass() { - log('Passed') - vm_return() - } -} - -states.vm_inflationary_currency_discard = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_cards.length === 0 ) { - view.prompt = 'Inflationary Currency: no valid cards to discard. You must pass.' - gen_action('pass') - } else if (game.temp === 0 ) { - view.prompt = 'Inflationary Currency: you may discard a 3 op or higher value card to cancel the support check.' - gen_action('pass') - for (let card of game.valid_cards) { - gen_action_card(card) - } - } /*else { - view.prompt = 'Inflationary Currency. Discard a card: done.' - gen_action('done') - } */ - }, - card(card) { - push_undo() - discard(card) - game.temp = card - if (!game.vm_infl_to_do) { - if(game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - vm_next() - }, - pass() { - push_undo() - log('Did not discard') - next_player() - game.vm_available_ops = 1 - vm_next() - //game.state = 'vm_support_check_prep' - }, - done() { - if (!game.vm_infl_to_do) { - if(game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - vm_next() - } -} - - -states.vm_kiss_of_death = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.communist_hand.length === 0) { - view.prompt = 'Kiss of Death. No cards to discard.' - gen_action('pass') - } else { - view.prompt = 'Kiss of Death: you must randomly discard a card.' - gen_action('discard') - } - }, - discard() { - 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) { - next_player() - game.state = 'vm_kiss_of_death_finish' - } else { - log('Event does not occur') - vm_next() - } - }, - pass() { - log('No card to discard') - vm_next() - } -} - -states.vm_kiss_of_death_finish = { - get inactive() { - 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')) { - view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.` - console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard) - gen_action('event') - } else { - view.prompt = 'Event does not occur.' - gen_action('done') - } - }, - event() { - //game.return = game.active - // Remove game.vm_event from the discard - //game.strategy_discard = game.strategy_discard.filter(n => n !== game.vm_event) - - goto_vm(game.vm_event) - }, - done() { - vm_next() - } -} - -states.vm_kremlin_coup_choose_country = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt() { - if (game.temp.length > 0) { - view.prompt = 'Kremlin Coup! Select a country where the Communist retains power.' - for (let country of countries) { - if (game.temp.includes(country)) { - gen_action(`${country.toLowerCase()}`) - } - } - } else { - view.prompt = 'Kremlin Coup! There are no countries where the Communist retains power.' - gen_action('done') - } - }, - east_germany() { - push_undo() - game.vm_active_country = 'East_Germany' - game.temp = game.temp.filter(country => country !== game.vm_active_country) - log(`${country_name(game.vm_active_country)}:`) - vm_kremlin_coup_elite() - }, - poland() { - push_undo() - game.vm_active_country = 'Poland' - log(`${country_name(game.vm_active_country)}:`) - game.temp = game.temp.filter(country => country !== game.vm_active_country) - vm_kremlin_coup_elite() - }, - czechoslovakia() { - push_undo() - game.vm_active_country = 'Czechoslovakia' - log(`${country_name(game.vm_active_country)}:`) - game.temp = game.temp.filter(country => country !== game.vm_active_country) - vm_kremlin_coup_elite() - }, - hungary() { - push_undo() - game.vm_active_country = 'Hungary' - log(`${country_name(game.vm_active_country)}:`) - game.temp = game.temp.filter(country => country !== game.vm_active_country) - vm_kremlin_coup_elite() - }, - romania() { - push_undo() - game.vm_active_country = 'Romania' - log(`${country_name(game.vm_active_country)}:`) - game.temp = game.temp.filter(country => country !== game.vm_active_country) - vm_kremlin_coup_elite() - }, - bulgaria () { - push_undo() - game.vm_active_country = 'Bulgaria' - log(`${country_name(game.vm_active_country)}:`) - game.temp = game.temp.filter(country => country !== game.vm_active_country) - vm_kremlin_coup_elite() - }, - done() { - game.temp = 0 - vm_next() - } -} - -states.vm_kremlin_coup_take_control = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_spaces.includes(game.systematization)) { - view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space no longer exists.` - gen_action('done') - } - else if (game.valid_spaces.length === 0){ - view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space is already controlled.` - gen_action('done') - } else { - view.prompt = `Kremlin Coup! Take control of the Elite space in ${country_name(game.vm_active_country)}.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } - }, - infl(space) { - push_undo() - vm_take_control(space) - if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} - game.state = 'vm_kremlin_coup_sc_prep' - }, - done() { - push_undo() - if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} - game.state = 'vm_kremlin_coup_sc_prep' - } -} - -states.vm_kremlin_coup_sc_prep = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` - gen_action_sc(game.selected_space); - }, - sc(space) { - //game.selected_space = space - push_undo() - game.state = 'vm_kremlin_coup_sc' - } -} - -states.vm_kremlin_coup_sc = { - inactive: 'do support checks', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - if (game.temp.length > 0 ){ - game.state = 'vm_kremlin_coup_choose_country' - } else { - //game.state = 'vm_kremlin_coup_end' - vm_next() - } - } -} -/* -states.vm_kremlin_coup_end = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt() { - view.prompt = `${clean_name(cards[this_card()].name)} Support checks: done.` - gen_action('done') - }, - done() { - vm_next() - } -} -*/ -states.vm_laszlo_tokes = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = `Laszlo Tokes. Choose to:` - gen_action('influence') - gen_action('support_check') - }, - influence(){ - push_undo() - game.vm_available_ops = get_card_ops(73) - valid_spaces_infl() - game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') - game.phase = 3 - vm_next() - //game.state = 'vm_add_infl' - }, - support_check() { - push_undo() - game.vm_available_ops = 2 - //game.state = 'vm_support_check_prep' - valid_spaces_sc() - game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') - vm_next() - } -} - -states.vm_switch_infl = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_spaces.length === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: No SPs to remove.` - gen_action('pass') - } else { - /*if (game.vm_available_ops > 0 ) {*/ - view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } /*else { - view.prompt = 'Influence replaced.' - gen_action('done') - }*/ - }, - infl(space) { - push_undo() - vm_switch_infl(space) - if (game.vm_available_ops === 0) { - game.valid_spaces = [] - } - vm_next() - }, - pass() { - vm_next() - } - /*done() { - vm_next() - }*/ -} - -states.vm_malta_summit = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - /*if (game.phase === 1) {*/ - view.prompt = 'Malta Summit: roll a die.' - gen_action('roll') - /*} else { - view.prompt = 'Done.' - gen_action('done') - }*/ - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - if (game.stability > 0) { - log(`+${game.stability} from USSR Stability Track`) - log(`Modified roll: ${roll + game.stability}`) - } - if (roll + game.stability > 3) { - log('Summit successful') - game.vp += 3 - log('+3 VP') - if (check_vp()) { - return - } - if (game.comInfl[12] > 0 ) {game.valid_spaces.push(12)} - if (game.comInfl[15] > 0 ) {game.valid_spaces.push(15)} - if (game.comInfl[27] > 0 ) {game.valid_spaces.push(27)} - if (game.comInfl[43] > 0 ) {game.valid_spaces.push(43)} - if (game.comInfl[51] > 0 ) {game.valid_spaces.push(51)} - if (game.comInfl[69] > 0 ) {game.valid_spaces.push(69)} - //game.vm_available_ops = 5 - game.remove_opponent_infl = true - vm_next() - } - else { - log('Summit failed. Required 4 or more') - //game.phase++ - vm_goto_step(vm_permanently_remove) - } - }, - /*done() { - vm_next() - }*/ -} - -states.vm_modrow = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = `Modrow: roll a die.` - gen_action('roll') - }, - roll(){ - clear_undo() - 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(`Success. More than the ${dem_spaces} Democratically controlled spaces`) - vm_next() - } else { - log(`Roll: D${roll}`) - log(`Fail. More than ${dem_spaces} required`) - permanently_remove(83) - vm_return() - } - } -} - -states.vm_nepotism = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - //if (game.phase === 1 ) { - view.prompt = 'Nepotism: roll a die.' - gen_action('roll') - /*} else { - view.prompt = 'Roll a die: done.' - gen_action('done') - }*/ - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - if (roll < 3) { - log(`Roll: D${roll} adds 4 SPs`) - game.vm_available_ops = 4} - else if (roll < 5 ) { - log(`Roll: D${roll} adds 3 SPs`) - game.vm_available_ops = 3} - else { - log(`Roll: D${roll} adds 1 SP`) - game.vm_available_ops = 1} - //game.phase = 2 - vm_next() - }, - /*done() { - vm_next() - }*/ -} - -states.vm_new_years_eve_party = { - get inactive() { - return `resolve ${clean_name(cards[104].name)}.` - }, - prompt() { - view.prompt = 'Choose whether the game ends at the end of this turn.' - gen_action('end') - gen_action('continue') - }, - end() { - push_undo() - game.persistent_events.push(104) - log('Chooses to end the game. There will be no final scoring') - let power = game.revolutions.filter(value => value === false).length - if (power > 3) { - log(`Communist holds power in ${power} countries. -3 VP`) - game.vp -= 3 - } else { - log(`Communist holds power in ${power} countries. +3 VP`) - game.vp += 3 - } - if (check_vp()) { - return - } - //game.table_cards.push(104) - permanently_remove(104) - vm_next() - }, - continue() { - push_undo() - log('Chooses to continue') - permanently_remove(104) - vm_next() - } -} - -states.vm_nomenklatura = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = 'Nomenklatura: choose to remove all Democratic SPs from Elite spaces or add 3 SPs to any Elite space(s).' - gen_action('remove') - gen_action('add') - }, - remove() { - push_undo() - game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - - if (space.socio === 1 && game.demInfl[i] > 0) { - game.valid_spaces.push(space.space_id) - } - } - game.vm_available_ops = game.valid_spaces.length - game.remove_opponent_infl = true - game.state = 'vm_nomenklatura_remove' - }, - add() { - push_undo() - game.valid_spaces = [] - for (let space of spaces) { - if (!space) continue - if (space.socio === 1) { - game.valid_spaces.push(space.space_id) - } - } - check_systematization() - game.vm_available_ops = 3 - game.state = 'vm_nomenklatura_add' - } -} - -states.vm_nomenklatura_remove = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_spaces.length === 0 ) { - view.prompt = 'Nomenklatura. No SPs to remove: pass.' - gen_action('pass') - } else { - view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } - }, - infl(space) { - push_undo() - vm_do_remove_all_infl(space) - if (game.valid_spaces.length === 0) { - vm_next() - } - }, - pass() { - push_undo() - vm_next() - } -} - -states.vm_nomenklatura_add = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - 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.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - //} - }, - infl(space) { - push_undo() - vm_do_add_infl_free(space) - if (game.vm_available_ops === 0 ) { - game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } - }, -/* done() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }*/ -} - -states.vm_samizdat = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = 'Samizdat: you may set aside a card from your hand and draw a replacement.' - for (let card of game.democrat_hand) { - gen_action_card(card) - } - gen_action('pass') - }, - card(card) { - push_undo() - game.samizdat_card = card - game.democrat_hand = game.democrat_hand.filter(c => c !== card) - log('Set aside a card') - game.state = 'vm_samizdat_finish' - }, - pass() { - push_undo() - //if (game.samizdat_card > 0) {game.state = 'vm_samizdat_finish'} - /*else { */ - log('Did not set aside a card') - vm_next() - //} - } -} - -states.vm_samizdat_finish = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - /*if (game.phase ) { - view.prompt = 'Samizdat: done.' - gen_action('done') - } else {*/ - view.prompt = 'Draw a replacement card.' - gen_action('draw') - //} - }, - draw() { - clear_undo() - game.democrat_hand.push(draw_card(game.strategy_deck)) - vm_next() - //game.phase ++ - }, - /*done() { - vm_next() - }*/ -} - -states.vm_shock_therapy = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.revolutions.every(n => n === false)) { - view.prompt = 'Shock Therapy: no countries to choose.' - gen_action('pass') - } else { - if (game.vm_active_country === '' ) { - view.prompt = 'Shock Therapy: choose 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')} - if (game.revolutions[3]) {gen_action('bulgaria')} - if (game.revolutions[4]) {gen_action('czechoslovakia')} - if (game.revolutions[5]) {gen_action('romania')} - } /*else if (game.phase === 2) { - view.prompt = 'Shock Therapy: done.' - gen_action('done') - } */ - else { - view.prompt = 'Shock Therapy: roll a die.' - gen_action('roll') - } - } - }, - east_germany() { - push_undo() - game.vm_active_country = 'East_Germany' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - poland() { - push_undo() - game.vm_active_country = 'Poland' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - czechoslovakia() { - push_undo() - game.vm_active_country = 'Czechoslovakia' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - hungary() { - push_undo() - game.vm_active_country = 'Hungary' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - romania() { - push_undo() - game.vm_active_country = 'Romania' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - bulgaria () { - push_undo() - game.vm_active_country = 'Bulgaria' - log(`Chose ${country_name(game.vm_active_country)}`) - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - let worker_farmer = 0 - for (let space of spaces) { - if (space && space.country === game.vm_active_country && check_com_control(space.space_id) && (space.socio === 3 || space.socio === 4)) { - worker_farmer++ - } - } - 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) { - log('C93 is successful. +3 VP') - vm_next() - } else { - log('C93 is unsuccessful. Required 3 or more') - //game.phase++ - permanently_remove(93) - vm_return() - } - }, - pass() { - log('Passed') - vm_return() - } - /*done() { - permanently_remove(93) - vm_return() - }*/ -} - -states.vm_social_democratic_platform_adopted = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.revolutions.every(n => n === false)) { - view.prompt = 'Social Democratic Platform Adopted: no countries to choose.' - gen_action('pass') - } else { - view.prompt = 'Select a country where the Democrat holds Power.' - if (game.revolutions[0]) {gen_action('poland')} - if (game.revolutions[1]) {gen_action('hungary')} - if (game.revolutions[2]) {gen_action('east_germany')} - if (game.revolutions[3]) {gen_action('bulgaria')} - if (game.revolutions[4]) {gen_action('czechoslovakia')} - if (game.revolutions[5]) {gen_action('romania')} - } - }, - east_germany() { - push_undo() - game.vm_active_country = 'East_Germany' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next() - }, - poland() { - push_undo() - game.vm_active_country = 'Poland' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, - czechoslovakia() { - push_undo() - game.vm_active_country = 'Czechoslovakia' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, - hungary() { - push_undo() - game.vm_active_country = 'Hungary' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next() - }, - romania() { - push_undo() - game.vm_active_country = 'Romania' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next() - }, - bulgaria () { - push_undo() - game.vm_active_country = 'Bulgaria' - log(`Selected ${country_name(game.vm_active_country)}`) - vm_next() - }, - pass() { - log('Passed') - vm_return() - } -} - -states.vm_systematization = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - /*if (game.systematization === 0) { */ - view.prompt = 'Systematization: eliminate a space in Romania.' - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - /*} else { - view.prompt = 'Systematization: done.' - gen_action('done') - }*/ - }, - infl(space) { - push_undo() - vm_eliminate(space) - game.valid_spaces = [] - game.systematization = space - game.persistent_events.push(69) - vm_next() - }, -/* done() { - vm_next() - } */ -} - -states.vm_the_chinese_solution = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - 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')} - if (!game.revolutions[3]) {gen_action('bulgaria')} - if (!game.revolutions[4]) {gen_action('czechoslovakia')} - if (!game.revolutions[5]) {gen_action('romania')} - gen_action('pass') - }, - east_germany() { - push_undo() - game.vm_active_country = 'East_Germany' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - poland() { - push_undo() - game.vm_active_country = 'Poland' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - czechoslovakia() { - push_undo() - game.vm_active_country = 'Czechoslovakia' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - hungary() { - push_undo() - game.vm_active_country = 'Hungary' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - romania() { - push_undo() - game.vm_active_country = 'Romania' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - bulgaria () { - push_undo() - game.vm_active_country = 'Bulgaria' - log(`Chose ${country_name(game.vm_active_country)}`) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - vm_next() - }, - pass() { - push_undo() - permanently_remove(96) - vm_return() - } -} - -states.vm_the_tyrant_is_gone = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (!game.the_tyrant_is_gone) { - view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' - for (let space_id of game.valid_spaces) { - if (!space_id) continue - gen_action_infl(space_id); - } - } else { - view.prompt = 'The Tyrant is Gone: done.' - gen_action('done') - } - }, - infl(space) { - push_undo() - log(`The Ceausescus flee to %${space}`) - game.the_tyrant_is_gone = space - game.valid_spaces = [] - game.persistent_events.push(97) - - // vm_next() - }, - done () { - vm_next() - } -} -/* -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!" Rolls: done.' - gen_action('done') - } else { */ - view.prompt = ('The Wall Must Go! Roll a die.') - gen_action('roll') - //} - }, - roll() { - clear_undo() - let attempt = game.the_wall_must_go['dem_wins'] + game.the_wall_must_go['com_wins'] - if (game.the_wall_must_go['dem_roll'] === 0 && game.the_wall_must_go['com_roll'] === 0) { - log_h3(`Round ${attempt+1}`) - } - - let roll = Math.floor(Math.random() * 6) + 1 - 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) { - log(`+${controlled_spaces} from controlled spaces in East Germany`) - log(`Modified roll: ${roll + controlled_spaces}`) - roll += controlled_spaces - } - game.the_wall_must_go['dem_roll'] = roll - } else { - let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_com_control(space.space_id)).length - if (controlled_spaces > 0) { - log(`+${controlled_spaces} from controlled spaces in East Germany`) - log(`Modified roll: ${roll + controlled_spaces}`) - roll += controlled_spaces - } - game.the_wall_must_go['com_roll'] = roll - - } - if (game.the_wall_must_go['dem_roll'] > 0 && game.the_wall_must_go['com_roll'] > 0) { - if (game.the_wall_must_go['dem_roll'] > game.the_wall_must_go['com_roll'] ) { - log('Democrat wins') - game.the_wall_must_go['dem_wins']++ - } else if (game.the_wall_must_go['dem_roll'] === game.the_wall_must_go['com_roll'] ) { - log('Tie. Re-roll') - } else { - log('Communist wins') - game.the_wall_must_go['com_wins']++ - } - - log(`Democrat: ${game.the_wall_must_go['dem_wins']}, Communist: ${game.the_wall_must_go['com_wins']}`) - } - if (game.the_wall_must_go['dem_wins'] === 2) { - log('The Democrat wins C86') - finish_the_wall() - return - } - if (game.the_wall_must_go['com_wins'] === 2) { - log('The Communist wins C86') - finish_the_wall() - return - } - if (game.the_wall_must_go['dem_roll'] === 0 || game.the_wall_must_go['com_roll'] === 0) { - next_player() - } else { - game.the_wall_must_go['dem_roll'] = 0 - game.the_wall_must_go['com_roll'] = 0 - } - }, - /*done() { - if (game.the_wall_must_go['dem_wins'] === 2) { - game.persistent_events.push(86) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (space.country === 'East_Germany' && game.comInfl[i] > 0){ - game.valid_spaces.push(space.space_id) - } - } - if (!game.vm_infl_to_do) { - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - if (game.active === DEM) {next_player()} - vm_next () - } else { - permanently_remove(86) - delete game.the_wall_must_go - vm_return() - } - }*/ -} - -states.vm_warsaw_pact_summit = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - view.prompt = 'Choose to play for support checks or place SPs.' - gen_action('influence') - gen_action('support_check') - }, - influence(){ - push_undo() - for (let i = 1; i < spaces.length; i++) { - let space = spaces[i] - if (game.demInfl[i] === 0) { - game.valid_spaces.push(space.space_id); - } - } - game.vm_available_ops = 4 - game.phase = 3 - //game.state = 'vm_add_infl' - vm_next() - }, - support_check(){ - push_undo() - for (let i = 1; 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) - } - } - game.vm_available_ops = 2 - //game.state = 'vm_support_check_prep' - vm_next() - } -} - -states.vm_we_are_the_people_remove = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - 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 ) { - view.prompt = '"We are the People!": remove up to 4 SPs from the Lutherian Church.' - gen_action('done') - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - } else { - view.prompt = '"We are the People!" Remove SPs: done.' - gen_action('done') - } - }, - infl(space) { - vm_do_remove_infl(space) - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - if (!game.vm_influence_added[6]) { - log('No SPs removed') - vm_next() - } else { - game.valid_spaces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - game.state = 'vm_we_are_the_people_add' - } - } -} -states.vm_we_are_the_people_add = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - /* if (!game.vm_influence_added[6]) { - view.prompt = '"We are the People!" Add SPs: done.' - gen_action('done') - return - }*/ - - view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - vm_do_add_infl_free(space) - game.vm_influence_added[6]-- - if (game.vm_influence_added[6] === 0 ) { - game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } - }, - /*done() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }*/ -} - -states.vm_workers_revolt = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - if (game.valid_spaces.length === 0 ) { - view.prompt = 'Workers Revolt: no valid spaces to select.' - gen_action('pass') - return - } - view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.' - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) - } - }, - pass() { - push_undo() - vm_next() - }, - infl(space) { - push_undo() - game.selected_space = space - log(`Chose %${game.selected_space}`) - game.state = 'vm_workers_revolt_finish' - } -} - - -states.vm_workers_revolt_finish = { - get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` - }, - prompt() { - //if (game.selected_space > 0) { - view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - /* } else { - view.prompt = 'Workers Revolt: done.' - gen_action('done') - }*/ - - }, - roll() { - clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) - let adj = count_adj(game.selected_space) - if (game.active === DEM) { - log(`-${adj.com_adj} from opponent controlled spaces`) - roll -= adj.com_adj - } else { - log(`-${adj.dem_adj} from opponent controlled spaces`) - roll -= adj.dem_adj - } - log(`Modified roll: ${roll}`) - if (roll >= 4) { - log('Workers Revolt successful') - vm_replace_all_infl(game.temp) - } else {log('Workers Revolt fails. Required 4 or more')} - game.selected_space = 0 - vm_next() - }, - /*done() { - vm_next() - }*/ -} - -// ==================== TIANANMEN SQUARE TRACK STATES ===================== - -states.vm_tst_3_prep = { - inactive: 'resolve Tiananmen Square Track award.', - prompt() { - view.prompt = 'Tiananmen Square Track award: draw 3 cards.' - gen_action('draw') - }, - draw() { - if (game.active === DEM) { - game.temp = game.democrat_hand.length - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length + 3, game.communist_hand.length) - game.valid_cards = [game.democrat_hand[game.temp], game.democrat_hand[game.temp + 1], game.democrat_hand[game.temp + 2]] - } else { - game.temp = game.communist_hand.length - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length + 3) - game.valid_cards = [game.communist_hand[game.temp], game.communist_hand[game.temp + 1], game.communist_hand[game.temp + 2]] - } - game.temp = 0 - game.state = 'vm_tst_3' - } -} - -states.vm_tst_3 = { - inactive: 'resolve Tiananmen Square Track bonus.', - prompt() { - if (game.temp < 2) { - view.prompt = `Discard 2 of the drawn cards.` - for (let card of game.valid_cards) { - gen_action_card(card) - } - } /*else { - view.prompt = 'Discard cards: done.' - gen_action('done') - }*/ - }, - card(card) { - push_undo() - discard(card) - game.temp ++ - if (game.temp === 2) { - game.valid_cards = [] - vm_next() - } - }, - /*done() { - vm_next() - }*/ -} - -states.vm_tst_4 = { - inactive: 'remove SPs', - prompt () { - if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { - view.prompt = 'Tiananmen Square Track award. Remove SPs: done.' - gen_action('done') - return - } - view.prompt = `Tiananmen Square Track award: remove ${pluralize(game.vm_available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - vm_do_remove_infl(space) - if (game.vm_available_ops === 0) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } -} - -states.vm_tst_6 = { - inactive: 'make their free support check.', - prompt() { - /* if (game.vm_available_ops === 0) { - view.prompt = 'Tiananmen Square Track award support check: done.' - gen_action('done') - return - } else {*/ - view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' - for (let space_id of game.valid_spaces) { - if (space_id) { - gen_action_sc(space_id); - } - } - //} - }, - sc(space) { - push_undo() - game.selected_space = space - if (game.active === DEM && game.persistent_events.includes(58) && spaces[space].country === "East_Germany") { - game.austria_hungary_border_reopened_tracker = true - } - game.state = 'vm_tst_6_sc' - }, - /*done () { - push_undo() - vm_next() - }*/ -} - -states.vm_tst_6_sc = { - inactive: 'do support check.', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.vm_available_ops-- - game.valid_spaces = [] - game.state = 'vm_tst_6' - vm_next() - return - } -} - -states.vm_tst_8 = { - inactive: 'use Tiananmen Square Track award.', - prompt() { - if (game.vm_event_to_do && game.vm_infl_to_do) { - view.prompt = 'Choose whether to play for event or operations first.' - gen_action('event') - gen_action('ops') - } - else if (!game.vm_event_to_do && game.vm_infl_to_do) { - view.prompt = 'Event resolved. Use card for operations.' - gen_action('ops') - } - else if (game.vm_event_to_do && !game.vm_infl_to_do) { - view.prompt = 'Operations resolved. Use card for event.' - gen_action('event') - } - else if (!game.vm_event_to_do && !game.vm_infl_to_do) { - view.prompt = 'Event and operations: done.' - gen_action('end_round') - } - }, - event() { - push_undo() - log('Event') - game.vm_event_to_do = false - game.return_state = 'vm_tst_8' - game.return = game.active - game.vm_event = game.played_card - goto_vm(game.vm_event) - }, - ops() { - push_undo() - log('Operations') - game.vm_infl_to_do = false - game.return = game.active - game.return_state = 'vm_tst_8' - goto_vm(208) - }, - end_round() { - push_undo() - game.tst_8 = true - end_round() - } -} - - -states.vm_tst_8_ops = { - inactive: 'play card for operations.', - prompt() { - view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` - gen_action('influence') - gen_action('support_check') - if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 )) { - gen_action('tst') - } - }, - influence(){ - push_undo() - 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)) { - game.austria_hungary_border_reopened_tracker = true - } - game.state = 'vm_add_infl' - }, - support_check() { - push_undo() - game.vm_available_ops = 2 - game.state = 'vm_support_check_prep' - }, - tst() { - push_undo() - game.state = 'vm_tiananmen_square_attempt' - } -} - -// ========================= POWER STRUGGLE STATES ======================== - -states.vm_scare_tactics = { - inactive: 'remove a Support Point.', - prompt () { - if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` - gen_action('done') - return - } - if (game.vm_available_ops === 0 ) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); - } - }, - infl(space) { - push_undo() - vm_do_remove_infl(space) - }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - } -} - -states.vm_support_surges_1 = { - inactive: 'draw cards.', - prompt() { - view.prompt = 'Support Surges: draw a 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 after', game.dem_pwr_hand, 'game.temp', game.temp) - } else { - //console.log('hand before', game.com_pwr_hand) - 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.com_pwr_hand[game.com_pwr_hand.length-1] - //console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) - } - 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() { - let special = [49,50,51,52] - let elite_leader = [37,38,39,40] - if (special.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)) { - view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Draw a second card.` - } - else 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) { - 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] - } 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.com_pwr_hand[game.com_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 ${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() - } -} - -states.vm_support_falters = { - inactive: 'discard cards.', - prompt() { - if ((game.active === DEM && game.dem_pwr_hand.length === 0) || (game.active === COM && game.com_pwr_hand.length === 0)) { - view.prompt = 'Support Falters: no remaining cards to discard.' - gen_action('pass') - } else if (game.vm_available_ops > 0) { - view.prompt = 'Support Falters: discard a card.' - gen_action('discard') - } else { - view.prompt = 'Support Falters: done.' - gen_action('done') - } - }, - discard() { - if (game.active === DEM) {discard_card(game.dem_pwr_hand)} - else {discard_card(game.com_pwr_hand)} - game.vm_available_ops -- - }, - pass() { - log_msg_gap('Takes initiative') - game.return = game.active - vm_next() - }, - done() { - log_gap('Takes initiative') - game.return = game.active - vm_next() - } -} - -/* =================== EVENTS ================================ */ - -// #region GENERATED EVENT CODE -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_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_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_return ], -] - -CODE[4] = [ // Michnik - [ vm_permanently_remove ], - [ vm_valid_spaces, 26 ], - [ vm_prompt, 'the Polish Intellectuals space' ], - [ vm_add_x_infl, 3 ], - [ vm_return ], -] - -CODE[5] = [ // General strike - [ vm_general_strike ], - [ vm_return ], -] - -CODE[6] = [ // Brought in for Questioning - [ vm_brought_in_for_questioning ], - [ vm_return ], -] - -CODE[7] = [ // State Run Media* - [ vm_permanently_remove ], - [ vm_valid_spaces_opponent ], - [ vm_remove_limited_opp_infl, 4, 2 ], - [ vm_return ], -] - -CODE[8] = [ // Prudence - [ vm_prudence ], - [ vm_return ], -] - -CODE[9] = [ // 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_return ], -] - -CODE[11] = [ // Dissident arrested - [ vm_valid_spaces_opponent_socio, 5 ], - [ vm_prompt, 'any Intellectuals space' ], - [ vm_remove_x_opp_infl, 2 ], - [ vm_return ], -] - -CODE[12] = [ // Apparatchicks - [ vm_permanently_remove ], - [ vm_valid_spaces_socio, 2 ], - [ vm_prompt, ' to any Bureaucratic space(s)' ], - [ vm_add_infl_free, 3 ], - [ vm_return ], -] - -CODE[13] = [ // Stasi - [ vm_permanently_remove ], - [ vm_stasi ], - [ vm_return ], -] - -CODE[14] = [ // Gorbachev Charms the West - [ vm_valid_spaces_opponent ], - [ vm_remove_opp_infl, 2 ], - [ vm_valid_spaces_sc ], - [ vm_prompt, 'select a space for the Support Check' ], - [ vm_1_support_check ], - [ vm_return ], -] - -CODE[15] = [ // Honecker - [ vm_permanently_remove ], - [ vm_honecker ], - [ vm_return ], -] - -CODE[16] = [ // Nomenklatura* - [ vm_permanently_remove ], - [ vm_nomenklatura ], - [ vm_return ], -] - -CODE[17] = [ // Roundtable talks - [ vm_roundtable_talks ], - [ vm_return ], -] - -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_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_return ], -] - -CODE[20] = [ // Deutsche Marks* - [ vm_permanently_remove ], - [ vm_deutsche_marks ], - [ vm_return ], -] - -CODE[21] = [ // Common European Home - [ vm_common_european_home ], - [ vm_return ], -] - -CODE[22] = [ // Power Struggle - Poland - [ vm_power_struggle ], - [ vm_return ], -] - -CODE[23] = [ // Power Struggle - Hungary - [ vm_power_struggle ], - [ vm_return ], -] - -CODE[24] = [ // St Nicolas Church - [ vm_permanently_remove ], - [ vm_valid_spaces, 6 ], - [ vm_prompt, 'the Lutheran Church' ], - [ vm_take_control_prep, 1 ], - [ vm_st_nicholas_church ], - [ vm_return ], -] - -CODE[25] = [ // Perestroika - [ vm_permanently_remove ], - [ vm_perestroika ], - [ vm_return ], -] - -CODE[26] = [ // Helsinki Final Act* - [ vm_permanently_remove ], - [ vm_helsinki_final_act ], - [ vm_return ], -] - -CODE[27] = [ // Consumerism - [ vm_valid_spaces_opponent_socio, 4 ], - [ vm_prompt, ' from a Worker space' ], - [ vm_remove_opp_infl, 1 ], - [ vm_valid_spaces_opponent_socio, 4 ], - [ vm_active_country ], - [ vm_prompt, ()=>`make a support check in a Worker space in ${country_name(game.vm_active_country)}` ], - [ vm_1_support_check ], - [ vm_return ], -] - -CODE[28] = [ // Factory Party Cells - [ vm_valid_spaces_opponent_socio, 4 ], - [ vm_prompt, ' from Worker spaces' ], - [ vm_remove_limited_opp_infl, 3, 2 ], - [ vm_return ], -] - -CODE[29] = [ // Jan Palach Week* - [ vm_permanently_remove ], - [ vm_valid_spaces, 30 ], - [ vm_prompt, 'the Charles University space' ], - [ vm_add_x_infl, 6 ], - [ vm_return ], -] - -CODE[30] = [ // Tear Gas - [ vm_tear_gas ], - [ vm_return ], -] - -CODE[31] = [ // Intelligentsia - [ vm_valid_spaces, 4, 26, 31, 46, 55, 73 ], - [ vm_prompt, 'Intellectual spaces, no more than 2 per space' ], - [ vm_add_limited_infl, 4, 2 ], - [ vm_return ], -] - -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_return ], -] - -CODE[33] = [ // Sajudis* - [ vm_permanently_remove ], - [ vm_sajudis_check ], - [ vm_prompt, 'any Minorities space' ], - [ vm_take_control_prep, 1 ], - [ vm_sajudis ], - [ vm_return ], -] - -CODE[34] = [ // Fidesz* - [ vm_permanently_remove ], - [ vm_valid_spaces, 47 ], - [ vm_prompt, 'the Hungary students space' ], - [ vm_add_x_infl, 5 ], - [ vm_return ], -] - -CODE[35] = [ // Heal our Bleeding Wounds* - [ vm_permanently_remove ], - [ vm_heal_our_bleeding_wounds ], - [ vm_return ], -] - -CODE[36] = [ // Dash for the West* - [ vm_permanently_remove ], - [ vm_prompt, 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' ], - [ vm_dash_for_the_west ], - [ vm_return ], -] - -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_return ], -] - -CODE[38] = [ // July Concept - [ vm_permanently_remove ], - [ vm_valid_spaces_country, 'Bulgaria' ], - [ vm_prompt, 'Bulgaria' ], - [ vm_add_infl_free, 3 ], - [ vm_return ], -] - -CODE[39] = [ // Eco-Glasnost* - [ vm_permanently_remove ], - [ vm_valid_spaces, 66 ], - [ vm_prompt, 'Ruse' ], - [ vm_add_x_infl, 4 ], - [ vm_eco_glasnost ], - [ vm_return ], -] - -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_return ], -] - -CODE[41] = [ // Ceausescu* - [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], - [ vm_valid_spaces_country_opp, 'Romania' ], - [ vm_prompt, ' from Romania' ], - [ vm_remove_opp_infl, 3 ], - [ vm_valid_spaces_country_sc, 'Romania' ], - [ vm_prompt, 'make a support check in Romania' ], - [ vm_1_support_check ], - [ vm_prompt, ' from Bucharesti' ], - [ vm_ceausescu ], - [ vm_else ], - [ vm_tyrant_block ], - [ vm_endif ], - [ vm_return ], -] - -CODE[42] = [ // Power Struggle - East Germany - [ vm_power_struggle ], - [ vm_return ], -] - -CODE[43] = [ // Power Struggle - Bulgaria - [ vm_power_struggle ], - [ vm_return ], -] - -CODE[44] = [ // Inflationary Currency - [ vm_permanently_remove ], - [ vm_inflationary_currency ], - [ vm_valid_spaces_country_opp ], - [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], - [ vm_remove_opp_infl, 2 ], - [ vm_inflationary_currency_discard ], - [ vm_if, ()=>!discarded_card() ], - [ vm_valid_spaces_country_sc ], - [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], - [ vm_1_support_check ], - [ vm_endif ], - [ 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_return ], -] - -CODE[46] = [ // 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_return ], -] - -CODE[48] = [ // We are the People!* - [ vm_permanently_remove ], - [ vm_we_are_the_people ], - [ vm_return ], -] - -CODE[49] = [ // Foreign Currency Debt Burden* - [ vm_permanently_remove ], - [ vm_foreign_currency_debt_burden ], - [ vm_return ], -] - -CODE[50] = [ // 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_return ], -] - -CODE[52] = [ // Normalisation - [ vm_permanently_remove ], - [ vm_normalisation ], - [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], - [ vm_remove_all_infl, 2 ], - [ vm_return ], -] - -CODE[53] = [ // Li Peng* - [ vm_permanently_remove ], - [ vm_li_peng ], - [ vm_return ], -] - -CODE[54] = [ // The Crowd Turns Against Ceausescu* - [ vm_the_crowd_turns_against_ceausescu ], - [ vm_return ], -] - -CODE[55] = [ // Power Struggle - Czechoslovakia - [ vm_power_struggle ], - [ vm_return ], -] - -CODE[56] = [ // Foreign Television - [ vm_permanently_remove ], - [ vm_foreign_television ], - [ vm_remove_limited_opp_infl, 4, 2 ], - [ 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_return ], -] - -CODE[58] = [ // Austria-Hungary Border Reopened* - [ vm_austria_hungary_border_reopened ], - [ vm_return ], -] - -CODE[59] = [ // GrenzTruppen* - [ vm_grenztruppen ], - [ vm_return ], -] - -CODE[60] = [ // Toxic Waste* - [ vm_permanently_remove ], - [ vm_valid_spaces_socio, 4 ], - [ vm_prompt, 'any Worker space(s)' ], - [ vm_add_infl_free, 3 ], - [ 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_return ], -] - -CODE[62] = [ // Yakovlev Counsels Gorbachev* - [ vm_yakovlev_counsels_gorbachev ], - [ vm_return ], -] - -CODE[63] = [ // Genscher* - [ vm_genscher ], - [ vm_return ], -] - -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_return ], -] - -CODE[65] = [ // 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_return ], -] - -CODE[67] = [ // Reformer Rehabilitated* - [ vm_prompt, 'Reformer Rehabilitated: chose any non-scoring card in the discard pile. Event takes place immediately' ], - [ vm_reformer_rehabilitated ], - [ vm_return ], -] - -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_return ], -] - -CODE[69] = [ // Systematization* - [ vm_permanently_remove ], - [ vm_valid_spaces_country, 'Romania' ], - [ vm_systematization ], - [ vm_return ], -] - -CODE[70] = [ // Securitate* - [ vm_securitate ], - [ vm_return ], -] - -CODE[71] = [ // Kiss of Death* - [ vm_permanently_remove ], - [ vm_kiss_of_death ], - [ vm_return ], -] - -CODE[72] = [ // Peasant Parties Revolt - [ vm_peasant_parties_revolt ], - [ vm_return ], -] - -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 ], - [ vm_laszlo_tokes ], - [ vm_if, ()=>game.phase === 3 ], - [ vm_prompt, ' in Romania' ], - [ vm_add_infl ], - [ vm_else ], - [ vm_prompt, 'make 2 Support Checks in Romania' ], - [ vm_support_check, 2 ], - [ vm_endif ], - [ vm_return ], -] - -CODE[74] = [ // FRG Embassies - [ vm_frg_embassies ], - [ vm_return ], -] - -CODE[75] = [ // 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' ], - [ vm_add_infl_free, 4 ], - [ vm_else ], - [ vm_prompt, 'Select a Student or Intellectual space' ], - [ vm_valid_spaces_country_socio_2, 3,, 4 ], - [ vm_support_check_modified, 2, 2 ], - [ vm_endif ], - [ vm_return ], -] - -CODE[77] = [ // Samizdat - [ vm_permanently_remove ], - [ vm_samizdat ], - [ vm_return ], -] - -CODE[78] = [ // Workers Revolt - [ vm_workers_revolt ], - [ vm_return ], -] - -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_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_return ], -] - -CODE[81] = [ // The Baltic Way* - [ vm_permanently_remove ], - [ vm_the_baltic_way ], - [ vm_prompt, 'any Minorities space' ], - [ vm_take_control_prep, 1 ], - [ 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_return ], -] - -CODE[83] = [ // Modrow* - [ vm_permanently_remove ], - [ vm_modrow ], - [ vm_valid_spaces_country, 'East_Germany' ], - [ vm_prompt, 'East Germany, no more than 2 per space' ], - [ vm_add_limited_infl, 4, 2 ], - [ 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_return ], -] - -CODE[85] = [ // Tank Column/Tank Man* - [ 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_return ], -] - -CODE[87] = [ // 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_return ], -] - -CODE[89] = [ // 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 ], - [ vm_civic_forum ], - [ vm_valid_spaces_country_sc, 'Czechoslovakia' ], - [ vm_prompt, 'Select a space in Czechoslovakia' ], - [ vm_support_check, 2 ], - [ 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_return ], -] - -CODE[92] = [ // Betrayal - [ vm_permanently_remove ], - [ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ], - [ vm_betrayal ], - [ 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_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_return ], -] - -CODE[95] = [ // Power Struggle - Romania - [ vm_power_struggle ], - [ vm_return ], -] - -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_support_check_modified, 5, 3 ], - [ vm_return ], -] - -CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 51 ], - [ vm_prompt, 'the Romanian Elite Space' ], - [ vm_remove_x_opp_infl, 4 ], - [ vm_the_tyrant_is_gone ], - [ vm_permanently_remove ], - [ vm_else ], - [ vm_the_tyrant_is_gone_prep ], - [ vm_endif ], - [ vm_return ], -] - -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_return ], -] - -CODE[99] = [ // Ligachev* - [ vm_permanently_remove ], - [ vm_ligachev ], - [ vm_return ], -] - -CODE[100] = [ // 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_elena ], - [ vm_else ], - [ vm_tyrant_block ], - [ vm_endif ], - [ vm_return ], -] - -CODE[102] = [ // National Salvation Front* - [ vm_national_salvation_front ], - [ vm_return ], -] - -CODE[103] = [ // Government Resigns* - [ vm_government_resigns ], - [ vm_prompt, 'any uncontrolled Elite space' ], - [ vm_remove_all_infl, 1 ], - [ vm_permanently_remove ], - [ vm_return ], -] - -CODE[104] = [ // New Year's Eve Party* - [ vm_new_years_eve_party ], - [ vm_return ], -] - -CODE[105] = [ // Public Against Violence* - [ vm_permanently_remove ], - [ vm_valid_spaces, 36 ], - [ vm_prompt, 'Kosice' ], - [ vm_add_x_infl, 2 ], - [ 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_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)}` ], - [ vm_add_infl_free, 2 ], - [ vm_valid_spaces_country_sc ], - [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], - [ vm_1_support_check ], - [ 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_return ], -] - -CODE[108] = [ // Army Backs Revolution* - [ vm_permanently_remove ], - [ vm_army_backs_revolution ], - [ vm_return ], -] - -CODE[109] = [ // 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_return ], -] -// #endregion - - -// ============= TIANANMEN SQUARE TRACK AWARDS ==================== -CODE[203] = [//Tiananmen Square space 3 award - [vm_tst_3], - [vm_return] -] -CODE[204] = [//Tiananmen Square space 4 award - [vm_valid_spaces_opponent], - [vm_tst_4], - [vm_return] -] -CODE[206] = [//Tiananmen Square space 6 - [vm_valid_spaces_sc], - [vm_tst_6], - [vm_return] -] -CODE[208] = [//Tiananmen Square space 8 event - [vm_tst_8], - [vm_return] -] - -// ============= POWER STRUGGLE WILDCARDS ========================= - -CODE[349] = [//Scare Tactics - [vm_scare_tactics], - [vm_valid_spaces_country_opp], - [vm_prompt, ()=>` from ${country_name(game.vm_active_country)}`], - [vm_remove_opp_infl, 1], - [vm_return] -] -CODE[350] = [//Support Surges - [vm_support_surges], - [vm_return] -] -CODE[351] = [//Support Falters - [vm_support_falters], - [vm_return] -] +//"use strict" + +const { spaces, cards, power_cards } = require("./data.js") + +var game, view, states = {} + +const DEM = "Democrat" +const COM = "Communist" + +const first_strategy_card = 1 +const last_strategy_card = 110 + +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 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] +const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] +const elite_spaces = [12, 15, 27, 43, 51, 69] +const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] +const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] +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] + +exports.scenarios = [ "Standard" ] + +exports.roles = [ DEM, COM ] + +// --- SET UP --- + +exports.setup = function (seed, scenario, options) { + game = { + seed: seed, + log: [], + undo: [], + summary: [], + active: null, + state: "com_init", + return: '', + vm: null, + vm_event: 0, + vm_event_to_do: false, + vm_infl_to_do: false, + + played_card: 0, + table_cards: [], + available_ops: 0, + vm_available_ops: 0, + valid_spaces: [], + valid_cards: [], + + vp: 0, + turn: 0, + round: 0, + round_player: COM, + stability: 0, + dem_tst_position: 0, + com_tst_position: 0, + dem_tst_attempted: 0, + com_tst_attempted: 0, + dem_tst_attempted_this_turn: 0, + com_tst_attempted_this_turn: 0, + + demInfl: [], + comInfl: [], + + strategy_deck: [], + strategy_discard: [], + discard: false, + view_opp_hand: false, + strategy_removed: [], + persistent_events: [], + power_struggle_deck: [], + power_struggle_discard: [], + dem_hand_limit: 8, + com_hand_limit: 8, + democrat_hand: [], + communist_hand: [], + + pwr_struggle_in: [], + is_pwr_struggle: false, + dem_pwr_hand_limit: 0, + com_pwr_hand_limit: 0, + dem_pwr_hand: [], + com_pwr_hand: [], + raised_stakes_discard: 0, + raised_stakes: 0, + raised_stakes_round: 0, + phase: 0, + times_held: [0, 0, 0, 0, 0, 0], + revolutions: [false, false, false, false, false, false], + remove_opponent_infl: false, + tactics_fails: '', + } + + log_h1("1989 Dawn of Freedom") + + game.active = COM + start_game() + + return game +} + +function start_game() { + //starting influence + + // Draw cards + + //console.log('start game') + + game.strategy_deck = draw_deck(cards) + reset_power() + + //Set starting influence + spaces.forEach((space, index) => { + if (space !== null) { + game.demInfl[index] = space.demInfl + game.comInfl[index] = space.comInfl + } + }) + + //Set starting placement ops + game.starting_infl = { + com_starting_infl: 0, + dem_starting_infl: 0 + }, + + // Set variable event cards where event is playable at start of game + + game.playable_cards = [14, 15, 21, 70] + + //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) + //.log('game.strategy_deck: ', game.strategy_deck[1], 'democrat_hand:', game.democrat_hand) + + game.valid_spaces = valid_spaces_setup() + game.available_ops = 2 + game.phase = 0 + log_h1("Place starting Support Points") + log_side() +} + + +exports.view = function(state, player) { + game = state + + view = { + log: game.log, + active: game.active, + prompt: null, + actions: null, + + played_card: game.played_card, + table_cards: game.table_cards, + valid_spaces: game.valid_spaces, + valid_cards: game.valid_cards, + + demInfl: game.demInfl, + comInfl: game.comInfl, + turn: game.turn, + round: game.round, + round_player: game.round_player, + vp: game.vp, + stability: game.stability, + dem_tst: game.dem_tst_position, + com_tst: game.com_tst_position, + persistent_events: game.persistent_events, + systematization: game.systematization, + the_tyrant_is_gone: game.the_tyrant_is_gone, + + strategy_deck: game.strategy_deck.length, + strategy_removed: game.strategy_removed, + discard: game.discard, + show_opp_hand: game.view_opp_hand, + + democrat_hand: game.democrat_hand.length, + communist_hand: game.communist_hand.length, + democrat_power_hand: game.dem_pwr_hand.length, + communist_power_hand: game.com_pwr_hand.length, + ceausescu_cards: game.ceausescu_cards, + is_pwr_struggle: game.is_pwr_struggle, + times_held: game.times_held, + revolutions: game.revolutions, + + hand: [], + set_aside: [], + pwr_hand: [], + + + } + + if (game.is_pwr_struggle) { + view.strategy_discard = game.power_struggle_discard + } else { + view.strategy_discard = game.strategy_discard + } + + if (player === game.active && game.vm && game.vm.draw) + view.drawn = game.vm.draw + + if (player === game.active) { + if (game.selected_space > 0 ) { + view.valid_spaces = [game.selected_space] + } else { + view.valid_spaces = game.valid_spaces + } + } else { + view.valid_spaces = [] + } + + if (player === game.active) { + view.valid_cards = game.valid_cards + } else { + view.valid_cards = [] + } + + if (player === DEM) { + view.hand = game.democrat_hand + if (game.communist_hand_red) { + view.opp_hand = game.communist_hand_red + } + view.set_aside = game.democrat_set_aside /*Is this being used? */ + view.power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) + + } else if (player === COM) { + view.hand = game.communist_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) + } + + if (player === DEM) { + view.samizdat = game.samizdat_card + } + + if (game.state === "game_over") { + view.prompt = game.victory + } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { + if (states[game.state]) { + let inactive = states[game.state].inactive + if (typeof inactive === "function") + view.prompt = `Waiting for ${game.active} ${inactive()}` + else + view.prompt = `Waiting for ${game.active} to ${inactive}` + } else { + view.prompt = "A Unknown state: " + game.state + } + } else { + view.actions = {} + + if (states[game.state]) + states[game.state].prompt(player) + else + view.prompt = "B Unknown state: " + game.state + if (view.actions.undo === undefined) { + if (game.undo && game.undo.length > 0) + view.actions.undo = 1 + else + view.actions.undo = 0 + } + } + + return view +} + + +// === ACTIONS =========== + +function gen_action(action, argument) { +//console.log('gen_action called with ', action, ' and ', argument) + if (argument === undefined) { + //console.log('argument undefined') + view.actions[action] = 1 + } else { + if (!(action in view.actions)) { + //console.log('push argument') + view.actions[action] = [] + } + view.actions[action].push(argument) + } + //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) +} + +function gen_action_infl(space){ + gen_action("infl", space) +} + +function gen_action_card(card){ + gen_action("card", card) +} + +function gen_action_sc(space){ + gen_action("sc", space) +} + +function gen_action_scoring(){ + gen_action("scoring") +} + +exports.action = function (state, player, action, arg) { + //console.log('exports.action called with state:' , state, 'player:', player, 'action: ', action, 'arg: ', arg) + game = state + if (states[game.state] && action in states[game.state]) { + states[game.state][action](arg, player) + } else { + if (action === "undo" && game.undo && game.undo.length > 0) + pop_undo() + else + throw new Error("Invalid action: " + action) + } + return game +} + +// ============= GAME STATES ======================= + +states.com_init = { + inactive: 'place starting SPs.', + prompt() { + //console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) + if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { + view.prompt = 'Place starting SPs: done. Start Turn 1.'; + gen_action("start"); + } else if (game.available_ops === 0) { + view.prompt = 'Place starting SPs: done.'; + gen_action("done"); + return; + } else if (game.starting_infl.dem_starting_infl === 2) { + view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` + } else { + view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` + } + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + add_infl(space) + + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.starting_infl.com_starting_infl++ + if (game.starting_infl.com_starting_infl == 1){ + game.available_ops = 3 + game.state = 'dem_init' + valid_spaces_setup() + next_player() + } else if (game.starting_infl.com_starting_infl == 2) { + game.available_ops = 4 + game.state = 'dem_init' + valid_spaces_setup() + next_player() + } else if (game.starting_infl.com_starting_infl == 3) { + delete game.starting_infl + game.state = 'start_game' + } + }, + start() { + new_turn() + clear_undo() + game.state = 'choose_card' + } +} + +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"); + return; + } else if (game.starting_infl.com_starting_infl === 2) { + view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` + } else { + view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` + } + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + add_infl(space) + }, + + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.starting_infl.dem_starting_infl++ + if (game.starting_infl.dem_starting_infl == 1){ + game.available_ops = 3 + } else if (game.starting_infl.dem_starting_infl == 2) { + game.available_ops = 2 + } + game.state = 'com_init' + valid_spaces_setup() + next_player() + } +} + + +states.choose_card = { + inactive: 'choose a card.', + prompt() { + 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') + } else { + view.prompt = 'Choose a card.' + let available_cards + if (game.active === DEM) { + available_cards = game.democrat_hand + } else { + available_cards = game.communist_hand + } + for (let card of available_cards) { + gen_action_card(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() + + if (game.round !== 8 && scoring_cards_count >= (8-game.round)){ + game.temp = card + game.state = 'confirm_card' + return + } + } + select_card(card) + }, + pass() { + log('No cards remaining. Passed') + //end_round() + game.state = 'end_round' + } +} + +states.confirm_card = { + inactive: 'choose a card.', + prompt() { + let scoring_cards_count = count_scoring_cards() + view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + gen_action('continue') + }, + continue() { + select_card(game.temp) + } +} + +states.play_card ={ + get inactive() { + return `play ${clean_name(cards[game.played_card].name)}.` + }, + prompt () { + /*if (game.phase >= 1) { /*Finish here when playing your own event + console.log('in play card') + view.prompt = `${clean_name(cards[game.played_card].name)}: done. End the Action Round.` + gen_action('end_round') + return + }*/ + + view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` + + if (scoring_cards.includes(game.played_card)) { + /*view.prompt = 'Play for:'*/ + gen_action('event') + return + } + + // Check for Reformer Rehabilitated + + //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) + + + if (game.played_card === 67 && game.playable_cards.includes(67)){ + if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { + gen_action('event') + } + if (game.active === COM && (game.dem_tst_position < game.com_tst_position)) { + 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') + } + + 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') + } + + //Continue with normal logic + get_events(game.played_card) + } + + gen_action('influence') + 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() + //console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + log_gap(`Played C${cards[game.played_card].number} for the event`) + game.vm_infl_to_do = false + if (scoring_cards.includes(game.played_card)) {game.phase = 0} + else {game.phase = 1} + game.return = game.active + if (switch_events.includes(game.played_card)) {next_player()} + game.vm_event = game.played_card + //console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) + goto_vm(game.vm_event) + }, + opp_event() { + push_undo() + log_gap(`Played C${cards[game.played_card].number} for the event`) + game.phase = 1 /*Do I still need this?*/ + game.vm_infl_to_do = true + game.return = game.active + game.vm_event = game.played_card + if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { + goto_vm(game.vm_event)} + else { + next_player() + log(`C${game.vm_event}`) + goto_vm(game.vm_event) + } + }, + influence() { + push_undo() + log_gap(`Played C${cards[game.played_card].number} to place SPs`) + + + // Check if Common European Home played for influence + if (game.played_card === 21) { + if (game.active === DEM) { + game.vp -- + log('-1 VP') + if (check_vp()) { + return + } + } else { + game.vp ++ + log('+1 VP') + if (check_vp()) { + return + } + } + } + // Check if card is opponent card with event that needs to be resolved + + if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { + if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { + //game.phase = 1 /*Do I need this? */ + game.vm_event_to_do = true + } + } + + // If ABHR - Set AHBR tracker to true + if (game.persistent_events.includes(58)) { + game.austria_hungary_border_reopened_tracker = true + } + game.state='add_influence' + valid_spaces_infl() + }, + tst() { + push_undo() + log_gap(`Played C${cards[game.played_card].number} to the Tiananmen Square Track`) + game.state='tiananmen_square_attempt' + }, + support_check() { + push_undo() + log_gap(`Played C${cards[game.played_card].number} for support checks`) + + // Check if card is opponent card with event that needs to be resolved + + if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { + if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { + game.vm_event_to_do = true + } + } + + game.available_ops = 2 + game.state='support_check_prep' + valid_spaces_sc() + }, + tst_7() { /*Cancel opponent event */ + push_undo() + 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' + }, + tst_8() { /*Play card for ops and event */ + push_undo() + game.vm_event_to_do = true + game.vm_infl_to_do = true + game.tst_8 = true + log(`Played C${game.played_card} for event and operations`) + game.state = 'vm_tst_8' + }, + end_round () { + end_round() + } + +} + +states.resolve_opponent_event = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + //console.log('in resolve opponent event: discard', game.strategy_discard) + if (game.vm_infl_to_do) { + view.prompt = 'Event resolved. Choose to play card for:' + gen_action('influence') + gen_action('support_check') + } else if (game.vm_event_to_do) { + // Check for Tiananmen Square Track ability - play opponent card without triggering event + if ((game.active === DEM && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ + gen_action('tst_7') + } + view.prompt = `${clean_name(cards[game.played_card].name)}: you must resolve the opponent event.` + gen_action('opp_event') + } else { + view.prompt = 'Event resolved. End the action round.' + gen_action('end_round') + } + }, + influence(){ + push_undo() + // If ABHR - Set AHBR tracker to true + if (game.persistent_events.includes(58)) { + game.austria_hungary_border_reopened_tracker = true + } + game.state = 'finish_add_infl' + valid_spaces_infl() + }, + support_check() { + push_undo() + game.available_ops = 2 + game.state = 'finish_support_check_prep' + valid_spaces_sc() + }, + opp_event() { + game.vm_event_to_do = false + game.return_state = 'resolve_opponent_event' + if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { + game.return = game.active + log(`Played C${game.played_card} for the event`) + goto_vm(game.played_card)} + else { + if (game.active === DEM) { + game.return = COM + } else { + game.return = DEM + } + next_player() + log(`C${game.played_card}`) + goto_vm(game.played_card) + } + }, + tst_7() { + push_undo() + log('Event cancelled using TST Award') + game.tst_7 = true + game.vm_event_to_do = false + }, + end_round() { + push_undo() + /*if(game.round_player === COM && game.active === DEM) { + log_h3('End of Communist Action Round') + change_player() + } */ + end_round() + } +} + + +states.finish_add_infl = { + inactive: 'add SPs.', + prompt () { + if (game.available_ops === 0) { + view.prompt = 'Place SPs: done.' + gen_action("end_round") + return; + } + + view.prompt = `Add SPs: ${game.available_ops} remaining.` + + // Generate actions for valid spaces + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + }, + infl(space) { + add_infl(space) + }, + end_round() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + end_round() + //game.state = 'end_round' + } +} + +states.finish_support_check_prep = { + inactive: 'do support checks.', + prompt () { + if (game.available_ops === 0) { + view.prompt = 'Support checks: done.' + gen_action('end_round') + //return + } else { + view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` + for (let space_id of game.valid_spaces) { + gen_action_sc(space_id) + } + } + }, + sc(space) { + push_undo() + game.selected_space = space + // Check for Austria-Hungary Border Reopened - check on first support check only + //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) + if (game.persistent_events.includes(58)){ + if (game.active === DEM && game.available_ops > 1) { + //console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', 'austria_hungary_border_reopened']) + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { + game.state = 'finish_austria_hungary_border_reopened_check' + return + } + } + } + game.state = 'finish_do_support_check' + }, + end_round () { + end_round() + //game.state = 'end_round' + } +} + +states.finish_austria_hungary_border_reopened_check = { + inactive: 'decide Austria-Hungary Border Reopened', + prompt() { + view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' + gen_action('yes') + gen_action('no') + }, + yes() { + game.austria_hungary_border_reopened_tracker = true + game.state = 'finish_do_support_check' + }, + no() { + game.state = 'finish_do_support_check' + } +} + +states.finish_do_support_check = { + inactive: 'do support checks', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + game.available_ops-- + if (game.available_ops === 0) { + game.valid_spaces = [] + } + game.state = 'finish_support_check_prep' + return + } +} + +states.add_influence = { + inactive: 'add SPs.', + prompt () { + if (game.available_ops <= 0) { + view.prompt = 'Place SPs: done.' + if (!game.vm_event_to_do) { + gen_action("end_round") + } else { + gen_action('done') + } + } else { + + view.prompt = `Add SPs: ${game.available_ops} remaining.` + + // Generate actions for valid spaces + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } + }, + infl(space) { + add_infl(space) + }, + end_round() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + end_round() + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + reset_austria_hungary_border_reopened() + game.state = 'resolve_opponent_event' + } +} + +states.tiananmen_square_attempt = { + inactive: 'do Tiananmen Square Attempt.', + prompt () { + view.prompt = 'Tiananmen Square Track attempt: Roll a die.' + gen_action('roll') + }, + roll() { + clear_undo() + do_tst_attempt () + } +} + +states.tiananmen_square_attempt_success = { + inactive: 'do Tiananmen Square Attempt.', + prompt () { + if (game.vm_event > 200) { + view.prompt = 'Tiananmen Square Track attempt successful. Go to TST Award.' + gen_action('done') + } else { + view.prompt = 'Tiananmen Square Track attempt successful.' + gen_action('end_round') + } + + }, + done () { + push_undo() + //console.log('going to tst award, game.return_state', game.return_state) + goto_vm(game.vm_event) + }, + end_round () { + push_undo() + end_round() + } +} + +states.tiananmen_square_attempt_fail = { + inactive: 'do Tiananmen Square Attempt.', + prompt () { + view.prompt = 'Tiananmen Square Track attempt failed.' + gen_action('end_round') + }, + end_round () { + push_undo() + end_round() + //game.state = 'tiananmen_square_attempt_done' + } +} + +states.tiananmen_square_attempt_done = { + inactive: 'do Tiananmen Square Attempt.', + prompt () { + view.prompt = 'Tiananmen Square Track attempt: done.' + gen_action('end_round') + }, + end_round () { + end_round() + //game.state = 'end_round' + } +} + +states.tst_goddess = { + inactive: 'choose whether to discard a card.', + prompt() { + //if (game.phase === 0) { + view.prompt = 'Tiananmen Square Track award: you may discard a non-Power Struggle Card and draw a replacement.' + for (let card of game.valid_cards) { + gen_action_card(card) + } + gen_action('pass') + /*} else { + view.prompt = 'Discard a card: done.' + gen_action('done') + }*/ + }, + card(card) { + push_undo() + discard(card) + game.valid_cards = [] + game.state = 'tst_goddess_draw' + //game.phase++ + /*if (game.active === DEM) { + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length +1, game.communist_hand.length) + } else { + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) + }*/ + }, + pass() { + log('Did not discard') + log_h2("Action Round " + game.round) + if (game.active === DEM) { + next_player() + } else { + log_side() + } + if (game.persistent_events.includes(5)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } + }, + done() { + + log_h2("Action Round " + game.round) + if (game.active === DEM) { + next_player() + } else { + log_side() + } + game.phase = 0 + if (game.persistent_events.includes(5)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } + } +} + +states.tst_goddess_draw = { + inactive: 'choose whether to discard a card.', + prompt() { + view.prompt = 'Draw a replacement card.' + gen_action('draw') + }, + draw() { + if (game.active === DEM) { + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length +1, game.communist_hand.length) + } else { + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) + } + log_h2("Action Round " + game.round) + if (game.active === DEM) { + next_player() + } else { + log_side() + } + game.phase = 0 + if (game.persistent_events.includes(5)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } + } +} + + + +states.support_check_prep = { + inactive: 'do support checks', + prompt () { + if (game.available_ops === 0) { /*Needs another check for Support Checks done during Crowd Turns against Ceausescu*/ + if (game.is_pwr_struggle) { + view.prompt = 'The Crowd Turns Against Ceausescu. Support checks: done.' + gen_action('done') + } else if (!game.vm_event_to_do) { + view.prompt = 'Support checks: done.' + gen_action('end_round') + } else { + view.prompt = 'Support checks: done.' + gen_action('done') + } + } else if (game.available_ops > 0) { + view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` + + for (let space_id of game.valid_spaces) { + gen_action_sc(space_id) + } + } + }, + sc(space) { + push_undo() + game.selected_space = space + + // Check for Austria-Hungary Border Reopened - check on first support check only + //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) + if (game.persistent_events.includes(58)) { + if (game.active === DEM && game.available_ops > 1) { + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { + game.state = 'austria_hungary_border_reopened_check' + return + } + //game.state = 'do_support_check' + } /*else { */ + } + game.state = 'do_support_check' + //} + }, + end_round() { + push_undo() + end_round() + }, + done() { + push_undo() + if (game.is_pwr_struggle) {/*Crowd Turns Against Ceausescu should be the only time you end up here during a power struggle */ + if (game.return !== game.active) { + next_player() + } + log_h2('Raise the Stakes') + game.state = 'raise_stakes_1' + return + } + reset_austria_hungary_border_reopened() + game.state = 'resolve_opponent_event' + } +} + +states.do_support_check = { + inactive: 'do support checks.', + prompt () { + // console.log('in do_support_check') + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + game.available_ops-- + if (game.available_ops === 0) { + game.valid_spaces = [] + } + game.state = 'support_check_prep' + return + } +} + +states.austria_hungary_border_reopened_check = { + inactive: 'decide Austria-Hungary Border Reopened.', + prompt() { + view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' + gen_action('yes') + gen_action('no') + }, + yes() { + game.austria_hungary_border_reopened_tracker = true + game.state = 'do_support_check' + }, + no() { + game.state = 'do_support_check' + } +} + +states.end_round = { + inactive: 'finish playing a card.', + prompt() { + view.prompt = 'End the Action Round.' + gen_action('end_round') + }, + end_round() { + push_undo() + end_round() + } +} + +//======================= POWER STRUGGLE =============================== + +states.draw_power_cards = { + inactive: 'draw cards.', + prompt() { + view.prompt = `${clean_name(cards[this_card()].name)}: draw cards.` + gen_action('draw') + }, + draw() { + push_undo() + game.power_struggle_deck = [...all_power_cards] + // console.log('game.power_struggle_deck.length', game.power_struggle_deck.length) + //console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + //console.log('test3') + let presence = check_presence(game.pwr_struggle_in) + //console.log('test2') + if (presence.dem_spaces > 0) { + game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1) + } else { + game.dem_pwr_hand_limit = 0 + } + if (presence.com_spaces > 0 ) { + game.com_pwr_hand_limit = 6 + 2*(presence.com_spaces - 1) + } else { + game.com_pwr_hand_limit = 0 + } + // Events which affect cards drawn + if (game.persistent_events.includes(17) && game.com_pwr_hand_limit >= 2) { + log('Democrat receives 2 cards from Communist due to C17') + game.dem_pwr_hand_limit += 2 + game.com_pwr_hand_limit -= 2 + discard_from_table(17) + game.persistent_events = game.persistent_events.filter(n => n !== 17) + } + + if (game.persistent_events.includes(72)) { + let farmer_check + for (let space of spaces) { + if (space && space.country === game.pwr_struggle_in && space.socio === 3 && check_dem_control(space.space_id)) { + farmer_check = true + } + } + if (farmer_check && game.com_pwr_hand_limit > 0) { + log('Democrat receives 1 cards from Communist due to C72') + game.dem_pwr_hand_limit += 1 + game.com_pwr_hand_limit -= 1 + permanently_remove(72) + game.persistent_events = game.persistent_events.filter(n => n !== 72) + } + } + + if (game.persistent_events.includes(102) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { + log('Communist receives 2 cards from Democrat due to C102') + game.dem_pwr_hand_limit -= 2 + game.com_pwr_hand_limit += 2 + permanently_remove(102) + game.persistent_events = game.persistent_events.filter(n => n !== 102) + } + + //Draw Power Cards + game.is_pwr_struggle = true + //console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) + draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } + //game.valid_cards = all_power_cards + + log(`Communist: ${game.com_pwr_hand.length} cards`) + log(`Democrat: ${game.dem_pwr_hand.length} cards`) + + //Check if The Crowd Turns Against Ceausescu occurs + if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { + //console.log('draw cards: crowd subcheck, game.active', game.active) + if (game.active === COM) { + game.return = COM + next_player() + } + log_h3('C54') + game.persistent_events.push(54) + game.state = 'the_crowd_turns_against_ceausescu_prep' + } else { + log_h2('Raise the Stakes') + game.state = 'raise_stakes_1' + //console.log('game.state', game.state, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + } + } +} + +states.the_crowd_turns_against_ceausescu_prep = { + get inactive() { + return `resolve ${clean_name(cards[54].name)}.` + }, + prompt() { + view.prompt = 'The Crowd Turns Against Ceausescu: draw cards.' + gen_action('draw') + }, + draw() { + game.ceausescu_cards = [] + draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) + //console.log('game.ceausescu_cards', game.ceausescu_cards) + game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length + log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) + game.vm_available_ops = game.temp * 3 + log(`Democrat takes a ${game.vm_available_ops} Action Round`) + game.state = 'vm_the_crowd_turns_against_ceausescu' + } +} + +states.vm_the_crowd_turns_against_ceausescu = { + get inactive() { + return `resolve ${clean_name(cards[54].name)}.` + }, + prompt() { + view.prompt = `You have ${game.vm_available_ops} operations points. Play for:` + gen_action('influence') + gen_action('support_check') + }, + influence() { + push_undo() + delete game.ceausescu_cards + valid_spaces_infl() + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') + game.state = 'the_crowd_turns_against_ceausescu_infl' /* Send this to add_infl. Add check at end of add_infl similar to valid_spaces*/ + }, + support_check() { + push_undo() + delete game.ceausescu_cards + valid_spaces_sc() + game.available_ops = 2 + game.state = 'support_check_prep' + } +} + +states.the_crowd_turns_against_ceausescu_infl = { + inactive: 'add SPs.', + prompt () { + if (game.vm_available_ops === 0) + { + view.prompt = 'Place SPs: done.'; + gen_action("done"); + return; + } + + view.prompt = `Add SPs: ${game.vm_available_ops} remaining` + for (let space of game.valid_spaces) { + gen_action_infl(space) + } + }, + infl(space) { + vm_do_add_infl(space) + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + if (game.return !== game.active) { + next_player() + } + log_h2('Raise the Stakes') + game.state = 'raise_stakes_1' + } +} + +states.raise_stakes_1 = { + inactive: 'raise the stakes.', + + prompt () { + // console.log('raise stakes 1 - valid cards', game.valid_cards) + // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + view.prompt = 'Raise the stakes: you must pass.' + gen_action('pass') + } + else if (game.raised_stakes_discard === 3) { + view.prompt = 'Raise the stakes: done.' + gen_action('done') + } else { + view.prompt = `Discard ${3-game.raised_stakes_discard} cards to raise the stakes.` + if (game.raised_stakes_discard === 0) { + gen_action('pass') + } + for (let card of game.valid_cards) { + gen_action_card(card) + } + } + }, + card(card) { + push_undo() + if (numberless_cards.includes(card)) { + log(`Discarded: P${card}`) + } else { + log(`Discarded: P${card} V${power_cards[card].value}`) + } + discard(card) + + game.raised_stakes_discard ++ + if (game.raised_stakes_discard === 3) { + game.raised_stakes++ + game.valid_cards = [] + } + }, + pass(){ + log('Did not raise the stakes') + game.raised_stakes_discard = 0 + next_player() + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } + game.state = 'raise_stakes_2' + }, + done () { + log_gap('Raised the stakes') + game.raised_stakes_discard = 0 + next_player() + //console.log('game.active', game.active) + if (game.active === DEM) { + game.valid_cards = [...game.dem_pwr_hand] + } else { + game.valid_cards = [...game.com_pwr_hand] + } + // console.log('game.valid_cards', game.valid_cards) + game.state = 'raise_stakes_2' + } +} + +states.raise_stakes_2 = { + inactive: 'raise the stakes.', + + prompt () { + if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + view.prompt = 'Raise the stakes: you must pass.' + gen_action('pass') + return + } + if (game.raised_stakes_discard === 3) { + view.prompt = 'Raise the stakes: done.' + gen_action('done') + } else { + view.prompt = `Discard ${3-game.raised_stakes_discard} cards to raise the stakes.` + if (game.raised_stakes_discard === 0) { + gen_action('pass') + } + for (let card of game.valid_cards) { + gen_action_card(card) + } + } + }, + card(card) { + push_undo() + if (numberless_cards.includes(card)) { + log(`Discarded: P${card}`) + } else { + log(`Discarded: P${card} V${power_cards[card].value}`) + } + discard(card) + + game.raised_stakes_discard ++ + if (game.raised_stakes_discard === 3) { + game.raised_stakes++ + game.valid_cards = [] + } + + }, + pass() { + log('Did not raise the stakes') + game.raised_stakes_discard = 0 + game.valid_cards = [] + log_h2('Play Cards') + next_player() + game.state = 'begin_power_struggle' + }, + done () { + log_gap('Raised the stakes') + game.raised_stakes_discard = 0 + game.valid_cards = [] + log_h2('Play Cards') + next_player() + game.state = 'begin_power_struggle' + }, +} + +states.begin_power_struggle = { + inactive: 'begin power struggle.', + prompt() { + view.prompt = 'Begin power struggle.' + gen_action('struggle') + }, + struggle () { + do_valid_cards() + game.state = 'power_struggle' + } +} + +states.power_struggle = { + inactive: 'play a card.', + prompt () { + console.log('game.vm_event', game.vm_event) + if (game.phase === 0) { + if (game.valid_cards.length > 0) { + view.prompt = "Play a card." + for (let card of game.valid_cards) { + gen_action_card(card) + } + } else if ( game.valid_cards.length === 0) { + view.prompt = 'No valid cards. You must concede.' + gen_action('concede') + } + } + if (game.phase === 1) { + if (game.valid_cards.length > 0) { + view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` + gen_action('concede') + for (let card of game.valid_cards) { + gen_action_card(card) + } + } else if (game.valid_cards.length === 0) { + view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + gen_action('concede') + } + } + else if (game.phase === 2) { + view.prompt = 'You matched. Roll a die.' + gen_action('roll') + } + else if (game.phase === 3) { + view.prompt = 'Play leader as:' + if (game.tactics_fails !== "Strike") {gen_action('strike')} + if (game.tactics_fails !== "March") {gen_action('march')} + if (game.tactics_fails !== "Rally in the Square") {gen_action('rally')} + if (game.tactics_fails !== "Petition") {gen_action('petition')} + } + }, + card(card) { + push_undo() + discard(card) + game.valid_cards=[] + game.return_state = 'power_struggle' + if (card === 52) { + log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) + + } else { + if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ + else if (numberless_cards.includes(card)) { + log_gap(`Played: P${card}`) + } else { + log_gap(`Played: P${card} V${power_cards[card].value}`) + } + } + if (game.phase === 0) { + if (card >= 37 && card <= 48) { /*When a leader is played */ + game.played_power_card = card + game.phase = 3 + } else if (card === 49){ /*Scare Tactics */ + game.return = '' + goto_vm(349) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ + } else if (card === 50) { /*Support Surges */ + if (game.active === DEM) { + game.return = COM + } else { + game.return = DEM + } + goto_vm(350) + } else if (game.phase === 0 && card === 51) { /*Support Falters */ + next_player() + goto_vm(351) + } else { + game.played_power_card = card + game.phase = 1 + next_player() + do_valid_cards() + } + } else if (game.phase === 1) { + if (card === 52) { + game.tactics_fails = power_cards[game.played_power_card].name + game.phase = 0 + next_player() + do_valid_cards() + } else if (power_cards[game.played_power_card].value === 1) { + log('Takes initiative') + game.phase = 0 + do_valid_cards() + } else { + game.phase = 2 + } + } + }, + roll () { + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + if (roll >= power_cards[game.played_power_card].value) { + log('Initiative roll successful') + game.phase = 0 + do_valid_cards() + } else { + log(`Initiative roll failed. Required ${power_cards[game.played_power_card].value} or more`) + game.phase = 0 + next_player() + do_valid_cards() + } + }, + concede () { + push_undo() + game.valid_cards = [] + log('Conceded') + log_h2('Aftermath') + log_h3('Support Loss') + //if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {game.rally_win = 2} + //if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {game.petition_win = 2} + if (game.phase === 0) { + game.played_power_card = 0 /*If conceded when held the initiative but had no playable cards, ignore the last played card */ + } + game.phase = 0 + game.state = 'support_loss' + }, + strike () { + log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) + game.played_power_card = 9 + game.phase = 1 + next_player() + do_valid_cards() + }, + march () { + log(`Played: P${power_cards[game.played_power_card].number} as a March`) + game.played_power_card = 21 + game.phase = 1 + next_player() + do_valid_cards() + }, + rally () { + log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) + game.played_power_card = 53 + game.phase = 1 + next_player() + do_valid_cards() + }, + petition () { + log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) + game.played_power_card = 54 + game.phase = 1 + next_player() + do_valid_cards() + }, + /*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) + } 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)} + game.phase = 0 + next_player() + do_valid_cards() + },*/ + /*infl(space) { + game.remove_opponent_infl = true + remove_infl(space) + game.phase = 6 + }, + discard () { /*Is this still needed? + if (game.active === DEM) {discard_card(game.dem_pwr_hand)} + else {discard_card(game.com_pwr_hand)} + game.available_ops -- + }, */ + done () { + if (game.phase === 7) { /*Is this ever called anymore? */ + game.phase = 0 + log_msg_gap('Takes initiative') + do_valid_cards() + } else { + game.phase = 0 + next_player() + do_valid_cards() + } + } +} + +states.support_loss ={ + inactive: 'do Support Loss.', + prompt () { + if (!game.persistent_events.includes(111)) { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') + } + } else { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') + } + } + }, + roll () { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + let rally_win = 0 + let petition_win = 0 + 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 + + // Roll modifiers + if (game.active === COM && game.persistent_events.includes(62)) { + log('+1 from C62') + modified_roll ++ + } + + if (modified_roll < 0) {modified_roll = 0} + else if (modified_roll > 7) {modified_roll = 7} + + + if (game.raised_stakes !== 0) { + log(`+${game.raised_stakes} from Raising the Stakes`) + } + if (rally_win !== 0) { + log('+2 from winning on a P25') + } + if (petition_win !== 0) { + log('-2 from winning on a P31') + } + if (modified_roll !== roll) { + log(`Modified roll: ${modified_roll}`) + } + game.available_ops = support_loss_roll[modified_roll] + if (game.available_ops === 0) { + log('Does not remove SPs') + } + game.phase++ + if (game.available_ops > 0) { + valid_spaces_support_loss() + } + }, + infl (space) { + game.remove_opponent_infl = false /* Don't know why this is needed... */ + remove_infl(space) + if (game.available_ops === 0 ) { + game.valid_spaces = [] + } + }, + done () { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + next_player() + log_h3('Victory Point') + game.phase = 0 + game.state = 'vp_roll' + } +} + +states.vp_roll = { + inactive: 'do VP Roll.', + prompt () { + if (!game.persistent_events.includes(111)) { + if (game.phase === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } + } else { + if (game.phase === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } + } + }, + roll () { + let roll = Math.floor(Math.random() * 6) + 1 + 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} + 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 + if (game.active === DEM && game.persistent_events.includes(62)) { + log('+1 from C62') + modified_roll ++ + } + if (modified_roll < 0) {modified_roll = 0} + else if (modified_roll > 7) {modified_roll = 7} + + if (game.raised_stakes !== 0) { + log(`+${game.raised_stakes} from Raising the Stakes`) + } + if (rally_win !== 0) { + log('+2 from winning on a P25') + } + if (petition_win !== 0) { + log('-2 from winning on a P31') + } + if (modified_roll !== roll) { + log(`Modified roll: ${modified_roll}`) + } + let vp_change = vp_roll[modified_roll] + if (game.active === DEM) { + log(`+${vp_change} VP`) + } else { + log(`-${vp_change} VP`) + } + if (roll >= 4) + //console.log('VP before', game.vp) + if (game.active === DEM) {game.vp += vp_change} + else {game.vp -= vp_change} + //console.log('VP after', game.vp) + if (game.active === DEM && modified_roll >= 4) { + game.phase = 1 + } else { + game.phase = 0 + if (game.active === DEM) {next_player()} + game.state = 'choose_power' + } + }, + take () { + push_undo() + //Find name of scoring card + let scoring_card = scoring_cards[countries.indexOf(game.pwr_struggle_in)] + permanently_remove(scoring_card) + take_power(game.pwr_struggle_in) + game.phase = 2 + }, + scoring () { + push_undo() + log_h2('Scoring') + score_country(game.pwr_struggle_in) + + //Check if The Tyrant is Gone occurs + if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + game.return_state = 'finish_scoring' + if (game.active !== DEM) { + next_player() + } + game.state = 'the_tyrant_is_gone' + } else { + game.state = 'finish_scoring' + } + }, +} + +states.choose_power = { + inactive: 'choose whether to remain in power.', + prompt () { + if (game.phase === 0) { + view.prompt = 'Choose whether to remain in power.' + gen_action('retain') + gen_action('surrender') + } else if (game.phase === 1) { + view.prompt = 'Proceed to scoring.' + gen_action('scoring') + } + }, + retain() { + push_undo() + retain_power(game.pwr_struggle_in) + game.phase = 1 + }, + surrender () { + push_undo() + take_power(game.pwr_struggle_in) + permanently_remove(game.played_card) + game.phase = 1 + }, + scoring () { + push_undo() + score_country(game.pwr_struggle_in) + + //Check if The Tyrant is Gone occurs + if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + game.return_state = 'finish_scoring' + if (game.active !== DEM) { + next_player() + } + game.state = 'the_tyrant_is_gone' + } else { + game.state = 'finish_scoring' + } + } +} +/* +states.score_country = { + inactive: `score country`, + prompt () { + view.prompt = 'Scoring: done.' + gen_action('done') + }, + done () { + reset_power() + /*if (game.return !== game.active) { + next_player()} + game.state = 'finish_scoring' + } +} +*/ + +states.the_tyrant_is_gone ={ + inactive: 'resolve The Tyrant is Gone.', + prompt() { + view.prompt = 'Play The Tyrant is Gone for the event.' + gen_action('event') + }, + event() { + if (game.active !== DEM) { + next_player() + } + if (game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + log_h3(`C97`) + game.vm_event = 97 + goto_vm(game.vm_event) + } +} + +states.finish_scoring ={ + inactive: 'finish scoring.', + prompt() { + view.prompt = 'End power struggle.' + gen_action('done') + } , + done() { + //console.log('game.return_state', game.return_state) + log_msg_gap('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ + if (game.persistent_events.includes(111)) { + game.state = 'new_years_eve_party' + return + } + if (check_vp()) { + return + } + reset_power() + end_round() + //game.state = 'end_round' + } +} + +// ======================================= END TURN STATES ========================================== + +states.end_turn_4_5_4 = { + inactive: 'verify held cards.', + prompt() { + view.prompt = 'End Turn: verify held cards.' + gen_action('check') + }, + check() { + log_h2('Verify held cards') + const dem_has_scoring_card = game.democrat_hand.some(card => scoring_cards.includes(card)) + const com_has_scoring_card = game.communist_hand.some(card => scoring_cards.includes(card)) + if (!dem_has_scoring_card && !com_has_scoring_card) { + log('No held scoring cards') + } + + if (dem_has_scoring_card && com_has_scoring_card) { + log('Both players have held scoring cards') + game.state = 'game_end_tie' + } + else if (dem_has_scoring_card) { + log('Democrat player has a held scoring card') + goto_game_over(COM, `${COM} won by held scoring card!`) + } + else if (com_has_scoring_card) { + log('Communist player has a held scoring card') + goto_game_over(DEM, `${DEM} won by held scoring card!`) + } + else if (game.persistent_events.includes(104)) { + log_h1(`New Year's Eve Party`) + game.vm_event = 104 + //Check if the Communist receives VP from The Tyrant is Gone + if (game.persistent_events.includes(97)) { + game.vp -= 2 + log(`Communist receives 2 VP from C97`) + } + game.persistent_events.push(111) + if (game.active !== DEM) { + next_player() + } + game.state = 'new_years_eve_party' + } + else if(game.turn === 10) { + clear_undo() + log_h2('Final Scoring') + + //Check if the Communist receives VP from The Tyrant is Gone + if (game.persistent_events.includes(97)) { + game.vp -= 2 + log(`Communist receives 2 VP from C97`) + } + game.state = 'final_scoring_held' + + } else { + game.return_state = '' + 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() { + view.prompt = 'Final Scoring: Communist scores VP bonus for the number of countries they retain power.' + gen_action('bonus') + }, + bonus() { + // console.log('game.revolutions: ', game.revolutions) + const held_countries = game.revolutions.filter(value => value === false).length + let vp_gain = 4*held_countries + log(`Communist holds ${held_countries} countries: -${vp_gain} VP`) + game.vp -= 4*held_countries + game.temp = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} + game.state = 'final_scoring' + } +} + +states.final_scoring = { + inactive: 'score countries.', + prompt() { + if (game.temp['East_Germany'] && game.temp['Poland'] && game.temp['Czechoslovakia'] && game.temp['Hungary'] && game.temp['Romania'] && game.temp['Bulgaria']) { + view.prompt = 'Final scoring: done.' + gen_action('end') + } else { + view.prompt = 'Choose a country to score:' + if (!game.temp['East_Germany']) {gen_action('east_germany')} + if (!game.temp['Poland']) {gen_action('poland')} + if (!game.temp['Czechoslovakia']) {gen_action('czechoslovakia')} + if (!game.temp['Hungary']) {gen_action('hungary')} + if (!game.temp['Romania']) {gen_action('romania')} + if (!game.temp['Bulgaria']) {gen_action('bulgaria')} + } + }, + east_germany() { + score_country('East_Germany') + game.temp['East_Germany'] = true + }, + poland() { + score_country('Poland') + game.temp['Poland'] = true + }, + czechoslovakia() { + score_country('Czechoslovakia') + game.temp['Czechoslovakia'] = true + }, + hungary() { + score_country('Hungary') + game.temp['Hungary'] = true + }, + romania() { + score_country('Romania') + game.temp['Romania'] = true + }, + bulgaria() { + score_country('Bulgaria') + game.temp['Bulgaria'] = true + }, + end() { + delete game.temp + if (game.vp > 0) { + goto_game_over(DEM, `${DEM} wins on Victory Point Track!`) + } else if (game.vp < 0) { + goto_game_over(COM, `${COM} wins on Victory Point Track!`) + } else if (game.vp === 0) { + goto_game_over('', `The game is tied!`) /*Not sure what to pass for result */ + } + } +} + +states.game_over = { + get inactive() { + return game.victory + }, + prompt() { + view.prompt = game.victory + }, +} + +// ========================== EVENT SPECIFIC STATES ================================= + +states.general_strike = { + inactive: 'discard a card.', + prompt() { + if (game.played_card === 0 ) { + view.prompt = 'General Strike: you must discard a card or play a Scoring Card.' + available_cards = game.communist_hand + for (let card of available_cards) { + gen_action_card(card) + } + } /*else if (game.phase >= 1) { + view.prompt = 'General Strike: done.' + gen_action('done') + } */ else if (game.played_card > 0 ) { + view.prompt = 'General Strike: roll a die.' + gen_action('roll') + } + }, + card (card) { + push_undo() + game.played_card = card + let find_card + find_card = game.communist_hand.indexOf(card) + game.communist_hand.splice(find_card, 1) + game.available_ops = get_card_ops(card) + if (scoring_cards.includes(card)) { + game.vm_event = card + log(`Played C${card} for the event`) + game.return_state = 'general_strike' + goto_vm(game.vm_event) + } else { + log(`Discarded C${cards[card].number}`) + } + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + + logi(`+${game.available_ops} ops`) + + let total = roll + game.available_ops + log(`Total: ${total}`) + + if (total > 5) { + log('The strike is over.') + permanently_remove(5) + game.persistent_events = game.persistent_events.filter(n => n !== 5) + } else { + log('The strike continues. Required 6 or more') + } + //game.phase = 1 + game.state = 'end_round' + }, /* + done () { + //end_round() + game.state = 'end_round' + }*/ +} + +states.honecker ={ + inactive: 'resolve Honecker.', + prompt() { + view.prompt = 'Honecker: you may take an extra action round.' + gen_action('extra') + gen_action('pass') + }, + extra() { + push_undo() + game.round++ + game.round_player = COM + game.persistent_events = game.persistent_events.filter(n => n !== 15) + game.state = 'choose_card' + }, + pass() { + log('C15: passed') + game.persistent_events = game.persistent_events.filter(n => n !== 15) + //end_round() + game.state = 'end_round' + } +} + +states.new_years_eve_party = { + get inactive() { + return `resolve ${clean_name(cards[104].name)}.` + }, + prompt() { + if (!game.is_pwr_struggle) { + view.prompt = `New Year's Eve Party: you may choose a country to have a final power struggle.` + if (!game.revolutions[0]) {gen_action('poland')} + if (!game.revolutions[1]) {gen_action('hungary')} + if (!game.revolutions[2]) {gen_action('east_germany')} + if (!game.revolutions[3]) {gen_action('bulgaria')} + if (!game.revolutions[4]) {gen_action('czechoslovakia')} + if (!game.revolutions[5]) {gen_action('romania')} + gen_action('pass') + } else { + view.prompt = `New Year's Eve Party: done.` + gen_action('end') + } + }, + east_germany() { + push_undo() + log('Chose to score East Germany') + game.vm_event = 42 + goto_vm(42) + }, + poland() { + push_undo() + log('Chose to score Poland') + game.vm_event = 22 + goto_vm(22) + }, + czechoslovakia() { + push_undo() + log('Chose to score Czechoslovakia') + game.vm_event = 55 + goto_vm(55) + }, + hungary() { + push_undo() + log('Chose to score Hungary') + game.vm_event = 23 + goto_vm(23) + }, + romania() { + push_undo() + log('Chose to score Romania') + game.vm_event = 95 + goto_vm(95) + }, + bulgaria () { + push_undo() + log('Chose to score Bulgaria') + game.vm_event = 43 + goto_vm(43) + }, + pass() { + push_undo() + log('No final power struggle') + if (game.vp > 0) { + goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) + } else if (game.vp < 0) { + goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) + } else if (game.vp === 0) { + goto_game_over('', `New Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ + } + }, + end() { + if (game.vp > 0) { + goto_game_over(DEM, `New Year's Eve Party: ${DEM} wins on Victory Point Track!`) + } else if (game.vp < 0) { + goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) + } else if (game.vp === 0) { + goto_game_over('', `CNew Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ + } + } +} + +states.stasi_end_round = { + inactive: 'choose next card due to Stasi.', + prompt() { + //console.log('game.stasi_card', game.stasi_card) + let available_cards = game.democrat_hand + if (available_cards.length === 0) { + view.prompt = 'Stasi: no cards remaining.' + gen_action('pass') + return + } + view.prompt = 'Stasi: you must select your next card to play.' + + for (let card of available_cards) { + gen_action_card(card) + } + }, + card(card) { + push_undo() + log_gap(`Democrat selected C${cards[card].number} as next card.`) + game.stasi_card = card + game.state = 'stasi_finish' + }, + pass() { + log('Stasi: Democrat has no remaining cards') + game.stasi_card = 0 + end_stasi_choose_card() + }, + end_round() { + push_undo() + if (game.stasi_card === 21) { + game.state = 'stasi_confirm' + } else { + end_stasi_choose_card() + } + } +} + +states.stasi_finish = { + inactive: 'choose next card due to Stasi.', + prompt() { + view.prompt = 'Stasi. Choose card: done.' + gen_action('done') + }, + done() { + push_undo() + if (game.stasi_card === 21) { + game.state = 'stasi_confirm' + } else { + end_stasi_choose_card() + } + } +} + +states.stasi_confirm = { + inactive: 'choose next card due to Stasi.', + prompt() { + if (game.stasi_card === 21 ) { + 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) + end_stasi_choose_card() + } +} + +states.stasi_play_card = { + inactive: 'play a card.', + prompt () { /*Should get rid of the play card 'done' prompt for consistency with general play */ + /*if (game.played_card > 0) { + game.state = 'play_card' + view.prompt = 'Play card: done.' + gen_action("done"); + return;*/ + //} else + if (game.democrat_hand.length === 0) { + view.prompt = 'Stasi: you must pass.' + gen_action('pass') + } else { + view.prompt = `Stasi: you must play ${clean_name(cards[game.stasi_card].name)}.` + let available_cards = [game.stasi_card] + for (let card of available_cards) { + gen_action_card(card) + } + } + }, + card(card) { + push_undo() + //log_msg_gap(`Stasi: played C${card}`) + game.played_card = card + let find_card + find_card = game.democrat_hand.indexOf(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") { + game.state = 'stasi_resolve_common_european_home' + } else { + game.state = 'play_card' + } + + }, + pass () { + log('No cards remaining. Passed') + //end_round() + game.state = 'end_round' + }, + done () { + //game.stasi_card = 0 + if (game.democrat_hand.includes(21)) { + game.state = 'stasi_resolve_common_european_home' + } else { + game.state = 'play_card' + } + } +} + +states.stasi_resolve_common_european_home = { + inactive: 'play a card.', + prompt () { + view.prompt = `Do you wish to play ${clean_name(cards[game.played_card].name)} with Common European Home?` + gen_action('yes') + gen_action('no') + }, + yes() { + log(`Played with Common European Home`) + silent_discard(21) + game.vm_infl_to_do = true + game.vm_event_to_do = false + game.state = 'resolve_opponent_event' + }, + no() { + game.state = 'play_card' + } +} + + +// ==================== SUPPORTING STATE FUNCTIONS ============================= + + +function add_infl(space) { + push_undo() + //console.log('adding infl to', space) + //console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker) + //log(`Added 1 influence in %${space}`) + log_summary(`Added £ SP in %${space}`) + + //If AHBR - check AHBR conditions + if (game.persistent_events.includes(58)) { + if (spaces[space].country !== 'East_Germany'){ + game.austria_hungary_border_reopened_tracker = false + } + } + + // Check Genscher + if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { + game.available_ops-- + log_summary(`(-1 op due to C63)`) + } else if (check_opp_control(space)) { + game.available_ops -= 2 + //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative + if (game.available_ops < 0) { + log_summary(`(Used +1 op from C58)`) + } + } else { + game.available_ops-- + } + + // Update influence values + if (game.active === COM) { + game.comInfl[space]++ + } else { + game.demInfl[space]++ + } + + // Check whether spaces are controlled + 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) { + game.available_ops ++ + log('+1 op from C58') + game.austria_hungary_border_reopened_tracker = false + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') + } + + // If only 1 IP remaining, may not place in opponent controlled spaces + + // Check for Genscher & Austria Hungary Border Reopened + + if (game.available_ops === 1) { + //console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher']) + if (game.active === DEM) { + if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { + //console.log('in gensher subcheck - remove non-East German controlled ') + game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) + } else { + //console.log('remove all controlled spaces') + game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) + } + } else { + //console.log('remove all dem controlled spaces') + game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) + } + } + + //Clear valid spaces if no IP remaining. + if (game.available_ops <= 0 ) { + game.valid_spaces = [] + } +} + +function remove_infl(space) { + push_undo() + //log(`Removed 1 influence from %${space}.`) + log_summary(`Removed £ SP from %${space}.`) + + if (game.remove_opponent_infl === true) { + if (game.active === COM) { + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } else { + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } + check_control_change(space) + + } else { + if (game.active === COM) { + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } else { + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } + check_control_change(space) + } + game.available_ops-- +} + +function do_sc(space) { + clear_undo() + log_gap(`Support check: %${space}`) + + //Check Helsinki Final Act + + if (game.active === COM && game.persistent_events.includes(26) && (spaces[space].socio === 5 || spaces[space].socio === 6) ) { + log('+1 VP from C26') + game.vp ++ + if (check_vp()) { + game.state = 'game.over' + //console.log('after check_vp, game.state', game.state) + return + } + } + + // Continue with Support Check Logic + + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + + /* + //Check if support check is being done with game.played_card or a subsequent card (e.g. Common European Home, Dash for the West, etc) + if (game.vm_event > 0) { + roll+= cards[game.vm_event].ops + log(`+${cards[game.vm_event].ops} from card ops`) + } + */ + // Check for the Crowd Turns Against Ceausescu + + //else + if (game.is_pwr_struggle) { + roll += game.vm_available_ops + logi(`+${game.vm_available_ops} from Ceausescu`) + } + + // Check if in Tiananmen Square Track Award + + else if (game.state === 'vm_tst_6_sc') { + roll += get_tst_6_ops() + roll += 2 + logi('+2 TST award') + } + else { + //let modifier = 0 + let card_ops = get_card_ops(this_card()) + + roll += card_ops + logi(`+${card_ops} from card ops`) + } + + if (game.support_check_modifier > 0) { + roll += game.support_check_modifier + logi(`+${game.support_check_modifier} from event`) + } + + // Events which modify SC rolls + //Tear Gas + if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { + roll ++ + logi('+1 from C30') + permanently_remove(30) + game.persistent_events = game.persistent_events.filter(n => n !== 30) + } + //FRG Embassies + if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { + roll++ + logi('+1 from C74') + } + //GrenzTruppen + if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { + roll-- + logi('-1 from C59') + } + //Stand Fast + if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ + roll-- + logi('-1 from C100') + } + //Elena + if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { + roll-- + logi('-1 from C101') + } + //Austria Hungary Border Reopened + if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { + roll++ + logi(`+1 from C58`) + } + + // Continue with logic - check for adjacency + + // Events which affect adjacency - The Wall + + const adj = count_adj(space) + //console.log('adj', adj) + if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { + logi('No adjacency for Democrats due to C9') + logi('C9 no longer in effect') + roll += adj.com_adj + if (adj.com_adj > 0) { + logi(`+${adj.com_adj} adjacency`) + } + game.persistent_events = game.persistent_events.filter(n => n !== 9) + + // Standard adjacency + } else { + if (adj.dem_adj > 0 || adj.com_adj > 0 ){ + if (game.active === DEM) { + roll += adj.dem_adj + roll -= adj.com_adj + if (adj.dem_adj > 0) { + logi(`+${adj.dem_adj} from adjacency`) + } + if (adj.com_adj > 0) { + logi(`-${adj.com_adj} from opponent adjacency`) + } + } else { + roll += adj.com_adj + roll -= adj.dem_adj + if (adj.com_adj > 0) { + logi(`+${adj.com_adj} from adjacency`) + } + if (adj.dem_adj > 0) { + logi(`-${adj.dem_adj} from opponent adjacency`) + } + } + } + + } + + // Support check calcs + log(`Modified total: ${roll}`) + const stability = spaces[space].stability + logi(`-${stability*2} (stability * 2)`) + const change_infl = Math.max(0, roll - stability*2) + if (change_infl > 0) { + log_msg_gap(`Change influence: ${change_infl} SP`) + if(game.active === DEM) { + if (change_infl > game.comInfl[space]) { + const residual = change_infl - game.comInfl[space] + game.comInfl[space] = 0 + game.demInfl[space] += residual + } else { + game.comInfl[space] -= change_infl + } + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + } + } else { + if (change_infl > game.demInfl[space]) { + const residual = change_infl - game.demInfl[space] + game.demInfl[space] = 0 + game.comInfl[space] += residual + } else { + game.demInfl[space] -= change_infl + } + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + } + } + check_control_change(space) + + } else { + log_msg_gap('Change influence: 0 SP') + } + if (game.active === COM && game.persistent_events.includes(39) && spaces[space].space_id === 66) { + log_msg_gap('+1 VP from C39') + game.vp++ + if (check_vp()) { + return + } + } + + // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany + if (game.persistent_events.includes(58)){ + if (game.austria_hungary_border_reopened_tracker) { + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') + } + } + game.selected_space = 0 + +} + +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++) { + space = spaces[i] + + if (game.state === 'com_init') { + infl = game.demInfl[i] + + if (infl === 0) { + valid_spaces_set.add(space.space_id); + } + } else if (game.state === 'dem_init') { + infl = game.comInfl[i] + if (infl === 0) { + valid_spaces_set.add(space.space_id); + } + } + } + // Convert the set to an array before returning + game.valid_spaces = Array.from(valid_spaces_set); + return game.valid_spaces; +} + +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++) { + space = spaces[i] + + if (game.active === DEM) { + infl = game.comInfl[i] + if (infl !== 0 ) { + valid_spaces_set.add(space.space_id); + } + } else { + infl = game.demInfl[i] + if (infl !== 0 ) { + // Check Solidarity Legalised + if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + + // Check Civic Forum + if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + + // Check We Are the People + if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + + //Check for Foreign Currency Debt Burden + if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} { + + valid_spaces_set.add(space.space_id); + + } + } + } + } + + + // Convert the set to an array before returning + game.valid_spaces = Array.from(valid_spaces_set); + + //Check for the Crown Turns Against Ceausescu + if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') + } + return game.valid_spaces; +} + +function valid_spaces_support_loss() { + let valid_spaces_set = new Set(); + for (let i = 1; i < game.demInfl.length; i++) { + //console.log('spaces.length', game.demInfl.length, 'i', i) + space = spaces[i] + if (game.active === DEM) { + infl = game.demInfl[i] + if (infl > 0 && space.country === game.pwr_struggle_in) { + valid_spaces_set.add(space.space_id); + } + } else { + infl = game.comInfl[i] + if (infl > 0 && space.country === game.pwr_struggle_in) { + valid_spaces_set.add(space.space_id); + } + } + } + + // Convert the set to an array before returning + game.valid_spaces = Array.from(valid_spaces_set); + return game.valid_spaces; +} +/* +function valid_spaces_support_falters() { + let valid_spaces_set = new Set(); + if (game.active === DEM) { + for (let piece of game.pieces) { + if (!piece) continue + let space = spaces.find(s => s && s.space_id === piece.space_id); + if (space && piece.comInfl > 0 && space.country === game.pwr_struggle_in) { + valid_spaces_set.add(space.space_id); + } + } + } else { + for (let piece of game.pieces) { + if (!piece) continue + let space = spaces.find(s => s && s.space_id === piece.space_id); + if (space && piece.demInfl > 0 && space.country === game.pwr_struggle_in) { + valid_spaces_set.add(space.space_id); + } + } + } + // Convert the set to an array before returning + game.valid_spaces = Array.from(valid_spaces_set); + return game.valid_spaces; +} + */ + +function valid_spaces_infl() { + /*if (game.state.startsWith('vm')) { + console.log('valid_spaces_infl called from VM') + } else { + console.log('valid_spaces_infl called not from VM') + }*/ + // Check if function is called from the VM or not, take relevant ops variable + let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; + + let valid_spaces_set = new Set(); + // Iterate over all spaces to find the ones with the player's influence + for (let i = 1; i < game.demInfl.length; i++) { + //piece = game.pieces[i] + space = spaces[i] + + let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; + + // If the piece has the player's influence, add it and its adjacent spaces to the set + if (player_influence > 0) { + valid_spaces_set.add(space.space_id); + + // Check adjacency information + let adjacent_spaces = get_adjusted_adjacency(space.space_id) + + for (let adj_space_id of adjacent_spaces) { + //console.log('adj_space_id', adj_space_id) + if (adj_space_id) { + + const adj_piece = spaces[adj_space_id]; + //console.log('adjacent piece name', adj_piece.name_unique) + + // Check if the adjacent space is controlled by the opponent + const opponent_control = check_opp_control(adj_piece.space_id) + //console.log('controlled?', opponent_control) + + //Check for Genscher. Can always place in East Germany even with 1 op + if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(63)){ + // console.log('space added with genscher') + valid_spaces_set.add(adj_piece.space_id) + } + + // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent + if (ops >= 2 || !opponent_control) { + valid_spaces_set.add(adj_piece.space_id) + } + } + } + } + } + // Convert the set to an array before returning + game.valid_spaces = Array.from(valid_spaces_set); + return game.valid_spaces; +} + +function valid_cards(player_hand, presence) { + const valid_cards_set= new Set(); + if (game.phase === 0) { + for (let c of player_hand) { + let card = power_cards.find(card => card && card.number === c); + if (card.number === 52) {continue} // Never add tactics fails + if (card.name === game.tactics_fails) {continue} //Cannot play the suit of Tactics Fails + if (card.socio === 0) { + valid_cards_set.add(card.number); + } else if (leaders.includes(card.socio) && presence[card.socio]) { + valid_cards_set.add(card.number); + } + } + } else if (game.phase === 1) { + for (let c of player_hand) { + let card = power_cards.find(card => card && card.number === c); + if (card.name === power_cards[game.played_power_card].name) { + valid_cards_set.add(card.number); + } else if (leaders.includes(card.socio) && presence[card.socio]) { + valid_cards_set.add(card.number); + } else if (card.number === 52) {valid_cards_set.add(card.number)} + } + } + game.valid_cards = Array.from(valid_cards_set); + return game.valid_cards; +} + +function do_valid_cards() { + let presence = check_presence(game.pwr_struggle_in) + if (game.active === DEM) { + valid_cards(game.dem_pwr_hand, presence.dem_leaders) + + } else { + valid_cards(game.com_pwr_hand, presence.com_leaders)} +} + +function count_adj(id) { + const space = spaces[id] + let dem_adj = 0 + let com_adj = 0 + + let adjacent_spaces = get_adjusted_adjacency(space.space_id) + + for (let adj_space_id of adjacent_spaces) { + if (adj_space_id) { + const adj_piece = spaces.find(piece => piece && piece.space_id === adj_space_id); + //console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) + if (adj_piece && adj_piece.space_id !== space.space_id) { + if (check_dem_control(adj_piece.space_id)) { + //console.log('added DEM space', spaces[adj_piece.space_id].name) + dem_adj++ + } + if (check_com_control(adj_piece.space_id)) { + //console.log('added COM space', spaces[adj_piece.space_id].name) + com_adj++ + } + } + } + } + //console.log('dem_adj: ', dem_adj, 'com_adj: ', com_adj) + return {dem_adj, com_adj} +} + +/*function count_adj_worker(space_id) { + const space = spaces[space_id] + let dem_adj = 0 + let com_adj = 0 + + for (let adj_space_id of space.adjacent) { + if (adj_space_id) { + const adj_space = spaces[adj_space_id] + if (adj_space && adj_space.socio === 4) { + const adj_piece = game.pieces.find(piece => piece && piece.space_id === adj_space_id ); + if (adj_piece) { + if (adj_piece.demCtrl === 1 ) { + dem_adj++ + } + if (adj_piece.comCtrl === 1 ) { + com_adj++ + } + } + } + } + } + return {dem_adj, com_adj} +} */ + +function check_control(space_id) { + //console.log('in check control, space', spaces[space_id].name_unique) + if ( (game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability) { + return true; + } else if ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability) { + //console.log('true') + return true; + } else { + //console.log('false') + return false; + } +} + +function check_opp_control(space_id) { + if (spaces[space_id].country === 'Romania') { + //console.log('in check opp control, space', spaces[space_id].name_unique) + } + if (game.active === DEM && ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability)) { + if (spaces[space_id].country === 'Romania') { + //console.log('control true') + } + return true; + } else if (game.active === COM && ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability)) { + //console.log('true') + return true; + } else { + //console.log('false') + return false; + } +} + +function check_dem_control(space_id) { + if ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability) { + return true; + } else { + return false; + } +} + +function check_com_control(space_id) { + if ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability) { + return true; + } else { + return false; + } +} + +function do_tst_attempt() { + let roll = Math.floor(Math.random() * 6) + 1; + log(`Roll: D${roll}`); + + roll += game.available_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 ++; + logi('+1 from previous TST attempts') + } + if (game.active === DEM && game.dem_tst_position >= 1 && game.com_tst_position === 0) { + roll ++ + logi('+1 from TST award') + } + if (game.active === COM && game.com_tst_position >= 1 && game.dem_tst_position === 0) { + roll ++ + 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 ++; + logi('+1 for playing own card'); + } + if (game.active === COM && game.persistent_events.includes(53)) { + roll ++ + logi('+1 from C53') + } + log(`Modified total: ${roll}`) + + // TIANANMEN SQUARE ATTEMPT + game.return = game.active + game.return_state = 'tiananmen_square_attempt_done' + if (game.active === DEM) { + game.dem_tst_attempted_this_turn = 1 + if (roll >= dem_tst_req[game.dem_tst_position]) { + log(`${dem_tst_req[game.dem_tst_position]} required: success`) + game.dem_tst_position++ + game.dem_tst_attempted = 0 + + //Check if they have reached box 7 or 8 first + if (game.dem_tst_position === 7 && game.com_tst_position < 7) { + game.tst_7 = false + } + if (game.dem_tst_position === 8 && game.com_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) { + delete game.tst_7 + } + if (game.dem_tst_position >= 8 && game.com_tst_position >= 8) { + delete game.tst_8 + } + + //Check if TST events occur + if (game.dem_tst_position === 3 && game.com_tst_position < 3) {game.vm_event = 203} + else if (game.dem_tst_position === 4 && game.com_tst_position < 4) {game.vm_event = 204} + game.state = 'tiananmen_square_attempt_success' + } else { + log(`${dem_tst_req[game.dem_tst_position]} required: fail`) + game.dem_tst_attempted = 1 + game.state = 'tiananmen_square_attempt_fail' + } + } else { + game.com_tst_attempted_this_turn = 1 + if (roll >= com_tst_req[game.com_tst_position]) { + log(`${com_tst_req[game.com_tst_position]} required: success`) + game.com_tst_position++ + game.com_tst_attempted = 0 + + //Check if they have reached box 7 or 8 first + if (game.com_tst_position === 7 && game.dem_tst_position < 7) { + game.tst_7 = false + } + 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.com_tst_position >= 7 && game.dem_tst_position >= 7) { + delete game.tst_7 + } + if (game.com_tst_position >= 8 && game.dem_tst_position >= 8) { + delete game.tst_8 + } + + //Check if TST events occur + if (game.com_tst_position === 3 && game.dem_tst_position < 3) {game.vm_event = 203} + else if (game.com_tst_position === 4 && game.dem_tst_position < 4) {game.vm_event = 204} + game.state = 'tiananmen_square_attempt_success' + } else { + log(`${com_tst_req[game.com_tst_position]} required: fail`) + game.com_tst_attempted = 1 + game.state = 'tiananmen_square_attempt_fail' + } + } +} + +function check_presence(country) { + + let dem_spaces = 0; + let com_spaces = 0; + let dem_battlegrounds = 0; + let com_battlegrounds = 0; + let dem_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; + let com_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; + + + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (space.country === country) { + + if (check_dem_control(i)) { + dem_spaces++; + if (space.battleground === 1) { + dem_battlegrounds++; + } + if (leaders.includes(space.socio)) { + dem_leaders[space.socio] = true; + } + } + if (check_com_control(i)) { + com_spaces++; + if (space.battleground === 1) { + com_battlegrounds++; + } + if (leaders.includes(space.socio)) { + com_leaders[space.socio] = true; + } + } + } + } + + // Determine domination + let dem_domination = dem_battlegrounds > com_battlegrounds && dem_spaces > com_spaces && dem_spaces - dem_battlegrounds > 0; + let com_domination = com_battlegrounds > dem_battlegrounds && com_spaces > dem_spaces && com_spaces - com_battlegrounds > 0; + + // Determine control + let total_battlegrounds = battlegrounds(country); + let dem_control = dem_battlegrounds === total_battlegrounds && dem_spaces > com_spaces; + let com_control = com_battlegrounds === total_battlegrounds && com_spaces > dem_spaces; + + return { + dem_spaces: dem_spaces, + com_spaces: com_spaces, + dem_battlegrounds: dem_battlegrounds, + com_battlegrounds: com_battlegrounds, + dem_domination: dem_domination, + com_domination: com_domination, + dem_control: dem_control, + com_control: com_control, + dem_leaders: dem_leaders, + com_leaders: com_leaders + }; +} + +function battlegrounds(country) { + let battlegrounds = 0; + if (country === "Hungary") { + battlegrounds = 4 + } else if (country === "Bulgaria") { + battlegrounds = 5 + } else { + battlegrounds = 6 + } + return battlegrounds; +} + +function take_power(country) { + + log(`Democrat takes power in ${game.pwr_struggle_in}`) + game.revolutions[find_country_index(country)] = true + game.times_held[find_country_index(country)] = 1 + +} + +function retain_power(country){ + game.times_held[find_country_index(country)]++ + let vp_gain = get_value(country)*game.times_held[find_country_index(country)] + log(`Chooses to retain power`) + log(`-${vp_gain} VP`) + game.vp -= vp_gain +} + +function score_country(country) { + log_h3(`Scoring: ${country}`) + +//Get scoring values + let value_presence = get_value(country) + let value_domination = value_presence*2 + let value_control + if (country !== "Hungary") { + value_control = value_presence*3 + } else { + value_control = 4 + } +//Log for scoring + + let dem_vp = 0 + let com_vp = 0 + //Check for presence + let presence = check_presence(country) +// console.log('presence: ', presence) + + //If one side has domination or control + if (presence.dem_control || presence.dem_domination) { + log(`Democrat:`) + if (presence.dem_control) { + log(`Control: +${value_control} VP`) + dem_vp += value_control + } + else { + log(`Domination: +${value_domination} VP`) + dem_vp += value_domination + } + log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + dem_vp += presence.dem_battlegrounds + log(`Total: +${dem_vp} VP`) + + log_gap('Communist:') + if (presence.com_spaces > 0) { + log(`Presence: -${value_presence} VP`) + com_vp -= value_presence + if (presence.com_battlegrounds >0) { + log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + com_vp -= presence.com_battlegrounds + } + log(`Total: ${com_vp} VP`) + } else { + log('No presence: 0 VP') + } + + } + else if (presence.com_control || presence.com_domination) { + log('Communist:') + if (presence.com_control) { + log(`Control: -${value_control} VP`) + com_vp -= value_control + } + else { + log(`Domination: -${value_domination} VP`) + com_vp -= value_domination + } + log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + com_vp -= presence.com_battlegrounds + log(`Total: ${com_vp} VP`) + + log_gap('Democrat:') + if (presence.dem_spaces > 0) { + log(`Presence: +${value_presence} VP`) + dem_vp += value_presence + if (presence.dem_battlegrounds > 0) { + log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + dem_vp += presence.dem_battlegrounds + } + log (`Total: +${dem_vp} VP`) + } else { + log('No presence: 0 VP') + } + + } + + //Otherwise, presence and battlegrounds + else { + log("No domination or control") + log_gap(`Communist:`) + if (presence.com_spaces > 0) { + log(`Presence: -${value_presence} VP`) + com_vp -= value_presence + if (presence.com_battlegrounds > 0) { + log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + com_vp -= presence.com_battlegrounds + } else { + log('No battlegrounds') + } + log(`Total: ${com_vp} VP`) + } else { + log('No presence: 0 VP') + } + log_gap('Democrat:') + if (presence.dem_spaces > 0) { + log(`Presence: +${value_presence} VP`) + dem_vp += value_presence + if (presence.dem_battlegrounds > 0) { + log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + dem_vp += presence.dem_battlegrounds + } else { + log('No battlegrounds') + } + log(`Total: +${dem_vp} VP`) + } else { + log('No presence: 0 VP') + } + } + + +//Calculate change VP + /*let dem_vp = 0 + if (presence.dem_spaces > 0) {dem_vp += value_presence} + if (presence.dem_domination) {dem_vp += value_presence} + if (presence.dem_control && country !== "Hungary") { + dem_vp += value_control + } + else if (presence.dem_control && country === "Hungary") {dem_vp += 2} + dem_vp += presence.dem_battlegrounds + + let com_vp = 0 + if (presence.com_spaces > 0) {com_vp += value_presence} + if (presence.com_domination) {com_vp += value_presence} + if (presence.com_control && country !== "Hungary") {com_vp += value_presence} + else if (presence.com_control && country === "Hungary") {com_vp += 2} + com_vp += presence.com_battlegrounds */ + let change_vp = dem_vp + com_vp + game.vp += change_vp + if (change_vp > 0 ) { + log_gap(`Final change VP: +${change_vp} VP`) + } else { + log_gap(`Final change VP: ${change_vp} VP`) + } +} + +function get_value(country) { + let value + if (country === "East_Germany" || country === "Poland") {value = 3} + else if (country === "Czechoslovakia" || country === "Romania") {value = 2} + else value = 1 + return value +} + +function get_end_infl_prompt() { + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` + if (!game.vm_infl_to_do) { + gen_action('end_round') + } else { + gen_action('done') + } +} + +function permanently_remove(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') + game.table_cards.splice(card_index, 1) + } + game.strategy_removed.push(card) + //console.log('game.strategy_removed', game.strategy_removed) +} + +function check_vp() { + if (game.vp >= 20) { + goto_game_over(DEM, `${DEM} won an Automatic Victory!`) + //console.log('after goto_game_over, game.state', game.state) + return true + } else if(game.vp <= -20) { + goto_game_over(COM, `${COM} won an Automatic Victory!`) + return true + } + return false +} + +function game_over() { + if (game.vp >= 20 || game.vp <= -20) { + return true + } else { return false} +} + +function goto_game_over(result, victory) { + game.state = "game_over" + game.active = "None" + game.result = result + game.victory = victory + log_h1("Game Over") + log(game.victory) + //console.log('game over, game.state', game.state) + return + +} + +function reset_austria_hungary_border_reopened() { + //game.austria_hungary_border_reopened_checked = false + game.austria_hungary_border_reopened_tracker = false +} + +function end_stasi_choose_card() { + game.round_player = COM + game.round ++ + log_h2(`Action Round ${game.round}`) + next_player() + game.valid_spaces = [] + if (game.persistent_events.includes(5)) { + log_h3('C5') + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } +} + +function check_reformer() { + if (game.dem_tst_position !== game.com_tst_position) { + if (!game.playable_cards.includes(67)) { + game.playable_cards.push(67) + } + } else { + game.playable_cards = game.playable_cards.filter(n => n !== 67) + } + +} + +function count_scoring_cards() { + let scoring_check + if (game.active === DEM) { + scoring_check = game.democrat_hand.filter(card => scoring_cards.includes(card)).length + } else { + scoring_check = game.communist_hand.filter(card => scoring_cards.includes(card)).length + } + return scoring_check +} + +function select_card(card){ + game.played_card = card + game.temp = 0 + let find_card + if (game.active === COM) { + find_card = game.communist_hand.indexOf(card) + game.communist_hand.splice(find_card, 1) + } else { + find_card = game.democrat_hand.indexOf(card) + game.democrat_hand.splice(find_card, 1) + } + game.available_ops = get_card_ops(card) + + //Check Ligachev + if (game.active === DEM && game.persistent_events.includes(99) && card !== 14) { + log('-3 VP from C99') + game.vp -= 3 + if (check_vp()) { + return + } + game.persistent_events = game.persistent_events.filter(n => n !== 99) + } + game.state = 'play_card' + //console.log('game.state', game.state) +} + +function find_event(card) { + return variable_events.indexOf(card) +} + +function is_auto_resolve(card) { + + let ceausecu_events = [10, 41, 101, 107] + + if (card === 97) { + if (!game.persistent_events.includes(54)) { + return true + } + } + else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { + return true + } + else if (card === 87 && !game.persistent_events.includes(86)) { + return true + } + else if (auto_resolve_events.includes(card)) { + return true + } else { + return false + } +} + +function get_events(card){ + 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) { +// console.log('game.stasi_card', game.stasi_card, 'card', card) + //Reformer never playable here + if (card === 67) { + return false + } + //Check for Common European Hmme under Stasi + else if (game.stasi_card === 21 && card === 21 && game.active === DEM) { + return false + } + //Check for The Chinese Solution + else if (game.com_tst_position === 8 && card === 96) { + return true + } + //Then check normally + else if (cards[card].playable) { + return true + } else if (game.playable_cards.includes(card)) { + return true + } else { + return false + } +} + +function get_card_ops(card) { + let ops = 0 + + if (card) { + ops = cards[card].ops + } + if (game.persistent_events.includes(25) && game.active === COM) { + if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + log('+1 op from C25') + } + ops ++ + } + if (game.persistent_events.includes(50) && game.active === DEM) { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { + log('+1 op from C50') + } + ops ++ + } + + if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) { + if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + log('+1 op from Tiananmen Square Track') + } + ops ++ + } + + if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { + if (ops > 2) { + log(`${pluralize(game.prudence.DEM,'op')} from C8`) + } else { + if (ops > 1) { + log(`-1 op from C8`) + } + } + } + ops += game.prudence.DEM + + if (ops < 1) { + ops = 1 + } + } + + if (game.active === COM && game.prudence && game.prudence.COM < 0) { + if(game.state === 'choose_card') { + if (ops > 2) { + log(`${pluralize(game.prudence.COM,'op')} from C8`) + } else if (ops > 1) { + log(`-1 op from C8`) + } + } + ops += game.prudence.COM + if (ops < 1) { + ops = 1 + } + } return ops +} + +function get_tst_6_ops() { + let ops = 0 + + if (game.persistent_events.includes(25) && game.active === COM) { + log('+1 op from C25') + ops ++ + } + if (game.persistent_events.includes(50) && game.active === DEM) { + log('+1 op from C50') + ops ++ + } + + if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { + if (ops > 0) { + log(`${pluralize(game.prudence.DEM,'op')} from C8`) + } else { + log(`-1 op from C8`) + } + + ops += game.prudence.DEM + + if (ops < -1) { + ops = -1 + } + } + + if (game.active === COM && game.prudence && game.prudence.COM < 0) { + + if (ops > 0) { + log(`${pluralize(game.prudence.COM,'op')} from C8`) + } else { + log(`-1 op from C8`) + } + + ops += game.prudence.COM + if (ops < -1) { + ops = -1 + } + } + return ops +} + +function finish_the_wall() { + if (game.the_wall_must_go['dem_wins'] === 2) { + game.persistent_events.push(86) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (space.country === 'East_Germany' && game.comInfl[i] > 0){ + game.valid_spaces.push(space.space_id) + } + } + if (!game.vm_infl_to_do) { + if (game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + if (game.active === DEM) {next_player()} + vm_next () + } else { + permanently_remove(86) + delete game.the_wall_must_go + vm_return() + } +} + + +// =========== 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') + return} + + //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. + if (!game.strategy_removed.includes(game.played_card) && !game.table_cards.includes(game.played_card) && game.played_card > 0) { + game.strategy_discard.push(game.played_card) + } + + //Reset + game.played_card = 0 + game.temp = 0 + game.vm_event = 0 + game.phase = 0 + game.remove_opponent_infl = false + game.is_pwr_struggle = false + game.vm_infl_to_do = false /*Can get rid of this and use game.return_state? */ + game.vm_event_to_do = false + game.vm_active_country = '' + game.return_state = '' + game.discard = false + game.return = '' + 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! */ + + + // Check for duplicate card entries + let card_check + if (game.samizdat_card > 0) { + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; + } else { + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand]; + } + + function check_duplicates(array) { + return new Set(array).size !== array.length; + } + + function find_duplicates(array) { + const duplicates = array.filter((item, index) => array.indexOf(item) !== index); + return [...new Set(duplicates)]; + } + + //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + + if (check_duplicates(card_check)) { + console.log('card check', card_check) + const duplicates = find_duplicates(card_check) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) + } + //console.log('cards in game', card_check.length) + card_check = card_check.sort((a, b) => a - b) + //console.log('cards in game', card_check) + if (game.turn <= 3) { + if (card_check.length !== 40) { + throw new Error(`Wrong number of cards: ${card_check.length}`) + } + } else if (game.turn <=7) { + if (card_check.length !== 81) { + throw new Error(`Wrong number of cards: ${card_check.length}`) + } + } else if (card_check.length !== 110) { + throw new Error(`Wrong number of cards: ${card_check.length}`) + } + + + + //console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) + //Check if the Reformer is playable + check_reformer() + + // 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.active !== COM) { + next_player() + } + game.state = 'honecker' + return + } + else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) { + log_h2('Tiananmen Square Track Award') + if (game.active !== DEM) { + next_player() + } + game.return = game.active + clear_undo() + game.return_state = 'end_turn_4_5_4' + goto_vm(206) + return + } else if (game.com_tst_position >= 6 && game.dem_tst_position <= 5) { + log_h2('Tiananmen Square Track Award') + if (game.active !== COM) { + next_player() + } + game.return = game.active + clear_undo() + game.return_state = 'end_turn_4_5_4' + goto_vm(206) + return + } + else { + clear_undo() + game.state = 'end_turn_4_5_4' + return + } + } + + // Resolve end action round + //Stasi check + if(game.round_player === COM && game.persistent_events.includes(13)) { + //If in Honecker, turn ends + if (game.round === 8) { + clear_undo() + game.state = 'end_turn_4_5_4' + return + } + //Otherwise go to Stasi + game.round_player = DEM + if (game.active !== DEM) { + next_player() + } else { + log_h3('Democratic Action Round') + + } + if (game.democrat_hand.includes(game.stasi_card)) { + log_h3('C13') + game.state = 'stasi_play_card' + } else { + game.stasi_card = 0 + game.state = 'choose_card' + } + return + } + //Check if in extra Action Round + else if (game.round_player === COM && game.round === 8) { + clear_undo() + game.state = 'end_turn_4_5_4' + return + } + //Normal round end + else if (game.round_player===COM) { + game.round_player = DEM + if (game.active !== DEM) { + next_player() + } else { + log_h3('Democratic Action Round') + } + game.state = 'choose_card' + 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) { + next_player() + } + log_h3('C13') + game.state = 'stasi_end_round' + return + } else if(game.round_player === DEM && game.persistent_events.includes(5)){ + game.state = 'general_strike' + game.round ++ + log_h2(`Action Round ${game.round}`) + game.round_player = COM + if (game.active !== COM) { + next_player() + } + log_h3('C5') + return + } else { + game.state = 'choose_card' + game.round_player = COM + game.round ++ + log_h2(`Action Round ${game.round}`) + if (game.active !== COM) { + next_player() + } + } + } + //game.state = 'choose_card' Does this do anything any more? +} + +/* +function end_turn(){ + /*End Turn sequence + TST support check + Verify held cards + New Year's Eve Party + Advance Turn Marker + +// CHECK FOR OPTIONAL SUPPORT CHECK + if (game.dem_tst_position >=6 && game.com_tst_position <= 5) { + if (game.active !== DEM) { + next_player_() + } + game.state = 'tst_support_check' + } + if (game.com_tst_position >=6 && game.dem_tst_position <= 5) { + if (game.active !== COM) { + next_player_() + } + game.state = 'tst_support_check' + } + + +//CHECK HELD CARDS + +} */ + +function new_turn() { + clear_undo() + game.turn ++ + game.round = 1 + game.valid_spaces=[] + game.active = COM + game.round_player = COM + game.dem_tst_attempted_this_turn = 0 + game.com_tst_attempted_this_turn = 0 + if (game.tst_7) {game.tst_7 = false} + if (game.tst_8) {game.tst_8 = false} + + //Remove events that only last one 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*/ + delete game.prudence + delete game.stasi_card + + //Austria Hungary Border Reopened + if (game.persistent_events.includes(58)) { + game.persistent_events = game.persistent_events.filter(n => n !== 58) + delete game.austria_hungary_border_reopened_tracker + log(`C58 no longer in effect`) + //permanently_remove(58) + } + //Elena + if (game.persistent_events.includes(101)) { + game.persistent_events = game.persistent_events.filter(n => n !== 101) + log(`C101 no longer in effect`) + //permanently_remove(101) + } + //GrenzTruppen + if (game.persistent_events.includes(59)) { + game.persistent_events = game.persistent_events.filter(n => n !== 59) + log(`C59 no longer in effect`) + //permanently_remove(59) + } + //Foreign Currency Debt Burden + if (game.persistent_events.includes(49)) { + game.persistent_events = game.persistent_events.filter(n => n !== 49) + delete game.foreign_currency_debt_burden + log(`C49 no longer in effect`) + //permanently_remove(49) + } + //FRG Embassies + if (game.persistent_events.includes(74)) { + game.persistent_events = game.persistent_events.filter(n => n !== 74) + log(`C74 no longer in effect`) + discard_from_table(74) + permanently_remove(74) + } + //Genscher + if (game.persistent_events.includes(63)) { + game.persistent_events = game.persistent_events.filter(n => n !== 63) + log(`C63 no longer in effect`) + discard_from_table(63) + permanently_remove(63) + } + //Stand Fast + if (game.persistent_events.includes(100)) { + game.persistent_events = game.persistent_events.filter(n => n !== 100) + delete game.stand_fast + log(`C100 no longer in effect`) + //permanently_remove(100) + } + + if (game.samizdat_card > 0 ) { + game.democrat_hand.push(game.samizdat_card) + delete game.samizdat_card + } + + log_h1("Turn " + game.turn) + + if (game.turn === 4) { + add_midyear() + } + if (game.turn === 8) { + add_lateyear() + } + if (game.turn > 1) { + if (game.persistent_events.includes(65)) { + game.com_hand_limit = 7 + log('Communist draws 7 cards due to C65') + //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) + 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) + + } + + //Check if TST effects need to be resolved + if (game.dem_tst_position >=5 && game.com_tst_position <= 4) { + log_h2('Tiananmen Square Track award') + if(game.active !== DEM) { next_player() } + for (let card of game.democrat_hand) { + if (scoring_cards.includes(card)) continue + game.valid_cards.push(card) + } + game.state = 'tst_goddess' /* Goddess only name of Democrat bonus, not Communist*/ + return + } + else if (game.com_tst_position >=5 && game.dem_tst_position <= 4) { + log_h2('Tiananmen Square Track award') + if(game.active !== COM) { next_player() } + for (let card of game.communist_hand) { + if (scoring_cards.includes(card)) continue + game.valid_cards.push(card) + } + game.state = 'tst_goddess' + } else { + log_h2("Action Round " + game.round) + log_side() + //console.log('in start new AR call, game.active', game.active) + if (game.persistent_events.includes(5)) { + log_h3('C5') + game.state = 'general_strike' + } + else { + game.state = 'choose_card' + } + } +} + +function next_player() { + clear_undo() + //console.log('next player called') + if (game.active === DEM) + game.active = COM + else + game.active = DEM + + log_side() +} + +function change_player() { + clear_undo() + //console.log('next player called') + if (game.active === DEM) + game.active = COM + else + game.active = DEM +} + +function find_space_index(name_unique) { + return spaces.findIndex(space => space && space.name_unique === name_unique) +} + +function find_country_index(country) { + return countries.indexOf(country) +} + +function draw_deck(deck) { + return deck.filter(card => card && card.period === 1).map(card => card.number) +} + +function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { + //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) + 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 ) + if (deck.length === 0) { + log_h3('--- Reshuffle ---') + + deck.push(...game.strategy_discard) + game.strategy_discard = [] + } + + else if (turn === 'communist' && communist_hand.length < com_hand_limit) { + communist_hand.push(draw_card(deck)); + //console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards)); + turn = 'democrat'; + } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { + turn = 'democrat'; + } + else if (turn === 'democrat' && democrat_hand.length < dem_hand_limit) { + democrat_hand.push(draw_card(deck)); + //console.log('democrat_hand: ', democrat_hand) + + //console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards)); + turn = 'communist'; + } + else if (turn === 'democrat' && democrat_hand.length === dem_hand_limit) { + turn = 'communist'; + } + } + + clear_undo() +} + +function draw_card(deck) { + //console.log('draw card called with:', deck) + //console.log('game.strategy_deck before', game.strategy_deck) + if (deck.length === 0) { + log_h3('--- Reshuffle ---') + + deck.push(...game.strategy_discard) + game.strategy_discard = [] + } + const randomIndex = Math.floor(Math.random() * deck.length) + //console.log('card chosen:', randomIndex) + //console.log('game.strategy_deck after', game.strategy_deck) + return deck.splice(randomIndex, 1)[0]; +} + +function discard(card) { + //console.log('in discard(card)') + let find_card + if (!game.is_pwr_struggle) { + + if (game.active === COM) { + find_card = game.communist_hand.indexOf(card) + game.communist_hand.splice(find_card, 1) + } else { + find_card = game.democrat_hand.indexOf(card) + game.democrat_hand.splice(find_card, 1) + } + if (!game.strategy_discard.includes(card)) { + game.strategy_discard.push(card) + log(`Discarded C${cards[card].number}`) + } + } else if (game.is_pwr_struggle) { + if (game.active === COM) { + find_card = game.com_pwr_hand.indexOf(card); + game.com_pwr_hand.splice(find_card, 1); + } else { + find_card = game.dem_pwr_hand.indexOf(card); + game.dem_pwr_hand.splice(find_card, 1); + } + + game.power_struggle_discard.push(card) + //log(`Discarded P${power_cards[card].number}`) + } +} +function silent_discard(card) { + //console.log('in discard(card)') + let find_card + if (!game.is_pwr_struggle) { + if (game.active === COM) { + find_card = game.communist_hand.indexOf(card) + game.communist_hand.splice(find_card, 1) + } else { + find_card = game.democrat_hand.indexOf(card) + game.democrat_hand.splice(find_card, 1) + } + if (!game.strategy_discard.includes(card)) { + game.strategy_discard.push(card) + } + } else if (game.is_pwr_struggle) { + if (game.active === COM) { + find_card = game.com_pwr_hand.indexOf(card); + game.com_pwr_hand.splice(find_card, 1); + } else { + find_card = game.dem_pwr_hand.indexOf(card); + game.dem_pwr_hand.splice(find_card, 1); + } + game.power_struggle_discard.push(card) + } +} + +function remove_from_discard(card) { + let card_index = game.strategy_discard.indexOf(card) + if (card_index !== -1) { + game.strategy_discard.splice(card_index, 1) + } +} + +function discard_card(hand) { + //let find_card + let card = Math.floor(Math.random()*hand.length) + let discarded_card = hand.splice(card, 1)[0] + if (game.is_pwr_struggle) { + if (numberless_cards.includes(discarded_card)) { + log_gap(`Discarded: P${discarded_card}`) + } else { + log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) + } + } else { + log(`Discarded C${cards[discarded_card].number}`) + game.strategy_discard.push(discarded_card) + } + return discarded_card +} + +function discard_from_table(card) { + find_card = game.table_cards.indexOf(card) + game.table_cards.splice(find_card, 1) + game.strategy_discard.push(card) +} + + +function add_midyear() { + const mid_year = cards.filter(card => card && card.period === 2).map(card => card.number); + game.strategy_deck.push(...mid_year); + log_h3('Mid-year cards added to draw deck') +} + + +function add_lateyear() { + const late_year = cards.filter(card => card && card.period === 3).map(card => card.number) + game.strategy_deck.push(...late_year) + log_h3('Late-year cards added to draw deck') +} + +function reset_power() { + game.power_struggle_deck = [] + game.power_struggle_discard = [] + game.dem_pwr_hand = [] + game.com_pwr_hand = [] + game.phase = 1 + game.raised_stakes_round = 0 + game.raised_stakes = 0 + game.played_power_card = 0 + game.tactics_fails = '' + game.view_opp_hand = false + + if (game.persistent_events.includes(72)){ + permanently_remove(72) + game.table_cards = game.table_cards.filter(card => card !== 72) + game.persistent_events = game.persistent_events.filter(n => n !== 72) + } + if (game.persistent_events.includes(62)) { + permanently_remove(62) + game.table_cards = game.table_cards.filter(card => card !== 62) + game.persistent_events = game.persistent_events.filter(n => n !== 62) + } + if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ + permanently_remove(54) + //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) + } +} + +function check_control_change(space_id) { + + // Check if the Tyrant is Gone has been fulfilled + + if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { + log('+2 VP from C97') + game.vp += 2 + if (check_vp()) { + return + } + game.persistent_events = game.persistent_events.filter(n => n !== 97) + delete game.the_tyrant_is_gone + } +} + +function check_systematization() { + // Check for Systematization - may not use this space + if (game.systematization > 0) { + game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) + } +} + +function check_common_european_home() { + if (!game.playable_cards.includes(21)) { + game.playable_cards.push(21) + } +} + +function this_card() { + return game.vm_event > 0 ? game.vm_event : game.played_card +} +/* +function get_ops(card) { + let ops = cards[card].ops + if (game.active === COM) { + //Check TST op bonus + if (ops === 1 && game.com_tst_position >=2 && game.dem_tst_position <=1) { + ops++ + } + //Events that influence ops + if (game.persistent_events.includes(25)) { + ops++ + } + if (game.prudence.COM && game.prudence.COM <0) { + ops += game.prudence.COM + } + + } else { + //Check TST op bonus + if (ops === 1 && game.dem_tst_position >=2 && game.com_tst_position <=1) { + ops++ + } + //Events that influence ops + if (game.persistent_events.includes(50)) { + ops++ + } + if (game.prudence.DEM && game.prudence.DEM <0) { + ops += game.prudence.DEM + } + } + //Ops can never be less than one + if (ops <1) { ops = 1 } + return ops +} + */ + +const pluralize = (count, noun, suffix = 's') => + `${count} ${noun}${Math.abs(count) !== 1 ? suffix : ''}` + +function clean_name(str) { + if (str && str.slice(-1) === '*') { + return str.slice(0, -1) + } else { + return str; + } +} + +function country_name(country) { + return country.replace(/_/g, ' ') +} + +// ======== LOG FUNCTIONS ============= + +function log(msg) { + game.log.push(msg) +} + +function log_br() { + if (game.log.length > 0 && game.log[game.log.length - 1] !== "") + game.log.push("") +} + +function logi(msg) { + game.log.push(">" + msg) +} + +function log_h1(msg) { + log_br() + log(".h1 " + msg) + log_br() +} + +function log_h2(msg) { + log_br() + log(".h2 " + msg) + log_br() +} + +function log_h3(msg) { + log_br() + log(".h3 " + msg) +} + +function log_gap(msg) { + log_br() + game.log.push(msg) +} + +function log_msg_gap(msg) { + game.log.push(msg) + log_br() +} + + +function log_side() { + log_br() + if (game.active === DEM) + log(".h2d " + game.active) + else + log(".h2c " + game.active) + log_br() +} + +function log_sep() { + log(".hr") +} + +function log_action(msg) { + log_br() + log(msg) +} + +// ============= SUMMARY FUNCTIONS ============= + +function push_summary() { + if (game.summary) + throw "TOO MANY SUMMARIES" + game.summary = [] +} + +function log_summary(msg) { + + if (msg.startsWith('Added') || msg.startsWith('Removed')) { + for (let item of game.summary) { + if (item[1] === msg) { + item[0]++ + return + } + } + } + game.summary.push([1, msg]) +} + +function pop_summary() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + log(msg.replace("£ SP", `${n} SPs`)); + } else { + log(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + +function log_summary_place(p) { + let from = piece_space(p) + if (from !== AVAILABLE) + log_summary("% " + piece_name(p) + " from S" + from) + else + log_summary("% " + piece_name(p)) +} + +function log_summary_move_to_from(p, to) { + log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p)) +} + +function log_summary_remove(p) { + log_summary("Removed % " + piece_name(p)) +} + +function log_summary_activated(p) { + log_summary("Activated % " + piece_faction_name(p)) +} + +// ============ UNDO FUNCTIONS ================== + +function clear_undo() { + if (game.undo.length > 0) + game.undo = [] +} + +function push_undo() { + let copy = {} + for (let k in game) { + let v = game[k] + if (k === "undo") + continue + else if (k === "log") + v = v.length + else if (typeof v === "object" && v !== null) + v = object_copy(v) + copy[k] = v + } + game.undo.push(copy) +} + +function pop_undo() { + let save_log = game.log + let save_undo = game.undo + game = save_undo.pop() + save_log.length = game.log + game.log = save_log + game.undo = save_undo +} + +// Fast deep copy for objects without cycles +function object_copy(original) { + if (Array.isArray(original)) { + let n = original.length + let copy = new Array(n) + for (let i = 0; i < n; ++i) { + let v = original[i] + if (typeof v === "object" && v !== null) + copy[i] = object_copy(v) + else + copy[i] = v + } + return copy + } else { + let copy = {} + for (let i in original) { + let v = original[i] + if (typeof v === "object" && v !== null) + copy[i] = object_copy(v) + else + copy[i] = v + } + return copy + } +} + + +/* =================== VM FUNCTIONS ========================== */ + +function goto_vm(proc) { + let old_vm = game.vm; + + game.state = "vm"; + game.vm = { + prompt: 0, + fp: proc, + ip: 0, + }; + + if (old_vm) { + game.vm.return_vm = old_vm; + } + + vm_exec(); +} + +function vm_exec() { + vm_inst(0)(); +} + +function vm_inst(a) { + //console.log('game.vm.fp', game.vm.fp, 'game.vm.ip', game.vm.ip) + return CODE[game.vm.fp][game.vm.ip][a] +} + +function vm_next() { + game.vm.ip++; + //console.log('vm_next called, game.vm.ip', game.vm.ip) + vm_exec(); +} + +function vm_operand(a) { + let x = CODE[game.vm.fp][game.vm.ip][a] + if (a > 0 && typeof x === "function") + return x() + return x +} + +function vm_assert_argcount(n) { + const argcount = CODE[game.vm.fp][game.vm.ip].length - 1 + if (argcount !== n) + throw Error(`ASSERT Invalid number of arguments on event ${game.vm.fp}: ${argcount} instead of ${n}`) +} + +function vm_log() { + log(vm_operand(1)); + vm_next(); +} + +function vm_if() { + //console.log('game.temp', game.temp) +// console.log('vm_operand(1)', vm_operand(1)) + if (!vm_operand(1)) { + let balance = 1 + while (balance > 0) { + ++game.vm.ip + switch (vm_operand(0)) { + case vm_if: + ++balance + break + case vm_endif: + --balance + break + case vm_else: + if (balance === 1) + --balance + break + } + if (game.vm.ip < 0 || game.vm.ip > CODE[game.vm.fp].length) + throw "ERROR" + } + } + vm_next() +} + +function vm_else() { + vm_goto(vm_endif, vm_if, 1, 1) +} + +function vm_endif() { + vm_next() +} + +function vm_goto_step(step) { + // console.log('vm_goto_step called, target:', step) + //console.log('game.vm.ip', game.vp.ip) + for (let i = game.vm.ip; i < CODE[game.vm.fp].length; i++) { + //console.log('i', i) + //console.log('step', CODE[game.vm.fp][i][0]) + if (CODE[game.vm.fp][i][0] === step) { + game.vm.ip = i; + vm_exec(); + return; + } + } + + console.log("ERROR: Target operation not found in the current procedure."); +} + + +function vm_goto(op, nop, dir, step) { + //console.log('vm_inst(0)', vm_inst(0), op, nop) +// console.log('vm_inst(0)', vm_inst(1), op, nop) + let balance = 1 + while (balance > 0) { + game.vm.ip += dir + if (vm_inst(0) === op) + --balance + if (vm_inst(0) === nop) + ++balance + if (game.vm.ip < 0 || game.vm.ip > CODE[game.vm.fp].length) + throw "ERROR" + } + game.vm.ip += step + vm_exec() +} + +function event_prompt(str) { + //console.log('event_prompt called with', str) + if (typeof str === "undefined") + str = CODE[game.vm.fp][game.vm.prompt][1] + if (typeof str === "function") + str = str() + //console.log('str:', str) + if (!str) { + str = "" + } + return str +} + +function vm_prompt() { + if (game.vm.prompt) + game.vm._prompt = game.vm.prompt + game.vm.prompt = game.vm.ip + vm_next() +} + +function pop_vm_prompt() { + if (game.vm._prompt) { + game.vm.prompt = game.vm._prompt + delete game.vm._prompt + } else { + game.vm.prompt = 0 + } +} + +function vm_return() { + + //console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) + + //Remove temporary vm variables + delete game.support_check_modifier + delete game.vm_max_infl + delete game.vm_influence_added + delete game.communist_hand_red + + game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ + if (game.persistent_events.includes(58)) { + reset_austria_hungary_border_reopened() + } + + //Check if end event state is needed + if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { + vm_end_event() + } + //Check if auto-resolve opponent event + else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { + vm_end_event() + } + else { + + game.state = 'vm_end_event' + /*if (!game.vm_infl_to_do) { + /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { + game.state = 'vm_end_event' + } else { + game.state = 'vm_end_event' + //end_round() + //} + } else { + console.log('vm_infl_to_do true') + vm_end_event() + }*/ + } +} + +function vm_end_event() { + //game.view_opp_hand = false +// console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) + /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { + if (game.round_player !== game.active) { + change_player() + log_h2('End of Action Round') + } + end_round() + return + } /*Go direct to end round if card fully resolved */ + if (game.return !== game.active) { + next_player()} + if (game.return_state === 'power_struggle') { + do_valid_cards() + } + if (game.return_state && game.return_state !== '') { + game.state = game.return_state + //console.log( 'game.state', game.state) + } + else if (game.vm_infl_to_do) { + game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ + //else {game.state = "play_card"} + else{ + end_round()} +} + +/* ================== VM ACTIONS =========================== */ + +function vm_opp_hand_false() { + game.view_opp_hand = false + vm_next() +} + +function vm_valid_spaces() { + let space_1 = vm_operand(1) + let space_2 = vm_operand(2) + let space_3 = vm_operand(3) + let space_4 = vm_operand(4) + let space_5 = vm_operand(5) + let space_6 = vm_operand(6) + game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] + game.valid_spaces = game.valid_spaces.filter( n => n ) + + // Check for Systematization - may not use this space + check_systematization() + + vm_next() +} + +function vm_valid_spaces_opponent () { + let valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + + if (game.active === DEM) { + let infl = game.comInfl[i] + if (infl > 0) { + valid_spaces.push(space.space_id) + } + } else { + infl = game.demInfl[i] + if (infl > 0) { + valid_spaces.push(space.space_id) + } + } + } + game.valid_spaces = valid_spaces +// console.log('game.valid_spaces', game.valid_spaces) + vm_next() +} + +function vm_valid_spaces_socio () { + let valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + + if (space.socio === vm_operand(1)) { + valid_spaces.push(space.space_id) + } + } + game.valid_spaces = valid_spaces + + // Check for Systematization - may not use this space + if (game.systematization && game.systematization > 0) { + game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) + } + vm_next() +} + +function vm_valid_spaces_opponent_socio () { + let valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + + if (game.active === DEM) { + let infl = game.comInfl[i] + if (infl > 0 && space.socio === vm_operand(1)) { + valid_spaces.push(space.space_id) + } + } else { + let infl = game.demInfl[i] + if (infl > 0 && space.socio === vm_operand(1)) { + valid_spaces.push(space.space_id) + } + } + } + game.valid_spaces = valid_spaces + // Check for Systematization - may not use this space + if (game.systematization && game.systematization > 0) { + game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) + } + vm_next() +} + +function vm_valid_spaces_country () { + let country + if (vm_operand(1)) {country = vm_operand(1)} + else {country = game.vm_active_country} + for (let space of spaces) { + if (!space) continue + if (space.country === country) { + game.valid_spaces.push(space.space_id); + } + } + // Check for Systematization - may not use this space + if (game.systematization && game.systematization > 0) { + game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) + } + vm_next() +} + +function vm_valid_spaces_sc () { + valid_spaces_sc() + vm_next() +} + +function vm_valid_spaces_country_opp () { + let country = '' + + if (vm_operand(1)) { + country = vm_operand(1) } + else { + country = game.vm_active_country + } + for (let space of spaces) { + if (!space) continue + if (game.active === DEM) { + if (space.country === country && game.comInfl[space.space_id] >0) { + game.valid_spaces.push(space.space_id); + } + } else { + if (space.country === country && game.demInfl[space.space_id]>0) { + game.valid_spaces.push(space.space_id); + } + } + } + vm_next() +} + +function vm_valid_spaces_country_sc () { + let valid_spaces = [] + let country = '' + //console.log('in vm_valid_spaces_country_sc') + if (vm_operand(1)) { + country = vm_operand(1) } + else { + country = game.vm_active_country + } + for (let space of spaces) { + if (!space) continue + if (game.active === DEM) { + if (space.country === country && game.comInfl[space.space_id] >0) { + valid_spaces.push(space.space_id); + } + } else { + if (space.country === country && game.demInfl[space.space_id] >0) { + //Check Solidarity Legalised + if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + + //Check Civic Forum + if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + + //Check We are the People + if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + valid_spaces.push(space.space_id); + + //Check Foreign Currency Debt Burden + if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} + } + } + } + game.valid_spaces = valid_spaces + + //Check for Foreign Currency Debt Burden + /*if (game.persistent_events.includes(49) && game.active === COM) { + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country !== game.foreign_currency_debt_burden) + }*/ + vm_next() +} + +function vm_valid_spaces_country_socio_2() { + for (let space of spaces) { + if (!space) continue + if (space.space_id === game.systematization) continue + if ((space.country === vm_operand(1) && space.socio === vm_operand(2)) || (space.country === vm_operand(1) && space.socio === vm_operand(3))) { + game.valid_spaces.push(space.space_id); + } + } + vm_next() +} + +function vm_valid_spaces_region_socio() { + let valid_spaces = [] + for (let space of spaces) { + if (!space) continue + if (space.space_id === game.systematization) continue + if (space.region === vm_operand(1) && space.socio === vm_operand(2)) { + valid_spaces.push(space.space_id); + } + } + game.valid_spaces = valid_spaces + vm_next() +} + +function vm_valid_spaces_region_opp() { + let valid_spaces = [] + for (let space of spaces) { + if (!space) continue + let s = space.space_id + if ((game.active === DEM && space.region === vm_operand(1) && game.comInfl[s] > 0 ) || (game.active === COM && space.region === vm_operand(1) && game.demInfl[s] > 0 )) { + valid_spaces.push(space.space_id); + } + } + game.valid_spaces = valid_spaces + vm_next() +} + +function vm_valid_spaces_solidarity_legalised() { + let valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + let uncontrolled = (!check_control(i) && !check_opp_control(i)) + if ((space.country === 'Poland' && uncontrolled && space.socio === 3) || (space.country === 'Poland' && uncontrolled && space.socio === 4)) { + valid_spaces.push(space.space_id); + } + } + game.valid_spaces = valid_spaces + vm_next() +} + +function vm_active_country () { + game.valid_spaces = game.valid_spaces.filter(space_id => { + let space = spaces.find(s => s && s.space_id === space_id); + return space && space.country === game.vm_active_country; + }); + vm_next() +} + +function vm_take_control_prep() { + game.vm_available_ops = vm_operand(1) + game.state = 'vm_take_control' +} + +function vm_take_control(space) { + if (game.active === DEM) { + let current_infl = game.demInfl[space] + let opponent_infl = game.comInfl[space] + let stability = spaces[space].stability + + if ((current_infl - opponent_infl) < stability) { + game.demInfl[space] += stability - current_infl + opponent_infl + //game.pieces[space].demCtrl = 1 + //game.pieces[space].comCtrl = 0 + } + } else if (game.active === COM) { + let current_infl = game.comInfl[space] + let opponent_infl = game.demInfl[space] + let stability = spaces[space].stability + + if ((current_infl - opponent_infl) < stability) { + game.comInfl[space] += stability - current_infl + opponent_infl + //game.pieces[space].comCtrl = 1 + //game.pieces[space].demCtrl = 0 + } + } + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + log(`Took control of %${space}`) +} + + +function vm_do_add_infl(space) { + push_undo() + //console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) + + //log(`Added 1 influence in %${space}.`) + + log_summary(`Added £ SP in %${space}.`) + + //If AHBR - check AHBR condition + if (game.persistent_events.includes(58)) { + if (spaces[space].country !== 'East_Germany'){ + game.austria_hungary_border_reopened_tracker = false + } + } + + // Check Genscher + if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { + game.vm_available_ops-- + log_summary(`(-1 op due to C63)`) + } else if (check_opp_control(space)) { + game.vm_available_ops -= 2 + //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative + if (game.vm_available_ops < 0) { + log_summary(`(Used +1 op from C58)`) + } + } else { + game.vm_available_ops-- + } + + // Update influence values + if (game.active === COM) { + game.comInfl[space]++ + } else { + game.demInfl[space]++ + } + + // Check whether spaces are controlled + check_control_change(space) + + // Check Austria Hungary Border Reopened is true and condition has been met + if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { + //console.log('in award extra op') + game.vm_available_ops ++ + log('+1 Op from C58') + game.austria_hungary_border_reopened_tracker = false + game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') + } + + // If only 1 IP remaining, may not place in opponent controlled spaces + + // Check for Genscher & Austria Hungary Border Reopened + + if (game.vm_available_ops === 1) { + + if (game.active === DEM) { + //Check Genscher and AHBR + if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { + game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) + } else { + game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) + } + } else { + game.valid_spaces = game.valid_spaces.filter(n => !check_dem_control(n)) + } + } + + //Clear valid spaces if no IP remaining. + if (game.vm_available_ops <= 0 ) { + game.valid_spaces = [] + } +} + +function vm_do_add_infl_free(space) { + push_undo() + //log(`Added 1 influence in %${space}.`) + + log_summary(`Added £ SP in %${space}.`) + + // Update influence values + if (game.active === COM) { + game.comInfl[space]++ + } else { + game.demInfl[space]++ + } + game.vm_available_ops-- + // Check whether spaces are controlled + check_control_change(space) + + + //console.log('game pieces:', game.pieces[space]) +} + +function vm_add_infl() { + if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} + game.state = 'vm_add_infl' +} + +function vm_add_infl_free() { + if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} + game.state = 'vm_add_infl_free' +} + +function vm_add_x_infl() { + game.vm_available_ops = vm_operand(1) + game.state = 'vm_add_x_infl' +} + +function vm_do_add_x_infl(space) { + push_undo() + log(`Added ${game.vm_available_ops} SPs in %${space}.`) + + + if (game.active === COM) { + game.comInfl[space] += game.vm_available_ops + } else { + game.demInfl[space] += game.vm_available_ops + } + check_control_change(space) + game.vm_available_ops = 0 + game.valid_spaces = [] +} + +function vm_add_limited_infl() { + game.vm_available_ops = vm_operand(1) + game.vm_max_infl = vm_operand(2) + game.state = 'vm_add_limited_infl' +} + +function vm_do_add_limited_infl(space, max_infl) { + push_undo() + //log(`Added 1 influence in %${space}.`) + + log_summary(`Added £ SP in %${space}.`) + game.vm_available_ops -- + + if (!game.vm_influence_added) { + game.vm_influence_added = {}; + } + + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; + } + + if (game.active === COM) { + game.comInfl[space] ++ + } else { + game.demInfl[space] ++ + } + + game.vm_influence_added[space] ++ + + //console.log('valid_spaces before update', game.valid_spaces) + //console.log('influence added:', game.vm_influence_added[space], 'max infl', max_infl) + if (game.vm_influence_added[space] === max_infl) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + check_control_change(space) + if (game.vm_available_ops === 0) {game.valid_spaces = [] } +} + +function vm_remove_infl() { + game.vm_available_ops = vm_operand(1) + game.state = 'vm_remove_infl' +} + +function vm_remove_opp_infl() { + game.vm_available_ops = vm_operand(1) + game.remove_opponent_infl = true + if (game.is_pwr_struggle) { + game.state = 'vm_scare_tactics' + } else { + game.state = 'vm_remove_infl' + } +} + +function vm_remove_x_opp_infl() { + game.vm_available_ops = vm_operand(1) + game.remove_opponent_infl = true + game.state = 'vm_remove_x_infl' +} + +function vm_do_remove_infl(space) { + push_undo() + //log(`Removed 1 influence from %${space}.`) + log_summary(`Removed £ SP from %${space}.`) + + if (!game.vm_influence_added) { + game.vm_influence_added = {}; + } + + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; + } + if (game.remove_opponent_infl === true) { + if (game.active === COM) { + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } else { + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } + + + } else { + if (game.active === COM) { + game.comInfl[space]-- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } else { + game.demInfl[space]-- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + } + } + check_control_change(space) + game.vm_influence_added[space]++ + game.vm_available_ops-- + if (game.vm_available_ops===0) {game.valid_spaces = []} +} + +function vm_do_remove_x_infl(space) { + push_undo() + + if (game.remove_opponent_infl) { + if (game.active === COM) { + if (game.demInfl[space] >= game.vm_available_ops) { + game.demInfl[space] -= game.vm_available_ops + } else { + game.vm_available_ops = game.demInfl[space] + game.demInfl[space] -= game.vm_available_ops + } + } else { + if (game.comInfl[space] >= game.vm_available_ops) { + game.comInfl[space] -= game.vm_available_ops + } else { + game.vm_available_ops = game.comInfl[space] + game.comInfl[space] -= game.vm_available_ops + } + } + } else { + if (game.active === COM) { + if (game.comInfl[space] >= game.vm_available_ops) { + game.comInfl[space] -= game.vm_available_ops + } else { + game.vm_available_ops = game.comInfl[space] + game.comInfl[space] -= game.vm_available_ops + } + } else { + if (game.demInfl[space] >= game.vm_available_ops) { + game.demInfl[space] -= game.vm_available_ops + } else { + game.vm_available_ops = game.demInfl[space] + game.demInfl[space] -= game.vm_available_ops + } + } + } + + log(`Removed ${game.vm_available_ops} SPs from %${space}`) + check_control_change(space) + + game.vm_available_ops = 0 + game.valid_spaces = [] +} + +function vm_remove_limited_opp_infl() { + game.vm_available_ops = vm_operand(1) + game.vm_max_infl = vm_operand(2) + game.remove_opponent_infl = true + game.state = 'vm_remove_limited_infl' +} + +function vm_do_remove_limited_infl(space, max_infl) { + push_undo() + log(`Removed SP from %${space}.`) + game.vm_available_ops -- + + + if (!game.vm_influence_added) { + game.vm_influence_added = {}; + } + + if (!game.vm_influence_added[space]) { + game.vm_influence_added[space] = 0; + } + + if (game.active === COM) { + game.demInfl[space] -- + if (game.demInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + } + } else { + game.comInfl[space] -- + if (game.comInfl[space] === 0) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space) + } + } + + game.vm_influence_added[space] ++ + + if (game.vm_influence_added[space] === max_infl) { + game.valid_spaces = game.valid_spaces.filter(id => id !== space); + } + + check_control_change(space) + if (game.vm_available_ops === 0) {game.valid_spaces = []} +} + +function vm_remove_all_infl() { + game.vm_available_ops = vm_operand(1) + game.state = 'vm_remove_all_infl' +} + +function vm_do_remove_all_infl(space) { + push_undo() + log(`Removed all SP from %${space}.`) + + if (game.remove_opponent_infl === true) { + if (game.active === COM) { + game.demInfl[space] = 0 + } else { + game.comInfl[space] = 0 + } + check_control_change(space) + + } else { + if (game.active === COM) { + game.comInfl[space] = 0 + } else { + game.demInfl[space] = 0 + } + check_control_change(space) + } + game.vm_available_ops -- + game.valid_spaces = game.valid_spaces.filter(id => id !== space) +} + +function vm_replace_all_infl(space_id) { + if (game.active === DEM) { + game.demInfl[space_id] += game.comInfl[space_id] + game.comInfl[space_id] = 0 + } else { + game.comInfl[space_id] += game.demInfl[space_id] + game.demInfl[space_id] = 0 + } + check_control_change(space_id) +} + +function vm_1_support_check() { + game.vm_available_ops = 1 + game.state = 'vm_1_support_check_prep' +} + +function vm_support_check() { + game.vm_available_ops = vm_operand(1) + game.state = 'vm_support_check_prep' +} + +function vm_support_check_modified() { + game.vm_available_ops = vm_operand(1) + game.support_check_modifier = vm_operand(2) + game.state = 'vm_support_check_prep' +} + +function vm_switch_infl(id){ + push_undo() + + game.demInfl[id] -= game.vm_available_ops + game.comInfl[id] += game.vm_available_ops + log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${id}`) + game.vm_available_ops = 0 + check_control_change(id) +} + +/* ===================== EVENT SPECIFIC FUNCTIONS ========== */ + +function vm_40th_anniversary_celebration() { + if (game.vp < 0 ) {game.vm_available_ops = 4} + else {game.vm_available_ops = 2} + vm_next() +} + +function vm_40th_anniversary_celebration_vp() { + game.vp -- + log('-1VP') + if (check_vp()) { + return + } + vm_next() +} + +function vm_adamec() { + game.state = '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) + }*/ + vm_next() +} + +function vm_austria_hungary_border_reopened() { + game.persistent_events.push(58) + permanently_remove(58) + game.austria_hungary_border_reopened_tracker = false + //game.table_cards.push(58) + //remove_from_discard(58) + vm_next() +} + +function vm_betrayal() { + if (game.demInfl[58] > 0 ) { game.valid_spaces.push(58) } + if (game.demInfl[65] >0 ) { game.valid_spaces.push(65) } + game.vm_available_ops = Math.max(game.demInfl[58], game.demInfl[65]) + game.state = 'vm_switch_infl' +} + +function vm_breakaway_baltic_republics() { + log('+5 VP') + game.vp += 5 + game.stability++ + if (check_vp()) { + return + } + game.playable_cards.push(109) + game.playable_cards = game.playable_cards.filter(n => n !== 14) + if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} + if (!check_dem_control(70)) {game.valid_spaces.push(70)} + vm_next() +} + +function vm_brought_in_for_questioning() { + if (game.active === COM) { + game.active = DEM + } + //game.return = game.active + game.phase = 0 + game.state = 'vm_brought_in_for_questioning' +} + +function vm_bulgarian_turks_expelled(){ + game.remove_opponent_infl = true + game.vp -= 2 + log('-2VP') + if (check_vp()) { + return + } + if (game.demInfl[70] > 0) {game.valid_spaces = [70]} + vm_next() +} + +function vm_ceausescu() { + let adj_cluj = false + if (game.demInfl[50] > 0 ) {adj_cluj = true} + if (game.demInfl[54] > 0 ) {adj_cluj = true} + if (game.demInfl[58] > 0 ) {adj_cluj = true} + if (game.demInfl[61] > 0 ) {adj_cluj = true} + + if (adj_cluj && game.comInfl[61]>0) { + game.valid_spaces = [61] + game.vm_available_ops = 1 + //next_player() + game.remove_opponent_infl = false + game.state = 'vm_remove_infl' + } + else {vm_next()} +} + +function vm_central_committee_reshuffle() { + game.state = 'vm_central_committee_reshuffle' +} + +function vm_civic_forum() { + log('+1 VP') + game.vp++ + if (check_vp()) { + return + } + game.persistent_events.push(90) + if (check_dem_control(31)) { + vm_next() + } else { + permanently_remove(90) + vm_return() + } +} + +function vm_common_european_home() { + let valid_cards = []; + for (let c of cards) { + //if (c === null) {continue} + if (game.active === DEM) { + if (c && c.side === 'C') { + valid_cards.push(c.number) + } + } else { + if (c && c.side === 'D') { + valid_cards.push(c.number) + } + } + } + game.valid_cards = valid_cards + game.state = 'vm_common_european_home_choose' +} + +function vm_dash_for_the_west() { + game.valid_cards = [] + for (let c of game.strategy_discard) { + if (cards[c].side === 'D' && cards[c].remove === 1 && (cards[c].playable || game.playable_cards.includes(c))) { + game.valid_cards.push(c) + } + } + game.state = 'vm_dash_for_the_west' +} + +function vm_deutsche_marks() { + let max_value = 1; + for (let c of game.democrat_hand) { + if (cards[c].ops > max_value) { + max_value = cards[c].ops + } + } + let valid_cards = []; + for (let c of game.democrat_hand) { + if (cards[c].ops === max_value) { + valid_cards.push(c); + } + } + game.valid_cards = valid_cards + game.state = 'vm_deutsche_marks_prep' +} + +function vm_domino_theory() { + game.discard = true + for (let card of game.strategy_discard) { + if (scoring_cards.includes(card)) {game.valid_cards.push(card) } + } + game.phase = 0 + game.state = 'vm_play_event_from_discard' +} + +function vm_eco_glasnost() { + game.persistent_events.push(39) + vm_next() +} + +function vm_elena(){ + game.persistent_events.push(101) + vm_next() +} + +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 === 61) { + game.demInfl[space_id] = 0 + game.comInfl[space_id] = 0 + } else { + game.demInfl[space_id] = 0 + game.comInfl[61] += game.comInfl[space_id] + if (game.comInfl[space_id] > 0 ) { + log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) + } + game.comInfl[space_id] = 0 + } + //Update control in the eliminated space and in Bucuresti + check_control_change(space_id) + check_control_change(61) + +} + +function get_adjusted_adjacency(space_id) { + let adjacent_spaces = spaces[space_id].adjacent; + if (adjacent_spaces.includes(game.systematization)) { + //console.log('in get adjusted adjacency, systemization',game.systematization) + //console.log('adjacent_spaces', adjacent_spaces) + } + if (game.systematization !== 0) { + //console.log('in systematization check') + let eliminated_space_id = game.systematization; + + return adjacent_spaces.map(adj_space_id => { + if (adj_space_id === eliminated_space_id) { + // Replace the eliminated space with its adjacencies + //console.log('in map check, return', spaces[eliminated_space_id].adjacent) + return spaces[eliminated_space_id].adjacent; + } + //console.log('2nd check, return', adj_space_id) + return adj_space_id; + }).flat(); // Flatten in case the eliminated space has multiple adjacencies + } + //console.log('final adjacent spaces', adjacent_spaces) + return adjacent_spaces; +} + +function vm_exit_visas() { + game.state = 'vm_exit_visas' +} + +function vm_foreign_currency_debt_burden() { + log('+1VP') + game.vp++ + if (check_vp()) { + return + } + //game.table_cards.push(49) + //remove_from_discard(49) + game.persistent_events.push(49) + game.state = 'vm_foreign_currency_debt_burden' +} + +function vm_foreign_television() { + for (let i = 1 ; i < spaces.length; i++) { + if (i === 12) {continue} /*Does not apply to Dresden*/ + if (game.comInfl[i] > 0 ) { + game.valid_spaces.push(i) + } + } + vm_next() +} +function vm_frg_embassies() { + game.persistent_events.push(74) + game.table_cards.push(74) + remove_from_discard(74) + log('C74 in effect') + vm_next() +} + +function vm_general_strike() { + game.persistent_events.push(5) + game.table_cards.push(5) + remove_from_discard(5) + log('C5 in effect') + vm_next() +} + +function vm_genscher() { + game.persistent_events.push(63) + game.table_cards.push(63) + remove_from_discard(63) + log(`C63 in effect`) + vm_next() +} + +function vm_goodbye_lenin() { + game.view_opp_hand = true + game.communist_hand_red = [] + // Select Red cards to show + for (let card of game.communist_hand) { + if (cards[card].red) { + game.communist_hand_red.push(card) + } + } + //Check if these cards are playabl + for (let card of game.communist_hand_red) { + if (cards[card].playable || game.playable_cards.includes(card)) { + game.valid_cards.push(card) + } + } + game.state = 'vm_goodbye_lenin' +} + +function vm_government_resigns() { + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (space.socio === 1 && game.comInfl[i] > 0 && !check_control(i)) { + game.valid_spaces.push(i) + } + } + game.remove_opponent_infl = true + vm_next() +} + +function vm_grenztruppen() { + game.persistent_events.push(59) + permanently_remove(59) + //game.table_cards.push(59) + //remove_from_discard(59) + vm_next() +} + +function vm_heal_our_bleeding_wounds() { + let change_vp = 0 + if (game.turn <= 3) {change_vp = -3 } + else if (game.turn <= 7) {change_vp = -1} + else change_vp = 3 + if (change_vp >0) { + log(`+${change_vp} VP`) + } else { + log(`-${change_vp} VP`) + } + game.vp += change_vp + if (check_vp()) { + return + } + vm_next() +} + +function vm_helsinki_final_act() { + game.persistent_events.push(26) + vm_next() +} + +function vm_honecker() { + game.persistent_events.push(15) + game.valid_cards = [] + for (let c of game.strategy_discard) { + if (scoring_cards.includes(c)) { + continue} + else { + game.valid_cards.push(c) + } + } + game.discard = true + game.state = 'vm_honecker' +} + +function vm_inflationary_currency() { + game.state = 'vm_inflationary_currency' +} + +function vm_inflationary_currency_discard() { + // This function starts with the player who is playing Inflationary Currency for the Event + // Switch player and check the hand of their opponent to see if the have cards with ops > 3 to discard + next_player() + if (game.active === COM) { + for (let card of game.communist_hand){ + if (get_card_ops(card) >= 3) { + game.valid_cards.push(card) + } + } + } else { + for (let card of game.democrat_hand){ + if (get_card_ops(card) >= 3) { + game.valid_cards.push(card) + } + } + } + game.state = 'vm_inflationary_currency_discard' +} + +function vm_kiss_of_death() { + game.state = 'vm_kiss_of_death' +} + +function vm_klaus_and_komarek() { + if (game.comInfl[29] > 0 ) {game.valid_spaces = [29]} + vm_next() +} + +function vm_kohl_proposes_reunification() { + log('+2 VP') + game.vp += 2 + if (check_vp()) { + return + } + if (game.persistent_events.includes(86)) { + game.vm_event = 87 + game.state = 'vm_common_european_home_play' + } else { + permanently_remove(87) + vm_return() + } + +} + +function vm_kremlin_coup() { + log('-3 VP') + game.vp -= 3 + game.stability ++ + if (check_vp()) { + return + } + game.support_check_modifier = 1 + //countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] + //revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} + game.temp = [] + countries.forEach(country => { + if (!game.revolutions[find_country_index(country)]) { + game.temp.push(country) + } + }) + game.state = 'vm_kremlin_coup_choose_country' +} + +function vm_laszlo_tokes() { + game.persistent_events.push(73) + game.playable_cards.push(107) + game.state = 'vm_laszlo_tokes' +} + +function vm_legacy_of_martial_law() { + game.vm_available_ops = 1 + game.state = 'vm_switch_infl' +} + +function vm_legacy_of_1968() { + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if ((!check_com_control(i) && space.country === 'Czechoslovakia')) { + game.valid_spaces.push(space.space_id); + } + } + vm_next() +} + +function vm_li_peng() { + game.persistent_events.push(53) + //game.table_cards.push(53) + remove_from_discard(53) + vm_next() +} + +function vm_ligachev() { + game.persistent_events.push(99) + vm_next() +} + +function vm_malta_summit() { + game.state = 'vm_malta_summit' +} + +function vm_massacre_in_timisoara() { + game.persistent_events = game.persistent_events.filter(n => n !== 73) + vm_next() +} + +function vm_modrow() { + game.playable_cards.push(15) + game.state = 'vm_modrow' +} + +function vm_nagy_reburied(){ + if (game.comInfl[43] > 0) { + game.valid_spaces.push(43) + } + vm_next() +} + +function vm_national_salvation_front() { + game.persistent_events.push(102) + game.table_cards.push(102) + remove_from_discard(102) + vm_next() +} + +function vm_nepotism() { + game.state = 'vm_nepotism' +} + +function vm_new_years_eve_party() { + game.state = 'vm_new_years_eve_party' +} + +function vm_nomenklatura() { + game.state = 'vm_nomenklatura' +} + +function vm_normalisation() { + if (game.demInfl[27] >0) {game.valid_spaces.push(27)} + if (game.demInfl[29] > 0) {game.valid_spaces.push(29)} + game.remove_opponent_infl = true + vm_next() +} + +function vm_peasant_parties_revolt() { + game.persistent_events.push(72) + log_msg_gap('C72 in effect') + game.table_cards.push(72) + remove_from_discard(72) + vm_next() +} + +function vm_perestroika() { + game.persistent_events.push(25) + log_msg_gap('C25 in effect') + vm_next() +} + +function vm_poszgay() { + let valid_spaces = [] + for (let space of spaces) { + if (space && space.country === 'Hungary' && !check_dem_control(space.space_id)) { + valid_spaces.push(space.space_id); + } + } + game.valid_spaces = valid_spaces + vm_next() +} + +function vm_power_struggle() { + //console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) + game.is_pwr_struggle = true + + /* TO DELETE? + //Check if Power Struggle is because of an event + */ + + if (game.vm_event > 0) { + game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] + log_h2(`C${game.vm_event}`) + } +/* + //Otherwise set Power Struggle country normally + else { + console.log('vm_power_struggle, country set normally') + game.pwr_struggle_in = countries[scoring_cards.indexOf(game.played_card)] + log_h2(`C${game.played_card}`) + }*/ + + + //Check for Securitate + if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(70)) { + log('C70: Democrat reveals Power Struggle cards') + game.view_opp_hand = true + } + log_h2('Deal Cards') + game.state = 'draw_power_cards' +} + +function vm_presidential_visit() { + game.persistent_events.push(65) + //game.table_cards.push(65) + //remove_from_discard(65) + log_msg_gap('C65 in effect') + vm_next() +} + +function vm_prudence() { + if (!game.prudence) { + game.prudence = {DEM: 0, COM: 0} + } + if (game.active === DEM) { + game.prudence.COM -- + log(`${game.prudence.COM} to Communist ops this turn`) + } else { + game.prudence.DEM -- + log(`${game.prudence.DEM} to Democrat ops this turn`)} + vm_next() +} + +function vm_public_against_violence() { + game.valid_spaces = [] + if (game.comInfl[34] > 0 ) {game.valid_spaces.push(34)} + vm_next() +} + +function vm_reformer_rehabilitated () { + permanently_remove(67) + game.discard = true + for (let card of game.strategy_discard) { + if (!event_is_playable(card)) continue + if (card === game.played_card) continue + if (game.table_cards.includes(card)) continue + if (scoring_cards.includes(card)) continue + + game.valid_cards.push(card) + } + game.state = 'vm_play_event_from_discard' +} + +function vm_roundtable_talks() { + game.persistent_events.push(17) + game.table_cards.push(17) + remove_from_discard(17) + log_msg_gap('C17 in effect') + vm_next() +} + +function vm_sajudis_check() { + if (!check_dem_control(56)) { + game.valid_spaces.push(56) + } + if (!check_dem_control(70)) { + game.valid_spaces.push(70) + } + vm_next() +} + +function vm_sajudis() { + game.playable_cards.push(81) + game.stability++ + log('+1 VP') + game.vp++ + if (check_vp()) { + return + } + vm_next() +} + +function vm_samizdat() { + game.state = 'vm_samizdat' +} + +function vm_securitate() { + game.persistent_events.push(70) + permanently_remove(70) + //game.table_cards.push(70) + vm_next() +} + +function vm_shock_therapy() { + game.state = 'vm_shock_therapy' +} + +function vm_social_democratic_platform_adopted() { + game.state = '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) + vm_next() +} + +function vm_st_nicholas_church () { + game.persistent_events.push(24) + game.playable_cards.push(61) + vm_next() +} + +function vm_stasi() { + log_msg_gap('C13 in effect') + game.persistent_events.push(13) + vm_next() +} + +function vm_stand_fast() { + game.persistent_events.push(100) + if (game.active === DEM) { + game.stand_fast = DEM + } else {game.stand_fast = COM} + //game.table_cards.push(100) + vm_next() +} + +function vm_systematization() { + game.state = 'vm_systematization' +} + +function vm_tank_column() { + if (game.active === DEM) { + game.dem_tst_position++ + game.dem_tst_attempted = 0 + } else { + game.com_tst_position++ + game.com_tst_attempted = 0 + } + vm_next() +} + +function vm_tear_gas () { + game.persistent_events.push(30) + game.table_cards.push(30) + remove_from_discard(30) + log_msg_gap('C30 in effect') + vm_next() +} + +function vm_the_baltic_way() { + game.playable_cards.push(84) + game.stability++ + if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} + if (!check_dem_control(70) && game.systematization !== 70) {game.valid_spaces.push(70)} + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() +} + +function vm_the_chinese_solution() { + game.state = '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) + vm_next() +} + +function vm_the_monday_demonstrations() { + if (!check_dem_control(6)) {game.valid_spaces.push(6)} + if (!check_dem_control(9)) {game.valid_spaces.push(9)} + vm_next() +} + +function vm_the_sinatra_doctrine() { + game.persistent_events.push(50) + log_msg_gap('C50 in effect') + vm_next() +} + +function vm_the_third_way() { + log('-2VP') + vm_next() +} + +function vm_the_tyrant_is_gone() { + game.valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (game.demInfl[i] === 0 && space.country === 'Romania') { + if (space.space_id === game.systematization) {continue} + game.valid_spaces.push(space.space_id) + } + } + game.state = 'vm_the_tyrant_is_gone' +} + + +function vm_the_tyrant_is_gone_prep() { + game.table_cards.push(97) + remove_from_discard(97) + vm_next() +} + +function vm_tyrant_block() { + logi(`Has no effect after C97`) + vm_next() + //game.state = 'vm_tyrant_block' +} + +function vm_the_wall () { + game.persistent_events.push(9) + //game.strategy_removed.push(9) + //game.table_cards.push(9) + log_msg_gap('C9 in effect') + vm_next() +} + +function vm_the_wall_must_go() { + game.the_wall_must_go = {} + game.the_wall_must_go['dem_wins'] = 0 + game.the_wall_must_go['com_wins'] = 0 + game.the_wall_must_go['dem_roll'] = 0 + game.the_wall_must_go['com_roll'] = 0 + game.state = 'vm_the_wall_must_go' +} + +function vm_warsaw_pact_summit() { + game.warsaw_pact_summit = true /*What does this do? */ + game.state = 'vm_warsaw_pact_summit' +} + +function vm_we_are_the_people() { + if (game.demInfl[6] > 0) {game.valid_spaces = [6]} + game.persistent_events.push(48) + if (!game.vm_influence_added) { + game.vm_influence_added = {}; + } + game.vm_influence_added[6] = 0 + game.vm_available_ops = 4 + game.state = 'vm_we_are_the_people_remove' +} + +function vm_workers_revolt() { + if (game.active === DEM) { + for (let space of spaces) { + if (!space) continue + let country = space.country + if (!game.revolutions[find_country_index(country)] && game.comInfl[space.space_id] > 0 && space.socio === 4) { + game.valid_spaces.push(space.space_id); + } + } + } else { + for (let space of spaces) { + if (!space) continue + let country = space.country + if (game.revolutions[find_country_index(country)] && game.demInfl[space.space_id] > 0 && space.socio === 4) { + game.valid_spaces.push(space.space_id); + } + } + } + game.state = 'vm_workers_revolt' +} + +function vm_yakovlev_counsels_gorbachev() { + game.persistent_events.push(62) + log_msg_gap('C62 in effect') + game.table_cards.push(62) + remove_from_discard(62) + vm_next() +} + +function vm_permanently_remove () { + // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! + if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { + permanently_remove(game.vm_event) + } + if (cards[game.played_card].remove ===1 && !game.strategy_removed.includes(game.played_card)) { + permanently_remove(game.played_card) + } /*This means the card that called the event being played is also removed if relevant. Think this makes sense */ + vm_next() +} + +function discarded_card() { + return game.temp > 0 +} + +// =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== + +function vm_tst_3() { + log_gap('Tiananmen Square Track award') + game.state = 'vm_tst_3_prep' +} + +function vm_tst_4() { + log_gap('Tiananmen Square Track award') + game.vm_available_ops = 2 + game.remove_opponent_infl = true + game.state = 'vm_tst_4' +} +function vm_tst_6() { + log_h3('Tiananmen Square Track award') + game.vm_available_ops = 1 + game.temp = 1 //Set temp to 1, so that Card 1 is called during the support check, which has 2 ops + game.state = 'vm_tst_6' +} + +function vm_tst_8() { + game.state = 'vm_goodbye_lenin_ops' // Use this to resolve ops. +} + +// ==================== POWER STRUGGLE FUNCTIONS ====================== + +function vm_scare_tactics() { + game.vm_active_country = game.pwr_struggle_in + vm_next() +} +function vm_support_surges() { + game.state = 'vm_support_surges_1' +} + +function vm_support_falters() { + game.vm_available_ops = 2 + game.return === game.active + game.state = 'vm_support_falters' +} + +function vm_kremlin_coup_elite() { + game.valid_spaces=[] + elite_spaces.forEach(space => { + if (spaces[space].country === game.vm_active_country && !check_com_control(space)) { + game.valid_spaces.push(space); + } + }) + game.state = 'vm_kremlin_coup_take_control' +} + +/* ================== VM STATES ============================== */ + +states.vm_end_event = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt () { + view.prompt = `${clean_name(cards[this_card()].name)}: done.` + if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { + gen_action('done') + } else { + gen_action('end_round') + } + }, + done() { + push_undo() + vm_end_event() + }, + end_round() { + push_undo() + game.return_state = '' + vm_end_event() + } +} + +states.vm_take_control = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt () { + if (game.vm_available_ops > 0 && game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: all spaces controlled. Continue.` + gen_action('done') + } else if (game.vm_available_ops > 0 ) { + view.prompt = `${clean_name(cards[this_card()].name)}: take control of ${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Take control: done.` + if (game.vm_infl_to_do) { + gen_action('done') + } else { + gen_action('end_round') + } + } + }, + infl(space) { + push_undo() + vm_take_control(space) + game.vm_available_ops-- + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + vm_next() + } + }, + done() { + push_undo() + vm_next() + }, + end_round() { + push_undo() + vm_next() + } +} + +states.vm_add_infl = { + inactive: 'add Support Points.', + prompt () { + if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { + 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 ) { + view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else { + get_end_infl_prompt() + } + }, + infl(space) { + vm_do_add_infl(space) + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() + } + }, + done () { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() + }, + end_round() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() + } +} + +states.vm_add_infl_free = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}: add SPs.` + }, + prompt () { + if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { + 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 ) { + view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } else { + get_end_infl_prompt() + } + }, + infl(space) { + vm_do_add_infl_free(space) + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + + game.vm_event_done = true + vm_next() + } + }, + done () { + push_undo() + game.valid_spaces = [] + game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + }, + end_round () { + push_undo() + game.valid_spaces = [] + game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + +states.vm_add_x_infl = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.` + }, +// inactive: `resolve ${cards[this_card()].name}: add influence.`, + prompt () { + if (game.vm_event === 101 && game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: the Romanian Elite space no longer exists.` + gen_action('done') + } + else if (game.vm_available_ops > 0 ) { + view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } /*else { + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` + gen_action('done') + }*/ + }, + infl(space) { + push_undo() + vm_do_add_x_infl(space) + if (game.vm_available_ops === 0) { + 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() + game.vm_event_done = true + vm_next() + } +} + +states.vm_add_limited_infl = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.` + }, + prompt () { + if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) { + if (game.vm_max_infl === 1) { + view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_max_infl,'SP')} ${event_prompt()}.` + } + else { + view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.` + } + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } /*else { + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` + gen_action('done') + }*/ + }, + infl(space) { + vm_do_add_limited_infl(space, game.vm_max_infl) + if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + game.vm_event_done = true + vm_next() + } + }, + /*done () { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + game.vm_event_done = true + vm_next() + }*/ +} + +states.vm_remove_infl = { + inactive: 'remove Support Points.', + prompt () { + // Keep this so that there is an undo option in, e.g., Scare Tactics + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` + gen_action('done') + return + } + if (game.vm_available_ops === 0 ) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + if (game.remove_opponent_infl) { + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` + } + else { + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` + } + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + push_undo() + vm_do_remove_infl(space) + game.vm_active_country = spaces[space].country + if (game.vm_event !== 44) { + if (game.vm_available_ops === 0 ) { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } + } + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + + +states.vm_remove_x_infl = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}: remove SP from ${event_prompt()}.` + }, + prompt () { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` + gen_action('done') + } else if (game.vm_available_ops > 0) { + + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } /*else { + if (game.vm_infl_to_do) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` + gen_action('done') + return + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + }*/ + }, + infl(space) { + vm_do_remove_x_infl(space) + /*if (game.vm_event === 68) { + vm_next() + return + }*/ + if (game.vm_available_ops === 0) { + game.vm_event_done = true + vm_next() + } + /*game.vm_event_done = true + vm_next()*/ + }, + done () { + game.vm_event_done = true + vm_next() + } +} + +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 ${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(space_id); + } + } 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 { + if (game.vm_infl_to_do) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` + gen_action('done') + return + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + }*/ + }, + infl(space) { + vm_do_remove_limited_infl(space, game.vm_max_infl) + if (game.vm_available_ops === 0) { + game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } + }, + done () { + game.vm_event_done = true + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + +states.vm_remove_all_infl = { + inactive: 'remove Support Points', + prompt () { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` + gen_action('pass') + } else if (game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } /*else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + }*/ + }, + infl(space) { + vm_do_remove_all_infl(space) + game.vm_active_country = spaces[space].country + if (game.vm_available_ops === 0) { + vm_next() + } + }, + pass() { + push_undo() + vm_next() + } +} + +states.vm_support_check_prep = { + inactive: 'do support checks.', + prompt () { + /*if (game.vm_available_ops === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` + gen_action('done') + } else */ + if (game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` + gen_action('done') + } else { + //if (game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` + //} + for (let space_id of game.valid_spaces) { + if (!space_id) continue + gen_action_sc(space_id); + } + } + }, + sc(space) { + push_undo() + game.selected_space = space + + // 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)) { + game.austria_hungary_border_reopened_tracker = true + game.state = 'vm_do_support_check' + return + } + + //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.active === DEM && game.vm_available_ops > 1) { + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { + game.state = 'vm_austria_hungary_border_reopened_check' + return + } + //game.state = 'do_support_check' + } /*else { */ + } + game.state = 'vm_do_support_check' + }, + done () { + push_undo() + game.vm_available_ops = 0 + vm_next () + } +} + +states.vm_ceh_support_check_prep = { + inactive: 'do support checks.', + prompt () { + /*if (game.vm_available_ops === 0) { + view.prompt = 'Support checks: done.' + gen_action('done') + return + }*/ + if (game.vm_available_ops > 0) { + view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` + + for (let space_id of game.valid_spaces) { + gen_action_sc(space_id) + } + } + }, + sc(space) { + push_undo() + game.selected_space = space + + //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.active === DEM && game.vm_available_ops > 1) { + + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { + game.state = 'vm_austria_hungary_border_reopened_check' + return + } + //game.state = 'do_support_check' + } /*else { */ + } + game.state = 'vm_ceh_do_support_check' + }, + /*done () { + vm_next () + }*/ +} + + +states.vm_ceh_do_support_check = { + inactive: 'do support checks.', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + + game.vm_available_ops-- + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + vm_next() + } else { + game.state = 'vm_ceh_support_check_prep' + return + } + } +} + +states.vm_austria_hungary_border_reopened_check = { + inactive: 'decide Austria-Hungary Border Reopened', + prompt() { + view.prompt = 'Austria-Hungary Border Reopened: will all support checks be in East Germany?' + gen_action('yes') + gen_action('no') + }, + yes() { + game.austria_hungary_border_reopened_tracker = true + game.state = 'vm_do_support_check' + }, + no() { + game.state = 'vm_do_support_check' + } +} + +states.vm_1_support_check_prep = { + inactive: 'do support checks.', + prompt () { + /*if (game.vm_available_ops === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` + gen_action('done') + } else */if (game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` + gen_action('done') + } else { + view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}.` + + for (let space_id of game.valid_spaces) { + if (!space_id) continue + gen_action_sc(space_id); + } + } + }, + sc(space) { + push_undo() + game.selected_space = space + game.state = 'vm_do_support_check' + }, + done () { + push_undo() + game.vm_available_ops = 0 + vm_next () + } +} + +states.vm_do_support_check = { + inactive: 'do support checks.', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + game.vm_available_ops-- + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + vm_next() + return + } else { + game.state = 'vm_support_check_prep' + return + } + } +} + +states.vm_tiananmen_square_attempt = { + inactive: 'do Tiananmen Square', + prompt () { + /*if (game.active === DEM && game.dem_tst_attempted_this_turn > 0 || game.active === COM && game.com_tst_attempted_this_turn > 0) { + view.prompt = 'Tiananmen Square Track attempt: done.' + gen_action('done') + return + }*/ + view.prompt = 'Tiananmen Square: roll a die' + gen_action('roll') + }, + roll() { + clear_undo() + do_tst_attempt () + }, + /*done () { + vm_next() + }*/ +} + +//================================== EVENT SPECIFIC STATES ====================================== + +states.vm_adamec = { + get inactive() { + return `resolve ${clean_name(cards[88].name)}.` + }, + prompt() { + view.prompt = 'Adamec: roll a die.' + gen_action('roll') + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + 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`) + roll -= worker_spaces + } + log(`Modified roll: ${roll}`) + if (roll > 2) { + log('Adamec succeeds') + vm_next() + return + } + log('Adamec fails: 3 or more required') + permanently_remove(88) + vm_return() + } +} + +states.vm_brought_in_for_questioning = { + inactive: 'discard a card.', + prompt() { + /*if (game.phase === 1) { + view.prompt = 'Discard a card: done.' + gen_action('done') + } else */ + if (game.democrat_hand.length === 0) { + view.prompt = 'Brought in for Questioning. No cards to discard.' + gen_action('pass') + } else { + view.prompt = 'Brought in for Questioning: you must discard a random card.' + gen_action('discard') + } + }, + discard() { + clear_undo() + game.vm_event = discard_card(game.democrat_hand) + game.phase = 1 + if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { + //game.return = game.active + if (!game.vm_infl_to_do) { + if(game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + if (!is_auto_resolve(game.vm_event) && !switch_events.includes(game.vm_event)) { + next_player() + } + goto_vm(game.vm_event) + } else { + game.return = DEM + vm_return() + } + }, + pass() { + log('No cards to discard') + vm_return() + }, + /*done() { + vm_return() + }*/ +} + +states.vm_central_committee_reshuffle = { + get inactive() { + return `resolve ${clean_name(cards[57].name)}.` + }, + prompt() { + if (game.revolutions.every(n => n === true)) { + view.prompt = 'Central Committee Reshuffle: no countries to choose.' + gen_action('pass') + } else { + 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')} + if (!game.revolutions[3]) {gen_action('bulgaria')} + if (!game.revolutions[4]) {gen_action('czechoslovakia')} + if (!game.revolutions[5]) {gen_action('romania')} + } + }, + east_germany() { + push_undo() + game.vm_active_country = "East_Germany" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [1,2,3,4,5,6,7,8,9,10,11,12] + vm_next() + }, + poland() { + push_undo() + game.vm_active_country = "Poland" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [13,14,15,16,17,18,19,20,21,22,23,24,25,26] + vm_next() + }, + czechoslovakia() { + push_undo() + game.vm_active_country = "Czechoslovakia" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [27,28,29,30,31,32,33,34,35,36,37] + vm_next() + }, + hungary() { + push_undo() + game.vm_active_country = "Hungary" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [38,39,40,41,42,43,44,45,46,47,48,49] + vm_next() + }, + romania() { + push_undo() + game.vm_active_country = "Romania" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [50,51,52,53,54,55,56,57,58,59,60,61,62,63] + game.valid_spaces = game.valid_spaces.filter(space => space !== game.systematization) + vm_next() + }, + bulgaria () { + push_undo() + game.vm_active_country = "Bulgaria" + log(`Chose ${country_name(game.vm_active_country)}`) + game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] + vm_next() + }, + pass() { + log('Passed') + vm_return() + } + +} + +states.vm_common_european_home_choose = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = `Common European Home: play an opponent's card, event does not occur.` + for (let card of game.valid_cards) { + gen_action_card(card) + } + }, + card(card) { + push_undo() + //log(`Played with C${cards[card].number}`) + game.valid_cards = [] + silent_discard(card) + game.vm_event = card + game.state = 'vm_common_european_home_play' + } +} + +states.vm_common_european_home_play = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt() { + 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 ) { + 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) { + gen_action('tst') + } */ + }, + influence(){ + push_undo() + log_gap(`Played C${cards[game.vm_event].number} to place SPs`) + 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)) { + game.austria_hungary_border_reopened_tracker = true + } + game.state = 'vm_add_infl' + }, + support_check() { + push_undo() + log_gap(`Played C${cards[game.vm_event].number} for support checks`) + game.vm_available_ops = 2 + game.state = 'vm_ceh_support_check_prep' + valid_spaces_sc() + }, + tst() { + push_undo() + log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) + game.state = 'vm_tiananmen_square_attempt' + } +} + +states.vm_dash_for_the_west = { + get inactive() { + return `resolve ${clean_name(cards[36].name)}.` + }, + prompt() { + /* if (game.phase === 1) {*/ + view.prompt = 'Dash for the West: roll a die' + gen_action('roll') + /*} else { + view.prompt = 'Dash for the West: roll a die. Done.' + gen_action('done') + }*/ + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + let com_control = check_presence('East_Germany').com_spaces + + if (roll > com_control) { + log(`Success. More than the ${com_control} Communist controlled spaces in East Germany`) + log('+1 VP') + game.vp++ + if (check_vp()) { + return + } + game.discard = true + game.state = 'vm_play_event_from_discard' + } else { + log(`Fail: more than a ${com_control} required`) + //game.phase++ + vm_next() + } + },/* + done() { + vm_next() + }*/ +} + +states.vm_play_event_from_discard = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_cards.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no valid cards in discard.` + gen_action('pass') + } else if (game.temp === 0) { + view.prompt = `${event_prompt()}.` + for (let card of game.valid_cards) { + gen_action('pass') + gen_action_card(card) + } + } /*else { + view.prompt = 'Choose a card: done.' + gen_action('done') + }*/ + }, + card(card) { + push_undo() + log(`Chose C${cards[card].number}`) + game.vm_event = card + game.vm_available_ops = cards[card].ops + game.discard = false + //game.return = game.active Does turning this off cause problems? + if (switch_events.includes(card)) {next_player()} + goto_vm(card) + }, + pass(){ + push_undo() + if (game.valid_cards.length === 0) { + log('No valid cards to choose') + } else{ + log('Did not choose a card') + } + vm_next() + }, +/* done(){ + push_undo() + game.discard = false + vm_next() + }*/ +} + +states.vm_deutsche_marks_prep = { + inactive: 'choose a card.', + prompt() { + if (game.valid_cards.length === 0) { + view.prompt = 'Deutsche Marks: no cards to give.' + gen_action('pass') + } else { + view.prompt = 'Deutsche Marks: choose a card to give.' + for (let card of game.valid_cards) { + gen_action_card(card) + } + } + }, + card(card) { + push_undo() + log(`Gave C${cards[card].number}`) + game.valid_cards = [] + silent_discard(card) + //next_player() + game.state = 'vm_deutsche_marks_confirm' + game.vm_event = card + }, + pass() { + push_undo() + vm_next() + } +} + +states.vm_deutsche_marks_confirm = { + inactive: 'choose a card.', + prompt() { + view.prompt = `Deutsche Marks: gave ${cards[game.vm_event].name}.` + gen_action('done') + }, + done() { + next_player() + game.state = 'vm_deutsche_marks' + } +} + +states.vm_deutsche_marks = { + get inactive() { + return `resolve ${clean_name(cards[20].name)}.` + }, + prompt() { + if(cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { + view.prompt = `Deutsche Marks: you must play ${clean_name(cards[this_card()].name)} for the event.` + gen_action('event') + } else { + view.prompt = `Deutsche Marks: play ${clean_name(cards[this_card()].name)} for:` + gen_action('influence') + gen_action('support_check') + if (game.com_tst_attempted_this_turn === 0) { + gen_action('tst') + } + } + }, + event() { + push_undo() + log(`Played C${cards[game.vm_event].number} for the event`) + if (!game.vm_infl_to_do) { + game.return = game.active + } + goto_vm(game.vm_event) + }, + influence() { + push_undo() + log(`Played C${cards[game.vm_event].number} to place SPs`) + game.vm_available_ops = get_card_ops(game.vm_event) + + /*cards[game.vm_event].ops + if (game.persistent_events.includes(25)) {game.vm_available_ops++ } + if (game.prudence.COM && game.prudence.COM < 0 ) { + game.vm_available_ops += game.prudence.COM + }*/ + valid_spaces_infl() + game.state = 'vm_add_infl' + }, + support_check() { + push_undo() + log_gap(`Played C${cards[game.vm_event].number} for support checks`) + game.vm_available_ops = 2 + game.state='vm_support_check_prep' + valid_spaces_sc() + }, + tst() { + push_undo() + log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) + game.state='vm_tiananmen_square_attempt' + } +} + +states.vm_exit_visas = { + get inactive() { + return `resolve ${clean_name(cards[75].name)}.` + }, + prompt() { + view.prompt = 'Exit Visas: you may discard cards from your hand and draw replacements.' + for (let card of game.democrat_hand) { + gen_action_card(card) + } + if (game.temp === 0) { + gen_action('pass') + } else { + gen_action('done') + } + }, + card(card){ + push_undo() + discard(card) + game.temp++ + }, + pass() { + push_undo() + game.state = 'vm_exit_visas_finish' + }, + done() { + push_undo() + game.state = 'vm_exit_visas_finish' + } +} + +states.vm_exit_visas_finish = { + get inactive() { + return `resolve ${clean_name(cards[75].name)}.` + }, + prompt() { + if (game.temp > 0 ) { + view.prompt = 'Exit Visas: draw replacement cards.' + gen_action('draw') + } /*else { + view.prompt = 'Exit Visas. Draw cards: done.' + gen_action('done') + } */ + }, + draw() { + clear_undo() + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length + game.temp, game.communist_hand.length) + game.temp = 0 + vm_next() + }, + /*done() { + vm_next() + }*/ +} + +states.vm_foreign_currency_debt_burden = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = 'Choose a country. The Communist may not make support checks there for the rest of the turn.' + gen_action('east_germany') + gen_action('poland') + gen_action('czechoslovakia') + gen_action('hungary') + gen_action('bulgaria') + }, + east_germany() { + push_undo() + game.foreign_currency_debt_burden = 'East_Germany' + log('Selected East Germany') + vm_next() + }, + poland() { + push_undo() + game.foreign_currency_debt_burden = 'Poland' + log('Selected Poland') + vm_next() + }, + czechoslovakia() { + push_undo() + game.foreign_currency_debt_burden = 'Czechoslovakia' + log('Selected Czechoslovakia') + vm_next() + }, + hungary() { + push_undo() + game.foreign_currency_debt_burden = 'Hungary' + log('Selected Hungary') + vm_next() + }, + bulgaria() { + push_undo() + game.foreign_currency_debt_burden = 'Bulgaria' + log('Selected Bulgaria') + vm_next() + } +} + +states.vm_goodbye_lenin = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_cards.length > 0 ) { + view.prompt = `Play a red event from your opponent's hand, or play Goodbye Lenin for operations.` + for (let card of game.valid_cards) { + gen_action_card(card) + gen_action('ops') + } + } else { + view.prompt = 'Communist has no red events. Play Goodbye Lenin for operations.' + gen_action('ops') + } + }, + card(card) { + push_undo() + log(`Chose to play C${card} for the event`) + let card_index = game.communist_hand.indexOf(card) + game.communist_hand.splice(card_index, 1) + game.vm_event = card + game.view_opp_hand = false + goto_vm(card) + }, + ops() { + push_undo() + 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' + } +} + +states.vm_goodbye_lenin_ops = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt() { + view.prompt = `Play ${clean_name(cards[this_card()].name)} for:` + gen_action('influence') + gen_action('support_check') + if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 )) { + gen_action('tst') + } + }, + influence(){ + push_undo() + game.vm_available_ops = get_card_ops(this_card()) + /*if (game.persistent_events.includes(50)) { + log(`+1 from C50`) + game.vm_available_ops++ + }*/ + valid_spaces_infl() + + // If ABHR - Set AHBR tracker to true + if (game.persistent_events.includes(58)) { + game.austria_hungary_border_reopened_tracker = true + } + game.state = 'vm_add_infl' + }, + support_check() { + push_undo() + game.vm_available_ops = 2 + game.state = 'vm_support_check_prep' + valid_spaces_sc() + }, + tst() { + push_undo() + game.state = 'vm_tiananmen_square_attempt' + } +} + +states.vm_honecker = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_cards.length === 0 && game.temp === 0) { + view.prompt = 'Honecker: no valid cards to choose.' + gen_action('pass') + } else + if (game.temp === 0) {view.prompt = 'Honecker: choose a card to add to your hand.' + for (let card of game.valid_cards) { + gen_action_card(card) + gen_action('pass') + } + } /*else { + view.prompt = 'Honecker. Choose a card: done.' + gen_action('done') + }*/ + }, + card(card) { + push_undo() + game.valid_cards = [] + log(`Took C${cards[card].number} into hand`) + game.temp = card + let card_index = game.strategy_discard.indexOf(card) + game.strategy_discard.splice(card_index, 1) + game.communist_hand.push(card) + vm_next() + }, + pass(){ + log('Did not take a card') + game.discard = false + vm_next() + }, + /*done(){ + if (game.temp === 0) { + log('Did not take a card') + } + game.discard = false + vm_next() + } */ + +} + +states.vm_inflationary_currency = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if ((game.active === COM && game.revolutions.every(n => n === false)) || (game.active === DEM && game.revolutions.every(n => n === true))) { + view.prompt = 'Inflationary Currency: no countries to choose.' + gen_action('pass') + } else { + view.prompt = 'Inflationary Currency: choose a country where your opponent has power.' + if (game.active === DEM) { + if (!game.revolutions[0]) {gen_action('poland')} + if (!game.revolutions[1]) {gen_action('hungary')} + if (!game.revolutions[2]) {gen_action('east_germany')} + if (!game.revolutions[3]) {gen_action('bulgaria')} + if (!game.revolutions[4]) {gen_action('czechoslovakia')} + if (!game.revolutions[5]) {gen_action('romania')} + } else { + if (game.revolutions[0]) {gen_action('poland')} + if (game.revolutions[1]) {gen_action('hungary')} + if (game.revolutions[2]) {gen_action('east_germany')} + if (game.revolutions[3]) {gen_action('bulgaria')} + if (game.revolutions[4]) {gen_action('czechoslovakia')} + if (game.revolutions[5]) {gen_action('romania')} + } + } + }, + east_germany() { + push_undo() + game.vm_active_country = 'East_Germany' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + poland() { + push_undo() + game.vm_active_country = 'Poland' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + czechoslovakia() { + push_undo() + game.vm_active_country = 'Czechoslovakia' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + hungary() { + push_undo() + game.vm_active_country = 'Hungary' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + romania() { + push_undo() + game.vm_active_country = 'Romania' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + bulgaria () { + push_undo() + game.vm_active_country = 'Bulgaria' + log(`Chose ${country_name(game.vm_active_country)}`) + vm_next() + }, + pass() { + log('Passed') + vm_return() + } +} + +states.vm_inflationary_currency_discard = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_cards.length === 0 ) { + view.prompt = 'Inflationary Currency: no valid cards to discard. You must pass.' + gen_action('pass') + } else if (game.temp === 0 ) { + view.prompt = 'Inflationary Currency: you may discard a 3 op or higher value card to cancel the support check.' + gen_action('pass') + for (let card of game.valid_cards) { + gen_action_card(card) + } + } /*else { + view.prompt = 'Inflationary Currency. Discard a card: done.' + gen_action('done') + } */ + }, + card(card) { + push_undo() + discard(card) + game.temp = card + if (!game.vm_infl_to_do) { + if(game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + vm_next() + }, + pass() { + push_undo() + log('Did not discard') + next_player() + game.vm_available_ops = 1 + vm_next() + //game.state = 'vm_support_check_prep' + }, + done() { + if (!game.vm_infl_to_do) { + if(game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + vm_next() + } +} + + +states.vm_kiss_of_death = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.communist_hand.length === 0) { + view.prompt = 'Kiss of Death. No cards to discard.' + gen_action('pass') + } else { + view.prompt = 'Kiss of Death: you must randomly discard a card.' + gen_action('discard') + } + }, + discard() { + 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) { + next_player() + game.state = 'vm_kiss_of_death_finish' + } else { + log('Event does not occur') + vm_next() + } + }, + pass() { + log('No card to discard') + vm_next() + } +} + +states.vm_kiss_of_death_finish = { + get inactive() { + 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')) { + view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.` + console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard) + gen_action('event') + } else { + view.prompt = 'Event does not occur.' + gen_action('done') + } + }, + event() { + //game.return = game.active + // Remove game.vm_event from the discard + //game.strategy_discard = game.strategy_discard.filter(n => n !== game.vm_event) + + goto_vm(game.vm_event) + }, + done() { + vm_next() + } +} + +states.vm_kremlin_coup_choose_country = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt() { + if (game.temp.length > 0) { + view.prompt = 'Kremlin Coup! Select a country where the Communist retains power.' + for (let country of countries) { + if (game.temp.includes(country)) { + gen_action(`${country.toLowerCase()}`) + } + } + } else { + view.prompt = 'Kremlin Coup! There are no countries where the Communist retains power.' + gen_action('done') + } + }, + east_germany() { + push_undo() + game.vm_active_country = 'East_Germany' + game.temp = game.temp.filter(country => country !== game.vm_active_country) + log(`${country_name(game.vm_active_country)}:`) + vm_kremlin_coup_elite() + }, + poland() { + push_undo() + game.vm_active_country = 'Poland' + log(`${country_name(game.vm_active_country)}:`) + game.temp = game.temp.filter(country => country !== game.vm_active_country) + vm_kremlin_coup_elite() + }, + czechoslovakia() { + push_undo() + game.vm_active_country = 'Czechoslovakia' + log(`${country_name(game.vm_active_country)}:`) + game.temp = game.temp.filter(country => country !== game.vm_active_country) + vm_kremlin_coup_elite() + }, + hungary() { + push_undo() + game.vm_active_country = 'Hungary' + log(`${country_name(game.vm_active_country)}:`) + game.temp = game.temp.filter(country => country !== game.vm_active_country) + vm_kremlin_coup_elite() + }, + romania() { + push_undo() + game.vm_active_country = 'Romania' + log(`${country_name(game.vm_active_country)}:`) + game.temp = game.temp.filter(country => country !== game.vm_active_country) + vm_kremlin_coup_elite() + }, + bulgaria () { + push_undo() + game.vm_active_country = 'Bulgaria' + log(`${country_name(game.vm_active_country)}:`) + game.temp = game.temp.filter(country => country !== game.vm_active_country) + vm_kremlin_coup_elite() + }, + done() { + game.temp = 0 + vm_next() + } +} + +states.vm_kremlin_coup_take_control = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_spaces.includes(game.systematization)) { + view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space no longer exists.` + gen_action('done') + } + else if (game.valid_spaces.length === 0){ + view.prompt = `Kremlin Coup! ${country_name(game.vm_active_country)}'s Elite space is already controlled.` + gen_action('done') + } else { + view.prompt = `Kremlin Coup! Take control of the Elite space in ${country_name(game.vm_active_country)}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } + }, + infl(space) { + push_undo() + vm_take_control(space) + if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } + if (game.vm_active_country === 'Poland') {game.selected_space = 17} + if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} + if (game.vm_active_country === 'Hungary') {game.selected_space = 45} + if (game.vm_active_country === 'Romania') {game.selected_space = 61} + if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + game.state = 'vm_kremlin_coup_sc_prep' + }, + done() { + push_undo() + if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } + if (game.vm_active_country === 'Poland') {game.selected_space = 17} + if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} + if (game.vm_active_country === 'Hungary') {game.selected_space = 45} + if (game.vm_active_country === 'Romania') {game.selected_space = 61} + if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + game.state = 'vm_kremlin_coup_sc_prep' + } +} + +states.vm_kremlin_coup_sc_prep = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` + gen_action_sc(game.selected_space); + }, + sc(space) { + //game.selected_space = space + push_undo() + game.state = 'vm_kremlin_coup_sc' + } +} + +states.vm_kremlin_coup_sc = { + inactive: 'do support checks', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + if (game.temp.length > 0 ){ + game.state = 'vm_kremlin_coup_choose_country' + } else { + //game.state = 'vm_kremlin_coup_end' + vm_next() + } + } +} +/* +states.vm_kremlin_coup_end = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt() { + view.prompt = `${clean_name(cards[this_card()].name)} Support checks: done.` + gen_action('done') + }, + done() { + vm_next() + } +} +*/ +states.vm_laszlo_tokes = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = `Laszlo Tokes. Choose to:` + gen_action('influence') + gen_action('support_check') + }, + influence(){ + push_undo() + game.vm_available_ops = get_card_ops(73) + valid_spaces_infl() + game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') + game.phase = 3 + vm_next() + //game.state = 'vm_add_infl' + }, + support_check() { + push_undo() + game.vm_available_ops = 2 + //game.state = 'vm_support_check_prep' + valid_spaces_sc() + game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') + vm_next() + } +} + +states.vm_switch_infl = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_spaces.length === 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: No SPs to remove.` + gen_action('pass') + } else { + /*if (game.vm_available_ops > 0 ) {*/ + view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } /*else { + view.prompt = 'Influence replaced.' + gen_action('done') + }*/ + }, + infl(space) { + push_undo() + vm_switch_infl(space) + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + } + vm_next() + }, + pass() { + vm_next() + } + /*done() { + vm_next() + }*/ +} + +states.vm_malta_summit = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + /*if (game.phase === 1) {*/ + view.prompt = 'Malta Summit: roll a die.' + gen_action('roll') + /*} else { + view.prompt = 'Done.' + gen_action('done') + }*/ + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + if (game.stability > 0) { + log(`+${game.stability} from USSR Stability Track`) + log(`Modified roll: ${roll + game.stability}`) + } + if (roll + game.stability > 3) { + log('Summit successful') + game.vp += 3 + log('+3 VP') + if (check_vp()) { + return + } + if (game.comInfl[12] > 0 ) {game.valid_spaces.push(12)} + if (game.comInfl[15] > 0 ) {game.valid_spaces.push(15)} + if (game.comInfl[27] > 0 ) {game.valid_spaces.push(27)} + if (game.comInfl[43] > 0 ) {game.valid_spaces.push(43)} + if (game.comInfl[51] > 0 ) {game.valid_spaces.push(51)} + if (game.comInfl[69] > 0 ) {game.valid_spaces.push(69)} + //game.vm_available_ops = 5 + game.remove_opponent_infl = true + vm_next() + } + else { + log('Summit failed. Required 4 or more') + //game.phase++ + vm_goto_step(vm_permanently_remove) + } + }, + /*done() { + vm_next() + }*/ +} + +states.vm_modrow = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = `Modrow: roll a die.` + gen_action('roll') + }, + roll(){ + clear_undo() + 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(`Success. More than the ${dem_spaces} Democratically controlled spaces`) + vm_next() + } else { + log(`Roll: D${roll}`) + log(`Fail. More than ${dem_spaces} required`) + permanently_remove(83) + vm_return() + } + } +} + +states.vm_nepotism = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + //if (game.phase === 1 ) { + view.prompt = 'Nepotism: roll a die.' + gen_action('roll') + /*} else { + view.prompt = 'Roll a die: done.' + gen_action('done') + }*/ + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + if (roll < 3) { + log(`Roll: D${roll} adds 4 SPs`) + game.vm_available_ops = 4} + else if (roll < 5 ) { + log(`Roll: D${roll} adds 3 SPs`) + game.vm_available_ops = 3} + else { + log(`Roll: D${roll} adds 1 SP`) + game.vm_available_ops = 1} + //game.phase = 2 + vm_next() + }, + /*done() { + vm_next() + }*/ +} + +states.vm_new_years_eve_party = { + get inactive() { + return `resolve ${clean_name(cards[104].name)}.` + }, + prompt() { + view.prompt = 'Choose whether the game ends at the end of this turn.' + gen_action('end') + gen_action('continue') + }, + end() { + push_undo() + game.persistent_events.push(104) + log('Chooses to end the game. There will be no final scoring') + let power = game.revolutions.filter(value => value === false).length + if (power > 3) { + log(`Communist holds power in ${power} countries. -3 VP`) + game.vp -= 3 + } else { + log(`Communist holds power in ${power} countries. +3 VP`) + game.vp += 3 + } + if (check_vp()) { + return + } + //game.table_cards.push(104) + permanently_remove(104) + vm_next() + }, + continue() { + push_undo() + log('Chooses to continue') + permanently_remove(104) + vm_next() + } +} + +states.vm_nomenklatura = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = 'Nomenklatura: choose to remove all Democratic SPs from Elite spaces or add 3 SPs to any Elite space(s).' + gen_action('remove') + gen_action('add') + }, + remove() { + push_undo() + game.valid_spaces = [] + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + + if (space.socio === 1 && game.demInfl[i] > 0) { + game.valid_spaces.push(space.space_id) + } + } + game.vm_available_ops = game.valid_spaces.length + game.remove_opponent_infl = true + game.state = 'vm_nomenklatura_remove' + }, + add() { + push_undo() + game.valid_spaces = [] + for (let space of spaces) { + if (!space) continue + if (space.socio === 1) { + game.valid_spaces.push(space.space_id) + } + } + check_systematization() + game.vm_available_ops = 3 + game.state = 'vm_nomenklatura_add' + } +} + +states.vm_nomenklatura_remove = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_spaces.length === 0 ) { + view.prompt = 'Nomenklatura. No SPs to remove: pass.' + gen_action('pass') + } else { + view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } + }, + infl(space) { + push_undo() + vm_do_remove_all_infl(space) + if (game.valid_spaces.length === 0) { + vm_next() + } + }, + pass() { + push_undo() + vm_next() + } +} + +states.vm_nomenklatura_add = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { + 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.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + //} + }, + infl(space) { + push_undo() + vm_do_add_infl_free(space) + if (game.vm_available_ops === 0 ) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } + }, +/* done() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + }*/ +} + +states.vm_samizdat = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = 'Samizdat: you may set aside a card from your hand and draw a replacement.' + for (let card of game.democrat_hand) { + gen_action_card(card) + } + gen_action('pass') + }, + card(card) { + push_undo() + game.samizdat_card = card + game.democrat_hand = game.democrat_hand.filter(c => c !== card) + log('Set aside a card') + game.state = 'vm_samizdat_finish' + }, + pass() { + push_undo() + //if (game.samizdat_card > 0) {game.state = 'vm_samizdat_finish'} + /*else { */ + log('Did not set aside a card') + vm_next() + //} + } +} + +states.vm_samizdat_finish = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + /*if (game.phase ) { + view.prompt = 'Samizdat: done.' + gen_action('done') + } else {*/ + view.prompt = 'Draw a replacement card.' + gen_action('draw') + //} + }, + draw() { + clear_undo() + game.democrat_hand.push(draw_card(game.strategy_deck)) + vm_next() + //game.phase ++ + }, + /*done() { + vm_next() + }*/ +} + +states.vm_shock_therapy = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.revolutions.every(n => n === false)) { + view.prompt = 'Shock Therapy: no countries to choose.' + gen_action('pass') + } else { + if (game.vm_active_country === '' ) { + view.prompt = 'Shock Therapy: choose 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')} + if (game.revolutions[3]) {gen_action('bulgaria')} + if (game.revolutions[4]) {gen_action('czechoslovakia')} + if (game.revolutions[5]) {gen_action('romania')} + } /*else if (game.phase === 2) { + view.prompt = 'Shock Therapy: done.' + gen_action('done') + } */ + else { + view.prompt = 'Shock Therapy: roll a die.' + gen_action('roll') + } + } + }, + east_germany() { + push_undo() + game.vm_active_country = 'East_Germany' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + poland() { + push_undo() + game.vm_active_country = 'Poland' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + czechoslovakia() { + push_undo() + game.vm_active_country = 'Czechoslovakia' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + hungary() { + push_undo() + game.vm_active_country = 'Hungary' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + romania() { + push_undo() + game.vm_active_country = 'Romania' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + bulgaria () { + push_undo() + game.vm_active_country = 'Bulgaria' + log(`Chose ${country_name(game.vm_active_country)}`) + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + let worker_farmer = 0 + for (let space of spaces) { + if (space && space.country === game.vm_active_country && check_com_control(space.space_id) && (space.socio === 3 || space.socio === 4)) { + worker_farmer++ + } + } + 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) { + log('C93 is successful. +3 VP') + vm_next() + } else { + log('C93 is unsuccessful. Required 3 or more') + //game.phase++ + permanently_remove(93) + vm_return() + } + }, + pass() { + log('Passed') + vm_return() + } + /*done() { + permanently_remove(93) + vm_return() + }*/ +} + +states.vm_social_democratic_platform_adopted = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.revolutions.every(n => n === false)) { + view.prompt = 'Social Democratic Platform Adopted: no countries to choose.' + gen_action('pass') + } else { + view.prompt = 'Select a country where the Democrat holds Power.' + if (game.revolutions[0]) {gen_action('poland')} + if (game.revolutions[1]) {gen_action('hungary')} + if (game.revolutions[2]) {gen_action('east_germany')} + if (game.revolutions[3]) {gen_action('bulgaria')} + if (game.revolutions[4]) {gen_action('czechoslovakia')} + if (game.revolutions[5]) {gen_action('romania')} + } + }, + east_germany() { + push_undo() + game.vm_active_country = 'East_Germany' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next() + }, + poland() { + push_undo() + game.vm_active_country = 'Poland' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next()}, + czechoslovakia() { + push_undo() + game.vm_active_country = 'Czechoslovakia' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next()}, + hungary() { + push_undo() + game.vm_active_country = 'Hungary' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next() + }, + romania() { + push_undo() + game.vm_active_country = 'Romania' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next() + }, + bulgaria () { + push_undo() + game.vm_active_country = 'Bulgaria' + log(`Selected ${country_name(game.vm_active_country)}`) + vm_next() + }, + pass() { + log('Passed') + vm_return() + } +} + +states.vm_systematization = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + /*if (game.systematization === 0) { */ + view.prompt = 'Systematization: eliminate a space in Romania.' + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + /*} else { + view.prompt = 'Systematization: done.' + gen_action('done') + }*/ + }, + infl(space) { + push_undo() + vm_eliminate(space) + game.valid_spaces = [] + game.systematization = space + game.persistent_events.push(69) + vm_next() + }, +/* done() { + vm_next() + } */ +} + +states.vm_the_chinese_solution = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + 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')} + if (!game.revolutions[3]) {gen_action('bulgaria')} + if (!game.revolutions[4]) {gen_action('czechoslovakia')} + if (!game.revolutions[5]) {gen_action('romania')} + gen_action('pass') + }, + east_germany() { + push_undo() + game.vm_active_country = 'East_Germany' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + poland() { + push_undo() + game.vm_active_country = 'Poland' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + czechoslovakia() { + push_undo() + game.vm_active_country = 'Czechoslovakia' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + hungary() { + push_undo() + game.vm_active_country = 'Hungary' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + romania() { + push_undo() + game.vm_active_country = 'Romania' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + bulgaria () { + push_undo() + game.vm_active_country = 'Bulgaria' + log(`Chose ${country_name(game.vm_active_country)}`) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + vm_next() + }, + pass() { + push_undo() + permanently_remove(96) + vm_return() + } +} + +states.vm_the_tyrant_is_gone = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (!game.the_tyrant_is_gone) { + view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' + for (let space_id of game.valid_spaces) { + if (!space_id) continue + gen_action_infl(space_id); + } + } else { + view.prompt = 'The Tyrant is Gone: done.' + gen_action('done') + } + }, + infl(space) { + push_undo() + log(`The Ceausescus flee to %${space}`) + game.the_tyrant_is_gone = space + game.valid_spaces = [] + game.persistent_events.push(97) + + // vm_next() + }, + done () { + vm_next() + } +} +/* +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!" Rolls: done.' + gen_action('done') + } else { */ + view.prompt = ('The Wall Must Go! Roll a die.') + gen_action('roll') + //} + }, + roll() { + clear_undo() + let attempt = game.the_wall_must_go['dem_wins'] + game.the_wall_must_go['com_wins'] + if (game.the_wall_must_go['dem_roll'] === 0 && game.the_wall_must_go['com_roll'] === 0) { + log_h3(`Round ${attempt+1}`) + } + + let roll = Math.floor(Math.random() * 6) + 1 + 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) { + log(`+${controlled_spaces} from controlled spaces in East Germany`) + log(`Modified roll: ${roll + controlled_spaces}`) + roll += controlled_spaces + } + game.the_wall_must_go['dem_roll'] = roll + } else { + let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_com_control(space.space_id)).length + if (controlled_spaces > 0) { + log(`+${controlled_spaces} from controlled spaces in East Germany`) + log(`Modified roll: ${roll + controlled_spaces}`) + roll += controlled_spaces + } + game.the_wall_must_go['com_roll'] = roll + + } + if (game.the_wall_must_go['dem_roll'] > 0 && game.the_wall_must_go['com_roll'] > 0) { + if (game.the_wall_must_go['dem_roll'] > game.the_wall_must_go['com_roll'] ) { + log('Democrat wins') + game.the_wall_must_go['dem_wins']++ + } else if (game.the_wall_must_go['dem_roll'] === game.the_wall_must_go['com_roll'] ) { + log('Tie. Re-roll') + } else { + log('Communist wins') + game.the_wall_must_go['com_wins']++ + } + + log(`Democrat: ${game.the_wall_must_go['dem_wins']}, Communist: ${game.the_wall_must_go['com_wins']}`) + } + if (game.the_wall_must_go['dem_wins'] === 2) { + log('The Democrat wins C86') + finish_the_wall() + return + } + if (game.the_wall_must_go['com_wins'] === 2) { + log('The Communist wins C86') + finish_the_wall() + return + } + if (game.the_wall_must_go['dem_roll'] === 0 || game.the_wall_must_go['com_roll'] === 0) { + next_player() + } else { + game.the_wall_must_go['dem_roll'] = 0 + game.the_wall_must_go['com_roll'] = 0 + } + }, + /*done() { + if (game.the_wall_must_go['dem_wins'] === 2) { + game.persistent_events.push(86) + log('+3 VP') + game.vp += 3 + if (check_vp()) { + return + } + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (space.country === 'East_Germany' && game.comInfl[i] > 0){ + game.valid_spaces.push(space.space_id) + } + } + if (!game.vm_infl_to_do) { + if (game.round_player === DEM) { + game.return = COM + } else { + game.return = DEM + } + } + if (game.active === DEM) {next_player()} + vm_next () + } else { + permanently_remove(86) + delete game.the_wall_must_go + vm_return() + } + }*/ +} + +states.vm_warsaw_pact_summit = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + view.prompt = 'Choose to play for support checks or place SPs.' + gen_action('influence') + gen_action('support_check') + }, + influence(){ + push_undo() + for (let i = 1; i < spaces.length; i++) { + let space = spaces[i] + if (game.demInfl[i] === 0) { + game.valid_spaces.push(space.space_id); + } + } + game.vm_available_ops = 4 + game.phase = 3 + //game.state = 'vm_add_infl' + vm_next() + }, + support_check(){ + push_undo() + for (let i = 1; 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) + } + } + game.vm_available_ops = 2 + //game.state = 'vm_support_check_prep' + vm_next() + } +} + +states.vm_we_are_the_people_remove = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + 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 ) { + view.prompt = '"We are the People!": remove up to 4 SPs from the Lutherian Church.' + gen_action('done') + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + } else { + view.prompt = '"We are the People!" Remove SPs: done.' + gen_action('done') + } + }, + infl(space) { + vm_do_remove_infl(space) + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + if (!game.vm_influence_added[6]) { + log('No SPs removed') + vm_next() + } else { + game.valid_spaces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + game.state = 'vm_we_are_the_people_add' + } + } +} +states.vm_we_are_the_people_add = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + /* if (!game.vm_influence_added[6]) { + view.prompt = '"We are the People!" Add SPs: done.' + gen_action('done') + return + }*/ + + view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + vm_do_add_infl_free(space) + game.vm_influence_added[6]-- + if (game.vm_influence_added[6] === 0 ) { + game.valid_spaces = [] + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } + }, + /*done() { + push_undo() + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + }*/ +} + +states.vm_workers_revolt = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + if (game.valid_spaces.length === 0 ) { + view.prompt = 'Workers Revolt: no valid spaces to select.' + gen_action('pass') + return + } + view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.' + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + }, + pass() { + push_undo() + vm_next() + }, + infl(space) { + push_undo() + game.selected_space = space + log(`Chose %${game.selected_space}`) + game.state = 'vm_workers_revolt_finish' + } +} + + +states.vm_workers_revolt_finish = { + get inactive() { + return `resolve ${clean_name(cards[game.played_card].name)}.` + }, + prompt() { + //if (game.selected_space > 0) { + view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + /* } else { + view.prompt = 'Workers Revolt: done.' + gen_action('done') + }*/ + + }, + roll() { + clear_undo() + let roll = Math.floor(Math.random() * 6) + 1 + log(`Roll: D${roll}`) + let adj = count_adj(game.selected_space) + if (game.active === DEM) { + log(`-${adj.com_adj} from opponent controlled spaces`) + roll -= adj.com_adj + } else { + log(`-${adj.dem_adj} from opponent controlled spaces`) + roll -= adj.dem_adj + } + log(`Modified roll: ${roll}`) + if (roll >= 4) { + log('Workers Revolt successful') + vm_replace_all_infl(game.temp) + } else {log('Workers Revolt fails. Required 4 or more')} + game.selected_space = 0 + vm_next() + }, + /*done() { + vm_next() + }*/ +} + +// ==================== TIANANMEN SQUARE TRACK STATES ===================== + +states.vm_tst_3_prep = { + inactive: 'resolve Tiananmen Square Track award.', + prompt() { + view.prompt = 'Tiananmen Square Track award: draw 3 cards.' + gen_action('draw') + }, + draw() { + if (game.active === DEM) { + game.temp = game.democrat_hand.length + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length + 3, game.communist_hand.length) + game.valid_cards = [game.democrat_hand[game.temp], game.democrat_hand[game.temp + 1], game.democrat_hand[game.temp + 2]] + } else { + game.temp = game.communist_hand.length + draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length + 3) + game.valid_cards = [game.communist_hand[game.temp], game.communist_hand[game.temp + 1], game.communist_hand[game.temp + 2]] + } + game.temp = 0 + game.state = 'vm_tst_3' + } +} + +states.vm_tst_3 = { + inactive: 'resolve Tiananmen Square Track bonus.', + prompt() { + if (game.temp < 2) { + view.prompt = `Discard 2 of the drawn cards.` + for (let card of game.valid_cards) { + gen_action_card(card) + } + } /*else { + view.prompt = 'Discard cards: done.' + gen_action('done') + }*/ + }, + card(card) { + push_undo() + discard(card) + game.temp ++ + if (game.temp === 2) { + game.valid_cards = [] + vm_next() + } + }, + /*done() { + vm_next() + }*/ +} + +states.vm_tst_4 = { + inactive: 'remove SPs', + prompt () { + if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { + view.prompt = 'Tiananmen Square Track award. Remove SPs: done.' + gen_action('done') + return + } + view.prompt = `Tiananmen Square Track award: remove ${pluralize(game.vm_available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + vm_do_remove_infl(space) + if (game.vm_available_ops === 0) { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + +states.vm_tst_6 = { + inactive: 'make their free support check.', + prompt() { + /* if (game.vm_available_ops === 0) { + view.prompt = 'Tiananmen Square Track award support check: done.' + gen_action('done') + return + } else {*/ + view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' + for (let space_id of game.valid_spaces) { + if (space_id) { + gen_action_sc(space_id); + } + } + //} + }, + sc(space) { + push_undo() + game.selected_space = space + if (game.active === DEM && game.persistent_events.includes(58) && spaces[space].country === "East_Germany") { + game.austria_hungary_border_reopened_tracker = true + } + game.state = 'vm_tst_6_sc' + }, + /*done () { + push_undo() + vm_next() + }*/ +} + +states.vm_tst_6_sc = { + inactive: 'do support check.', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(game.selected_space) + game.vm_available_ops-- + game.valid_spaces = [] + game.state = 'vm_tst_6' + vm_next() + return + } +} + +states.vm_tst_8 = { + inactive: 'use Tiananmen Square Track award.', + prompt() { + if (game.vm_event_to_do && game.vm_infl_to_do) { + view.prompt = 'Choose whether to play for event or operations first.' + gen_action('event') + gen_action('ops') + } + else if (!game.vm_event_to_do && game.vm_infl_to_do) { + view.prompt = 'Event resolved. Use card for operations.' + gen_action('ops') + } + else if (game.vm_event_to_do && !game.vm_infl_to_do) { + view.prompt = 'Operations resolved. Use card for event.' + gen_action('event') + } + else if (!game.vm_event_to_do && !game.vm_infl_to_do) { + view.prompt = 'Event and operations: done.' + gen_action('end_round') + } + }, + event() { + push_undo() + log('Event') + game.vm_event_to_do = false + game.return_state = 'vm_tst_8' + game.return = game.active + game.vm_event = game.played_card + goto_vm(game.vm_event) + }, + ops() { + push_undo() + log('Operations') + game.vm_infl_to_do = false + game.return = game.active + game.return_state = 'vm_tst_8' + goto_vm(208) + }, + end_round() { + push_undo() + game.tst_8 = true + end_round() + } +} + + +states.vm_tst_8_ops = { + inactive: 'play card for operations.', + prompt() { + view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` + gen_action('influence') + gen_action('support_check') + if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 )) { + gen_action('tst') + } + }, + influence(){ + push_undo() + 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)) { + game.austria_hungary_border_reopened_tracker = true + } + game.state = 'vm_add_infl' + }, + support_check() { + push_undo() + game.vm_available_ops = 2 + game.state = 'vm_support_check_prep' + }, + tst() { + push_undo() + game.state = 'vm_tiananmen_square_attempt' + } +} + +// ========================= POWER STRUGGLE STATES ======================== + +states.vm_scare_tactics = { + inactive: 'remove a Support Point.', + prompt () { + if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { + view.prompt = `${clean_name(cards[this_card()].name)}: no SPs to remove.` + gen_action('done') + return + } + if (game.vm_available_ops === 0 ) { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') + return + } + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id); + } + }, + infl(space) { + push_undo() + vm_do_remove_infl(space) + }, + done() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } + vm_next() + } +} + +states.vm_support_surges_1 = { + inactive: 'draw cards.', + prompt() { + view.prompt = 'Support Surges: draw a 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 after', game.dem_pwr_hand, 'game.temp', game.temp) + } else { + //console.log('hand before', game.com_pwr_hand) + 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.com_pwr_hand[game.com_pwr_hand.length-1] + //console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) + } + 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() { + let special = [49,50,51,52] + let elite_leader = [37,38,39,40] + if (special.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)) { + view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Draw a second card.` + } + else 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) { + 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] + } 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.com_pwr_hand[game.com_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 ${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() + } +} + +states.vm_support_falters = { + inactive: 'discard cards.', + prompt() { + if ((game.active === DEM && game.dem_pwr_hand.length === 0) || (game.active === COM && game.com_pwr_hand.length === 0)) { + view.prompt = 'Support Falters: no remaining cards to discard.' + gen_action('pass') + } else if (game.vm_available_ops > 0) { + view.prompt = 'Support Falters: discard a card.' + gen_action('discard') + } else { + view.prompt = 'Support Falters: done.' + gen_action('done') + } + }, + discard() { + if (game.active === DEM) {discard_card(game.dem_pwr_hand)} + else {discard_card(game.com_pwr_hand)} + game.vm_available_ops -- + }, + pass() { + log_msg_gap('Takes initiative') + game.return = game.active + vm_next() + }, + done() { + log_gap('Takes initiative') + game.return = game.active + vm_next() + } +} + +/* =================== EVENTS ================================ */ + +// #region GENERATED EVENT CODE +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_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_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_return ], +] + +CODE[4] = [ // Michnik + [ vm_permanently_remove ], + [ vm_valid_spaces, 26 ], + [ vm_prompt, 'the Polish Intellectuals space' ], + [ vm_add_x_infl, 3 ], + [ vm_return ], +] + +CODE[5] = [ // General strike + [ vm_general_strike ], + [ vm_return ], +] + +CODE[6] = [ // Brought in for Questioning + [ vm_brought_in_for_questioning ], + [ vm_return ], +] + +CODE[7] = [ // State Run Media* + [ vm_permanently_remove ], + [ vm_valid_spaces_opponent ], + [ vm_remove_limited_opp_infl, 4, 2 ], + [ vm_return ], +] + +CODE[8] = [ // Prudence + [ vm_prudence ], + [ vm_return ], +] + +CODE[9] = [ // 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_return ], +] + +CODE[11] = [ // Dissident arrested + [ vm_valid_spaces_opponent_socio, 5 ], + [ vm_prompt, 'any Intellectuals space' ], + [ vm_remove_x_opp_infl, 2 ], + [ vm_return ], +] + +CODE[12] = [ // Apparatchicks + [ vm_permanently_remove ], + [ vm_valid_spaces_socio, 2 ], + [ vm_prompt, ' to any Bureaucratic space(s)' ], + [ vm_add_infl_free, 3 ], + [ vm_return ], +] + +CODE[13] = [ // Stasi + [ vm_permanently_remove ], + [ vm_stasi ], + [ vm_return ], +] + +CODE[14] = [ // Gorbachev Charms the West + [ vm_valid_spaces_opponent ], + [ vm_remove_opp_infl, 2 ], + [ vm_valid_spaces_sc ], + [ vm_prompt, 'select a space for the Support Check' ], + [ vm_1_support_check ], + [ vm_return ], +] + +CODE[15] = [ // Honecker + [ vm_permanently_remove ], + [ vm_honecker ], + [ vm_return ], +] + +CODE[16] = [ // Nomenklatura* + [ vm_permanently_remove ], + [ vm_nomenklatura ], + [ vm_return ], +] + +CODE[17] = [ // Roundtable talks + [ vm_roundtable_talks ], + [ vm_return ], +] + +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_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_return ], +] + +CODE[20] = [ // Deutsche Marks* + [ vm_permanently_remove ], + [ vm_deutsche_marks ], + [ vm_return ], +] + +CODE[21] = [ // Common European Home + [ vm_common_european_home ], + [ vm_return ], +] + +CODE[22] = [ // Power Struggle - Poland + [ vm_power_struggle ], + [ vm_return ], +] + +CODE[23] = [ // Power Struggle - Hungary + [ vm_power_struggle ], + [ vm_return ], +] + +CODE[24] = [ // St Nicolas Church + [ vm_permanently_remove ], + [ vm_valid_spaces, 6 ], + [ vm_prompt, 'the Lutheran Church' ], + [ vm_take_control_prep, 1 ], + [ vm_st_nicholas_church ], + [ vm_return ], +] + +CODE[25] = [ // Perestroika + [ vm_permanently_remove ], + [ vm_perestroika ], + [ vm_return ], +] + +CODE[26] = [ // Helsinki Final Act* + [ vm_permanently_remove ], + [ vm_helsinki_final_act ], + [ vm_return ], +] + +CODE[27] = [ // Consumerism + [ vm_valid_spaces_opponent_socio, 4 ], + [ vm_prompt, ' from a Worker space' ], + [ vm_remove_opp_infl, 1 ], + [ vm_valid_spaces_opponent_socio, 4 ], + [ vm_active_country ], + [ vm_prompt, ()=>`make a support check in a Worker space in ${country_name(game.vm_active_country)}` ], + [ vm_1_support_check ], + [ vm_return ], +] + +CODE[28] = [ // Factory Party Cells + [ vm_valid_spaces_opponent_socio, 4 ], + [ vm_prompt, ' from Worker spaces' ], + [ vm_remove_limited_opp_infl, 3, 2 ], + [ vm_return ], +] + +CODE[29] = [ // Jan Palach Week* + [ vm_permanently_remove ], + [ vm_valid_spaces, 30 ], + [ vm_prompt, 'the Charles University space' ], + [ vm_add_x_infl, 6 ], + [ vm_return ], +] + +CODE[30] = [ // Tear Gas + [ vm_tear_gas ], + [ vm_return ], +] + +CODE[31] = [ // Intelligentsia + [ vm_valid_spaces, 4, 26, 31, 46, 55, 73 ], + [ vm_prompt, 'Intellectual spaces, no more than 2 per space' ], + [ vm_add_limited_infl, 4, 2 ], + [ vm_return ], +] + +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_return ], +] + +CODE[33] = [ // Sajudis* + [ vm_permanently_remove ], + [ vm_sajudis_check ], + [ vm_prompt, 'any Minorities space' ], + [ vm_take_control_prep, 1 ], + [ vm_sajudis ], + [ vm_return ], +] + +CODE[34] = [ // Fidesz* + [ vm_permanently_remove ], + [ vm_valid_spaces, 47 ], + [ vm_prompt, 'the Hungary students space' ], + [ vm_add_x_infl, 5 ], + [ vm_return ], +] + +CODE[35] = [ // Heal our Bleeding Wounds* + [ vm_permanently_remove ], + [ vm_heal_our_bleeding_wounds ], + [ vm_return ], +] + +CODE[36] = [ // Dash for the West* + [ vm_permanently_remove ], + [ vm_prompt, 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' ], + [ vm_dash_for_the_west ], + [ vm_return ], +] + +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_return ], +] + +CODE[38] = [ // July Concept + [ vm_permanently_remove ], + [ vm_valid_spaces_country, 'Bulgaria' ], + [ vm_prompt, 'Bulgaria' ], + [ vm_add_infl_free, 3 ], + [ vm_return ], +] + +CODE[39] = [ // Eco-Glasnost* + [ vm_permanently_remove ], + [ vm_valid_spaces, 66 ], + [ vm_prompt, 'Ruse' ], + [ vm_add_x_infl, 4 ], + [ vm_eco_glasnost ], + [ vm_return ], +] + +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_return ], +] + +CODE[41] = [ // Ceausescu* + [ vm_permanently_remove ], + [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_valid_spaces_country_opp, 'Romania' ], + [ vm_prompt, ' from Romania' ], + [ vm_remove_opp_infl, 3 ], + [ vm_valid_spaces_country_sc, 'Romania' ], + [ vm_prompt, 'make a support check in Romania' ], + [ vm_1_support_check ], + [ vm_prompt, ' from Bucharesti' ], + [ vm_ceausescu ], + [ vm_else ], + [ vm_tyrant_block ], + [ vm_endif ], + [ vm_return ], +] + +CODE[42] = [ // Power Struggle - East Germany + [ vm_power_struggle ], + [ vm_return ], +] + +CODE[43] = [ // Power Struggle - Bulgaria + [ vm_power_struggle ], + [ vm_return ], +] + +CODE[44] = [ // Inflationary Currency + [ vm_permanently_remove ], + [ vm_inflationary_currency ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 2 ], + [ vm_inflationary_currency_discard ], + [ vm_if, ()=>!discarded_card() ], + [ vm_valid_spaces_country_sc ], + [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], + [ vm_1_support_check ], + [ vm_endif ], + [ 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_return ], +] + +CODE[46] = [ // 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_return ], +] + +CODE[48] = [ // We are the People!* + [ vm_permanently_remove ], + [ vm_we_are_the_people ], + [ vm_return ], +] + +CODE[49] = [ // Foreign Currency Debt Burden* + [ vm_permanently_remove ], + [ vm_foreign_currency_debt_burden ], + [ vm_return ], +] + +CODE[50] = [ // 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_return ], +] + +CODE[52] = [ // Normalisation + [ vm_permanently_remove ], + [ vm_normalisation ], + [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], + [ vm_remove_all_infl, 2 ], + [ vm_return ], +] + +CODE[53] = [ // Li Peng* + [ vm_permanently_remove ], + [ vm_li_peng ], + [ vm_return ], +] + +CODE[54] = [ // The Crowd Turns Against Ceausescu* + [ vm_the_crowd_turns_against_ceausescu ], + [ vm_return ], +] + +CODE[55] = [ // Power Struggle - Czechoslovakia + [ vm_power_struggle ], + [ vm_return ], +] + +CODE[56] = [ // Foreign Television + [ vm_permanently_remove ], + [ vm_foreign_television ], + [ vm_remove_limited_opp_infl, 4, 2 ], + [ 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_return ], +] + +CODE[58] = [ // Austria-Hungary Border Reopened* + [ vm_austria_hungary_border_reopened ], + [ vm_return ], +] + +CODE[59] = [ // GrenzTruppen* + [ vm_grenztruppen ], + [ vm_return ], +] + +CODE[60] = [ // Toxic Waste* + [ vm_permanently_remove ], + [ vm_valid_spaces_socio, 4 ], + [ vm_prompt, 'any Worker space(s)' ], + [ vm_add_infl_free, 3 ], + [ 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_return ], +] + +CODE[62] = [ // Yakovlev Counsels Gorbachev* + [ vm_yakovlev_counsels_gorbachev ], + [ vm_return ], +] + +CODE[63] = [ // Genscher* + [ vm_genscher ], + [ vm_return ], +] + +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_return ], +] + +CODE[65] = [ // 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_return ], +] + +CODE[67] = [ // Reformer Rehabilitated* + [ vm_prompt, 'Reformer Rehabilitated: chose any non-scoring card in the discard pile. Event takes place immediately' ], + [ vm_reformer_rehabilitated ], + [ vm_return ], +] + +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_return ], +] + +CODE[69] = [ // Systematization* + [ vm_permanently_remove ], + [ vm_valid_spaces_country, 'Romania' ], + [ vm_systematization ], + [ vm_return ], +] + +CODE[70] = [ // Securitate* + [ vm_securitate ], + [ vm_return ], +] + +CODE[71] = [ // Kiss of Death* + [ vm_permanently_remove ], + [ vm_kiss_of_death ], + [ vm_return ], +] + +CODE[72] = [ // Peasant Parties Revolt + [ vm_peasant_parties_revolt ], + [ vm_return ], +] + +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 ], + [ vm_laszlo_tokes ], + [ vm_if, ()=>game.phase === 3 ], + [ vm_prompt, ' in Romania' ], + [ vm_add_infl ], + [ vm_else ], + [ vm_prompt, 'make 2 Support Checks in Romania' ], + [ vm_support_check, 2 ], + [ vm_endif ], + [ vm_return ], +] + +CODE[74] = [ // FRG Embassies + [ vm_frg_embassies ], + [ vm_return ], +] + +CODE[75] = [ // 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' ], + [ vm_add_infl_free, 4 ], + [ vm_else ], + [ vm_prompt, 'Select a Student or Intellectual space' ], + [ vm_valid_spaces_country_socio_2, 3,, 4 ], + [ vm_support_check_modified, 2, 2 ], + [ vm_endif ], + [ vm_return ], +] + +CODE[77] = [ // Samizdat + [ vm_permanently_remove ], + [ vm_samizdat ], + [ vm_return ], +] + +CODE[78] = [ // Workers Revolt + [ vm_workers_revolt ], + [ vm_return ], +] + +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_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_return ], +] + +CODE[81] = [ // The Baltic Way* + [ vm_permanently_remove ], + [ vm_the_baltic_way ], + [ vm_prompt, 'any Minorities space' ], + [ vm_take_control_prep, 1 ], + [ 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_return ], +] + +CODE[83] = [ // Modrow* + [ vm_permanently_remove ], + [ vm_modrow ], + [ vm_valid_spaces_country, 'East_Germany' ], + [ vm_prompt, 'East Germany, no more than 2 per space' ], + [ vm_add_limited_infl, 4, 2 ], + [ 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_return ], +] + +CODE[85] = [ // Tank Column/Tank Man* + [ 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_return ], +] + +CODE[87] = [ // 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_return ], +] + +CODE[89] = [ // 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 ], + [ vm_civic_forum ], + [ vm_valid_spaces_country_sc, 'Czechoslovakia' ], + [ vm_prompt, 'Select a space in Czechoslovakia' ], + [ vm_support_check, 2 ], + [ 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_return ], +] + +CODE[92] = [ // Betrayal + [ vm_permanently_remove ], + [ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ], + [ vm_betrayal ], + [ 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_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_return ], +] + +CODE[95] = [ // Power Struggle - Romania + [ vm_power_struggle ], + [ vm_return ], +] + +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_support_check_modified, 5, 3 ], + [ vm_return ], +] + +CODE[97] = [ // The Tyrant is Gone* + [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_valid_spaces, 51 ], + [ vm_prompt, 'the Romanian Elite Space' ], + [ vm_remove_x_opp_infl, 4 ], + [ vm_the_tyrant_is_gone ], + [ vm_permanently_remove ], + [ vm_else ], + [ vm_the_tyrant_is_gone_prep ], + [ vm_endif ], + [ vm_return ], +] + +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_return ], +] + +CODE[99] = [ // Ligachev* + [ vm_permanently_remove ], + [ vm_ligachev ], + [ vm_return ], +] + +CODE[100] = [ // 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_elena ], + [ vm_else ], + [ vm_tyrant_block ], + [ vm_endif ], + [ vm_return ], +] + +CODE[102] = [ // National Salvation Front* + [ vm_national_salvation_front ], + [ vm_return ], +] + +CODE[103] = [ // Government Resigns* + [ vm_government_resigns ], + [ vm_prompt, 'any uncontrolled Elite space' ], + [ vm_remove_all_infl, 1 ], + [ vm_permanently_remove ], + [ vm_return ], +] + +CODE[104] = [ // New Year's Eve Party* + [ vm_new_years_eve_party ], + [ vm_return ], +] + +CODE[105] = [ // Public Against Violence* + [ vm_permanently_remove ], + [ vm_valid_spaces, 36 ], + [ vm_prompt, 'Kosice' ], + [ vm_add_x_infl, 2 ], + [ 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_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)}` ], + [ vm_add_infl_free, 2 ], + [ vm_valid_spaces_country_sc ], + [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], + [ vm_1_support_check ], + [ 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_return ], +] + +CODE[108] = [ // Army Backs Revolution* + [ vm_permanently_remove ], + [ vm_army_backs_revolution ], + [ vm_return ], +] + +CODE[109] = [ // 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_return ], +] +// #endregion + + +// ============= TIANANMEN SQUARE TRACK AWARDS ==================== +CODE[203] = [//Tiananmen Square space 3 award + [vm_tst_3], + [vm_return] +] +CODE[204] = [//Tiananmen Square space 4 award + [vm_valid_spaces_opponent], + [vm_tst_4], + [vm_return] +] +CODE[206] = [//Tiananmen Square space 6 + [vm_valid_spaces_sc], + [vm_tst_6], + [vm_return] +] +CODE[208] = [//Tiananmen Square space 8 event + [vm_tst_8], + [vm_return] +] + +// ============= POWER STRUGGLE WILDCARDS ========================= + +CODE[349] = [//Scare Tactics + [vm_scare_tactics], + [vm_valid_spaces_country_opp], + [vm_prompt, ()=>` from ${country_name(game.vm_active_country)}`], + [vm_remove_opp_infl, 1], + [vm_return] +] +CODE[350] = [//Support Surges + [vm_support_surges], + [vm_return] +] +CODE[351] = [//Support Falters + [vm_support_falters], + [vm_return] +] -- cgit v1.2.3 From cda50293541d39c8304f6934ddcef6c7dd1614ee Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 11:25:57 +0100 Subject: Update Modrow prompt --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.txt b/events.txt index 85b50bf..0f66954 100644 --- a/events.txt +++ b/events.txt @@ -620,7 +620,7 @@ CARD 83 - Modrow* permanently_remove modrow valid_spaces_country 'East_Germany' -prompt 'East Germany' +prompt 'East Germany, no more than 2 per space' add_limited_infl 4 2 -- cgit v1.2.3 From 7b2084f413b19f3d2bcea32261d29a766ff49b70 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 12:40:17 +0100 Subject: Added TST and Power Struggle events --- events.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/events.txt b/events.txt index 0f66954..ded984f 100644 --- a/events.txt +++ b/events.txt @@ -863,3 +863,32 @@ prompt ' from Elite spaces' remove_opp_infl 5 +#// ============= TIANANMEN SQUARE TRACK AWARDS ==================== +CARD 203 - Tiananmen Square space 3 award +tst_3 + +CARD 204 - Tiananmen Square space 4 award +valid_spaces_opponent +tst_4 + +CARD 206 - Tiananmen Square space 6 +valid_spaces_sc +tst_6 + +CARD 208 - Tiananmen Square space 8 event +tst_8 + +#// ============= POWER STRUGGLE WILDCARDS ========================= + +CARD 349 - Scare Tactics +scare_tactics +valid_spaces_country_opp +prompt ()=>` from ${country_name(game.vm_active_country)}` +remove_opp_infl 1 + +CARD 350 - Support Surges +support_surges + +CARD 351 - Support Falters +support_falters + -- cgit v1.2.3 From a8874fde796f8fa563a8a80aa429f3a7c40eec44 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 13:14:16 +0100 Subject: Added power_card action --- play.js | 5 +++++ rules.js | 18 +++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/play.js b/play.js index f0f4390..5ccf136 100644 --- a/play.js +++ b/play.js @@ -206,6 +206,11 @@ function on_click_card(evt) { evt.stopPropagation(); } } + if (is_action('power_card', card)) { + if (send_action('power_card', card)) { + evt.stopPropagation(); + } + } } } diff --git a/rules.js b/rules.js index 44bbef6..0d0dcc3 100644 --- a/rules.js +++ b/rules.js @@ -290,6 +290,10 @@ function gen_action_card(card){ gen_action("card", card) } +function gen_action_power_card(card){ + gen_action("power_card", card) +} + function gen_action_sc(space){ gen_action("sc", space) } @@ -1280,11 +1284,11 @@ states.raise_stakes_1 = { gen_action('pass') } for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } }, - card(card) { + power_card(card) { push_undo() if (numberless_cards.includes(card)) { log(`Discarded: P${card}`) @@ -1343,11 +1347,11 @@ states.raise_stakes_2 = { gen_action('pass') } for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } }, - card(card) { + power_card(card) { push_undo() if (numberless_cards.includes(card)) { log(`Discarded: P${card}`) @@ -1401,7 +1405,7 @@ states.power_struggle = { if (game.valid_cards.length > 0) { view.prompt = "Play a card." for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } else if ( game.valid_cards.length === 0) { view.prompt = 'No valid cards. You must concede.' @@ -1413,7 +1417,7 @@ states.power_struggle = { view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` gen_action('concede') for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } else if (game.valid_cards.length === 0) { view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` @@ -1432,7 +1436,7 @@ states.power_struggle = { if (game.tactics_fails !== "Petition") {gen_action('petition')} } }, - card(card) { + power_card(card) { push_undo() discard(card) game.valid_cards=[] -- cgit v1.2.3 From e85e39c90fd3d6b375a4ce48d3347531b75f5f56 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 13:28:31 +0100 Subject: Merged infl sc into spaces action --- rules.js | 139 +++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/rules.js b/rules.js index 0d0dcc3..d0d86f7 100644 --- a/rules.js +++ b/rules.js @@ -282,6 +282,11 @@ function gen_action(action, argument) { //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } +function gen_action_space(space){ + gen_action("space", space) +} + + function gen_action_infl(space){ gen_action("infl", space) } @@ -335,10 +340,10 @@ states.com_init = { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { add_infl(space) }, @@ -385,10 +390,10 @@ states.dem_init = { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { add_infl(space) }, @@ -716,10 +721,10 @@ states.finish_add_infl = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } }, - infl(space) { + space(space) { add_infl(space) }, end_round() { @@ -744,11 +749,11 @@ states.finish_support_check_prep = { } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) + space(space_id) } } }, - sc(space) { + space(space) { push_undo() game.selected_space = space // Check for Austria-Hungary Border Reopened - check on first support check only @@ -820,11 +825,11 @@ states.add_influence = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } }, - infl(space) { + space(space) { add_infl(space) }, end_round() { @@ -1009,11 +1014,11 @@ states.support_check_prep = { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) + space(space_id) } } }, - sc(space) { + space(space) { push_undo() game.selected_space = space @@ -1245,10 +1250,10 @@ states.the_crowd_turns_against_ceausescu_infl = { view.prompt = `Add SPs: ${game.vm_available_ops} remaining` for (let space of game.valid_spaces) { - gen_action_infl(space) + gen_action_space(space) } }, - infl(space) { + space(space) { vm_do_add_infl(space) }, done() { @@ -1588,7 +1593,7 @@ states.support_loss ={ view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } } else if (game.phase === 1 && game.available_ops === 0 ) { view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` @@ -1605,7 +1610,7 @@ states.support_loss ={ view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } } else if (game.phase === 1 && game.available_ops === 0 ) { view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` @@ -1657,7 +1662,7 @@ states.support_loss ={ valid_spaces_support_loss() } }, - infl (space) { + space(space) { game.remove_opponent_infl = false /* Don't know why this is needed... */ remove_infl(space) if (game.available_ops === 0 ) { @@ -6171,7 +6176,7 @@ states.vm_take_control = { } else if (game.vm_available_ops > 0 ) { view.prompt = `${clean_name(cards[this_card()].name)}: take control of ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } else { view.prompt = `${clean_name(cards[this_card()].name)}. Take control: done.` @@ -6182,7 +6187,7 @@ states.vm_take_control = { } } }, - infl(space) { + space(space) { push_undo() vm_take_control(space) game.vm_available_ops-- @@ -6212,13 +6217,13 @@ states.vm_add_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } } else { get_end_infl_prompt() } }, - infl(space) { + space(space) { vm_do_add_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -6265,13 +6270,13 @@ states.vm_add_infl_free = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } else { get_end_infl_prompt() } }, - infl(space) { + space(space) { vm_do_add_infl_free(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -6320,14 +6325,14 @@ states.vm_add_x_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: Add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') }*/ }, - infl(space) { + space(space) { push_undo() vm_do_add_x_infl(space) if (game.vm_available_ops === 0) { @@ -6363,14 +6368,14 @@ states.vm_add_limited_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') }*/ }, - infl(space) { + space(space) { vm_do_add_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { game.valid_spaces = [] @@ -6414,10 +6419,10 @@ states.vm_remove_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { push_undo() vm_do_remove_infl(space) game.vm_active_country = spaces[space].country @@ -6454,7 +6459,7 @@ states.vm_remove_x_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } /*else { if (game.vm_infl_to_do) { @@ -6468,7 +6473,7 @@ states.vm_remove_x_infl = { } }*/ }, - infl(space) { + space(space) { vm_do_remove_x_infl(space) /*if (game.vm_event === 68) { vm_next() @@ -6494,7 +6499,7 @@ states.vm_remove_limited_infl = { 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(space_id); + gen_action_space(space_id); } } 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.` @@ -6511,7 +6516,7 @@ states.vm_remove_limited_infl = { } }*/ }, - infl(space) { + space(space) { vm_do_remove_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0) { game.vm_event_done = true @@ -6541,14 +6546,14 @@ states.vm_remove_all_infl = { } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` gen_action('done') }*/ }, - infl(space) { + space(space) { vm_do_remove_all_infl(space) game.vm_active_country = spaces[space].country if (game.vm_available_ops === 0) { @@ -6577,11 +6582,11 @@ states.vm_support_check_prep = { //} for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_sc(space_id); + space(space_id); } } }, - sc(space) { + space(space) { push_undo() game.selected_space = space @@ -6625,11 +6630,11 @@ states.vm_ceh_support_check_prep = { view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_sc(space_id) + space(space_id) } } }, - sc(space) { + space(space) { push_undo() game.selected_space = space @@ -6704,11 +6709,11 @@ states.vm_1_support_check_prep = { for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_sc(space_id); + space(space_id); } } }, - sc(space) { + space(space) { push_undo() game.selected_space = space game.state = 'vm_do_support_check' @@ -7618,11 +7623,11 @@ states.vm_kremlin_coup_take_control = { } else { view.prompt = `Kremlin Coup! Take control of the Elite space in ${country_name(game.vm_active_country)}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } }, - infl(space) { + space(space) { push_undo() vm_take_control(space) if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } @@ -7651,9 +7656,9 @@ states.vm_kremlin_coup_sc_prep = { }, prompt() { view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` - gen_action_sc(game.selected_space); + space(game.selected_space); }, - sc(space) { + space(space) { //game.selected_space = space push_undo() game.state = 'vm_kremlin_coup_sc' @@ -7731,14 +7736,14 @@ states.vm_switch_infl = { /*if (game.vm_available_ops > 0 ) {*/ view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } /*else { view.prompt = 'Influence replaced.' gen_action('done') }*/ }, - infl(space) { + space(space) { push_undo() vm_switch_infl(space) if (game.vm_available_ops === 0) { @@ -7947,11 +7952,11 @@ states.vm_nomenklatura_remove = { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } }, - infl(space) { + space(space) { push_undo() vm_do_remove_all_infl(space) if (game.valid_spaces.length === 0) { @@ -7975,11 +7980,11 @@ states.vm_nomenklatura_add = { } else { */ view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } //} }, - infl(space) { + space(space) { push_undo() vm_do_add_infl_free(space) if (game.vm_available_ops === 0 ) { @@ -8208,14 +8213,14 @@ states.vm_systematization = { /*if (game.systematization === 0) { */ view.prompt = 'Systematization: eliminate a space in Romania.' for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } /*} else { view.prompt = 'Systematization: done.' gen_action('done') }*/ }, - infl(space) { + space(space) { push_undo() vm_eliminate(space) game.valid_spaces = [] @@ -8324,14 +8329,14 @@ states.vm_the_tyrant_is_gone = { view.prompt = 'The Tyrant is Gone: Select a space in Romania for the Ceausescus to flee to.' for (let space_id of game.valid_spaces) { if (!space_id) continue - gen_action_infl(space_id); + gen_action_space(space_id); } } else { view.prompt = 'The Tyrant is Gone: done.' gen_action('done') } }, - infl(space) { + space(space) { push_undo() log(`The Ceausescus flee to %${space}`) game.the_tyrant_is_gone = space @@ -8509,14 +8514,14 @@ states.vm_we_are_the_people_remove = { view.prompt = '"We are the People!": remove up to 4 SPs from the Lutherian Church.' gen_action('done') for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } } else { view.prompt = '"We are the People!" Remove SPs: done.' gen_action('done') } }, - infl(space) { + space(space) { vm_do_remove_infl(space) }, done() { @@ -8546,10 +8551,10 @@ states.vm_we_are_the_people_add = { view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { vm_do_add_infl_free(space) game.vm_influence_added[6]-- if (game.vm_influence_added[6] === 0 ) { @@ -8583,14 +8588,14 @@ states.vm_workers_revolt = { } view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.' for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + gen_action_space(space_id) } }, pass() { push_undo() vm_next() }, - infl(space) { + space(space) { push_undo() game.selected_space = space log(`Chose %${game.selected_space}`) @@ -8699,10 +8704,10 @@ states.vm_tst_4 = { view.prompt = `Tiananmen Square Track award: remove ${pluralize(game.vm_available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { vm_do_remove_infl(space) if (game.vm_available_ops === 0) { if (game.summary.length > 0) { @@ -8732,12 +8737,12 @@ states.vm_tst_6 = { view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' for (let space_id of game.valid_spaces) { if (space_id) { - gen_action_sc(space_id); + space(space_id); } } //} }, - sc(space) { + space(space) { push_undo() game.selected_space = space if (game.active === DEM && game.persistent_events.includes(58) && spaces[space].country === "East_Germany") { @@ -8862,10 +8867,10 @@ states.vm_scare_tactics = { } view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops, 'opponent SP')}${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_infl(space_id); + gen_action_space(space_id); } }, - infl(space) { + space(space) { push_undo() vm_do_remove_infl(space) }, -- cgit v1.2.3 From 5bc3b0140d5e59f0c8d987d2d3d5299c420673ee Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 18:13:20 +0100 Subject: Removed Math.random --- rules.js | 98 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/rules.js b/rules.js index d0d86f7..877c4d8 100644 --- a/rules.js +++ b/rules.js @@ -721,7 +721,7 @@ states.finish_add_infl = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_space(space_id) + gen_action_space(space_id) } }, space(space) { @@ -749,7 +749,7 @@ states.finish_support_check_prep = { } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - space(space_id) + gen_action_space(space_id) } } }, @@ -825,7 +825,7 @@ states.add_influence = { // Generate actions for valid spaces for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } }, @@ -1014,7 +1014,7 @@ states.support_check_prep = { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - space(space_id) + gen_action_space(space_id) } } }, @@ -1248,10 +1248,10 @@ states.the_crowd_turns_against_ceausescu_infl = { return; } - view.prompt = `Add SPs: ${game.vm_available_ops} remaining` - for (let space of game.valid_spaces) { - gen_action_space(space) - } + view.prompt = `Add SPs: ${game.vm_available_ops} remaining` + for (let space of game.valid_spaces) { + gen_action_space(space) + } }, space(space) { vm_do_add_infl(space) @@ -1496,7 +1496,7 @@ states.power_struggle = { } }, roll () { - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { log('Initiative roll successful') @@ -1623,7 +1623,7 @@ states.support_loss ={ }, roll () { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() let rally_win = 0 let petition_win = 0 log(`Roll: D${roll}`) @@ -1709,7 +1709,7 @@ states.vp_roll = { } }, roll () { - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) let rally_win = 0 let petition_win = 0 @@ -2064,7 +2064,7 @@ states.general_strike = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) logi(`+${game.available_ops} ops`) @@ -2454,7 +2454,7 @@ function do_sc(space) { // Continue with Support Check Logic - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) /* @@ -2927,7 +2927,7 @@ function check_com_control(space_id) { } function do_tst_attempt() { - let roll = Math.floor(Math.random() * 6) + 1; + let roll = roll_d6(); log(`Roll: D${roll}`); roll += game.available_ops @@ -3944,6 +3944,18 @@ function change_player() { game.active = DEM } +function random(range) { + // An MLCG using integer arithmetic with doubles. + // https://www.ams.org/journals/mcom/1999-68-225/S0025-5718-99-00996-5/S0025-5718-99-00996-5.pdf + // m = 2**35 − 31 + return (game.seed = game.seed * 200105 % 34359738337) % range +} + +function roll_d6() { + return random(6) + 1 +} + + function find_space_index(name_unique) { return spaces.findIndex(space => space && space.name_unique === name_unique) } @@ -4002,7 +4014,7 @@ function draw_card(deck) { deck.push(...game.strategy_discard) game.strategy_discard = [] } - const randomIndex = Math.floor(Math.random() * deck.length) + const randomIndex = Math.floor(random(deck.length)) //console.log('card chosen:', randomIndex) //console.log('game.strategy_deck after', game.strategy_deck) return deck.splice(randomIndex, 1)[0]; @@ -4072,7 +4084,7 @@ function remove_from_discard(card) { function discard_card(hand) { //let find_card - let card = Math.floor(Math.random()*hand.length) + let card = Math.floor(random(hand.length)) let discarded_card = hand.splice(card, 1)[0] if (game.is_pwr_struggle) { if (numberless_cards.includes(discarded_card)) { @@ -6217,7 +6229,7 @@ states.vm_add_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id) + gen_action_space(space_id) } } else { get_end_infl_prompt() @@ -6270,7 +6282,7 @@ states.vm_add_infl_free = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${game.vm_available_ops} SPs to ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } else { get_end_infl_prompt() @@ -6368,7 +6380,7 @@ states.vm_add_limited_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: add ${pluralize(game.vm_available_ops,'SP')} to ${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` @@ -6419,7 +6431,7 @@ states.vm_remove_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}.` } for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } }, space(space) { @@ -6459,7 +6471,7 @@ states.vm_remove_x_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } /*else { if (game.vm_infl_to_do) { @@ -6499,7 +6511,7 @@ states.vm_remove_limited_infl = { 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_space(space_id); + gen_action_space(space_id); } } 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.` @@ -6546,7 +6558,7 @@ states.vm_remove_all_infl = { } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove all SPs from ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } /*else { view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` @@ -6582,7 +6594,7 @@ states.vm_support_check_prep = { //} for (let space_id of game.valid_spaces) { if (!space_id) continue - space(space_id); + gen_action_space(space_id); } } }, @@ -6630,7 +6642,7 @@ states.vm_ceh_support_check_prep = { view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - space(space_id) + gen_action_space(space_id) } } }, @@ -6709,7 +6721,7 @@ states.vm_1_support_check_prep = { for (let space_id of game.valid_spaces) { if (!space_id) continue - space(space_id); + gen_action_space(space_id); } } }, @@ -6778,7 +6790,7 @@ states.vm_adamec = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() 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) { @@ -6986,7 +6998,7 @@ states.vm_dash_for_the_west = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) let com_control = check_presence('East_Germany').com_spaces @@ -7090,8 +7102,12 @@ states.vm_deutsche_marks_confirm = { gen_action('done') }, done() { - next_player() - game.state = 'vm_deutsche_marks' + if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { + goto_vm(game.vm_event) + } else { + next_player() + game.state = 'vm_deutsche_marks' + } } } @@ -7736,7 +7752,7 @@ states.vm_switch_infl = { /*if (game.vm_available_ops > 0 ) {*/ view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } /*else { view.prompt = 'Influence replaced.' @@ -7774,7 +7790,7 @@ states.vm_malta_summit = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) if (game.stability > 0) { log(`+${game.stability} from USSR Stability Track`) @@ -7818,7 +7834,7 @@ states.vm_modrow = { }, roll(){ clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() 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}`) @@ -7848,7 +7864,7 @@ states.vm_nepotism = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() if (roll < 3) { log(`Roll: D${roll} adds 4 SPs`) game.vm_available_ops = 4} @@ -7952,7 +7968,7 @@ states.vm_nomenklatura_remove = { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } } }, @@ -8117,7 +8133,7 @@ states.vm_shock_therapy = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() let worker_farmer = 0 for (let space of spaces) { if (space && space.country === game.vm_active_country && check_com_control(space.space_id) && (space.socio === 3 || space.socio === 4)) { @@ -8385,7 +8401,7 @@ states.vm_the_wall_must_go = { log_h3(`Round ${attempt+1}`) } - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() 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 @@ -8588,7 +8604,7 @@ states.vm_workers_revolt = { } view.prompt = 'Workers Revolt: select a Worker Space in a country your opponent has power.' for (let space_id of game.valid_spaces) { - gen_action_space(space_id) + gen_action_space(space_id) } }, pass() { @@ -8620,7 +8636,7 @@ states.vm_workers_revolt_finish = { }, roll() { clear_undo() - let roll = Math.floor(Math.random() * 6) + 1 + let roll = roll_d6() log(`Roll: D${roll}`) let adj = count_adj(game.selected_space) if (game.active === DEM) { @@ -8704,7 +8720,7 @@ states.vm_tst_4 = { view.prompt = `Tiananmen Square Track award: remove ${pluralize(game.vm_available_ops,'SP')}.` for (let space_id of game.valid_spaces) { - gen_action_space(space_id); + gen_action_space(space_id); } }, space(space) { @@ -8737,7 +8753,7 @@ states.vm_tst_6 = { view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' for (let space_id of game.valid_spaces) { if (space_id) { - space(space_id); + gen_action_space(space_id); } } //} -- cgit v1.2.3 From 8f1914e8942d961355aac8e5b2503e2d025948b8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 24 Oct 2024 10:54:33 +0200 Subject: Updated cover art. --- cover.1x.jpg | Bin 21853 -> 22474 bytes cover.1x.png | Bin 56446 -> 56446 bytes cover.2x.jpg | Bin 66712 -> 69090 bytes cover.2x.png | Bin 206110 -> 206110 bytes thumbnail.png | Bin 31023 -> 31023 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/cover.1x.jpg b/cover.1x.jpg index a8070d8..a7f7128 100644 Binary files a/cover.1x.jpg and b/cover.1x.jpg differ diff --git a/cover.1x.png b/cover.1x.png index ece84d7..6ae7868 100644 Binary files a/cover.1x.png and b/cover.1x.png differ diff --git a/cover.2x.jpg b/cover.2x.jpg index c8d23c7..a3844f1 100644 Binary files a/cover.2x.jpg and b/cover.2x.jpg differ diff --git a/cover.2x.png b/cover.2x.png index 1f09e19..514ed1d 100644 Binary files a/cover.2x.png and b/cover.2x.png differ diff --git a/thumbnail.png b/thumbnail.png index b61c39a..28c5fc4 100644 Binary files a/thumbnail.png and b/thumbnail.png differ -- cgit v1.2.3 From 476012cf32f886491e983ae4a24ec077b1430b78 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 23:46:52 +0200 Subject: REMOVE VASSAL IMAGES --- 1989_map.jpg | Bin 1532763 -> 0 bytes cards/e1.gif | Bin 41173 -> 0 bytes cards/e10.gif | Bin 45725 -> 0 bytes cards/e100.gif | Bin 47033 -> 0 bytes cards/e101.gif | Bin 35715 -> 0 bytes cards/e102.gif | Bin 52121 -> 0 bytes cards/e103.gif | Bin 41393 -> 0 bytes cards/e104.gif | Bin 50934 -> 0 bytes cards/e105.gif | Bin 32868 -> 0 bytes cards/e106.gif | Bin 55236 -> 0 bytes cards/e107.gif | Bin 53985 -> 0 bytes cards/e108.gif | Bin 39396 -> 0 bytes cards/e109.gif | Bin 52280 -> 0 bytes cards/e11.gif | Bin 35357 -> 0 bytes cards/e110.gif | Bin 52196 -> 0 bytes cards/e12.gif | Bin 36855 -> 0 bytes cards/e13.gif | Bin 29026 -> 0 bytes cards/e14.gif | Bin 47291 -> 0 bytes cards/e15.gif | Bin 44485 -> 0 bytes cards/e16.gif | Bin 47827 -> 0 bytes cards/e17.gif | Bin 55283 -> 0 bytes cards/e18.gif | Bin 48673 -> 0 bytes cards/e19.gif | Bin 51580 -> 0 bytes cards/e2.gif | Bin 47713 -> 0 bytes cards/e20.gif | Bin 48684 -> 0 bytes cards/e21.gif | Bin 43661 -> 0 bytes cards/e22.gif | Bin 55339 -> 0 bytes cards/e23.gif | Bin 45012 -> 0 bytes cards/e24.gif | Bin 46517 -> 0 bytes cards/e25.gif | Bin 36750 -> 0 bytes cards/e26.gif | Bin 48924 -> 0 bytes cards/e27.gif | Bin 37383 -> 0 bytes cards/e28.gif | Bin 40841 -> 0 bytes cards/e29.gif | Bin 50513 -> 0 bytes cards/e3.gif | Bin 45791 -> 0 bytes cards/e30.gif | Bin 48397 -> 0 bytes cards/e31.gif | Bin 48803 -> 0 bytes cards/e32.gif | Bin 41812 -> 0 bytes cards/e33.gif | Bin 37416 -> 0 bytes cards/e34.gif | Bin 30253 -> 0 bytes cards/e35.gif | Bin 43812 -> 0 bytes cards/e36.gif | Bin 48081 -> 0 bytes cards/e37.gif | Bin 48246 -> 0 bytes cards/e38.gif | Bin 42546 -> 0 bytes cards/e39.gif | Bin 20887 -> 0 bytes cards/e4.gif | Bin 49249 -> 0 bytes cards/e40.gif | Bin 32686 -> 0 bytes cards/e41.gif | Bin 47201 -> 0 bytes cards/e42.gif | Bin 51711 -> 0 bytes cards/e43.gif | Bin 48165 -> 0 bytes cards/e44.gif | Bin 47662 -> 0 bytes cards/e45.gif | Bin 48593 -> 0 bytes cards/e46.gif | Bin 52918 -> 0 bytes cards/e47.gif | Bin 46167 -> 0 bytes cards/e48.gif | Bin 46050 -> 0 bytes cards/e49.gif | Bin 30897 -> 0 bytes cards/e5.gif | Bin 55871 -> 0 bytes cards/e50.gif | Bin 37886 -> 0 bytes cards/e51.gif | Bin 42136 -> 0 bytes cards/e52.gif | Bin 35487 -> 0 bytes cards/e53.gif | Bin 41152 -> 0 bytes cards/e54.gif | Bin 51568 -> 0 bytes cards/e55.gif | Bin 53379 -> 0 bytes cards/e56.gif | Bin 47264 -> 0 bytes cards/e57.gif | Bin 41053 -> 0 bytes cards/e58.gif | Bin 49002 -> 0 bytes cards/e59.gif | Bin 48521 -> 0 bytes cards/e6.gif | Bin 53364 -> 0 bytes cards/e60.gif | Bin 38365 -> 0 bytes cards/e61.gif | Bin 59278 -> 0 bytes cards/e62.gif | Bin 47030 -> 0 bytes cards/e63.gif | Bin 37173 -> 0 bytes cards/e64.gif | Bin 55336 -> 0 bytes cards/e65.gif | Bin 45256 -> 0 bytes cards/e66.gif | Bin 45276 -> 0 bytes cards/e67.gif | Bin 46779 -> 0 bytes cards/e68.gif | Bin 47975 -> 0 bytes cards/e69.gif | Bin 55250 -> 0 bytes cards/e7.gif | Bin 38561 -> 0 bytes cards/e70.gif | Bin 51398 -> 0 bytes cards/e71.gif | Bin 41245 -> 0 bytes cards/e72.gif | Bin 57623 -> 0 bytes cards/e73.gif | Bin 45497 -> 0 bytes cards/e74.gif | Bin 47107 -> 0 bytes cards/e75.gif | Bin 43205 -> 0 bytes cards/e76.gif | Bin 59066 -> 0 bytes cards/e77.gif | Bin 55423 -> 0 bytes cards/e78.gif | Bin 48166 -> 0 bytes cards/e79.gif | Bin 49578 -> 0 bytes cards/e8.gif | Bin 38108 -> 0 bytes cards/e80.gif | Bin 42881 -> 0 bytes cards/e81.gif | Bin 46392 -> 0 bytes cards/e82.gif | Bin 33240 -> 0 bytes cards/e83.gif | Bin 41811 -> 0 bytes cards/e84.gif | Bin 55422 -> 0 bytes cards/e85.gif | Bin 44517 -> 0 bytes cards/e86.gif | Bin 55559 -> 0 bytes cards/e87.gif | Bin 43060 -> 0 bytes cards/e88.gif | Bin 59184 -> 0 bytes cards/e89.gif | Bin 49189 -> 0 bytes cards/e9.gif | Bin 49698 -> 0 bytes cards/e90.gif | Bin 52416 -> 0 bytes cards/e91.gif | Bin 37102 -> 0 bytes cards/e92.gif | Bin 40982 -> 0 bytes cards/e93.gif | Bin 53105 -> 0 bytes cards/e94.gif | Bin 54882 -> 0 bytes cards/e95.gif | Bin 41576 -> 0 bytes cards/e96.gif | Bin 53108 -> 0 bytes cards/e97.gif | Bin 55092 -> 0 bytes cards/e98.gif | Bin 49232 -> 0 bytes cards/e99.gif | Bin 42212 -> 0 bytes cards_2/ps1.gif | Bin 12989 -> 0 bytes cards_2/ps10.gif | Bin 11046 -> 0 bytes cards_2/ps11.gif | Bin 11029 -> 0 bytes cards_2/ps12.gif | Bin 12107 -> 0 bytes cards_2/ps13.gif | Bin 10798 -> 0 bytes cards_2/ps14.gif | Bin 11340 -> 0 bytes cards_2/ps15.gif | Bin 9963 -> 0 bytes cards_2/ps16.gif | Bin 9427 -> 0 bytes cards_2/ps17.gif | Bin 10657 -> 0 bytes cards_2/ps18.gif | Bin 9394 -> 0 bytes cards_2/ps19.gif | Bin 9370 -> 0 bytes cards_2/ps2.gif | Bin 12816 -> 0 bytes cards_2/ps20.gif | Bin 9022 -> 0 bytes cards_2/ps21.gif | Bin 11928 -> 0 bytes cards_2/ps22.gif | Bin 11208 -> 0 bytes cards_2/ps23.gif | Bin 15085 -> 0 bytes cards_2/ps24.gif | Bin 8340 -> 0 bytes cards_2/ps25.gif | Bin 10627 -> 0 bytes cards_2/ps26.gif | Bin 9910 -> 0 bytes cards_2/ps27.gif | Bin 11695 -> 0 bytes cards_2/ps3.gif | Bin 12752 -> 0 bytes cards_2/ps4.gif | Bin 12713 -> 0 bytes cards_2/ps5.gif | Bin 12776 -> 0 bytes cards_2/ps6.gif | Bin 15057 -> 0 bytes cards_2/ps7.gif | Bin 15033 -> 0 bytes cards_2/ps8.gif | Bin 14977 -> 0 bytes cards_2/ps9.gif | Bin 15088 -> 0 bytes images/Event_Marker_Austria_Hungar.gif | Bin 5229 -> 0 bytes images/Event_Marker_Eco_Glasnost.gif | Bin 3849 -> 0 bytes images/Event_Marker_Elena.gif | Bin 5472 -> 0 bytes images/Event_Marker_Foreign_Curren.gif | Bin 5612 -> 0 bytes images/Event_Marker_Grenz_Truppen.gif | Bin 6114 -> 0 bytes images/Event_Marker_Helsinki.gif | Bin 4732 -> 0 bytes images/Event_Marker_Honecker.gif | Bin 5660 -> 0 bytes images/Event_Marker_Laszlo.gif | Bin 4389 -> 0 bytes images/Event_Marker_Li_Peng_.gif | Bin 4496 -> 0 bytes images/Event_Marker_NYE_Party.gif | Bin 5383 -> 0 bytes images/Event_Marker_Pres_Visit.gif | Bin 6248 -> 0 bytes images/Event_Marker_Securitate.gif | Bin 5847 -> 0 bytes images/Event_Marker_Solidarity_Leg.gif | Bin 4948 -> 0 bytes images/Event_Marker_St_Nicholas.gif | Bin 4302 -> 0 bytes images/Event_Marker_Stand_Fast.gif | Bin 6199 -> 0 bytes images/Event_Marker_Systematizatio.gif | Bin 4470 -> 0 bytes images/Event_Marker_The_Tyrant_Is_.gif | Bin 6164 -> 0 bytes images/Event_Marker_The_Wall.gif | Bin 5801 -> 0 bytes images/Event_Marker_USSR_Stability.gif | Bin 1666 -> 0 bytes images/Event_Marker_We_are_the_Peo.gif | Bin 5427 -> 0 bytes images/SV_2.gif | Bin 2014 -> 0 bytes images/SV_3.gif | Bin 2011 -> 0 bytes images/SV_4.gif | Bin 1959 -> 0 bytes images/SV_5.gif | Bin 1976 -> 0 bytes images/SV_6.gif | Bin 2003 -> 0 bytes images/SV_7.gif | Bin 1976 -> 0 bytes images/SV_8.gif | Bin 1986 -> 0 bytes images/SV_Action_Round.gif | Bin 2007 -> 0 bytes images/SV_Stability.gif | Bin 2556 -> 0 bytes images/SV_Tiananmen_Square.gif | Bin 2288 -> 0 bytes images/SV_blank.gif | Bin 1168 -> 0 bytes images/SVd_blank.gif | Bin 1814 -> 0 bytes images/Turn.gif | Bin 1391 -> 0 bytes images/US_1.gif | Bin 1933 -> 0 bytes images/US_2.gif | Bin 1961 -> 0 bytes images/US_3.gif | Bin 1982 -> 0 bytes images/US_4.gif | Bin 1953 -> 0 bytes images/US_5.gif | Bin 1971 -> 0 bytes images/US_6.gif | Bin 1992 -> 0 bytes images/US_7.gif | Bin 2005 -> 0 bytes images/US_8.gif | Bin 1951 -> 0 bytes images/US_Action_Round.gif | Bin 2667 -> 0 bytes images/US_Tiananmen_Square.gif | Bin 2241 -> 0 bytes images/US_blank.gif | Bin 1542 -> 0 bytes images/USd_blank.gif | Bin 1810 -> 0 bytes images/VP.gif | Bin 1293 -> 0 bytes images/bin.png | Bin 25047 -> 0 bytes images/cog.svg | 1 - images/earth-africa-europe.svg | 1 - images/remove.png | Bin 4887 -> 0 bytes 188 files changed, 2 deletions(-) delete mode 100644 1989_map.jpg delete mode 100644 cards/e1.gif delete mode 100644 cards/e10.gif delete mode 100644 cards/e100.gif delete mode 100644 cards/e101.gif delete mode 100644 cards/e102.gif delete mode 100644 cards/e103.gif delete mode 100644 cards/e104.gif delete mode 100644 cards/e105.gif delete mode 100644 cards/e106.gif delete mode 100644 cards/e107.gif delete mode 100644 cards/e108.gif delete mode 100644 cards/e109.gif delete mode 100644 cards/e11.gif delete mode 100644 cards/e110.gif delete mode 100644 cards/e12.gif delete mode 100644 cards/e13.gif delete mode 100644 cards/e14.gif delete mode 100644 cards/e15.gif delete mode 100644 cards/e16.gif delete mode 100644 cards/e17.gif delete mode 100644 cards/e18.gif delete mode 100644 cards/e19.gif delete mode 100644 cards/e2.gif delete mode 100644 cards/e20.gif delete mode 100644 cards/e21.gif delete mode 100644 cards/e22.gif delete mode 100644 cards/e23.gif delete mode 100644 cards/e24.gif delete mode 100644 cards/e25.gif delete mode 100644 cards/e26.gif delete mode 100644 cards/e27.gif delete mode 100644 cards/e28.gif delete mode 100644 cards/e29.gif delete mode 100644 cards/e3.gif delete mode 100644 cards/e30.gif delete mode 100644 cards/e31.gif delete mode 100644 cards/e32.gif delete mode 100644 cards/e33.gif delete mode 100644 cards/e34.gif delete mode 100644 cards/e35.gif delete mode 100644 cards/e36.gif delete mode 100644 cards/e37.gif delete mode 100644 cards/e38.gif delete mode 100644 cards/e39.gif delete mode 100644 cards/e4.gif delete mode 100644 cards/e40.gif delete mode 100644 cards/e41.gif delete mode 100644 cards/e42.gif delete mode 100644 cards/e43.gif delete mode 100644 cards/e44.gif delete mode 100644 cards/e45.gif delete mode 100644 cards/e46.gif delete mode 100644 cards/e47.gif delete mode 100644 cards/e48.gif delete mode 100644 cards/e49.gif delete mode 100644 cards/e5.gif delete mode 100644 cards/e50.gif delete mode 100644 cards/e51.gif delete mode 100644 cards/e52.gif delete mode 100644 cards/e53.gif delete mode 100644 cards/e54.gif delete mode 100644 cards/e55.gif delete mode 100644 cards/e56.gif delete mode 100644 cards/e57.gif delete mode 100644 cards/e58.gif delete mode 100644 cards/e59.gif delete mode 100644 cards/e6.gif delete mode 100644 cards/e60.gif delete mode 100644 cards/e61.gif delete mode 100644 cards/e62.gif delete mode 100644 cards/e63.gif delete mode 100644 cards/e64.gif delete mode 100644 cards/e65.gif delete mode 100644 cards/e66.gif delete mode 100644 cards/e67.gif delete mode 100644 cards/e68.gif delete mode 100644 cards/e69.gif delete mode 100644 cards/e7.gif delete mode 100644 cards/e70.gif delete mode 100644 cards/e71.gif delete mode 100644 cards/e72.gif delete mode 100644 cards/e73.gif delete mode 100644 cards/e74.gif delete mode 100644 cards/e75.gif delete mode 100644 cards/e76.gif delete mode 100644 cards/e77.gif delete mode 100644 cards/e78.gif delete mode 100644 cards/e79.gif delete mode 100644 cards/e8.gif delete mode 100644 cards/e80.gif delete mode 100644 cards/e81.gif delete mode 100644 cards/e82.gif delete mode 100644 cards/e83.gif delete mode 100644 cards/e84.gif delete mode 100644 cards/e85.gif delete mode 100644 cards/e86.gif delete mode 100644 cards/e87.gif delete mode 100644 cards/e88.gif delete mode 100644 cards/e89.gif delete mode 100644 cards/e9.gif delete mode 100644 cards/e90.gif delete mode 100644 cards/e91.gif delete mode 100644 cards/e92.gif delete mode 100644 cards/e93.gif delete mode 100644 cards/e94.gif delete mode 100644 cards/e95.gif delete mode 100644 cards/e96.gif delete mode 100644 cards/e97.gif delete mode 100644 cards/e98.gif delete mode 100644 cards/e99.gif delete mode 100644 cards_2/ps1.gif delete mode 100644 cards_2/ps10.gif delete mode 100644 cards_2/ps11.gif delete mode 100644 cards_2/ps12.gif delete mode 100644 cards_2/ps13.gif delete mode 100644 cards_2/ps14.gif delete mode 100644 cards_2/ps15.gif delete mode 100644 cards_2/ps16.gif delete mode 100644 cards_2/ps17.gif delete mode 100644 cards_2/ps18.gif delete mode 100644 cards_2/ps19.gif delete mode 100644 cards_2/ps2.gif delete mode 100644 cards_2/ps20.gif delete mode 100644 cards_2/ps21.gif delete mode 100644 cards_2/ps22.gif delete mode 100644 cards_2/ps23.gif delete mode 100644 cards_2/ps24.gif delete mode 100644 cards_2/ps25.gif delete mode 100644 cards_2/ps26.gif delete mode 100644 cards_2/ps27.gif delete mode 100644 cards_2/ps3.gif delete mode 100644 cards_2/ps4.gif delete mode 100644 cards_2/ps5.gif delete mode 100644 cards_2/ps6.gif delete mode 100644 cards_2/ps7.gif delete mode 100644 cards_2/ps8.gif delete mode 100644 cards_2/ps9.gif delete mode 100644 images/Event_Marker_Austria_Hungar.gif delete mode 100644 images/Event_Marker_Eco_Glasnost.gif delete mode 100644 images/Event_Marker_Elena.gif delete mode 100644 images/Event_Marker_Foreign_Curren.gif delete mode 100644 images/Event_Marker_Grenz_Truppen.gif delete mode 100644 images/Event_Marker_Helsinki.gif delete mode 100644 images/Event_Marker_Honecker.gif delete mode 100644 images/Event_Marker_Laszlo.gif delete mode 100644 images/Event_Marker_Li_Peng_.gif delete mode 100644 images/Event_Marker_NYE_Party.gif delete mode 100644 images/Event_Marker_Pres_Visit.gif delete mode 100644 images/Event_Marker_Securitate.gif delete mode 100644 images/Event_Marker_Solidarity_Leg.gif delete mode 100644 images/Event_Marker_St_Nicholas.gif delete mode 100644 images/Event_Marker_Stand_Fast.gif delete mode 100644 images/Event_Marker_Systematizatio.gif delete mode 100644 images/Event_Marker_The_Tyrant_Is_.gif delete mode 100644 images/Event_Marker_The_Wall.gif delete mode 100644 images/Event_Marker_USSR_Stability.gif delete mode 100644 images/Event_Marker_We_are_the_Peo.gif delete mode 100644 images/SV_2.gif delete mode 100644 images/SV_3.gif delete mode 100644 images/SV_4.gif delete mode 100644 images/SV_5.gif delete mode 100644 images/SV_6.gif delete mode 100644 images/SV_7.gif delete mode 100644 images/SV_8.gif delete mode 100644 images/SV_Action_Round.gif delete mode 100644 images/SV_Stability.gif delete mode 100644 images/SV_Tiananmen_Square.gif delete mode 100644 images/SV_blank.gif delete mode 100644 images/SVd_blank.gif delete mode 100644 images/Turn.gif delete mode 100644 images/US_1.gif delete mode 100644 images/US_2.gif delete mode 100644 images/US_3.gif delete mode 100644 images/US_4.gif delete mode 100644 images/US_5.gif delete mode 100644 images/US_6.gif delete mode 100644 images/US_7.gif delete mode 100644 images/US_8.gif delete mode 100644 images/US_Action_Round.gif delete mode 100644 images/US_Tiananmen_Square.gif delete mode 100644 images/US_blank.gif delete mode 100644 images/USd_blank.gif delete mode 100644 images/VP.gif delete mode 100644 images/bin.png delete mode 100644 images/cog.svg delete mode 100644 images/earth-africa-europe.svg delete mode 100644 images/remove.png diff --git a/1989_map.jpg b/1989_map.jpg deleted file mode 100644 index b0d38b9..0000000 Binary files a/1989_map.jpg and /dev/null differ diff --git a/cards/e1.gif b/cards/e1.gif deleted file mode 100644 index 6e876fe..0000000 Binary files a/cards/e1.gif and /dev/null differ diff --git a/cards/e10.gif b/cards/e10.gif deleted file mode 100644 index c73aef7..0000000 Binary files a/cards/e10.gif and /dev/null differ diff --git a/cards/e100.gif b/cards/e100.gif deleted file mode 100644 index c4ee1e0..0000000 Binary files a/cards/e100.gif and /dev/null differ diff --git a/cards/e101.gif b/cards/e101.gif deleted file mode 100644 index 7e233cd..0000000 Binary files a/cards/e101.gif and /dev/null differ diff --git a/cards/e102.gif b/cards/e102.gif deleted file mode 100644 index e9e8c83..0000000 Binary files a/cards/e102.gif and /dev/null differ diff --git a/cards/e103.gif b/cards/e103.gif deleted file mode 100644 index 9596e34..0000000 Binary files a/cards/e103.gif and /dev/null differ diff --git a/cards/e104.gif b/cards/e104.gif deleted file mode 100644 index d7350fd..0000000 Binary files a/cards/e104.gif and /dev/null differ diff --git a/cards/e105.gif b/cards/e105.gif deleted file mode 100644 index c2bbf39..0000000 Binary files a/cards/e105.gif and /dev/null differ diff --git a/cards/e106.gif b/cards/e106.gif deleted file mode 100644 index 8d628b7..0000000 Binary files a/cards/e106.gif and /dev/null differ diff --git a/cards/e107.gif b/cards/e107.gif deleted file mode 100644 index 45215ec..0000000 Binary files a/cards/e107.gif and /dev/null differ diff --git a/cards/e108.gif b/cards/e108.gif deleted file mode 100644 index c7b39d6..0000000 Binary files a/cards/e108.gif and /dev/null differ diff --git a/cards/e109.gif b/cards/e109.gif deleted file mode 100644 index 63524d7..0000000 Binary files a/cards/e109.gif and /dev/null differ diff --git a/cards/e11.gif b/cards/e11.gif deleted file mode 100644 index 7f1e3d1..0000000 Binary files a/cards/e11.gif and /dev/null differ diff --git a/cards/e110.gif b/cards/e110.gif deleted file mode 100644 index 49ed8a7..0000000 Binary files a/cards/e110.gif and /dev/null differ diff --git a/cards/e12.gif b/cards/e12.gif deleted file mode 100644 index 6edee5b..0000000 Binary files a/cards/e12.gif and /dev/null differ diff --git a/cards/e13.gif b/cards/e13.gif deleted file mode 100644 index 7c2687f..0000000 Binary files a/cards/e13.gif and /dev/null differ diff --git a/cards/e14.gif b/cards/e14.gif deleted file mode 100644 index 182f153..0000000 Binary files a/cards/e14.gif and /dev/null differ diff --git a/cards/e15.gif b/cards/e15.gif deleted file mode 100644 index 1223dcd..0000000 Binary files a/cards/e15.gif and /dev/null differ diff --git a/cards/e16.gif b/cards/e16.gif deleted file mode 100644 index 7cb40a2..0000000 Binary files a/cards/e16.gif and /dev/null differ diff --git a/cards/e17.gif b/cards/e17.gif deleted file mode 100644 index 231fe92..0000000 Binary files a/cards/e17.gif and /dev/null differ diff --git a/cards/e18.gif b/cards/e18.gif deleted file mode 100644 index 7738d85..0000000 Binary files a/cards/e18.gif and /dev/null differ diff --git a/cards/e19.gif b/cards/e19.gif deleted file mode 100644 index 2e59b3f..0000000 Binary files a/cards/e19.gif and /dev/null differ diff --git a/cards/e2.gif b/cards/e2.gif deleted file mode 100644 index b6f3f2e..0000000 Binary files a/cards/e2.gif and /dev/null differ diff --git a/cards/e20.gif b/cards/e20.gif deleted file mode 100644 index c21ee70..0000000 Binary files a/cards/e20.gif and /dev/null differ diff --git a/cards/e21.gif b/cards/e21.gif deleted file mode 100644 index c1cdeb7..0000000 Binary files a/cards/e21.gif and /dev/null differ diff --git a/cards/e22.gif b/cards/e22.gif deleted file mode 100644 index e70575b..0000000 Binary files a/cards/e22.gif and /dev/null differ diff --git a/cards/e23.gif b/cards/e23.gif deleted file mode 100644 index c3f8974..0000000 Binary files a/cards/e23.gif and /dev/null differ diff --git a/cards/e24.gif b/cards/e24.gif deleted file mode 100644 index 66f2dbb..0000000 Binary files a/cards/e24.gif and /dev/null differ diff --git a/cards/e25.gif b/cards/e25.gif deleted file mode 100644 index 838fbdd..0000000 Binary files a/cards/e25.gif and /dev/null differ diff --git a/cards/e26.gif b/cards/e26.gif deleted file mode 100644 index c7573f4..0000000 Binary files a/cards/e26.gif and /dev/null differ diff --git a/cards/e27.gif b/cards/e27.gif deleted file mode 100644 index 850da0b..0000000 Binary files a/cards/e27.gif and /dev/null differ diff --git a/cards/e28.gif b/cards/e28.gif deleted file mode 100644 index 6149bab..0000000 Binary files a/cards/e28.gif and /dev/null differ diff --git a/cards/e29.gif b/cards/e29.gif deleted file mode 100644 index d34cdee..0000000 Binary files a/cards/e29.gif and /dev/null differ diff --git a/cards/e3.gif b/cards/e3.gif deleted file mode 100644 index a0f690c..0000000 Binary files a/cards/e3.gif and /dev/null differ diff --git a/cards/e30.gif b/cards/e30.gif deleted file mode 100644 index 8f9d92f..0000000 Binary files a/cards/e30.gif and /dev/null differ diff --git a/cards/e31.gif b/cards/e31.gif deleted file mode 100644 index fe6ff2b..0000000 Binary files a/cards/e31.gif and /dev/null differ diff --git a/cards/e32.gif b/cards/e32.gif deleted file mode 100644 index a0f4e23..0000000 Binary files a/cards/e32.gif and /dev/null differ diff --git a/cards/e33.gif b/cards/e33.gif deleted file mode 100644 index abaa4f2..0000000 Binary files a/cards/e33.gif and /dev/null differ diff --git a/cards/e34.gif b/cards/e34.gif deleted file mode 100644 index ec33286..0000000 Binary files a/cards/e34.gif and /dev/null differ diff --git a/cards/e35.gif b/cards/e35.gif deleted file mode 100644 index 6e5755d..0000000 Binary files a/cards/e35.gif and /dev/null differ diff --git a/cards/e36.gif b/cards/e36.gif deleted file mode 100644 index 7d05d4e..0000000 Binary files a/cards/e36.gif and /dev/null differ diff --git a/cards/e37.gif b/cards/e37.gif deleted file mode 100644 index e84bd17..0000000 Binary files a/cards/e37.gif and /dev/null differ diff --git a/cards/e38.gif b/cards/e38.gif deleted file mode 100644 index 4cb8e4a..0000000 Binary files a/cards/e38.gif and /dev/null differ diff --git a/cards/e39.gif b/cards/e39.gif deleted file mode 100644 index 621ea21..0000000 Binary files a/cards/e39.gif and /dev/null differ diff --git a/cards/e4.gif b/cards/e4.gif deleted file mode 100644 index b225bc1..0000000 Binary files a/cards/e4.gif and /dev/null differ diff --git a/cards/e40.gif b/cards/e40.gif deleted file mode 100644 index d0f7470..0000000 Binary files a/cards/e40.gif and /dev/null differ diff --git a/cards/e41.gif b/cards/e41.gif deleted file mode 100644 index 824fc1f..0000000 Binary files a/cards/e41.gif and /dev/null differ diff --git a/cards/e42.gif b/cards/e42.gif deleted file mode 100644 index 23069f5..0000000 Binary files a/cards/e42.gif and /dev/null differ diff --git a/cards/e43.gif b/cards/e43.gif deleted file mode 100644 index e883ef7..0000000 Binary files a/cards/e43.gif and /dev/null differ diff --git a/cards/e44.gif b/cards/e44.gif deleted file mode 100644 index 15bdf38..0000000 Binary files a/cards/e44.gif and /dev/null differ diff --git a/cards/e45.gif b/cards/e45.gif deleted file mode 100644 index fa6c0ca..0000000 Binary files a/cards/e45.gif and /dev/null differ diff --git a/cards/e46.gif b/cards/e46.gif deleted file mode 100644 index ec7310c..0000000 Binary files a/cards/e46.gif and /dev/null differ diff --git a/cards/e47.gif b/cards/e47.gif deleted file mode 100644 index fcbd622..0000000 Binary files a/cards/e47.gif and /dev/null differ diff --git a/cards/e48.gif b/cards/e48.gif deleted file mode 100644 index b40d716..0000000 Binary files a/cards/e48.gif and /dev/null differ diff --git a/cards/e49.gif b/cards/e49.gif deleted file mode 100644 index ac3c7b2..0000000 Binary files a/cards/e49.gif and /dev/null differ diff --git a/cards/e5.gif b/cards/e5.gif deleted file mode 100644 index bb75531..0000000 Binary files a/cards/e5.gif and /dev/null differ diff --git a/cards/e50.gif b/cards/e50.gif deleted file mode 100644 index a91cdb5..0000000 Binary files a/cards/e50.gif and /dev/null differ diff --git a/cards/e51.gif b/cards/e51.gif deleted file mode 100644 index 55b1bbd..0000000 Binary files a/cards/e51.gif and /dev/null differ diff --git a/cards/e52.gif b/cards/e52.gif deleted file mode 100644 index cc6241a..0000000 Binary files a/cards/e52.gif and /dev/null differ diff --git a/cards/e53.gif b/cards/e53.gif deleted file mode 100644 index 0e7638b..0000000 Binary files a/cards/e53.gif and /dev/null differ diff --git a/cards/e54.gif b/cards/e54.gif deleted file mode 100644 index 734ae1c..0000000 Binary files a/cards/e54.gif and /dev/null differ diff --git a/cards/e55.gif b/cards/e55.gif deleted file mode 100644 index e202be6..0000000 Binary files a/cards/e55.gif and /dev/null differ diff --git a/cards/e56.gif b/cards/e56.gif deleted file mode 100644 index 994c526..0000000 Binary files a/cards/e56.gif and /dev/null differ diff --git a/cards/e57.gif b/cards/e57.gif deleted file mode 100644 index 1202089..0000000 Binary files a/cards/e57.gif and /dev/null differ diff --git a/cards/e58.gif b/cards/e58.gif deleted file mode 100644 index b4cb03c..0000000 Binary files a/cards/e58.gif and /dev/null differ diff --git a/cards/e59.gif b/cards/e59.gif deleted file mode 100644 index eb5075d..0000000 Binary files a/cards/e59.gif and /dev/null differ diff --git a/cards/e6.gif b/cards/e6.gif deleted file mode 100644 index 56293e7..0000000 Binary files a/cards/e6.gif and /dev/null differ diff --git a/cards/e60.gif b/cards/e60.gif deleted file mode 100644 index 42904d1..0000000 Binary files a/cards/e60.gif and /dev/null differ diff --git a/cards/e61.gif b/cards/e61.gif deleted file mode 100644 index 9a04b79..0000000 Binary files a/cards/e61.gif and /dev/null differ diff --git a/cards/e62.gif b/cards/e62.gif deleted file mode 100644 index 14e4bac..0000000 Binary files a/cards/e62.gif and /dev/null differ diff --git a/cards/e63.gif b/cards/e63.gif deleted file mode 100644 index 91cb22f..0000000 Binary files a/cards/e63.gif and /dev/null differ diff --git a/cards/e64.gif b/cards/e64.gif deleted file mode 100644 index 1863085..0000000 Binary files a/cards/e64.gif and /dev/null differ diff --git a/cards/e65.gif b/cards/e65.gif deleted file mode 100644 index 7d317c2..0000000 Binary files a/cards/e65.gif and /dev/null differ diff --git a/cards/e66.gif b/cards/e66.gif deleted file mode 100644 index e709983..0000000 Binary files a/cards/e66.gif and /dev/null differ diff --git a/cards/e67.gif b/cards/e67.gif deleted file mode 100644 index 7d4b2de..0000000 Binary files a/cards/e67.gif and /dev/null differ diff --git a/cards/e68.gif b/cards/e68.gif deleted file mode 100644 index 500ac35..0000000 Binary files a/cards/e68.gif and /dev/null differ diff --git a/cards/e69.gif b/cards/e69.gif deleted file mode 100644 index 1247611..0000000 Binary files a/cards/e69.gif and /dev/null differ diff --git a/cards/e7.gif b/cards/e7.gif deleted file mode 100644 index f4022fd..0000000 Binary files a/cards/e7.gif and /dev/null differ diff --git a/cards/e70.gif b/cards/e70.gif deleted file mode 100644 index f7769d4..0000000 Binary files a/cards/e70.gif and /dev/null differ diff --git a/cards/e71.gif b/cards/e71.gif deleted file mode 100644 index d5ea620..0000000 Binary files a/cards/e71.gif and /dev/null differ diff --git a/cards/e72.gif b/cards/e72.gif deleted file mode 100644 index 9ca0a98..0000000 Binary files a/cards/e72.gif and /dev/null differ diff --git a/cards/e73.gif b/cards/e73.gif deleted file mode 100644 index aaff909..0000000 Binary files a/cards/e73.gif and /dev/null differ diff --git a/cards/e74.gif b/cards/e74.gif deleted file mode 100644 index 608dfec..0000000 Binary files a/cards/e74.gif and /dev/null differ diff --git a/cards/e75.gif b/cards/e75.gif deleted file mode 100644 index d644c5d..0000000 Binary files a/cards/e75.gif and /dev/null differ diff --git a/cards/e76.gif b/cards/e76.gif deleted file mode 100644 index e679a0a..0000000 Binary files a/cards/e76.gif and /dev/null differ diff --git a/cards/e77.gif b/cards/e77.gif deleted file mode 100644 index 4845969..0000000 Binary files a/cards/e77.gif and /dev/null differ diff --git a/cards/e78.gif b/cards/e78.gif deleted file mode 100644 index b435bd5..0000000 Binary files a/cards/e78.gif and /dev/null differ diff --git a/cards/e79.gif b/cards/e79.gif deleted file mode 100644 index 3821d00..0000000 Binary files a/cards/e79.gif and /dev/null differ diff --git a/cards/e8.gif b/cards/e8.gif deleted file mode 100644 index 3a36343..0000000 Binary files a/cards/e8.gif and /dev/null differ diff --git a/cards/e80.gif b/cards/e80.gif deleted file mode 100644 index 19885ac..0000000 Binary files a/cards/e80.gif and /dev/null differ diff --git a/cards/e81.gif b/cards/e81.gif deleted file mode 100644 index 636e13a..0000000 Binary files a/cards/e81.gif and /dev/null differ diff --git a/cards/e82.gif b/cards/e82.gif deleted file mode 100644 index 7dc2ed4..0000000 Binary files a/cards/e82.gif and /dev/null differ diff --git a/cards/e83.gif b/cards/e83.gif deleted file mode 100644 index 27e718d..0000000 Binary files a/cards/e83.gif and /dev/null differ diff --git a/cards/e84.gif b/cards/e84.gif deleted file mode 100644 index 7847ecf..0000000 Binary files a/cards/e84.gif and /dev/null differ diff --git a/cards/e85.gif b/cards/e85.gif deleted file mode 100644 index f6b656e..0000000 Binary files a/cards/e85.gif and /dev/null differ diff --git a/cards/e86.gif b/cards/e86.gif deleted file mode 100644 index 46af753..0000000 Binary files a/cards/e86.gif and /dev/null differ diff --git a/cards/e87.gif b/cards/e87.gif deleted file mode 100644 index 63bbd5e..0000000 Binary files a/cards/e87.gif and /dev/null differ diff --git a/cards/e88.gif b/cards/e88.gif deleted file mode 100644 index f1eedf3..0000000 Binary files a/cards/e88.gif and /dev/null differ diff --git a/cards/e89.gif b/cards/e89.gif deleted file mode 100644 index edd968a..0000000 Binary files a/cards/e89.gif and /dev/null differ diff --git a/cards/e9.gif b/cards/e9.gif deleted file mode 100644 index 1e094fb..0000000 Binary files a/cards/e9.gif and /dev/null differ diff --git a/cards/e90.gif b/cards/e90.gif deleted file mode 100644 index 954e485..0000000 Binary files a/cards/e90.gif and /dev/null differ diff --git a/cards/e91.gif b/cards/e91.gif deleted file mode 100644 index baf649a..0000000 Binary files a/cards/e91.gif and /dev/null differ diff --git a/cards/e92.gif b/cards/e92.gif deleted file mode 100644 index 15e4d1b..0000000 Binary files a/cards/e92.gif and /dev/null differ diff --git a/cards/e93.gif b/cards/e93.gif deleted file mode 100644 index bdcdf5f..0000000 Binary files a/cards/e93.gif and /dev/null differ diff --git a/cards/e94.gif b/cards/e94.gif deleted file mode 100644 index 797ff40..0000000 Binary files a/cards/e94.gif and /dev/null differ diff --git a/cards/e95.gif b/cards/e95.gif deleted file mode 100644 index 3455ade..0000000 Binary files a/cards/e95.gif and /dev/null differ diff --git a/cards/e96.gif b/cards/e96.gif deleted file mode 100644 index 2326e6d..0000000 Binary files a/cards/e96.gif and /dev/null differ diff --git a/cards/e97.gif b/cards/e97.gif deleted file mode 100644 index 7a2753c..0000000 Binary files a/cards/e97.gif and /dev/null differ diff --git a/cards/e98.gif b/cards/e98.gif deleted file mode 100644 index 2cc5f89..0000000 Binary files a/cards/e98.gif and /dev/null differ diff --git a/cards/e99.gif b/cards/e99.gif deleted file mode 100644 index c2def43..0000000 Binary files a/cards/e99.gif and /dev/null differ diff --git a/cards_2/ps1.gif b/cards_2/ps1.gif deleted file mode 100644 index 93bdf19..0000000 Binary files a/cards_2/ps1.gif and /dev/null differ diff --git a/cards_2/ps10.gif b/cards_2/ps10.gif deleted file mode 100644 index b78ec1f..0000000 Binary files a/cards_2/ps10.gif and /dev/null differ diff --git a/cards_2/ps11.gif b/cards_2/ps11.gif deleted file mode 100644 index 298c9e6..0000000 Binary files a/cards_2/ps11.gif and /dev/null differ diff --git a/cards_2/ps12.gif b/cards_2/ps12.gif deleted file mode 100644 index ebc293c..0000000 Binary files a/cards_2/ps12.gif and /dev/null differ diff --git a/cards_2/ps13.gif b/cards_2/ps13.gif deleted file mode 100644 index 5df58c4..0000000 Binary files a/cards_2/ps13.gif and /dev/null differ diff --git a/cards_2/ps14.gif b/cards_2/ps14.gif deleted file mode 100644 index 1ab602b..0000000 Binary files a/cards_2/ps14.gif and /dev/null differ diff --git a/cards_2/ps15.gif b/cards_2/ps15.gif deleted file mode 100644 index 77d01eb..0000000 Binary files a/cards_2/ps15.gif and /dev/null differ diff --git a/cards_2/ps16.gif b/cards_2/ps16.gif deleted file mode 100644 index 3821417..0000000 Binary files a/cards_2/ps16.gif and /dev/null differ diff --git a/cards_2/ps17.gif b/cards_2/ps17.gif deleted file mode 100644 index caaa761..0000000 Binary files a/cards_2/ps17.gif and /dev/null differ diff --git a/cards_2/ps18.gif b/cards_2/ps18.gif deleted file mode 100644 index 04c1cd5..0000000 Binary files a/cards_2/ps18.gif and /dev/null differ diff --git a/cards_2/ps19.gif b/cards_2/ps19.gif deleted file mode 100644 index f88c379..0000000 Binary files a/cards_2/ps19.gif and /dev/null differ diff --git a/cards_2/ps2.gif b/cards_2/ps2.gif deleted file mode 100644 index a900be2..0000000 Binary files a/cards_2/ps2.gif and /dev/null differ diff --git a/cards_2/ps20.gif b/cards_2/ps20.gif deleted file mode 100644 index 1387a8d..0000000 Binary files a/cards_2/ps20.gif and /dev/null differ diff --git a/cards_2/ps21.gif b/cards_2/ps21.gif deleted file mode 100644 index 31cd0b2..0000000 Binary files a/cards_2/ps21.gif and /dev/null differ diff --git a/cards_2/ps22.gif b/cards_2/ps22.gif deleted file mode 100644 index 42a7cec..0000000 Binary files a/cards_2/ps22.gif and /dev/null differ diff --git a/cards_2/ps23.gif b/cards_2/ps23.gif deleted file mode 100644 index 50ee901..0000000 Binary files a/cards_2/ps23.gif and /dev/null differ diff --git a/cards_2/ps24.gif b/cards_2/ps24.gif deleted file mode 100644 index 3107cc1..0000000 Binary files a/cards_2/ps24.gif and /dev/null differ diff --git a/cards_2/ps25.gif b/cards_2/ps25.gif deleted file mode 100644 index ba321f4..0000000 Binary files a/cards_2/ps25.gif and /dev/null differ diff --git a/cards_2/ps26.gif b/cards_2/ps26.gif deleted file mode 100644 index c6befdf..0000000 Binary files a/cards_2/ps26.gif and /dev/null differ diff --git a/cards_2/ps27.gif b/cards_2/ps27.gif deleted file mode 100644 index 34a4cea..0000000 Binary files a/cards_2/ps27.gif and /dev/null differ diff --git a/cards_2/ps3.gif b/cards_2/ps3.gif deleted file mode 100644 index 0f546d2..0000000 Binary files a/cards_2/ps3.gif and /dev/null differ diff --git a/cards_2/ps4.gif b/cards_2/ps4.gif deleted file mode 100644 index eebdb7f..0000000 Binary files a/cards_2/ps4.gif and /dev/null differ diff --git a/cards_2/ps5.gif b/cards_2/ps5.gif deleted file mode 100644 index b2da6bd..0000000 Binary files a/cards_2/ps5.gif and /dev/null differ diff --git a/cards_2/ps6.gif b/cards_2/ps6.gif deleted file mode 100644 index cd2b261..0000000 Binary files a/cards_2/ps6.gif and /dev/null differ diff --git a/cards_2/ps7.gif b/cards_2/ps7.gif deleted file mode 100644 index 5516bb3..0000000 Binary files a/cards_2/ps7.gif and /dev/null differ diff --git a/cards_2/ps8.gif b/cards_2/ps8.gif deleted file mode 100644 index 136e81a..0000000 Binary files a/cards_2/ps8.gif and /dev/null differ diff --git a/cards_2/ps9.gif b/cards_2/ps9.gif deleted file mode 100644 index df79c56..0000000 Binary files a/cards_2/ps9.gif and /dev/null differ diff --git a/images/Event_Marker_Austria_Hungar.gif b/images/Event_Marker_Austria_Hungar.gif deleted file mode 100644 index 5e2053f..0000000 Binary files a/images/Event_Marker_Austria_Hungar.gif and /dev/null differ diff --git a/images/Event_Marker_Eco_Glasnost.gif b/images/Event_Marker_Eco_Glasnost.gif deleted file mode 100644 index c50ac5b..0000000 Binary files a/images/Event_Marker_Eco_Glasnost.gif and /dev/null differ diff --git a/images/Event_Marker_Elena.gif b/images/Event_Marker_Elena.gif deleted file mode 100644 index 9e5ff46..0000000 Binary files a/images/Event_Marker_Elena.gif and /dev/null differ diff --git a/images/Event_Marker_Foreign_Curren.gif b/images/Event_Marker_Foreign_Curren.gif deleted file mode 100644 index 822b098..0000000 Binary files a/images/Event_Marker_Foreign_Curren.gif and /dev/null differ diff --git a/images/Event_Marker_Grenz_Truppen.gif b/images/Event_Marker_Grenz_Truppen.gif deleted file mode 100644 index 1e2832f..0000000 Binary files a/images/Event_Marker_Grenz_Truppen.gif and /dev/null differ diff --git a/images/Event_Marker_Helsinki.gif b/images/Event_Marker_Helsinki.gif deleted file mode 100644 index 7567dc7..0000000 Binary files a/images/Event_Marker_Helsinki.gif and /dev/null differ diff --git a/images/Event_Marker_Honecker.gif b/images/Event_Marker_Honecker.gif deleted file mode 100644 index 52a6ad1..0000000 Binary files a/images/Event_Marker_Honecker.gif and /dev/null differ diff --git a/images/Event_Marker_Laszlo.gif b/images/Event_Marker_Laszlo.gif deleted file mode 100644 index ba09ff2..0000000 Binary files a/images/Event_Marker_Laszlo.gif and /dev/null differ diff --git a/images/Event_Marker_Li_Peng_.gif b/images/Event_Marker_Li_Peng_.gif deleted file mode 100644 index 9477bac..0000000 Binary files a/images/Event_Marker_Li_Peng_.gif and /dev/null differ diff --git a/images/Event_Marker_NYE_Party.gif b/images/Event_Marker_NYE_Party.gif deleted file mode 100644 index b2a91d2..0000000 Binary files a/images/Event_Marker_NYE_Party.gif and /dev/null differ diff --git a/images/Event_Marker_Pres_Visit.gif b/images/Event_Marker_Pres_Visit.gif deleted file mode 100644 index 006e93d..0000000 Binary files a/images/Event_Marker_Pres_Visit.gif and /dev/null differ diff --git a/images/Event_Marker_Securitate.gif b/images/Event_Marker_Securitate.gif deleted file mode 100644 index 9289a99..0000000 Binary files a/images/Event_Marker_Securitate.gif and /dev/null differ diff --git a/images/Event_Marker_Solidarity_Leg.gif b/images/Event_Marker_Solidarity_Leg.gif deleted file mode 100644 index 044f4db..0000000 Binary files a/images/Event_Marker_Solidarity_Leg.gif and /dev/null differ diff --git a/images/Event_Marker_St_Nicholas.gif b/images/Event_Marker_St_Nicholas.gif deleted file mode 100644 index cb09917..0000000 Binary files a/images/Event_Marker_St_Nicholas.gif and /dev/null differ diff --git a/images/Event_Marker_Stand_Fast.gif b/images/Event_Marker_Stand_Fast.gif deleted file mode 100644 index 2d12898..0000000 Binary files a/images/Event_Marker_Stand_Fast.gif and /dev/null differ diff --git a/images/Event_Marker_Systematizatio.gif b/images/Event_Marker_Systematizatio.gif deleted file mode 100644 index 9f53576..0000000 Binary files a/images/Event_Marker_Systematizatio.gif and /dev/null differ diff --git a/images/Event_Marker_The_Tyrant_Is_.gif b/images/Event_Marker_The_Tyrant_Is_.gif deleted file mode 100644 index 05aca22..0000000 Binary files a/images/Event_Marker_The_Tyrant_Is_.gif and /dev/null differ diff --git a/images/Event_Marker_The_Wall.gif b/images/Event_Marker_The_Wall.gif deleted file mode 100644 index a929132..0000000 Binary files a/images/Event_Marker_The_Wall.gif and /dev/null differ diff --git a/images/Event_Marker_USSR_Stability.gif b/images/Event_Marker_USSR_Stability.gif deleted file mode 100644 index daacbbb..0000000 Binary files a/images/Event_Marker_USSR_Stability.gif and /dev/null differ diff --git a/images/Event_Marker_We_are_the_Peo.gif b/images/Event_Marker_We_are_the_Peo.gif deleted file mode 100644 index e10d8e6..0000000 Binary files a/images/Event_Marker_We_are_the_Peo.gif and /dev/null differ diff --git a/images/SV_2.gif b/images/SV_2.gif deleted file mode 100644 index 76f1f46..0000000 Binary files a/images/SV_2.gif and /dev/null differ diff --git a/images/SV_3.gif b/images/SV_3.gif deleted file mode 100644 index 75404f0..0000000 Binary files a/images/SV_3.gif and /dev/null differ diff --git a/images/SV_4.gif b/images/SV_4.gif deleted file mode 100644 index 29158b4..0000000 Binary files a/images/SV_4.gif and /dev/null differ diff --git a/images/SV_5.gif b/images/SV_5.gif deleted file mode 100644 index 2fdea81..0000000 Binary files a/images/SV_5.gif and /dev/null differ diff --git a/images/SV_6.gif b/images/SV_6.gif deleted file mode 100644 index 9f614e7..0000000 Binary files a/images/SV_6.gif and /dev/null differ diff --git a/images/SV_7.gif b/images/SV_7.gif deleted file mode 100644 index 43c6a14..0000000 Binary files a/images/SV_7.gif and /dev/null differ diff --git a/images/SV_8.gif b/images/SV_8.gif deleted file mode 100644 index a2e7dad..0000000 Binary files a/images/SV_8.gif and /dev/null differ diff --git a/images/SV_Action_Round.gif b/images/SV_Action_Round.gif deleted file mode 100644 index 7d2c9ef..0000000 Binary files a/images/SV_Action_Round.gif and /dev/null differ diff --git a/images/SV_Stability.gif b/images/SV_Stability.gif deleted file mode 100644 index dbc33aa..0000000 Binary files a/images/SV_Stability.gif and /dev/null differ diff --git a/images/SV_Tiananmen_Square.gif b/images/SV_Tiananmen_Square.gif deleted file mode 100644 index 41740bc..0000000 Binary files a/images/SV_Tiananmen_Square.gif and /dev/null differ diff --git a/images/SV_blank.gif b/images/SV_blank.gif deleted file mode 100644 index 5b9190b..0000000 Binary files a/images/SV_blank.gif and /dev/null differ diff --git a/images/SVd_blank.gif b/images/SVd_blank.gif deleted file mode 100644 index e202de3..0000000 Binary files a/images/SVd_blank.gif and /dev/null differ diff --git a/images/Turn.gif b/images/Turn.gif deleted file mode 100644 index 94dba0b..0000000 Binary files a/images/Turn.gif and /dev/null differ diff --git a/images/US_1.gif b/images/US_1.gif deleted file mode 100644 index 0f4d999..0000000 Binary files a/images/US_1.gif and /dev/null differ diff --git a/images/US_2.gif b/images/US_2.gif deleted file mode 100644 index e30ce29..0000000 Binary files a/images/US_2.gif and /dev/null differ diff --git a/images/US_3.gif b/images/US_3.gif deleted file mode 100644 index 3f6596d..0000000 Binary files a/images/US_3.gif and /dev/null differ diff --git a/images/US_4.gif b/images/US_4.gif deleted file mode 100644 index 4e1d1b1..0000000 Binary files a/images/US_4.gif and /dev/null differ diff --git a/images/US_5.gif b/images/US_5.gif deleted file mode 100644 index 4b32ff1..0000000 Binary files a/images/US_5.gif and /dev/null differ diff --git a/images/US_6.gif b/images/US_6.gif deleted file mode 100644 index da52ac1..0000000 Binary files a/images/US_6.gif and /dev/null differ diff --git a/images/US_7.gif b/images/US_7.gif deleted file mode 100644 index bbf8135..0000000 Binary files a/images/US_7.gif and /dev/null differ diff --git a/images/US_8.gif b/images/US_8.gif deleted file mode 100644 index 18b5f4d..0000000 Binary files a/images/US_8.gif and /dev/null differ diff --git a/images/US_Action_Round.gif b/images/US_Action_Round.gif deleted file mode 100644 index 00e4916..0000000 Binary files a/images/US_Action_Round.gif and /dev/null differ diff --git a/images/US_Tiananmen_Square.gif b/images/US_Tiananmen_Square.gif deleted file mode 100644 index 0fadb29..0000000 Binary files a/images/US_Tiananmen_Square.gif and /dev/null differ diff --git a/images/US_blank.gif b/images/US_blank.gif deleted file mode 100644 index 1f2f331..0000000 Binary files a/images/US_blank.gif and /dev/null differ diff --git a/images/USd_blank.gif b/images/USd_blank.gif deleted file mode 100644 index b999b18..0000000 Binary files a/images/USd_blank.gif and /dev/null differ diff --git a/images/VP.gif b/images/VP.gif deleted file mode 100644 index bd69b44..0000000 Binary files a/images/VP.gif and /dev/null differ diff --git a/images/bin.png b/images/bin.png deleted file mode 100644 index 37ea1a7..0000000 Binary files a/images/bin.png and /dev/null differ diff --git a/images/cog.svg b/images/cog.svg deleted file mode 100644 index 6e44bd2..0000000 --- a/images/cog.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/images/earth-africa-europe.svg b/images/earth-africa-europe.svg deleted file mode 100644 index 39a4868..0000000 --- a/images/earth-africa-europe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/images/remove.png b/images/remove.png deleted file mode 100644 index 1c5b028..0000000 Binary files a/images/remove.png and /dev/null differ -- cgit v1.2.3 From dd98f0802d5f7b7847a72e6b5226cf6ed2b37b2c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 23:54:42 +0200 Subject: OFFICIAL ASSETS - LOSSLESS --- cards100/event_1.png | Bin 0 -> 76401 bytes cards100/event_10.png | Bin 0 -> 84507 bytes cards100/event_100.png | Bin 0 -> 87579 bytes cards100/event_101.png | Bin 0 -> 89250 bytes cards100/event_102.png | Bin 0 -> 103307 bytes cards100/event_103.png | Bin 0 -> 81800 bytes cards100/event_104.png | Bin 0 -> 115195 bytes cards100/event_105.png | Bin 0 -> 63571 bytes cards100/event_106.png | Bin 0 -> 80075 bytes cards100/event_107.png | Bin 0 -> 109916 bytes cards100/event_108.png | Bin 0 -> 81594 bytes cards100/event_109.png | Bin 0 -> 104329 bytes cards100/event_11.png | Bin 0 -> 51855 bytes cards100/event_110.png | Bin 0 -> 83833 bytes cards100/event_12.png | Bin 0 -> 75057 bytes cards100/event_13.png | Bin 0 -> 58296 bytes cards100/event_14.png | Bin 0 -> 88067 bytes cards100/event_15.png | Bin 0 -> 95155 bytes cards100/event_16.png | Bin 0 -> 99024 bytes cards100/event_17.png | Bin 0 -> 111182 bytes cards100/event_18.png | Bin 0 -> 95838 bytes cards100/event_19.png | Bin 0 -> 103977 bytes cards100/event_2.png | Bin 0 -> 98118 bytes cards100/event_20.png | Bin 0 -> 92247 bytes cards100/event_21.png | Bin 0 -> 88492 bytes cards100/event_22.png | Bin 0 -> 102631 bytes cards100/event_23.png | Bin 0 -> 74397 bytes cards100/event_24.png | Bin 0 -> 89102 bytes cards100/event_25.png | Bin 0 -> 70921 bytes cards100/event_26.png | Bin 0 -> 93178 bytes cards100/event_27.png | Bin 0 -> 74142 bytes cards100/event_28.png | Bin 0 -> 79904 bytes cards100/event_29.png | Bin 0 -> 72595 bytes cards100/event_3.png | Bin 0 -> 90933 bytes cards100/event_30.png | Bin 0 -> 73619 bytes cards100/event_31.png | Bin 0 -> 65977 bytes cards100/event_32.png | Bin 0 -> 84004 bytes cards100/event_33.png | Bin 0 -> 76113 bytes cards100/event_34.png | Bin 0 -> 47195 bytes cards100/event_35.png | Bin 0 -> 88855 bytes cards100/event_36.png | Bin 0 -> 105231 bytes cards100/event_37.png | Bin 0 -> 97392 bytes cards100/event_38.png | Bin 0 -> 80584 bytes cards100/event_39.png | Bin 0 -> 31952 bytes cards100/event_4.png | Bin 0 -> 71036 bytes cards100/event_40.png | Bin 0 -> 63233 bytes cards100/event_41.png | Bin 0 -> 91123 bytes cards100/event_42.png | Bin 0 -> 108804 bytes cards100/event_43.png | Bin 0 -> 84960 bytes cards100/event_44.png | Bin 0 -> 102297 bytes cards100/event_45.png | Bin 0 -> 87588 bytes cards100/event_46.png | Bin 0 -> 104877 bytes cards100/event_47.png | Bin 0 -> 82412 bytes cards100/event_48.png | Bin 0 -> 94728 bytes cards100/event_49.png | Bin 0 -> 53345 bytes cards100/event_5.png | Bin 0 -> 116938 bytes cards100/event_50.png | Bin 0 -> 71066 bytes cards100/event_51.png | Bin 0 -> 82170 bytes cards100/event_52.png | Bin 0 -> 74361 bytes cards100/event_53.png | Bin 0 -> 86466 bytes cards100/event_54.png | Bin 0 -> 105101 bytes cards100/event_55.png | Bin 0 -> 104688 bytes cards100/event_56.png | Bin 0 -> 89644 bytes cards100/event_57.png | Bin 0 -> 77970 bytes cards100/event_58.png | Bin 0 -> 93376 bytes cards100/event_59.png | Bin 0 -> 90265 bytes cards100/event_6.png | Bin 0 -> 77143 bytes cards100/event_60.png | Bin 0 -> 57507 bytes cards100/event_61.png | Bin 0 -> 117926 bytes cards100/event_62.png | Bin 0 -> 98866 bytes cards100/event_63.png | Bin 0 -> 73919 bytes cards100/event_64.png | Bin 0 -> 78731 bytes cards100/event_65.png | Bin 0 -> 86900 bytes cards100/event_66.png | Bin 0 -> 67266 bytes cards100/event_67.png | Bin 0 -> 89836 bytes cards100/event_68.png | Bin 0 -> 83500 bytes cards100/event_69.png | Bin 0 -> 103468 bytes cards100/event_7.png | Bin 0 -> 68977 bytes cards100/event_70.png | Bin 0 -> 83151 bytes cards100/event_71.png | Bin 0 -> 83284 bytes cards100/event_72.png | Bin 0 -> 92391 bytes cards100/event_73.png | Bin 0 -> 90703 bytes cards100/event_74.png | Bin 0 -> 83326 bytes cards100/event_75.png | Bin 0 -> 88252 bytes cards100/event_76.png | Bin 0 -> 83370 bytes cards100/event_77.png | Bin 0 -> 87527 bytes cards100/event_78.png | Bin 0 -> 95589 bytes cards100/event_79.png | Bin 0 -> 89148 bytes cards100/event_8.png | Bin 0 -> 73132 bytes cards100/event_80.png | Bin 0 -> 89508 bytes cards100/event_81.png | Bin 0 -> 89669 bytes cards100/event_82.png | Bin 0 -> 58857 bytes cards100/event_83.png | Bin 0 -> 84638 bytes cards100/event_84.png | Bin 0 -> 117291 bytes cards100/event_85.png | Bin 0 -> 83036 bytes cards100/event_86.png | Bin 0 -> 106118 bytes cards100/event_87.png | Bin 0 -> 102148 bytes cards100/event_88.png | Bin 0 -> 79870 bytes cards100/event_89.png | Bin 0 -> 102536 bytes cards100/event_9.png | Bin 0 -> 102645 bytes cards100/event_90.png | Bin 0 -> 99797 bytes cards100/event_91.png | Bin 0 -> 68793 bytes cards100/event_92.png | Bin 0 -> 79928 bytes cards100/event_93.png | Bin 0 -> 79845 bytes cards100/event_94.png | Bin 0 -> 107624 bytes cards100/event_95.png | Bin 0 -> 77323 bytes cards100/event_96.png | Bin 0 -> 104995 bytes cards100/event_97.png | Bin 0 -> 83817 bytes cards100/event_98.png | Bin 0 -> 75200 bytes cards100/event_99.png | Bin 0 -> 74677 bytes cards100/event_back.png | Bin 0 -> 93488 bytes cards100/power_1.png | Bin 0 -> 42902 bytes cards100/power_10.png | Bin 0 -> 37010 bytes cards100/power_11.png | Bin 0 -> 36610 bytes cards100/power_12.png | Bin 0 -> 36673 bytes cards100/power_13.png | Bin 0 -> 36661 bytes cards100/power_14.png | Bin 0 -> 37178 bytes cards100/power_15.png | Bin 0 -> 37201 bytes cards100/power_16.png | Bin 0 -> 37203 bytes cards100/power_17.png | Bin 0 -> 37182 bytes cards100/power_18.png | Bin 0 -> 36688 bytes cards100/power_19.png | Bin 0 -> 54167 bytes cards100/power_2.png | Bin 0 -> 42961 bytes cards100/power_20.png | Bin 0 -> 54211 bytes cards100/power_21.png | Bin 0 -> 54037 bytes cards100/power_22.png | Bin 0 -> 54098 bytes cards100/power_23.png | Bin 0 -> 53892 bytes cards100/power_24.png | Bin 0 -> 53889 bytes cards100/power_25.png | Bin 0 -> 53895 bytes cards100/power_26.png | Bin 0 -> 53941 bytes cards100/power_27.png | Bin 0 -> 54288 bytes cards100/power_28.png | Bin 0 -> 54297 bytes cards100/power_29.png | Bin 0 -> 54301 bytes cards100/power_3.png | Bin 0 -> 42936 bytes cards100/power_30.png | Bin 0 -> 54292 bytes cards100/power_31.png | Bin 0 -> 33118 bytes cards100/power_32.png | Bin 0 -> 33169 bytes cards100/power_33.png | Bin 0 -> 33157 bytes cards100/power_34.png | Bin 0 -> 32980 bytes cards100/power_35.png | Bin 0 -> 32977 bytes cards100/power_36.png | Bin 0 -> 32987 bytes cards100/power_37.png | Bin 0 -> 36820 bytes cards100/power_38.png | Bin 0 -> 34916 bytes cards100/power_39.png | Bin 0 -> 37792 bytes cards100/power_4.png | Bin 0 -> 42952 bytes cards100/power_40.png | Bin 0 -> 31504 bytes cards100/power_41.png | Bin 0 -> 32190 bytes cards100/power_42.png | Bin 0 -> 38115 bytes cards100/power_43.png | Bin 0 -> 27677 bytes cards100/power_44.png | Bin 0 -> 26394 bytes cards100/power_45.png | Bin 0 -> 29391 bytes cards100/power_46.png | Bin 0 -> 46648 bytes cards100/power_47.png | Bin 0 -> 38594 bytes cards100/power_48.png | Bin 0 -> 47714 bytes cards100/power_49.png | Bin 0 -> 26478 bytes cards100/power_5.png | Bin 0 -> 42956 bytes cards100/power_50.png | Bin 0 -> 34179 bytes cards100/power_51.png | Bin 0 -> 34691 bytes cards100/power_52.png | Bin 0 -> 38437 bytes cards100/power_6.png | Bin 0 -> 42962 bytes cards100/power_7.png | Bin 0 -> 37016 bytes cards100/power_8.png | Bin 0 -> 37035 bytes cards100/power_9.png | Bin 0 -> 36937 bytes cards100/power_back.png | Bin 0 -> 80928 bytes cards200/event_1.png | Bin 0 -> 259615 bytes cards200/event_10.png | Bin 0 -> 277835 bytes cards200/event_100.png | Bin 0 -> 327789 bytes cards200/event_101.png | Bin 0 -> 296226 bytes cards200/event_102.png | Bin 0 -> 341430 bytes cards200/event_103.png | Bin 0 -> 265631 bytes cards200/event_104.png | Bin 0 -> 404806 bytes cards200/event_105.png | Bin 0 -> 206282 bytes cards200/event_106.png | Bin 0 -> 282693 bytes cards200/event_107.png | Bin 0 -> 392446 bytes cards200/event_108.png | Bin 0 -> 277705 bytes cards200/event_109.png | Bin 0 -> 352205 bytes cards200/event_11.png | Bin 0 -> 190177 bytes cards200/event_110.png | Bin 0 -> 283675 bytes cards200/event_12.png | Bin 0 -> 271825 bytes cards200/event_13.png | Bin 0 -> 179873 bytes cards200/event_14.png | Bin 0 -> 302836 bytes cards200/event_15.png | Bin 0 -> 337976 bytes cards200/event_16.png | Bin 0 -> 362142 bytes cards200/event_17.png | Bin 0 -> 399237 bytes cards200/event_18.png | Bin 0 -> 354207 bytes cards200/event_19.png | Bin 0 -> 371538 bytes cards200/event_2.png | Bin 0 -> 345023 bytes cards200/event_20.png | Bin 0 -> 306673 bytes cards200/event_21.png | Bin 0 -> 297010 bytes cards200/event_22.png | Bin 0 -> 353902 bytes cards200/event_23.png | Bin 0 -> 230720 bytes cards200/event_24.png | Bin 0 -> 322090 bytes cards200/event_25.png | Bin 0 -> 243225 bytes cards200/event_26.png | Bin 0 -> 320783 bytes cards200/event_27.png | Bin 0 -> 227552 bytes cards200/event_28.png | Bin 0 -> 268870 bytes cards200/event_29.png | Bin 0 -> 291363 bytes cards200/event_3.png | Bin 0 -> 319603 bytes cards200/event_30.png | Bin 0 -> 279505 bytes cards200/event_31.png | Bin 0 -> 234244 bytes cards200/event_32.png | Bin 0 -> 295166 bytes cards200/event_33.png | Bin 0 -> 248488 bytes cards200/event_34.png | Bin 0 -> 156815 bytes cards200/event_35.png | Bin 0 -> 305325 bytes cards200/event_36.png | Bin 0 -> 351686 bytes cards200/event_37.png | Bin 0 -> 337289 bytes cards200/event_38.png | Bin 0 -> 267869 bytes cards200/event_39.png | Bin 0 -> 98163 bytes cards200/event_4.png | Bin 0 -> 268051 bytes cards200/event_40.png | Bin 0 -> 214220 bytes cards200/event_41.png | Bin 0 -> 288966 bytes cards200/event_42.png | Bin 0 -> 373767 bytes cards200/event_43.png | Bin 0 -> 267196 bytes cards200/event_44.png | Bin 0 -> 343099 bytes cards200/event_45.png | Bin 0 -> 298622 bytes cards200/event_46.png | Bin 0 -> 366622 bytes cards200/event_47.png | Bin 0 -> 283489 bytes cards200/event_48.png | Bin 0 -> 301210 bytes cards200/event_49.png | Bin 0 -> 184309 bytes cards200/event_5.png | Bin 0 -> 411265 bytes cards200/event_50.png | Bin 0 -> 224707 bytes cards200/event_51.png | Bin 0 -> 294064 bytes cards200/event_52.png | Bin 0 -> 246973 bytes cards200/event_53.png | Bin 0 -> 308357 bytes cards200/event_54.png | Bin 0 -> 367897 bytes cards200/event_55.png | Bin 0 -> 340090 bytes cards200/event_56.png | Bin 0 -> 308871 bytes cards200/event_57.png | Bin 0 -> 274039 bytes cards200/event_58.png | Bin 0 -> 334416 bytes cards200/event_59.png | Bin 0 -> 319998 bytes cards200/event_6.png | Bin 0 -> 290894 bytes cards200/event_60.png | Bin 0 -> 189771 bytes cards200/event_61.png | Bin 0 -> 411497 bytes cards200/event_62.png | Bin 0 -> 318732 bytes cards200/event_63.png | Bin 0 -> 238860 bytes cards200/event_64.png | Bin 0 -> 316967 bytes cards200/event_65.png | Bin 0 -> 299827 bytes cards200/event_66.png | Bin 0 -> 257061 bytes cards200/event_67.png | Bin 0 -> 300107 bytes cards200/event_68.png | Bin 0 -> 314811 bytes cards200/event_69.png | Bin 0 -> 342266 bytes cards200/event_7.png | Bin 0 -> 243802 bytes cards200/event_70.png | Bin 0 -> 278964 bytes cards200/event_71.png | Bin 0 -> 274514 bytes cards200/event_72.png | Bin 0 -> 343171 bytes cards200/event_73.png | Bin 0 -> 282944 bytes cards200/event_74.png | Bin 0 -> 278914 bytes cards200/event_75.png | Bin 0 -> 288703 bytes cards200/event_76.png | Bin 0 -> 290812 bytes cards200/event_77.png | Bin 0 -> 329122 bytes cards200/event_78.png | Bin 0 -> 301561 bytes cards200/event_79.png | Bin 0 -> 307939 bytes cards200/event_8.png | Bin 0 -> 267101 bytes cards200/event_80.png | Bin 0 -> 289690 bytes cards200/event_81.png | Bin 0 -> 302357 bytes cards200/event_82.png | Bin 0 -> 209097 bytes cards200/event_83.png | Bin 0 -> 277694 bytes cards200/event_84.png | Bin 0 -> 421097 bytes cards200/event_85.png | Bin 0 -> 308200 bytes cards200/event_86.png | Bin 0 -> 364045 bytes cards200/event_87.png | Bin 0 -> 342680 bytes cards200/event_88.png | Bin 0 -> 301693 bytes cards200/event_89.png | Bin 0 -> 365522 bytes cards200/event_9.png | Bin 0 -> 369097 bytes cards200/event_90.png | Bin 0 -> 332210 bytes cards200/event_91.png | Bin 0 -> 231620 bytes cards200/event_92.png | Bin 0 -> 284812 bytes cards200/event_93.png | Bin 0 -> 260380 bytes cards200/event_94.png | Bin 0 -> 388087 bytes cards200/event_95.png | Bin 0 -> 238004 bytes cards200/event_96.png | Bin 0 -> 372006 bytes cards200/event_97.png | Bin 0 -> 314185 bytes cards200/event_98.png | Bin 0 -> 285419 bytes cards200/event_99.png | Bin 0 -> 235551 bytes cards200/event_back.png | Bin 0 -> 372035 bytes cards200/power_1.png | Bin 0 -> 119267 bytes cards200/power_10.png | Bin 0 -> 96222 bytes cards200/power_11.png | Bin 0 -> 94980 bytes cards200/power_12.png | Bin 0 -> 95286 bytes cards200/power_13.png | Bin 0 -> 95316 bytes cards200/power_14.png | Bin 0 -> 97096 bytes cards200/power_15.png | Bin 0 -> 97175 bytes cards200/power_16.png | Bin 0 -> 97196 bytes cards200/power_17.png | Bin 0 -> 97100 bytes cards200/power_18.png | Bin 0 -> 95356 bytes cards200/power_19.png | Bin 0 -> 161130 bytes cards200/power_2.png | Bin 0 -> 119571 bytes cards200/power_20.png | Bin 0 -> 161344 bytes cards200/power_21.png | Bin 0 -> 160412 bytes cards200/power_22.png | Bin 0 -> 160639 bytes cards200/power_23.png | Bin 0 -> 159830 bytes cards200/power_24.png | Bin 0 -> 159749 bytes cards200/power_25.png | Bin 0 -> 159814 bytes cards200/power_26.png | Bin 0 -> 159887 bytes cards200/power_27.png | Bin 0 -> 161489 bytes cards200/power_28.png | Bin 0 -> 161673 bytes cards200/power_29.png | Bin 0 -> 161599 bytes cards200/power_3.png | Bin 0 -> 119573 bytes cards200/power_30.png | Bin 0 -> 161572 bytes cards200/power_31.png | Bin 0 -> 94374 bytes cards200/power_32.png | Bin 0 -> 94567 bytes cards200/power_33.png | Bin 0 -> 94574 bytes cards200/power_34.png | Bin 0 -> 93876 bytes cards200/power_35.png | Bin 0 -> 93950 bytes cards200/power_36.png | Bin 0 -> 93976 bytes cards200/power_37.png | Bin 0 -> 110540 bytes cards200/power_38.png | Bin 0 -> 97988 bytes cards200/power_39.png | Bin 0 -> 112614 bytes cards200/power_4.png | Bin 0 -> 119484 bytes cards200/power_40.png | Bin 0 -> 86923 bytes cards200/power_41.png | Bin 0 -> 91195 bytes cards200/power_42.png | Bin 0 -> 115789 bytes cards200/power_43.png | Bin 0 -> 79245 bytes cards200/power_44.png | Bin 0 -> 77193 bytes cards200/power_45.png | Bin 0 -> 80386 bytes cards200/power_46.png | Bin 0 -> 143761 bytes cards200/power_47.png | Bin 0 -> 118574 bytes cards200/power_48.png | Bin 0 -> 152412 bytes cards200/power_49.png | Bin 0 -> 73102 bytes cards200/power_5.png | Bin 0 -> 119572 bytes cards200/power_50.png | Bin 0 -> 96707 bytes cards200/power_51.png | Bin 0 -> 95681 bytes cards200/power_52.png | Bin 0 -> 108892 bytes cards200/power_6.png | Bin 0 -> 119582 bytes cards200/power_7.png | Bin 0 -> 96589 bytes cards200/power_8.png | Bin 0 -> 96724 bytes cards200/power_9.png | Bin 0 -> 96028 bytes cards200/power_back.png | Bin 0 -> 319956 bytes map150.png | Bin 0 -> 17901047 bytes map75.png | Bin 0 -> 5954165 bytes markers150/action_round_blue.png | Bin 0 -> 4711 bytes markers150/action_round_red.png | Bin 0 -> 4612 bytes markers150/cc1.png | Bin 0 -> 3306 bytes markers150/cc2.png | Bin 0 -> 3862 bytes markers150/cc3.png | Bin 0 -> 4199 bytes markers150/cc4.png | Bin 0 -> 3464 bytes markers150/cc5.png | Bin 0 -> 4066 bytes markers150/cc6.png | Bin 0 -> 4142 bytes markers150/cc7.png | Bin 0 -> 3696 bytes markers150/cc8.png | Bin 0 -> 4085 bytes markers150/ci1.png | Bin 0 -> 3523 bytes markers150/ci2.png | Bin 0 -> 4143 bytes markers150/ci3.png | Bin 0 -> 4448 bytes markers150/ci4.png | Bin 0 -> 3893 bytes markers150/ci5.png | Bin 0 -> 4269 bytes markers150/ci6.png | Bin 0 -> 4486 bytes markers150/ci7.png | Bin 0 -> 3948 bytes markers150/ci8.png | Bin 0 -> 4554 bytes markers150/dc1.png | Bin 0 -> 6019 bytes markers150/dc2.png | Bin 0 -> 6694 bytes markers150/dc3.png | Bin 0 -> 7089 bytes markers150/dc4.png | Bin 0 -> 6311 bytes markers150/dc5.png | Bin 0 -> 6711 bytes markers150/dc6.png | Bin 0 -> 7042 bytes markers150/dc7.png | Bin 0 -> 6684 bytes markers150/dc8.png | Bin 0 -> 6970 bytes markers150/di1.png | Bin 0 -> 4487 bytes markers150/di2.png | Bin 0 -> 5054 bytes markers150/di3.png | Bin 0 -> 5054 bytes markers150/di4.png | Bin 0 -> 4851 bytes markers150/di5.png | Bin 0 -> 4927 bytes markers150/di6.png | Bin 0 -> 5136 bytes markers150/di7.png | Bin 0 -> 4826 bytes markers150/di8.png | Bin 0 -> 5156 bytes markers150/event_austria_hungary.png | Bin 0 -> 6020 bytes markers150/event_eco_glasnost.png | Bin 0 -> 4440 bytes markers150/event_elena.png | Bin 0 -> 12668 bytes markers150/event_foreign_currency.png | Bin 0 -> 6334 bytes markers150/event_grenz_truppen.png | Bin 0 -> 13951 bytes markers150/event_helsinki.png | Bin 0 -> 6123 bytes markers150/event_honecker.png | Bin 0 -> 13209 bytes markers150/event_laszlo_tokes.png | Bin 0 -> 5091 bytes markers150/event_li_peng.png | Bin 0 -> 5037 bytes markers150/event_nye_party.png | Bin 0 -> 11942 bytes markers150/event_pres_visit.png | Bin 0 -> 13874 bytes markers150/event_securitate.png | Bin 0 -> 10784 bytes markers150/event_solidarity_legalized.png | Bin 0 -> 5723 bytes markers150/event_st_nicholas.png | Bin 0 -> 4457 bytes markers150/event_stand_fast.png | Bin 0 -> 12342 bytes markers150/event_systematization.png | Bin 0 -> 6736 bytes markers150/event_the_wall.png | Bin 0 -> 14171 bytes markers150/event_tyrant.png | Bin 0 -> 13208 bytes markers150/event_we_are_the_people.png | Bin 0 -> 6455 bytes markers150/ts_blue.png | Bin 0 -> 7267 bytes markers150/ts_blue_back.png | Bin 0 -> 6405 bytes markers150/ts_red.png | Bin 0 -> 9802 bytes markers150/ts_red_back.png | Bin 0 -> 8780 bytes markers150/turn.png | Bin 0 -> 3177 bytes markers150/ussr_stability_track.png | Bin 0 -> 4722 bytes markers150/vp.png | Bin 0 -> 2176 bytes markers75/action_round_blue.png | Bin 0 -> 2108 bytes markers75/action_round_red.png | Bin 0 -> 2117 bytes markers75/cc1.png | Bin 0 -> 1747 bytes markers75/cc2.png | Bin 0 -> 1961 bytes markers75/cc3.png | Bin 0 -> 1957 bytes markers75/cc4.png | Bin 0 -> 1860 bytes markers75/cc5.png | Bin 0 -> 1961 bytes markers75/cc6.png | Bin 0 -> 1960 bytes markers75/cc7.png | Bin 0 -> 1919 bytes markers75/cc8.png | Bin 0 -> 1937 bytes markers75/ci1.png | Bin 0 -> 1630 bytes markers75/ci2.png | Bin 0 -> 1815 bytes markers75/ci3.png | Bin 0 -> 1840 bytes markers75/ci4.png | Bin 0 -> 1772 bytes markers75/ci5.png | Bin 0 -> 1831 bytes markers75/ci6.png | Bin 0 -> 1849 bytes markers75/ci7.png | Bin 0 -> 1747 bytes markers75/ci8.png | Bin 0 -> 1877 bytes markers75/dc1.png | Bin 0 -> 2563 bytes markers75/dc2.png | Bin 0 -> 2780 bytes markers75/dc3.png | Bin 0 -> 2836 bytes markers75/dc4.png | Bin 0 -> 2753 bytes markers75/dc5.png | Bin 0 -> 2771 bytes markers75/dc6.png | Bin 0 -> 2864 bytes markers75/dc7.png | Bin 0 -> 2800 bytes markers75/dc8.png | Bin 0 -> 2810 bytes markers75/di1.png | Bin 0 -> 1767 bytes markers75/di2.png | Bin 0 -> 1857 bytes markers75/di3.png | Bin 0 -> 1897 bytes markers75/di4.png | Bin 0 -> 1846 bytes markers75/di5.png | Bin 0 -> 1831 bytes markers75/di6.png | Bin 0 -> 1884 bytes markers75/di7.png | Bin 0 -> 1790 bytes markers75/di8.png | Bin 0 -> 1910 bytes markers75/event_austria_hungary.png | Bin 0 -> 2415 bytes markers75/event_eco_glasnost.png | Bin 0 -> 1973 bytes markers75/event_elena.png | Bin 0 -> 3923 bytes markers75/event_foreign_currency.png | Bin 0 -> 2634 bytes markers75/event_grenz_truppen.png | Bin 0 -> 4122 bytes markers75/event_helsinki.png | Bin 0 -> 2388 bytes markers75/event_honecker.png | Bin 0 -> 3902 bytes markers75/event_laszlo_tokes.png | Bin 0 -> 2041 bytes markers75/event_li_peng.png | Bin 0 -> 2186 bytes markers75/event_nye_party.png | Bin 0 -> 3538 bytes markers75/event_pres_visit.png | Bin 0 -> 4074 bytes markers75/event_securitate.png | Bin 0 -> 3423 bytes markers75/event_solidarity_legalized.png | Bin 0 -> 2133 bytes markers75/event_st_nicholas.png | Bin 0 -> 2034 bytes markers75/event_stand_fast.png | Bin 0 -> 3713 bytes markers75/event_systematization.png | Bin 0 -> 2510 bytes markers75/event_the_wall.png | Bin 0 -> 3924 bytes markers75/event_tyrant.png | Bin 0 -> 3978 bytes markers75/event_we_are_the_people.png | Bin 0 -> 2578 bytes markers75/ts_blue.png | Bin 0 -> 2711 bytes markers75/ts_blue_back.png | Bin 0 -> 2259 bytes markers75/ts_red.png | Bin 0 -> 3455 bytes markers75/ts_red_back.png | Bin 0 -> 2994 bytes markers75/turn.png | Bin 0 -> 1424 bytes markers75/ussr_stability_track.png | Bin 0 -> 1918 bytes markers75/vp.png | Bin 0 -> 1035 bytes 450 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cards100/event_1.png create mode 100644 cards100/event_10.png create mode 100644 cards100/event_100.png create mode 100644 cards100/event_101.png create mode 100644 cards100/event_102.png create mode 100644 cards100/event_103.png create mode 100644 cards100/event_104.png create mode 100644 cards100/event_105.png create mode 100644 cards100/event_106.png create mode 100644 cards100/event_107.png create mode 100644 cards100/event_108.png create mode 100644 cards100/event_109.png create mode 100644 cards100/event_11.png create mode 100644 cards100/event_110.png create mode 100644 cards100/event_12.png create mode 100644 cards100/event_13.png create mode 100644 cards100/event_14.png create mode 100644 cards100/event_15.png create mode 100644 cards100/event_16.png create mode 100644 cards100/event_17.png create mode 100644 cards100/event_18.png create mode 100644 cards100/event_19.png create mode 100644 cards100/event_2.png create mode 100644 cards100/event_20.png create mode 100644 cards100/event_21.png create mode 100644 cards100/event_22.png create mode 100644 cards100/event_23.png create mode 100644 cards100/event_24.png create mode 100644 cards100/event_25.png create mode 100644 cards100/event_26.png create mode 100644 cards100/event_27.png create mode 100644 cards100/event_28.png create mode 100644 cards100/event_29.png create mode 100644 cards100/event_3.png create mode 100644 cards100/event_30.png create mode 100644 cards100/event_31.png create mode 100644 cards100/event_32.png create mode 100644 cards100/event_33.png create mode 100644 cards100/event_34.png create mode 100644 cards100/event_35.png create mode 100644 cards100/event_36.png create mode 100644 cards100/event_37.png create mode 100644 cards100/event_38.png create mode 100644 cards100/event_39.png create mode 100644 cards100/event_4.png create mode 100644 cards100/event_40.png create mode 100644 cards100/event_41.png create mode 100644 cards100/event_42.png create mode 100644 cards100/event_43.png create mode 100644 cards100/event_44.png create mode 100644 cards100/event_45.png create mode 100644 cards100/event_46.png create mode 100644 cards100/event_47.png create mode 100644 cards100/event_48.png create mode 100644 cards100/event_49.png create mode 100644 cards100/event_5.png create mode 100644 cards100/event_50.png create mode 100644 cards100/event_51.png create mode 100644 cards100/event_52.png create mode 100644 cards100/event_53.png create mode 100644 cards100/event_54.png create mode 100644 cards100/event_55.png create mode 100644 cards100/event_56.png create mode 100644 cards100/event_57.png create mode 100644 cards100/event_58.png create mode 100644 cards100/event_59.png create mode 100644 cards100/event_6.png create mode 100644 cards100/event_60.png create mode 100644 cards100/event_61.png create mode 100644 cards100/event_62.png create mode 100644 cards100/event_63.png create mode 100644 cards100/event_64.png create mode 100644 cards100/event_65.png create mode 100644 cards100/event_66.png create mode 100644 cards100/event_67.png create mode 100644 cards100/event_68.png create mode 100644 cards100/event_69.png create mode 100644 cards100/event_7.png create mode 100644 cards100/event_70.png create mode 100644 cards100/event_71.png create mode 100644 cards100/event_72.png create mode 100644 cards100/event_73.png create mode 100644 cards100/event_74.png create mode 100644 cards100/event_75.png create mode 100644 cards100/event_76.png create mode 100644 cards100/event_77.png create mode 100644 cards100/event_78.png create mode 100644 cards100/event_79.png create mode 100644 cards100/event_8.png create mode 100644 cards100/event_80.png create mode 100644 cards100/event_81.png create mode 100644 cards100/event_82.png create mode 100644 cards100/event_83.png create mode 100644 cards100/event_84.png create mode 100644 cards100/event_85.png create mode 100644 cards100/event_86.png create mode 100644 cards100/event_87.png create mode 100644 cards100/event_88.png create mode 100644 cards100/event_89.png create mode 100644 cards100/event_9.png create mode 100644 cards100/event_90.png create mode 100644 cards100/event_91.png create mode 100644 cards100/event_92.png create mode 100644 cards100/event_93.png create mode 100644 cards100/event_94.png create mode 100644 cards100/event_95.png create mode 100644 cards100/event_96.png create mode 100644 cards100/event_97.png create mode 100644 cards100/event_98.png create mode 100644 cards100/event_99.png create mode 100644 cards100/event_back.png create mode 100644 cards100/power_1.png create mode 100644 cards100/power_10.png create mode 100644 cards100/power_11.png create mode 100644 cards100/power_12.png create mode 100644 cards100/power_13.png create mode 100644 cards100/power_14.png create mode 100644 cards100/power_15.png create mode 100644 cards100/power_16.png create mode 100644 cards100/power_17.png create mode 100644 cards100/power_18.png create mode 100644 cards100/power_19.png create mode 100644 cards100/power_2.png create mode 100644 cards100/power_20.png create mode 100644 cards100/power_21.png create mode 100644 cards100/power_22.png create mode 100644 cards100/power_23.png create mode 100644 cards100/power_24.png create mode 100644 cards100/power_25.png create mode 100644 cards100/power_26.png create mode 100644 cards100/power_27.png create mode 100644 cards100/power_28.png create mode 100644 cards100/power_29.png create mode 100644 cards100/power_3.png create mode 100644 cards100/power_30.png create mode 100644 cards100/power_31.png create mode 100644 cards100/power_32.png create mode 100644 cards100/power_33.png create mode 100644 cards100/power_34.png create mode 100644 cards100/power_35.png create mode 100644 cards100/power_36.png create mode 100644 cards100/power_37.png create mode 100644 cards100/power_38.png create mode 100644 cards100/power_39.png create mode 100644 cards100/power_4.png create mode 100644 cards100/power_40.png create mode 100644 cards100/power_41.png create mode 100644 cards100/power_42.png create mode 100644 cards100/power_43.png create mode 100644 cards100/power_44.png create mode 100644 cards100/power_45.png create mode 100644 cards100/power_46.png create mode 100644 cards100/power_47.png create mode 100644 cards100/power_48.png create mode 100644 cards100/power_49.png create mode 100644 cards100/power_5.png create mode 100644 cards100/power_50.png create mode 100644 cards100/power_51.png create mode 100644 cards100/power_52.png create mode 100644 cards100/power_6.png create mode 100644 cards100/power_7.png create mode 100644 cards100/power_8.png create mode 100644 cards100/power_9.png create mode 100644 cards100/power_back.png create mode 100644 cards200/event_1.png create mode 100644 cards200/event_10.png create mode 100644 cards200/event_100.png create mode 100644 cards200/event_101.png create mode 100644 cards200/event_102.png create mode 100644 cards200/event_103.png create mode 100644 cards200/event_104.png create mode 100644 cards200/event_105.png create mode 100644 cards200/event_106.png create mode 100644 cards200/event_107.png create mode 100644 cards200/event_108.png create mode 100644 cards200/event_109.png create mode 100644 cards200/event_11.png create mode 100644 cards200/event_110.png create mode 100644 cards200/event_12.png create mode 100644 cards200/event_13.png create mode 100644 cards200/event_14.png create mode 100644 cards200/event_15.png create mode 100644 cards200/event_16.png create mode 100644 cards200/event_17.png create mode 100644 cards200/event_18.png create mode 100644 cards200/event_19.png create mode 100644 cards200/event_2.png create mode 100644 cards200/event_20.png create mode 100644 cards200/event_21.png create mode 100644 cards200/event_22.png create mode 100644 cards200/event_23.png create mode 100644 cards200/event_24.png create mode 100644 cards200/event_25.png create mode 100644 cards200/event_26.png create mode 100644 cards200/event_27.png create mode 100644 cards200/event_28.png create mode 100644 cards200/event_29.png create mode 100644 cards200/event_3.png create mode 100644 cards200/event_30.png create mode 100644 cards200/event_31.png create mode 100644 cards200/event_32.png create mode 100644 cards200/event_33.png create mode 100644 cards200/event_34.png create mode 100644 cards200/event_35.png create mode 100644 cards200/event_36.png create mode 100644 cards200/event_37.png create mode 100644 cards200/event_38.png create mode 100644 cards200/event_39.png create mode 100644 cards200/event_4.png create mode 100644 cards200/event_40.png create mode 100644 cards200/event_41.png create mode 100644 cards200/event_42.png create mode 100644 cards200/event_43.png create mode 100644 cards200/event_44.png create mode 100644 cards200/event_45.png create mode 100644 cards200/event_46.png create mode 100644 cards200/event_47.png create mode 100644 cards200/event_48.png create mode 100644 cards200/event_49.png create mode 100644 cards200/event_5.png create mode 100644 cards200/event_50.png create mode 100644 cards200/event_51.png create mode 100644 cards200/event_52.png create mode 100644 cards200/event_53.png create mode 100644 cards200/event_54.png create mode 100644 cards200/event_55.png create mode 100644 cards200/event_56.png create mode 100644 cards200/event_57.png create mode 100644 cards200/event_58.png create mode 100644 cards200/event_59.png create mode 100644 cards200/event_6.png create mode 100644 cards200/event_60.png create mode 100644 cards200/event_61.png create mode 100644 cards200/event_62.png create mode 100644 cards200/event_63.png create mode 100644 cards200/event_64.png create mode 100644 cards200/event_65.png create mode 100644 cards200/event_66.png create mode 100644 cards200/event_67.png create mode 100644 cards200/event_68.png create mode 100644 cards200/event_69.png create mode 100644 cards200/event_7.png create mode 100644 cards200/event_70.png create mode 100644 cards200/event_71.png create mode 100644 cards200/event_72.png create mode 100644 cards200/event_73.png create mode 100644 cards200/event_74.png create mode 100644 cards200/event_75.png create mode 100644 cards200/event_76.png create mode 100644 cards200/event_77.png create mode 100644 cards200/event_78.png create mode 100644 cards200/event_79.png create mode 100644 cards200/event_8.png create mode 100644 cards200/event_80.png create mode 100644 cards200/event_81.png create mode 100644 cards200/event_82.png create mode 100644 cards200/event_83.png create mode 100644 cards200/event_84.png create mode 100644 cards200/event_85.png create mode 100644 cards200/event_86.png create mode 100644 cards200/event_87.png create mode 100644 cards200/event_88.png create mode 100644 cards200/event_89.png create mode 100644 cards200/event_9.png create mode 100644 cards200/event_90.png create mode 100644 cards200/event_91.png create mode 100644 cards200/event_92.png create mode 100644 cards200/event_93.png create mode 100644 cards200/event_94.png create mode 100644 cards200/event_95.png create mode 100644 cards200/event_96.png create mode 100644 cards200/event_97.png create mode 100644 cards200/event_98.png create mode 100644 cards200/event_99.png create mode 100644 cards200/event_back.png create mode 100644 cards200/power_1.png create mode 100644 cards200/power_10.png create mode 100644 cards200/power_11.png create mode 100644 cards200/power_12.png create mode 100644 cards200/power_13.png create mode 100644 cards200/power_14.png create mode 100644 cards200/power_15.png create mode 100644 cards200/power_16.png create mode 100644 cards200/power_17.png create mode 100644 cards200/power_18.png create mode 100644 cards200/power_19.png create mode 100644 cards200/power_2.png create mode 100644 cards200/power_20.png create mode 100644 cards200/power_21.png create mode 100644 cards200/power_22.png create mode 100644 cards200/power_23.png create mode 100644 cards200/power_24.png create mode 100644 cards200/power_25.png create mode 100644 cards200/power_26.png create mode 100644 cards200/power_27.png create mode 100644 cards200/power_28.png create mode 100644 cards200/power_29.png create mode 100644 cards200/power_3.png create mode 100644 cards200/power_30.png create mode 100644 cards200/power_31.png create mode 100644 cards200/power_32.png create mode 100644 cards200/power_33.png create mode 100644 cards200/power_34.png create mode 100644 cards200/power_35.png create mode 100644 cards200/power_36.png create mode 100644 cards200/power_37.png create mode 100644 cards200/power_38.png create mode 100644 cards200/power_39.png create mode 100644 cards200/power_4.png create mode 100644 cards200/power_40.png create mode 100644 cards200/power_41.png create mode 100644 cards200/power_42.png create mode 100644 cards200/power_43.png create mode 100644 cards200/power_44.png create mode 100644 cards200/power_45.png create mode 100644 cards200/power_46.png create mode 100644 cards200/power_47.png create mode 100644 cards200/power_48.png create mode 100644 cards200/power_49.png create mode 100644 cards200/power_5.png create mode 100644 cards200/power_50.png create mode 100644 cards200/power_51.png create mode 100644 cards200/power_52.png create mode 100644 cards200/power_6.png create mode 100644 cards200/power_7.png create mode 100644 cards200/power_8.png create mode 100644 cards200/power_9.png create mode 100644 cards200/power_back.png create mode 100644 map150.png create mode 100644 map75.png create mode 100644 markers150/action_round_blue.png create mode 100644 markers150/action_round_red.png create mode 100644 markers150/cc1.png create mode 100644 markers150/cc2.png create mode 100644 markers150/cc3.png create mode 100644 markers150/cc4.png create mode 100644 markers150/cc5.png create mode 100644 markers150/cc6.png create mode 100644 markers150/cc7.png create mode 100644 markers150/cc8.png create mode 100644 markers150/ci1.png create mode 100644 markers150/ci2.png create mode 100644 markers150/ci3.png create mode 100644 markers150/ci4.png create mode 100644 markers150/ci5.png create mode 100644 markers150/ci6.png create mode 100644 markers150/ci7.png create mode 100644 markers150/ci8.png create mode 100644 markers150/dc1.png create mode 100644 markers150/dc2.png create mode 100644 markers150/dc3.png create mode 100644 markers150/dc4.png create mode 100644 markers150/dc5.png create mode 100644 markers150/dc6.png create mode 100644 markers150/dc7.png create mode 100644 markers150/dc8.png create mode 100644 markers150/di1.png create mode 100644 markers150/di2.png create mode 100644 markers150/di3.png create mode 100644 markers150/di4.png create mode 100644 markers150/di5.png create mode 100644 markers150/di6.png create mode 100644 markers150/di7.png create mode 100644 markers150/di8.png create mode 100644 markers150/event_austria_hungary.png create mode 100644 markers150/event_eco_glasnost.png create mode 100644 markers150/event_elena.png create mode 100644 markers150/event_foreign_currency.png create mode 100644 markers150/event_grenz_truppen.png create mode 100644 markers150/event_helsinki.png create mode 100644 markers150/event_honecker.png create mode 100644 markers150/event_laszlo_tokes.png create mode 100644 markers150/event_li_peng.png create mode 100644 markers150/event_nye_party.png create mode 100644 markers150/event_pres_visit.png create mode 100644 markers150/event_securitate.png create mode 100644 markers150/event_solidarity_legalized.png create mode 100644 markers150/event_st_nicholas.png create mode 100644 markers150/event_stand_fast.png create mode 100644 markers150/event_systematization.png create mode 100644 markers150/event_the_wall.png create mode 100644 markers150/event_tyrant.png create mode 100644 markers150/event_we_are_the_people.png create mode 100644 markers150/ts_blue.png create mode 100644 markers150/ts_blue_back.png create mode 100644 markers150/ts_red.png create mode 100644 markers150/ts_red_back.png create mode 100644 markers150/turn.png create mode 100644 markers150/ussr_stability_track.png create mode 100644 markers150/vp.png create mode 100644 markers75/action_round_blue.png create mode 100644 markers75/action_round_red.png create mode 100644 markers75/cc1.png create mode 100644 markers75/cc2.png create mode 100644 markers75/cc3.png create mode 100644 markers75/cc4.png create mode 100644 markers75/cc5.png create mode 100644 markers75/cc6.png create mode 100644 markers75/cc7.png create mode 100644 markers75/cc8.png create mode 100644 markers75/ci1.png create mode 100644 markers75/ci2.png create mode 100644 markers75/ci3.png create mode 100644 markers75/ci4.png create mode 100644 markers75/ci5.png create mode 100644 markers75/ci6.png create mode 100644 markers75/ci7.png create mode 100644 markers75/ci8.png create mode 100644 markers75/dc1.png create mode 100644 markers75/dc2.png create mode 100644 markers75/dc3.png create mode 100644 markers75/dc4.png create mode 100644 markers75/dc5.png create mode 100644 markers75/dc6.png create mode 100644 markers75/dc7.png create mode 100644 markers75/dc8.png create mode 100644 markers75/di1.png create mode 100644 markers75/di2.png create mode 100644 markers75/di3.png create mode 100644 markers75/di4.png create mode 100644 markers75/di5.png create mode 100644 markers75/di6.png create mode 100644 markers75/di7.png create mode 100644 markers75/di8.png create mode 100644 markers75/event_austria_hungary.png create mode 100644 markers75/event_eco_glasnost.png create mode 100644 markers75/event_elena.png create mode 100644 markers75/event_foreign_currency.png create mode 100644 markers75/event_grenz_truppen.png create mode 100644 markers75/event_helsinki.png create mode 100644 markers75/event_honecker.png create mode 100644 markers75/event_laszlo_tokes.png create mode 100644 markers75/event_li_peng.png create mode 100644 markers75/event_nye_party.png create mode 100644 markers75/event_pres_visit.png create mode 100644 markers75/event_securitate.png create mode 100644 markers75/event_solidarity_legalized.png create mode 100644 markers75/event_st_nicholas.png create mode 100644 markers75/event_stand_fast.png create mode 100644 markers75/event_systematization.png create mode 100644 markers75/event_the_wall.png create mode 100644 markers75/event_tyrant.png create mode 100644 markers75/event_we_are_the_people.png create mode 100644 markers75/ts_blue.png create mode 100644 markers75/ts_blue_back.png create mode 100644 markers75/ts_red.png create mode 100644 markers75/ts_red_back.png create mode 100644 markers75/turn.png create mode 100644 markers75/ussr_stability_track.png create mode 100644 markers75/vp.png diff --git a/cards100/event_1.png b/cards100/event_1.png new file mode 100644 index 0000000..53581d9 Binary files /dev/null and b/cards100/event_1.png differ diff --git a/cards100/event_10.png b/cards100/event_10.png new file mode 100644 index 0000000..c2fbb9d Binary files /dev/null and b/cards100/event_10.png differ diff --git a/cards100/event_100.png b/cards100/event_100.png new file mode 100644 index 0000000..d45748d Binary files /dev/null and b/cards100/event_100.png differ diff --git a/cards100/event_101.png b/cards100/event_101.png new file mode 100644 index 0000000..3af75fd Binary files /dev/null and b/cards100/event_101.png differ diff --git a/cards100/event_102.png b/cards100/event_102.png new file mode 100644 index 0000000..d97bca3 Binary files /dev/null and b/cards100/event_102.png differ diff --git a/cards100/event_103.png b/cards100/event_103.png new file mode 100644 index 0000000..45859b1 Binary files /dev/null and b/cards100/event_103.png differ diff --git a/cards100/event_104.png b/cards100/event_104.png new file mode 100644 index 0000000..de69e22 Binary files /dev/null and b/cards100/event_104.png differ diff --git a/cards100/event_105.png b/cards100/event_105.png new file mode 100644 index 0000000..d6b30ba Binary files /dev/null and b/cards100/event_105.png differ diff --git a/cards100/event_106.png b/cards100/event_106.png new file mode 100644 index 0000000..503870b Binary files /dev/null and b/cards100/event_106.png differ diff --git a/cards100/event_107.png b/cards100/event_107.png new file mode 100644 index 0000000..11a9113 Binary files /dev/null and b/cards100/event_107.png differ diff --git a/cards100/event_108.png b/cards100/event_108.png new file mode 100644 index 0000000..de9e2e6 Binary files /dev/null and b/cards100/event_108.png differ diff --git a/cards100/event_109.png b/cards100/event_109.png new file mode 100644 index 0000000..cc1b483 Binary files /dev/null and b/cards100/event_109.png differ diff --git a/cards100/event_11.png b/cards100/event_11.png new file mode 100644 index 0000000..a368aae Binary files /dev/null and b/cards100/event_11.png differ diff --git a/cards100/event_110.png b/cards100/event_110.png new file mode 100644 index 0000000..ee139d5 Binary files /dev/null and b/cards100/event_110.png differ diff --git a/cards100/event_12.png b/cards100/event_12.png new file mode 100644 index 0000000..edfbca9 Binary files /dev/null and b/cards100/event_12.png differ diff --git a/cards100/event_13.png b/cards100/event_13.png new file mode 100644 index 0000000..1f3fad9 Binary files /dev/null and b/cards100/event_13.png differ diff --git a/cards100/event_14.png b/cards100/event_14.png new file mode 100644 index 0000000..9fb1e71 Binary files /dev/null and b/cards100/event_14.png differ diff --git a/cards100/event_15.png b/cards100/event_15.png new file mode 100644 index 0000000..b36fe5e Binary files /dev/null and b/cards100/event_15.png differ diff --git a/cards100/event_16.png b/cards100/event_16.png new file mode 100644 index 0000000..081a9ba Binary files /dev/null and b/cards100/event_16.png differ diff --git a/cards100/event_17.png b/cards100/event_17.png new file mode 100644 index 0000000..0134969 Binary files /dev/null and b/cards100/event_17.png differ diff --git a/cards100/event_18.png b/cards100/event_18.png new file mode 100644 index 0000000..564d5fe Binary files /dev/null and b/cards100/event_18.png differ diff --git a/cards100/event_19.png b/cards100/event_19.png new file mode 100644 index 0000000..2cedd7a Binary files /dev/null and b/cards100/event_19.png differ diff --git a/cards100/event_2.png b/cards100/event_2.png new file mode 100644 index 0000000..5279ba4 Binary files /dev/null and b/cards100/event_2.png differ diff --git a/cards100/event_20.png b/cards100/event_20.png new file mode 100644 index 0000000..4f3073c Binary files /dev/null and b/cards100/event_20.png differ diff --git a/cards100/event_21.png b/cards100/event_21.png new file mode 100644 index 0000000..c0b87f3 Binary files /dev/null and b/cards100/event_21.png differ diff --git a/cards100/event_22.png b/cards100/event_22.png new file mode 100644 index 0000000..80df681 Binary files /dev/null and b/cards100/event_22.png differ diff --git a/cards100/event_23.png b/cards100/event_23.png new file mode 100644 index 0000000..e23389a Binary files /dev/null and b/cards100/event_23.png differ diff --git a/cards100/event_24.png b/cards100/event_24.png new file mode 100644 index 0000000..8104837 Binary files /dev/null and b/cards100/event_24.png differ diff --git a/cards100/event_25.png b/cards100/event_25.png new file mode 100644 index 0000000..c55be45 Binary files /dev/null and b/cards100/event_25.png differ diff --git a/cards100/event_26.png b/cards100/event_26.png new file mode 100644 index 0000000..ad42b5f Binary files /dev/null and b/cards100/event_26.png differ diff --git a/cards100/event_27.png b/cards100/event_27.png new file mode 100644 index 0000000..7d514b1 Binary files /dev/null and b/cards100/event_27.png differ diff --git a/cards100/event_28.png b/cards100/event_28.png new file mode 100644 index 0000000..d47838c Binary files /dev/null and b/cards100/event_28.png differ diff --git a/cards100/event_29.png b/cards100/event_29.png new file mode 100644 index 0000000..7152afc Binary files /dev/null and b/cards100/event_29.png differ diff --git a/cards100/event_3.png b/cards100/event_3.png new file mode 100644 index 0000000..0e25416 Binary files /dev/null and b/cards100/event_3.png differ diff --git a/cards100/event_30.png b/cards100/event_30.png new file mode 100644 index 0000000..e67ed48 Binary files /dev/null and b/cards100/event_30.png differ diff --git a/cards100/event_31.png b/cards100/event_31.png new file mode 100644 index 0000000..d3b8efc Binary files /dev/null and b/cards100/event_31.png differ diff --git a/cards100/event_32.png b/cards100/event_32.png new file mode 100644 index 0000000..e602227 Binary files /dev/null and b/cards100/event_32.png differ diff --git a/cards100/event_33.png b/cards100/event_33.png new file mode 100644 index 0000000..c67b8d0 Binary files /dev/null and b/cards100/event_33.png differ diff --git a/cards100/event_34.png b/cards100/event_34.png new file mode 100644 index 0000000..9d97bba Binary files /dev/null and b/cards100/event_34.png differ diff --git a/cards100/event_35.png b/cards100/event_35.png new file mode 100644 index 0000000..807bfb1 Binary files /dev/null and b/cards100/event_35.png differ diff --git a/cards100/event_36.png b/cards100/event_36.png new file mode 100644 index 0000000..6729f82 Binary files /dev/null and b/cards100/event_36.png differ diff --git a/cards100/event_37.png b/cards100/event_37.png new file mode 100644 index 0000000..ee1b36c Binary files /dev/null and b/cards100/event_37.png differ diff --git a/cards100/event_38.png b/cards100/event_38.png new file mode 100644 index 0000000..80b1136 Binary files /dev/null and b/cards100/event_38.png differ diff --git a/cards100/event_39.png b/cards100/event_39.png new file mode 100644 index 0000000..ef17a6f Binary files /dev/null and b/cards100/event_39.png differ diff --git a/cards100/event_4.png b/cards100/event_4.png new file mode 100644 index 0000000..55042ab Binary files /dev/null and b/cards100/event_4.png differ diff --git a/cards100/event_40.png b/cards100/event_40.png new file mode 100644 index 0000000..fd6014d Binary files /dev/null and b/cards100/event_40.png differ diff --git a/cards100/event_41.png b/cards100/event_41.png new file mode 100644 index 0000000..aac3d39 Binary files /dev/null and b/cards100/event_41.png differ diff --git a/cards100/event_42.png b/cards100/event_42.png new file mode 100644 index 0000000..2610b17 Binary files /dev/null and b/cards100/event_42.png differ diff --git a/cards100/event_43.png b/cards100/event_43.png new file mode 100644 index 0000000..351dc64 Binary files /dev/null and b/cards100/event_43.png differ diff --git a/cards100/event_44.png b/cards100/event_44.png new file mode 100644 index 0000000..a34495e Binary files /dev/null and b/cards100/event_44.png differ diff --git a/cards100/event_45.png b/cards100/event_45.png new file mode 100644 index 0000000..1a545fd Binary files /dev/null and b/cards100/event_45.png differ diff --git a/cards100/event_46.png b/cards100/event_46.png new file mode 100644 index 0000000..2d9e6fb Binary files /dev/null and b/cards100/event_46.png differ diff --git a/cards100/event_47.png b/cards100/event_47.png new file mode 100644 index 0000000..6c820f1 Binary files /dev/null and b/cards100/event_47.png differ diff --git a/cards100/event_48.png b/cards100/event_48.png new file mode 100644 index 0000000..7584b00 Binary files /dev/null and b/cards100/event_48.png differ diff --git a/cards100/event_49.png b/cards100/event_49.png new file mode 100644 index 0000000..c0f6c1d Binary files /dev/null and b/cards100/event_49.png differ diff --git a/cards100/event_5.png b/cards100/event_5.png new file mode 100644 index 0000000..bbacd20 Binary files /dev/null and b/cards100/event_5.png differ diff --git a/cards100/event_50.png b/cards100/event_50.png new file mode 100644 index 0000000..618eb50 Binary files /dev/null and b/cards100/event_50.png differ diff --git a/cards100/event_51.png b/cards100/event_51.png new file mode 100644 index 0000000..08d223b Binary files /dev/null and b/cards100/event_51.png differ diff --git a/cards100/event_52.png b/cards100/event_52.png new file mode 100644 index 0000000..98167cc Binary files /dev/null and b/cards100/event_52.png differ diff --git a/cards100/event_53.png b/cards100/event_53.png new file mode 100644 index 0000000..194971f Binary files /dev/null and b/cards100/event_53.png differ diff --git a/cards100/event_54.png b/cards100/event_54.png new file mode 100644 index 0000000..165f49a Binary files /dev/null and b/cards100/event_54.png differ diff --git a/cards100/event_55.png b/cards100/event_55.png new file mode 100644 index 0000000..c8b85d6 Binary files /dev/null and b/cards100/event_55.png differ diff --git a/cards100/event_56.png b/cards100/event_56.png new file mode 100644 index 0000000..f48ce25 Binary files /dev/null and b/cards100/event_56.png differ diff --git a/cards100/event_57.png b/cards100/event_57.png new file mode 100644 index 0000000..c48357c Binary files /dev/null and b/cards100/event_57.png differ diff --git a/cards100/event_58.png b/cards100/event_58.png new file mode 100644 index 0000000..2f990ca Binary files /dev/null and b/cards100/event_58.png differ diff --git a/cards100/event_59.png b/cards100/event_59.png new file mode 100644 index 0000000..e48fa48 Binary files /dev/null and b/cards100/event_59.png differ diff --git a/cards100/event_6.png b/cards100/event_6.png new file mode 100644 index 0000000..830ff28 Binary files /dev/null and b/cards100/event_6.png differ diff --git a/cards100/event_60.png b/cards100/event_60.png new file mode 100644 index 0000000..5ae1476 Binary files /dev/null and b/cards100/event_60.png differ diff --git a/cards100/event_61.png b/cards100/event_61.png new file mode 100644 index 0000000..ae6f4b4 Binary files /dev/null and b/cards100/event_61.png differ diff --git a/cards100/event_62.png b/cards100/event_62.png new file mode 100644 index 0000000..621bcfb Binary files /dev/null and b/cards100/event_62.png differ diff --git a/cards100/event_63.png b/cards100/event_63.png new file mode 100644 index 0000000..f5974b7 Binary files /dev/null and b/cards100/event_63.png differ diff --git a/cards100/event_64.png b/cards100/event_64.png new file mode 100644 index 0000000..fbdbff5 Binary files /dev/null and b/cards100/event_64.png differ diff --git a/cards100/event_65.png b/cards100/event_65.png new file mode 100644 index 0000000..2d7d411 Binary files /dev/null and b/cards100/event_65.png differ diff --git a/cards100/event_66.png b/cards100/event_66.png new file mode 100644 index 0000000..798782b Binary files /dev/null and b/cards100/event_66.png differ diff --git a/cards100/event_67.png b/cards100/event_67.png new file mode 100644 index 0000000..37b1d07 Binary files /dev/null and b/cards100/event_67.png differ diff --git a/cards100/event_68.png b/cards100/event_68.png new file mode 100644 index 0000000..4b36172 Binary files /dev/null and b/cards100/event_68.png differ diff --git a/cards100/event_69.png b/cards100/event_69.png new file mode 100644 index 0000000..2debba9 Binary files /dev/null and b/cards100/event_69.png differ diff --git a/cards100/event_7.png b/cards100/event_7.png new file mode 100644 index 0000000..f2f1090 Binary files /dev/null and b/cards100/event_7.png differ diff --git a/cards100/event_70.png b/cards100/event_70.png new file mode 100644 index 0000000..668b8cc Binary files /dev/null and b/cards100/event_70.png differ diff --git a/cards100/event_71.png b/cards100/event_71.png new file mode 100644 index 0000000..f39ab07 Binary files /dev/null and b/cards100/event_71.png differ diff --git a/cards100/event_72.png b/cards100/event_72.png new file mode 100644 index 0000000..52d7826 Binary files /dev/null and b/cards100/event_72.png differ diff --git a/cards100/event_73.png b/cards100/event_73.png new file mode 100644 index 0000000..f746f2f Binary files /dev/null and b/cards100/event_73.png differ diff --git a/cards100/event_74.png b/cards100/event_74.png new file mode 100644 index 0000000..173bec0 Binary files /dev/null and b/cards100/event_74.png differ diff --git a/cards100/event_75.png b/cards100/event_75.png new file mode 100644 index 0000000..4d52da8 Binary files /dev/null and b/cards100/event_75.png differ diff --git a/cards100/event_76.png b/cards100/event_76.png new file mode 100644 index 0000000..4fcc9dc Binary files /dev/null and b/cards100/event_76.png differ diff --git a/cards100/event_77.png b/cards100/event_77.png new file mode 100644 index 0000000..25eb5e7 Binary files /dev/null and b/cards100/event_77.png differ diff --git a/cards100/event_78.png b/cards100/event_78.png new file mode 100644 index 0000000..479fe0b Binary files /dev/null and b/cards100/event_78.png differ diff --git a/cards100/event_79.png b/cards100/event_79.png new file mode 100644 index 0000000..d19937d Binary files /dev/null and b/cards100/event_79.png differ diff --git a/cards100/event_8.png b/cards100/event_8.png new file mode 100644 index 0000000..fbc34ab Binary files /dev/null and b/cards100/event_8.png differ diff --git a/cards100/event_80.png b/cards100/event_80.png new file mode 100644 index 0000000..c96490d Binary files /dev/null and b/cards100/event_80.png differ diff --git a/cards100/event_81.png b/cards100/event_81.png new file mode 100644 index 0000000..fe6f6a0 Binary files /dev/null and b/cards100/event_81.png differ diff --git a/cards100/event_82.png b/cards100/event_82.png new file mode 100644 index 0000000..c8cbc2e Binary files /dev/null and b/cards100/event_82.png differ diff --git a/cards100/event_83.png b/cards100/event_83.png new file mode 100644 index 0000000..8e109cc Binary files /dev/null and b/cards100/event_83.png differ diff --git a/cards100/event_84.png b/cards100/event_84.png new file mode 100644 index 0000000..509d79b Binary files /dev/null and b/cards100/event_84.png differ diff --git a/cards100/event_85.png b/cards100/event_85.png new file mode 100644 index 0000000..db0912a Binary files /dev/null and b/cards100/event_85.png differ diff --git a/cards100/event_86.png b/cards100/event_86.png new file mode 100644 index 0000000..18560ea Binary files /dev/null and b/cards100/event_86.png differ diff --git a/cards100/event_87.png b/cards100/event_87.png new file mode 100644 index 0000000..f4e7277 Binary files /dev/null and b/cards100/event_87.png differ diff --git a/cards100/event_88.png b/cards100/event_88.png new file mode 100644 index 0000000..e40c852 Binary files /dev/null and b/cards100/event_88.png differ diff --git a/cards100/event_89.png b/cards100/event_89.png new file mode 100644 index 0000000..fc1e57e Binary files /dev/null and b/cards100/event_89.png differ diff --git a/cards100/event_9.png b/cards100/event_9.png new file mode 100644 index 0000000..086d1c8 Binary files /dev/null and b/cards100/event_9.png differ diff --git a/cards100/event_90.png b/cards100/event_90.png new file mode 100644 index 0000000..b8624f7 Binary files /dev/null and b/cards100/event_90.png differ diff --git a/cards100/event_91.png b/cards100/event_91.png new file mode 100644 index 0000000..81b19d3 Binary files /dev/null and b/cards100/event_91.png differ diff --git a/cards100/event_92.png b/cards100/event_92.png new file mode 100644 index 0000000..7b69207 Binary files /dev/null and b/cards100/event_92.png differ diff --git a/cards100/event_93.png b/cards100/event_93.png new file mode 100644 index 0000000..aba042a Binary files /dev/null and b/cards100/event_93.png differ diff --git a/cards100/event_94.png b/cards100/event_94.png new file mode 100644 index 0000000..23f2060 Binary files /dev/null and b/cards100/event_94.png differ diff --git a/cards100/event_95.png b/cards100/event_95.png new file mode 100644 index 0000000..1ef70f8 Binary files /dev/null and b/cards100/event_95.png differ diff --git a/cards100/event_96.png b/cards100/event_96.png new file mode 100644 index 0000000..98fb4df Binary files /dev/null and b/cards100/event_96.png differ diff --git a/cards100/event_97.png b/cards100/event_97.png new file mode 100644 index 0000000..eab7e13 Binary files /dev/null and b/cards100/event_97.png differ diff --git a/cards100/event_98.png b/cards100/event_98.png new file mode 100644 index 0000000..af012cd Binary files /dev/null and b/cards100/event_98.png differ diff --git a/cards100/event_99.png b/cards100/event_99.png new file mode 100644 index 0000000..d4ad421 Binary files /dev/null and b/cards100/event_99.png differ diff --git a/cards100/event_back.png b/cards100/event_back.png new file mode 100644 index 0000000..c3dfb6b Binary files /dev/null and b/cards100/event_back.png differ diff --git a/cards100/power_1.png b/cards100/power_1.png new file mode 100644 index 0000000..36d5b6c Binary files /dev/null and b/cards100/power_1.png differ diff --git a/cards100/power_10.png b/cards100/power_10.png new file mode 100644 index 0000000..328d6b1 Binary files /dev/null and b/cards100/power_10.png differ diff --git a/cards100/power_11.png b/cards100/power_11.png new file mode 100644 index 0000000..d2f472a Binary files /dev/null and b/cards100/power_11.png differ diff --git a/cards100/power_12.png b/cards100/power_12.png new file mode 100644 index 0000000..951d0d5 Binary files /dev/null and b/cards100/power_12.png differ diff --git a/cards100/power_13.png b/cards100/power_13.png new file mode 100644 index 0000000..84ff247 Binary files /dev/null and b/cards100/power_13.png differ diff --git a/cards100/power_14.png b/cards100/power_14.png new file mode 100644 index 0000000..bc76c71 Binary files /dev/null and b/cards100/power_14.png differ diff --git a/cards100/power_15.png b/cards100/power_15.png new file mode 100644 index 0000000..ad89b9f Binary files /dev/null and b/cards100/power_15.png differ diff --git a/cards100/power_16.png b/cards100/power_16.png new file mode 100644 index 0000000..5b5bea9 Binary files /dev/null and b/cards100/power_16.png differ diff --git a/cards100/power_17.png b/cards100/power_17.png new file mode 100644 index 0000000..1c59736 Binary files /dev/null and b/cards100/power_17.png differ diff --git a/cards100/power_18.png b/cards100/power_18.png new file mode 100644 index 0000000..620d7fe Binary files /dev/null and b/cards100/power_18.png differ diff --git a/cards100/power_19.png b/cards100/power_19.png new file mode 100644 index 0000000..1597664 Binary files /dev/null and b/cards100/power_19.png differ diff --git a/cards100/power_2.png b/cards100/power_2.png new file mode 100644 index 0000000..d0b22aa Binary files /dev/null and b/cards100/power_2.png differ diff --git a/cards100/power_20.png b/cards100/power_20.png new file mode 100644 index 0000000..5edde2b Binary files /dev/null and b/cards100/power_20.png differ diff --git a/cards100/power_21.png b/cards100/power_21.png new file mode 100644 index 0000000..903b1f3 Binary files /dev/null and b/cards100/power_21.png differ diff --git a/cards100/power_22.png b/cards100/power_22.png new file mode 100644 index 0000000..e3594c6 Binary files /dev/null and b/cards100/power_22.png differ diff --git a/cards100/power_23.png b/cards100/power_23.png new file mode 100644 index 0000000..294582f Binary files /dev/null and b/cards100/power_23.png differ diff --git a/cards100/power_24.png b/cards100/power_24.png new file mode 100644 index 0000000..28266a4 Binary files /dev/null and b/cards100/power_24.png differ diff --git a/cards100/power_25.png b/cards100/power_25.png new file mode 100644 index 0000000..52fa015 Binary files /dev/null and b/cards100/power_25.png differ diff --git a/cards100/power_26.png b/cards100/power_26.png new file mode 100644 index 0000000..e150da5 Binary files /dev/null and b/cards100/power_26.png differ diff --git a/cards100/power_27.png b/cards100/power_27.png new file mode 100644 index 0000000..b249ff4 Binary files /dev/null and b/cards100/power_27.png differ diff --git a/cards100/power_28.png b/cards100/power_28.png new file mode 100644 index 0000000..25f52c7 Binary files /dev/null and b/cards100/power_28.png differ diff --git a/cards100/power_29.png b/cards100/power_29.png new file mode 100644 index 0000000..8448731 Binary files /dev/null and b/cards100/power_29.png differ diff --git a/cards100/power_3.png b/cards100/power_3.png new file mode 100644 index 0000000..3b76698 Binary files /dev/null and b/cards100/power_3.png differ diff --git a/cards100/power_30.png b/cards100/power_30.png new file mode 100644 index 0000000..d507cbb Binary files /dev/null and b/cards100/power_30.png differ diff --git a/cards100/power_31.png b/cards100/power_31.png new file mode 100644 index 0000000..7d839f7 Binary files /dev/null and b/cards100/power_31.png differ diff --git a/cards100/power_32.png b/cards100/power_32.png new file mode 100644 index 0000000..d5f9f8f Binary files /dev/null and b/cards100/power_32.png differ diff --git a/cards100/power_33.png b/cards100/power_33.png new file mode 100644 index 0000000..20ec7ed Binary files /dev/null and b/cards100/power_33.png differ diff --git a/cards100/power_34.png b/cards100/power_34.png new file mode 100644 index 0000000..2eec511 Binary files /dev/null and b/cards100/power_34.png differ diff --git a/cards100/power_35.png b/cards100/power_35.png new file mode 100644 index 0000000..a06db14 Binary files /dev/null and b/cards100/power_35.png differ diff --git a/cards100/power_36.png b/cards100/power_36.png new file mode 100644 index 0000000..9c07e35 Binary files /dev/null and b/cards100/power_36.png differ diff --git a/cards100/power_37.png b/cards100/power_37.png new file mode 100644 index 0000000..ed22a02 Binary files /dev/null and b/cards100/power_37.png differ diff --git a/cards100/power_38.png b/cards100/power_38.png new file mode 100644 index 0000000..f2d19c2 Binary files /dev/null and b/cards100/power_38.png differ diff --git a/cards100/power_39.png b/cards100/power_39.png new file mode 100644 index 0000000..8056a8c Binary files /dev/null and b/cards100/power_39.png differ diff --git a/cards100/power_4.png b/cards100/power_4.png new file mode 100644 index 0000000..898b8a5 Binary files /dev/null and b/cards100/power_4.png differ diff --git a/cards100/power_40.png b/cards100/power_40.png new file mode 100644 index 0000000..1295beb Binary files /dev/null and b/cards100/power_40.png differ diff --git a/cards100/power_41.png b/cards100/power_41.png new file mode 100644 index 0000000..b623ee7 Binary files /dev/null and b/cards100/power_41.png differ diff --git a/cards100/power_42.png b/cards100/power_42.png new file mode 100644 index 0000000..d6e4fc5 Binary files /dev/null and b/cards100/power_42.png differ diff --git a/cards100/power_43.png b/cards100/power_43.png new file mode 100644 index 0000000..42d51e8 Binary files /dev/null and b/cards100/power_43.png differ diff --git a/cards100/power_44.png b/cards100/power_44.png new file mode 100644 index 0000000..cf1405e Binary files /dev/null and b/cards100/power_44.png differ diff --git a/cards100/power_45.png b/cards100/power_45.png new file mode 100644 index 0000000..41a2452 Binary files /dev/null and b/cards100/power_45.png differ diff --git a/cards100/power_46.png b/cards100/power_46.png new file mode 100644 index 0000000..95e6656 Binary files /dev/null and b/cards100/power_46.png differ diff --git a/cards100/power_47.png b/cards100/power_47.png new file mode 100644 index 0000000..f9f61f0 Binary files /dev/null and b/cards100/power_47.png differ diff --git a/cards100/power_48.png b/cards100/power_48.png new file mode 100644 index 0000000..f4383cf Binary files /dev/null and b/cards100/power_48.png differ diff --git a/cards100/power_49.png b/cards100/power_49.png new file mode 100644 index 0000000..62d0af2 Binary files /dev/null and b/cards100/power_49.png differ diff --git a/cards100/power_5.png b/cards100/power_5.png new file mode 100644 index 0000000..8e61d06 Binary files /dev/null and b/cards100/power_5.png differ diff --git a/cards100/power_50.png b/cards100/power_50.png new file mode 100644 index 0000000..ea6b15f Binary files /dev/null and b/cards100/power_50.png differ diff --git a/cards100/power_51.png b/cards100/power_51.png new file mode 100644 index 0000000..102aab0 Binary files /dev/null and b/cards100/power_51.png differ diff --git a/cards100/power_52.png b/cards100/power_52.png new file mode 100644 index 0000000..90865ce Binary files /dev/null and b/cards100/power_52.png differ diff --git a/cards100/power_6.png b/cards100/power_6.png new file mode 100644 index 0000000..70c889b Binary files /dev/null and b/cards100/power_6.png differ diff --git a/cards100/power_7.png b/cards100/power_7.png new file mode 100644 index 0000000..d848d3f Binary files /dev/null and b/cards100/power_7.png differ diff --git a/cards100/power_8.png b/cards100/power_8.png new file mode 100644 index 0000000..1f4f19f Binary files /dev/null and b/cards100/power_8.png differ diff --git a/cards100/power_9.png b/cards100/power_9.png new file mode 100644 index 0000000..f0274ce Binary files /dev/null and b/cards100/power_9.png differ diff --git a/cards100/power_back.png b/cards100/power_back.png new file mode 100644 index 0000000..a5e7824 Binary files /dev/null and b/cards100/power_back.png differ diff --git a/cards200/event_1.png b/cards200/event_1.png new file mode 100644 index 0000000..7be2a30 Binary files /dev/null and b/cards200/event_1.png differ diff --git a/cards200/event_10.png b/cards200/event_10.png new file mode 100644 index 0000000..3f68f6a Binary files /dev/null and b/cards200/event_10.png differ diff --git a/cards200/event_100.png b/cards200/event_100.png new file mode 100644 index 0000000..e1a5362 Binary files /dev/null and b/cards200/event_100.png differ diff --git a/cards200/event_101.png b/cards200/event_101.png new file mode 100644 index 0000000..7bc146c Binary files /dev/null and b/cards200/event_101.png differ diff --git a/cards200/event_102.png b/cards200/event_102.png new file mode 100644 index 0000000..83da244 Binary files /dev/null and b/cards200/event_102.png differ diff --git a/cards200/event_103.png b/cards200/event_103.png new file mode 100644 index 0000000..7da9ba1 Binary files /dev/null and b/cards200/event_103.png differ diff --git a/cards200/event_104.png b/cards200/event_104.png new file mode 100644 index 0000000..180436e Binary files /dev/null and b/cards200/event_104.png differ diff --git a/cards200/event_105.png b/cards200/event_105.png new file mode 100644 index 0000000..1f62151 Binary files /dev/null and b/cards200/event_105.png differ diff --git a/cards200/event_106.png b/cards200/event_106.png new file mode 100644 index 0000000..d6617e6 Binary files /dev/null and b/cards200/event_106.png differ diff --git a/cards200/event_107.png b/cards200/event_107.png new file mode 100644 index 0000000..35e208e Binary files /dev/null and b/cards200/event_107.png differ diff --git a/cards200/event_108.png b/cards200/event_108.png new file mode 100644 index 0000000..e86613b Binary files /dev/null and b/cards200/event_108.png differ diff --git a/cards200/event_109.png b/cards200/event_109.png new file mode 100644 index 0000000..584e1aa Binary files /dev/null and b/cards200/event_109.png differ diff --git a/cards200/event_11.png b/cards200/event_11.png new file mode 100644 index 0000000..90567f9 Binary files /dev/null and b/cards200/event_11.png differ diff --git a/cards200/event_110.png b/cards200/event_110.png new file mode 100644 index 0000000..93c3e81 Binary files /dev/null and b/cards200/event_110.png differ diff --git a/cards200/event_12.png b/cards200/event_12.png new file mode 100644 index 0000000..86ebd53 Binary files /dev/null and b/cards200/event_12.png differ diff --git a/cards200/event_13.png b/cards200/event_13.png new file mode 100644 index 0000000..d2dc40c Binary files /dev/null and b/cards200/event_13.png differ diff --git a/cards200/event_14.png b/cards200/event_14.png new file mode 100644 index 0000000..5b173b5 Binary files /dev/null and b/cards200/event_14.png differ diff --git a/cards200/event_15.png b/cards200/event_15.png new file mode 100644 index 0000000..0d9a87c Binary files /dev/null and b/cards200/event_15.png differ diff --git a/cards200/event_16.png b/cards200/event_16.png new file mode 100644 index 0000000..7703f86 Binary files /dev/null and b/cards200/event_16.png differ diff --git a/cards200/event_17.png b/cards200/event_17.png new file mode 100644 index 0000000..14bd6b5 Binary files /dev/null and b/cards200/event_17.png differ diff --git a/cards200/event_18.png b/cards200/event_18.png new file mode 100644 index 0000000..5d4e50b Binary files /dev/null and b/cards200/event_18.png differ diff --git a/cards200/event_19.png b/cards200/event_19.png new file mode 100644 index 0000000..18f8c42 Binary files /dev/null and b/cards200/event_19.png differ diff --git a/cards200/event_2.png b/cards200/event_2.png new file mode 100644 index 0000000..ffdf5d1 Binary files /dev/null and b/cards200/event_2.png differ diff --git a/cards200/event_20.png b/cards200/event_20.png new file mode 100644 index 0000000..3bc6981 Binary files /dev/null and b/cards200/event_20.png differ diff --git a/cards200/event_21.png b/cards200/event_21.png new file mode 100644 index 0000000..bdf2aad Binary files /dev/null and b/cards200/event_21.png differ diff --git a/cards200/event_22.png b/cards200/event_22.png new file mode 100644 index 0000000..7a473d5 Binary files /dev/null and b/cards200/event_22.png differ diff --git a/cards200/event_23.png b/cards200/event_23.png new file mode 100644 index 0000000..406d6b0 Binary files /dev/null and b/cards200/event_23.png differ diff --git a/cards200/event_24.png b/cards200/event_24.png new file mode 100644 index 0000000..1b2f5e7 Binary files /dev/null and b/cards200/event_24.png differ diff --git a/cards200/event_25.png b/cards200/event_25.png new file mode 100644 index 0000000..b766ce3 Binary files /dev/null and b/cards200/event_25.png differ diff --git a/cards200/event_26.png b/cards200/event_26.png new file mode 100644 index 0000000..f25449f Binary files /dev/null and b/cards200/event_26.png differ diff --git a/cards200/event_27.png b/cards200/event_27.png new file mode 100644 index 0000000..2bbca72 Binary files /dev/null and b/cards200/event_27.png differ diff --git a/cards200/event_28.png b/cards200/event_28.png new file mode 100644 index 0000000..6d93051 Binary files /dev/null and b/cards200/event_28.png differ diff --git a/cards200/event_29.png b/cards200/event_29.png new file mode 100644 index 0000000..4a1d1d8 Binary files /dev/null and b/cards200/event_29.png differ diff --git a/cards200/event_3.png b/cards200/event_3.png new file mode 100644 index 0000000..f2e0367 Binary files /dev/null and b/cards200/event_3.png differ diff --git a/cards200/event_30.png b/cards200/event_30.png new file mode 100644 index 0000000..aa38516 Binary files /dev/null and b/cards200/event_30.png differ diff --git a/cards200/event_31.png b/cards200/event_31.png new file mode 100644 index 0000000..2837385 Binary files /dev/null and b/cards200/event_31.png differ diff --git a/cards200/event_32.png b/cards200/event_32.png new file mode 100644 index 0000000..ad5c601 Binary files /dev/null and b/cards200/event_32.png differ diff --git a/cards200/event_33.png b/cards200/event_33.png new file mode 100644 index 0000000..632c09b Binary files /dev/null and b/cards200/event_33.png differ diff --git a/cards200/event_34.png b/cards200/event_34.png new file mode 100644 index 0000000..fdb5109 Binary files /dev/null and b/cards200/event_34.png differ diff --git a/cards200/event_35.png b/cards200/event_35.png new file mode 100644 index 0000000..9d89816 Binary files /dev/null and b/cards200/event_35.png differ diff --git a/cards200/event_36.png b/cards200/event_36.png new file mode 100644 index 0000000..de38fbf Binary files /dev/null and b/cards200/event_36.png differ diff --git a/cards200/event_37.png b/cards200/event_37.png new file mode 100644 index 0000000..8c20c59 Binary files /dev/null and b/cards200/event_37.png differ diff --git a/cards200/event_38.png b/cards200/event_38.png new file mode 100644 index 0000000..cfa6417 Binary files /dev/null and b/cards200/event_38.png differ diff --git a/cards200/event_39.png b/cards200/event_39.png new file mode 100644 index 0000000..4d2a82b Binary files /dev/null and b/cards200/event_39.png differ diff --git a/cards200/event_4.png b/cards200/event_4.png new file mode 100644 index 0000000..74e0091 Binary files /dev/null and b/cards200/event_4.png differ diff --git a/cards200/event_40.png b/cards200/event_40.png new file mode 100644 index 0000000..69f5ab9 Binary files /dev/null and b/cards200/event_40.png differ diff --git a/cards200/event_41.png b/cards200/event_41.png new file mode 100644 index 0000000..4837400 Binary files /dev/null and b/cards200/event_41.png differ diff --git a/cards200/event_42.png b/cards200/event_42.png new file mode 100644 index 0000000..873d29d Binary files /dev/null and b/cards200/event_42.png differ diff --git a/cards200/event_43.png b/cards200/event_43.png new file mode 100644 index 0000000..c4939cc Binary files /dev/null and b/cards200/event_43.png differ diff --git a/cards200/event_44.png b/cards200/event_44.png new file mode 100644 index 0000000..ba748fa Binary files /dev/null and b/cards200/event_44.png differ diff --git a/cards200/event_45.png b/cards200/event_45.png new file mode 100644 index 0000000..8acc4c4 Binary files /dev/null and b/cards200/event_45.png differ diff --git a/cards200/event_46.png b/cards200/event_46.png new file mode 100644 index 0000000..a4887f5 Binary files /dev/null and b/cards200/event_46.png differ diff --git a/cards200/event_47.png b/cards200/event_47.png new file mode 100644 index 0000000..cd0928f Binary files /dev/null and b/cards200/event_47.png differ diff --git a/cards200/event_48.png b/cards200/event_48.png new file mode 100644 index 0000000..bbe102c Binary files /dev/null and b/cards200/event_48.png differ diff --git a/cards200/event_49.png b/cards200/event_49.png new file mode 100644 index 0000000..3de292d Binary files /dev/null and b/cards200/event_49.png differ diff --git a/cards200/event_5.png b/cards200/event_5.png new file mode 100644 index 0000000..0122a96 Binary files /dev/null and b/cards200/event_5.png differ diff --git a/cards200/event_50.png b/cards200/event_50.png new file mode 100644 index 0000000..9734ecd Binary files /dev/null and b/cards200/event_50.png differ diff --git a/cards200/event_51.png b/cards200/event_51.png new file mode 100644 index 0000000..96d295e Binary files /dev/null and b/cards200/event_51.png differ diff --git a/cards200/event_52.png b/cards200/event_52.png new file mode 100644 index 0000000..dc60078 Binary files /dev/null and b/cards200/event_52.png differ diff --git a/cards200/event_53.png b/cards200/event_53.png new file mode 100644 index 0000000..57305d2 Binary files /dev/null and b/cards200/event_53.png differ diff --git a/cards200/event_54.png b/cards200/event_54.png new file mode 100644 index 0000000..848f730 Binary files /dev/null and b/cards200/event_54.png differ diff --git a/cards200/event_55.png b/cards200/event_55.png new file mode 100644 index 0000000..989b947 Binary files /dev/null and b/cards200/event_55.png differ diff --git a/cards200/event_56.png b/cards200/event_56.png new file mode 100644 index 0000000..fb65a56 Binary files /dev/null and b/cards200/event_56.png differ diff --git a/cards200/event_57.png b/cards200/event_57.png new file mode 100644 index 0000000..d81033c Binary files /dev/null and b/cards200/event_57.png differ diff --git a/cards200/event_58.png b/cards200/event_58.png new file mode 100644 index 0000000..c4a1be5 Binary files /dev/null and b/cards200/event_58.png differ diff --git a/cards200/event_59.png b/cards200/event_59.png new file mode 100644 index 0000000..cc4e42a Binary files /dev/null and b/cards200/event_59.png differ diff --git a/cards200/event_6.png b/cards200/event_6.png new file mode 100644 index 0000000..20211bf Binary files /dev/null and b/cards200/event_6.png differ diff --git a/cards200/event_60.png b/cards200/event_60.png new file mode 100644 index 0000000..8337790 Binary files /dev/null and b/cards200/event_60.png differ diff --git a/cards200/event_61.png b/cards200/event_61.png new file mode 100644 index 0000000..8af7292 Binary files /dev/null and b/cards200/event_61.png differ diff --git a/cards200/event_62.png b/cards200/event_62.png new file mode 100644 index 0000000..fa9481b Binary files /dev/null and b/cards200/event_62.png differ diff --git a/cards200/event_63.png b/cards200/event_63.png new file mode 100644 index 0000000..3f1a60f Binary files /dev/null and b/cards200/event_63.png differ diff --git a/cards200/event_64.png b/cards200/event_64.png new file mode 100644 index 0000000..95ba4f1 Binary files /dev/null and b/cards200/event_64.png differ diff --git a/cards200/event_65.png b/cards200/event_65.png new file mode 100644 index 0000000..2a81eca Binary files /dev/null and b/cards200/event_65.png differ diff --git a/cards200/event_66.png b/cards200/event_66.png new file mode 100644 index 0000000..4a46077 Binary files /dev/null and b/cards200/event_66.png differ diff --git a/cards200/event_67.png b/cards200/event_67.png new file mode 100644 index 0000000..f02fd09 Binary files /dev/null and b/cards200/event_67.png differ diff --git a/cards200/event_68.png b/cards200/event_68.png new file mode 100644 index 0000000..6b20e51 Binary files /dev/null and b/cards200/event_68.png differ diff --git a/cards200/event_69.png b/cards200/event_69.png new file mode 100644 index 0000000..69b5f38 Binary files /dev/null and b/cards200/event_69.png differ diff --git a/cards200/event_7.png b/cards200/event_7.png new file mode 100644 index 0000000..302d6d4 Binary files /dev/null and b/cards200/event_7.png differ diff --git a/cards200/event_70.png b/cards200/event_70.png new file mode 100644 index 0000000..40e0027 Binary files /dev/null and b/cards200/event_70.png differ diff --git a/cards200/event_71.png b/cards200/event_71.png new file mode 100644 index 0000000..ad04c75 Binary files /dev/null and b/cards200/event_71.png differ diff --git a/cards200/event_72.png b/cards200/event_72.png new file mode 100644 index 0000000..12638f7 Binary files /dev/null and b/cards200/event_72.png differ diff --git a/cards200/event_73.png b/cards200/event_73.png new file mode 100644 index 0000000..5913623 Binary files /dev/null and b/cards200/event_73.png differ diff --git a/cards200/event_74.png b/cards200/event_74.png new file mode 100644 index 0000000..a86af12 Binary files /dev/null and b/cards200/event_74.png differ diff --git a/cards200/event_75.png b/cards200/event_75.png new file mode 100644 index 0000000..20a1cd6 Binary files /dev/null and b/cards200/event_75.png differ diff --git a/cards200/event_76.png b/cards200/event_76.png new file mode 100644 index 0000000..686a8d8 Binary files /dev/null and b/cards200/event_76.png differ diff --git a/cards200/event_77.png b/cards200/event_77.png new file mode 100644 index 0000000..d337966 Binary files /dev/null and b/cards200/event_77.png differ diff --git a/cards200/event_78.png b/cards200/event_78.png new file mode 100644 index 0000000..aa319fc Binary files /dev/null and b/cards200/event_78.png differ diff --git a/cards200/event_79.png b/cards200/event_79.png new file mode 100644 index 0000000..d130153 Binary files /dev/null and b/cards200/event_79.png differ diff --git a/cards200/event_8.png b/cards200/event_8.png new file mode 100644 index 0000000..8e86ea3 Binary files /dev/null and b/cards200/event_8.png differ diff --git a/cards200/event_80.png b/cards200/event_80.png new file mode 100644 index 0000000..4ff0b73 Binary files /dev/null and b/cards200/event_80.png differ diff --git a/cards200/event_81.png b/cards200/event_81.png new file mode 100644 index 0000000..b17ee8c Binary files /dev/null and b/cards200/event_81.png differ diff --git a/cards200/event_82.png b/cards200/event_82.png new file mode 100644 index 0000000..e140bc6 Binary files /dev/null and b/cards200/event_82.png differ diff --git a/cards200/event_83.png b/cards200/event_83.png new file mode 100644 index 0000000..cb9b11b Binary files /dev/null and b/cards200/event_83.png differ diff --git a/cards200/event_84.png b/cards200/event_84.png new file mode 100644 index 0000000..57d9de8 Binary files /dev/null and b/cards200/event_84.png differ diff --git a/cards200/event_85.png b/cards200/event_85.png new file mode 100644 index 0000000..b86e0aa Binary files /dev/null and b/cards200/event_85.png differ diff --git a/cards200/event_86.png b/cards200/event_86.png new file mode 100644 index 0000000..4f056b1 Binary files /dev/null and b/cards200/event_86.png differ diff --git a/cards200/event_87.png b/cards200/event_87.png new file mode 100644 index 0000000..bbc7c13 Binary files /dev/null and b/cards200/event_87.png differ diff --git a/cards200/event_88.png b/cards200/event_88.png new file mode 100644 index 0000000..0d87631 Binary files /dev/null and b/cards200/event_88.png differ diff --git a/cards200/event_89.png b/cards200/event_89.png new file mode 100644 index 0000000..115e6a3 Binary files /dev/null and b/cards200/event_89.png differ diff --git a/cards200/event_9.png b/cards200/event_9.png new file mode 100644 index 0000000..15b9c4f Binary files /dev/null and b/cards200/event_9.png differ diff --git a/cards200/event_90.png b/cards200/event_90.png new file mode 100644 index 0000000..a5c07a0 Binary files /dev/null and b/cards200/event_90.png differ diff --git a/cards200/event_91.png b/cards200/event_91.png new file mode 100644 index 0000000..429f0f0 Binary files /dev/null and b/cards200/event_91.png differ diff --git a/cards200/event_92.png b/cards200/event_92.png new file mode 100644 index 0000000..dd1f186 Binary files /dev/null and b/cards200/event_92.png differ diff --git a/cards200/event_93.png b/cards200/event_93.png new file mode 100644 index 0000000..1bca777 Binary files /dev/null and b/cards200/event_93.png differ diff --git a/cards200/event_94.png b/cards200/event_94.png new file mode 100644 index 0000000..e425fb0 Binary files /dev/null and b/cards200/event_94.png differ diff --git a/cards200/event_95.png b/cards200/event_95.png new file mode 100644 index 0000000..9497cc6 Binary files /dev/null and b/cards200/event_95.png differ diff --git a/cards200/event_96.png b/cards200/event_96.png new file mode 100644 index 0000000..1e3066b Binary files /dev/null and b/cards200/event_96.png differ diff --git a/cards200/event_97.png b/cards200/event_97.png new file mode 100644 index 0000000..b79aa4d Binary files /dev/null and b/cards200/event_97.png differ diff --git a/cards200/event_98.png b/cards200/event_98.png new file mode 100644 index 0000000..5727c79 Binary files /dev/null and b/cards200/event_98.png differ diff --git a/cards200/event_99.png b/cards200/event_99.png new file mode 100644 index 0000000..404e4f4 Binary files /dev/null and b/cards200/event_99.png differ diff --git a/cards200/event_back.png b/cards200/event_back.png new file mode 100644 index 0000000..957b0c3 Binary files /dev/null and b/cards200/event_back.png differ diff --git a/cards200/power_1.png b/cards200/power_1.png new file mode 100644 index 0000000..98df73d Binary files /dev/null and b/cards200/power_1.png differ diff --git a/cards200/power_10.png b/cards200/power_10.png new file mode 100644 index 0000000..08fb78a Binary files /dev/null and b/cards200/power_10.png differ diff --git a/cards200/power_11.png b/cards200/power_11.png new file mode 100644 index 0000000..bb1aeb9 Binary files /dev/null and b/cards200/power_11.png differ diff --git a/cards200/power_12.png b/cards200/power_12.png new file mode 100644 index 0000000..e652055 Binary files /dev/null and b/cards200/power_12.png differ diff --git a/cards200/power_13.png b/cards200/power_13.png new file mode 100644 index 0000000..64dcf8c Binary files /dev/null and b/cards200/power_13.png differ diff --git a/cards200/power_14.png b/cards200/power_14.png new file mode 100644 index 0000000..37f9973 Binary files /dev/null and b/cards200/power_14.png differ diff --git a/cards200/power_15.png b/cards200/power_15.png new file mode 100644 index 0000000..cbd9b1a Binary files /dev/null and b/cards200/power_15.png differ diff --git a/cards200/power_16.png b/cards200/power_16.png new file mode 100644 index 0000000..9d1f46e Binary files /dev/null and b/cards200/power_16.png differ diff --git a/cards200/power_17.png b/cards200/power_17.png new file mode 100644 index 0000000..e544d7b Binary files /dev/null and b/cards200/power_17.png differ diff --git a/cards200/power_18.png b/cards200/power_18.png new file mode 100644 index 0000000..abcd13d Binary files /dev/null and b/cards200/power_18.png differ diff --git a/cards200/power_19.png b/cards200/power_19.png new file mode 100644 index 0000000..f3ddd37 Binary files /dev/null and b/cards200/power_19.png differ diff --git a/cards200/power_2.png b/cards200/power_2.png new file mode 100644 index 0000000..3faccb9 Binary files /dev/null and b/cards200/power_2.png differ diff --git a/cards200/power_20.png b/cards200/power_20.png new file mode 100644 index 0000000..b3fcc80 Binary files /dev/null and b/cards200/power_20.png differ diff --git a/cards200/power_21.png b/cards200/power_21.png new file mode 100644 index 0000000..18745bb Binary files /dev/null and b/cards200/power_21.png differ diff --git a/cards200/power_22.png b/cards200/power_22.png new file mode 100644 index 0000000..911feb6 Binary files /dev/null and b/cards200/power_22.png differ diff --git a/cards200/power_23.png b/cards200/power_23.png new file mode 100644 index 0000000..6036935 Binary files /dev/null and b/cards200/power_23.png differ diff --git a/cards200/power_24.png b/cards200/power_24.png new file mode 100644 index 0000000..956509d Binary files /dev/null and b/cards200/power_24.png differ diff --git a/cards200/power_25.png b/cards200/power_25.png new file mode 100644 index 0000000..203f104 Binary files /dev/null and b/cards200/power_25.png differ diff --git a/cards200/power_26.png b/cards200/power_26.png new file mode 100644 index 0000000..6a82872 Binary files /dev/null and b/cards200/power_26.png differ diff --git a/cards200/power_27.png b/cards200/power_27.png new file mode 100644 index 0000000..0df4d7b Binary files /dev/null and b/cards200/power_27.png differ diff --git a/cards200/power_28.png b/cards200/power_28.png new file mode 100644 index 0000000..897885d Binary files /dev/null and b/cards200/power_28.png differ diff --git a/cards200/power_29.png b/cards200/power_29.png new file mode 100644 index 0000000..3354196 Binary files /dev/null and b/cards200/power_29.png differ diff --git a/cards200/power_3.png b/cards200/power_3.png new file mode 100644 index 0000000..8fcc32a Binary files /dev/null and b/cards200/power_3.png differ diff --git a/cards200/power_30.png b/cards200/power_30.png new file mode 100644 index 0000000..9cb9e20 Binary files /dev/null and b/cards200/power_30.png differ diff --git a/cards200/power_31.png b/cards200/power_31.png new file mode 100644 index 0000000..520f67e Binary files /dev/null and b/cards200/power_31.png differ diff --git a/cards200/power_32.png b/cards200/power_32.png new file mode 100644 index 0000000..28e75ae Binary files /dev/null and b/cards200/power_32.png differ diff --git a/cards200/power_33.png b/cards200/power_33.png new file mode 100644 index 0000000..0d331ee Binary files /dev/null and b/cards200/power_33.png differ diff --git a/cards200/power_34.png b/cards200/power_34.png new file mode 100644 index 0000000..ef35663 Binary files /dev/null and b/cards200/power_34.png differ diff --git a/cards200/power_35.png b/cards200/power_35.png new file mode 100644 index 0000000..840b53a Binary files /dev/null and b/cards200/power_35.png differ diff --git a/cards200/power_36.png b/cards200/power_36.png new file mode 100644 index 0000000..a67f287 Binary files /dev/null and b/cards200/power_36.png differ diff --git a/cards200/power_37.png b/cards200/power_37.png new file mode 100644 index 0000000..e851e20 Binary files /dev/null and b/cards200/power_37.png differ diff --git a/cards200/power_38.png b/cards200/power_38.png new file mode 100644 index 0000000..3af1ece Binary files /dev/null and b/cards200/power_38.png differ diff --git a/cards200/power_39.png b/cards200/power_39.png new file mode 100644 index 0000000..750f30a Binary files /dev/null and b/cards200/power_39.png differ diff --git a/cards200/power_4.png b/cards200/power_4.png new file mode 100644 index 0000000..e483d3d Binary files /dev/null and b/cards200/power_4.png differ diff --git a/cards200/power_40.png b/cards200/power_40.png new file mode 100644 index 0000000..2cc4006 Binary files /dev/null and b/cards200/power_40.png differ diff --git a/cards200/power_41.png b/cards200/power_41.png new file mode 100644 index 0000000..e07b7d0 Binary files /dev/null and b/cards200/power_41.png differ diff --git a/cards200/power_42.png b/cards200/power_42.png new file mode 100644 index 0000000..c8f4383 Binary files /dev/null and b/cards200/power_42.png differ diff --git a/cards200/power_43.png b/cards200/power_43.png new file mode 100644 index 0000000..992e747 Binary files /dev/null and b/cards200/power_43.png differ diff --git a/cards200/power_44.png b/cards200/power_44.png new file mode 100644 index 0000000..0e0fb0d Binary files /dev/null and b/cards200/power_44.png differ diff --git a/cards200/power_45.png b/cards200/power_45.png new file mode 100644 index 0000000..3906296 Binary files /dev/null and b/cards200/power_45.png differ diff --git a/cards200/power_46.png b/cards200/power_46.png new file mode 100644 index 0000000..9364156 Binary files /dev/null and b/cards200/power_46.png differ diff --git a/cards200/power_47.png b/cards200/power_47.png new file mode 100644 index 0000000..9c38e9f Binary files /dev/null and b/cards200/power_47.png differ diff --git a/cards200/power_48.png b/cards200/power_48.png new file mode 100644 index 0000000..0eea0e3 Binary files /dev/null and b/cards200/power_48.png differ diff --git a/cards200/power_49.png b/cards200/power_49.png new file mode 100644 index 0000000..3b0cc9a Binary files /dev/null and b/cards200/power_49.png differ diff --git a/cards200/power_5.png b/cards200/power_5.png new file mode 100644 index 0000000..31c0dfc Binary files /dev/null and b/cards200/power_5.png differ diff --git a/cards200/power_50.png b/cards200/power_50.png new file mode 100644 index 0000000..4cdd3b2 Binary files /dev/null and b/cards200/power_50.png differ diff --git a/cards200/power_51.png b/cards200/power_51.png new file mode 100644 index 0000000..8b5a0ff Binary files /dev/null and b/cards200/power_51.png differ diff --git a/cards200/power_52.png b/cards200/power_52.png new file mode 100644 index 0000000..d1d8f32 Binary files /dev/null and b/cards200/power_52.png differ diff --git a/cards200/power_6.png b/cards200/power_6.png new file mode 100644 index 0000000..3e63fb4 Binary files /dev/null and b/cards200/power_6.png differ diff --git a/cards200/power_7.png b/cards200/power_7.png new file mode 100644 index 0000000..aee9613 Binary files /dev/null and b/cards200/power_7.png differ diff --git a/cards200/power_8.png b/cards200/power_8.png new file mode 100644 index 0000000..4dff234 Binary files /dev/null and b/cards200/power_8.png differ diff --git a/cards200/power_9.png b/cards200/power_9.png new file mode 100644 index 0000000..beffaad Binary files /dev/null and b/cards200/power_9.png differ diff --git a/cards200/power_back.png b/cards200/power_back.png new file mode 100644 index 0000000..ad32921 Binary files /dev/null and b/cards200/power_back.png differ diff --git a/map150.png b/map150.png new file mode 100644 index 0000000..519f917 Binary files /dev/null and b/map150.png differ diff --git a/map75.png b/map75.png new file mode 100644 index 0000000..16e8039 Binary files /dev/null and b/map75.png differ diff --git a/markers150/action_round_blue.png b/markers150/action_round_blue.png new file mode 100644 index 0000000..2ab6ee6 Binary files /dev/null and b/markers150/action_round_blue.png differ diff --git a/markers150/action_round_red.png b/markers150/action_round_red.png new file mode 100644 index 0000000..7a23d51 Binary files /dev/null and b/markers150/action_round_red.png differ diff --git a/markers150/cc1.png b/markers150/cc1.png new file mode 100644 index 0000000..b066664 Binary files /dev/null and b/markers150/cc1.png differ diff --git a/markers150/cc2.png b/markers150/cc2.png new file mode 100644 index 0000000..d08a3ca Binary files /dev/null and b/markers150/cc2.png differ diff --git a/markers150/cc3.png b/markers150/cc3.png new file mode 100644 index 0000000..f048a77 Binary files /dev/null and b/markers150/cc3.png differ diff --git a/markers150/cc4.png b/markers150/cc4.png new file mode 100644 index 0000000..d06eda7 Binary files /dev/null and b/markers150/cc4.png differ diff --git a/markers150/cc5.png b/markers150/cc5.png new file mode 100644 index 0000000..18beae4 Binary files /dev/null and b/markers150/cc5.png differ diff --git a/markers150/cc6.png b/markers150/cc6.png new file mode 100644 index 0000000..9d6bbf1 Binary files /dev/null and b/markers150/cc6.png differ diff --git a/markers150/cc7.png b/markers150/cc7.png new file mode 100644 index 0000000..7ffb6dd Binary files /dev/null and b/markers150/cc7.png differ diff --git a/markers150/cc8.png b/markers150/cc8.png new file mode 100644 index 0000000..dc8e215 Binary files /dev/null and b/markers150/cc8.png differ diff --git a/markers150/ci1.png b/markers150/ci1.png new file mode 100644 index 0000000..df07eda Binary files /dev/null and b/markers150/ci1.png differ diff --git a/markers150/ci2.png b/markers150/ci2.png new file mode 100644 index 0000000..e09141a Binary files /dev/null and b/markers150/ci2.png differ diff --git a/markers150/ci3.png b/markers150/ci3.png new file mode 100644 index 0000000..801004c Binary files /dev/null and b/markers150/ci3.png differ diff --git a/markers150/ci4.png b/markers150/ci4.png new file mode 100644 index 0000000..845ca2d Binary files /dev/null and b/markers150/ci4.png differ diff --git a/markers150/ci5.png b/markers150/ci5.png new file mode 100644 index 0000000..a23d874 Binary files /dev/null and b/markers150/ci5.png differ diff --git a/markers150/ci6.png b/markers150/ci6.png new file mode 100644 index 0000000..4c0b78e Binary files /dev/null and b/markers150/ci6.png differ diff --git a/markers150/ci7.png b/markers150/ci7.png new file mode 100644 index 0000000..6e3349b Binary files /dev/null and b/markers150/ci7.png differ diff --git a/markers150/ci8.png b/markers150/ci8.png new file mode 100644 index 0000000..9e15dd3 Binary files /dev/null and b/markers150/ci8.png differ diff --git a/markers150/dc1.png b/markers150/dc1.png new file mode 100644 index 0000000..75c14ba Binary files /dev/null and b/markers150/dc1.png differ diff --git a/markers150/dc2.png b/markers150/dc2.png new file mode 100644 index 0000000..17c18cb Binary files /dev/null and b/markers150/dc2.png differ diff --git a/markers150/dc3.png b/markers150/dc3.png new file mode 100644 index 0000000..35b2a53 Binary files /dev/null and b/markers150/dc3.png differ diff --git a/markers150/dc4.png b/markers150/dc4.png new file mode 100644 index 0000000..9f7fb0d Binary files /dev/null and b/markers150/dc4.png differ diff --git a/markers150/dc5.png b/markers150/dc5.png new file mode 100644 index 0000000..d2c3cfc Binary files /dev/null and b/markers150/dc5.png differ diff --git a/markers150/dc6.png b/markers150/dc6.png new file mode 100644 index 0000000..0529d96 Binary files /dev/null and b/markers150/dc6.png differ diff --git a/markers150/dc7.png b/markers150/dc7.png new file mode 100644 index 0000000..af3169f Binary files /dev/null and b/markers150/dc7.png differ diff --git a/markers150/dc8.png b/markers150/dc8.png new file mode 100644 index 0000000..c6386c8 Binary files /dev/null and b/markers150/dc8.png differ diff --git a/markers150/di1.png b/markers150/di1.png new file mode 100644 index 0000000..54cc37f Binary files /dev/null and b/markers150/di1.png differ diff --git a/markers150/di2.png b/markers150/di2.png new file mode 100644 index 0000000..07a8d64 Binary files /dev/null and b/markers150/di2.png differ diff --git a/markers150/di3.png b/markers150/di3.png new file mode 100644 index 0000000..784d95f Binary files /dev/null and b/markers150/di3.png differ diff --git a/markers150/di4.png b/markers150/di4.png new file mode 100644 index 0000000..41ca0c7 Binary files /dev/null and b/markers150/di4.png differ diff --git a/markers150/di5.png b/markers150/di5.png new file mode 100644 index 0000000..fe3d524 Binary files /dev/null and b/markers150/di5.png differ diff --git a/markers150/di6.png b/markers150/di6.png new file mode 100644 index 0000000..9b16c9e Binary files /dev/null and b/markers150/di6.png differ diff --git a/markers150/di7.png b/markers150/di7.png new file mode 100644 index 0000000..07f6b9a Binary files /dev/null and b/markers150/di7.png differ diff --git a/markers150/di8.png b/markers150/di8.png new file mode 100644 index 0000000..1febae2 Binary files /dev/null and b/markers150/di8.png differ diff --git a/markers150/event_austria_hungary.png b/markers150/event_austria_hungary.png new file mode 100644 index 0000000..c602b45 Binary files /dev/null and b/markers150/event_austria_hungary.png differ diff --git a/markers150/event_eco_glasnost.png b/markers150/event_eco_glasnost.png new file mode 100644 index 0000000..96c2626 Binary files /dev/null and b/markers150/event_eco_glasnost.png differ diff --git a/markers150/event_elena.png b/markers150/event_elena.png new file mode 100644 index 0000000..5fc979e Binary files /dev/null and b/markers150/event_elena.png differ diff --git a/markers150/event_foreign_currency.png b/markers150/event_foreign_currency.png new file mode 100644 index 0000000..d15b9d8 Binary files /dev/null and b/markers150/event_foreign_currency.png differ diff --git a/markers150/event_grenz_truppen.png b/markers150/event_grenz_truppen.png new file mode 100644 index 0000000..87c1e7b Binary files /dev/null and b/markers150/event_grenz_truppen.png differ diff --git a/markers150/event_helsinki.png b/markers150/event_helsinki.png new file mode 100644 index 0000000..bc492e5 Binary files /dev/null and b/markers150/event_helsinki.png differ diff --git a/markers150/event_honecker.png b/markers150/event_honecker.png new file mode 100644 index 0000000..10441d1 Binary files /dev/null and b/markers150/event_honecker.png differ diff --git a/markers150/event_laszlo_tokes.png b/markers150/event_laszlo_tokes.png new file mode 100644 index 0000000..7670260 Binary files /dev/null and b/markers150/event_laszlo_tokes.png differ diff --git a/markers150/event_li_peng.png b/markers150/event_li_peng.png new file mode 100644 index 0000000..cfa2a0c Binary files /dev/null and b/markers150/event_li_peng.png differ diff --git a/markers150/event_nye_party.png b/markers150/event_nye_party.png new file mode 100644 index 0000000..c8cb309 Binary files /dev/null and b/markers150/event_nye_party.png differ diff --git a/markers150/event_pres_visit.png b/markers150/event_pres_visit.png new file mode 100644 index 0000000..679f98f Binary files /dev/null and b/markers150/event_pres_visit.png differ diff --git a/markers150/event_securitate.png b/markers150/event_securitate.png new file mode 100644 index 0000000..58a0216 Binary files /dev/null and b/markers150/event_securitate.png differ diff --git a/markers150/event_solidarity_legalized.png b/markers150/event_solidarity_legalized.png new file mode 100644 index 0000000..fd54f11 Binary files /dev/null and b/markers150/event_solidarity_legalized.png differ diff --git a/markers150/event_st_nicholas.png b/markers150/event_st_nicholas.png new file mode 100644 index 0000000..211c89c Binary files /dev/null and b/markers150/event_st_nicholas.png differ diff --git a/markers150/event_stand_fast.png b/markers150/event_stand_fast.png new file mode 100644 index 0000000..83bc3a4 Binary files /dev/null and b/markers150/event_stand_fast.png differ diff --git a/markers150/event_systematization.png b/markers150/event_systematization.png new file mode 100644 index 0000000..985e3df Binary files /dev/null and b/markers150/event_systematization.png differ diff --git a/markers150/event_the_wall.png b/markers150/event_the_wall.png new file mode 100644 index 0000000..e1c9ec9 Binary files /dev/null and b/markers150/event_the_wall.png differ diff --git a/markers150/event_tyrant.png b/markers150/event_tyrant.png new file mode 100644 index 0000000..acf3859 Binary files /dev/null and b/markers150/event_tyrant.png differ diff --git a/markers150/event_we_are_the_people.png b/markers150/event_we_are_the_people.png new file mode 100644 index 0000000..b1df70b Binary files /dev/null and b/markers150/event_we_are_the_people.png differ diff --git a/markers150/ts_blue.png b/markers150/ts_blue.png new file mode 100644 index 0000000..7a62a65 Binary files /dev/null and b/markers150/ts_blue.png differ diff --git a/markers150/ts_blue_back.png b/markers150/ts_blue_back.png new file mode 100644 index 0000000..6c8816e Binary files /dev/null and b/markers150/ts_blue_back.png differ diff --git a/markers150/ts_red.png b/markers150/ts_red.png new file mode 100644 index 0000000..63279de Binary files /dev/null and b/markers150/ts_red.png differ diff --git a/markers150/ts_red_back.png b/markers150/ts_red_back.png new file mode 100644 index 0000000..a97a9f4 Binary files /dev/null and b/markers150/ts_red_back.png differ diff --git a/markers150/turn.png b/markers150/turn.png new file mode 100644 index 0000000..22ec78d Binary files /dev/null and b/markers150/turn.png differ diff --git a/markers150/ussr_stability_track.png b/markers150/ussr_stability_track.png new file mode 100644 index 0000000..5d3914f Binary files /dev/null and b/markers150/ussr_stability_track.png differ diff --git a/markers150/vp.png b/markers150/vp.png new file mode 100644 index 0000000..2f0acf6 Binary files /dev/null and b/markers150/vp.png differ diff --git a/markers75/action_round_blue.png b/markers75/action_round_blue.png new file mode 100644 index 0000000..56f4280 Binary files /dev/null and b/markers75/action_round_blue.png differ diff --git a/markers75/action_round_red.png b/markers75/action_round_red.png new file mode 100644 index 0000000..66a2d12 Binary files /dev/null and b/markers75/action_round_red.png differ diff --git a/markers75/cc1.png b/markers75/cc1.png new file mode 100644 index 0000000..2b3fbec Binary files /dev/null and b/markers75/cc1.png differ diff --git a/markers75/cc2.png b/markers75/cc2.png new file mode 100644 index 0000000..c3075cb Binary files /dev/null and b/markers75/cc2.png differ diff --git a/markers75/cc3.png b/markers75/cc3.png new file mode 100644 index 0000000..41834ed Binary files /dev/null and b/markers75/cc3.png differ diff --git a/markers75/cc4.png b/markers75/cc4.png new file mode 100644 index 0000000..f846108 Binary files /dev/null and b/markers75/cc4.png differ diff --git a/markers75/cc5.png b/markers75/cc5.png new file mode 100644 index 0000000..9d85631 Binary files /dev/null and b/markers75/cc5.png differ diff --git a/markers75/cc6.png b/markers75/cc6.png new file mode 100644 index 0000000..88ec980 Binary files /dev/null and b/markers75/cc6.png differ diff --git a/markers75/cc7.png b/markers75/cc7.png new file mode 100644 index 0000000..e2d3c6e Binary files /dev/null and b/markers75/cc7.png differ diff --git a/markers75/cc8.png b/markers75/cc8.png new file mode 100644 index 0000000..53bf846 Binary files /dev/null and b/markers75/cc8.png differ diff --git a/markers75/ci1.png b/markers75/ci1.png new file mode 100644 index 0000000..51d682a Binary files /dev/null and b/markers75/ci1.png differ diff --git a/markers75/ci2.png b/markers75/ci2.png new file mode 100644 index 0000000..b7c6b45 Binary files /dev/null and b/markers75/ci2.png differ diff --git a/markers75/ci3.png b/markers75/ci3.png new file mode 100644 index 0000000..5e18c21 Binary files /dev/null and b/markers75/ci3.png differ diff --git a/markers75/ci4.png b/markers75/ci4.png new file mode 100644 index 0000000..a75ffae Binary files /dev/null and b/markers75/ci4.png differ diff --git a/markers75/ci5.png b/markers75/ci5.png new file mode 100644 index 0000000..e41c4cc Binary files /dev/null and b/markers75/ci5.png differ diff --git a/markers75/ci6.png b/markers75/ci6.png new file mode 100644 index 0000000..35b68a6 Binary files /dev/null and b/markers75/ci6.png differ diff --git a/markers75/ci7.png b/markers75/ci7.png new file mode 100644 index 0000000..70329c5 Binary files /dev/null and b/markers75/ci7.png differ diff --git a/markers75/ci8.png b/markers75/ci8.png new file mode 100644 index 0000000..3f5b63d Binary files /dev/null and b/markers75/ci8.png differ diff --git a/markers75/dc1.png b/markers75/dc1.png new file mode 100644 index 0000000..11cfc08 Binary files /dev/null and b/markers75/dc1.png differ diff --git a/markers75/dc2.png b/markers75/dc2.png new file mode 100644 index 0000000..935e68e Binary files /dev/null and b/markers75/dc2.png differ diff --git a/markers75/dc3.png b/markers75/dc3.png new file mode 100644 index 0000000..c3f1ccf Binary files /dev/null and b/markers75/dc3.png differ diff --git a/markers75/dc4.png b/markers75/dc4.png new file mode 100644 index 0000000..cb84692 Binary files /dev/null and b/markers75/dc4.png differ diff --git a/markers75/dc5.png b/markers75/dc5.png new file mode 100644 index 0000000..98c47ed Binary files /dev/null and b/markers75/dc5.png differ diff --git a/markers75/dc6.png b/markers75/dc6.png new file mode 100644 index 0000000..c2b4926 Binary files /dev/null and b/markers75/dc6.png differ diff --git a/markers75/dc7.png b/markers75/dc7.png new file mode 100644 index 0000000..c8a8a0e Binary files /dev/null and b/markers75/dc7.png differ diff --git a/markers75/dc8.png b/markers75/dc8.png new file mode 100644 index 0000000..5ce0325 Binary files /dev/null and b/markers75/dc8.png differ diff --git a/markers75/di1.png b/markers75/di1.png new file mode 100644 index 0000000..82554e5 Binary files /dev/null and b/markers75/di1.png differ diff --git a/markers75/di2.png b/markers75/di2.png new file mode 100644 index 0000000..f258382 Binary files /dev/null and b/markers75/di2.png differ diff --git a/markers75/di3.png b/markers75/di3.png new file mode 100644 index 0000000..15dd714 Binary files /dev/null and b/markers75/di3.png differ diff --git a/markers75/di4.png b/markers75/di4.png new file mode 100644 index 0000000..5bfaf95 Binary files /dev/null and b/markers75/di4.png differ diff --git a/markers75/di5.png b/markers75/di5.png new file mode 100644 index 0000000..0ca28da Binary files /dev/null and b/markers75/di5.png differ diff --git a/markers75/di6.png b/markers75/di6.png new file mode 100644 index 0000000..699efe3 Binary files /dev/null and b/markers75/di6.png differ diff --git a/markers75/di7.png b/markers75/di7.png new file mode 100644 index 0000000..fa2a21d Binary files /dev/null and b/markers75/di7.png differ diff --git a/markers75/di8.png b/markers75/di8.png new file mode 100644 index 0000000..055a95a Binary files /dev/null and b/markers75/di8.png differ diff --git a/markers75/event_austria_hungary.png b/markers75/event_austria_hungary.png new file mode 100644 index 0000000..b60b337 Binary files /dev/null and b/markers75/event_austria_hungary.png differ diff --git a/markers75/event_eco_glasnost.png b/markers75/event_eco_glasnost.png new file mode 100644 index 0000000..cfcfb19 Binary files /dev/null and b/markers75/event_eco_glasnost.png differ diff --git a/markers75/event_elena.png b/markers75/event_elena.png new file mode 100644 index 0000000..f9fc450 Binary files /dev/null and b/markers75/event_elena.png differ diff --git a/markers75/event_foreign_currency.png b/markers75/event_foreign_currency.png new file mode 100644 index 0000000..f19435a Binary files /dev/null and b/markers75/event_foreign_currency.png differ diff --git a/markers75/event_grenz_truppen.png b/markers75/event_grenz_truppen.png new file mode 100644 index 0000000..2bfe9b2 Binary files /dev/null and b/markers75/event_grenz_truppen.png differ diff --git a/markers75/event_helsinki.png b/markers75/event_helsinki.png new file mode 100644 index 0000000..18db1a7 Binary files /dev/null and b/markers75/event_helsinki.png differ diff --git a/markers75/event_honecker.png b/markers75/event_honecker.png new file mode 100644 index 0000000..72e2261 Binary files /dev/null and b/markers75/event_honecker.png differ diff --git a/markers75/event_laszlo_tokes.png b/markers75/event_laszlo_tokes.png new file mode 100644 index 0000000..33d5dfe Binary files /dev/null and b/markers75/event_laszlo_tokes.png differ diff --git a/markers75/event_li_peng.png b/markers75/event_li_peng.png new file mode 100644 index 0000000..f864423 Binary files /dev/null and b/markers75/event_li_peng.png differ diff --git a/markers75/event_nye_party.png b/markers75/event_nye_party.png new file mode 100644 index 0000000..bf2ff1a Binary files /dev/null and b/markers75/event_nye_party.png differ diff --git a/markers75/event_pres_visit.png b/markers75/event_pres_visit.png new file mode 100644 index 0000000..a80cff9 Binary files /dev/null and b/markers75/event_pres_visit.png differ diff --git a/markers75/event_securitate.png b/markers75/event_securitate.png new file mode 100644 index 0000000..516c1f5 Binary files /dev/null and b/markers75/event_securitate.png differ diff --git a/markers75/event_solidarity_legalized.png b/markers75/event_solidarity_legalized.png new file mode 100644 index 0000000..6ff8e69 Binary files /dev/null and b/markers75/event_solidarity_legalized.png differ diff --git a/markers75/event_st_nicholas.png b/markers75/event_st_nicholas.png new file mode 100644 index 0000000..43294f7 Binary files /dev/null and b/markers75/event_st_nicholas.png differ diff --git a/markers75/event_stand_fast.png b/markers75/event_stand_fast.png new file mode 100644 index 0000000..c51c758 Binary files /dev/null and b/markers75/event_stand_fast.png differ diff --git a/markers75/event_systematization.png b/markers75/event_systematization.png new file mode 100644 index 0000000..5ee1fc7 Binary files /dev/null and b/markers75/event_systematization.png differ diff --git a/markers75/event_the_wall.png b/markers75/event_the_wall.png new file mode 100644 index 0000000..0108f00 Binary files /dev/null and b/markers75/event_the_wall.png differ diff --git a/markers75/event_tyrant.png b/markers75/event_tyrant.png new file mode 100644 index 0000000..37807ce Binary files /dev/null and b/markers75/event_tyrant.png differ diff --git a/markers75/event_we_are_the_people.png b/markers75/event_we_are_the_people.png new file mode 100644 index 0000000..afbde45 Binary files /dev/null and b/markers75/event_we_are_the_people.png differ diff --git a/markers75/ts_blue.png b/markers75/ts_blue.png new file mode 100644 index 0000000..2262d0c Binary files /dev/null and b/markers75/ts_blue.png differ diff --git a/markers75/ts_blue_back.png b/markers75/ts_blue_back.png new file mode 100644 index 0000000..489b847 Binary files /dev/null and b/markers75/ts_blue_back.png differ diff --git a/markers75/ts_red.png b/markers75/ts_red.png new file mode 100644 index 0000000..ae690bc Binary files /dev/null and b/markers75/ts_red.png differ diff --git a/markers75/ts_red_back.png b/markers75/ts_red_back.png new file mode 100644 index 0000000..001fb60 Binary files /dev/null and b/markers75/ts_red_back.png differ diff --git a/markers75/turn.png b/markers75/turn.png new file mode 100644 index 0000000..bf88f48 Binary files /dev/null and b/markers75/turn.png differ diff --git a/markers75/ussr_stability_track.png b/markers75/ussr_stability_track.png new file mode 100644 index 0000000..b7b88ea Binary files /dev/null and b/markers75/ussr_stability_track.png differ diff --git a/markers75/vp.png b/markers75/vp.png new file mode 100644 index 0000000..1f4217b Binary files /dev/null and b/markers75/vp.png differ -- cgit v1.2.3 From 7122c8101e49300b7e29266a939f355e9eb8ffd3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 23:50:19 +0200 Subject: OFFICIAL ASSETS - LOSSY (WEBP + JPEG) cards 100 - webp q85 cards 200 - webp q60 map75 - jpegli d2 map150 - mozjpeg default --- cards100/event_1.webp | Bin 0 -> 12636 bytes cards100/event_10.webp | Bin 0 -> 13494 bytes cards100/event_100.webp | Bin 0 -> 15370 bytes cards100/event_101.webp | Bin 0 -> 14638 bytes cards100/event_102.webp | Bin 0 -> 18222 bytes cards100/event_103.webp | Bin 0 -> 13502 bytes cards100/event_104.webp | Bin 0 -> 22266 bytes cards100/event_105.webp | Bin 0 -> 13408 bytes cards100/event_106.webp | Bin 0 -> 15728 bytes cards100/event_107.webp | Bin 0 -> 21704 bytes cards100/event_108.webp | Bin 0 -> 12730 bytes cards100/event_109.webp | Bin 0 -> 19910 bytes cards100/event_11.webp | Bin 0 -> 11164 bytes cards100/event_110.webp | Bin 0 -> 16400 bytes cards100/event_12.webp | Bin 0 -> 11730 bytes cards100/event_13.webp | Bin 0 -> 11840 bytes cards100/event_14.webp | Bin 0 -> 15016 bytes cards100/event_15.webp | Bin 0 -> 15512 bytes cards100/event_16.webp | Bin 0 -> 18432 bytes cards100/event_17.webp | Bin 0 -> 21604 bytes cards100/event_18.webp | Bin 0 -> 18034 bytes cards100/event_19.webp | Bin 0 -> 21442 bytes cards100/event_2.webp | Bin 0 -> 16970 bytes cards100/event_20.webp | Bin 0 -> 16270 bytes cards100/event_21.webp | Bin 0 -> 14340 bytes cards100/event_22.webp | Bin 0 -> 20670 bytes cards100/event_23.webp | Bin 0 -> 11554 bytes cards100/event_24.webp | Bin 0 -> 14884 bytes cards100/event_25.webp | Bin 0 -> 10078 bytes cards100/event_26.webp | Bin 0 -> 16412 bytes cards100/event_27.webp | Bin 0 -> 13336 bytes cards100/event_28.webp | Bin 0 -> 13738 bytes cards100/event_29.webp | Bin 0 -> 14200 bytes cards100/event_3.webp | Bin 0 -> 15042 bytes cards100/event_30.webp | Bin 0 -> 12188 bytes cards100/event_31.webp | Bin 0 -> 11286 bytes cards100/event_32.webp | Bin 0 -> 15700 bytes cards100/event_33.webp | Bin 0 -> 12710 bytes cards100/event_34.webp | Bin 0 -> 8704 bytes cards100/event_35.webp | Bin 0 -> 16288 bytes cards100/event_36.webp | Bin 0 -> 19860 bytes cards100/event_37.webp | Bin 0 -> 17518 bytes cards100/event_38.webp | Bin 0 -> 12192 bytes cards100/event_39.webp | Bin 0 -> 8782 bytes cards100/event_4.webp | Bin 0 -> 12420 bytes cards100/event_40.webp | Bin 0 -> 12514 bytes cards100/event_41.webp | Bin 0 -> 16286 bytes cards100/event_42.webp | Bin 0 -> 22484 bytes cards100/event_43.webp | Bin 0 -> 14034 bytes cards100/event_44.webp | Bin 0 -> 20892 bytes cards100/event_45.webp | Bin 0 -> 15918 bytes cards100/event_46.webp | Bin 0 -> 19222 bytes cards100/event_47.webp | Bin 0 -> 14414 bytes cards100/event_48.webp | Bin 0 -> 15884 bytes cards100/event_49.webp | Bin 0 -> 13442 bytes cards100/event_5.webp | Bin 0 -> 22454 bytes cards100/event_50.webp | Bin 0 -> 11174 bytes cards100/event_51.webp | Bin 0 -> 15520 bytes cards100/event_52.webp | Bin 0 -> 11508 bytes cards100/event_53.webp | Bin 0 -> 13168 bytes cards100/event_54.webp | Bin 0 -> 19138 bytes cards100/event_55.webp | Bin 0 -> 20786 bytes cards100/event_56.webp | Bin 0 -> 14936 bytes cards100/event_57.webp | Bin 0 -> 12296 bytes cards100/event_58.webp | Bin 0 -> 17462 bytes cards100/event_59.webp | Bin 0 -> 16646 bytes cards100/event_6.webp | Bin 0 -> 14008 bytes cards100/event_60.webp | Bin 0 -> 8392 bytes cards100/event_61.webp | Bin 0 -> 23890 bytes cards100/event_62.webp | Bin 0 -> 16860 bytes cards100/event_63.webp | Bin 0 -> 11594 bytes cards100/event_64.webp | Bin 0 -> 16588 bytes cards100/event_65.webp | Bin 0 -> 14156 bytes cards100/event_66.webp | Bin 0 -> 11662 bytes cards100/event_67.webp | Bin 0 -> 14428 bytes cards100/event_68.webp | Bin 0 -> 13438 bytes cards100/event_69.webp | Bin 0 -> 19296 bytes cards100/event_7.webp | Bin 0 -> 9586 bytes cards100/event_70.webp | Bin 0 -> 14106 bytes cards100/event_71.webp | Bin 0 -> 12930 bytes cards100/event_72.webp | Bin 0 -> 19642 bytes cards100/event_73.webp | Bin 0 -> 15930 bytes cards100/event_74.webp | Bin 0 -> 13590 bytes cards100/event_75.webp | Bin 0 -> 15346 bytes cards100/event_76.webp | Bin 0 -> 17154 bytes cards100/event_77.webp | Bin 0 -> 18044 bytes cards100/event_78.webp | Bin 0 -> 16814 bytes cards100/event_79.webp | Bin 0 -> 16672 bytes cards100/event_8.webp | Bin 0 -> 10462 bytes cards100/event_80.webp | Bin 0 -> 15786 bytes cards100/event_81.webp | Bin 0 -> 15386 bytes cards100/event_82.webp | Bin 0 -> 9982 bytes cards100/event_83.webp | Bin 0 -> 13948 bytes cards100/event_84.webp | Bin 0 -> 24642 bytes cards100/event_85.webp | Bin 0 -> 12100 bytes cards100/event_86.webp | Bin 0 -> 19254 bytes cards100/event_87.webp | Bin 0 -> 19714 bytes cards100/event_88.webp | Bin 0 -> 16276 bytes cards100/event_89.webp | Bin 0 -> 18980 bytes cards100/event_9.webp | Bin 0 -> 18502 bytes cards100/event_90.webp | Bin 0 -> 18634 bytes cards100/event_91.webp | Bin 0 -> 11960 bytes cards100/event_92.webp | Bin 0 -> 13518 bytes cards100/event_93.webp | Bin 0 -> 15294 bytes cards100/event_94.webp | Bin 0 -> 21390 bytes cards100/event_95.webp | Bin 0 -> 12652 bytes cards100/event_96.webp | Bin 0 -> 19046 bytes cards100/event_97.webp | Bin 0 -> 14846 bytes cards100/event_98.webp | Bin 0 -> 13440 bytes cards100/event_99.webp | Bin 0 -> 13244 bytes cards100/event_back.webp | Bin 0 -> 10168 bytes cards100/power_1.webp | Bin 0 -> 13770 bytes cards100/power_10.webp | Bin 0 -> 10306 bytes cards100/power_11.webp | Bin 0 -> 10226 bytes cards100/power_12.webp | Bin 0 -> 10238 bytes cards100/power_13.webp | Bin 0 -> 10244 bytes cards100/power_14.webp | Bin 0 -> 10378 bytes cards100/power_15.webp | Bin 0 -> 10384 bytes cards100/power_16.webp | Bin 0 -> 10396 bytes cards100/power_17.webp | Bin 0 -> 10374 bytes cards100/power_18.webp | Bin 0 -> 10250 bytes cards100/power_19.webp | Bin 0 -> 17218 bytes cards100/power_2.webp | Bin 0 -> 13764 bytes cards100/power_20.webp | Bin 0 -> 17194 bytes cards100/power_21.webp | Bin 0 -> 17130 bytes cards100/power_22.webp | Bin 0 -> 17152 bytes cards100/power_23.webp | Bin 0 -> 17110 bytes cards100/power_24.webp | Bin 0 -> 17132 bytes cards100/power_25.webp | Bin 0 -> 17106 bytes cards100/power_26.webp | Bin 0 -> 17132 bytes cards100/power_27.webp | Bin 0 -> 17206 bytes cards100/power_28.webp | Bin 0 -> 17208 bytes cards100/power_29.webp | Bin 0 -> 17210 bytes cards100/power_3.webp | Bin 0 -> 13774 bytes cards100/power_30.webp | Bin 0 -> 17206 bytes cards100/power_31.webp | Bin 0 -> 9882 bytes cards100/power_32.webp | Bin 0 -> 9916 bytes cards100/power_33.webp | Bin 0 -> 9898 bytes cards100/power_34.webp | Bin 0 -> 9836 bytes cards100/power_35.webp | Bin 0 -> 9838 bytes cards100/power_36.webp | Bin 0 -> 9848 bytes cards100/power_37.webp | Bin 0 -> 11018 bytes cards100/power_38.webp | Bin 0 -> 11092 bytes cards100/power_39.webp | Bin 0 -> 11622 bytes cards100/power_4.webp | Bin 0 -> 13744 bytes cards100/power_40.webp | Bin 0 -> 9760 bytes cards100/power_41.webp | Bin 0 -> 9844 bytes cards100/power_42.webp | Bin 0 -> 11646 bytes cards100/power_43.webp | Bin 0 -> 8264 bytes cards100/power_44.webp | Bin 0 -> 7780 bytes cards100/power_45.webp | Bin 0 -> 8992 bytes cards100/power_46.webp | Bin 0 -> 13752 bytes cards100/power_47.webp | Bin 0 -> 12066 bytes cards100/power_48.webp | Bin 0 -> 14626 bytes cards100/power_49.webp | Bin 0 -> 8538 bytes cards100/power_5.webp | Bin 0 -> 13768 bytes cards100/power_50.webp | Bin 0 -> 10990 bytes cards100/power_51.webp | Bin 0 -> 10736 bytes cards100/power_52.webp | Bin 0 -> 11920 bytes cards100/power_6.webp | Bin 0 -> 13758 bytes cards100/power_7.webp | Bin 0 -> 10348 bytes cards100/power_8.webp | Bin 0 -> 10338 bytes cards100/power_9.webp | Bin 0 -> 10286 bytes cards100/power_back.webp | Bin 0 -> 10072 bytes cards200/event_1.webp | Bin 0 -> 22350 bytes cards200/event_10.webp | Bin 0 -> 21930 bytes cards200/event_100.webp | Bin 0 -> 28526 bytes cards200/event_101.webp | Bin 0 -> 24516 bytes cards200/event_102.webp | Bin 0 -> 30552 bytes cards200/event_103.webp | Bin 0 -> 20810 bytes cards200/event_104.webp | Bin 0 -> 43226 bytes cards200/event_105.webp | Bin 0 -> 23432 bytes cards200/event_106.webp | Bin 0 -> 25060 bytes cards200/event_107.webp | Bin 0 -> 42920 bytes cards200/event_108.webp | Bin 0 -> 19800 bytes cards200/event_109.webp | Bin 0 -> 36686 bytes cards200/event_11.webp | Bin 0 -> 18752 bytes cards200/event_110.webp | Bin 0 -> 28880 bytes cards200/event_12.webp | Bin 0 -> 19736 bytes cards200/event_13.webp | Bin 0 -> 21184 bytes cards200/event_14.webp | Bin 0 -> 24190 bytes cards200/event_15.webp | Bin 0 -> 27766 bytes cards200/event_16.webp | Bin 0 -> 37778 bytes cards200/event_17.webp | Bin 0 -> 43882 bytes cards200/event_18.webp | Bin 0 -> 35604 bytes cards200/event_19.webp | Bin 0 -> 43662 bytes cards200/event_2.webp | Bin 0 -> 30412 bytes cards200/event_20.webp | Bin 0 -> 27616 bytes cards200/event_21.webp | Bin 0 -> 23124 bytes cards200/event_22.webp | Bin 0 -> 34340 bytes cards200/event_23.webp | Bin 0 -> 18116 bytes cards200/event_24.webp | Bin 0 -> 27452 bytes cards200/event_25.webp | Bin 0 -> 15978 bytes cards200/event_26.webp | Bin 0 -> 28136 bytes cards200/event_27.webp | Bin 0 -> 21480 bytes cards200/event_28.webp | Bin 0 -> 22564 bytes cards200/event_29.webp | Bin 0 -> 26612 bytes cards200/event_3.webp | Bin 0 -> 25296 bytes cards200/event_30.webp | Bin 0 -> 20976 bytes cards200/event_31.webp | Bin 0 -> 17934 bytes cards200/event_32.webp | Bin 0 -> 28120 bytes cards200/event_33.webp | Bin 0 -> 19478 bytes cards200/event_34.webp | Bin 0 -> 14114 bytes cards200/event_35.webp | Bin 0 -> 28194 bytes cards200/event_36.webp | Bin 0 -> 33902 bytes cards200/event_37.webp | Bin 0 -> 32056 bytes cards200/event_38.webp | Bin 0 -> 18174 bytes cards200/event_39.webp | Bin 0 -> 15458 bytes cards200/event_4.webp | Bin 0 -> 19848 bytes cards200/event_40.webp | Bin 0 -> 22484 bytes cards200/event_41.webp | Bin 0 -> 28206 bytes cards200/event_42.webp | Bin 0 -> 40342 bytes cards200/event_43.webp | Bin 0 -> 21388 bytes cards200/event_44.webp | Bin 0 -> 39526 bytes cards200/event_45.webp | Bin 0 -> 25076 bytes cards200/event_46.webp | Bin 0 -> 34162 bytes cards200/event_47.webp | Bin 0 -> 22860 bytes cards200/event_48.webp | Bin 0 -> 26066 bytes cards200/event_49.webp | Bin 0 -> 22874 bytes cards200/event_5.webp | Bin 0 -> 45064 bytes cards200/event_50.webp | Bin 0 -> 16744 bytes cards200/event_51.webp | Bin 0 -> 28646 bytes cards200/event_52.webp | Bin 0 -> 18056 bytes cards200/event_53.webp | Bin 0 -> 23846 bytes cards200/event_54.webp | Bin 0 -> 33854 bytes cards200/event_55.webp | Bin 0 -> 31286 bytes cards200/event_56.webp | Bin 0 -> 25506 bytes cards200/event_57.webp | Bin 0 -> 20842 bytes cards200/event_58.webp | Bin 0 -> 29286 bytes cards200/event_59.webp | Bin 0 -> 29146 bytes cards200/event_6.webp | Bin 0 -> 22944 bytes cards200/event_60.webp | Bin 0 -> 13096 bytes cards200/event_61.webp | Bin 0 -> 47392 bytes cards200/event_62.webp | Bin 0 -> 28210 bytes cards200/event_63.webp | Bin 0 -> 18680 bytes cards200/event_64.webp | Bin 0 -> 30368 bytes cards200/event_65.webp | Bin 0 -> 23714 bytes cards200/event_66.webp | Bin 0 -> 20022 bytes cards200/event_67.webp | Bin 0 -> 22958 bytes cards200/event_68.webp | Bin 0 -> 23344 bytes cards200/event_69.webp | Bin 0 -> 32722 bytes cards200/event_7.webp | Bin 0 -> 15060 bytes cards200/event_70.webp | Bin 0 -> 23132 bytes cards200/event_71.webp | Bin 0 -> 20598 bytes cards200/event_72.webp | Bin 0 -> 37304 bytes cards200/event_73.webp | Bin 0 -> 26904 bytes cards200/event_74.webp | Bin 0 -> 20696 bytes cards200/event_75.webp | Bin 0 -> 25030 bytes cards200/event_76.webp | Bin 0 -> 29456 bytes cards200/event_77.webp | Bin 0 -> 32826 bytes cards200/event_78.webp | Bin 0 -> 26690 bytes cards200/event_79.webp | Bin 0 -> 27756 bytes cards200/event_8.webp | Bin 0 -> 16950 bytes cards200/event_80.webp | Bin 0 -> 26998 bytes cards200/event_81.webp | Bin 0 -> 26520 bytes cards200/event_82.webp | Bin 0 -> 17286 bytes cards200/event_83.webp | Bin 0 -> 23620 bytes cards200/event_84.webp | Bin 0 -> 48568 bytes cards200/event_85.webp | Bin 0 -> 20308 bytes cards200/event_86.webp | Bin 0 -> 31378 bytes cards200/event_87.webp | Bin 0 -> 33610 bytes cards200/event_88.webp | Bin 0 -> 27868 bytes cards200/event_89.webp | Bin 0 -> 37128 bytes cards200/event_9.webp | Bin 0 -> 34810 bytes cards200/event_90.webp | Bin 0 -> 32194 bytes cards200/event_91.webp | Bin 0 -> 20422 bytes cards200/event_92.webp | Bin 0 -> 23216 bytes cards200/event_93.webp | Bin 0 -> 25820 bytes cards200/event_94.webp | Bin 0 -> 40108 bytes cards200/event_95.webp | Bin 0 -> 19088 bytes cards200/event_96.webp | Bin 0 -> 34992 bytes cards200/event_97.webp | Bin 0 -> 28138 bytes cards200/event_98.webp | Bin 0 -> 23106 bytes cards200/event_99.webp | Bin 0 -> 22670 bytes cards200/event_back.webp | Bin 0 -> 13162 bytes cards200/power_1.webp | Bin 0 -> 19256 bytes cards200/power_10.webp | Bin 0 -> 13904 bytes cards200/power_11.webp | Bin 0 -> 13784 bytes cards200/power_12.webp | Bin 0 -> 13788 bytes cards200/power_13.webp | Bin 0 -> 13806 bytes cards200/power_14.webp | Bin 0 -> 13982 bytes cards200/power_15.webp | Bin 0 -> 13934 bytes cards200/power_16.webp | Bin 0 -> 13964 bytes cards200/power_17.webp | Bin 0 -> 13958 bytes cards200/power_18.webp | Bin 0 -> 13844 bytes cards200/power_19.webp | Bin 0 -> 26318 bytes cards200/power_2.webp | Bin 0 -> 19256 bytes cards200/power_20.webp | Bin 0 -> 26356 bytes cards200/power_21.webp | Bin 0 -> 26194 bytes cards200/power_22.webp | Bin 0 -> 26264 bytes cards200/power_23.webp | Bin 0 -> 26210 bytes cards200/power_24.webp | Bin 0 -> 26226 bytes cards200/power_25.webp | Bin 0 -> 26244 bytes cards200/power_26.webp | Bin 0 -> 26252 bytes cards200/power_27.webp | Bin 0 -> 26366 bytes cards200/power_28.webp | Bin 0 -> 26318 bytes cards200/power_29.webp | Bin 0 -> 26348 bytes cards200/power_3.webp | Bin 0 -> 19274 bytes cards200/power_30.webp | Bin 0 -> 26390 bytes cards200/power_31.webp | Bin 0 -> 14926 bytes cards200/power_32.webp | Bin 0 -> 14958 bytes cards200/power_33.webp | Bin 0 -> 14922 bytes cards200/power_34.webp | Bin 0 -> 14842 bytes cards200/power_35.webp | Bin 0 -> 14868 bytes cards200/power_36.webp | Bin 0 -> 14876 bytes cards200/power_37.webp | Bin 0 -> 17438 bytes cards200/power_38.webp | Bin 0 -> 16072 bytes cards200/power_39.webp | Bin 0 -> 18004 bytes cards200/power_4.webp | Bin 0 -> 19260 bytes cards200/power_40.webp | Bin 0 -> 14552 bytes cards200/power_41.webp | Bin 0 -> 14796 bytes cards200/power_42.webp | Bin 0 -> 18322 bytes cards200/power_43.webp | Bin 0 -> 12750 bytes cards200/power_44.webp | Bin 0 -> 12374 bytes cards200/power_45.webp | Bin 0 -> 13316 bytes cards200/power_46.webp | Bin 0 -> 22676 bytes cards200/power_47.webp | Bin 0 -> 18916 bytes cards200/power_48.webp | Bin 0 -> 23208 bytes cards200/power_49.webp | Bin 0 -> 13124 bytes cards200/power_5.webp | Bin 0 -> 19240 bytes cards200/power_50.webp | Bin 0 -> 15928 bytes cards200/power_51.webp | Bin 0 -> 16456 bytes cards200/power_52.webp | Bin 0 -> 18602 bytes cards200/power_6.webp | Bin 0 -> 19304 bytes cards200/power_7.webp | Bin 0 -> 13920 bytes cards200/power_8.webp | Bin 0 -> 13938 bytes cards200/power_9.webp | Bin 0 -> 13830 bytes cards200/power_back.webp | Bin 0 -> 13868 bytes map150.jpg | Bin 0 -> 2081840 bytes map75.jpg | Bin 0 -> 871825 bytes 330 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cards100/event_1.webp create mode 100644 cards100/event_10.webp create mode 100644 cards100/event_100.webp create mode 100644 cards100/event_101.webp create mode 100644 cards100/event_102.webp create mode 100644 cards100/event_103.webp create mode 100644 cards100/event_104.webp create mode 100644 cards100/event_105.webp create mode 100644 cards100/event_106.webp create mode 100644 cards100/event_107.webp create mode 100644 cards100/event_108.webp create mode 100644 cards100/event_109.webp create mode 100644 cards100/event_11.webp create mode 100644 cards100/event_110.webp create mode 100644 cards100/event_12.webp create mode 100644 cards100/event_13.webp create mode 100644 cards100/event_14.webp create mode 100644 cards100/event_15.webp create mode 100644 cards100/event_16.webp create mode 100644 cards100/event_17.webp create mode 100644 cards100/event_18.webp create mode 100644 cards100/event_19.webp create mode 100644 cards100/event_2.webp create mode 100644 cards100/event_20.webp create mode 100644 cards100/event_21.webp create mode 100644 cards100/event_22.webp create mode 100644 cards100/event_23.webp create mode 100644 cards100/event_24.webp create mode 100644 cards100/event_25.webp create mode 100644 cards100/event_26.webp create mode 100644 cards100/event_27.webp create mode 100644 cards100/event_28.webp create mode 100644 cards100/event_29.webp create mode 100644 cards100/event_3.webp create mode 100644 cards100/event_30.webp create mode 100644 cards100/event_31.webp create mode 100644 cards100/event_32.webp create mode 100644 cards100/event_33.webp create mode 100644 cards100/event_34.webp create mode 100644 cards100/event_35.webp create mode 100644 cards100/event_36.webp create mode 100644 cards100/event_37.webp create mode 100644 cards100/event_38.webp create mode 100644 cards100/event_39.webp create mode 100644 cards100/event_4.webp create mode 100644 cards100/event_40.webp create mode 100644 cards100/event_41.webp create mode 100644 cards100/event_42.webp create mode 100644 cards100/event_43.webp create mode 100644 cards100/event_44.webp create mode 100644 cards100/event_45.webp create mode 100644 cards100/event_46.webp create mode 100644 cards100/event_47.webp create mode 100644 cards100/event_48.webp create mode 100644 cards100/event_49.webp create mode 100644 cards100/event_5.webp create mode 100644 cards100/event_50.webp create mode 100644 cards100/event_51.webp create mode 100644 cards100/event_52.webp create mode 100644 cards100/event_53.webp create mode 100644 cards100/event_54.webp create mode 100644 cards100/event_55.webp create mode 100644 cards100/event_56.webp create mode 100644 cards100/event_57.webp create mode 100644 cards100/event_58.webp create mode 100644 cards100/event_59.webp create mode 100644 cards100/event_6.webp create mode 100644 cards100/event_60.webp create mode 100644 cards100/event_61.webp create mode 100644 cards100/event_62.webp create mode 100644 cards100/event_63.webp create mode 100644 cards100/event_64.webp create mode 100644 cards100/event_65.webp create mode 100644 cards100/event_66.webp create mode 100644 cards100/event_67.webp create mode 100644 cards100/event_68.webp create mode 100644 cards100/event_69.webp create mode 100644 cards100/event_7.webp create mode 100644 cards100/event_70.webp create mode 100644 cards100/event_71.webp create mode 100644 cards100/event_72.webp create mode 100644 cards100/event_73.webp create mode 100644 cards100/event_74.webp create mode 100644 cards100/event_75.webp create mode 100644 cards100/event_76.webp create mode 100644 cards100/event_77.webp create mode 100644 cards100/event_78.webp create mode 100644 cards100/event_79.webp create mode 100644 cards100/event_8.webp create mode 100644 cards100/event_80.webp create mode 100644 cards100/event_81.webp create mode 100644 cards100/event_82.webp create mode 100644 cards100/event_83.webp create mode 100644 cards100/event_84.webp create mode 100644 cards100/event_85.webp create mode 100644 cards100/event_86.webp create mode 100644 cards100/event_87.webp create mode 100644 cards100/event_88.webp create mode 100644 cards100/event_89.webp create mode 100644 cards100/event_9.webp create mode 100644 cards100/event_90.webp create mode 100644 cards100/event_91.webp create mode 100644 cards100/event_92.webp create mode 100644 cards100/event_93.webp create mode 100644 cards100/event_94.webp create mode 100644 cards100/event_95.webp create mode 100644 cards100/event_96.webp create mode 100644 cards100/event_97.webp create mode 100644 cards100/event_98.webp create mode 100644 cards100/event_99.webp create mode 100644 cards100/event_back.webp create mode 100644 cards100/power_1.webp create mode 100644 cards100/power_10.webp create mode 100644 cards100/power_11.webp create mode 100644 cards100/power_12.webp create mode 100644 cards100/power_13.webp create mode 100644 cards100/power_14.webp create mode 100644 cards100/power_15.webp create mode 100644 cards100/power_16.webp create mode 100644 cards100/power_17.webp create mode 100644 cards100/power_18.webp create mode 100644 cards100/power_19.webp create mode 100644 cards100/power_2.webp create mode 100644 cards100/power_20.webp create mode 100644 cards100/power_21.webp create mode 100644 cards100/power_22.webp create mode 100644 cards100/power_23.webp create mode 100644 cards100/power_24.webp create mode 100644 cards100/power_25.webp create mode 100644 cards100/power_26.webp create mode 100644 cards100/power_27.webp create mode 100644 cards100/power_28.webp create mode 100644 cards100/power_29.webp create mode 100644 cards100/power_3.webp create mode 100644 cards100/power_30.webp create mode 100644 cards100/power_31.webp create mode 100644 cards100/power_32.webp create mode 100644 cards100/power_33.webp create mode 100644 cards100/power_34.webp create mode 100644 cards100/power_35.webp create mode 100644 cards100/power_36.webp create mode 100644 cards100/power_37.webp create mode 100644 cards100/power_38.webp create mode 100644 cards100/power_39.webp create mode 100644 cards100/power_4.webp create mode 100644 cards100/power_40.webp create mode 100644 cards100/power_41.webp create mode 100644 cards100/power_42.webp create mode 100644 cards100/power_43.webp create mode 100644 cards100/power_44.webp create mode 100644 cards100/power_45.webp create mode 100644 cards100/power_46.webp create mode 100644 cards100/power_47.webp create mode 100644 cards100/power_48.webp create mode 100644 cards100/power_49.webp create mode 100644 cards100/power_5.webp create mode 100644 cards100/power_50.webp create mode 100644 cards100/power_51.webp create mode 100644 cards100/power_52.webp create mode 100644 cards100/power_6.webp create mode 100644 cards100/power_7.webp create mode 100644 cards100/power_8.webp create mode 100644 cards100/power_9.webp create mode 100644 cards100/power_back.webp create mode 100644 cards200/event_1.webp create mode 100644 cards200/event_10.webp create mode 100644 cards200/event_100.webp create mode 100644 cards200/event_101.webp create mode 100644 cards200/event_102.webp create mode 100644 cards200/event_103.webp create mode 100644 cards200/event_104.webp create mode 100644 cards200/event_105.webp create mode 100644 cards200/event_106.webp create mode 100644 cards200/event_107.webp create mode 100644 cards200/event_108.webp create mode 100644 cards200/event_109.webp create mode 100644 cards200/event_11.webp create mode 100644 cards200/event_110.webp create mode 100644 cards200/event_12.webp create mode 100644 cards200/event_13.webp create mode 100644 cards200/event_14.webp create mode 100644 cards200/event_15.webp create mode 100644 cards200/event_16.webp create mode 100644 cards200/event_17.webp create mode 100644 cards200/event_18.webp create mode 100644 cards200/event_19.webp create mode 100644 cards200/event_2.webp create mode 100644 cards200/event_20.webp create mode 100644 cards200/event_21.webp create mode 100644 cards200/event_22.webp create mode 100644 cards200/event_23.webp create mode 100644 cards200/event_24.webp create mode 100644 cards200/event_25.webp create mode 100644 cards200/event_26.webp create mode 100644 cards200/event_27.webp create mode 100644 cards200/event_28.webp create mode 100644 cards200/event_29.webp create mode 100644 cards200/event_3.webp create mode 100644 cards200/event_30.webp create mode 100644 cards200/event_31.webp create mode 100644 cards200/event_32.webp create mode 100644 cards200/event_33.webp create mode 100644 cards200/event_34.webp create mode 100644 cards200/event_35.webp create mode 100644 cards200/event_36.webp create mode 100644 cards200/event_37.webp create mode 100644 cards200/event_38.webp create mode 100644 cards200/event_39.webp create mode 100644 cards200/event_4.webp create mode 100644 cards200/event_40.webp create mode 100644 cards200/event_41.webp create mode 100644 cards200/event_42.webp create mode 100644 cards200/event_43.webp create mode 100644 cards200/event_44.webp create mode 100644 cards200/event_45.webp create mode 100644 cards200/event_46.webp create mode 100644 cards200/event_47.webp create mode 100644 cards200/event_48.webp create mode 100644 cards200/event_49.webp create mode 100644 cards200/event_5.webp create mode 100644 cards200/event_50.webp create mode 100644 cards200/event_51.webp create mode 100644 cards200/event_52.webp create mode 100644 cards200/event_53.webp create mode 100644 cards200/event_54.webp create mode 100644 cards200/event_55.webp create mode 100644 cards200/event_56.webp create mode 100644 cards200/event_57.webp create mode 100644 cards200/event_58.webp create mode 100644 cards200/event_59.webp create mode 100644 cards200/event_6.webp create mode 100644 cards200/event_60.webp create mode 100644 cards200/event_61.webp create mode 100644 cards200/event_62.webp create mode 100644 cards200/event_63.webp create mode 100644 cards200/event_64.webp create mode 100644 cards200/event_65.webp create mode 100644 cards200/event_66.webp create mode 100644 cards200/event_67.webp create mode 100644 cards200/event_68.webp create mode 100644 cards200/event_69.webp create mode 100644 cards200/event_7.webp create mode 100644 cards200/event_70.webp create mode 100644 cards200/event_71.webp create mode 100644 cards200/event_72.webp create mode 100644 cards200/event_73.webp create mode 100644 cards200/event_74.webp create mode 100644 cards200/event_75.webp create mode 100644 cards200/event_76.webp create mode 100644 cards200/event_77.webp create mode 100644 cards200/event_78.webp create mode 100644 cards200/event_79.webp create mode 100644 cards200/event_8.webp create mode 100644 cards200/event_80.webp create mode 100644 cards200/event_81.webp create mode 100644 cards200/event_82.webp create mode 100644 cards200/event_83.webp create mode 100644 cards200/event_84.webp create mode 100644 cards200/event_85.webp create mode 100644 cards200/event_86.webp create mode 100644 cards200/event_87.webp create mode 100644 cards200/event_88.webp create mode 100644 cards200/event_89.webp create mode 100644 cards200/event_9.webp create mode 100644 cards200/event_90.webp create mode 100644 cards200/event_91.webp create mode 100644 cards200/event_92.webp create mode 100644 cards200/event_93.webp create mode 100644 cards200/event_94.webp create mode 100644 cards200/event_95.webp create mode 100644 cards200/event_96.webp create mode 100644 cards200/event_97.webp create mode 100644 cards200/event_98.webp create mode 100644 cards200/event_99.webp create mode 100644 cards200/event_back.webp create mode 100644 cards200/power_1.webp create mode 100644 cards200/power_10.webp create mode 100644 cards200/power_11.webp create mode 100644 cards200/power_12.webp create mode 100644 cards200/power_13.webp create mode 100644 cards200/power_14.webp create mode 100644 cards200/power_15.webp create mode 100644 cards200/power_16.webp create mode 100644 cards200/power_17.webp create mode 100644 cards200/power_18.webp create mode 100644 cards200/power_19.webp create mode 100644 cards200/power_2.webp create mode 100644 cards200/power_20.webp create mode 100644 cards200/power_21.webp create mode 100644 cards200/power_22.webp create mode 100644 cards200/power_23.webp create mode 100644 cards200/power_24.webp create mode 100644 cards200/power_25.webp create mode 100644 cards200/power_26.webp create mode 100644 cards200/power_27.webp create mode 100644 cards200/power_28.webp create mode 100644 cards200/power_29.webp create mode 100644 cards200/power_3.webp create mode 100644 cards200/power_30.webp create mode 100644 cards200/power_31.webp create mode 100644 cards200/power_32.webp create mode 100644 cards200/power_33.webp create mode 100644 cards200/power_34.webp create mode 100644 cards200/power_35.webp create mode 100644 cards200/power_36.webp create mode 100644 cards200/power_37.webp create mode 100644 cards200/power_38.webp create mode 100644 cards200/power_39.webp create mode 100644 cards200/power_4.webp create mode 100644 cards200/power_40.webp create mode 100644 cards200/power_41.webp create mode 100644 cards200/power_42.webp create mode 100644 cards200/power_43.webp create mode 100644 cards200/power_44.webp create mode 100644 cards200/power_45.webp create mode 100644 cards200/power_46.webp create mode 100644 cards200/power_47.webp create mode 100644 cards200/power_48.webp create mode 100644 cards200/power_49.webp create mode 100644 cards200/power_5.webp create mode 100644 cards200/power_50.webp create mode 100644 cards200/power_51.webp create mode 100644 cards200/power_52.webp create mode 100644 cards200/power_6.webp create mode 100644 cards200/power_7.webp create mode 100644 cards200/power_8.webp create mode 100644 cards200/power_9.webp create mode 100644 cards200/power_back.webp create mode 100644 map150.jpg create mode 100644 map75.jpg diff --git a/cards100/event_1.webp b/cards100/event_1.webp new file mode 100644 index 0000000..b1aca56 Binary files /dev/null and b/cards100/event_1.webp differ diff --git a/cards100/event_10.webp b/cards100/event_10.webp new file mode 100644 index 0000000..821396b Binary files /dev/null and b/cards100/event_10.webp differ diff --git a/cards100/event_100.webp b/cards100/event_100.webp new file mode 100644 index 0000000..a744526 Binary files /dev/null and b/cards100/event_100.webp differ diff --git a/cards100/event_101.webp b/cards100/event_101.webp new file mode 100644 index 0000000..90388c0 Binary files /dev/null and b/cards100/event_101.webp differ diff --git a/cards100/event_102.webp b/cards100/event_102.webp new file mode 100644 index 0000000..811442f Binary files /dev/null and b/cards100/event_102.webp differ diff --git a/cards100/event_103.webp b/cards100/event_103.webp new file mode 100644 index 0000000..bd34acf Binary files /dev/null and b/cards100/event_103.webp differ diff --git a/cards100/event_104.webp b/cards100/event_104.webp new file mode 100644 index 0000000..193f6e7 Binary files /dev/null and b/cards100/event_104.webp differ diff --git a/cards100/event_105.webp b/cards100/event_105.webp new file mode 100644 index 0000000..20043ee Binary files /dev/null and b/cards100/event_105.webp differ diff --git a/cards100/event_106.webp b/cards100/event_106.webp new file mode 100644 index 0000000..23fb4b3 Binary files /dev/null and b/cards100/event_106.webp differ diff --git a/cards100/event_107.webp b/cards100/event_107.webp new file mode 100644 index 0000000..d405e47 Binary files /dev/null and b/cards100/event_107.webp differ diff --git a/cards100/event_108.webp b/cards100/event_108.webp new file mode 100644 index 0000000..d79e324 Binary files /dev/null and b/cards100/event_108.webp differ diff --git a/cards100/event_109.webp b/cards100/event_109.webp new file mode 100644 index 0000000..ab803bc Binary files /dev/null and b/cards100/event_109.webp differ diff --git a/cards100/event_11.webp b/cards100/event_11.webp new file mode 100644 index 0000000..d01abcb Binary files /dev/null and b/cards100/event_11.webp differ diff --git a/cards100/event_110.webp b/cards100/event_110.webp new file mode 100644 index 0000000..67e66a6 Binary files /dev/null and b/cards100/event_110.webp differ diff --git a/cards100/event_12.webp b/cards100/event_12.webp new file mode 100644 index 0000000..c4de21e Binary files /dev/null and b/cards100/event_12.webp differ diff --git a/cards100/event_13.webp b/cards100/event_13.webp new file mode 100644 index 0000000..e8354e6 Binary files /dev/null and b/cards100/event_13.webp differ diff --git a/cards100/event_14.webp b/cards100/event_14.webp new file mode 100644 index 0000000..b8c0a39 Binary files /dev/null and b/cards100/event_14.webp differ diff --git a/cards100/event_15.webp b/cards100/event_15.webp new file mode 100644 index 0000000..401fc24 Binary files /dev/null and b/cards100/event_15.webp differ diff --git a/cards100/event_16.webp b/cards100/event_16.webp new file mode 100644 index 0000000..7c5b2e2 Binary files /dev/null and b/cards100/event_16.webp differ diff --git a/cards100/event_17.webp b/cards100/event_17.webp new file mode 100644 index 0000000..7d2a9da Binary files /dev/null and b/cards100/event_17.webp differ diff --git a/cards100/event_18.webp b/cards100/event_18.webp new file mode 100644 index 0000000..a3b5b53 Binary files /dev/null and b/cards100/event_18.webp differ diff --git a/cards100/event_19.webp b/cards100/event_19.webp new file mode 100644 index 0000000..7361c87 Binary files /dev/null and b/cards100/event_19.webp differ diff --git a/cards100/event_2.webp b/cards100/event_2.webp new file mode 100644 index 0000000..be1d878 Binary files /dev/null and b/cards100/event_2.webp differ diff --git a/cards100/event_20.webp b/cards100/event_20.webp new file mode 100644 index 0000000..a8ea73a Binary files /dev/null and b/cards100/event_20.webp differ diff --git a/cards100/event_21.webp b/cards100/event_21.webp new file mode 100644 index 0000000..96b6c6d Binary files /dev/null and b/cards100/event_21.webp differ diff --git a/cards100/event_22.webp b/cards100/event_22.webp new file mode 100644 index 0000000..059da40 Binary files /dev/null and b/cards100/event_22.webp differ diff --git a/cards100/event_23.webp b/cards100/event_23.webp new file mode 100644 index 0000000..ac5bc4e Binary files /dev/null and b/cards100/event_23.webp differ diff --git a/cards100/event_24.webp b/cards100/event_24.webp new file mode 100644 index 0000000..91f8aeb Binary files /dev/null and b/cards100/event_24.webp differ diff --git a/cards100/event_25.webp b/cards100/event_25.webp new file mode 100644 index 0000000..1d786e9 Binary files /dev/null and b/cards100/event_25.webp differ diff --git a/cards100/event_26.webp b/cards100/event_26.webp new file mode 100644 index 0000000..6857624 Binary files /dev/null and b/cards100/event_26.webp differ diff --git a/cards100/event_27.webp b/cards100/event_27.webp new file mode 100644 index 0000000..1df14e8 Binary files /dev/null and b/cards100/event_27.webp differ diff --git a/cards100/event_28.webp b/cards100/event_28.webp new file mode 100644 index 0000000..0cc20de Binary files /dev/null and b/cards100/event_28.webp differ diff --git a/cards100/event_29.webp b/cards100/event_29.webp new file mode 100644 index 0000000..5936d7a Binary files /dev/null and b/cards100/event_29.webp differ diff --git a/cards100/event_3.webp b/cards100/event_3.webp new file mode 100644 index 0000000..615215e Binary files /dev/null and b/cards100/event_3.webp differ diff --git a/cards100/event_30.webp b/cards100/event_30.webp new file mode 100644 index 0000000..654531c Binary files /dev/null and b/cards100/event_30.webp differ diff --git a/cards100/event_31.webp b/cards100/event_31.webp new file mode 100644 index 0000000..75cac9e Binary files /dev/null and b/cards100/event_31.webp differ diff --git a/cards100/event_32.webp b/cards100/event_32.webp new file mode 100644 index 0000000..5be58d1 Binary files /dev/null and b/cards100/event_32.webp differ diff --git a/cards100/event_33.webp b/cards100/event_33.webp new file mode 100644 index 0000000..8c73999 Binary files /dev/null and b/cards100/event_33.webp differ diff --git a/cards100/event_34.webp b/cards100/event_34.webp new file mode 100644 index 0000000..9206713 Binary files /dev/null and b/cards100/event_34.webp differ diff --git a/cards100/event_35.webp b/cards100/event_35.webp new file mode 100644 index 0000000..0f82965 Binary files /dev/null and b/cards100/event_35.webp differ diff --git a/cards100/event_36.webp b/cards100/event_36.webp new file mode 100644 index 0000000..6554efc Binary files /dev/null and b/cards100/event_36.webp differ diff --git a/cards100/event_37.webp b/cards100/event_37.webp new file mode 100644 index 0000000..0559a8d Binary files /dev/null and b/cards100/event_37.webp differ diff --git a/cards100/event_38.webp b/cards100/event_38.webp new file mode 100644 index 0000000..752ebe4 Binary files /dev/null and b/cards100/event_38.webp differ diff --git a/cards100/event_39.webp b/cards100/event_39.webp new file mode 100644 index 0000000..b07edb8 Binary files /dev/null and b/cards100/event_39.webp differ diff --git a/cards100/event_4.webp b/cards100/event_4.webp new file mode 100644 index 0000000..85b8f97 Binary files /dev/null and b/cards100/event_4.webp differ diff --git a/cards100/event_40.webp b/cards100/event_40.webp new file mode 100644 index 0000000..005159f Binary files /dev/null and b/cards100/event_40.webp differ diff --git a/cards100/event_41.webp b/cards100/event_41.webp new file mode 100644 index 0000000..049d0d1 Binary files /dev/null and b/cards100/event_41.webp differ diff --git a/cards100/event_42.webp b/cards100/event_42.webp new file mode 100644 index 0000000..1aa629a Binary files /dev/null and b/cards100/event_42.webp differ diff --git a/cards100/event_43.webp b/cards100/event_43.webp new file mode 100644 index 0000000..7c10f17 Binary files /dev/null and b/cards100/event_43.webp differ diff --git a/cards100/event_44.webp b/cards100/event_44.webp new file mode 100644 index 0000000..0bd7e7a Binary files /dev/null and b/cards100/event_44.webp differ diff --git a/cards100/event_45.webp b/cards100/event_45.webp new file mode 100644 index 0000000..4ecc80a Binary files /dev/null and b/cards100/event_45.webp differ diff --git a/cards100/event_46.webp b/cards100/event_46.webp new file mode 100644 index 0000000..0da492b Binary files /dev/null and b/cards100/event_46.webp differ diff --git a/cards100/event_47.webp b/cards100/event_47.webp new file mode 100644 index 0000000..1e328c4 Binary files /dev/null and b/cards100/event_47.webp differ diff --git a/cards100/event_48.webp b/cards100/event_48.webp new file mode 100644 index 0000000..4080080 Binary files /dev/null and b/cards100/event_48.webp differ diff --git a/cards100/event_49.webp b/cards100/event_49.webp new file mode 100644 index 0000000..d5839a9 Binary files /dev/null and b/cards100/event_49.webp differ diff --git a/cards100/event_5.webp b/cards100/event_5.webp new file mode 100644 index 0000000..216f8aa Binary files /dev/null and b/cards100/event_5.webp differ diff --git a/cards100/event_50.webp b/cards100/event_50.webp new file mode 100644 index 0000000..2a9a351 Binary files /dev/null and b/cards100/event_50.webp differ diff --git a/cards100/event_51.webp b/cards100/event_51.webp new file mode 100644 index 0000000..21f241e Binary files /dev/null and b/cards100/event_51.webp differ diff --git a/cards100/event_52.webp b/cards100/event_52.webp new file mode 100644 index 0000000..3543cc5 Binary files /dev/null and b/cards100/event_52.webp differ diff --git a/cards100/event_53.webp b/cards100/event_53.webp new file mode 100644 index 0000000..9c400d4 Binary files /dev/null and b/cards100/event_53.webp differ diff --git a/cards100/event_54.webp b/cards100/event_54.webp new file mode 100644 index 0000000..5e3cb7a Binary files /dev/null and b/cards100/event_54.webp differ diff --git a/cards100/event_55.webp b/cards100/event_55.webp new file mode 100644 index 0000000..a375e55 Binary files /dev/null and b/cards100/event_55.webp differ diff --git a/cards100/event_56.webp b/cards100/event_56.webp new file mode 100644 index 0000000..77144ff Binary files /dev/null and b/cards100/event_56.webp differ diff --git a/cards100/event_57.webp b/cards100/event_57.webp new file mode 100644 index 0000000..563918a Binary files /dev/null and b/cards100/event_57.webp differ diff --git a/cards100/event_58.webp b/cards100/event_58.webp new file mode 100644 index 0000000..ac42fd3 Binary files /dev/null and b/cards100/event_58.webp differ diff --git a/cards100/event_59.webp b/cards100/event_59.webp new file mode 100644 index 0000000..c9c0343 Binary files /dev/null and b/cards100/event_59.webp differ diff --git a/cards100/event_6.webp b/cards100/event_6.webp new file mode 100644 index 0000000..f269f09 Binary files /dev/null and b/cards100/event_6.webp differ diff --git a/cards100/event_60.webp b/cards100/event_60.webp new file mode 100644 index 0000000..5d9af39 Binary files /dev/null and b/cards100/event_60.webp differ diff --git a/cards100/event_61.webp b/cards100/event_61.webp new file mode 100644 index 0000000..dd061c5 Binary files /dev/null and b/cards100/event_61.webp differ diff --git a/cards100/event_62.webp b/cards100/event_62.webp new file mode 100644 index 0000000..4923062 Binary files /dev/null and b/cards100/event_62.webp differ diff --git a/cards100/event_63.webp b/cards100/event_63.webp new file mode 100644 index 0000000..1f19b96 Binary files /dev/null and b/cards100/event_63.webp differ diff --git a/cards100/event_64.webp b/cards100/event_64.webp new file mode 100644 index 0000000..3dff036 Binary files /dev/null and b/cards100/event_64.webp differ diff --git a/cards100/event_65.webp b/cards100/event_65.webp new file mode 100644 index 0000000..bb59d6d Binary files /dev/null and b/cards100/event_65.webp differ diff --git a/cards100/event_66.webp b/cards100/event_66.webp new file mode 100644 index 0000000..f9ae20e Binary files /dev/null and b/cards100/event_66.webp differ diff --git a/cards100/event_67.webp b/cards100/event_67.webp new file mode 100644 index 0000000..163a191 Binary files /dev/null and b/cards100/event_67.webp differ diff --git a/cards100/event_68.webp b/cards100/event_68.webp new file mode 100644 index 0000000..693c794 Binary files /dev/null and b/cards100/event_68.webp differ diff --git a/cards100/event_69.webp b/cards100/event_69.webp new file mode 100644 index 0000000..a1c3bab Binary files /dev/null and b/cards100/event_69.webp differ diff --git a/cards100/event_7.webp b/cards100/event_7.webp new file mode 100644 index 0000000..10a2e23 Binary files /dev/null and b/cards100/event_7.webp differ diff --git a/cards100/event_70.webp b/cards100/event_70.webp new file mode 100644 index 0000000..20866fb Binary files /dev/null and b/cards100/event_70.webp differ diff --git a/cards100/event_71.webp b/cards100/event_71.webp new file mode 100644 index 0000000..e82535a Binary files /dev/null and b/cards100/event_71.webp differ diff --git a/cards100/event_72.webp b/cards100/event_72.webp new file mode 100644 index 0000000..b95bf49 Binary files /dev/null and b/cards100/event_72.webp differ diff --git a/cards100/event_73.webp b/cards100/event_73.webp new file mode 100644 index 0000000..1485ec9 Binary files /dev/null and b/cards100/event_73.webp differ diff --git a/cards100/event_74.webp b/cards100/event_74.webp new file mode 100644 index 0000000..a70215d Binary files /dev/null and b/cards100/event_74.webp differ diff --git a/cards100/event_75.webp b/cards100/event_75.webp new file mode 100644 index 0000000..a02e14f Binary files /dev/null and b/cards100/event_75.webp differ diff --git a/cards100/event_76.webp b/cards100/event_76.webp new file mode 100644 index 0000000..b545394 Binary files /dev/null and b/cards100/event_76.webp differ diff --git a/cards100/event_77.webp b/cards100/event_77.webp new file mode 100644 index 0000000..1d6f894 Binary files /dev/null and b/cards100/event_77.webp differ diff --git a/cards100/event_78.webp b/cards100/event_78.webp new file mode 100644 index 0000000..86d9b7a Binary files /dev/null and b/cards100/event_78.webp differ diff --git a/cards100/event_79.webp b/cards100/event_79.webp new file mode 100644 index 0000000..2645194 Binary files /dev/null and b/cards100/event_79.webp differ diff --git a/cards100/event_8.webp b/cards100/event_8.webp new file mode 100644 index 0000000..45f5d54 Binary files /dev/null and b/cards100/event_8.webp differ diff --git a/cards100/event_80.webp b/cards100/event_80.webp new file mode 100644 index 0000000..8f0121b Binary files /dev/null and b/cards100/event_80.webp differ diff --git a/cards100/event_81.webp b/cards100/event_81.webp new file mode 100644 index 0000000..6a11c26 Binary files /dev/null and b/cards100/event_81.webp differ diff --git a/cards100/event_82.webp b/cards100/event_82.webp new file mode 100644 index 0000000..0150f59 Binary files /dev/null and b/cards100/event_82.webp differ diff --git a/cards100/event_83.webp b/cards100/event_83.webp new file mode 100644 index 0000000..ba1aa9c Binary files /dev/null and b/cards100/event_83.webp differ diff --git a/cards100/event_84.webp b/cards100/event_84.webp new file mode 100644 index 0000000..18faf7c Binary files /dev/null and b/cards100/event_84.webp differ diff --git a/cards100/event_85.webp b/cards100/event_85.webp new file mode 100644 index 0000000..55aec5f Binary files /dev/null and b/cards100/event_85.webp differ diff --git a/cards100/event_86.webp b/cards100/event_86.webp new file mode 100644 index 0000000..405d128 Binary files /dev/null and b/cards100/event_86.webp differ diff --git a/cards100/event_87.webp b/cards100/event_87.webp new file mode 100644 index 0000000..946e7f2 Binary files /dev/null and b/cards100/event_87.webp differ diff --git a/cards100/event_88.webp b/cards100/event_88.webp new file mode 100644 index 0000000..616d762 Binary files /dev/null and b/cards100/event_88.webp differ diff --git a/cards100/event_89.webp b/cards100/event_89.webp new file mode 100644 index 0000000..a443a43 Binary files /dev/null and b/cards100/event_89.webp differ diff --git a/cards100/event_9.webp b/cards100/event_9.webp new file mode 100644 index 0000000..4e13dce Binary files /dev/null and b/cards100/event_9.webp differ diff --git a/cards100/event_90.webp b/cards100/event_90.webp new file mode 100644 index 0000000..fc59998 Binary files /dev/null and b/cards100/event_90.webp differ diff --git a/cards100/event_91.webp b/cards100/event_91.webp new file mode 100644 index 0000000..76cc566 Binary files /dev/null and b/cards100/event_91.webp differ diff --git a/cards100/event_92.webp b/cards100/event_92.webp new file mode 100644 index 0000000..b3af374 Binary files /dev/null and b/cards100/event_92.webp differ diff --git a/cards100/event_93.webp b/cards100/event_93.webp new file mode 100644 index 0000000..6c0cb28 Binary files /dev/null and b/cards100/event_93.webp differ diff --git a/cards100/event_94.webp b/cards100/event_94.webp new file mode 100644 index 0000000..7b936ba Binary files /dev/null and b/cards100/event_94.webp differ diff --git a/cards100/event_95.webp b/cards100/event_95.webp new file mode 100644 index 0000000..0e56227 Binary files /dev/null and b/cards100/event_95.webp differ diff --git a/cards100/event_96.webp b/cards100/event_96.webp new file mode 100644 index 0000000..e7aa49b Binary files /dev/null and b/cards100/event_96.webp differ diff --git a/cards100/event_97.webp b/cards100/event_97.webp new file mode 100644 index 0000000..ad176d6 Binary files /dev/null and b/cards100/event_97.webp differ diff --git a/cards100/event_98.webp b/cards100/event_98.webp new file mode 100644 index 0000000..d77bdd9 Binary files /dev/null and b/cards100/event_98.webp differ diff --git a/cards100/event_99.webp b/cards100/event_99.webp new file mode 100644 index 0000000..f3c0353 Binary files /dev/null and b/cards100/event_99.webp differ diff --git a/cards100/event_back.webp b/cards100/event_back.webp new file mode 100644 index 0000000..1831576 Binary files /dev/null and b/cards100/event_back.webp differ diff --git a/cards100/power_1.webp b/cards100/power_1.webp new file mode 100644 index 0000000..e01bdc9 Binary files /dev/null and b/cards100/power_1.webp differ diff --git a/cards100/power_10.webp b/cards100/power_10.webp new file mode 100644 index 0000000..4c67d42 Binary files /dev/null and b/cards100/power_10.webp differ diff --git a/cards100/power_11.webp b/cards100/power_11.webp new file mode 100644 index 0000000..c81b9d1 Binary files /dev/null and b/cards100/power_11.webp differ diff --git a/cards100/power_12.webp b/cards100/power_12.webp new file mode 100644 index 0000000..42e0ba3 Binary files /dev/null and b/cards100/power_12.webp differ diff --git a/cards100/power_13.webp b/cards100/power_13.webp new file mode 100644 index 0000000..2de981f Binary files /dev/null and b/cards100/power_13.webp differ diff --git a/cards100/power_14.webp b/cards100/power_14.webp new file mode 100644 index 0000000..0d0fdc3 Binary files /dev/null and b/cards100/power_14.webp differ diff --git a/cards100/power_15.webp b/cards100/power_15.webp new file mode 100644 index 0000000..3962a61 Binary files /dev/null and b/cards100/power_15.webp differ diff --git a/cards100/power_16.webp b/cards100/power_16.webp new file mode 100644 index 0000000..8b6b67e Binary files /dev/null and b/cards100/power_16.webp differ diff --git a/cards100/power_17.webp b/cards100/power_17.webp new file mode 100644 index 0000000..4badde7 Binary files /dev/null and b/cards100/power_17.webp differ diff --git a/cards100/power_18.webp b/cards100/power_18.webp new file mode 100644 index 0000000..539fe52 Binary files /dev/null and b/cards100/power_18.webp differ diff --git a/cards100/power_19.webp b/cards100/power_19.webp new file mode 100644 index 0000000..959f1b6 Binary files /dev/null and b/cards100/power_19.webp differ diff --git a/cards100/power_2.webp b/cards100/power_2.webp new file mode 100644 index 0000000..53f0f22 Binary files /dev/null and b/cards100/power_2.webp differ diff --git a/cards100/power_20.webp b/cards100/power_20.webp new file mode 100644 index 0000000..f3a3152 Binary files /dev/null and b/cards100/power_20.webp differ diff --git a/cards100/power_21.webp b/cards100/power_21.webp new file mode 100644 index 0000000..27398d3 Binary files /dev/null and b/cards100/power_21.webp differ diff --git a/cards100/power_22.webp b/cards100/power_22.webp new file mode 100644 index 0000000..f62db58 Binary files /dev/null and b/cards100/power_22.webp differ diff --git a/cards100/power_23.webp b/cards100/power_23.webp new file mode 100644 index 0000000..c2f4b33 Binary files /dev/null and b/cards100/power_23.webp differ diff --git a/cards100/power_24.webp b/cards100/power_24.webp new file mode 100644 index 0000000..6c843d1 Binary files /dev/null and b/cards100/power_24.webp differ diff --git a/cards100/power_25.webp b/cards100/power_25.webp new file mode 100644 index 0000000..1c399c6 Binary files /dev/null and b/cards100/power_25.webp differ diff --git a/cards100/power_26.webp b/cards100/power_26.webp new file mode 100644 index 0000000..60cfba3 Binary files /dev/null and b/cards100/power_26.webp differ diff --git a/cards100/power_27.webp b/cards100/power_27.webp new file mode 100644 index 0000000..9cafa90 Binary files /dev/null and b/cards100/power_27.webp differ diff --git a/cards100/power_28.webp b/cards100/power_28.webp new file mode 100644 index 0000000..e2c5498 Binary files /dev/null and b/cards100/power_28.webp differ diff --git a/cards100/power_29.webp b/cards100/power_29.webp new file mode 100644 index 0000000..38a2d25 Binary files /dev/null and b/cards100/power_29.webp differ diff --git a/cards100/power_3.webp b/cards100/power_3.webp new file mode 100644 index 0000000..ea0c4ee Binary files /dev/null and b/cards100/power_3.webp differ diff --git a/cards100/power_30.webp b/cards100/power_30.webp new file mode 100644 index 0000000..4020aa5 Binary files /dev/null and b/cards100/power_30.webp differ diff --git a/cards100/power_31.webp b/cards100/power_31.webp new file mode 100644 index 0000000..a6b94b4 Binary files /dev/null and b/cards100/power_31.webp differ diff --git a/cards100/power_32.webp b/cards100/power_32.webp new file mode 100644 index 0000000..159dbf3 Binary files /dev/null and b/cards100/power_32.webp differ diff --git a/cards100/power_33.webp b/cards100/power_33.webp new file mode 100644 index 0000000..52844cd Binary files /dev/null and b/cards100/power_33.webp differ diff --git a/cards100/power_34.webp b/cards100/power_34.webp new file mode 100644 index 0000000..79fbab6 Binary files /dev/null and b/cards100/power_34.webp differ diff --git a/cards100/power_35.webp b/cards100/power_35.webp new file mode 100644 index 0000000..e71905d Binary files /dev/null and b/cards100/power_35.webp differ diff --git a/cards100/power_36.webp b/cards100/power_36.webp new file mode 100644 index 0000000..40b707e Binary files /dev/null and b/cards100/power_36.webp differ diff --git a/cards100/power_37.webp b/cards100/power_37.webp new file mode 100644 index 0000000..bca0b98 Binary files /dev/null and b/cards100/power_37.webp differ diff --git a/cards100/power_38.webp b/cards100/power_38.webp new file mode 100644 index 0000000..eb0ff2e Binary files /dev/null and b/cards100/power_38.webp differ diff --git a/cards100/power_39.webp b/cards100/power_39.webp new file mode 100644 index 0000000..8affe3b Binary files /dev/null and b/cards100/power_39.webp differ diff --git a/cards100/power_4.webp b/cards100/power_4.webp new file mode 100644 index 0000000..a7a0967 Binary files /dev/null and b/cards100/power_4.webp differ diff --git a/cards100/power_40.webp b/cards100/power_40.webp new file mode 100644 index 0000000..d212e3f Binary files /dev/null and b/cards100/power_40.webp differ diff --git a/cards100/power_41.webp b/cards100/power_41.webp new file mode 100644 index 0000000..28b500d Binary files /dev/null and b/cards100/power_41.webp differ diff --git a/cards100/power_42.webp b/cards100/power_42.webp new file mode 100644 index 0000000..aac8880 Binary files /dev/null and b/cards100/power_42.webp differ diff --git a/cards100/power_43.webp b/cards100/power_43.webp new file mode 100644 index 0000000..7d46505 Binary files /dev/null and b/cards100/power_43.webp differ diff --git a/cards100/power_44.webp b/cards100/power_44.webp new file mode 100644 index 0000000..b91e3e0 Binary files /dev/null and b/cards100/power_44.webp differ diff --git a/cards100/power_45.webp b/cards100/power_45.webp new file mode 100644 index 0000000..29a6c9a Binary files /dev/null and b/cards100/power_45.webp differ diff --git a/cards100/power_46.webp b/cards100/power_46.webp new file mode 100644 index 0000000..c234226 Binary files /dev/null and b/cards100/power_46.webp differ diff --git a/cards100/power_47.webp b/cards100/power_47.webp new file mode 100644 index 0000000..172684a Binary files /dev/null and b/cards100/power_47.webp differ diff --git a/cards100/power_48.webp b/cards100/power_48.webp new file mode 100644 index 0000000..6b84ae8 Binary files /dev/null and b/cards100/power_48.webp differ diff --git a/cards100/power_49.webp b/cards100/power_49.webp new file mode 100644 index 0000000..bc7d68a Binary files /dev/null and b/cards100/power_49.webp differ diff --git a/cards100/power_5.webp b/cards100/power_5.webp new file mode 100644 index 0000000..7f8d1a8 Binary files /dev/null and b/cards100/power_5.webp differ diff --git a/cards100/power_50.webp b/cards100/power_50.webp new file mode 100644 index 0000000..1991d98 Binary files /dev/null and b/cards100/power_50.webp differ diff --git a/cards100/power_51.webp b/cards100/power_51.webp new file mode 100644 index 0000000..1cea87c Binary files /dev/null and b/cards100/power_51.webp differ diff --git a/cards100/power_52.webp b/cards100/power_52.webp new file mode 100644 index 0000000..0c66b00 Binary files /dev/null and b/cards100/power_52.webp differ diff --git a/cards100/power_6.webp b/cards100/power_6.webp new file mode 100644 index 0000000..df790b4 Binary files /dev/null and b/cards100/power_6.webp differ diff --git a/cards100/power_7.webp b/cards100/power_7.webp new file mode 100644 index 0000000..1232080 Binary files /dev/null and b/cards100/power_7.webp differ diff --git a/cards100/power_8.webp b/cards100/power_8.webp new file mode 100644 index 0000000..6233375 Binary files /dev/null and b/cards100/power_8.webp differ diff --git a/cards100/power_9.webp b/cards100/power_9.webp new file mode 100644 index 0000000..37ad104 Binary files /dev/null and b/cards100/power_9.webp differ diff --git a/cards100/power_back.webp b/cards100/power_back.webp new file mode 100644 index 0000000..cc3ed96 Binary files /dev/null and b/cards100/power_back.webp differ diff --git a/cards200/event_1.webp b/cards200/event_1.webp new file mode 100644 index 0000000..f4304b1 Binary files /dev/null and b/cards200/event_1.webp differ diff --git a/cards200/event_10.webp b/cards200/event_10.webp new file mode 100644 index 0000000..14dc0ee Binary files /dev/null and b/cards200/event_10.webp differ diff --git a/cards200/event_100.webp b/cards200/event_100.webp new file mode 100644 index 0000000..456f810 Binary files /dev/null and b/cards200/event_100.webp differ diff --git a/cards200/event_101.webp b/cards200/event_101.webp new file mode 100644 index 0000000..82438eb Binary files /dev/null and b/cards200/event_101.webp differ diff --git a/cards200/event_102.webp b/cards200/event_102.webp new file mode 100644 index 0000000..ce3e920 Binary files /dev/null and b/cards200/event_102.webp differ diff --git a/cards200/event_103.webp b/cards200/event_103.webp new file mode 100644 index 0000000..1007783 Binary files /dev/null and b/cards200/event_103.webp differ diff --git a/cards200/event_104.webp b/cards200/event_104.webp new file mode 100644 index 0000000..78d5038 Binary files /dev/null and b/cards200/event_104.webp differ diff --git a/cards200/event_105.webp b/cards200/event_105.webp new file mode 100644 index 0000000..1df447d Binary files /dev/null and b/cards200/event_105.webp differ diff --git a/cards200/event_106.webp b/cards200/event_106.webp new file mode 100644 index 0000000..d28872b Binary files /dev/null and b/cards200/event_106.webp differ diff --git a/cards200/event_107.webp b/cards200/event_107.webp new file mode 100644 index 0000000..a09f6e5 Binary files /dev/null and b/cards200/event_107.webp differ diff --git a/cards200/event_108.webp b/cards200/event_108.webp new file mode 100644 index 0000000..e53ffd8 Binary files /dev/null and b/cards200/event_108.webp differ diff --git a/cards200/event_109.webp b/cards200/event_109.webp new file mode 100644 index 0000000..a9d40ab Binary files /dev/null and b/cards200/event_109.webp differ diff --git a/cards200/event_11.webp b/cards200/event_11.webp new file mode 100644 index 0000000..3d65c8c Binary files /dev/null and b/cards200/event_11.webp differ diff --git a/cards200/event_110.webp b/cards200/event_110.webp new file mode 100644 index 0000000..3fcecd5 Binary files /dev/null and b/cards200/event_110.webp differ diff --git a/cards200/event_12.webp b/cards200/event_12.webp new file mode 100644 index 0000000..76c7a1b Binary files /dev/null and b/cards200/event_12.webp differ diff --git a/cards200/event_13.webp b/cards200/event_13.webp new file mode 100644 index 0000000..6ab7fa3 Binary files /dev/null and b/cards200/event_13.webp differ diff --git a/cards200/event_14.webp b/cards200/event_14.webp new file mode 100644 index 0000000..a723316 Binary files /dev/null and b/cards200/event_14.webp differ diff --git a/cards200/event_15.webp b/cards200/event_15.webp new file mode 100644 index 0000000..0e70483 Binary files /dev/null and b/cards200/event_15.webp differ diff --git a/cards200/event_16.webp b/cards200/event_16.webp new file mode 100644 index 0000000..70f1988 Binary files /dev/null and b/cards200/event_16.webp differ diff --git a/cards200/event_17.webp b/cards200/event_17.webp new file mode 100644 index 0000000..4ad15b4 Binary files /dev/null and b/cards200/event_17.webp differ diff --git a/cards200/event_18.webp b/cards200/event_18.webp new file mode 100644 index 0000000..94459ea Binary files /dev/null and b/cards200/event_18.webp differ diff --git a/cards200/event_19.webp b/cards200/event_19.webp new file mode 100644 index 0000000..2f186df Binary files /dev/null and b/cards200/event_19.webp differ diff --git a/cards200/event_2.webp b/cards200/event_2.webp new file mode 100644 index 0000000..d3c04a7 Binary files /dev/null and b/cards200/event_2.webp differ diff --git a/cards200/event_20.webp b/cards200/event_20.webp new file mode 100644 index 0000000..56e771c Binary files /dev/null and b/cards200/event_20.webp differ diff --git a/cards200/event_21.webp b/cards200/event_21.webp new file mode 100644 index 0000000..7344fd9 Binary files /dev/null and b/cards200/event_21.webp differ diff --git a/cards200/event_22.webp b/cards200/event_22.webp new file mode 100644 index 0000000..87d539f Binary files /dev/null and b/cards200/event_22.webp differ diff --git a/cards200/event_23.webp b/cards200/event_23.webp new file mode 100644 index 0000000..9f297c8 Binary files /dev/null and b/cards200/event_23.webp differ diff --git a/cards200/event_24.webp b/cards200/event_24.webp new file mode 100644 index 0000000..c6be7da Binary files /dev/null and b/cards200/event_24.webp differ diff --git a/cards200/event_25.webp b/cards200/event_25.webp new file mode 100644 index 0000000..3e11268 Binary files /dev/null and b/cards200/event_25.webp differ diff --git a/cards200/event_26.webp b/cards200/event_26.webp new file mode 100644 index 0000000..ff259f1 Binary files /dev/null and b/cards200/event_26.webp differ diff --git a/cards200/event_27.webp b/cards200/event_27.webp new file mode 100644 index 0000000..5376eed Binary files /dev/null and b/cards200/event_27.webp differ diff --git a/cards200/event_28.webp b/cards200/event_28.webp new file mode 100644 index 0000000..97d3ee9 Binary files /dev/null and b/cards200/event_28.webp differ diff --git a/cards200/event_29.webp b/cards200/event_29.webp new file mode 100644 index 0000000..b8969a1 Binary files /dev/null and b/cards200/event_29.webp differ diff --git a/cards200/event_3.webp b/cards200/event_3.webp new file mode 100644 index 0000000..8e38616 Binary files /dev/null and b/cards200/event_3.webp differ diff --git a/cards200/event_30.webp b/cards200/event_30.webp new file mode 100644 index 0000000..a5a4837 Binary files /dev/null and b/cards200/event_30.webp differ diff --git a/cards200/event_31.webp b/cards200/event_31.webp new file mode 100644 index 0000000..e5bdd29 Binary files /dev/null and b/cards200/event_31.webp differ diff --git a/cards200/event_32.webp b/cards200/event_32.webp new file mode 100644 index 0000000..26ee578 Binary files /dev/null and b/cards200/event_32.webp differ diff --git a/cards200/event_33.webp b/cards200/event_33.webp new file mode 100644 index 0000000..fe37642 Binary files /dev/null and b/cards200/event_33.webp differ diff --git a/cards200/event_34.webp b/cards200/event_34.webp new file mode 100644 index 0000000..7bb3884 Binary files /dev/null and b/cards200/event_34.webp differ diff --git a/cards200/event_35.webp b/cards200/event_35.webp new file mode 100644 index 0000000..9e2dde8 Binary files /dev/null and b/cards200/event_35.webp differ diff --git a/cards200/event_36.webp b/cards200/event_36.webp new file mode 100644 index 0000000..5a801f0 Binary files /dev/null and b/cards200/event_36.webp differ diff --git a/cards200/event_37.webp b/cards200/event_37.webp new file mode 100644 index 0000000..7cf52b6 Binary files /dev/null and b/cards200/event_37.webp differ diff --git a/cards200/event_38.webp b/cards200/event_38.webp new file mode 100644 index 0000000..8502e48 Binary files /dev/null and b/cards200/event_38.webp differ diff --git a/cards200/event_39.webp b/cards200/event_39.webp new file mode 100644 index 0000000..0ad3781 Binary files /dev/null and b/cards200/event_39.webp differ diff --git a/cards200/event_4.webp b/cards200/event_4.webp new file mode 100644 index 0000000..12cf544 Binary files /dev/null and b/cards200/event_4.webp differ diff --git a/cards200/event_40.webp b/cards200/event_40.webp new file mode 100644 index 0000000..6b2e969 Binary files /dev/null and b/cards200/event_40.webp differ diff --git a/cards200/event_41.webp b/cards200/event_41.webp new file mode 100644 index 0000000..2dbef1f Binary files /dev/null and b/cards200/event_41.webp differ diff --git a/cards200/event_42.webp b/cards200/event_42.webp new file mode 100644 index 0000000..a131d4c Binary files /dev/null and b/cards200/event_42.webp differ diff --git a/cards200/event_43.webp b/cards200/event_43.webp new file mode 100644 index 0000000..783e4f1 Binary files /dev/null and b/cards200/event_43.webp differ diff --git a/cards200/event_44.webp b/cards200/event_44.webp new file mode 100644 index 0000000..d1316b5 Binary files /dev/null and b/cards200/event_44.webp differ diff --git a/cards200/event_45.webp b/cards200/event_45.webp new file mode 100644 index 0000000..46817a3 Binary files /dev/null and b/cards200/event_45.webp differ diff --git a/cards200/event_46.webp b/cards200/event_46.webp new file mode 100644 index 0000000..b9f66d4 Binary files /dev/null and b/cards200/event_46.webp differ diff --git a/cards200/event_47.webp b/cards200/event_47.webp new file mode 100644 index 0000000..cfe776a Binary files /dev/null and b/cards200/event_47.webp differ diff --git a/cards200/event_48.webp b/cards200/event_48.webp new file mode 100644 index 0000000..56ce918 Binary files /dev/null and b/cards200/event_48.webp differ diff --git a/cards200/event_49.webp b/cards200/event_49.webp new file mode 100644 index 0000000..cdcfbed Binary files /dev/null and b/cards200/event_49.webp differ diff --git a/cards200/event_5.webp b/cards200/event_5.webp new file mode 100644 index 0000000..6b84db6 Binary files /dev/null and b/cards200/event_5.webp differ diff --git a/cards200/event_50.webp b/cards200/event_50.webp new file mode 100644 index 0000000..ec14c14 Binary files /dev/null and b/cards200/event_50.webp differ diff --git a/cards200/event_51.webp b/cards200/event_51.webp new file mode 100644 index 0000000..074c9f6 Binary files /dev/null and b/cards200/event_51.webp differ diff --git a/cards200/event_52.webp b/cards200/event_52.webp new file mode 100644 index 0000000..6711bae Binary files /dev/null and b/cards200/event_52.webp differ diff --git a/cards200/event_53.webp b/cards200/event_53.webp new file mode 100644 index 0000000..ca62a7b Binary files /dev/null and b/cards200/event_53.webp differ diff --git a/cards200/event_54.webp b/cards200/event_54.webp new file mode 100644 index 0000000..5e222ea Binary files /dev/null and b/cards200/event_54.webp differ diff --git a/cards200/event_55.webp b/cards200/event_55.webp new file mode 100644 index 0000000..3dce13c Binary files /dev/null and b/cards200/event_55.webp differ diff --git a/cards200/event_56.webp b/cards200/event_56.webp new file mode 100644 index 0000000..3594f7f Binary files /dev/null and b/cards200/event_56.webp differ diff --git a/cards200/event_57.webp b/cards200/event_57.webp new file mode 100644 index 0000000..435f9db Binary files /dev/null and b/cards200/event_57.webp differ diff --git a/cards200/event_58.webp b/cards200/event_58.webp new file mode 100644 index 0000000..30d7c20 Binary files /dev/null and b/cards200/event_58.webp differ diff --git a/cards200/event_59.webp b/cards200/event_59.webp new file mode 100644 index 0000000..b75ecf2 Binary files /dev/null and b/cards200/event_59.webp differ diff --git a/cards200/event_6.webp b/cards200/event_6.webp new file mode 100644 index 0000000..e708af7 Binary files /dev/null and b/cards200/event_6.webp differ diff --git a/cards200/event_60.webp b/cards200/event_60.webp new file mode 100644 index 0000000..6e5b3e8 Binary files /dev/null and b/cards200/event_60.webp differ diff --git a/cards200/event_61.webp b/cards200/event_61.webp new file mode 100644 index 0000000..5011fa6 Binary files /dev/null and b/cards200/event_61.webp differ diff --git a/cards200/event_62.webp b/cards200/event_62.webp new file mode 100644 index 0000000..4192e3c Binary files /dev/null and b/cards200/event_62.webp differ diff --git a/cards200/event_63.webp b/cards200/event_63.webp new file mode 100644 index 0000000..c963bdf Binary files /dev/null and b/cards200/event_63.webp differ diff --git a/cards200/event_64.webp b/cards200/event_64.webp new file mode 100644 index 0000000..4914c35 Binary files /dev/null and b/cards200/event_64.webp differ diff --git a/cards200/event_65.webp b/cards200/event_65.webp new file mode 100644 index 0000000..a4502be Binary files /dev/null and b/cards200/event_65.webp differ diff --git a/cards200/event_66.webp b/cards200/event_66.webp new file mode 100644 index 0000000..43a61ee Binary files /dev/null and b/cards200/event_66.webp differ diff --git a/cards200/event_67.webp b/cards200/event_67.webp new file mode 100644 index 0000000..3f5b00d Binary files /dev/null and b/cards200/event_67.webp differ diff --git a/cards200/event_68.webp b/cards200/event_68.webp new file mode 100644 index 0000000..8238f60 Binary files /dev/null and b/cards200/event_68.webp differ diff --git a/cards200/event_69.webp b/cards200/event_69.webp new file mode 100644 index 0000000..219f77e Binary files /dev/null and b/cards200/event_69.webp differ diff --git a/cards200/event_7.webp b/cards200/event_7.webp new file mode 100644 index 0000000..b8a9820 Binary files /dev/null and b/cards200/event_7.webp differ diff --git a/cards200/event_70.webp b/cards200/event_70.webp new file mode 100644 index 0000000..40fe8e0 Binary files /dev/null and b/cards200/event_70.webp differ diff --git a/cards200/event_71.webp b/cards200/event_71.webp new file mode 100644 index 0000000..9628ac7 Binary files /dev/null and b/cards200/event_71.webp differ diff --git a/cards200/event_72.webp b/cards200/event_72.webp new file mode 100644 index 0000000..7dd82a0 Binary files /dev/null and b/cards200/event_72.webp differ diff --git a/cards200/event_73.webp b/cards200/event_73.webp new file mode 100644 index 0000000..dc9a116 Binary files /dev/null and b/cards200/event_73.webp differ diff --git a/cards200/event_74.webp b/cards200/event_74.webp new file mode 100644 index 0000000..b6d4cee Binary files /dev/null and b/cards200/event_74.webp differ diff --git a/cards200/event_75.webp b/cards200/event_75.webp new file mode 100644 index 0000000..85e1986 Binary files /dev/null and b/cards200/event_75.webp differ diff --git a/cards200/event_76.webp b/cards200/event_76.webp new file mode 100644 index 0000000..2817081 Binary files /dev/null and b/cards200/event_76.webp differ diff --git a/cards200/event_77.webp b/cards200/event_77.webp new file mode 100644 index 0000000..88e9e95 Binary files /dev/null and b/cards200/event_77.webp differ diff --git a/cards200/event_78.webp b/cards200/event_78.webp new file mode 100644 index 0000000..271b0d0 Binary files /dev/null and b/cards200/event_78.webp differ diff --git a/cards200/event_79.webp b/cards200/event_79.webp new file mode 100644 index 0000000..dbe8982 Binary files /dev/null and b/cards200/event_79.webp differ diff --git a/cards200/event_8.webp b/cards200/event_8.webp new file mode 100644 index 0000000..bb61f2d Binary files /dev/null and b/cards200/event_8.webp differ diff --git a/cards200/event_80.webp b/cards200/event_80.webp new file mode 100644 index 0000000..c89d6af Binary files /dev/null and b/cards200/event_80.webp differ diff --git a/cards200/event_81.webp b/cards200/event_81.webp new file mode 100644 index 0000000..976a368 Binary files /dev/null and b/cards200/event_81.webp differ diff --git a/cards200/event_82.webp b/cards200/event_82.webp new file mode 100644 index 0000000..0f3fe27 Binary files /dev/null and b/cards200/event_82.webp differ diff --git a/cards200/event_83.webp b/cards200/event_83.webp new file mode 100644 index 0000000..70cecc4 Binary files /dev/null and b/cards200/event_83.webp differ diff --git a/cards200/event_84.webp b/cards200/event_84.webp new file mode 100644 index 0000000..8d96761 Binary files /dev/null and b/cards200/event_84.webp differ diff --git a/cards200/event_85.webp b/cards200/event_85.webp new file mode 100644 index 0000000..3d74464 Binary files /dev/null and b/cards200/event_85.webp differ diff --git a/cards200/event_86.webp b/cards200/event_86.webp new file mode 100644 index 0000000..3fd9c63 Binary files /dev/null and b/cards200/event_86.webp differ diff --git a/cards200/event_87.webp b/cards200/event_87.webp new file mode 100644 index 0000000..1907e16 Binary files /dev/null and b/cards200/event_87.webp differ diff --git a/cards200/event_88.webp b/cards200/event_88.webp new file mode 100644 index 0000000..1eb3e8b Binary files /dev/null and b/cards200/event_88.webp differ diff --git a/cards200/event_89.webp b/cards200/event_89.webp new file mode 100644 index 0000000..0d74ea0 Binary files /dev/null and b/cards200/event_89.webp differ diff --git a/cards200/event_9.webp b/cards200/event_9.webp new file mode 100644 index 0000000..6fbb835 Binary files /dev/null and b/cards200/event_9.webp differ diff --git a/cards200/event_90.webp b/cards200/event_90.webp new file mode 100644 index 0000000..a0eb56a Binary files /dev/null and b/cards200/event_90.webp differ diff --git a/cards200/event_91.webp b/cards200/event_91.webp new file mode 100644 index 0000000..dde0502 Binary files /dev/null and b/cards200/event_91.webp differ diff --git a/cards200/event_92.webp b/cards200/event_92.webp new file mode 100644 index 0000000..acb9a25 Binary files /dev/null and b/cards200/event_92.webp differ diff --git a/cards200/event_93.webp b/cards200/event_93.webp new file mode 100644 index 0000000..b91814e Binary files /dev/null and b/cards200/event_93.webp differ diff --git a/cards200/event_94.webp b/cards200/event_94.webp new file mode 100644 index 0000000..763da64 Binary files /dev/null and b/cards200/event_94.webp differ diff --git a/cards200/event_95.webp b/cards200/event_95.webp new file mode 100644 index 0000000..1314556 Binary files /dev/null and b/cards200/event_95.webp differ diff --git a/cards200/event_96.webp b/cards200/event_96.webp new file mode 100644 index 0000000..6c84709 Binary files /dev/null and b/cards200/event_96.webp differ diff --git a/cards200/event_97.webp b/cards200/event_97.webp new file mode 100644 index 0000000..bf483ef Binary files /dev/null and b/cards200/event_97.webp differ diff --git a/cards200/event_98.webp b/cards200/event_98.webp new file mode 100644 index 0000000..0f0ad1d Binary files /dev/null and b/cards200/event_98.webp differ diff --git a/cards200/event_99.webp b/cards200/event_99.webp new file mode 100644 index 0000000..5ae6e85 Binary files /dev/null and b/cards200/event_99.webp differ diff --git a/cards200/event_back.webp b/cards200/event_back.webp new file mode 100644 index 0000000..8243788 Binary files /dev/null and b/cards200/event_back.webp differ diff --git a/cards200/power_1.webp b/cards200/power_1.webp new file mode 100644 index 0000000..9b5f61d Binary files /dev/null and b/cards200/power_1.webp differ diff --git a/cards200/power_10.webp b/cards200/power_10.webp new file mode 100644 index 0000000..f24e04f Binary files /dev/null and b/cards200/power_10.webp differ diff --git a/cards200/power_11.webp b/cards200/power_11.webp new file mode 100644 index 0000000..5bb27f0 Binary files /dev/null and b/cards200/power_11.webp differ diff --git a/cards200/power_12.webp b/cards200/power_12.webp new file mode 100644 index 0000000..ff100b0 Binary files /dev/null and b/cards200/power_12.webp differ diff --git a/cards200/power_13.webp b/cards200/power_13.webp new file mode 100644 index 0000000..951b677 Binary files /dev/null and b/cards200/power_13.webp differ diff --git a/cards200/power_14.webp b/cards200/power_14.webp new file mode 100644 index 0000000..c1af6a8 Binary files /dev/null and b/cards200/power_14.webp differ diff --git a/cards200/power_15.webp b/cards200/power_15.webp new file mode 100644 index 0000000..e0dfb2e Binary files /dev/null and b/cards200/power_15.webp differ diff --git a/cards200/power_16.webp b/cards200/power_16.webp new file mode 100644 index 0000000..10103a2 Binary files /dev/null and b/cards200/power_16.webp differ diff --git a/cards200/power_17.webp b/cards200/power_17.webp new file mode 100644 index 0000000..a8dff31 Binary files /dev/null and b/cards200/power_17.webp differ diff --git a/cards200/power_18.webp b/cards200/power_18.webp new file mode 100644 index 0000000..8f94bf0 Binary files /dev/null and b/cards200/power_18.webp differ diff --git a/cards200/power_19.webp b/cards200/power_19.webp new file mode 100644 index 0000000..f5d36b4 Binary files /dev/null and b/cards200/power_19.webp differ diff --git a/cards200/power_2.webp b/cards200/power_2.webp new file mode 100644 index 0000000..686229c Binary files /dev/null and b/cards200/power_2.webp differ diff --git a/cards200/power_20.webp b/cards200/power_20.webp new file mode 100644 index 0000000..b462559 Binary files /dev/null and b/cards200/power_20.webp differ diff --git a/cards200/power_21.webp b/cards200/power_21.webp new file mode 100644 index 0000000..be2c405 Binary files /dev/null and b/cards200/power_21.webp differ diff --git a/cards200/power_22.webp b/cards200/power_22.webp new file mode 100644 index 0000000..4bb6160 Binary files /dev/null and b/cards200/power_22.webp differ diff --git a/cards200/power_23.webp b/cards200/power_23.webp new file mode 100644 index 0000000..293ca37 Binary files /dev/null and b/cards200/power_23.webp differ diff --git a/cards200/power_24.webp b/cards200/power_24.webp new file mode 100644 index 0000000..07ac041 Binary files /dev/null and b/cards200/power_24.webp differ diff --git a/cards200/power_25.webp b/cards200/power_25.webp new file mode 100644 index 0000000..f5acaff Binary files /dev/null and b/cards200/power_25.webp differ diff --git a/cards200/power_26.webp b/cards200/power_26.webp new file mode 100644 index 0000000..0d628b2 Binary files /dev/null and b/cards200/power_26.webp differ diff --git a/cards200/power_27.webp b/cards200/power_27.webp new file mode 100644 index 0000000..eb39574 Binary files /dev/null and b/cards200/power_27.webp differ diff --git a/cards200/power_28.webp b/cards200/power_28.webp new file mode 100644 index 0000000..d387557 Binary files /dev/null and b/cards200/power_28.webp differ diff --git a/cards200/power_29.webp b/cards200/power_29.webp new file mode 100644 index 0000000..e99dc5a Binary files /dev/null and b/cards200/power_29.webp differ diff --git a/cards200/power_3.webp b/cards200/power_3.webp new file mode 100644 index 0000000..a36b1e9 Binary files /dev/null and b/cards200/power_3.webp differ diff --git a/cards200/power_30.webp b/cards200/power_30.webp new file mode 100644 index 0000000..20125e6 Binary files /dev/null and b/cards200/power_30.webp differ diff --git a/cards200/power_31.webp b/cards200/power_31.webp new file mode 100644 index 0000000..a6ff963 Binary files /dev/null and b/cards200/power_31.webp differ diff --git a/cards200/power_32.webp b/cards200/power_32.webp new file mode 100644 index 0000000..69ece76 Binary files /dev/null and b/cards200/power_32.webp differ diff --git a/cards200/power_33.webp b/cards200/power_33.webp new file mode 100644 index 0000000..22e8b4e Binary files /dev/null and b/cards200/power_33.webp differ diff --git a/cards200/power_34.webp b/cards200/power_34.webp new file mode 100644 index 0000000..845b39a Binary files /dev/null and b/cards200/power_34.webp differ diff --git a/cards200/power_35.webp b/cards200/power_35.webp new file mode 100644 index 0000000..b05ce45 Binary files /dev/null and b/cards200/power_35.webp differ diff --git a/cards200/power_36.webp b/cards200/power_36.webp new file mode 100644 index 0000000..092b033 Binary files /dev/null and b/cards200/power_36.webp differ diff --git a/cards200/power_37.webp b/cards200/power_37.webp new file mode 100644 index 0000000..8059cff Binary files /dev/null and b/cards200/power_37.webp differ diff --git a/cards200/power_38.webp b/cards200/power_38.webp new file mode 100644 index 0000000..1448c4a Binary files /dev/null and b/cards200/power_38.webp differ diff --git a/cards200/power_39.webp b/cards200/power_39.webp new file mode 100644 index 0000000..3118a3c Binary files /dev/null and b/cards200/power_39.webp differ diff --git a/cards200/power_4.webp b/cards200/power_4.webp new file mode 100644 index 0000000..d34d8a0 Binary files /dev/null and b/cards200/power_4.webp differ diff --git a/cards200/power_40.webp b/cards200/power_40.webp new file mode 100644 index 0000000..ca6b110 Binary files /dev/null and b/cards200/power_40.webp differ diff --git a/cards200/power_41.webp b/cards200/power_41.webp new file mode 100644 index 0000000..9976e6c Binary files /dev/null and b/cards200/power_41.webp differ diff --git a/cards200/power_42.webp b/cards200/power_42.webp new file mode 100644 index 0000000..ff95220 Binary files /dev/null and b/cards200/power_42.webp differ diff --git a/cards200/power_43.webp b/cards200/power_43.webp new file mode 100644 index 0000000..09c14d9 Binary files /dev/null and b/cards200/power_43.webp differ diff --git a/cards200/power_44.webp b/cards200/power_44.webp new file mode 100644 index 0000000..8154856 Binary files /dev/null and b/cards200/power_44.webp differ diff --git a/cards200/power_45.webp b/cards200/power_45.webp new file mode 100644 index 0000000..c881f4a Binary files /dev/null and b/cards200/power_45.webp differ diff --git a/cards200/power_46.webp b/cards200/power_46.webp new file mode 100644 index 0000000..1dafa80 Binary files /dev/null and b/cards200/power_46.webp differ diff --git a/cards200/power_47.webp b/cards200/power_47.webp new file mode 100644 index 0000000..4cee530 Binary files /dev/null and b/cards200/power_47.webp differ diff --git a/cards200/power_48.webp b/cards200/power_48.webp new file mode 100644 index 0000000..56638e6 Binary files /dev/null and b/cards200/power_48.webp differ diff --git a/cards200/power_49.webp b/cards200/power_49.webp new file mode 100644 index 0000000..019c3b8 Binary files /dev/null and b/cards200/power_49.webp differ diff --git a/cards200/power_5.webp b/cards200/power_5.webp new file mode 100644 index 0000000..c2f72b0 Binary files /dev/null and b/cards200/power_5.webp differ diff --git a/cards200/power_50.webp b/cards200/power_50.webp new file mode 100644 index 0000000..fec2b61 Binary files /dev/null and b/cards200/power_50.webp differ diff --git a/cards200/power_51.webp b/cards200/power_51.webp new file mode 100644 index 0000000..642eb5c Binary files /dev/null and b/cards200/power_51.webp differ diff --git a/cards200/power_52.webp b/cards200/power_52.webp new file mode 100644 index 0000000..3615a9e Binary files /dev/null and b/cards200/power_52.webp differ diff --git a/cards200/power_6.webp b/cards200/power_6.webp new file mode 100644 index 0000000..fbf68b0 Binary files /dev/null and b/cards200/power_6.webp differ diff --git a/cards200/power_7.webp b/cards200/power_7.webp new file mode 100644 index 0000000..0055b94 Binary files /dev/null and b/cards200/power_7.webp differ diff --git a/cards200/power_8.webp b/cards200/power_8.webp new file mode 100644 index 0000000..3ed5f0a Binary files /dev/null and b/cards200/power_8.webp differ diff --git a/cards200/power_9.webp b/cards200/power_9.webp new file mode 100644 index 0000000..1f0a8f2 Binary files /dev/null and b/cards200/power_9.webp differ diff --git a/cards200/power_back.webp b/cards200/power_back.webp new file mode 100644 index 0000000..aa9d351 Binary files /dev/null and b/cards200/power_back.webp differ diff --git a/map150.jpg b/map150.jpg new file mode 100644 index 0000000..0726d04 Binary files /dev/null and b/map150.jpg differ diff --git a/map75.jpg b/map75.jpg new file mode 100644 index 0000000..db34ab4 Binary files /dev/null and b/map75.jpg differ -- cgit v1.2.3 From 5d81b4294bd8f9b20ac8a396a185f6cf9550c00f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Oct 2024 11:58:58 +0200 Subject: Update client. Fixed some spelling errors in space data table. Create tools directory and add Makefile. Add layout.svg with boxes drawn on top of locations. Add genlayout.js to create list of box locations. Add gencolors.js to create beveled marker border colors. Major rewrite of play.js and play.css with official assets. --- Makefile | 9 + data.js | 1355 +++++++++++++++++++++++++++++++++++++++++++++++--- gencode.js | 107 ---- images/trash-can.svg | 1 + info/cards.html | 193 +++++++ play.css | 1010 +++++++++++++------------------------ play.html | 236 ++++----- play.js | 1080 +++++++++++++++++----------------------- rules.js | 71 ++- tools/colors.js | 110 ++++ tools/gencode.js | 106 ++++ tools/gencolors.js | 78 +++ tools/genlayout.js | 37 ++ tools/layout.svg | 920 ++++++++++++++++++++++++++++++++++ 14 files changed, 3651 insertions(+), 1662 deletions(-) create mode 100644 Makefile delete mode 100644 gencode.js create mode 100644 images/trash-can.svg create mode 100644 info/cards.html create mode 100644 tools/colors.js create mode 100644 tools/gencode.js create mode 100644 tools/gencolors.js create mode 100644 tools/genlayout.js create mode 100644 tools/layout.svg diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..daa5c21 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +default: rules.js play.js +rules.js: events.txt + sed '/const CODE /,$$d' < rules.js > /tmp/rules.js + node tools/gencode.js >> /tmp/rules.js + cp /tmp/rules.js rules.js +play.js: tools/layout.svg + sed '/var LAYOUT /,$$d' < play.js > /tmp/play.js + node tools/genlayout.js >> /tmp/play.js + cp /tmp/play.js play.js diff --git a/data.js b/data.js index 17e7530..6c37c50 100644 --- a/data.js +++ b/data.js @@ -1,80 +1,1280 @@ -const spaces = [ - null, - {name_unique: 'Schwerin', space_id: 1, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 111, y: 61}, adjacent: [2, 3, , , ]}, - {name_unique: 'Rostock', space_id: 2, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 228, y: 41}, adjacent: [1, 3, , , ]}, - {name_unique: 'Berlin', space_id: 3, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 251, y: 113}, adjacent: [1, 2, 5, 9, ]}, - {name_unique: 'German Writers', space_id: 4, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 185}, adjacent: [5, , , , ]}, - {name_unique: 'Walter Ulbricht Academy', space_id: 5, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 187}, adjacent: [3, 4, , , ]}, - {name_unique: 'Lutherian Church', space_id: 6, socio: 7, stability: 5, battleground: 1, demInfl: 1, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 300, y: 212}, adjacent: [9, , , , ]}, - {name_unique: 'Magdeburg', space_id: 7, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 275}, adjacent: [8, 10, 11, , ]}, - {name_unique: 'Halle', space_id: 8, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 278}, adjacent: [7, 9, 11, , ]}, - {name_unique: 'Leipzig', space_id: 9, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 297, y: 297}, adjacent: [3, 6, 8, 11, 12]}, - {name_unique: 'Erfurt', space_id: 10, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 23, y: 356}, adjacent: [7, , , , ]}, - {name_unique: 'Karl-Marx-Stadt', space_id: 11, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 138, y: 385}, adjacent: [7, 8, 9, 12, ]}, - {name_unique: 'Dresden', space_id: 12, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 262, y: 375}, adjacent: [9, 11, 19, 27, ]}, - {name_unique: 'Szczecin', space_id: 13, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 434, y: 204}, adjacent: [14, 16, , , ]}, - {name_unique: 'Gdańsk', space_id: 14, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 699, y: 215}, adjacent: [13, 15, 16, 17, 18]}, - {name_unique: 'Bydgoszcz', space_id: 15, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 304}, adjacent: [14, 17, , , ]}, - {name_unique: 'Poznań', space_id: 16, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 521, y: 355}, adjacent: [13, 14, 19, 20, ]}, - {name_unique: 'Warszawa', space_id: 17, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 806, y: 383}, adjacent: [14, 15, 18, 21, 24]}, - {name_unique: 'Białystok', space_id: 18, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 940, y: 342}, adjacent: [14, 17, 24, , ]}, - {name_unique: 'Wrocław', space_id: 19, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 462, y: 443}, adjacent: [12, 16, 20, 22, ]}, - {name_unique: 'Catholic Church, Poland', space_id: 20, socio: 7, stability: 5, battleground: 0, demInfl: 5, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 625, y: 437}, adjacent: [16, 19, 21, 22, 23]}, - {name_unique: 'Łódź', space_id: 21, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 749, y: 486}, adjacent: [17, 20, 23, 24, ]}, - {name_unique: 'Katowice', space_id: 22, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 570, y: 569}, adjacent: [19, 20, 23, 33, ]}, - {name_unique: 'Kraków', space_id: 23, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 711, y: 598}, adjacent: [20, 21, 22, 25, ]}, - {name_unique: 'Lublin', space_id: 24, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 879, y: 603}, adjacent: [17, 18, 21, , ]}, - {name_unique: 'Jagiellian University', space_id: 25, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 681}, adjacent: [23, 26, , , ]}, - {name_unique: 'Polish Writers', space_id: 26, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 832, y: 694}, adjacent: [25, , , , ]}, - {name_unique: 'Plzeň', space_id: 27, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 159, y: 483}, adjacent: [12, 28, 29, , ]}, - {name_unique: 'České Budĕjovice', space_id: 28, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 196, y: 601}, adjacent: [27, 29, , , ]}, - {name_unique: 'Praha', space_id: 29, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 317, y: 614}, adjacent: [27, 28, 30, 32, ]}, - {name_unique: 'Charles University', space_id: 30, socio: 6, stability: 1, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 380, y: 532}, adjacent: [29, 31, , , ]}, - {name_unique: 'Czech Writers', space_id: 31, socio: 5, stability: 2, battleground: 1, demInfl: 2, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 444, y: 607}, adjacent: [30, , , , ]}, - {name_unique: 'Brno', space_id: 32, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 403, y: 711}, adjacent: [29, 33, 34, , ]}, - {name_unique: 'Ostrava', space_id: 33, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 523, y: 681}, adjacent: [22, 32, 34, 35, ]}, - {name_unique: 'Bratislava', space_id: 34, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 417, y: 797}, adjacent: [32, 33, 35, , ]}, - {name_unique: 'Catholic Church, Czechoslovakia', space_id: 35, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 538, y: 794}, adjacent: [33, 34, 36, , ]}, - {name_unique: 'Prešov', space_id: 36, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 658, y: 794}, adjacent: [35, 37, , , ]}, - {name_unique: 'Košice', space_id: 37, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 777, y: 815}, adjacent: [36, 42, , , ]}, - {name_unique: 'Catholic Church, Hungary', space_id: 38, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 314, y: 886}, adjacent: [39, 43, , , ]}, - {name_unique: 'Győr', space_id: 39, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 434, y: 887}, adjacent: [38, 40, 43, 44, ]}, - {name_unique: 'Tatabánya', space_id: 40, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 549, y: 886}, adjacent: [39, 41, 45, , ]}, - {name_unique: 'Miskolc', space_id: 41, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 664, y: 901}, adjacent: [40, 42, 45, , ]}, - {name_unique: 'Debrecen', space_id: 42, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 781, y: 938}, adjacent: [37, 41, , , ]}, - {name_unique: 'Szombathely', space_id: 43, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Hungary', region: 'Eastern Europe', box: {x: 316, y: 963}, adjacent: [38, 39, 44, , ]}, - {name_unique: 'Székesfehérvár', space_id: 44, socio: 4, stability: 3, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 442, y: 962}, adjacent: [39, 43, 45, , ]}, - {name_unique: 'Budapest', space_id: 45, socio: 2, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 630, y: 983}, adjacent: [40, 41, 44, 47, 48]}, - {name_unique: 'Hungarian Writers', space_id: 46, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 348, y: 1040}, adjacent: [47, , , , ]}, - {name_unique: 'Eötvös Loránd University', space_id: 47, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 512, y: 1034}, adjacent: [46, 45, , , ]}, - {name_unique: 'Szeged', space_id: 48, socio: 3, stability: 4, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 632, y: 1073}, adjacent: [45, 49, 50, , ]}, - {name_unique: 'Pécs', space_id: 49, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 486, y: 1105}, adjacent: [48, , , , ]}, - {name_unique: 'Timişoara', space_id: 50, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 597, y: 1204}, adjacent: [48, 51, 60, , ]}, - {name_unique: 'Cluj-Napoca', space_id: 51, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 756, y: 1125}, adjacent: [50, 54, 58, 61, ]}, - {name_unique: 'Târgu Mureş', space_id: 52, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 915, y: 1136}, adjacent: [53, 56, , , ]}, - {name_unique: 'Iaşi', space_id: 53, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1072, y: 1097}, adjacent: [52, 57, 62, , ]}, - {name_unique: 'Babeş-Bolyai University', space_id: 54, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 746, y: 1203}, adjacent: [51, 55, , , ]}, - {name_unique: 'Romanian Writers', space_id: 55, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 739, y: 1278}, adjacent: [54, , , , ]}, - {name_unique: 'Hargita/Covasna', space_id: 56, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 928, y: 1227}, adjacent: [52, , , , ]}, - {name_unique: 'Braşov', space_id: 57, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1049, y: 1225}, adjacent: [53, 59, 61, , ]}, - {name_unique: 'Orthodox Church Romania', space_id: 58, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 855, y: 1338}, adjacent: [51, 60, , , ]}, - {name_unique: 'Ploieşti', space_id: 59, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1061, y: 1316}, adjacent: [57, 61, 62, , ]}, - {name_unique: 'Craiova', space_id: 60, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 763, y: 1411}, adjacent: [50, 58, 61, , ]}, - {name_unique: 'Bucureşti', space_id: 61, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 929, y: 1445}, adjacent: [51, 57, 59, 60, 63]}, - {name_unique: 'Galaţi', space_id: 62, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1104, y: 1399}, adjacent: [53, 59, 63, , ]}, - {name_unique: 'Constanţa', space_id: 63, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1130, y: 1517}, adjacent: [61, 62, 72, , ]}, - {name_unique: 'Pleven', space_id: 64, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 764, y: 1534}, adjacent: [68, , , , ]}, - {name_unique: 'Orthodox Church Bulgaria', space_id: 65, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 882, y: 1540}, adjacent: [66, 68, , , ]}, - {name_unique: 'Ruse', space_id: 66, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 998, y: 1540}, adjacent: [65, 69, 70, 71, 72]}, - {name_unique: 'Sofia University', space_id: 67, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 645, y: 1650}, adjacent: [68, 73, , , ]}, - {name_unique: 'Sofia', space_id: 68, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Bulgaria', region: 'Balkans', box: {x: 768, y: 1653}, adjacent: [64, 65, 67, 69, 74]}, - {name_unique: 'Stara Zagora', space_id: 69, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Bulgaria', region: 'Balkans', box: {x: 886, y: 1694}, adjacent: [66, 68, 71, , ]}, - {name_unique: 'Razgrad', space_id: 70, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 954, y: 1620}, adjacent: [66, , , , ]}, - {name_unique: 'Burgas', space_id: 71, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1004, y: 1695}, adjacent: [66, 69, 72, , ]}, - {name_unique: 'Varna', space_id: 72, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [63, 66, 71, , ]}, - {name_unique: 'Bulgarian Writers', space_id: 73, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [67, , , , ]}, - {name_unique: 'Plovdiv', space_id: 74, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [68, 75, , , ]}, - {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]} +const spaces = [ + null, + { + name_unique: "Schwerin", + space_id: 1, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 111, + y: 61, + }, + adjacent: [ 2, 3 ], + ascii_name: "Schwerin", + }, + { + name_unique: "Rostock", + space_id: 2, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 228, + y: 41, + }, + adjacent: [ 1, 3 ], + ascii_name: "Rostock", + }, + { + name_unique: "Berlin", + space_id: 3, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 251, + y: 113, + }, + adjacent: [ 1, 2, 5, 9 ], + ascii_name: "Berlin", + }, + { + name_unique: "German Writers", + space_id: 4, + socio: 5, + stability: 2, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 58, + y: 185, + }, + adjacent: [ 5 ], + ascii_name: "German Writers", + }, + { + name_unique: "Walter Ulbricht Academy", + space_id: 5, + socio: 6, + stability: 1, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 175, + y: 187, + }, + adjacent: [ 3, 4 ], + ascii_name: "Walter Ulbricht Academy", + }, + { + name_unique: "Lutheran Church", + space_id: 6, + socio: 7, + stability: 5, + battleground: 1, + demInfl: 1, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 300, + y: 212, + }, + adjacent: [ 9 ], + ascii_name: "Lutheran Church", + }, + { + name_unique: "Magdeburg", + space_id: 7, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 58, + y: 275, + }, + adjacent: [ 8, 10, 11 ], + ascii_name: "Magdeburg", + }, + { + name_unique: "Halle", + space_id: 8, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 175, + y: 278, + }, + adjacent: [ 7, 9, 11 ], + ascii_name: "Halle", + }, + { + name_unique: "Leipzig", + space_id: 9, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 297, + y: 297, + }, + adjacent: [ 3, 6, 8, 11, 12 ], + ascii_name: "Leipzig", + }, + { + name_unique: "Erfurt", + space_id: 10, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 23, + y: 356, + }, + adjacent: [ 7 ], + ascii_name: "Erfurt", + }, + { + name_unique: "Karl-Marx-Stadt", + space_id: 11, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 138, + y: 385, + }, + adjacent: [ 7, 8, 9, 12 ], + ascii_name: "Karl-Marx-Stadt", + }, + { + name_unique: "Dresden", + space_id: 12, + socio: 1, + stability: 4, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "East_Germany", + region: "Eastern Europe", + box: { + x: 262, + y: 375, + }, + adjacent: [ 9, 11, 19, 27 ], + ascii_name: "Dresden", + }, + { + name_unique: "Szczecin", + space_id: 13, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 434, + y: 204, + }, + adjacent: [ 14, 16 ], + ascii_name: "Szczecin", + }, + { + name_unique: "Gdańsk", + space_id: 14, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 1, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 699, + y: 215, + }, + adjacent: [ 13, 15, 16, 17, 18 ], + ascii_name: "Gdansk", + }, + { + name_unique: "Bydgoszcz", + space_id: 15, + socio: 1, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 1, + country: "Poland", + region: "Eastern Europe", + box: { + x: 679, + y: 304, + }, + adjacent: [ 14, 17 ], + ascii_name: "Bydgoszcz", + }, + { + name_unique: "Poznań", + space_id: 16, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 521, + y: 355, + }, + adjacent: [ 13, 14, 19, 20 ], + ascii_name: "Poznan", + }, + { + name_unique: "Warszawa", + space_id: 17, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 1, + country: "Poland", + region: "Eastern Europe", + box: { + x: 806, + y: 383, + }, + adjacent: [ 14, 15, 18, 21, 24 ], + ascii_name: "Warszawa", + }, + { + name_unique: "Białystok", + space_id: 18, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 940, + y: 342, + }, + adjacent: [ 14, 17, 24 ], + ascii_name: "Bialystok", + }, + { + name_unique: "Wrocław", + space_id: 19, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 462, + y: 443, + }, + adjacent: [ 12, 16, 20, 22 ], + ascii_name: "Wroclaw", + }, + { + name_unique: "Catholic Church, Poland", + space_id: 20, + socio: 7, + stability: 5, + battleground: 0, + demInfl: 5, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 625, + y: 437, + }, + adjacent: [ 16, 19, 21, 22, 23 ], + ascii_name: "Catholic Church, Poland", + }, + { + name_unique: "Łódź", + space_id: 21, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 749, + y: 486, + }, + adjacent: [ 17, 20, 23, 24 ], + ascii_name: "Lodz", + }, + { + name_unique: "Katowice", + space_id: 22, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 570, + y: 569, + }, + adjacent: [ 19, 20, 23, 33 ], + ascii_name: "Katowice", + }, + { + name_unique: "Kraków", + space_id: 23, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 1, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 711, + y: 598, + }, + adjacent: [ 20, 21, 22, 25 ], + ascii_name: "Krakow", + }, + { + name_unique: "Lublin", + space_id: 24, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 1, + country: "Poland", + region: "Eastern Europe", + box: { + x: 879, + y: 603, + }, + adjacent: [ 17, 18, 21 ], + ascii_name: "Lublin", + }, + { + name_unique: "Jagiellonian University", + space_id: 25, + socio: 6, + stability: 1, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 679, + y: 681, + }, + adjacent: [ 23, 26 ], + ascii_name: "Jagiellonian University", + }, + { + name_unique: "Polish Writers", + space_id: 26, + socio: 5, + stability: 2, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Poland", + region: "Eastern Europe", + box: { + x: 832, + y: 694, + }, + adjacent: [ 25 ], + ascii_name: "Polish Writers", + }, + { + name_unique: "Plzeň", + space_id: 27, + socio: 1, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 2, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 159, + y: 483, + }, + adjacent: [ 12, 28, 29 ], + ascii_name: "Plzen", + }, + { + name_unique: "České Budĕjovice", + space_id: 28, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 196, + y: 601, + }, + adjacent: [ 27, 29 ], + ascii_name: "Ceske Budejovice", + }, + { + name_unique: "Praha", + space_id: 29, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 317, + y: 614, + }, + adjacent: [ 27, 28, 30, 32 ], + ascii_name: "Praha", + }, + { + name_unique: "Charles University", + space_id: 30, + socio: 6, + stability: 1, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 380, + y: 532, + }, + adjacent: [ 29, 31 ], + ascii_name: "Charles University", + }, + { + name_unique: "Czech Writers", + space_id: 31, + socio: 5, + stability: 2, + battleground: 1, + demInfl: 2, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 444, + y: 607, + }, + adjacent: [ 30 ], + ascii_name: "Czech Writers", + }, + { + name_unique: "Brno", + space_id: 32, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 1, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 403, + y: 711, + }, + adjacent: [ 29, 33, 34 ], + ascii_name: "Brno", + }, + { + name_unique: "Ostrava", + space_id: 33, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 523, + y: 681, + }, + adjacent: [ 22, 32, 34, 35 ], + ascii_name: "Ostrava", + }, + { + name_unique: "Bratislava", + space_id: 34, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 417, + y: 797, + }, + adjacent: [ 32, 33, 35 ], + ascii_name: "Bratislava", + }, + { + name_unique: "Catholic Church, Czechoslovakia", + space_id: 35, + socio: 7, + stability: 5, + battleground: 0, + demInfl: 1, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 538, + y: 794, + }, + adjacent: [ 33, 34, 36 ], + ascii_name: "Catholic Church, Czechoslovakia", + }, + { + name_unique: "Prešov", + space_id: 36, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 658, + y: 794, + }, + adjacent: [ 35, 37 ], + ascii_name: "Presov", + }, + { + name_unique: "Košice", + space_id: 37, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Czechoslovakia", + region: "Eastern Europe", + box: { + x: 777, + y: 815, + }, + adjacent: [ 36, 42 ], + ascii_name: "Kosice", + }, + { + name_unique: "Catholic Church, Hungary", + space_id: 38, + socio: 7, + stability: 5, + battleground: 0, + demInfl: 1, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 314, + y: 886, + }, + adjacent: [ 39, 43 ], + ascii_name: "Catholic Church, Hungary", + }, + { + name_unique: "Győr", + space_id: 39, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 434, + y: 887, + }, + adjacent: [ 38, 40, 43, 44 ], + ascii_name: "Gyor", + }, + { + name_unique: "Tatabánya", + space_id: 40, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 549, + y: 886, + }, + adjacent: [ 39, 41, 45 ], + ascii_name: "Tatabanya", + }, + { + name_unique: "Miskolc", + space_id: 41, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 664, + y: 901, + }, + adjacent: [ 40, 42, 45 ], + ascii_name: "Miskolc", + }, + { + name_unique: "Debrecen", + space_id: 42, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 781, + y: 938, + }, + adjacent: [ 37, 41 ], + ascii_name: "Debrecen", + }, + { + name_unique: "Szombathely", + space_id: 43, + socio: 1, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 1, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 316, + y: 963, + }, + adjacent: [ 38, 39, 44 ], + ascii_name: "Szombathely", + }, + { + name_unique: "Székesfehérvár", + space_id: 44, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 1, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 442, + y: 962, + }, + adjacent: [ 39, 43, 45 ], + ascii_name: "Szekesfehervar", + }, + { + name_unique: "Budapest", + space_id: 45, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 1, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 630, + y: 983, + }, + adjacent: [ 40, 41, 44, 47, 48 ], + ascii_name: "Budapest", + }, + { + name_unique: "Hungarian Writers", + space_id: 46, + socio: 5, + stability: 2, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 348, + y: 1040, + }, + adjacent: [ 47 ], + ascii_name: "Hungarian Writers", + }, + { + name_unique: "Eötvös Loránd University", + space_id: 47, + socio: 6, + stability: 1, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 512, + y: 1034, + }, + adjacent: [ 46, 45 ], + ascii_name: "Eotvos Lorand University", + }, + { + name_unique: "Szeged", + space_id: 48, + socio: 3, + stability: 4, + battleground: 1, + demInfl: 1, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 632, + y: 1073, + }, + adjacent: [ 45, 49, 50 ], + ascii_name: "Szeged", + }, + { + name_unique: "Pécs", + space_id: 49, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Hungary", + region: "Eastern Europe", + box: { + x: 486, + y: 1105, + }, + adjacent: [ 48 ], + ascii_name: "Pecs", + }, + { + name_unique: "Timişoara", + space_id: 50, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 597, + y: 1204, + }, + adjacent: [ 48, 51, 60 ], + ascii_name: "Timisoara", + }, + { + name_unique: "Cluj-Napoca", + space_id: 51, + socio: 1, + stability: 4, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "Romania", + region: "Balkans", + box: { + x: 756, + y: 1125, + }, + adjacent: [ 50, 54, 58, 61 ], + ascii_name: "Cluj-Napoca", + }, + { + name_unique: "Târgu Mureş", + space_id: 52, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 915, + y: 1136, + }, + adjacent: [ 53, 56 ], + ascii_name: "Targu Mures", + }, + { + name_unique: "Iaşi", + space_id: 53, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 1072, + y: 1097, + }, + adjacent: [ 52, 57, 62 ], + ascii_name: "Iasi", + }, + { + name_unique: "Babeş-Bolyai University", + space_id: 54, + socio: 6, + stability: 1, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 746, + y: 1203, + }, + adjacent: [ 51, 55 ], + ascii_name: "Babes-Bolyai University", + }, + { + name_unique: "Romanian Writers", + space_id: 55, + socio: 5, + stability: 2, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 739, + y: 1278, + }, + adjacent: [ 54 ], + ascii_name: "Romanian Writers", + }, + { + name_unique: "Harghita/Covasna", + space_id: 56, + socio: 8, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 928, + y: 1227, + }, + adjacent: [ 52 ], + ascii_name: "Harghita/Covasna", + }, + { + name_unique: "Braşov", + space_id: 57, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 1049, + y: 1225, + }, + adjacent: [ 53, 59, 61 ], + ascii_name: "Brasov", + }, + { + name_unique: "Orthodox Church, Romania", + space_id: 58, + socio: 7, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 855, + y: 1338, + }, + adjacent: [ 51, 60 ], + ascii_name: "Orthodox Church, Romania", + }, + { + name_unique: "Ploieşti", + space_id: 59, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 1061, + y: 1316, + }, + adjacent: [ 57, 61, 62 ], + ascii_name: "Ploiesti", + }, + { + name_unique: "Craiova", + space_id: 60, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 763, + y: 1411, + }, + adjacent: [ 50, 58, 61 ], + ascii_name: "Craiova", + }, + { + name_unique: "Bucureşti", + space_id: 61, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "Romania", + region: "Balkans", + box: { + x: 929, + y: 1445, + }, + adjacent: [ 51, 57, 59, 60, 63 ], + ascii_name: "Bucuresti", + }, + { + name_unique: "Galaţi", + space_id: 62, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 1104, + y: 1399, + }, + adjacent: [ 53, 59, 63 ], + ascii_name: "Galati", + }, + { + name_unique: "Constanţa", + space_id: 63, + socio: 4, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Romania", + region: "Balkans", + box: { + x: 1130, + y: 1517, + }, + adjacent: [ 61, 62, 72 ], + ascii_name: "Constanta", + }, + { + name_unique: "Pleven", + space_id: 64, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 764, + y: 1534, + }, + adjacent: [ 68 ], + ascii_name: "Pleven", + }, + { + name_unique: "Orthodox Church, Bulgaria", + space_id: 65, + socio: 7, + stability: 3, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 882, + y: 1540, + }, + adjacent: [ 66, 68 ], + ascii_name: "Orthodox Church, Bulgaria", + }, + { + name_unique: "Ruse", + space_id: 66, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 998, + y: 1540, + }, + adjacent: [ 65, 69, 70, 71, 72 ], + ascii_name: "Ruse", + }, + { + name_unique: "Sofia University", + space_id: 67, + socio: 6, + stability: 1, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 645, + y: 1650, + }, + adjacent: [ 68, 73 ], + ascii_name: "Sofia University", + }, + { + name_unique: "Sofia", + space_id: 68, + socio: 2, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 2, + country: "Bulgaria", + region: "Balkans", + box: { + x: 768, + y: 1653, + }, + adjacent: [ 64, 65, 67, 69, 74 ], + ascii_name: "Sofia", + }, + { + name_unique: "Stara Zagora", + space_id: 69, + socio: 1, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 1, + country: "Bulgaria", + region: "Balkans", + box: { + x: 886, + y: 1694, + }, + adjacent: [ 66, 68, 71 ], + ascii_name: "Stara Zagora", + }, + { + name_unique: "Razgrad", + space_id: 70, + socio: 8, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 954, + y: 1620, + }, + adjacent: [ 66 ], + ascii_name: "Razgrad", + }, + { + name_unique: "Burgas", + space_id: 71, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 1004, + y: 1695, + }, + adjacent: [ 66, 69, 72 ], + ascii_name: "Burgas", + }, + { + name_unique: "Varna", + space_id: 72, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 1086, + y: 1613, + }, + adjacent: [ 63, 66, 71 ], + ascii_name: "Varna", + }, + { + name_unique: "Bulgarian Writers", + space_id: 73, + socio: 5, + stability: 2, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 652, + y: 1726, + }, + adjacent: [ 67 ], + ascii_name: "Bulgarian Writers", + }, + { + name_unique: "Plovdiv", + space_id: 74, + socio: 4, + stability: 3, + battleground: 1, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 771, + y: 1739, + }, + adjacent: [ 68, 75 ], + ascii_name: "Plovdiv", + }, + { + name_unique: "Sliven", + space_id: 75, + socio: 3, + stability: 4, + battleground: 0, + demInfl: 0, + comInfl: 0, + country: "Bulgaria", + region: "Balkans", + box: { + x: 894, + y: 1768, + }, + adjacent: [ 74 ], + ascii_name: "Sliven", + }, ] const cards = [ @@ -249,5 +1449,4 @@ null, {number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, ] - if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } diff --git a/gencode.js b/gencode.js deleted file mode 100644 index 6e66a02..0000000 --- a/gencode.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict" - -let fs = require("fs") - -let pc = 0 - -function tokenize(s) { - let list = [] - let p = 0, - n = s.length - while (p < n) { - while (p < n && s[p] === " ") - ++p - if (p < n) { - let m = p - while (p < n && s[p] !== " ") { - let q = s[p++] - switch (q) { - case "(": - case "[": - case "{": - for (let x = 1; p < n && x > 0; ++p) { - switch (s[p]) { - case "(": - case "[": - case "{": - ++x - break - case ")": - case "]": - case "}": - --x - break - } - } - break - case '"': - case "'": - case "`": - while (p < n && s[p] !== q) - ++p - break - } - } - list.push(s.substring(m, p)) - } - } - return list -} - -function emit(line) { - ++pc - line[0] = "vm_" + line[0] - for (let i = 1; i < line.length; ++i) { - if (typeof line[i] === "string") { - if (line[i] === "all") - line[i] = 999 - if (line[i][0] === "(" && !line[i].match(/\)=>/)) - line[i] = "()=>" + line[i] - if (line[i][0] === "`") - line[i] = "()=>" + line[i] - } - } - console.log("\t[ " + line.join(", ") + " ],") -} - -console.log("// #region GENERATED EVENT CODE") -console.log("const CODE = []") -let first = false - -for (let line of fs.readFileSync("events.txt", "utf-8").split("\n")) { - line = line.trim() - if (line.length === 0 || line[0] === "#") - continue - if (line === "EOF") - break - line = tokenize(line) - switch (line[0]) { - case "CARD": - if (first++) { - emit(["return"]) - console.log("]") - } - console.log("") - console.log("CODE[" + line[1] + "] = [ // " + line.slice(3).join(" ")) - break - - case "log": - case "prompt": - emit([ line[0], line.slice(1).join(" ") ]) - break - - case "asm": - case "if": - case "while": - emit([ line[0], "()=>" + line.slice(1).join(" ") ]) - break - - default: - emit(line) - break - } -} - -emit(["return"]) -console.log("]") -console.log("// #endregion") \ No newline at end of file diff --git a/images/trash-can.svg b/images/trash-can.svg new file mode 100644 index 0000000..7b8da5a --- /dev/null +++ b/images/trash-can.svg @@ -0,0 +1 @@ + diff --git a/info/cards.html b/info/cards.html new file mode 100644 index 0000000..479867d --- /dev/null +++ b/info/cards.html @@ -0,0 +1,193 @@ + + + +1989 - Cards + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + diff --git a/play.css b/play.css index 2a65885..3b49c7b 100644 --- a/play.css +++ b/play.css @@ -1,46 +1,14 @@ -main { background-color: dimgray; } -header { background-color: silver; } -header.your_turn { background-color: orange; } -#role_Democrat { background-color: hsl(200, 80%, 80%); } -#role_Communist { background-color: hsl(0, 80%, 80%); } -#turn_info { background-color: white; } -/*.aside_events { - font-family: "Source Sans"; - font-style: normal; - font-size: 16px; - line-height: 1.5; -}*/ -#deck_data { - font-family: "Source Sans"; - font-style: normal; - font-size: 16px; - line-height: 1.5; -} -#deck_stat {padding-left: 5px; padding-bottom: 5px;} - +main { background-color: slategray; } -#log { background-color: whitesmoke; } -#log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } -#log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } -#log .h3 { text-align: center; } -#log .h4 { text-decoration: underline; } -#log .h5 { text-decoration: underline; } +body.Democrat header.your_turn { background-color: hsl(206, 85%, 75%); } +body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } -#log .h2 { background-color: hsl(0,0%,80%);} -#log .h1 { background-color: hsl(0,0%,80%); } -#log .h2.dem { background-color: hsl(200, 80%, 80%); } -#log .h2.com { background-color: hsl(0, 80%, 80%); } -#log .h3.democrat { background-color: hsl(210,30%,90%); } -#log .h3.h2.communist { background-color: hsl(35,40%,90%); } +#role_Democrat { background-color: hsl(206, 80%, 80%); } +#role_Communist { background-color: hsl(355, 70%, 80%); } -#log div { padding-left: 20px; text-indent: -12px; } -#log div.i { padding-left: 32px; text-indent: -12px; } -#log div.ii { padding-left: 44px; text-indent: -12px; } +/* LOG */ - -#log .card_name { font-style: italic; } -#log .card_name:hover { text-decoration: underline; } -#log .space_tip:hover { cursor: pointer; text-decoration: underline; } +#log { font-variant-numeric: tabular-nums; } #log .die { display: inline-block; @@ -62,555 +30,212 @@ header.your_turn { background-color: orange; } #log .d5 { background-position: 80% 0; } #log .d6 { background-position: 100% 0; } -.selected { - cursor: pointer; -} +#log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } +#log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } +#log .h3 { text-align: center; } +#log .h4 { text-decoration: underline; } +#log .h5 { text-decoration: underline; } -#log { - font-variant-numeric: tabular-nums; -} +#log { background-color: floralwhite } +#log .h1 { background-color: tan } +#log .h2 { background-color: wheat } +#log .h2.dem { background-color: hsl(206, 85%, 80%); } +#log .h2.com { background-color: hsl(355, 70%, 80%); } -/* TOOLBAR */ +#log div { padding-left: 20px; text-indent: -12px; } +#log div.i { padding-left: 32px; text-indent: -12px; } +#log div.ii { padding-left: 44px; text-indent: -12px; } -#toolbar { - justify-content: space-evenly; -} +#log .card_name { font-style: italic; } +#log .card_name:hover { text-decoration: underline; } +#log .space_tip:hover { cursor: pointer; text-decoration: underline; } -#prompt { - display: flex; - margin-left: auto; -} +/* MAP */ -#button { - display: flex; - margin-left: auto; +#mapwrap { + width: 1650px; + height: 2550px; } -/* MAP */ #map { - margin: 0 auto ; - position: relative; - background-repeat: no-repeat; - background-size: cover; - width: 1275px; /* was 1275*/ - height: 2000px; - /*border: solid black;*/ - overflow: clip; + width: 1650px; + height: 2550px; + background-size: 1650px 2550px; box-shadow: 0px 1px 10px #0008; - /*z-index: 3;*/ -} - -#map { background-image: url(1989_map.jpg) } - -/* Containers to appear on hover*/ - #overlay { - position: relative; - top: 0; - left: 0; - width: 100%; - height: 100%; - /* background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent overlay */ - /* display: none;*/ - justify-content: center; - align-items: center; - text-align: left; - } - -/* SPACES */ - -.space-area { - position: absolute; - box-sizing: border-box; - border: transparent red 2px; -} - -/* PANELS AND HANDS */ - -.panel { - background-color: #555; - display: inline-block; -} - -.panel_header { - background-color: #444; - color: hsl(40, 60%, 90%); - font-weight: bold; - text-align: center; - padding: 3px 1em; -} - -.hide { - display: none; -} - -#hand_panel, #events_panel, #played_card_panel, #table_panel, #samizdat_panel, #opp_hand_panel, #power_panel, #ceausescu_panel { - min-width: 200px; - width: auto; - /*display: inline-block;*/ - margin: 10px; - border-radius: 5px; -} - -#events { - display: flex; -} - -#discard_panel, #removed_panel { - min-width: 200px; - width: auto; - display: inline-block; - margin: 10px; - border-radius: 5px; -} - -#discard_panel.hide, #removed_panel.hide { - display: none; -} - -#hand_panel { - margin: 10px; - border-radius: 5px; -} - -/* INFLUENCE MARKERS */ - -.demInfl { - position: absolute; - box-sizing: border-box; - bottom: 1px; - left: 6px; - height: 35px; - width: 35px; - border-radius: 5px; -} - -.demInfl.controlled { - background-image: url(images/US_blank.gif); - background-size: contain; -} - - -.demInfl.uncontrolled { - background-image: url(images/USd_blank.gif); - background-size: contain; -} -/* -.demInfl:hover { - cursor: pointer; -}*/ - -.comInfl { - position: absolute; - box-sizing: border-box; - bottom: 1px; - right: 6px; - height: 35px; - width: 35px; -} -/* -.comInfl:hover { - cursor: pointer; -}*/ - -.comInfl.controlled { - background-image: url(images/SV_blank.gif); - background-size: contain; -} - - -.comInfl.uncontrolled { - background-image: url(images/SVd_blank.gif); - background-size: contain; -} - -.demInflValue { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 10px; - left: 16px; } -.demInflValue_10 { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 10px; - left: 10px; +#map { background-image: url("map75.jpg") } +@media (min-resolution: 97dpi) { + #map { background-image: url("map150.jpg") } } -.comInflValue { - position: absolute; - box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 12px; - left: 74px; -} +/* SPACES */ -.comInflValue_10 { +.space { position: absolute; box-sizing: border-box; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: 12px; - left: 68px; + border: 4px solid transparent; } -.comInflValue.controlled, .held { - color: whitesmoke; - text-shadow: - 1px 1px 0 #c2272d, /* Right bottom */ - -1px 1px 0 #c2272d, /* Left bottom */ - 1px -1px 0 #c2272d, /* Right top */ - -1px -1px 0 #c2272d; /* Left top */ +.space.action { + border-color: white; + box-shadow: 0 0 0 1px black, inset 0 0 0 1px black; } -.comInflValue.uncontrolled { - color: #c2272d; - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} +.space.East_Germany.action { border-color: white; } +.space.Poland.action { border-color: yellow; } +.space.Czechoslovakia.action { border-color: lightgreen; } +.space.Hungary.action { border-color: gold; } +.space.Romania.action { border-color: peachpuff; } +.space.Bulgaria.action { border-color: palegreen; } -.comInflValue_10.controlled, .held { - color: whitesmoke; - text-shadow: - 1px 1px 0 #c2272d, /* Right bottom */ - -1px 1px 0 #c2272d, /* Left bottom */ - 1px -1px 0 #c2272d, /* Right top */ - -1px -1px 0 #c2272d; /* Left top */ +.space.tip { + border-color: lime; + box-shadow: 0 0 0 1px black, inset 0 0 0 1px black; } -.comInflValue_10.uncontrolled { - color: #c2272d; - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} - - -/* GAME MARKERS */ - -.t0 {left: 511px} -.t1 {left: 511px} -.t2 {left: 553px} -.t3 {left: 595px} -.t4 {left: 637px} -.t5 {left: 679px} -.t6 {left: 721px} -.t7 {left: 763px} -.t8 {left: 805px} -.t9 {left: 847px} -.t10 {left: 889px} - -#turn-tracker { - position:absolute; - top: 65px; - height: 35px; - width: 36px; - /*display: block;*/ -} - -.r0 {left: 554px} -.r1 {left: 554px} -.r2 {left: 596px} -.r3 {left: 638px} -.r4 {left: 680px} -.r5 {left: 722px} -.r6 {left: 764px} -.r7 {left: 806px} -.r8 {left: 848px} +/* MARKERS */ -.dem-action-round-tracker { background-image: url(images/US_Action_Round.gif);} -.com-action-round-tracker { background-image: url(images/SV_Action_Round.gif);} +/* node tools/gencolors.js */ +.marker { background-color: #ffffff; border-color: #eeeeee #8a8a8a #8a8a8a #eeeeee; box-shadow: 0 0 0 1px #323232, 1px 2px 4px #0008; } +.demInfl.ctl { background-color: #c4e2f6; border-color: #e6ffff #8ca8bb #8ca8bb #e6ffff; box-shadow: 0 0 0 1px #274050, 1px 2px 4px #0008; } +.comInfl.ctl { background-color: #c1272d; border-color: #e74e4c #9c0009 #9c0009 #e74e4c; box-shadow: 0 0 0 1px #520000, 1px 2px 4px #0008; } +#marker_action_round.com { background-color: #147fc0; border-color: #44a3e6 #005c9b #005c9b #44a3e6; box-shadow: 0 0 0 1px #001a54, 1px 2px 4px #0008; } +#marker_action_round.dem { background-color: #c1272d; border-color: #e74e4c #9c0009 #9c0009 #e74e4c; box-shadow: 0 0 0 1px #520000, 1px 2px 4px #0008; } +#marker_vp, #marker_turn { background-color: #fadb04; border-color: #ffff51 #c0a100 #c0a100 #ffff51; box-shadow: 0 0 0 1px #563600, 1px 2px 4px #0008; } +#marker_com_tst { background-color: #f26649; border-color: #ff9273 #c2391c #c2391c #ff9273; box-shadow: 0 0 0 1px #640000, 1px 2px 4px #0008; } +#marker_dem_tst { background-color: #c4e2f4; border-color: #e6ffff #8ca8ba #8ca8ba #e6ffff; box-shadow: 0 0 0 1px #27404f, 1px 2px 4px #0008; } -#action-round-tracker { +#event_reminder_list { position: absolute; - top: 114px; - height: 30px; - width: 35px; - background-size: cover; -} - - - -#stability-track { - position:absolute; - left: 1085px; - height: 35px; - width: 35px; -} - -.s0 {top: 853px} -.s1 {top: 896px} -.s2 {top: 939px} -.s3 {top: 982px} -.s4 {top: 1025px} - - -.tst0 {left: 0} -.tst1 {left: 38px} -.tst2 {left: 93px} -.tst3 {left: 148px} -.tst4 {left: 203px} -.tst5 {left: 258px} -.tst6 {left: 313px} -.tst7 {left: 368px} -.tst8 {left: 436px} - -#dem-TST { - position: absolute; - top: 1680px; - height: 35px; - width: 35px; -} - -#com-TST { - position: absolute; - top: 1782px; - height: 35px; - width: 35px; -} - -.vp0 {top: 1913px; -left: 660px} - -.vp-20, .vp-18, .vp-16, .vp-14, .vp-12, .vp-10, .vp-8, .vp-6, .vp-4, .vp-2, .vp1, .vp3, .vp5, .vp7, .vp9, .vp11, .vp13, .vp15, .vp17, .vp19 {top: 1889px} -.vp-19, .vp-17, .vp-15, .vp-13, .vp-11, .vp-9, .vp-7, .vp-5, .vp-3, .vp-1, .vp2, .vp4, .vp6, .vp8, .vp10, .vp12, .vp14, .vp16, .vp18, .vp20 {top: 1938px} - -.vp-21 {top: 1912px; left: 117px} -.vp21 {top: 1912px; left: 1182px} - -.vp-20 {left: 165px} -.vp-19 {left: 189px} -.vp-18 {left: 214px} -.vp-17 {left: 238px} -.vp-16 {left: 263px} -.vp-15 {left: 287px} -.vp-14 {left: 312px} -.vp-13 {left: 336px} -.vp-12 {left: 361px} -.vp-11 {left: 385px} -.vp-10 {left: 410px} -.vp-9 {left: 434px} -.vp-8 {left: 459px} -.vp-7 {left: 483px} -.vp-6 {left: 508px} -.vp-5 {left: 532px} -.vp-4 {left: 557px} -.vp-3 {left: 581px} -.vp-2 {left: 606px} -.vp-1 {left: 630px} -.vp1 {left: 692px} -.vp2 {left: 717px} -.vp3 {left: 741px} -.vp4 {left: 766px} -.vp5 {left: 790px} -.vp6 {left: 815px} -.vp7 {left: 839px} -.vp8 {left: 864px} -.vp9 {left: 888px} -.vp10 {left: 913px} -.vp11 {left: 937px} -.vp12 {left: 962px} -.vp13 {left: 986px} -.vp14 {left: 1011px} -.vp15 {left: 1035px} -.vp16 {left: 1060px} -.vp17 {left: 1084px} -.vp18 {left: 1109px} -.vp19 {left: 1133px} -.vp20 {left: 1158px} - -#vp { - position: absolute; - height: 40px; - width: 40px; + display: flex; + flex-rap: wrap; + gap: 5px; + bottom: 165px; + right: 195px; } .marker { position: absolute; - height: 30px; - width: 30px; -} - -.revolution {background-image: url(images/US_blank.gif); background-size: contain} -.held {background-image: url(images/SV_blank.gif); background-size: contain} - -.germany {top: 127px; left: 439px} -.poland { top: 232px; left: 934px} -.czech {top: 494px; left: 362px} -.hungary {top: 1041px; left: 813px} -.romania {top: 1063px; left: 1012px} -.bulgaria {top: 1578px; left: 720px} - -.times_held { - position: absolute; - font-family: 'Open Sans'; - font-size: 20px; - font-weight: bold; - top: -18px; - left: 8px -} - -.outlined_text { - text-shadow: - 1px 1px 0 #ffffff, /* Right bottom */ - -1px 1px 0 #ffffff, /* Left bottom */ - 1px -1px 0 #ffffff, /* Right top */ - -1px -1px 0 #ffffff; /* Left top */ -} - -/* ============= EVENT MARKERS ========== */ - -.event-marker { - display: none; - position: absolute; - height: 30px; - width: 30px; - transition: transform 0.3s ease; -} - -.event-marker:hover { - cursor: pointer; - transform: scale(2); - z-index: 1; -} - -.event-marker.aside { - border: solid black 1.5px; - margin: 3px; - position: relative; -} - -#turn_info { - display: flex; - flex-direction: column; - align-items: flex-start; -} - -#turn_info > div { - display: flex; - margin-bottom: 8px; - gap: 4px; -} - -#turn_info > img { - display: block; - -} - -/*Solidarity legalised*/ -#event_2 { - top: 216px; - left: 612px; -} - -/*Systematisation*/ -#event_69 { - height: 65px; - width: 65px; -} + pointer-events: none; + width: 45px; + height: 45px; + border: 2px solid; + border-color: #eee #bbb #bbb #eee; + /* TODO: per marker border color */ + box-shadow: 0 0 0 1px #444; + //border-radius: 8px; +} + +.demInfl { background-color: #fff; } +.comInfl { background-color: #fff; } +.demInfl.ctl { background-color: #147fc0; } +.comInfl.ctl { background-color: #c1272d; } + +.demInfl.v1 { background-image: url(markers75/di1.png) } +.demInfl.v2 { background-image: url(markers75/di2.png) } +.demInfl.v3 { background-image: url(markers75/di3.png) } +.demInfl.v4 { background-image: url(markers75/di4.png) } +.demInfl.v5 { background-image: url(markers75/di5.png) } +.demInfl.v6 { background-image: url(markers75/di6.png) } +.demInfl.v7 { background-image: url(markers75/di7.png) } +.demInfl.v8 { background-image: url(markers75/di8.png) } +.demInfl.ctl.v1 { background-image: url(markers75/dc1.png) } +.demInfl.ctl.v2 { background-image: url(markers75/dc2.png) } +.demInfl.ctl.v3 { background-image: url(markers75/dc3.png) } +.demInfl.ctl.v4 { background-image: url(markers75/dc4.png) } +.demInfl.ctl.v5 { background-image: url(markers75/dc5.png) } +.demInfl.ctl.v6 { background-image: url(markers75/dc6.png) } +.demInfl.ctl.v7 { background-image: url(markers75/dc7.png) } +.demInfl.ctl.v8 { background-image: url(markers75/dc8.png) } + +.comInfl.v1 { background-image: url(markers75/ci1.png) } +.comInfl.v2 { background-image: url(markers75/ci2.png) } +.comInfl.v3 { background-image: url(markers75/ci3.png) } +.comInfl.v4 { background-image: url(markers75/ci4.png) } +.comInfl.v5 { background-image: url(markers75/ci5.png) } +.comInfl.v6 { background-image: url(markers75/ci6.png) } +.comInfl.v7 { background-image: url(markers75/ci7.png) } +.comInfl.v8 { background-image: url(markers75/ci8.png) } +.comInfl.ctl.v1 { background-image: url(markers75/cc1.png) } +.comInfl.ctl.v2 { background-image: url(markers75/cc2.png) } +.comInfl.ctl.v3 { background-image: url(markers75/cc3.png) } +.comInfl.ctl.v4 { background-image: url(markers75/cc4.png) } +.comInfl.ctl.v5 { background-image: url(markers75/cc5.png) } +.comInfl.ctl.v6 { background-image: url(markers75/cc6.png) } +.comInfl.ctl.v7 { background-image: url(markers75/cc7.png) } +.comInfl.ctl.v8 { background-image: url(markers75/cc8.png) } + +#marker_turn { background-image: url(markers75/turn.png) } +#marker_action_round.dem { background-image: url(markers75/action_round_blue.png) } +#marker_action_round.com { background-image: url(markers75/action_round_blue.png) } +#marker_stability_track { background-image: url(markers75/ussr_stability_track.png) } +#marker_dem_tst { background-image: url(markers75/ts_blue.png) } +#marker_com_tst { background-image: url(markers75/ts_red.png) } +#marker_vp { background-image: url(markers75/vp.png) } + +/* EVENT MARKERS */ + +.marker.aside { + position: static; +} + +#event_2 { background-image: url(markers75/event_solidarity_legalized.png) } +#event_9 { background-image: url(markers75/event_the_wall.png) } +#event_15 { background-image: url(markers75/event_honecker.png) } +#event_24 { background-image: url(markers75/event_st_nicholas.png) } +#event_26 { background-image: url(markers75/event_helsinki.png) } +#event_39 { background-image: url(markers75/event_eco_glasnost.png) } +#event_48 { background-image: url(markers75/event_we_are_the_people.png) } +#event_49 { background-image: url(markers75/event_foreign_currency.png) } +#event_53 { background-image: url(markers75/event_li_peng.png) } +#event_58 { background-image: url(markers75/event_austria_hungary.png) } +#event_59 { background-image: url(markers75/event_grenz_truppen.png) } +#event_65 { background-image: url(markers75/event_pres_visit.png) } +#event_69 { background-image: url(markers75/event_systematization.png) } +#event_70 { background-image: url(markers75/event_securitate.png) } +#event_73 { background-image: url(markers75/event_laszlo_tokes.png) } +#event_97 { background-image: url(markers75/event_tyrant.png) } +#event_100 { background-image: url(markers75/event_stand_fast.png) } +#event_101 { background-image: url(markers75/event_elena.png) } +#event_104 { background-image: url(markers75/event_nye_party.png) } + +/* Solidarity legalized */ +#event_2 { top: 265px; left: 778px; } + +/* The Wall */ +#event_9 { top: 175px; left: 216px; } + +/* CARD PANELS */ -/*The Tyrant is Gone*/ -#event_97 { - height: 40px; - width: 40px; +.panel { + background-color: #607080; + max-width: 1650px; + margin: 24px auto; } -/*The Wall*/ -#event_9 { - top: 143px; - left: 170px; +.panel_header { + background-color: #506070; + color: white; + font-weight: bold; + padding: 3px; + text-align: center; } - -/* =========== CARDS ================= */ -/* -.playedCard { +.panel_body { + margin-top: 3px; display: flex; - margin: auto; - height: 300px; -}*/ - -.hand_card { - background-size: contain; - height: 250px; - margin: 10px; - border-radius: 5px; - transition: transform .3s ease 0.5s; -} -/* -.hand_card:hover { - cursor: pointer; -}*/ - -.zoom { - transform: scale(1.75) -} - -.power_card { - background-size: contain; - height: 250px; - margin: 10px; - border-radius: 5px; -} - -.discard_card, .event_card { - background-size: contain; - height: 150px; - margin: 5px; - border-radius: 5px; - transition: transform .3s ease; -} - -.discard_card:hover, .event_card:hover { - /*cursor: pointer;*/ - transform: scale(2); + flex-wrap: wrap; + padding: 16px; + gap: 16px; + min-height: 350px; } -.selected.space-area { - background-color: #0002; - outline: solid white 2px; - /*box-shadow: 0 0 4px white; */ - border-radius: 10px 10px 0 0; -} - -.space-area.tip { - background-color: #ff08; - outline: solid white 2px; - box-shadow: 0 0 8px #ff08; - border-radius: 10px 10px 0 0; -} - -.selected.hand_card { - outline: solid silver 3px; - /*box-shadow: 0 0 4px white; */ - border-radius: 18px; -} - - -.selected.power_card { - outline: solid silver 3px; - /*box-shadow: 0 0 4px white; */ - border-radius: 18px; +.panel:has(.panel_body:empty) { + display: none; } -/* =============== OTHER ===============*/ -#space-characteristics {display: none} - -/* =============== CARD IMAGES =========*/ +/* CARD IMAGES */ #tooltip { position: fixed; @@ -626,116 +251,179 @@ left: 660px} width: 250px; height: 350px; border-radius: 16px; - box-shadow: 1px 2px 4px #0004; -} - -.card_1 {background-image: url(cards/e1.gif)} -.card_2 {background-image: url(cards/e2.gif)} -.card_3 {background-image: url(cards/e3.gif)} -.card_4 {background-image: url(cards/e4.gif)} -.card_5 {background-image: url(cards/e5.gif)} -.card_6 {background-image: url(cards/e6.gif)} -.card_7 {background-image: url(cards/e7.gif)} -.card_8 {background-image: url(cards/e8.gif)} -.card_9 {background-image: url(cards/e9.gif)} -.card_10 {background-image: url(cards/e10.gif)} -.card_11 {background-image: url(cards/e11.gif)} -.card_12 {background-image: url(cards/e12.gif)} -.card_13 {background-image: url(cards/e13.gif)} -.card_14 {background-image: url(cards/e14.gif)} -.card_15 {background-image: url(cards/e15.gif)} -.card_16 {background-image: url(cards/e16.gif)} -.card_17 {background-image: url(cards/e17.gif)} -.card_18 {background-image: url(cards/e18.gif)} -.card_19 {background-image: url(cards/e19.gif)} -.card_20 {background-image: url(cards/e20.gif)} -.card_21 {background-image: url(cards/e21.gif)} -.card_22 {background-image: url(cards/e22.gif)} -.card_23 {background-image: url(cards/e23.gif)} -.card_24 {background-image: url(cards/e24.gif)} -.card_25 {background-image: url(cards/e25.gif)} -.card_26 {background-image: url(cards/e26.gif)} -.card_27 {background-image: url(cards/e27.gif)} -.card_28 {background-image: url(cards/e28.gif)} -.card_29 {background-image: url(cards/e29.gif)} -.card_30 {background-image: url(cards/e30.gif)} -.card_31 {background-image: url(cards/e31.gif)} -.card_32 {background-image: url(cards/e32.gif)} -.card_33 {background-image: url(cards/e33.gif)} -.card_34 {background-image: url(cards/e34.gif)} -.card_35 {background-image: url(cards/e35.gif)} -.card_36 {background-image: url(cards/e36.gif)} -.card_37 {background-image: url(cards/e37.gif)} -.card_38 {background-image: url(cards/e38.gif)} -.card_39 {background-image: url(cards/e39.gif)} -.card_40 {background-image: url(cards/e40.gif)} -.card_41 {background-image: url(cards/e41.gif)} -.card_42 {background-image: url(cards/e42.gif)} -.card_43 {background-image: url(cards/e43.gif)} -.card_44 {background-image: url(cards/e44.gif)} -.card_45 {background-image: url(cards/e45.gif)} -.card_46 {background-image: url(cards/e46.gif)} -.card_47 {background-image: url(cards/e47.gif)} -.card_48 {background-image: url(cards/e48.gif)} -.card_49 {background-image: url(cards/e49.gif)} -.card_50 {background-image: url(cards/e50.gif)} -.card_51 {background-image: url(cards/e51.gif)} -.card_52 {background-image: url(cards/e52.gif)} -.card_53 {background-image: url(cards/e53.gif)} -.card_54 {background-image: url(cards/e54.gif)} -.card_55 {background-image: url(cards/e55.gif)} -.card_56 {background-image: url(cards/e56.gif)} -.card_57 {background-image: url(cards/e57.gif)} -.card_58 {background-image: url(cards/e58.gif)} -.card_59 {background-image: url(cards/e59.gif)} -.card_60 {background-image: url(cards/e60.gif)} -.card_61 {background-image: url(cards/e61.gif)} -.card_62 {background-image: url(cards/e62.gif)} -.card_63 {background-image: url(cards/e63.gif)} -.card_64 {background-image: url(cards/e64.gif)} -.card_65 {background-image: url(cards/e65.gif)} -.card_66 {background-image: url(cards/e66.gif)} -.card_67 {background-image: url(cards/e67.gif)} -.card_68 {background-image: url(cards/e68.gif)} -.card_69 {background-image: url(cards/e69.gif)} -.card_70 {background-image: url(cards/e70.gif)} -.card_71 {background-image: url(cards/e71.gif)} -.card_72 {background-image: url(cards/e72.gif)} -.card_73 {background-image: url(cards/e73.gif)} -.card_74 {background-image: url(cards/e74.gif)} -.card_75 {background-image: url(cards/e75.gif)} -.card_76 {background-image: url(cards/e76.gif)} -.card_77 {background-image: url(cards/e77.gif)} -.card_78 {background-image: url(cards/e78.gif)} -.card_79 {background-image: url(cards/e79.gif)} -.card_80 {background-image: url(cards/e80.gif)} -.card_81 {background-image: url(cards/e81.gif)} -.card_82 {background-image: url(cards/e82.gif)} -.card_83 {background-image: url(cards/e83.gif)} -.card_84 {background-image: url(cards/e84.gif)} -.card_85 {background-image: url(cards/e85.gif)} -.card_86 {background-image: url(cards/e86.gif)} -.card_87 {background-image: url(cards/e87.gif)} -.card_88 {background-image: url(cards/e88.gif)} -.card_89 {background-image: url(cards/e89.gif)} -.card_90 {background-image: url(cards/e90.gif)} -.card_91 {background-image: url(cards/e91.gif)} -.card_92 {background-image: url(cards/e92.gif)} -.card_93 {background-image: url(cards/e93.gif)} -.card_94 {background-image: url(cards/e94.gif)} -.card_95 {background-image: url(cards/e95.gif)} -.card_96 {background-image: url(cards/e96.gif)} -.card_97 {background-image: url(cards/e97.gif)} -.card_98 {background-image: url(cards/e98.gif)} -.card_99 {background-image: url(cards/e99.gif)} -.card_100 {background-image: url(cards/e100.gif)} -.card_101 {background-image: url(cards/e101.gif)} -.card_102 {background-image: url(cards/e102.gif)} -.card_103 {background-image: url(cards/e103.gif)} -.card_104 {background-image: url(cards/e104.gif)} -.card_105 {background-image: url(cards/e105.gif)} -.card_106 {background-image: url(cards/e106.gif)} -.card_107 {background-image: url(cards/e107.gif)} -.card_108 {background-image: url(cards/e108.gif)} -.card_109 {background-image: url(cards/e109.gif)} -.card_110 {background-image: url(cards/e110.gif)} + box-shadow: 0 0 0 1px #444, 1px 2px 4px #0004; +} + +.card.action { + box-shadow: 0 0 0 1px #444, 0 0 0 4px white; +} + +.card.selected { + box-shadow: 0 0 0 1px #444, 0 0 0 4px yellow; +} + +.card.event_0 { background-image: url(cards100/event_back.webp) } +.card.event_1 { background-image: url(cards100/event_1.webp) } +.card.event_2 { background-image: url(cards100/event_2.webp) } +.card.event_3 { background-image: url(cards100/event_3.webp) } +.card.event_4 { background-image: url(cards100/event_4.webp) } +.card.event_5 { background-image: url(cards100/event_5.webp) } +.card.event_6 { background-image: url(cards100/event_6.webp) } +.card.event_7 { background-image: url(cards100/event_7.webp) } +.card.event_8 { background-image: url(cards100/event_8.webp) } +.card.event_9 { background-image: url(cards100/event_9.webp) } +.card.event_10 { background-image: url(cards100/event_10.webp) } +.card.event_11 { background-image: url(cards100/event_11.webp) } +.card.event_12 { background-image: url(cards100/event_12.webp) } +.card.event_13 { background-image: url(cards100/event_13.webp) } +.card.event_14 { background-image: url(cards100/event_14.webp) } +.card.event_15 { background-image: url(cards100/event_15.webp) } +.card.event_16 { background-image: url(cards100/event_16.webp) } +.card.event_17 { background-image: url(cards100/event_17.webp) } +.card.event_18 { background-image: url(cards100/event_18.webp) } +.card.event_19 { background-image: url(cards100/event_19.webp) } +.card.event_20 { background-image: url(cards100/event_20.webp) } +.card.event_21 { background-image: url(cards100/event_21.webp) } +.card.event_22 { background-image: url(cards100/event_22.webp) } +.card.event_23 { background-image: url(cards100/event_23.webp) } +.card.event_24 { background-image: url(cards100/event_24.webp) } +.card.event_25 { background-image: url(cards100/event_25.webp) } +.card.event_26 { background-image: url(cards100/event_26.webp) } +.card.event_27 { background-image: url(cards100/event_27.webp) } +.card.event_28 { background-image: url(cards100/event_28.webp) } +.card.event_29 { background-image: url(cards100/event_29.webp) } +.card.event_30 { background-image: url(cards100/event_30.webp) } +.card.event_31 { background-image: url(cards100/event_31.webp) } +.card.event_32 { background-image: url(cards100/event_32.webp) } +.card.event_33 { background-image: url(cards100/event_33.webp) } +.card.event_34 { background-image: url(cards100/event_34.webp) } +.card.event_35 { background-image: url(cards100/event_35.webp) } +.card.event_36 { background-image: url(cards100/event_36.webp) } +.card.event_37 { background-image: url(cards100/event_37.webp) } +.card.event_38 { background-image: url(cards100/event_38.webp) } +.card.event_39 { background-image: url(cards100/event_39.webp) } +.card.event_40 { background-image: url(cards100/event_40.webp) } +.card.event_41 { background-image: url(cards100/event_41.webp) } +.card.event_42 { background-image: url(cards100/event_42.webp) } +.card.event_43 { background-image: url(cards100/event_43.webp) } +.card.event_44 { background-image: url(cards100/event_44.webp) } +.card.event_45 { background-image: url(cards100/event_45.webp) } +.card.event_46 { background-image: url(cards100/event_46.webp) } +.card.event_47 { background-image: url(cards100/event_47.webp) } +.card.event_48 { background-image: url(cards100/event_48.webp) } +.card.event_49 { background-image: url(cards100/event_49.webp) } +.card.event_50 { background-image: url(cards100/event_50.webp) } +.card.event_51 { background-image: url(cards100/event_51.webp) } +.card.event_52 { background-image: url(cards100/event_52.webp) } +.card.event_53 { background-image: url(cards100/event_53.webp) } +.card.event_54 { background-image: url(cards100/event_54.webp) } +.card.event_55 { background-image: url(cards100/event_55.webp) } +.card.event_56 { background-image: url(cards100/event_56.webp) } +.card.event_57 { background-image: url(cards100/event_57.webp) } +.card.event_58 { background-image: url(cards100/event_58.webp) } +.card.event_59 { background-image: url(cards100/event_59.webp) } +.card.event_60 { background-image: url(cards100/event_60.webp) } +.card.event_61 { background-image: url(cards100/event_61.webp) } +.card.event_62 { background-image: url(cards100/event_62.webp) } +.card.event_63 { background-image: url(cards100/event_63.webp) } +.card.event_64 { background-image: url(cards100/event_64.webp) } +.card.event_65 { background-image: url(cards100/event_65.webp) } +.card.event_66 { background-image: url(cards100/event_66.webp) } +.card.event_67 { background-image: url(cards100/event_67.webp) } +.card.event_68 { background-image: url(cards100/event_68.webp) } +.card.event_69 { background-image: url(cards100/event_69.webp) } +.card.event_70 { background-image: url(cards100/event_70.webp) } +.card.event_71 { background-image: url(cards100/event_71.webp) } +.card.event_72 { background-image: url(cards100/event_72.webp) } +.card.event_73 { background-image: url(cards100/event_73.webp) } +.card.event_74 { background-image: url(cards100/event_74.webp) } +.card.event_75 { background-image: url(cards100/event_75.webp) } +.card.event_76 { background-image: url(cards100/event_76.webp) } +.card.event_77 { background-image: url(cards100/event_77.webp) } +.card.event_78 { background-image: url(cards100/event_78.webp) } +.card.event_79 { background-image: url(cards100/event_79.webp) } +.card.event_80 { background-image: url(cards100/event_80.webp) } +.card.event_81 { background-image: url(cards100/event_81.webp) } +.card.event_82 { background-image: url(cards100/event_82.webp) } +.card.event_83 { background-image: url(cards100/event_83.webp) } +.card.event_84 { background-image: url(cards100/event_84.webp) } +.card.event_85 { background-image: url(cards100/event_85.webp) } +.card.event_86 { background-image: url(cards100/event_86.webp) } +.card.event_87 { background-image: url(cards100/event_87.webp) } +.card.event_88 { background-image: url(cards100/event_88.webp) } +.card.event_89 { background-image: url(cards100/event_89.webp) } +.card.event_90 { background-image: url(cards100/event_90.webp) } +.card.event_91 { background-image: url(cards100/event_91.webp) } +.card.event_92 { background-image: url(cards100/event_92.webp) } +.card.event_93 { background-image: url(cards100/event_93.webp) } +.card.event_94 { background-image: url(cards100/event_94.webp) } +.card.event_95 { background-image: url(cards100/event_95.webp) } +.card.event_96 { background-image: url(cards100/event_96.webp) } +.card.event_97 { background-image: url(cards100/event_97.webp) } +.card.event_98 { background-image: url(cards100/event_98.webp) } +.card.event_99 { background-image: url(cards100/event_99.webp) } +.card.event_100 { background-image: url(cards100/event_100.webp) } +.card.event_101 { background-image: url(cards100/event_101.webp) } +.card.event_102 { background-image: url(cards100/event_102.webp) } +.card.event_103 { background-image: url(cards100/event_103.webp) } +.card.event_104 { background-image: url(cards100/event_104.webp) } +.card.event_105 { background-image: url(cards100/event_105.webp) } +.card.event_106 { background-image: url(cards100/event_106.webp) } +.card.event_107 { background-image: url(cards100/event_107.webp) } +.card.event_108 { background-image: url(cards100/event_108.webp) } +.card.event_109 { background-image: url(cards100/event_109.webp) } +.card.event_110 { background-image: url(cards100/event_110.webp) } + +.card.power_0 { background-image: url(cards100/power_back.webp) } +.card.power_1 { background-image: url(cards100/power_1.webp) } +.card.power_2 { background-image: url(cards100/power_2.webp) } +.card.power_3 { background-image: url(cards100/power_3.webp) } +.card.power_4 { background-image: url(cards100/power_4.webp) } +.card.power_5 { background-image: url(cards100/power_5.webp) } +.card.power_6 { background-image: url(cards100/power_6.webp) } +.card.power_7 { background-image: url(cards100/power_7.webp) } +.card.power_8 { background-image: url(cards100/power_8.webp) } +.card.power_9 { background-image: url(cards100/power_9.webp) } +.card.power_10 { background-image: url(cards100/power_10.webp) } +.card.power_11 { background-image: url(cards100/power_11.webp) } +.card.power_12 { background-image: url(cards100/power_12.webp) } +.card.power_13 { background-image: url(cards100/power_13.webp) } +.card.power_14 { background-image: url(cards100/power_14.webp) } +.card.power_15 { background-image: url(cards100/power_15.webp) } +.card.power_16 { background-image: url(cards100/power_16.webp) } +.card.power_17 { background-image: url(cards100/power_17.webp) } +.card.power_18 { background-image: url(cards100/power_18.webp) } +.card.power_19 { background-image: url(cards100/power_19.webp) } +.card.power_20 { background-image: url(cards100/power_20.webp) } +.card.power_21 { background-image: url(cards100/power_21.webp) } +.card.power_22 { background-image: url(cards100/power_22.webp) } +.card.power_23 { background-image: url(cards100/power_23.webp) } +.card.power_24 { background-image: url(cards100/power_24.webp) } +.card.power_25 { background-image: url(cards100/power_25.webp) } +.card.power_26 { background-image: url(cards100/power_26.webp) } +.card.power_27 { background-image: url(cards100/power_27.webp) } +.card.power_28 { background-image: url(cards100/power_28.webp) } +.card.power_29 { background-image: url(cards100/power_29.webp) } +.card.power_30 { background-image: url(cards100/power_30.webp) } +.card.power_31 { background-image: url(cards100/power_31.webp) } +.card.power_32 { background-image: url(cards100/power_32.webp) } +.card.power_33 { background-image: url(cards100/power_33.webp) } +.card.power_34 { background-image: url(cards100/power_34.webp) } +.card.power_35 { background-image: url(cards100/power_35.webp) } +.card.power_36 { background-image: url(cards100/power_36.webp) } +.card.power_37 { background-image: url(cards100/power_37.webp) } +.card.power_38 { background-image: url(cards100/power_38.webp) } +.card.power_39 { background-image: url(cards100/power_39.webp) } +.card.power_40 { background-image: url(cards100/power_40.webp) } +.card.power_41 { background-image: url(cards100/power_41.webp) } +.card.power_42 { background-image: url(cards100/power_42.webp) } +.card.power_43 { background-image: url(cards100/power_43.webp) } +.card.power_44 { background-image: url(cards100/power_44.webp) } +.card.power_45 { background-image: url(cards100/power_45.webp) } +.card.power_46 { background-image: url(cards100/power_46.webp) } +.card.power_47 { background-image: url(cards100/power_47.webp) } +.card.power_48 { background-image: url(cards100/power_48.webp) } +.card.power_49 { background-image: url(cards100/power_49.webp) } +.card.power_50 { background-image: url(cards100/power_50.webp) } +.card.power_51 { background-image: url(cards100/power_51.webp) } +.card.power_52 { background-image: url(cards100/power_52.webp) } diff --git a/play.html b/play.html index e09e214..eb2f495 100644 --- a/play.html +++ b/play.html @@ -7,204 +7,140 @@ 1989 - - - +
    - + + +
  • Rules of Play +
  • Background Book +
  • Reference Sheets +
  • +
  • Card Gallery +
  • +
    +
    + -
  • Rules of Play -
  • Background Book -
  • Reference Sheets - +
  • Show removed events +
  • Show discard
  • - - -
    -
    - - -
    - -
    -
    -
    -

    - -
    - - - - -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    -
    -

    1

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + - - - - - - - -
    -
    +
    -
    - - - -
    -
    -
    Event Markers
    -
    - - - - - - - - - - - - - - - -
    -
    -
    +
    -
    -
    -
    Cards on the Table
    -
    -
    -
    +
    +
    Cards on the Table
    +
    +
    -
    -
    -
    Played Card
    -
    +
    +
    Played Card
    +
    -
    - - -
    -
    -
    Discard
    -
    -
    -
    - - -
    -
    -
    Permanently Removed Events
    -
    -
    -
    + +
    +
    Hand
    +
    +
    -
    -
    -
    Ceausescu Cards
    -
    -
    -
    -
    Power Struggle Hand
    -
    -
    -
    - - +
    +
    Ceausescu Cards
    +
    +
    +
    +
    Power Struggle Hand
    +
    +
    -
    +
    +
    Opponent Hand
    +
    +
    -
    -
    Opponent Hand
    -
    -
    - -
    +
    +
    Opponent Power Struggle Hand
    +
    +
    -
    -
    -
    Set aside card
    -
    -
    -
    - +
    +
    Samizdat Card
    +
    +
    - -
    + +
    +
    Permanently Removed Events
    +
    +
    -
    -
    Hand
    -
    + +
    +
    Discard
    +
    -
    - - diff --git a/play.js b/play.js index 5ccf136..9ac9e60 100644 --- a/play.js +++ b/play.js @@ -1,677 +1,417 @@ +"use strict" -const seed = 'none' -const scenario = 'standard' -const options = 'none' -//const rules = require("./rules") +let action_register = [] +function register_action(target, action, id) { + target.my_action = action + target.my_id = id + target.onmousedown = on_click_action + action_register.push(target) +} + +function is_action(action, arg) { + return !!(view.actions && view.actions[action] && view.actions[action].includes(arg)) +} + +function on_click_action(evt) { + if (evt.button === 0) + send_action(evt.target.my_action, evt.target.my_id) +} + +const last_space = 75 const last_card = 110 const last_power_card = 52 -let hover_timeout -const height = 65 -const width = 105 -const toolbar = document.getElementById('toolbar') -const vpMarker = document.getElementById('vp') -const counters = document.getElementById('counters') - -const countries= ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] - -/*const aside_events = [ - "honecker", - "st_nicholas_church", - "helsinki_final_act", - "eco_glasnost", - "we_are_the_people", - "foreign_currency_debt_burden", - "li_peng", - "austria_hungary_border_reopened", - "grenztruppen", - "presidential_visit", - "securitate", - "laslzo_tokes", - "stand_fast", - "elena", - "new_years_eve_party" -]*/ -const board_events = [2, 9, 69, 97] + +const countries = [ "Poland", "Hungary", "East_Germany", "Bulgaria", "Czechoslovakia", "Romania" ] +const board_events = [ 2, 9, 69, 97 ] const box_events = [ 15, 24, 26, 39, 48, 49, 53, 58, 59, 65, 70, 73, 100, 101, 104 ] -let box_events_showing = false -let show_discard = false - -const overlay = document.getElementById('overlay'); -const spaceNameElement = document.getElementById('space-name'); -const spaceCharacteristicsElement = document.getElementById('space-characteristics'); - - -// Event listener to track mouse movement over the map - document.querySelector('.map').addEventListener('mousemove', function(event) { - const x = event.offsetX; // X-coordinate of mouse relative to container - const y = event.offsetY; // Y-coordinate of mouse relative to container - spaceCharacteristicsElement.innerText = `X: ${x}, Y: ${y}`; - }) - - - // Create map areas dynamically based on coordinates - - function create_ui() { - -// CREATE MAP - - spaces.forEach((space) => { - - - if (space && space.box) { - - //CREATE SPACES - const { x, y} = space.box; - const spaceArea = document.createElement('div'); - spaceArea.classList.add('space-area', space.country) - spaceArea.id=`space_${space.space_id}`; - spaceArea.style.left = x + 'px'; - spaceArea.style.top = y + 'px'; - spaceArea.style.width = width + 'px'; - spaceArea.style.height = height + 'px'; - spaceArea.style.zIndex = 2; - spaceArea.my_space = space.space_id; - spaceArea.addEventListener('mousedown', on_click_space); - - //CREATE DEMOCRATIC INFLUENCE MARKERS FOR EACH SPACE - const dem_img = document.createElement('div') - dem_img.classList.add('demInfl', space.country) - dem_img.style.display = 'none' - dem_img.id=`${space.name_unique}_demInfl` - dem_img.style.zIndex = 1 - dem_img.my_space = space.space_id; - dem_img.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(dem_img) - - //CREATE DEMOCRATIC INFLUENCE VALUES - const demInflValue = document.createElement('p') - demInflValue.className='demInflValue' - demInflValue.style.display = 'none' - demInflValue.id=`${space.name_unique}_demInflValue` - demInflValue.innerText=space.demInfl - demInflValue.style.zIndex = 1 - demInflValue.my_space = space.space_id; - demInflValue.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(demInflValue) - - //CREATE COMMUNIST INFLUENCE MARKERS FOR EACH SPACE - const com_img = document.createElement('div') - com_img.className='comInfl' - com_img.style.display='none' - com_img.id=`${space.name_unique}_comInfl` - com_img.style.zIndex = 1 - com_img.my_space = space.space_id; - com_img.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(com_img) - - //CREATE COMMUNIST INFLUENCE VALUES - const comInflValue = document.createElement('p') - comInflValue.className='comInflValue' - comInflValue.style.display='none' - comInflValue.id=`${space.name_unique}_comInflValue` - comInflValue.innerText=space.comInfl - comInflValue.style.zIndex = 1 - comInflValue.my_space = space.space_id; - comInflValue.addEventListener('mousedown', on_click_space); - spaceArea.appendChild(comInflValue) - //} - - counters.appendChild(spaceArea); - } - }); -// CREATE CARDS +const ui = { + favicon: document.getElementById("favicon"), + turn_info: document.getElementById("turn_info"), + + turn: document.getElementById("marker_turn"), + round: document.getElementById("marker_action_round"), + stability: document.getElementById("marker_stability_track"), + dem_tst: document.getElementById("marker_dem_tst"), + com_tst: document.getElementById("marker_com_tst"), + vp: document.getElementById("marker_vp"), + + event_reminder_list: document.getElementById("event_reminder_list"), + + played_card: document.getElementById("played_card"), + hand: document.getElementById("hand"), + power_hand: document.getElementById("power_hand"), + opp_hand: document.getElementById("opp_hand"), + opp_power_hand: document.getElementById("opp_power_hand"), + discard: document.getElementById("discard"), + removed: document.getElementById("removed"), + table_cards: document.getElementById("table_cards"), + + ceausescu_hand: document.getElementById("ceausescu_hand"), + samizdat_card: document.getElementById("samizdat_card"), +} + +function create_country(id, name) { + let [ x, y, w, h ] = LAYOUT[name] + let xc = Math.round(x + w / 2) + let yc = Math.round(y + h / 2) + + let e = document.createElement("div") + e.className = "marker demInfl" + e.style.left = xc - 25 + "px" + e.style.top = yc - 25 + "px" + ui.countries[id] = e + document.getElementById("markers").appendChild(e) +} + +function create_ui() { + ui.layout_xy = [] + ui.spaces = [] + ui.dem_inf = [] + ui.com_inf = [] + + for (let s = 1; s <= last_space; ++s) { + let info = spaces[s] + let [ x, y, w, h ] = LAYOUT[info.ascii_name] + let xc = Math.round( x + w / 2 ) + let yc = Math.round( y + h / 2 ) + x -= 6 + y -= 6 + w += 12 + h += 12 + + ui.layout_xy[s] = [ xc, yc ] + + let space_e = document.createElement("div") + register_action(space_e, "space", s) + space_e.className = "space " + info.country + space_e.style.left = x + "px" + space_e.style.top = y + "px" + space_e.style.width = w + "px" + space_e.style.height = h + "px" + ui.spaces[s] = space_e + + let com_e = document.createElement("div") + com_e.className = "marker comInfl hide" + com_e.style.left = (xc + 32 - 25) + "px" + com_e.style.top = (yc + 12 - 25) + "px" + ui.com_inf[s] = com_e + + let dem_e = document.createElement("div") + dem_e.className = "marker demInfl hide" + dem_e.style.left = (xc - 32 - 25) + "px" + dem_e.style.top = (yc + 12 - 25) + "px" + ui.dem_inf[s] = dem_e + + document.getElementById("spaces").append(space_e) + document.getElementById("markers").appendChild(com_e) + document.getElementById("markers").appendChild(dem_e) + } - const is_mobile = window.matchMedia("(pointer: coarse)").matches + ui.cards = [] for (let c = 1; c <= last_card; ++c) { + const card_e = document.createElement("div") + register_action(card_e, "card", c) + card_e.className = "card event_" + c + ui.cards[c] = card_e + } - const hand_card = document.createElement('img'); - hand_card.classList.add('hand_card') - hand_card.id=`card_${c}`; - hand_card.src = `cards/e${c}.gif` - hand_card.my_card = c; - hand_card.addEventListener('click', on_click_card); - - if(!is_mobile) { - hand_card.addEventListener('mouseenter', () => { - hover_timeout = setTimeout(() => { - hand_card.classList.add('zoom'); - }, 500) }) - hand_card.addEventListener('mouseleave', () => { - clearTimeout(hover_timeout); - hand_card.classList.remove('zoom'); - }); - } + ui.power_cards = [] + for (let c = 1; c <= last_power_card; ++c) { + const power_card_e = document.createElement("div") + register_action(power_card_e, "power_card", c) + power_card_e.className = "card power_" + c + ui.power_cards[c] = power_card_e + } - ui.cards.push(hand_card); + ui.events = [] + for (let id of box_events) { + ui.events[id] = document.createElement("div") + ui.events[id].id = "event_" + id + ui.events[id].className = "marker event aside" } - - - - for (let card of power_cards) { - if (!card) continue; - const power_card = document.createElement('img'); - power_card.classList.add('power_card'); - power_card.id = `power_card_${card.number}`; - power_card.src = `cards_2/${card.url}.gif`; - power_card.my_card = card.number; - power_card.addEventListener('mousedown', on_click_card); - ui.power_cards.push(power_card); + for (let id of board_events) { + ui.events[id] = document.createElement("div") + ui.events[id].id = "event_" + id + ui.events[id].className = "marker event" + document.getElementById("markers").appendChild(ui.events[id]) } -} - - - -function is_card_enabled(card) { - if (view.actions) { - if (card_action_menu.some(a => view.actions[a] && view.actions[a].includes(card))) - return true - if (view.actions.card_select && view.actions.card_select.includes(card)) - return true - if (view.actions.card && view.actions.card.includes(card)) - return true - } - return false + ui.countries = [] + create_country(0, "country_poland") + create_country(1, "country_hungary") + create_country(2, "country_east_germany") + create_country(3, "country_bulgaria") + create_country(4, "country_czechoslovakia") + create_country(5, "country_romania") } // SUPPORTING FUNCTIONS function on_click_space(evt) { - if (evt.button === 0) { - const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); - if (send_action('infl', space)) { + if (evt.button === 0) { + const space = evt.target.my_space + //console.log('on_click_space_called with space:', space); + if (send_action("infl", space)) { //console.log('send_action with infl:', space); - evt.stopPropagation(); - } else if (send_action('sc', space)) { + evt.stopPropagation() + } else if (send_action("sc", space)) { //console.log('send_action with sc:', space); - evt.stopPropagation(); + evt.stopPropagation() } else { - // console.log('send_action failed for space:', space); - } - } - //hide_popup_menu(); -} - -function on_click_card(evt) { - if (evt.button === 0) { - const card = evt.target.my_card; - //console.log('on_click_card_called with card:', card); - if (is_action('card', card)) { - //console.log('in action card') - if (send_action('card', card)) { - evt.stopPropagation(); - } - } - if (is_action('power_card', card)) { - if (send_action('power_card', card)) { - evt.stopPropagation(); - } + // console.log('send_action failed for space:', space); } } + //hide_popup_menu(); } -function is_action(action) { - //console.log('is_action called with: ', action) - //console.log('view.actions', view.actions) - if (view.actions && view.actions[action]) - return true - return false -} - -function is_card_action(action, card) { - //console.log('is_card_action called with action', action, 'card', card) - //console.log('view.actions', view.actions, 'view.actions[action]', view.actions[action]) - if (view.actions && view.actions[action] && view.actions[action].includes(card)) - return true - return false -} - -function on_log(text) { // eslint-disable-line no-unused-vars +function on_log(text) { + // eslint-disable-line no-unused-vars let p = document.createElement("div") if (text.match(/^>/)) { text = text.substring(1) - p.className = 'i' + p.className = "i" } - text = text.replace(/_/g, ' ') + text = text.replace(/_/g, " ") text = text.replace(/C(\d+)/g, sub_card_name) text = text.replace(/P(\d+)/g, sub_power_card_name) text = text.replace(/V(\d+)/g, sub_power_card_value) text = text.replace(/%(\d+)/g, sub_space_name) text = text.replace(/D[1-6]/g, sub_die) - if (text.match(/^\.h1/)) { text = text.substring(4) - p.className = 'h1' - } - else if (text.match(/^\.h2d/)) { + p.className = "h1" + } else if (text.match(/^\.h2d/)) { text = text.substring(5) - p.className = 'h2 dem' - } - else if (text.match(/^\.h2c/)) { + p.className = "h2 dem" + } else if (text.match(/^\.h2c/)) { text = text.substring(5) - p.className = 'h2 com' - } - else if (text.match(/^\.h2/)) { + p.className = "h2 com" + } else if (text.match(/^\.h2/)) { text = text.substring(4) - p.className = 'h2' - } - else if (text.match(/^\.h3/)) { + p.className = "h2" + } else if (text.match(/^\.h3/)) { text = text.substring(4) - p.className = 'h3' + p.className = "h3" } p.innerHTML = text return p } -let ui = { - favicon: document.getElementById('favicon'), - player: [ - document.getElementById("role_Democrat"), - document.getElementById("role_Communist"), - ], - cards: [ null ], - power_cards: [null], - dem_hand_count: document.getElementById("role_stat_dem"), - com_hand_count: document.getElementById("role_stat_com"), - deck_length: document.getElementById("deck_length"), - played_card: 0, - table_panel: document.getElementById("table_panel"), - hand_panel: document.getElementById("hand_panel"), - turn: document.getElementById("turn-tracker"), - round: document.getElementById("action-round-tracker"), - stability: document.getElementById("stability-track"), - dem_TST: document.getElementById("dem-TST"), - com_TST: document.getElementById("com-TST"), - vp: document.getElementById("vp"), - spaces: document.getElementsByClassName("space-area") +function layout_turn_marker() { + let x = 654 + 24 + (view.turn - 1) * 53 + let y = 80 + 24 + ui.turn.style.left = (x - 25) + "px" + ui.turn.style.top = (y - 25) + "px" +} +function layout_round_marker() { + let x = 709 + 24 + (view.turn - 1) * 53 + let y = 142 + 24 + ui.round.style.left = (x - 25) + "px" + ui.round.style.top = (y - 25) + "px" + if (view.round_player === "Democrat") // TODO: bit flag? + ui.round.className = "marker dem" + else + ui.round.className = "marker com" } +function layout_stability_marker() { + let x = 24 + 1381 + let y = 24 + 1081 + view.stability * 54 + ui.stability.style.left = (x - 25) + "px" + ui.stability.style.top = (y - 25) + "px" +} -function on_update() { - //console.log('on_update called') - //console.log('view.valid_spaces: ', view.valid_spaces) - //console.log('view.actions: ', view.actions) - //console.log('view.power_cards:', view.power_cards) - document.querySelectorAll('[id^="space_"].selected').forEach(spaceElement => {spaceElement.classList.remove('selected');}); - document.getElementById("power_hand")?.querySelectorAll('.selected').forEach(cardElement => {cardElement.classList.remove('selected');}); - view.valid_spaces.forEach(space_id => { - const spaceElementId = `space_${space_id}`; - const spaceElement = document.getElementById(spaceElementId); - - if (spaceElement) { - spaceElement.classList.add('selected'); - } - }); - - //Check influence values - - for (let i = 1; i < spaces.length; i ++) { - - const space = spaces[i] - const demInfl = view.demInfl[i] - const comInfl = view.comInfl[i] - //console.log('piece', piece) - //console.log('space', space) - const dem_marker = document.getElementById(`${space.name_unique}_demInfl`); - const dem_number = document.getElementById(`${space.name_unique}_demInflValue`); - const com_marker = document.getElementById(`${space.name_unique}_comInfl`); - const com_number = document.getElementById(`${space.name_unique}_comInflValue`); - - dem_number.innerText=demInfl - if (demInfl > 0) { - dem_marker.style.display = 'block'; - dem_number.style.display = 'block'; - - if (demInfl > 9) { - dem_number.classList.remove('demInflValue') - dem_number.classList.add('demInflValue_10') - } else { - dem_number.classList.add('demInflValue') - dem_number.classList.remove('demInflValue_10') - } - - if(check_dem_control(demInfl, comInfl, space)){ - dem_marker.classList.add('controlled') - dem_number.classList.add('outlined_text') - dem_marker.classList.remove('uncontrolled') - } else { - dem_marker.classList.add('uncontrolled') - dem_marker.classList.remove('controlled') - dem_number.classList.remove('outlined_text') - } - } else { - dem_marker.style.display = 'none'; - dem_number.style.display = 'none'; - } - com_number.innerText=comInfl - if (comInfl > 0) { - com_marker.style.display = 'block'; - com_number.style.display = 'block'; - - if (comInfl > 9) { - com_number.classList.remove('comInflValue') - com_number.classList.add('comInflValue_10') - } else { - com_number.classList.add('comInflValue') - com_number.classList.remove('comInflValue_10') - } - - if(check_com_control(demInfl, comInfl, space)){ - com_marker.classList.add('controlled') - com_number.classList.add('controlled') - com_marker.classList.remove('uncontrolled') - com_number.classList.remove('uncontrolled') - } else { - com_marker.classList.add('uncontrolled') - com_number.classList.add('uncontrolled') - com_marker.classList.remove('controlled') - com_number.classList.remove('controlled') - } - } else { - com_marker.style.display = 'none'; - com_number.style.display = 'none'; - } - - } +let TST_X = [ 53, 53+69, 53+69*2, 53+69*3, 53+69*4, 53+69*5, 53+69*6, 556 ] +let TST_Y = [ 2128, 2257 ] -// UPDATE COUNTRY MARKERS - for (let i = 0; i < countries.length; i++) { - const country = countries[i]; - const marker = document.getElementById(country) - const times_held = document.getElementById(`${country}_times_held`) - - if (view.revolutions[find_country_index(country)]) { - marker.classList.add('revolution') - marker.classList.remove('held') - marker.style.display = 'block' - times_held.classList.add('outlined_text') - times_held.classList.remove('hide') - } else if (view.times_held[find_country_index(country)] > 0 ) { - //console.log('setting ', country) - marker.classList.add('held') - marker.style.display = 'block' - times_held.classList.remove('hide') - times_held.innerHTML = view.times_held[find_country_index(country)] - } - else {marker.style.display = 'none'} - } +function layout_tst_marker(e, v, top) { + let x = TST_X[v] + 24 + let y = TST_Y[top] + 24 + e.style.left = (x - 25) + "px" + e.style.top = (y - 25) + "px" +} -// UPDATE ASIDE - if (view.is_pwr_struggle) { - ui.dem_hand_count.innerText = `${view.democrat_power_hand} Power cards` - ui.com_hand_count.innerText = `${view.communist_power_hand} Power cards` - } else{ - ui.dem_hand_count.innerText = `${view.democrat_hand} cards` - ui.com_hand_count.innerText = `${view.communist_hand} cards` +function layout_vp_marker() { + let x, y + if (view.vp === 0) { + y = 2425 + 25 + x = 843 + 28 } - ui.deck_length.innerText = `${view.strategy_deck} cards` - -// UPDATE HAND - document.getElementById("hand").replaceChildren() - document.getElementById("played_card").replaceChildren() - - if (view.hand.length && view.is_pwr_struggle === false) { - document.getElementById("hand_panel").classList.remove("hide") - //console.log('view.actions.card', view.actions.card) - for (let c of view.hand) { - let card = ui.cards[c] - document.getElementById("hand").appendChild(card); - if (view.actions && view.actions.card && view.actions.card.includes(c)) { - card.classList.add('action') - } else { - card.classList.remove('action') - } - if (view.valid_cards.includes(c)) { - card.classList.add('selected') - } else { - card.classList.remove('selected') - } - card.classList.remove('discard_card') + else if (view.vp < 0) { + if (view.vp & 1) { + y = 2456 + 25 + x = 803 + 28 - (-view.vp - 1)/2 * 62 + } else { + y = 2395 + 25 + x = 772 + 28 - (-view.vp - 2)/2 * 62 } - } else { - document.getElementById("hand_panel").classList.add("hide") - } - -// UPDATE DISCARD -document.getElementById("discard").replaceChildren() -if (!view.is_pwr_struggle) { - for (let c of view.strategy_discard) { - let discard_card = ui.cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') - } -} else if (view.is_pwr_struggle) { - for (let c of view.strategy_discard) { - let discard_card = ui.power_cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') } -} - -// DISCARD FOR EVENTS -//console.log('view.discard',view.discard) -if(view.discard) { - //document.getElementById("discard").replaceChildren() - document.getElementById("discard_panel").classList.remove("hide") - for (let c of view.strategy_discard) { - let discard_card = ui.cards[c] - document.getElementById("discard").appendChild(discard_card) - discard_card.classList.add('discard_card') - if (view.valid_cards.includes(c)) { - discard_card.classList.add('selected') + else if (view.vp > 0) { + if (view.vp & 1) { + y = 2396 + 25 + x = 883 + 28 + (view.vp - 1)/2 * 62 } else { - discard_card.classList.remove('selected') + y = 2455 + 25 + x = 913 + 28 + (view.vp - 2)/2 * 62 } - } -} else { - if (!show_discard) { - document.getElementById("discard_panel").classList.add("hide") + } + ui.vp.style.left = (x - 25) + "px" + ui.vp.style.top = (y - 25) + "px" +} + +function layout_country(id) { + for (let i = 0; i < 6; i++) { + // TODO: what number to display? + if (view.revolutions[id]) + ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] + else if (view.times_held[id] > 0) + ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id] + else + ui.countries[id].className = "marker hide" } } -// UPDATE PERMANENTLY REMOVED CARDS -document.getElementById("removed").replaceChildren() -for (let c of view.strategy_removed) { - let discard_card = ui.cards[c] - document.getElementById("removed").appendChild(discard_card) - discard_card.classList.add('discard_card') - discard_card.classList.remove('selected') -} - - -// PLAYED CARD PANEL -if (view.played_card > 0) { - document.getElementById("played_card_panel").classList.remove("hide") - document.getElementById("played_card").appendChild(ui.cards[view.played_card]); - document.getElementById("played_card").classList.remove("hand_card") -} else { - document.getElementById("played_card_panel").classList.add("hide") -} - -// TABLE CARDS PANEL -document.getElementById("table_cards").replaceChildren() -if (view.table_cards.length > 0) { - document.getElementById("table_panel").classList.remove("hide") - for (let c of view.table_cards) { - let card = ui.cards[c] - document.getElementById("table_cards").appendChild(card); - card.classList.remove("hand_card") - card.classList.add('event_card'); - } - } else { - document.getElementById("table_panel").classList.add("hide") -} +function on_update() { + if (!ui.spaces) + create_ui() -// OPPONENT HAND -document.getElementById("opp_hand").replaceChildren() -if (!view.is_pwr_struggle) { - if (view.show_opp_hand && view.opp_hand.length >0) { - document.getElementById("opp_hand_panel").classList.remove("hide") - for (let c of view.opp_hand) { - let card = ui.cards[c] - document.getElementById("opp_hand").appendChild(card); - card.classList.remove('discard_card') - if (!view.is_pwr_struggle) { - if (view.valid_cards.includes(c)) { - card.classList.add('selected') - } else { - card.classList.remove('selected') - } - } - } + // UPDATE ASIDE + if (view.is_pwr_struggle) { + roles.Democrat.stat.textContent = `${view.democrat_power_hand} Power cards` + roles.Communist.stat.textContent = `${view.communist_power_hand} Power cards` } else { - document.getElementById("opp_hand_panel").classList.add("hide") + roles.Democrat.stat.textContent = `${view.democrat_hand} cards` + roles.Communist.stat.innerText = `${view.communist_hand} cards` } -} else { - //console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) - if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { - document.getElementById("opp_hand_panel").classList.remove("hide") - for (let c of view.opp_hand) { - let card = ui.power_cards[c] - //console.log('power_card:', power_card) - document.getElementById("opp_hand").appendChild(card); - card.classList.remove('discard_card') - } + ui.turn_info.innerText = `Strategy deck: ${view.strategy_deck} cards` + + // UPDATE TRACK MARKERS + layout_turn_marker() + layout_round_marker() + layout_stability_marker() + layout_vp_marker() + layout_tst_marker(ui.dem_tst, view.dem_tst, 0) + layout_tst_marker(ui.com_tst, view.com_tst, 1) + + // UPDATE EVENT MARKERS ON THE BOARD + + if (view.persistent_events.includes(2)) + ui.events[2].style.display = "block" + else + ui.events[2].style.display = "none" + + if (view.persistent_events.includes(9)) + ui.events[9].style.display = "block" + else + ui.events[9].style.display = "none" + + if (view.persistent_events.includes(69)) { + ui.events[69].style.display = "block" + ui.events[69].style.left = ui.layout_xy[view.systematization][0] - 25 + "px" + ui.events[69].style.top = ui.layout_xy[view.systematization][1] - 25 + "px" } else { - document.getElementById("opp_hand_panel").classList.add("hide") + ui.events[69].style.display = "none" } -} -// POWER STRUGGLE HAND - document.getElementById("power_hand").replaceChildren() - - if (view.power_hand.length && view.is_pwr_struggle) { - document.getElementById("power_panel").classList.remove("hide") - for (let c of view.power_hand) { - let power_card = ui.power_cards[c] - document.getElementById("power_hand").appendChild(power_card); - power_card.classList.remove('discard_card') - if (view.valid_cards.includes(c)) { - power_card.classList.add('selected'); - } - } + if (view.persistent_events.includes(97)) { + ui.events[97].style.display = "block" + ui.events[97].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" + ui.events[97].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 25 + "px" } else { - document.getElementById("power_panel").classList.add("hide") + ui.events[97].style.display = "none" } -// CEAUSESCU + // EVENT REMINDER LIST + + ui.event_reminder_list.replaceChildren() + for (let id of box_events) + if (view.persistent_events.includes(id)) + ui.event_reminder_list.appendChild(ui.events[id]) + + // UPDATE INFLUENCE VALUES + for (let s = 1; s <= last_space; ++s) { + const demInfl = view.demInfl[s] + const comInfl = view.comInfl[s] + + if (demInfl - comInfl >= spaces[s].stability) + ui.dem_inf[s].className = "marker demInfl ctl v" + demInfl + else if (demInfl > 0) + ui.dem_inf[s].className = "marker demInfl v" + demInfl + else + ui.dem_inf[s].className = "marker demInfl hide" + + if (comInfl - demInfl >= spaces[s].stability) + ui.com_inf[s].className = "marker comInfl ctl v" + comInfl + else if (comInfl > 0) + ui.com_inf[s].className = "marker comInfl v" + comInfl + else + ui.com_inf[s].className = "marker comInfl hide" + } -if (view.ceausescu_cards && view.ceausescu_cards.length > 0 && view.is_pwr_struggle === true) { - document.getElementById("ceausescu_panel").classList.remove("hide") - for (let c of view.ceausescu_cards) { - let power_card = ui.power_cards[c] - document.getElementById("ceausescu_hand").appendChild(power_card); - power_card.classList.remove('discard_card') + // UPDATE COUNTRY MARKERS - } -} else { - document.getElementById("ceausescu_panel").classList.add("hide") -} + for (let i = 0; i < 6; ++i) + layout_country(i) -// SAMIZDAT CARD -if (view.samizdat > 0 ) { - let samizdat_card = ui.cards[view.samizdat] - document.getElementById("samizdat_panel").classList.remove("hide") - document.getElementById("samizdat_card").appendChild(samizdat_card) -} else { - document.getElementById("samizdat_panel").classList.add("hide") -} + // UPDATE CARD DISPLAYS -// UPDATE BOARD MARKERS - ui.turn.className = `t${view.turn}` - if (view.round_player === 'Democrat') { - ui.round.className = `dem-action-round-tracker r${view.round}` - } else { - ui.round.className = `com-action-round-tracker r${view.round}` - } - ui.stability.className = `s${view.stability}` - ui.dem_TST.className = `tst${view.dem_tst}` - ui.com_TST.className = `tst${view.com_tst}` - if (view.vp >= -20 && view.vp <= 20) { - ui.vp.className = `vp${view.vp}` - } else if (view.vp > 20) { - ui.vp.className = `vp21` - } else if (view.vp < -20) { - ui.vp.className = `vp-21` - } - -//console.log('strategy discard: ', view.strategy_discard) -//console.log('valid spaces: ', view.valid_spaces) - -//console.log('view.persistent_events', view.persistent_events) + ui.played_card.replaceChildren() + if (view.played_card > 0) + ui.played_card.appendChild(ui.cards[view.played_card]) -// UPDATE EVENT MARKERS ON THE BOARD + ui.samizdat_card.replaceChildren() + if (view.samizdat > 0) + ui.samizdat_card.appendChild(ui.cards[view.samizdat]) -for (let id of board_events) { - let marker = document.getElementById(`event_${id}`) - //console.log('event', id, marker) - if (view.persistent_events.includes(id)) { - marker.style.display = 'block' - } else { - marker.style.display = 'none' - } -} + ui.hand.replaceChildren() + for (let c of view.hand) + ui.hand.appendChild(ui.cards[c]) + ui.power_hand.replaceChildren() + if (view.power_hand) + for (let c of view.power_hand) + ui.hand.appendChild(ui.power_cards[c]) -// UPDATE EVENT MARKERS BELOW THE BOARD + ui.opp_hand.replaceChildren() + if (view.opp_hand) + for (let c of view.opp_hand) + ui.opp_hand.appendChild(ui.cards[c]) -for (let id of box_events) { - let marker = document.getElementById(`event_${id}`) - //console.log('event', id, marker) - if (view.persistent_events.includes(id)) { - marker.style.display = 'block' - } else { - marker.style.display = 'none' - } -} + // TODO: fix rules to set view.opp_power_hand + ui.opp_power_hand.replaceChildren() + if (view.opp_power_hand) + for (let c of view.opp_power_hand) + ui.opp_hand.appendChild(ui.power_cards[c]) + ui.ceausescu_hand.replaceChildren() + if (view.ceausescu_cards) + for (let c of view.ceausescu_cards) + ui.ceausescu_hand.appendChild(ui.power_cards[c]) -// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE EVENTS BOX -box_events_showing = false -for (let id of box_events) { - if (view.persistent_events.includes(id)) { - box_events_showing = true; - } -/* - //Special check for events which are not true/false - if (view.persistent_events['foreign_currency_debt_burden'] !== '') { - aside_events_showing = true - } - if (view.persistent_events['stand_fast'] !== '') { - aside_events_showing = true - } - */ -} + ui.discard.replaceChildren() + for (let c of view.strategy_discard) + ui.discard.appendChild(ui.cards[c]) -if (box_events_showing) { - document.getElementById('events_panel').classList.remove("hide") -} else { - document.getElementById('events_panel').classList.add("hide") -} + ui.removed.replaceChildren() + for (let c of view.strategy_removed) + ui.discard.appendChild(ui.cards[c]) -let systematization = document.getElementById('event_69') -if (view.persistent_events.includes(69)) { - systematization.style.left = (spaces[view.systematization].box.x +20) + 'px'; - systematization.style.top = spaces[view.systematization].box.y + 'px'; -} + ui.table_cards.replaceChildren() + if (view.table_cards) + for (let c of view.table_cards) + ui.table_cards.appendChild(ui.cards[c]) -let tyrant = document.getElementById('event_97') -if (view.persistent_events.includes(97)) { - tyrant.style.left = (spaces[view.the_tyrant_is_gone].box.x - 41) + 'px'; - tyrant.style.top = (spaces[view.the_tyrant_is_gone].box.y + 23) + 'px'; -} else {tyrant.style.display = 'none'} + for (let e of action_register) + e.classList.toggle("action", is_action(e.my_action, e.my_id)) action_button("yes", "Yes") action_button("no", "No") @@ -696,7 +436,7 @@ if (view.persistent_events.includes(97)) { action_button("strike", "Strike") action_button("march", "March") action_button("rally", "Rally in the Square") - action_button("petition", "Petition") + action_button("petition", "Petition") action_button("bonus", "Calculate VP bonus") action_button("scoring", "Score country") action_button("retain", "Retain Power") @@ -704,9 +444,9 @@ if (view.persistent_events.includes(97)) { action_button("take", "Take Power") action_button("concede", "Concede") action_button("struggle", "Begin power struggle") - action_button("raise", "Raise the stakes") - action_button("draw", "Draw") - action_button("scoring", "Scoring") + action_button("raise", "Raise the stakes") + action_button("draw", "Draw") + action_button("scoring", "Scoring") action_button("event", "Event") action_button("opp_event", "Resolve opponent event") action_button("influence", "Place SPs") @@ -716,8 +456,6 @@ if (view.persistent_events.includes(97)) { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - -console.log('view.actions', view.actions) } // =========================== LOG FUNCTIONS ============================================== @@ -738,9 +476,8 @@ function sub_power_card_value(match, p1) { } function sub_space_name(match, p1) { - let x = p1 | 0 - let id = spaces[x].space_id - let name = spaces[x].name_unique + let id = p1 | 0 + let name = spaces[id].name_unique return `${name}` } @@ -754,45 +491,32 @@ const die = { D3: '', D4: '', D5: '', - D6: '' + D6: '', } // =========================== VISUAL FUNCTIONS ==========================================# -function on_focus_card_tip(card_number) { - document.getElementById("tooltip").className = "card card_" + card_number +function on_focus_card_tip(card_number) { + document.getElementById("tooltip").className = "card event_" + card_number } -function on_blur_card_tip() { +function on_blur_card_tip() { document.getElementById("tooltip").classList = "card hide" } function on_focus_space_tip(id) { - space = document.getElementById(`space_${id}`) - space.classList.add("tip") -} - -function on_click_space_tip(id) { - space = document.getElementById(`space_${id}`) - scroll_into_view(space) + ui.spaces[id].classList.add("tip") } function on_blur_space_tip(id) { - space = document.getElementById(`space_${id}`) - space.classList.remove("tip") + ui.spaces[id].classList.remove("tip") } -function toggle_pieces() { - document.getElementById("pieces").classList.toggle("hide") +function on_click_space_tip(id) { + scroll_into_view(ui.spaces[id]) } - function toggle_discard() { - if (show_discard) { - show_discard = false - } else { - show_discard = true - } document.getElementById("discard_panel").classList.toggle("hide") } @@ -800,20 +524,118 @@ function toggle_removed() { document.getElementById("removed_panel").classList.toggle("hide") } -function check_dem_control(demInfl, comInfl, space) { - if ((demInfl - comInfl) >= space.stability) { - return true - } else{ false} -} - -function check_com_control(demInfl, comInfl, space) { - if ((comInfl - demInfl) >= space.stability) { - return true - } else{ false} -} - function find_country_index(country) { return countries.indexOf(country) } -create_ui() +// #region GENERATED LAYOUT DATA + +var LAYOUT = { + "Babes-Bolyai University": [958,1529,127,75], + "Berlin": [329,148,127,75], + "Bialystok": [1202,436,127,76], + "Brasov": [1339,1556,127,75], + "Bratislava": [539,1013,127,76], + "Brno": [521,904,127,76], + "Bucuresti": [1186,1837,127,76], + "Budapest": [809,1249,127,76], + "Bulgarian Writers": [838,2192,127,76], + "Burgas": [1289,2152,127,76], + "Bydgoszcz": [872,388,127,76], + "Catholic Church, Czechoslovakia": [692,1010,127,75], + "Catholic Church, Hungary": [409,1126,127,76], + "Catholic Church, Poland": [802,558,127,75], + "Ceske Budejovice": [260,765,127,77], + "Charles University": [491,677,128,76], + "Cluj-Napoca": [970,1429,127,76], + "Constanta": [1443,1925,127,76], + "Craiova": [977,1793,127,76], + "Czech Writers": [573,773,127,76], + "Debrecen": [1000,1192,127,76], + "Dresden": [343,479,127,76], + "Eotvos Lorand University": [658,1314,127,76], + "Erfurt": [38,455,127,76], + "Galati": [1409,1778,127,76], + "Gdansk": [896,277,127,76], + "German Writers": [81,239,127,76], + "Gyor": [560,1129,127,76], + "Halle": [231,357,127,75], + "Harghita/Covasna": [1186,1560,127,75], + "Hungarian Writers": [452,1322,127,76], + "Iasi": [1369,1395,127,76], + "Jagiellonian University": [870,867,127,76], + "Karl-Marx-Stadt": [184,492,127,75], + "Katowice": [733,723,127,76], + "Kosice": [995,1037,127,76], + "Krakow": [911,761,127,76], + "Leipzig": [387,379,127,76], + "Lodz": [959,620,127,76], + "Lublin": [1124,754,127,76], + "Lutheran Church": [391,271,127,76], + "Magdeburg": [79,352,127,75], + "Miskolc": [851,1146,127,76], + "Orthodox Church, Bulgaria": [1130,1956,127,76], + "Orthodox Church, Romania": [1094,1700,127,76], + "Ostrava": [673,868,127,75], + "Pecs": [626,1406,127,75], + "Pleven": [979,1948,127,76], + "Ploiesti": [1356,1671,127,76], + "Plovdiv": [987,2209,127,75], + "Plzen": [211,615,127,76], + "Polish Writers": [1051,883,127,75], + "Poznan": [671,452,127,76], + "Praha": [412,782,127,75], + "Presov": [844,1010,127,75], + "Razgrad": [1219,2057,127,76], + "Romanian Writers": [947,1625,127,75], + "Rostock": [299,53,127,76], + "Ruse": [1277,1956,127,76], + "Schwerin": [148,86,127,76], + "Sliven": [1144,2251,127,75], + "Sofia": [983,2098,127,76], + "Sofia University": [828,2095,127,76], + "Stara Zagora": [1133,2153,127,75], + "Szczecin": [574,263,127,75], + "Szeged": [812,1364,127,76], + "Szekesfehervar": [571,1223,127,75], + "Szombathely": [410,1224,127,76], + "Targu Mures": [1169,1443,127,76], + "Tatabanya": [706,1126,127,75], + "Timisoara": [767,1531,127,76], + "Varna": [1387,2051,127,76], + "Walter Ulbricht Academy": [234,240,127,76], + "Warszawa": [1032,490,127,75], + "Wroclaw": [595,565,127,75], + "action_1": [708,143,48,44], + "action_8": [1080,143,47,43], + "country_bulgaria": [915,1999,46,41], + "country_czechoslovakia": [463,624,44,39], + "country_east_germany": [560,160,43,37], + "country_hungary": [1034,1319,44,39], + "country_poland": [1188,292,44,39], + "country_romania": [1287,1349,44,39], + "event_solidarity_legalized": [779,270,44,43], + "event_the_wall": [222,179,40,41], + "tst_com_1": [53,2257,47,47], + "tst_com_7": [469,2257,47,47], + "tst_com_8": [556,2257,47,47], + "tst_dem_1": [53,2128,47,47], + "tst_dem_7": [469,2128,47,47], + "tst_dem_8": [556,2128,47,47], + "turn_1": [655,81,47,48], + "turn_10": [1133,80,48,48], + "ussr_1": [1381,1080,48,48], + "ussr_2": [1381,1134,48,48], + "ussr_3": [1381,1188,48,48], + "ussr_4": [1381,1243,48,48], + "ussr_5": [1381,1297,48,48], + "vp_0": [843,2425,55,51], + "vp_1": [883,2395,55,50], + "vp_19": [1440,2395,55,50], + "vp_2": [913,2455,56,51], + "vp_20": [1471,2455,55,51], + "vp_neg_1": [803,2455,56,51], + "vp_neg_19": [246,2456,55,50], + "vp_neg_2": [772,2395,56,51], + "vp_neg_20": [215,2395,55,51], +} diff --git a/rules.js b/rules.js index 877c4d8..6ce54dd 100644 --- a/rules.js +++ b/rules.js @@ -268,18 +268,13 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { - //console.log('argument undefined') view.actions[action] = 1 } else { - if (!(action in view.actions)) { - //console.log('push argument') + if (!(action in view.actions)) view.actions[action] = [] - } view.actions[action].push(argument) } - //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_space(space){ @@ -9013,6 +9008,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ // #region GENERATED EVENT CODE + const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -9875,43 +9871,44 @@ CODE[110] = [ // Malta Summit* [ vm_remove_opp_infl, 5 ], [ vm_return ], ] -// #endregion - -// ============= TIANANMEN SQUARE TRACK AWARDS ==================== -CODE[203] = [//Tiananmen Square space 3 award - [vm_tst_3], - [vm_return] -] -CODE[204] = [//Tiananmen Square space 4 award - [vm_valid_spaces_opponent], - [vm_tst_4], - [vm_return] +CODE[203] = [ // Tiananmen Square space 3 award + [ vm_tst_3 ], + [ vm_return ], ] -CODE[206] = [//Tiananmen Square space 6 - [vm_valid_spaces_sc], - [vm_tst_6], - [vm_return] + +CODE[204] = [ // Tiananmen Square space 4 award + [ vm_valid_spaces_opponent ], + [ vm_tst_4 ], + [ vm_return ], ] -CODE[208] = [//Tiananmen Square space 8 event - [vm_tst_8], - [vm_return] + +CODE[206] = [ // Tiananmen Square space 6 + [ vm_valid_spaces_sc ], + [ vm_tst_6 ], + [ vm_return ], ] -// ============= POWER STRUGGLE WILDCARDS ========================= +CODE[208] = [ // Tiananmen Square space 8 event + [ vm_tst_8 ], + [ vm_return ], +] -CODE[349] = [//Scare Tactics - [vm_scare_tactics], - [vm_valid_spaces_country_opp], - [vm_prompt, ()=>` from ${country_name(game.vm_active_country)}`], - [vm_remove_opp_infl, 1], - [vm_return] +CODE[349] = [ // Scare Tactics + [ vm_scare_tactics ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 1 ], + [ vm_return ], ] -CODE[350] = [//Support Surges - [vm_support_surges], - [vm_return] + +CODE[350] = [ // Support Surges + [ vm_support_surges ], + [ vm_return ], ] -CODE[351] = [//Support Falters - [vm_support_falters], - [vm_return] + +CODE[351] = [ // Support Falters + [ vm_support_falters ], + [ vm_return ], ] +// #endregion diff --git a/tools/colors.js b/tools/colors.js new file mode 100644 index 0000000..f8f7ace --- /dev/null +++ b/tools/colors.js @@ -0,0 +1,110 @@ +"use strict" + +function rgb_from_any(color) { + switch (color.mode) { + case "rgb": return color + case "lrgb": return rgb_from_lrgb(color) + case "oklab": return rgb_from_oklab(color) + } +} + +function lrgb_from_any(color) { + switch (color.mode) { + case "rgb": return lrgb_from_rgb(color) + case "lrgb": return color + case "oklab": return lrgb_from_oklab(color) + } +} + +function oklab_from_any(color) { + switch (color.mode) { + case "rgb": return oklab_from_rgb(color) + case "lrgb": return oklab_from_lrgb(color) + case "oklab": return color + } +} + +function format_hex(color) { + let {r, g, b} = rgb_from_any(color) + let adj = 1 + r = Math.round(Math.max(0, Math.min(1, r)) * 255) + g = Math.round(Math.max(0, Math.min(1, g)) * 255) + b = Math.round(Math.max(0, Math.min(1, b)) * 255) + let x = (r << 16) | (g << 8) | b + return "#" + x.toString(16).padStart(6, "0") +} + +function parse_hex(str) { + let x = parseInt(str.substring(1), 16) + return { + mode: "rgb", + r: ((x >> 16) & 255) / 255.0, + g: ((x >> 8) & 255) / 255.0, + b: ((x) & 255) / 255.0 + } +} + +function lrgb_from_rgb({ r, g, b }) { + function to_linear(c) { + let ac = Math.abs(c) + if (ac < 0.04045) + return c / 12.92 + return (Math.sign(c) || 1) * Math.pow((ac + 0.055) / 1.055, 2.4) + } + return { + mode: "lrgb", + r: to_linear(r), + g: to_linear(g), + b: to_linear(b) + } +} + +function rgb_from_lrgb({ r, g, b }) { + function from_linear(c) { + let ac = Math.abs(c) + if (ac > 0.0031308) + return (Math.sign(c) || 1) * (1.055 * Math.pow(ac, 1 / 2.4) - 0.055) + return c * 12.92 + } + return { + mode: "rgb", + r: from_linear(r), + g: from_linear(g), + b: from_linear(b) + } +} + +function oklab_from_lrgb({ r, g, b }) { + let L = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b) + let M = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b) + let S = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b) + return { + mode: "oklab", + l: 0.2104542553 * L + 0.793617785 * M - 0.0040720468 * S, + a: 1.9779984951 * L - 2.428592205 * M + 0.4505937099 * S, + b: 0.0259040371 * L + 0.7827717662 * M - 0.808675766 * S + } +} + +function lrgb_from_oklab({ l, a, b }) { + let L = Math.pow(l + 0.3963377774 * a + 0.2158037573 * b, 3) + let M = Math.pow(l - 0.1055613458 * a - 0.0638541728 * b, 3) + let S = Math.pow(l - 0.0894841775 * a - 1.291485548 * b, 3) + return { + mode: "lrgb", + r: +4.0767416621 * L - 3.3077115913 * M + 0.2309699292 * S, + g: -1.2684380046 * L + 2.6097574011 * M - 0.3413193965 * S, + b: -0.0041960863 * L - 0.7034186147 * M + 1.707614701 * S + } +} + +function oklab_from_rgb(rgb) { + return oklab_from_lrgb(lrgb_from_rgb(rgb)) +} + +function rgb_from_oklab(oklab) { + return rgb_from_lrgb(lrgb_from_oklab(oklab)) +} + +if (typeof module === "object") + module.exports = { format_hex, parse_hex, rgb_from_any, lrgb_from_any, oklab_from_any } diff --git a/tools/gencode.js b/tools/gencode.js new file mode 100644 index 0000000..f2e3a26 --- /dev/null +++ b/tools/gencode.js @@ -0,0 +1,106 @@ +"use strict" + +let fs = require("fs") + +let pc = 0 + +function tokenize(s) { + let list = [] + let p = 0, + n = s.length + while (p < n) { + while (p < n && s[p] === " ") + ++p + if (p < n) { + let m = p + while (p < n && s[p] !== " ") { + let q = s[p++] + switch (q) { + case "(": + case "[": + case "{": + for (let x = 1; p < n && x > 0; ++p) { + switch (s[p]) { + case "(": + case "[": + case "{": + ++x + break + case ")": + case "]": + case "}": + --x + break + } + } + break + case '"': + case "'": + case "`": + while (p < n && s[p] !== q) + ++p + break + } + } + list.push(s.substring(m, p)) + } + } + return list +} + +function emit(line) { + ++pc + line[0] = "vm_" + line[0] + for (let i = 1; i < line.length; ++i) { + if (typeof line[i] === "string") { + if (line[i] === "all") + line[i] = 999 + if (line[i][0] === "(" && !line[i].match(/\)=>/)) + line[i] = "()=>" + line[i] + if (line[i][0] === "`") + line[i] = "()=>" + line[i] + } + } + console.log("\t[ " + line.join(", ") + " ],") +} + +console.log("const CODE = []") +let first = false + +for (let line of fs.readFileSync("events.txt", "utf-8").split("\n")) { + line = line.trim() + if (line.length === 0 || line[0] === "#") + continue + if (line === "EOF") + break + line = tokenize(line) + switch (line[0]) { + case "CARD": + if (first++) { + emit(["return"]) + console.log("]") + } + console.log("") + console.log("CODE[" + line[1] + "] = [ // " + line.slice(3).join(" ")) + break + + case "log": + case "prompt": + emit([ line[0], line.slice(1).join(" ") ]) + break + + case "asm": + case "if": + case "while": + emit([ line[0], "()=>" + line.slice(1).join(" ") ]) + break + + default: + emit(line) + break + } +} + +emit(["return"]) +console.log("]") +console.log("// #endregion") diff --git a/tools/gencolors.js b/tools/gencolors.js new file mode 100644 index 0000000..5904741 --- /dev/null +++ b/tools/gencolors.js @@ -0,0 +1,78 @@ +const { parse_hex, format_hex, lrgb_from_any, rgb_from_any, oklab_from_any } = require("./colors.js") + +const white = "#ffffff" +const black = "#000000" + +function lerp(a, b, n) { + return a + (b - a) * n +} + +function blend(a, b, n) { + a = lrgb_from_any(parse_hex(a)) + b = lrgb_from_any(parse_hex(b)) + return format_hex({ + mode: "lrgb", + r: lerp(a.r, b.r, n), + g: lerp(a.g, b.g, n), + b: lerp(a.b, b.b, n) + }) +} + +function multiply_luminance(hex, m) { + let oklab = oklab_from_any(parse_hex(hex)) + oklab.l = Math.max(0, Math.min(1, oklab.l * m)) + return format_hex(oklab) +} + +function add_luminance(hex, m) { + let oklab = oklab_from_any(parse_hex(hex)) + oklab.l = Math.max(0, Math.min(1, oklab.l + m)) + return format_hex(oklab) +} + +function make_3d_colors(base) { + return [ + base, + multiply_luminance(base, 0.9), + multiply_luminance(base, 0.8), + multiply_luminance(base, 0.7), + multiply_luminance(base, 0.4) + ] +} + +function make_2d_colors(base) { + return [ + base, + multiply_luminance(base, 1.2), + multiply_luminance(base, 0.8), + multiply_luminance(base, 0.4) + ] +} + +function make_2d_colors_add(base) { + return [ + base, + add_luminance(base, 0.2), + add_luminance(base, -0.2), + add_luminance(base, -0.5), + ] +} + +function print(x) { + console.log(x) +} + +function gencss(color, sel) { + let [ bg, hi, lo, sh ] = make_2d_colors(color) + print(`${sel} { background-color: ${color}; border-color: ${hi} ${lo} ${lo} ${hi}; box-shadow: 0 0 0 1px ${sh}, 1px 2px 4px #0008; }`) +} + +gencss("#bbbbbb", ".marker") +gencss("#c4e2f6", ".demInfl.ctl") +gencss("#c1272d", ".comInfl.ctl") +gencss("#147fc0", "#marker_action_round.com") +gencss("#c1272d", "#marker_action_round.dem") +gencss("#fadb04", "#marker_vp, #marker_turn") +gencss("#f26649", "#marker_com_tst") +gencss("#c4e2f4", "#marker_dem_tst") + diff --git a/tools/genlayout.js b/tools/genlayout.js new file mode 100644 index 0000000..37f419d --- /dev/null +++ b/tools/genlayout.js @@ -0,0 +1,37 @@ +const fs = require("fs") + +let boxes = [] +let mode, name, x, y, w, h + +function flush() { + if (mode === 'rect') { + boxes[name] = [ x |0, y |0, w |0, h |0 ] + } + x = y = w = h = 0 + name = null +} + +for (let line of fs.readFileSync("tools/layout.svg", "utf-8").split("\n")) { + line = line.trim() + if (line.startsWith(" + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From be53b4b3373da546644ce71ee6a311be406a27aa Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:06:21 +0200 Subject: Fix mixed up colors and images in action round marker. --- play.css | 6 +++--- tools/gencolors.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/play.css b/play.css index 3b49c7b..d98c8ce 100644 --- a/play.css +++ b/play.css @@ -100,8 +100,8 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .marker { background-color: #ffffff; border-color: #eeeeee #8a8a8a #8a8a8a #eeeeee; box-shadow: 0 0 0 1px #323232, 1px 2px 4px #0008; } .demInfl.ctl { background-color: #c4e2f6; border-color: #e6ffff #8ca8bb #8ca8bb #e6ffff; box-shadow: 0 0 0 1px #274050, 1px 2px 4px #0008; } .comInfl.ctl { background-color: #c1272d; border-color: #e74e4c #9c0009 #9c0009 #e74e4c; box-shadow: 0 0 0 1px #520000, 1px 2px 4px #0008; } -#marker_action_round.com { background-color: #147fc0; border-color: #44a3e6 #005c9b #005c9b #44a3e6; box-shadow: 0 0 0 1px #001a54, 1px 2px 4px #0008; } -#marker_action_round.dem { background-color: #c1272d; border-color: #e74e4c #9c0009 #9c0009 #e74e4c; box-shadow: 0 0 0 1px #520000, 1px 2px 4px #0008; } +#marker_action_round.dem { background-color: #147fc0; border-color: #44a3e6 #005c9b #005c9b #44a3e6; box-shadow: 0 0 0 1px #001a54, 1px 2px 4px #0008; } +#marker_action_round.com { background-color: #c1272d; border-color: #e74e4c #9c0009 #9c0009 #e74e4c; box-shadow: 0 0 0 1px #520000, 1px 2px 4px #0008; } #marker_vp, #marker_turn { background-color: #fadb04; border-color: #ffff51 #c0a100 #c0a100 #ffff51; box-shadow: 0 0 0 1px #563600, 1px 2px 4px #0008; } #marker_com_tst { background-color: #f26649; border-color: #ff9273 #c2391c #c2391c #ff9273; box-shadow: 0 0 0 1px #640000, 1px 2px 4px #0008; } #marker_dem_tst { background-color: #c4e2f4; border-color: #e6ffff #8ca8ba #8ca8ba #e6ffff; box-shadow: 0 0 0 1px #27404f, 1px 2px 4px #0008; } @@ -168,7 +168,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #marker_turn { background-image: url(markers75/turn.png) } #marker_action_round.dem { background-image: url(markers75/action_round_blue.png) } -#marker_action_round.com { background-image: url(markers75/action_round_blue.png) } +#marker_action_round.com { background-image: url(markers75/action_round_red.png) } #marker_stability_track { background-image: url(markers75/ussr_stability_track.png) } #marker_dem_tst { background-image: url(markers75/ts_blue.png) } #marker_com_tst { background-image: url(markers75/ts_red.png) } diff --git a/tools/gencolors.js b/tools/gencolors.js index 5904741..cff0fe2 100644 --- a/tools/gencolors.js +++ b/tools/gencolors.js @@ -70,8 +70,8 @@ function gencss(color, sel) { gencss("#bbbbbb", ".marker") gencss("#c4e2f6", ".demInfl.ctl") gencss("#c1272d", ".comInfl.ctl") -gencss("#147fc0", "#marker_action_round.com") -gencss("#c1272d", "#marker_action_round.dem") +gencss("#147fc0", "#marker_action_round.dem") +gencss("#c1272d", "#marker_action_round.com") gencss("#fadb04", "#marker_vp, #marker_turn") gencss("#f26649", "#marker_com_tst") gencss("#c4e2f4", "#marker_dem_tst") -- cgit v1.2.3 From 3e30593e9986187aff35a4440bdbcb309025c58c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:12:25 +0200 Subject: Move event reminder location on top of Yugoslavia. Initialize marker locations to their starting positions. --- play.css | 7 ++++--- play.html | 27 ++++++--------------------- play.js | 6 +++++- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/play.css b/play.css index d98c8ce..c339351 100644 --- a/play.css +++ b/play.css @@ -109,10 +109,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #event_reminder_list { position: absolute; display: flex; - flex-rap: wrap; + flex-wrap: wrap; gap: 5px; - bottom: 165px; - right: 195px; + top: 1650px; + left: 600px; + width: 200px; } .marker { diff --git a/play.html b/play.html index eb2f495..473be26 100644 --- a/play.html +++ b/play.html @@ -53,27 +53,12 @@
    -
    -
    -
    -
    -
    -
    - - +
    +
    +
    +
    +
    +
    diff --git a/play.js b/play.js index 9ac9e60..4658044 100644 --- a/play.js +++ b/play.js @@ -284,7 +284,8 @@ function on_update() { if (!ui.spaces) create_ui() - // UPDATE ASIDE + // UPDATE PLAYER INFO + if (view.is_pwr_struggle) { roles.Democrat.stat.textContent = `${view.democrat_power_hand} Power cards` roles.Communist.stat.textContent = `${view.communist_power_hand} Power cards` @@ -292,9 +293,11 @@ function on_update() { roles.Democrat.stat.textContent = `${view.democrat_hand} cards` roles.Communist.stat.innerText = `${view.communist_hand} cards` } + ui.turn_info.innerText = `Strategy deck: ${view.strategy_deck} cards` // UPDATE TRACK MARKERS + layout_turn_marker() layout_round_marker() layout_stability_marker() @@ -338,6 +341,7 @@ function on_update() { ui.event_reminder_list.appendChild(ui.events[id]) // UPDATE INFLUENCE VALUES + for (let s = 1; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] -- cgit v1.2.3 From f71d3ff7dd4e6b4536049fe034e934182cb36cf4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:24:38 +0200 Subject: Animate transitions. Card background color while image is loading. --- play.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/play.css b/play.css index c339351..1a9b4dd 100644 --- a/play.css +++ b/play.css @@ -123,9 +123,10 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } height: 45px; border: 2px solid; border-color: #eee #bbb #bbb #eee; - /* TODO: per marker border color */ box-shadow: 0 0 0 1px #444; - //border-radius: 8px; + transition-property: top, left; + transition-duration: 700ms; + transition-timing-function: ease; } .demInfl { background-color: #fff; } @@ -249,6 +250,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card { background-size: cover; background-repeat: no-repeat; + background-color: #fffde9; width: 250px; height: 350px; border-radius: 16px; -- cgit v1.2.3 From ea8755f9fe54ea911cdd864c5cfc01d708bdafb4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:33:08 +0200 Subject: add played power card panel --- play.html | 24 ++++++++++++++---------- play.js | 7 ++++++- rules.js | 3 ++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/play.html b/play.html index 473be26..f510ba0 100644 --- a/play.html +++ b/play.html @@ -66,6 +66,20 @@
    + +
    +
    Played Power Card
    +
    +
    +
    +
    Ceausescu Cards
    +
    +
    +
    +
    Power Struggle Hand
    +
    +
    +
    Cards on the Table
    @@ -84,16 +98,6 @@
    - -
    -
    Ceausescu Cards
    -
    -
    -
    -
    Power Struggle Hand
    -
    -
    -
    Opponent Hand
    diff --git a/play.js b/play.js index 4658044..770e6d5 100644 --- a/play.js +++ b/play.js @@ -40,6 +40,7 @@ const ui = { event_reminder_list: document.getElementById("event_reminder_list"), played_card: document.getElementById("played_card"), + played_power_card: document.getElementById("played_power_card"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), opp_hand: document.getElementById("opp_hand"), @@ -372,6 +373,10 @@ function on_update() { if (view.played_card > 0) ui.played_card.appendChild(ui.cards[view.played_card]) + ui.played_power_card.replaceChildren() + if (view.played_power_card > 0) + ui.played_power_card.appendChild(ui.power_cards[view.played_power_card]) + ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) @@ -383,7 +388,7 @@ function on_update() { ui.power_hand.replaceChildren() if (view.power_hand) for (let c of view.power_hand) - ui.hand.appendChild(ui.power_cards[c]) + ui.power_hand.appendChild(ui.power_cards[c]) ui.opp_hand.replaceChildren() if (view.opp_hand) diff --git a/rules.js b/rules.js index 6ce54dd..64d4396 100644 --- a/rules.js +++ b/rules.js @@ -192,7 +192,8 @@ exports.view = function(state, player) { } if (game.is_pwr_struggle) { - view.strategy_discard = game.power_struggle_discard + view.power_struggle_discard = game.power_struggle_discard + view.played_power_card = game.played_power_card, } else { view.strategy_discard = game.strategy_discard } -- cgit v1.2.3 From 4cc31a4a900a93473f98a23a9de78ffe7001dbff Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 00:36:46 +0200 Subject: show power card tooltip --- play.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index 770e6d5..319f79c 100644 --- a/play.js +++ b/play.js @@ -476,7 +476,7 @@ function sub_card_name(match, p1) { function sub_power_card_name(match, p1) { let x = p1 | 0 - return `${power_cards[x].name}` + return `${power_cards[x].name}` } function sub_power_card_value(match, p1) { @@ -513,6 +513,14 @@ function on_blur_card_tip() { document.getElementById("tooltip").classList = "card hide" } +function on_focus_power_card_tip(card_number) { + document.getElementById("tooltip").className = "card power_" + card_number +} + +function on_blur_power_card_tip() { + document.getElementById("tooltip").classList = "card hide" +} + function on_focus_space_tip(id) { ui.spaces[id].classList.add("tip") } -- cgit v1.2.3 From 99a6ff8112bbc47d6c2825c36328aa40c5c99384 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 01:06:07 +0200 Subject: fix typo --- about.html | 26 +++++++++++++++++--------- rules.js | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/about.html b/about.html index d9ba2a8..7cd0291 100644 --- a/about.html +++ b/about.html @@ -1,10 +1,18 @@

    - 1989 is an exciting, fast paced game simulating the end of the Cold War in 1989. During this amazing year, a series of democratic revolutions ended the 40 year Soviet empire in Eastern Europe. 1989 simulates the political, social and economic aspects of these revolutions using a card driven system similar to Twilight Struggle. - - -

    - Designer: Jason Matthews, Ted Torgerson. -
    Copyright © 2012 GMT Games, LLC. -
    Programming © 2024 Iain Pearce. - - \ No newline at end of file +1989 is an exciting, fast paced game simulating the end of the Cold War in +1989. During this amazing year, a series of democratic revolutions ended the 40 +year Soviet empire in Eastern Europe. 1989 simulates the political, social and +economic aspects of these revolutions using a card driven system similar to +Twilight Struggle. + +

    +Designer: Jason Matthews, Ted Torgerson. +
    Copyright © 2012 GMT Games, LLC. +
    Programming © 2024 Iain Pearce. + +

    diff --git a/rules.js b/rules.js index 64d4396..c179e9e 100644 --- a/rules.js +++ b/rules.js @@ -193,7 +193,7 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard - view.played_power_card = game.played_power_card, + view.played_power_card = game.played_power_card } else { view.strategy_discard = game.strategy_discard } -- cgit v1.2.3 From 36c00d55b75b4a6677fbd366158f9775303f9279 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 07:52:09 +0100 Subject: Removing null --- data.js | 151 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 75 insertions(+), 76 deletions(-) diff --git a/data.js b/data.js index 17e7530..7f82bf4 100644 --- a/data.js +++ b/data.js @@ -1,80 +1,79 @@ const spaces = [ - null, - {name_unique: 'Schwerin', space_id: 1, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 111, y: 61}, adjacent: [2, 3, , , ]}, - {name_unique: 'Rostock', space_id: 2, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 228, y: 41}, adjacent: [1, 3, , , ]}, - {name_unique: 'Berlin', space_id: 3, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 251, y: 113}, adjacent: [1, 2, 5, 9, ]}, - {name_unique: 'German Writers', space_id: 4, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 185}, adjacent: [5, , , , ]}, - {name_unique: 'Walter Ulbricht Academy', space_id: 5, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 187}, adjacent: [3, 4, , , ]}, - {name_unique: 'Lutherian Church', space_id: 6, socio: 7, stability: 5, battleground: 1, demInfl: 1, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 300, y: 212}, adjacent: [9, , , , ]}, - {name_unique: 'Magdeburg', space_id: 7, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 275}, adjacent: [8, 10, 11, , ]}, - {name_unique: 'Halle', space_id: 8, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 278}, adjacent: [7, 9, 11, , ]}, - {name_unique: 'Leipzig', space_id: 9, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 297, y: 297}, adjacent: [3, 6, 8, 11, 12]}, - {name_unique: 'Erfurt', space_id: 10, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 23, y: 356}, adjacent: [7, , , , ]}, - {name_unique: 'Karl-Marx-Stadt', space_id: 11, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 138, y: 385}, adjacent: [7, 8, 9, 12, ]}, - {name_unique: 'Dresden', space_id: 12, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 262, y: 375}, adjacent: [9, 11, 19, 27, ]}, - {name_unique: 'Szczecin', space_id: 13, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 434, y: 204}, adjacent: [14, 16, , , ]}, - {name_unique: 'Gdańsk', space_id: 14, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 699, y: 215}, adjacent: [13, 15, 16, 17, 18]}, - {name_unique: 'Bydgoszcz', space_id: 15, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 304}, adjacent: [14, 17, , , ]}, - {name_unique: 'Poznań', space_id: 16, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 521, y: 355}, adjacent: [13, 14, 19, 20, ]}, - {name_unique: 'Warszawa', space_id: 17, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 806, y: 383}, adjacent: [14, 15, 18, 21, 24]}, - {name_unique: 'Białystok', space_id: 18, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 940, y: 342}, adjacent: [14, 17, 24, , ]}, - {name_unique: 'Wrocław', space_id: 19, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 462, y: 443}, adjacent: [12, 16, 20, 22, ]}, - {name_unique: 'Catholic Church, Poland', space_id: 20, socio: 7, stability: 5, battleground: 0, demInfl: 5, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 625, y: 437}, adjacent: [16, 19, 21, 22, 23]}, - {name_unique: 'Łódź', space_id: 21, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 749, y: 486}, adjacent: [17, 20, 23, 24, ]}, - {name_unique: 'Katowice', space_id: 22, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 570, y: 569}, adjacent: [19, 20, 23, 33, ]}, - {name_unique: 'Kraków', space_id: 23, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 711, y: 598}, adjacent: [20, 21, 22, 25, ]}, - {name_unique: 'Lublin', space_id: 24, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 879, y: 603}, adjacent: [17, 18, 21, , ]}, - {name_unique: 'Jagiellian University', space_id: 25, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 681}, adjacent: [23, 26, , , ]}, - {name_unique: 'Polish Writers', space_id: 26, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 832, y: 694}, adjacent: [25, , , , ]}, - {name_unique: 'Plzeň', space_id: 27, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 159, y: 483}, adjacent: [12, 28, 29, , ]}, - {name_unique: 'České Budĕjovice', space_id: 28, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 196, y: 601}, adjacent: [27, 29, , , ]}, - {name_unique: 'Praha', space_id: 29, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 317, y: 614}, adjacent: [27, 28, 30, 32, ]}, - {name_unique: 'Charles University', space_id: 30, socio: 6, stability: 1, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 380, y: 532}, adjacent: [29, 31, , , ]}, - {name_unique: 'Czech Writers', space_id: 31, socio: 5, stability: 2, battleground: 1, demInfl: 2, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 444, y: 607}, adjacent: [30, , , , ]}, - {name_unique: 'Brno', space_id: 32, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 403, y: 711}, adjacent: [29, 33, 34, , ]}, - {name_unique: 'Ostrava', space_id: 33, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 523, y: 681}, adjacent: [22, 32, 34, 35, ]}, - {name_unique: 'Bratislava', space_id: 34, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 417, y: 797}, adjacent: [32, 33, 35, , ]}, - {name_unique: 'Catholic Church, Czechoslovakia', space_id: 35, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 538, y: 794}, adjacent: [33, 34, 36, , ]}, - {name_unique: 'Prešov', space_id: 36, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 658, y: 794}, adjacent: [35, 37, , , ]}, - {name_unique: 'Košice', space_id: 37, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 777, y: 815}, adjacent: [36, 42, , , ]}, - {name_unique: 'Catholic Church, Hungary', space_id: 38, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 314, y: 886}, adjacent: [39, 43, , , ]}, - {name_unique: 'Győr', space_id: 39, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 434, y: 887}, adjacent: [38, 40, 43, 44, ]}, - {name_unique: 'Tatabánya', space_id: 40, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 549, y: 886}, adjacent: [39, 41, 45, , ]}, - {name_unique: 'Miskolc', space_id: 41, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 664, y: 901}, adjacent: [40, 42, 45, , ]}, - {name_unique: 'Debrecen', space_id: 42, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 781, y: 938}, adjacent: [37, 41, , , ]}, - {name_unique: 'Szombathely', space_id: 43, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Hungary', region: 'Eastern Europe', box: {x: 316, y: 963}, adjacent: [38, 39, 44, , ]}, - {name_unique: 'Székesfehérvár', space_id: 44, socio: 4, stability: 3, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 442, y: 962}, adjacent: [39, 43, 45, , ]}, - {name_unique: 'Budapest', space_id: 45, socio: 2, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 630, y: 983}, adjacent: [40, 41, 44, 47, 48]}, - {name_unique: 'Hungarian Writers', space_id: 46, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 348, y: 1040}, adjacent: [47, , , , ]}, - {name_unique: 'Eötvös Loránd University', space_id: 47, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 512, y: 1034}, adjacent: [46, 45, , , ]}, - {name_unique: 'Szeged', space_id: 48, socio: 3, stability: 4, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 632, y: 1073}, adjacent: [45, 49, 50, , ]}, - {name_unique: 'Pécs', space_id: 49, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 486, y: 1105}, adjacent: [48, , , , ]}, - {name_unique: 'Timişoara', space_id: 50, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 597, y: 1204}, adjacent: [48, 51, 60, , ]}, - {name_unique: 'Cluj-Napoca', space_id: 51, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 756, y: 1125}, adjacent: [50, 54, 58, 61, ]}, - {name_unique: 'Târgu Mureş', space_id: 52, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 915, y: 1136}, adjacent: [53, 56, , , ]}, - {name_unique: 'Iaşi', space_id: 53, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1072, y: 1097}, adjacent: [52, 57, 62, , ]}, - {name_unique: 'Babeş-Bolyai University', space_id: 54, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 746, y: 1203}, adjacent: [51, 55, , , ]}, - {name_unique: 'Romanian Writers', space_id: 55, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 739, y: 1278}, adjacent: [54, , , , ]}, - {name_unique: 'Hargita/Covasna', space_id: 56, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 928, y: 1227}, adjacent: [52, , , , ]}, - {name_unique: 'Braşov', space_id: 57, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1049, y: 1225}, adjacent: [53, 59, 61, , ]}, - {name_unique: 'Orthodox Church Romania', space_id: 58, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 855, y: 1338}, adjacent: [51, 60, , , ]}, - {name_unique: 'Ploieşti', space_id: 59, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1061, y: 1316}, adjacent: [57, 61, 62, , ]}, - {name_unique: 'Craiova', space_id: 60, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 763, y: 1411}, adjacent: [50, 58, 61, , ]}, - {name_unique: 'Bucureşti', space_id: 61, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 929, y: 1445}, adjacent: [51, 57, 59, 60, 63]}, - {name_unique: 'Galaţi', space_id: 62, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1104, y: 1399}, adjacent: [53, 59, 63, , ]}, - {name_unique: 'Constanţa', space_id: 63, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1130, y: 1517}, adjacent: [61, 62, 72, , ]}, - {name_unique: 'Pleven', space_id: 64, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 764, y: 1534}, adjacent: [68, , , , ]}, - {name_unique: 'Orthodox Church Bulgaria', space_id: 65, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 882, y: 1540}, adjacent: [66, 68, , , ]}, - {name_unique: 'Ruse', space_id: 66, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 998, y: 1540}, adjacent: [65, 69, 70, 71, 72]}, - {name_unique: 'Sofia University', space_id: 67, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 645, y: 1650}, adjacent: [68, 73, , , ]}, - {name_unique: 'Sofia', space_id: 68, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Bulgaria', region: 'Balkans', box: {x: 768, y: 1653}, adjacent: [64, 65, 67, 69, 74]}, - {name_unique: 'Stara Zagora', space_id: 69, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Bulgaria', region: 'Balkans', box: {x: 886, y: 1694}, adjacent: [66, 68, 71, , ]}, - {name_unique: 'Razgrad', space_id: 70, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 954, y: 1620}, adjacent: [66, , , , ]}, - {name_unique: 'Burgas', space_id: 71, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1004, y: 1695}, adjacent: [66, 69, 72, , ]}, - {name_unique: 'Varna', space_id: 72, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [63, 66, 71, , ]}, - {name_unique: 'Bulgarian Writers', space_id: 73, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [67, , , , ]}, - {name_unique: 'Plovdiv', space_id: 74, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [68, 75, , , ]}, - {name_unique: 'Sliven', space_id: 75, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [74, , , , ]} + {name_unique: 'Schwerin', space_id: 0, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 111, y: 61}, adjacent: [1, 2, , , ]}, + {name_unique: 'Rostock', space_id: 1, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 228, y: 41}, adjacent: [0, 2, , , ]}, + {name_unique: 'Berlin', space_id: 2, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 251, y: 113}, adjacent: [0, 1, 4, 8, ]}, + {name_unique: 'German Writers', space_id: 3, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 185}, adjacent: [4, , , , ]}, + {name_unique: 'Walter Ulbricht Academy', space_id: 4, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 187}, adjacent: [2, 3, , , ]}, + {name_unique: 'Lutherian Church', space_id: 5, socio: 7, stability: 5, battleground: 1, demInfl: 1, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 300, y: 212}, adjacent: [8, , , , ]}, + {name_unique: 'Magdeburg', space_id: 6, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 58, y: 275}, adjacent: [7, 9, 10, , ]}, + {name_unique: 'Halle', space_id: 7, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 175, y: 278}, adjacent: [6, 8, 10, , ]}, + {name_unique: 'Leipzig', space_id: 8, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 297, y: 297}, adjacent: [2, 5, 7, 10, 11]}, + {name_unique: 'Erfurt', space_id: 9, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 23, y: 356}, adjacent: [6, , , , ]}, + {name_unique: 'Karl-Marx-Stadt', space_id: 10, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'East_Germany', region: 'Eastern Europe', box: {x: 138, y: 385}, adjacent: [6, 7, 8, 11, ]}, + {name_unique: 'Dresden', space_id: 11, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'East_Germany', region: 'Eastern Europe', box: {x: 262, y: 375}, adjacent: [8, 10, 18, 26, ]}, + {name_unique: 'Szczecin', space_id: 12, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 434, y: 204}, adjacent: [13, 15, , , ]}, + {name_unique: 'Gdańsk', space_id: 13, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 699, y: 215}, adjacent: [12, 14, 15, 16, 17]}, + {name_unique: 'Bydgoszcz', space_id: 14, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 304}, adjacent: [13, 16, , , ]}, + {name_unique: 'Poznań', space_id: 15, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 521, y: 355}, adjacent: [12, 13, 18, 19, ]}, + {name_unique: 'Warszawa', space_id: 16, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 806, y: 383}, adjacent: [13, 14, 17, 20, 23]}, + {name_unique: 'Białystok', space_id: 17, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 940, y: 342}, adjacent: [13, 16, 23, , ]}, + {name_unique: 'Wrocław', space_id: 18, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 462, y: 443}, adjacent: [11, 15, 19, 21, ]}, + {name_unique: 'Catholic Church, Poland', space_id: 19, socio: 7, stability: 5, battleground: 0, demInfl: 5, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 625, y: 437}, adjacent: [15, 18, 20, 21, 22]}, + {name_unique: 'Łódź', space_id: 20, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 749, y: 486}, adjacent: [16, 19, 22, 23, ]}, + {name_unique: 'Katowice', space_id: 21, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 570, y: 569}, adjacent: [18, 19, 22, 32, ]}, + {name_unique: 'Kraków', space_id: 22, socio: 4, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 711, y: 598}, adjacent: [19, 20, 21, 24, ]}, + {name_unique: 'Lublin', space_id: 23, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Poland', region: 'Eastern Europe', box: {x: 879, y: 603}, adjacent: [16, 17, 20, , ]}, + {name_unique: 'Jagiellian University', space_id: 24, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 679, y: 681}, adjacent: [22, 25, , , ]}, + {name_unique: 'Polish Writers', space_id: 25, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Poland', region: 'Eastern Europe', box: {x: 832, y: 694}, adjacent: [24, , , , ]}, + {name_unique: 'Plzeň', space_id: 26, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 159, y: 483}, adjacent: [11, 27, 28, , ]}, + {name_unique: 'České Budĕjovice', space_id: 27, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 196, y: 601}, adjacent: [26, 28, , , ]}, + {name_unique: 'Praha', space_id: 28, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 317, y: 614}, adjacent: [26, 27, 29, 31, ]}, + {name_unique: 'Charles University', space_id: 29, socio: 6, stability: 1, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 380, y: 532}, adjacent: [28, 30, , , ]}, + {name_unique: 'Czech Writers', space_id: 30, socio: 5, stability: 2, battleground: 1, demInfl: 2, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 444, y: 607}, adjacent: [29, , , , ]}, + {name_unique: 'Brno', space_id: 31, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 1, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 403, y: 711}, adjacent: [28, 32, 33, , ]}, + {name_unique: 'Ostrava', space_id: 32, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 523, y: 681}, adjacent: [21, 31, 33, 34, ]}, + {name_unique: 'Bratislava', space_id: 33, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 417, y: 797}, adjacent: [31, 32, 34, , ]}, + {name_unique: 'Catholic Church, Czechoslovakia', space_id: 34, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 538, y: 794}, adjacent: [32, 33, 35, , ]}, + {name_unique: 'Prešov', space_id: 35, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 658, y: 794}, adjacent: [34, 36, , , ]}, + {name_unique: 'Košice', space_id: 36, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Czechoslovakia', region: 'Eastern Europe', box: {x: 777, y: 815}, adjacent: [35, 41, , , ]}, + {name_unique: 'Catholic Church, Hungary', space_id: 37, socio: 7, stability: 5, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 314, y: 886}, adjacent: [38, 42, , , ]}, + {name_unique: 'Győr', space_id: 38, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 434, y: 887}, adjacent: [37, 39, 42, 43, ]}, + {name_unique: 'Tatabánya', space_id: 39, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 549, y: 886}, adjacent: [38, 40, 44, , ]}, + {name_unique: 'Miskolc', space_id: 40, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 664, y: 901}, adjacent: [39, 41, 44, , ]}, + {name_unique: 'Debrecen', space_id: 41, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 781, y: 938}, adjacent: [36, 40, , , ]}, + {name_unique: 'Szombathely', space_id: 42, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Hungary', region: 'Eastern Europe', box: {x: 316, y: 963}, adjacent: [37, 38, 43, , ]}, + {name_unique: 'Székesfehérvár', space_id: 43, socio: 4, stability: 3, battleground: 0, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 442, y: 962}, adjacent: [38, 42, 44, , ]}, + {name_unique: 'Budapest', space_id: 44, socio: 2, stability: 3, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 630, y: 983}, adjacent: [39, 40, 43, 46, 47]}, + {name_unique: 'Hungarian Writers', space_id: 45, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 348, y: 1040}, adjacent: [46, , , , ]}, + {name_unique: 'Eötvös Loránd University', space_id: 46, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 512, y: 1034}, adjacent: [45, 44, , , ]}, + {name_unique: 'Szeged', space_id: 47, socio: 3, stability: 4, battleground: 1, demInfl: 1, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 632, y: 1073}, adjacent: [44, 48, 49, , ]}, + {name_unique: 'Pécs', space_id: 48, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Hungary', region: 'Eastern Europe', box: {x: 486, y: 1105}, adjacent: [47, , , , ]}, + {name_unique: 'Timişoara', space_id: 49, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 597, y: 1204}, adjacent: [47, 50, 59, , ]}, + {name_unique: 'Cluj-Napoca', space_id: 50, socio: 1, stability: 4, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 756, y: 1125}, adjacent: [49, 53, 57, 60, ]}, + {name_unique: 'Târgu Mureş', space_id: 51, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 915, y: 1136}, adjacent: [52, 55, , , ]}, + {name_unique: 'Iaşi', space_id: 52, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1072, y: 1097}, adjacent: [51, 56, 61, , ]}, + {name_unique: 'Babeş-Bolyai University', space_id: 53, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 746, y: 1203}, adjacent: [50, 54, , , ]}, + {name_unique: 'Romanian Writers', space_id: 54, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 739, y: 1278}, adjacent: [53, , , , ]}, + {name_unique: 'Hargita/Covasna', space_id: 55, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 928, y: 1227}, adjacent: [51, , , , ]}, + {name_unique: 'Braşov', space_id: 56, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1049, y: 1225}, adjacent: [52, 58, 60, , ]}, + {name_unique: 'Orthodox Church Romania', space_id: 57, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 855, y: 1338}, adjacent: [50, 59, , , ]}, + {name_unique: 'Ploieşti', space_id: 58, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1061, y: 1316}, adjacent: [56, 60, 61, , ]}, + {name_unique: 'Craiova', space_id: 59, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 763, y: 1411}, adjacent: [49, 57, 60, , ]}, + {name_unique: 'Bucureşti', space_id: 60, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Romania', region: 'Balkans', box: {x: 929, y: 1445}, adjacent: [50, 56, 58, 59, 62]}, + {name_unique: 'Galaţi', space_id: 61, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1104, y: 1399}, adjacent: [52, 58, 62, , ]}, + {name_unique: 'Constanţa', space_id: 62, socio: 4, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Romania', region: 'Balkans', box: {x: 1130, y: 1517}, adjacent: [60, 61, 71, , ]}, + {name_unique: 'Pleven', space_id: 63, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 764, y: 1534}, adjacent: [67, , , , ]}, + {name_unique: 'Orthodox Church Bulgaria', space_id: 64, socio: 7, stability: 3, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 882, y: 1540}, adjacent: [65, 67, , , ]}, + {name_unique: 'Ruse', space_id: 65, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 998, y: 1540}, adjacent: [64, 68, 69, 70, 71]}, + {name_unique: 'Sofia University', space_id: 66, socio: 6, stability: 1, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 645, y: 1650}, adjacent: [67, 72, , , ]}, + {name_unique: 'Sofia', space_id: 67, socio: 2, stability: 3, battleground: 1, demInfl: 0, comInfl: 2, country: 'Bulgaria', region: 'Balkans', box: {x: 768, y: 1653}, adjacent: [63, 64, 66, 68, 73]}, + {name_unique: 'Stara Zagora', space_id: 68, socio: 1, stability: 4, battleground: 0, demInfl: 0, comInfl: 1, country: 'Bulgaria', region: 'Balkans', box: {x: 886, y: 1694}, adjacent: [65, 67, 70, , ]}, + {name_unique: 'Razgrad', space_id: 69, socio: 8, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 954, y: 1620}, adjacent: [65, , , , ]}, + {name_unique: 'Burgas', space_id: 70, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1004, y: 1695}, adjacent: [65, 68, 71, , ]}, + {name_unique: 'Varna', space_id: 71, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 1086, y: 1613}, adjacent: [62, 65, 70, , ]}, + {name_unique: 'Bulgarian Writers', space_id: 72, socio: 5, stability: 2, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 652, y: 1726}, adjacent: [66, , , , ]}, + {name_unique: 'Plovdiv', space_id: 73, socio: 4, stability: 3, battleground: 1, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 771, y: 1739}, adjacent: [67, 74, , , ]}, + {name_unique: 'Sliven', space_id: 74, socio: 3, stability: 4, battleground: 0, demInfl: 0, comInfl: 0, country: 'Bulgaria', region: 'Balkans', box: {x: 894, y: 1768}, adjacent: [73, , , , ]}, ] const cards = [ -- cgit v1.2.3 From f08940b60cb3a873aead8db1c2b25445c6af5a1e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 07:53:43 +0100 Subject: Fix typo --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.txt b/events.txt index ded984f..e900510 100644 --- a/events.txt +++ b/events.txt @@ -565,7 +565,7 @@ prompt ' spaces with no Democratic SPs' add_infl_free 4 else prompt 'Select a Student or Intellectual space' -valid_spaces_country_socio_2 3, 4 +valid_spaces_country_socio_2 3 4 support_check_modified 2 2 endif -- cgit v1.2.3 From 04f3fce657af20407eb0e640d925e0fe79913aac Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 07:54:12 +0100 Subject: Working on no null space --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 877c4d8..a508d04 100644 --- a/rules.js +++ b/rules.js @@ -201,7 +201,7 @@ exports.view = function(state, player) { view.drawn = game.vm.draw if (player === game.active) { - if (game.selected_space > 0 ) { + if (game.selected_space) { view.valid_spaces = [game.selected_space] } else { view.valid_spaces = game.valid_spaces @@ -748,6 +748,7 @@ states.finish_support_check_prep = { //return } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` + console.log('valid_spaces', game.valid_spaces) for (let space_id of game.valid_spaces) { gen_action_space(space_id) } @@ -3806,6 +3807,7 @@ function new_turn() { game.com_tst_attempted_this_turn = 0 if (game.tst_7) {game.tst_7 = false} if (game.tst_8) {game.tst_8 = false} + delete game.selected_space //Remove events that only last one turn game.persistent_events = game.persistent_events.filter(n => n !== 25) /*Perestroika*/ -- cgit v1.2.3 From a651d28999accf0c18476b322a47ea5ebf031aef Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 07:55:38 +0100 Subject: Switch to single space action --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index 5ccf136..b2500ba 100644 --- a/play.js +++ b/play.js @@ -183,7 +183,7 @@ function on_click_space(evt) { if (evt.button === 0) { const space = evt.target.my_space; //console.log('on_click_space_called with space:', space); - if (send_action('infl', space)) { + if (send_action('space', space)) { //console.log('send_action with infl:', space); evt.stopPropagation(); } else if (send_action('sc', space)) { -- cgit v1.2.3 From 264161f150688577c757835dafbd78645106172c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 12:21:13 +0100 Subject: Remove null space --- data.js | 2552 ++++++++++++++++++++++++++++++------------------------------ events.txt | 28 +- play.js | 14 +- rules.js | 245 +++--- 4 files changed, 1426 insertions(+), 1413 deletions(-) diff --git a/data.js b/data.js index 6c37c50..c8194f1 100644 --- a/data.js +++ b/data.js @@ -1,1282 +1,1280 @@ const spaces = [ - null, - { - name_unique: "Schwerin", - space_id: 1, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 111, - y: 61, - }, - adjacent: [ 2, 3 ], - ascii_name: "Schwerin", - }, - { - name_unique: "Rostock", - space_id: 2, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 228, - y: 41, - }, - adjacent: [ 1, 3 ], - ascii_name: "Rostock", - }, - { - name_unique: "Berlin", - space_id: 3, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 251, - y: 113, - }, - adjacent: [ 1, 2, 5, 9 ], - ascii_name: "Berlin", - }, - { - name_unique: "German Writers", - space_id: 4, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 58, - y: 185, - }, - adjacent: [ 5 ], - ascii_name: "German Writers", - }, - { - name_unique: "Walter Ulbricht Academy", - space_id: 5, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 175, - y: 187, - }, - adjacent: [ 3, 4 ], - ascii_name: "Walter Ulbricht Academy", - }, - { - name_unique: "Lutheran Church", - space_id: 6, - socio: 7, - stability: 5, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 300, - y: 212, - }, - adjacent: [ 9 ], - ascii_name: "Lutheran Church", - }, - { - name_unique: "Magdeburg", - space_id: 7, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 58, - y: 275, - }, - adjacent: [ 8, 10, 11 ], - ascii_name: "Magdeburg", - }, - { - name_unique: "Halle", - space_id: 8, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 175, - y: 278, - }, - adjacent: [ 7, 9, 11 ], - ascii_name: "Halle", - }, - { - name_unique: "Leipzig", - space_id: 9, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 297, - y: 297, - }, - adjacent: [ 3, 6, 8, 11, 12 ], - ascii_name: "Leipzig", - }, - { - name_unique: "Erfurt", - space_id: 10, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 23, - y: 356, - }, - adjacent: [ 7 ], - ascii_name: "Erfurt", - }, - { - name_unique: "Karl-Marx-Stadt", - space_id: 11, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 138, - y: 385, - }, - adjacent: [ 7, 8, 9, 12 ], - ascii_name: "Karl-Marx-Stadt", - }, - { - name_unique: "Dresden", - space_id: 12, - socio: 1, - stability: 4, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 262, - y: 375, - }, - adjacent: [ 9, 11, 19, 27 ], - ascii_name: "Dresden", - }, - { - name_unique: "Szczecin", - space_id: 13, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 434, - y: 204, - }, - adjacent: [ 14, 16 ], - ascii_name: "Szczecin", - }, - { - name_unique: "Gdańsk", - space_id: 14, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 699, - y: 215, - }, - adjacent: [ 13, 15, 16, 17, 18 ], - ascii_name: "Gdansk", - }, - { - name_unique: "Bydgoszcz", - space_id: 15, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 679, - y: 304, - }, - adjacent: [ 14, 17 ], - ascii_name: "Bydgoszcz", - }, - { - name_unique: "Poznań", - space_id: 16, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 521, - y: 355, - }, - adjacent: [ 13, 14, 19, 20 ], - ascii_name: "Poznan", - }, - { - name_unique: "Warszawa", - space_id: 17, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 806, - y: 383, - }, - adjacent: [ 14, 15, 18, 21, 24 ], - ascii_name: "Warszawa", - }, - { - name_unique: "Białystok", - space_id: 18, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 940, - y: 342, - }, - adjacent: [ 14, 17, 24 ], - ascii_name: "Bialystok", - }, - { - name_unique: "Wrocław", - space_id: 19, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 462, - y: 443, - }, - adjacent: [ 12, 16, 20, 22 ], - ascii_name: "Wroclaw", - }, - { - name_unique: "Catholic Church, Poland", - space_id: 20, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 5, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 625, - y: 437, - }, - adjacent: [ 16, 19, 21, 22, 23 ], - ascii_name: "Catholic Church, Poland", - }, - { - name_unique: "Łódź", - space_id: 21, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 749, - y: 486, - }, - adjacent: [ 17, 20, 23, 24 ], - ascii_name: "Lodz", - }, - { - name_unique: "Katowice", - space_id: 22, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 570, - y: 569, - }, - adjacent: [ 19, 20, 23, 33 ], - ascii_name: "Katowice", - }, - { - name_unique: "Kraków", - space_id: 23, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 711, - y: 598, - }, - adjacent: [ 20, 21, 22, 25 ], - ascii_name: "Krakow", - }, - { - name_unique: "Lublin", - space_id: 24, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 879, - y: 603, - }, - adjacent: [ 17, 18, 21 ], - ascii_name: "Lublin", - }, - { - name_unique: "Jagiellonian University", - space_id: 25, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 679, - y: 681, - }, - adjacent: [ 23, 26 ], - ascii_name: "Jagiellonian University", - }, - { - name_unique: "Polish Writers", - space_id: 26, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 832, - y: 694, - }, - adjacent: [ 25 ], - ascii_name: "Polish Writers", - }, - { - name_unique: "Plzeň", - space_id: 27, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 2, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 159, - y: 483, - }, - adjacent: [ 12, 28, 29 ], - ascii_name: "Plzen", - }, - { - name_unique: "České Budĕjovice", - space_id: 28, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 196, - y: 601, - }, - adjacent: [ 27, 29 ], - ascii_name: "Ceske Budejovice", - }, - { - name_unique: "Praha", - space_id: 29, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 317, - y: 614, - }, - adjacent: [ 27, 28, 30, 32 ], - ascii_name: "Praha", - }, - { - name_unique: "Charles University", - space_id: 30, - socio: 6, - stability: 1, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 380, - y: 532, - }, - adjacent: [ 29, 31 ], - ascii_name: "Charles University", - }, - { - name_unique: "Czech Writers", - space_id: 31, - socio: 5, - stability: 2, - battleground: 1, - demInfl: 2, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 444, - y: 607, - }, - adjacent: [ 30 ], - ascii_name: "Czech Writers", - }, - { - name_unique: "Brno", - space_id: 32, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 1, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 403, - y: 711, - }, - adjacent: [ 29, 33, 34 ], - ascii_name: "Brno", - }, - { - name_unique: "Ostrava", - space_id: 33, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 523, - y: 681, - }, - adjacent: [ 22, 32, 34, 35 ], - ascii_name: "Ostrava", - }, - { - name_unique: "Bratislava", - space_id: 34, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 417, - y: 797, - }, - adjacent: [ 32, 33, 35 ], - ascii_name: "Bratislava", - }, - { - name_unique: "Catholic Church, Czechoslovakia", - space_id: 35, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 538, - y: 794, - }, - adjacent: [ 33, 34, 36 ], - ascii_name: "Catholic Church, Czechoslovakia", - }, - { - name_unique: "Prešov", - space_id: 36, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 658, - y: 794, - }, - adjacent: [ 35, 37 ], - ascii_name: "Presov", - }, - { - name_unique: "Košice", - space_id: 37, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 777, - y: 815, - }, - adjacent: [ 36, 42 ], - ascii_name: "Kosice", - }, - { - name_unique: "Catholic Church, Hungary", - space_id: 38, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 314, - y: 886, - }, - adjacent: [ 39, 43 ], - ascii_name: "Catholic Church, Hungary", - }, - { - name_unique: "Győr", - space_id: 39, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 434, - y: 887, - }, - adjacent: [ 38, 40, 43, 44 ], - ascii_name: "Gyor", - }, - { - name_unique: "Tatabánya", - space_id: 40, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 549, - y: 886, - }, - adjacent: [ 39, 41, 45 ], - ascii_name: "Tatabanya", - }, - { - name_unique: "Miskolc", - space_id: 41, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 664, - y: 901, - }, - adjacent: [ 40, 42, 45 ], - ascii_name: "Miskolc", - }, - { - name_unique: "Debrecen", - space_id: 42, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 781, - y: 938, - }, - adjacent: [ 37, 41 ], - ascii_name: "Debrecen", - }, - { - name_unique: "Szombathely", - space_id: 43, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 316, - y: 963, - }, - adjacent: [ 38, 39, 44 ], - ascii_name: "Szombathely", - }, - { - name_unique: "Székesfehérvár", - space_id: 44, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 442, - y: 962, - }, - adjacent: [ 39, 43, 45 ], - ascii_name: "Szekesfehervar", - }, - { - name_unique: "Budapest", - space_id: 45, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 630, - y: 983, - }, - adjacent: [ 40, 41, 44, 47, 48 ], - ascii_name: "Budapest", - }, - { - name_unique: "Hungarian Writers", - space_id: 46, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 348, - y: 1040, - }, - adjacent: [ 47 ], - ascii_name: "Hungarian Writers", - }, - { - name_unique: "Eötvös Loránd University", - space_id: 47, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 512, - y: 1034, - }, - adjacent: [ 46, 45 ], - ascii_name: "Eotvos Lorand University", - }, - { - name_unique: "Szeged", - space_id: 48, - socio: 3, - stability: 4, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 632, - y: 1073, - }, - adjacent: [ 45, 49, 50 ], - ascii_name: "Szeged", - }, - { - name_unique: "Pécs", - space_id: 49, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 486, - y: 1105, - }, - adjacent: [ 48 ], - ascii_name: "Pecs", - }, - { - name_unique: "Timişoara", - space_id: 50, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 597, - y: 1204, - }, - adjacent: [ 48, 51, 60 ], - ascii_name: "Timisoara", - }, - { - name_unique: "Cluj-Napoca", - space_id: 51, - socio: 1, - stability: 4, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Romania", - region: "Balkans", - box: { - x: 756, - y: 1125, - }, - adjacent: [ 50, 54, 58, 61 ], - ascii_name: "Cluj-Napoca", - }, - { - name_unique: "Târgu Mureş", - space_id: 52, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 915, - y: 1136, - }, - adjacent: [ 53, 56 ], - ascii_name: "Targu Mures", - }, - { - name_unique: "Iaşi", - space_id: 53, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1072, - y: 1097, - }, - adjacent: [ 52, 57, 62 ], - ascii_name: "Iasi", - }, - { - name_unique: "Babeş-Bolyai University", - space_id: 54, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 746, - y: 1203, - }, - adjacent: [ 51, 55 ], - ascii_name: "Babes-Bolyai University", - }, - { - name_unique: "Romanian Writers", - space_id: 55, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 739, - y: 1278, - }, - adjacent: [ 54 ], - ascii_name: "Romanian Writers", - }, - { - name_unique: "Harghita/Covasna", - space_id: 56, - socio: 8, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 928, - y: 1227, - }, - adjacent: [ 52 ], - ascii_name: "Harghita/Covasna", - }, - { - name_unique: "Braşov", - space_id: 57, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1049, - y: 1225, - }, - adjacent: [ 53, 59, 61 ], - ascii_name: "Brasov", - }, - { - name_unique: "Orthodox Church, Romania", - space_id: 58, - socio: 7, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 855, - y: 1338, - }, - adjacent: [ 51, 60 ], - ascii_name: "Orthodox Church, Romania", - }, - { - name_unique: "Ploieşti", - space_id: 59, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1061, - y: 1316, - }, - adjacent: [ 57, 61, 62 ], - ascii_name: "Ploiesti", - }, - { - name_unique: "Craiova", - space_id: 60, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 763, - y: 1411, - }, - adjacent: [ 50, 58, 61 ], - ascii_name: "Craiova", - }, - { - name_unique: "Bucureşti", - space_id: 61, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Romania", - region: "Balkans", - box: { - x: 929, - y: 1445, - }, - adjacent: [ 51, 57, 59, 60, 63 ], - ascii_name: "Bucuresti", - }, - { - name_unique: "Galaţi", - space_id: 62, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1104, - y: 1399, - }, - adjacent: [ 53, 59, 63 ], - ascii_name: "Galati", - }, - { - name_unique: "Constanţa", - space_id: 63, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1130, - y: 1517, - }, - adjacent: [ 61, 62, 72 ], - ascii_name: "Constanta", - }, - { - name_unique: "Pleven", - space_id: 64, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 764, - y: 1534, - }, - adjacent: [ 68 ], - ascii_name: "Pleven", - }, - { - name_unique: "Orthodox Church, Bulgaria", - space_id: 65, - socio: 7, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 882, - y: 1540, - }, - adjacent: [ 66, 68 ], - ascii_name: "Orthodox Church, Bulgaria", - }, - { - name_unique: "Ruse", - space_id: 66, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 998, - y: 1540, - }, - adjacent: [ 65, 69, 70, 71, 72 ], - ascii_name: "Ruse", - }, - { - name_unique: "Sofia University", - space_id: 67, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 645, - y: 1650, - }, - adjacent: [ 68, 73 ], - ascii_name: "Sofia University", - }, - { - name_unique: "Sofia", - space_id: 68, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Bulgaria", - region: "Balkans", - box: { - x: 768, - y: 1653, - }, - adjacent: [ 64, 65, 67, 69, 74 ], - ascii_name: "Sofia", - }, - { - name_unique: "Stara Zagora", - space_id: 69, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Bulgaria", - region: "Balkans", - box: { - x: 886, - y: 1694, - }, - adjacent: [ 66, 68, 71 ], - ascii_name: "Stara Zagora", - }, - { - name_unique: "Razgrad", - space_id: 70, - socio: 8, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 954, - y: 1620, - }, - adjacent: [ 66 ], - ascii_name: "Razgrad", - }, - { - name_unique: "Burgas", - space_id: 71, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 1004, - y: 1695, - }, - adjacent: [ 66, 69, 72 ], - ascii_name: "Burgas", - }, - { - name_unique: "Varna", - space_id: 72, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 1086, - y: 1613, - }, - adjacent: [ 63, 66, 71 ], - ascii_name: "Varna", - }, - { - name_unique: "Bulgarian Writers", - space_id: 73, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 652, - y: 1726, - }, - adjacent: [ 67 ], - ascii_name: "Bulgarian Writers", - }, - { - name_unique: "Plovdiv", - space_id: 74, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 771, - y: 1739, - }, - adjacent: [ 68, 75 ], - ascii_name: "Plovdiv", - }, - { - name_unique: "Sliven", - space_id: 75, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 894, - y: 1768, - }, - adjacent: [ 74 ], - ascii_name: "Sliven", - }, + { +         name_unique: "Schwerin", +         space_id: 0, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 111, +                 y: 61, +         }, +         adjacent: [ 1, 2 ], +         ascii_name: "Schwerin", + }, + { +         name_unique: "Rostock", +         space_id: 1, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 228, +                 y: 41, +         }, +         adjacent: [ 0, 2 ], +         ascii_name: "Rostock", + }, + { +         name_unique: "Berlin", +         space_id: 2, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 251, +                 y: 113, +         }, +         adjacent: [ 0, 1, 4, 8 ], +         ascii_name: "Berlin", + }, + { +         name_unique: "German Writers", +         space_id: 3, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 58, +                 y: 185, +         }, +         adjacent: [ 4 ], +         ascii_name: "German Writers", + }, + { +         name_unique: "Walter Ulbricht Academy", +         space_id: 4, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 175, +                 y: 187, +         }, +         adjacent: [ 2, 3 ], +         ascii_name: "Walter Ulbricht Academy", + }, + { +         name_unique: "Lutheran Church", +         space_id: 5, +         socio: 7, +         stability: 5, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 300, +                 y: 212, +         }, +         adjacent: [ 8 ], +         ascii_name: "Lutheran Church", + }, + { +         name_unique: "Magdeburg", +         space_id: 6, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 58, +                 y: 275, +         }, +         adjacent: [ 7, 9, 10 ], +         ascii_name: "Magdeburg", + }, + { +         name_unique: "Halle", +         space_id: 7, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 175, +                 y: 278, +         }, +         adjacent: [ 6, 8, 10 ], +         ascii_name: "Halle", + }, + { +         name_unique: "Leipzig", +         space_id: 8, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 297, +                 y: 297, +         }, +         adjacent: [ 2, 5, 7, 10, 11 ], +         ascii_name: "Leipzig", + }, + { +         name_unique: "Erfurt", +         space_id: 9, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 23, +                 y: 356, +         }, +         adjacent: [ 6 ], +         ascii_name: "Erfurt", + }, + { +         name_unique: "Karl-Marx-Stadt", +         space_id: 10, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 138, +                 y: 385, +         }, +         adjacent: [ 6, 7, 8, 11 ], +         ascii_name: "Karl-Marx-Stadt", + }, + { +         name_unique: "Dresden", +         space_id: 11, +         socio: 1, +         stability: 4, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 262, +                 y: 375, +         }, +         adjacent: [ 8, 10, 18, 26 ], +         ascii_name: "Dresden", + }, + { +         name_unique: "Szczecin", +         space_id: 12, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 434, +                 y: 204, +         }, +         adjacent: [ 13, 15 ], +         ascii_name: "Szczecin", + }, + { +         name_unique: "Gdańsk", +         space_id: 13, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 699, +                 y: 215, +         }, +         adjacent: [ 12, 14, 15, 16, 17 ], +         ascii_name: "Gdansk", + }, + { +         name_unique: "Bydgoszcz", +         space_id: 14, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 679, +                 y: 304, +         }, +         adjacent: [ 13, 16 ], +         ascii_name: "Bydgoszcz", + }, + { +         name_unique: "Poznań", +         space_id: 15, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 521, +                 y: 355, +         }, +         adjacent: [ 12, 13, 18, 19 ], +         ascii_name: "Poznan", + }, + { +         name_unique: "Warszawa", +         space_id: 16, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 806, +                 y: 383, +         }, +         adjacent: [ 13, 14, 17, 20, 23 ], +         ascii_name: "Warszawa", + }, + { +         name_unique: "Białystok", +         space_id: 17, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 940, +                 y: 342, +         }, +         adjacent: [ 13, 16, 23 ], +         ascii_name: "Bialystok", + }, + { +         name_unique: "Wrocław", +         space_id: 18, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 462, +                 y: 443, +         }, +         adjacent: [ 11, 15, 19, 21 ], +         ascii_name: "Wroclaw", + }, + { +         name_unique: "Catholic Church, Poland", +         space_id: 19, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 5, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 625, +                 y: 437, +         }, +         adjacent: [ 15, 18, 20, 21, 22 ], +         ascii_name: "Catholic Church, Poland", + }, + { +         name_unique: "Łódź", +         space_id: 20, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 749, +                 y: 486, +         }, +         adjacent: [ 16, 19, 22, 23 ], +         ascii_name: "Lodz", + }, + { +         name_unique: "Katowice", +         space_id: 21, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 570, +                 y: 569, +         }, +         adjacent: [ 18, 19, 22, 32 ], +         ascii_name: "Katowice", + }, + { +         name_unique: "Kraków", +         space_id: 22, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 711, +                 y: 598, +         }, +         adjacent: [ 19, 20, 21, 24 ], +         ascii_name: "Krakow", + }, + { +         name_unique: "Lublin", +         space_id: 23, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 879, +                 y: 603, +         }, +         adjacent: [ 16, 17, 20 ], +         ascii_name: "Lublin", + }, + { +         name_unique: "Jagiellonian University", +         space_id: 24, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 679, +                 y: 681, +         }, +         adjacent: [ 22, 25 ], +         ascii_name: "Jagiellonian University", + }, + { +         name_unique: "Polish Writers", +         space_id: 25, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 832, +                 y: 694, +         }, +         adjacent: [ 24 ], +         ascii_name: "Polish Writers", + }, + { +         name_unique: "Plzeň", +         space_id: 26, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 2, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 159, +                 y: 483, +         }, +         adjacent: [ 11, 27, 28 ], +         ascii_name: "Plzen", + }, + { +         name_unique: "České Budĕjovice", +         space_id: 27, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 196, +                 y: 601, +         }, +         adjacent: [ 26, 28 ], +         ascii_name: "Ceske Budejovice", + }, + { +         name_unique: "Praha", +         space_id: 28, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 317, +                 y: 614, +         }, +         adjacent: [ 26, 27, 29, 31 ], +         ascii_name: "Praha", + }, + { +         name_unique: "Charles University", +         space_id: 29, +         socio: 6, +         stability: 1, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 380, +                 y: 532, +         }, +         adjacent: [ 28, 30 ], +         ascii_name: "Charles University", + }, + { +         name_unique: "Czech Writers", +         space_id: 30, +         socio: 5, +         stability: 2, +         battleground: 1, +         demInfl: 2, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 444, +                 y: 607, +         }, +         adjacent: [ 29 ], +         ascii_name: "Czech Writers", + }, + { +         name_unique: "Brno", +         space_id: 31, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 1, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 403, +                 y: 711, +         }, +         adjacent: [ 28, 32, 33 ], +         ascii_name: "Brno", + }, + { +         name_unique: "Ostrava", +         space_id: 32, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 523, +                 y: 681, +         }, +         adjacent: [ 21, 31, 33, 34 ], +         ascii_name: "Ostrava", + }, + { +         name_unique: "Bratislava", +         space_id: 33, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 417, +                 y: 797, +         }, +         adjacent: [ 31, 32, 34 ], +         ascii_name: "Bratislava", + }, + { +         name_unique: "Catholic Church, Czechoslovakia", +         space_id: 34, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 538, +                 y: 794, +         }, +         adjacent: [ 32, 33, 35 ], +         ascii_name: "Catholic Church, Czechoslovakia", + }, + { +         name_unique: "Prešov", +         space_id: 35, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 658, +                 y: 794, +         }, +         adjacent: [ 34, 36 ], +         ascii_name: "Presov", + }, + { +         name_unique: "Košice", +         space_id: 36, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 777, +                 y: 815, +         }, +         adjacent: [ 35, 41 ], +         ascii_name: "Kosice", + }, + { +         name_unique: "Catholic Church, Hungary", +         space_id: 37, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 314, +                 y: 886, +         }, +         adjacent: [ 38, 42 ], +         ascii_name: "Catholic Church, Hungary", + }, + { +         name_unique: "Győr", +         space_id: 38, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 434, +                 y: 887, +         }, +         adjacent: [ 37, 39, 42, 43 ], +         ascii_name: "Gyor", + }, + { +         name_unique: "Tatabánya", +         space_id: 39, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 549, +                 y: 886, +         }, +         adjacent: [ 38, 40, 44 ], +         ascii_name: "Tatabanya", + }, + { +         name_unique: "Miskolc", +         space_id: 40, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 664, +                 y: 901, +         }, +         adjacent: [ 39, 41, 44 ], +         ascii_name: "Miskolc", + }, + { +         name_unique: "Debrecen", +         space_id: 41, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 781, +                 y: 938, +         }, +         adjacent: [ 36, 40 ], +         ascii_name: "Debrecen", + }, + { +         name_unique: "Szombathely", +         space_id: 42, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 316, +                 y: 963, +         }, +         adjacent: [ 37, 38, 43 ], +         ascii_name: "Szombathely", + }, + { +         name_unique: "Székesfehérvár", +         space_id: 43, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 442, +                 y: 962, +         }, +         adjacent: [ 38, 42, 44 ], +         ascii_name: "Szekesfehervar", + }, + { +         name_unique: "Budapest", +         space_id: 44, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 630, +                 y: 983, +         }, +         adjacent: [ 39, 40, 43, 46, 47 ], +         ascii_name: "Budapest", + }, + { +         name_unique: "Hungarian Writers", +         space_id: 45, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 348, +                 y: 1040, +         }, +         adjacent: [ 46 ], +         ascii_name: "Hungarian Writers", + }, + { +         name_unique: "Eötvös Loránd University", +         space_id: 46, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 512, +                 y: 1034, +         }, +         adjacent: [ 45, 44 ], +         ascii_name: "Eotvos Lorand University", + }, + { +         name_unique: "Szeged", +         space_id: 47, +         socio: 3, +         stability: 4, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 632, +                 y: 1073, +         }, +         adjacent: [ 44, 48, 49 ], +         ascii_name: "Szeged", + }, + { +         name_unique: "Pécs", +         space_id: 48, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 486, +                 y: 1105, +         }, +         adjacent: [ 47 ], +         ascii_name: "Pecs", + }, + { +         name_unique: "Timişoara", +         space_id: 49, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 597, +                 y: 1204, +         }, +         adjacent: [ 47, 50, 59 ], +         ascii_name: "Timisoara", + }, + { +         name_unique: "Cluj-Napoca", +         space_id: 50, +         socio: 1, +         stability: 4, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 756, +                 y: 1125, +         }, +         adjacent: [ 49, 53, 57, 60 ], +         ascii_name: "Cluj-Napoca", + }, + { +         name_unique: "Târgu Mureş", +         space_id: 51, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 915, +                 y: 1136, +         }, +         adjacent: [ 52, 55 ], +         ascii_name: "Targu Mures", + }, + { +         name_unique: "Iaşi", +         space_id: 52, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1072, +                 y: 1097, +         }, +         adjacent: [ 51, 56, 61 ], +         ascii_name: "Iasi", + }, + { +         name_unique: "Babeş-Bolyai University", +         space_id: 53, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 746, +                 y: 1203, +         }, +         adjacent: [ 50, 54 ], +         ascii_name: "Babes-Bolyai University", + }, + { +         name_unique: "Romanian Writers", +         space_id: 54, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 739, +                 y: 1278, +         }, +         adjacent: [ 53 ], +         ascii_name: "Romanian Writers", + }, + { +         name_unique: "Harghita/Covasna", +         space_id: 55, +         socio: 8, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 928, +                 y: 1227, +         }, +         adjacent: [ 51 ], +         ascii_name: "Harghita/Covasna", + }, + { +         name_unique: "Braşov", +         space_id: 56, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1049, +                 y: 1225, +         }, +         adjacent: [ 52, 58, 60 ], +         ascii_name: "Brasov", + }, + { +         name_unique: "Orthodox Church, Romania", +         space_id: 57, +         socio: 7, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 855, +                 y: 1338, +         }, +         adjacent: [ 50, 59 ], +         ascii_name: "Orthodox Church, Romania", + }, + { +         name_unique: "Ploieşti", +         space_id: 58, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1061, +                 y: 1316, +         }, +         adjacent: [ 56, 60, 61 ], +         ascii_name: "Ploiesti", + }, + { +         name_unique: "Craiova", +         space_id: 59, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 763, +                 y: 1411, +         }, +         adjacent: [ 49, 57, 60 ], +         ascii_name: "Craiova", + }, + { +         name_unique: "Bucureşti", +         space_id: 60, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 929, +                 y: 1445, +         }, +         adjacent: [ 50, 56, 58, 59, 62 ], +         ascii_name: "Bucuresti", + }, + { +         name_unique: "Galaţi", +         space_id: 61, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1104, +                 y: 1399, +         }, +         adjacent: [ 52, 58, 62 ], +         ascii_name: "Galati", + }, + { +         name_unique: "Constanţa", +         space_id: 62, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1130, +                 y: 1517, +         }, +         adjacent: [ 60, 61, 71 ], +         ascii_name: "Constanta", + }, + { +         name_unique: "Pleven", +         space_id: 63, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 764, +                 y: 1534, +         }, +         adjacent: [ 67 ], +         ascii_name: "Pleven", + }, + { +         name_unique: "Orthodox Church, Bulgaria", +         space_id: 64, +         socio: 7, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 882, +                 y: 1540, +         }, +         adjacent: [ 65, 67 ], +         ascii_name: "Orthodox Church, Bulgaria", + }, + { +         name_unique: "Ruse", +         space_id: 65, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 998, +                 y: 1540, +         }, +         adjacent: [ 64, 68, 69, 70, 71 ], +         ascii_name: "Ruse", + }, + { +         name_unique: "Sofia University", +         space_id: 66, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 645, +                 y: 1650, +         }, +         adjacent: [ 67, 72 ], +         ascii_name: "Sofia University", + }, + { +         name_unique: "Sofia", +         space_id: 67, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 768, +                 y: 1653, +         }, +         adjacent: [ 63, 64, 66, 68, 73 ], +         ascii_name: "Sofia", + }, + { +         name_unique: "Stara Zagora", +         space_id: 68, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 886, +                 y: 1694, +         }, +         adjacent: [ 65, 67, 70 ], +         ascii_name: "Stara Zagora", + }, + { +         name_unique: "Razgrad", +         space_id: 69, +         socio: 8, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 954, +                 y: 1620, +         }, +         adjacent: [ 65 ], +         ascii_name: "Razgrad", + }, + { +         name_unique: "Burgas", +         space_id: 70, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 1004, +                 y: 1695, +         }, +         adjacent: [ 65, 68, 71 ], +         ascii_name: "Burgas", + }, + { +         name_unique: "Varna", +         space_id: 71, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 1086, +                 y: 1613, +         }, +         adjacent: [ 62, 65, 70 ], +         ascii_name: "Varna", + }, + { +         name_unique: "Bulgarian Writers", +         space_id: 72, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 652, +                 y: 1726, +         }, +         adjacent: [ 66 ], +         ascii_name: "Bulgarian Writers", + }, + { +         name_unique: "Plovdiv", +         space_id: 73, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 771, +                 y: 1739, +         }, +         adjacent: [ 67, 74 ], +         ascii_name: "Plovdiv", + }, + { +         name_unique: "Sliven", +         space_id: 74, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 894, +                 y: 1768, +         }, +         adjacent: [ 73 ], +         ascii_name: "Sliven", + }, ] - const cards = [ null, {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, diff --git a/events.txt b/events.txt index e900510..82d3c59 100644 --- a/events.txt +++ b/events.txt @@ -33,7 +33,7 @@ support_check 2 CARD 4 - Michnik # Place 3 Democratic SPs in the Polish Intellectuals space. permanently_remove -valid_spaces 26 +valid_spaces 'Polish Writers' prompt 'the Polish Intellectuals space' add_x_infl 3 @@ -136,7 +136,7 @@ add_limited_infl 4 1 CARD 19 - Papal vist # Place 3 SPs in any Catholic Church space. permanently_remove -valid_spaces 20 35 38 +valid_spaces 'Catholic Church, Poland', 'Catholic Church, Czechoslovakia', 'Catholic Church, Hungary' prompt 'any Catholic Church space' add_x_infl 3 @@ -165,7 +165,7 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. permanently_remove -valid_spaces 6 +valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 st_nicholas_church @@ -204,7 +204,7 @@ remove_limited_opp_infl 3 2 CARD 29 - Jan Palach Week* # Place 6 Democratic SPs in the Charles University space. permanently_remove -valid_spaces 30 +valid_spaces 'Charles University' prompt 'the Charles University space' add_x_infl 6 @@ -216,7 +216,7 @@ tear_gas CARD 31 - Intelligentsia # Place 4 Democratic SPs in Intellectual spaces, no more than 2 per space. -valid_spaces 4 26 31 46 55 73 +valid_spaces_socio 5 prompt 'Intellectual spaces, no more than 2 per space' add_limited_infl 4 2 @@ -241,7 +241,7 @@ sajudis CARD 34 - Fidesz* # Place 5 Democratic SPs in Hungary Student space. permanently_remove -valid_spaces 47 +valid_spaces 'Eotvos Lorand University' prompt 'the Hungary students space' add_x_infl 5 @@ -281,7 +281,7 @@ add_infl_free 3 CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. permanently_remove -valid_spaces 66 +valid_spaces 'Ruse' prompt 'Ruse' add_x_infl 4 eco_glasnost @@ -502,7 +502,7 @@ permanently_remove klaus_and_komarek prompt 'Prague' remove_x_opp_infl 2 -valid_spaces 29 +valid_spaces 'Praha' add_x_infl 2 @@ -532,7 +532,7 @@ peasant_parties_revolt CARD 73 - Laszlo Tokes* # Place 1 Democratic SP in Timisoara and Harghita/Covasna. The Democratic may then place SPs or make Support Check rolls in Romania using the Ops value of this card. Allows play of Massacre in Timisoara. permanently_remove -valid_spaces 50 56 +valid_spaces 'Timisoara', 'Harghita/Covasna' prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 laszlo_tokes @@ -585,7 +585,7 @@ CARD 79 - The Third Way* # -2 VP. Place 3 Communist SPs in the German writers space. permanently_remove the_third_way -valid_spaces 4 +valid_spaces 'German Writers' prompt 'the East German Writers space' add_x_infl 3 @@ -740,7 +740,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu if game.persistent_events.includes(54) -valid_spaces 51 +valid_spaces 'Cluj-Napoca' prompt 'the Romanian Elite Space' remove_x_opp_infl 4 the_tyrant_is_gone @@ -777,7 +777,7 @@ CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone permanently_remove if !game.the_tyrant_is_gone -valid_spaces 51 +valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 elena @@ -807,10 +807,10 @@ new_years_eve_party CARD 105 - Public Against Violence* # Place 2 Democratic SPs each in Kosice and Presov. Make one Support Check in Bratislava using the Ops value of this card. permanently_remove -valid_spaces 36 +valid_spaces 'Kosice' prompt 'Kosice' add_x_infl 2 -valid_spaces 37 +valid_spaces 'Presov' prompt 'Presov' add_x_infl 2 public_against_violence diff --git a/play.js b/play.js index 7f73430..dc2c592 100644 --- a/play.js +++ b/play.js @@ -18,7 +18,7 @@ function on_click_action(evt) { send_action(evt.target.my_action, evt.target.my_id) } -const last_space = 75 +const last_space = 74 const last_card = 110 const last_power_card = 52 @@ -152,11 +152,11 @@ function create_ui() { // SUPPORTING FUNCTIONS function on_click_space(evt) { - if (evt.button === 0) { - const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); - if (send_action('space', space)) { - //console.log('send_action with infl:', space); + if (evt.button === 0) { + const space = evt.target.my_space + //console.log('on_click_space_called with space:', space); + if (send_action("space", space)) { + console.log('send_action with space:', space); evt.stopPropagation() } else if (send_action("sc", space)) { //console.log('send_action with sc:', space); @@ -655,4 +655,4 @@ var LAYOUT = { "vp_neg_19": [246,2456,55,50], "vp_neg_2": [772,2395,56,51], "vp_neg_20": [215,2395,55,51], -} +} \ No newline at end of file diff --git a/rules.js b/rules.js index a82a641..a691129 100644 --- a/rules.js +++ b/rules.js @@ -269,13 +269,18 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { +//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { + //console.log('argument undefined') view.actions[action] = 1 } else { - if (!(action in view.actions)) + if (!(action in view.actions)) { + //console.log('push argument') view.actions[action] = [] + } view.actions[action].push(argument) } + //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_space(space){ @@ -2621,7 +2626,7 @@ 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++) { + for (let i =0 ; i <= 74 ; i++) { space = spaces[i] if (game.state === 'com_init') { @@ -2646,7 +2651,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 = 0 ; i <= 74; i++) { space = spaces[i] if (game.active === DEM) { @@ -2658,13 +2663,13 @@ function valid_spaces_sc() { infl = game.demInfl[i] if (infl !== 0 ) { // Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + if (game.persistent_events.includes(2) && space.space_id === 13) {continue} // Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + if (game.persistent_events.includes(90) && space.space_id === 29) {continue} // Check We Are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + if (game.persistent_events.includes(48) && space.space_id === 8) {continue} //Check for Foreign Currency Debt Burden if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} { @@ -2689,7 +2694,7 @@ function valid_spaces_sc() { function valid_spaces_support_loss() { let valid_spaces_set = new Set(); - for (let i = 1; i < game.demInfl.length; i++) { + for (let i = 0; i < game.demInfl.length; i++) { //console.log('spaces.length', game.demInfl.length, 'i', i) space = spaces[i] if (game.active === DEM) { @@ -2746,7 +2751,7 @@ function valid_spaces_infl() { let valid_spaces_set = new Set(); // Iterate over all spaces to find the ones with the player's influence - for (let i = 1; i < game.demInfl.length; i++) { + for (let i = 0; i < game.demInfl.length; i++) { //piece = game.pieces[i] space = spaces[i] @@ -3034,7 +3039,7 @@ function check_presence(country) { let com_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === country) { @@ -3549,7 +3554,7 @@ function finish_the_wall() { if (check_vp()) { return } - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === 'East_Germany' && game.comInfl[i] > 0){ game.valid_spaces.push(space.space_id) @@ -3623,7 +3628,7 @@ function end_round() { return [...new Set(duplicates)]; } - //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) if (check_duplicates(card_check)) { console.log('card check', card_check) @@ -4629,13 +4634,21 @@ function vm_opp_hand_false() { } function vm_valid_spaces() { - let space_1 = vm_operand(1) - let space_2 = vm_operand(2) - let space_3 = vm_operand(3) - let space_4 = vm_operand(4) - let space_5 = vm_operand(5) - let space_6 = vm_operand(6) - game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] + let space_1 + let space_2 + let space_3 + let space_4 + let space_5 + let space_6 + + if (vm_operand(1)) { space_1 = spaces.find(space => space.ascii_name === vm_operand(1)).space_id} + if (vm_operand(2)) { space_2 = spaces.find(space => space.ascii_name === vm_operand(2)).space_id} + if (vm_operand(3)) { space_3 = spaces.find(space => space.ascii_name === vm_operand(3)).space_id} + if (vm_operand(4)) { space_4 = spaces.find(space => space.ascii_name === vm_operand(4)).space_id} + if (vm_operand(5)) { space_5 = spaces.find(space => space.ascii_name === vm_operand(5)).space_id} + if (vm_operand(6)) { space_6 = spaces.find(space => space.ascii_name === vm_operand(6)).space_id} + + game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] game.valid_spaces = game.valid_spaces.filter( n => n ) // Check for Systematization - may not use this space @@ -4646,7 +4659,7 @@ function vm_valid_spaces() { function vm_valid_spaces_opponent () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.active === DEM) { @@ -4668,7 +4681,7 @@ function vm_valid_spaces_opponent () { function vm_valid_spaces_socio () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === vm_operand(1)) { @@ -4686,7 +4699,7 @@ function vm_valid_spaces_socio () { function vm_valid_spaces_opponent_socio () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.active === DEM) { @@ -4772,13 +4785,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 === 14) {continue} + if (game.persistent_events.includes(2) && space.space_id === 13) {continue} //Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + if (game.persistent_events.includes(90) && space.space_id === 29) {continue} //Check We are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + if (game.persistent_events.includes(48) && space.space_id === 8) {continue} valid_spaces.push(space.space_id); //Check Foreign Currency Debt Burden @@ -4834,7 +4847,7 @@ function vm_valid_spaces_region_opp() { function vm_valid_spaces_solidarity_legalised() { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] let uncontrolled = (!check_control(i) && !check_opp_control(i)) if ((space.country === 'Poland' && uncontrolled && space.socio === 3) || (space.country === 'Poland' && uncontrolled && space.socio === 4)) { @@ -5319,8 +5332,8 @@ function vm_breakaway_baltic_republics() { } game.playable_cards.push(109) game.playable_cards = game.playable_cards.filter(n => n !== 14) - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70)) {game.valid_spaces.push(70)} + if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)} + if (!check_dem_control(69)) {game.valid_spaces.push(69)} vm_next() } @@ -5346,13 +5359,19 @@ function vm_bulgarian_turks_expelled(){ function vm_ceausescu() { let adj_cluj = false - if (game.demInfl[50] > 0 ) {adj_cluj = true} - if (game.demInfl[54] > 0 ) {adj_cluj = true} - if (game.demInfl[58] > 0 ) {adj_cluj = true} - if (game.demInfl[61] > 0 ) {adj_cluj = true} + 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 (adj_cluj && game.comInfl[61]>0) { - game.valid_spaces = [61] + 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 (adj_cluj && game.comInfl[Bucuresti]>0) { + game.valid_spaces = [60] game.vm_available_ops = 1 //next_player() game.remove_opponent_infl = false @@ -5372,7 +5391,7 @@ function vm_civic_forum() { return } game.persistent_events.push(90) - if (check_dem_control(31)) { + if (check_dem_control(30)) { vm_next() } else { permanently_remove(90) @@ -5451,20 +5470,20 @@ function vm_eliminate(space_id) { //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 === 61) { + if (space_id === 60) { game.demInfl[space_id] = 0 game.comInfl[space_id] = 0 } else { game.demInfl[space_id] = 0 - game.comInfl[61] += game.comInfl[space_id] + game.comInfl[60] += game.comInfl[space_id] if (game.comInfl[space_id] > 0 ) { - log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) + log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %60`) } game.comInfl[space_id] = 0 } //Update control in the eliminated space and in Bucuresti check_control_change(space_id) - check_control_change(61) + check_control_change(60) } @@ -5509,8 +5528,8 @@ function vm_foreign_currency_debt_burden() { } function vm_foreign_television() { - for (let i = 1 ; i < spaces.length; i++) { - if (i === 12) {continue} /*Does not apply to Dresden*/ + for (let i = 0 ; i < spaces.length; i++) { + if (i === 11) {continue} /*Does not apply to Dresden*/ if (game.comInfl[i] > 0 ) { game.valid_spaces.push(i) } @@ -5560,7 +5579,7 @@ function vm_goodbye_lenin() { } function vm_government_resigns() { - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === 1 && game.comInfl[i] > 0 && !check_control(i)) { game.valid_spaces.push(i) @@ -5643,7 +5662,7 @@ function vm_kiss_of_death() { } function vm_klaus_and_komarek() { - if (game.comInfl[29] > 0 ) {game.valid_spaces = [29]} + if (game.comInfl[28] > 0 ) {game.valid_spaces = [28]} vm_next() } @@ -5694,7 +5713,7 @@ function vm_legacy_of_martial_law() { } function vm_legacy_of_1968() { - for (let i = 1; 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); @@ -5730,8 +5749,8 @@ function vm_modrow() { } function vm_nagy_reburied(){ - if (game.comInfl[43] > 0) { - game.valid_spaces.push(43) + if (game.comInfl[42] > 0) { + game.valid_spaces.push(42) } vm_next() } @@ -5756,8 +5775,8 @@ function vm_nomenklatura() { } function vm_normalisation() { - if (game.demInfl[27] >0) {game.valid_spaces.push(27)} - if (game.demInfl[29] > 0) {game.valid_spaces.push(29)} + if (game.demInfl[26] >0) {game.valid_spaces.push(26)} + if (game.demInfl[28] > 0) {game.valid_spaces.push(28)} game.remove_opponent_infl = true vm_next() } @@ -5840,7 +5859,7 @@ function vm_prudence() { function vm_public_against_violence() { game.valid_spaces = [] - if (game.comInfl[34] > 0 ) {game.valid_spaces.push(34)} + if (game.comInfl[33] > 0 ) {game.valid_spaces.push(33)} vm_next() } @@ -5867,11 +5886,11 @@ function vm_roundtable_talks() { } function vm_sajudis_check() { - if (!check_dem_control(56)) { - game.valid_spaces.push(56) + if (!check_dem_control(55)) { + game.valid_spaces.push(55) } - if (!check_dem_control(70)) { - game.valid_spaces.push(70) + if (!check_dem_control(69)) { + game.valid_spaces.push(69) } vm_next() } @@ -5960,8 +5979,8 @@ function vm_tear_gas () { function vm_the_baltic_way() { game.playable_cards.push(84) game.stability++ - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70) && game.systematization !== 70) {game.valid_spaces.push(70)} + if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)} + if (!check_dem_control(69) ) {game.valid_spaces.push(69)} log('+3 VP') game.vp += 3 if (check_vp()) { @@ -5982,8 +6001,8 @@ function vm_the_crowd_turns_against_ceausescu() { } function vm_the_monday_demonstrations() { - if (!check_dem_control(6)) {game.valid_spaces.push(6)} - if (!check_dem_control(9)) {game.valid_spaces.push(9)} + if (!check_dem_control(5)) {game.valid_spaces.push(5)} + if (!check_dem_control(8)) {game.valid_spaces.push(8)} vm_next() } @@ -6000,7 +6019,7 @@ function vm_the_third_way() { function vm_the_tyrant_is_gone() { game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.demInfl[i] === 0 && space.country === 'Romania') { if (space.space_id === game.systematization) {continue} @@ -6046,12 +6065,12 @@ function vm_warsaw_pact_summit() { } function vm_we_are_the_people() { - if (game.demInfl[6] > 0) {game.valid_spaces = [6]} - game.persistent_events.push(48) + if (game.demInfl[5] > 0) {game.valid_spaces = [5]} + game.persistent_events.push(48) if (!game.vm_influence_added) { game.vm_influence_added = {}; } - game.vm_influence_added[6] = 0 + game.vm_influence_added[5] = 0 game.vm_available_ops = 4 game.state = 'vm_we_are_the_people_remove' } @@ -6871,39 +6890,39 @@ states.vm_central_committee_reshuffle = { if (!game.revolutions[5]) {gen_action('romania')} } }, - east_germany() { + east_germany() { /*Updated for zero index spaces*/ push_undo() game.vm_active_country = "East_Germany" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [1,2,3,4,5,6,7,8,9,10,11,12] + game.valid_spaces = [0,1,2,3,4,5,6,7,8,9,10,11] vm_next() }, poland() { push_undo() game.vm_active_country = "Poland" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [13,14,15,16,17,18,19,20,21,22,23,24,25,26] + game.valid_spaces = [12,13,14,15,16,17,18,19,20,21,22,23,24,25] vm_next() }, czechoslovakia() { push_undo() game.vm_active_country = "Czechoslovakia" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [27,28,29,30,31,32,33,34,35,36,37] + game.valid_spaces = [26,27,28,29,30,31,32,33,34,35,36] vm_next() }, hungary() { push_undo() game.vm_active_country = "Hungary" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [38,39,40,41,42,43,44,45,46,47,48,49] + game.valid_spaces = [37,38,39,40,41,42,43,44,45,46,47,48] vm_next() }, romania() { push_undo() game.vm_active_country = "Romania" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [50,51,52,53,54,55,56,57,58,59,60,61,62,63] + game.valid_spaces = [49,50,51,52,53,54,55,56,57,58,59,60,61,62] game.valid_spaces = game.valid_spaces.filter(space => space !== game.systematization) vm_next() }, @@ -6911,7 +6930,7 @@ states.vm_central_committee_reshuffle = { push_undo() game.vm_active_country = "Bulgaria" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] + game.valid_spaces = [63,64,65,66,67,68,69,70,71,72,73,74] vm_next() }, pass() { @@ -7310,10 +7329,6 @@ states.vm_goodbye_lenin_ops = { influence(){ push_undo() game.vm_available_ops = get_card_ops(this_card()) - /*if (game.persistent_events.includes(50)) { - log(`+1 from C50`) - game.vm_available_ops++ - }*/ valid_spaces_infl() // If ABHR - Set AHBR tracker to true @@ -7644,22 +7659,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 = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + 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} game.state = 'vm_kremlin_coup_sc_prep' }, done() { push_undo() - if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + 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} game.state = 'vm_kremlin_coup_sc_prep' } } @@ -7801,12 +7816,12 @@ states.vm_malta_summit = { if (check_vp()) { return } - if (game.comInfl[12] > 0 ) {game.valid_spaces.push(12)} - if (game.comInfl[15] > 0 ) {game.valid_spaces.push(15)} - if (game.comInfl[27] > 0 ) {game.valid_spaces.push(27)} - if (game.comInfl[43] > 0 ) {game.valid_spaces.push(43)} - if (game.comInfl[51] > 0 ) {game.valid_spaces.push(51)} - if (game.comInfl[69] > 0 ) {game.valid_spaces.push(69)} + 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)} //game.vm_available_ops = 5 game.remove_opponent_infl = true vm_next() @@ -7928,7 +7943,7 @@ states.vm_nomenklatura = { remove() { push_undo() game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === 1 && game.demInfl[i] > 0) { @@ -8457,7 +8472,7 @@ states.vm_the_wall_must_go = { if (check_vp()) { return } - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === 'East_Germany' && game.comInfl[i] > 0){ game.valid_spaces.push(space.space_id) @@ -8491,7 +8506,7 @@ states.vm_warsaw_pact_summit = { }, influence(){ push_undo() - for (let i = 1; 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); @@ -8504,7 +8519,7 @@ states.vm_warsaw_pact_summit = { }, support_check(){ push_undo() - for (let i = 1; 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) @@ -8521,7 +8536,7 @@ states.vm_we_are_the_people_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.demInfl[6] === 0 && game.vm_available_ops > 0) { + if (game.demInfl[5] === 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 ) { @@ -8543,11 +8558,11 @@ states.vm_we_are_the_people_remove = { pop_summary() log_br() } - if (!game.vm_influence_added[6]) { + if (!game.vm_influence_added[5]) { log('No SPs removed') vm_next() } else { - game.valid_spaces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + game.valid_spaces = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] game.state = 'vm_we_are_the_people_add' } } @@ -8563,15 +8578,15 @@ states.vm_we_are_the_people_add = { return }*/ - view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` + view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[5],'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[6]-- - if (game.vm_influence_added[6] === 0 ) { + game.vm_influence_added[5]-- + if (game.vm_influence_added[5] === 0 ) { game.valid_spaces = [] if (game.summary.length > 0) { pop_summary() @@ -9011,7 +9026,6 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ // #region GENERATED EVENT CODE - const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -9047,7 +9061,7 @@ CODE[3] = [ // Walesa CODE[4] = [ // Michnik [ vm_permanently_remove ], - [ vm_valid_spaces, 26 ], + [ vm_valid_spaces, 'Polish Writers' ], [ vm_prompt, 'the Polish Intellectuals space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9150,7 +9164,7 @@ CODE[18] = [ // Poszgay Defends the Revolution CODE[19] = [ // Papal vist [ vm_permanently_remove ], - [ vm_valid_spaces, 20, 35, 38 ], + [ vm_valid_spaces, 'Catholic Church, Poland', 'Catholic Church, Czechoslovakia', 'Catholic Church, Hungary' ], [ vm_prompt, 'any Catholic Church space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9179,7 +9193,7 @@ CODE[23] = [ // Power Struggle - Hungary CODE[24] = [ // St Nicolas Church [ vm_permanently_remove ], - [ vm_valid_spaces, 6 ], + [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], [ vm_st_nicholas_church ], @@ -9218,7 +9232,7 @@ CODE[28] = [ // Factory Party Cells CODE[29] = [ // Jan Palach Week* [ vm_permanently_remove ], - [ vm_valid_spaces, 30 ], + [ vm_valid_spaces, 'Charles University' ], [ vm_prompt, 'the Charles University space' ], [ vm_add_x_infl, 6 ], [ vm_return ], @@ -9230,7 +9244,7 @@ CODE[30] = [ // Tear Gas ] CODE[31] = [ // Intelligentsia - [ vm_valid_spaces, 4, 26, 31, 46, 55, 73 ], + [ vm_valid_spaces_socio, 5 ], [ vm_prompt, 'Intellectual spaces, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], [ vm_return ], @@ -9255,7 +9269,7 @@ CODE[33] = [ // Sajudis* CODE[34] = [ // Fidesz* [ vm_permanently_remove ], - [ vm_valid_spaces, 47 ], + [ vm_valid_spaces, 'Eotvos Lorand University' ], [ vm_prompt, 'the Hungary students space' ], [ vm_add_x_infl, 5 ], [ vm_return ], @@ -9295,7 +9309,7 @@ CODE[38] = [ // July Concept CODE[39] = [ // Eco-Glasnost* [ vm_permanently_remove ], - [ vm_valid_spaces, 66 ], + [ vm_valid_spaces, 'Ruse' ], [ vm_prompt, 'Ruse' ], [ vm_add_x_infl, 4 ], [ vm_eco_glasnost ], @@ -9516,7 +9530,7 @@ CODE[68] = [ // Klaus and Komarek* [ vm_klaus_and_komarek ], [ vm_prompt, 'Prague' ], [ vm_remove_x_opp_infl, 2 ], - [ vm_valid_spaces, 29 ], + [ vm_valid_spaces, 'Praha' ], [ vm_add_x_infl, 2 ], [ vm_return ], ] @@ -9546,7 +9560,7 @@ CODE[72] = [ // Peasant Parties Revolt CODE[73] = [ // Laszlo Tokes* [ vm_permanently_remove ], - [ vm_valid_spaces, 50, 56 ], + [ vm_valid_spaces, 'Timisoara', 'Harghita/Covasna' ], [ vm_prompt, 'in Timisoara and Harghita/Covasna' ], [ vm_add_limited_infl, 2, 1 ], [ vm_laszlo_tokes ], @@ -9579,7 +9593,7 @@ CODE[76] = [ // Warsaw Pact Summit [ vm_add_infl_free, 4 ], [ vm_else ], [ vm_prompt, 'Select a Student or Intellectual space' ], - [ vm_valid_spaces_country_socio_2, 3,, 4 ], + [ vm_valid_spaces_country_socio_2, 3, 4 ], [ vm_support_check_modified, 2, 2 ], [ vm_endif ], [ vm_return ], @@ -9599,7 +9613,7 @@ CODE[78] = [ // Workers Revolt CODE[79] = [ // The Third Way* [ vm_permanently_remove ], [ vm_the_third_way ], - [ vm_valid_spaces, 4 ], + [ vm_valid_spaces, 'German Writers' ], [ vm_prompt, 'the East German Writers space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9751,7 +9765,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 51 ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -9788,7 +9802,7 @@ CODE[100] = [ // Stand Fast* CODE[101] = [ // Elena* [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], - [ vm_valid_spaces, 51 ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], [ vm_elena ], @@ -9818,10 +9832,10 @@ CODE[104] = [ // New Year's Eve Party* CODE[105] = [ // Public Against Violence* [ vm_permanently_remove ], - [ vm_valid_spaces, 36 ], + [ vm_valid_spaces, 'Kosice' ], [ vm_prompt, 'Kosice' ], [ vm_add_x_infl, 2 ], - [ vm_valid_spaces, 37 ], + [ vm_valid_spaces, 'Presov' ], [ vm_prompt, 'Presov' ], [ vm_add_x_infl, 2 ], [ vm_public_against_violence ], @@ -9915,3 +9929,4 @@ CODE[351] = [ // Support Falters [ vm_return ], ] // #endregion + -- cgit v1.2.3 From c2df9cc16c98db5286509e2bf6deef028b111fac Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 15:14:48 +0100 Subject: New power cards --- data.js | 106 ++++++++++++++++++++++++++++++------------------------------- events.txt | 16 +++++----- play.css | 4 +-- play.js | 6 ++-- rules.js | 79 +++++++++++++++++++++++++++------------------ 5 files changed, 113 insertions(+), 98 deletions(-) diff --git a/data.js b/data.js index c8194f1..17291e8 100644 --- a/data.js +++ b/data.js @@ -1391,60 +1391,58 @@ const cards = [ const power_cards = [ null, -{number: 1, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 2, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 3, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 4, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 5, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 6, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 7, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 8, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 9, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 10, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 11, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 12, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 13, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 14, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 15, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 16, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 17, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 18, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 19, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 20, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 21, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 22, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 23, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 24, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 25, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 26, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 27, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 28, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 29, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 30, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 31, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 32, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 33, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 34, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 35, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 36, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 37, name: 'Elite Leader', value: 3, socio: 1, url: 'ps16'}, -{number: 38, name: 'Elite Leader', value: 3, socio: 1, url: 'ps17'}, -{number: 39, name: 'Elite Leader', value: 3, socio: 1, url: 'ps18'}, -{number: 40, name: 'Elite Leader', value: 3, socio: 1, url: 'ps19'}, -{number: 41, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps12'}, -{number: 42, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps13'}, -{number: 43, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps14'}, -{number: 44, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps15'}, -{number: 45, name: 'Worker Leader', value: 3, socio: 4, url: 'ps20'}, -{number: 46, name: 'Worker Leader', value: 3, socio: 4, url: 'ps21'}, -{number: 47, name: 'Church Leader', value: 3, socio: 7, url: 'ps23'}, -{number: 48, name: 'Student Leader', value: 3, socio: 6, url: 'ps22'}, -{number: 49, name: 'Scare Tactics', value: '', socio: 0, url: 'ps26'}, -{number: 50, name: 'Support Surges', value: '', socio: 0, url: 'ps25'}, -{number: 51, name: 'Support Falters', value: '', socio: 0, url: 'ps24'}, -{number: 52, name: 'Tactic Fails', value: '', socio: 0, url: 'ps27'}, -{number: 53, name: 'Rally in the Square', value: 3, socio: 0, url: 'ps1'}, -{number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, +{number: 1, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 2, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 3, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 4, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 5, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 6, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 7, name: 'Strike', value: 6, socio: 0}, +{number: 8, name: 'Strike', value: 6, socio: 0}, +{number: 9, name: 'Strike', value: 5, socio: 0}, +{number: 10, name: 'Strike', value: 5, socio: 0}, +{number: 11, name: 'Strike', value: 4, socio: 0}, +{number: 12, name: 'Strike', value: 4, socio: 0}, +{number: 13, name: 'Strike', value: 4, socio: 0}, +{number: 14, name: 'Strike', value: 3, socio: 0}, +{number: 15, name: 'Strike', value: 3, socio: 0}, +{number: 16, name: 'Strike', value: 3, socio: 0}, +{number: 17, name: 'Strike', value: 3, socio: 0}, +{number: 18, name: 'Strike', value: 4, socio: 0}, +{number: 19, name: 'March', value: 6, socio: 0}, +{number: 20, name: 'March', value: 6, socio: 0}, +{number: 21, name: 'March', value: 5, socio: 0}, +{number: 22, name: 'March', value: 5, socio: 0}, +{number: 23, name: 'March', value: 4, socio: 0}, +{number: 24, name: 'March', value: 4, socio: 0}, +{number: 25, name: 'March', value: 4, socio: 0}, +{number: 26, name: 'March', value: 4, socio: 0}, +{number: 27, name: 'March', value: 3, socio: 0}, +{number: 28, name: 'March', value: 3, socio: 0}, +{number: 29, name: 'March', value: 3, socio: 0}, +{number: 30, name: 'March', value: 3, socio: 0}, +{number: 31, name: 'Petition', value: 6, socio: 0}, +{number: 32, name: 'Petition', value: 6, socio: 0}, +{number: 33, name: 'Petition', value: 6, socio: 0}, +{number: 34, name: 'Petition', value: 5, socio: 0}, +{number: 35, name: 'Petition', value: 5, socio: 0}, +{number: 36, name: 'Petition', value: 5, socio: 0}, +{number: 37, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 38, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 39, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 40, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 41, name: 'Elite Leader', value: 3, socio: 1}, +{number: 42, name: 'Elite Leader', value: 3, socio: 1}, +{number: 43, name: 'Elite Leader', value: 3, socio: 1}, +{number: 44, name: 'Elite Leader', value: 3, socio: 1}, +{number: 45, name: 'Worker Leader', value: 3, socio: 4}, +{number: 46, name: 'Worker Leader', value: 3, socio: 4}, +{number: 47, name: 'Student Leader', value: 3, socio: 6}, +{number: 48, name: 'Church Leader', value: 3, socio: 7}, +{number: 49, name: 'Support Falters', value: '', socio: 0}, +{number: 50, name: 'Support Surges', value: '', socio: 0}, +{number: 51, name: 'Scare Tactics', value: '', socio: 0}, +{number: 52, name: 'Tactic Fails', value: '', socio: 0}, ] if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } diff --git a/events.txt b/events.txt index 82d3c59..eaf585d 100644 --- a/events.txt +++ b/events.txt @@ -880,15 +880,15 @@ tst_8 #// ============= POWER STRUGGLE WILDCARDS ========================= -CARD 349 - Scare Tactics -scare_tactics -valid_spaces_country_opp -prompt ()=>` from ${country_name(game.vm_active_country)}` -remove_opp_infl 1 + +CARD 349 - Support Falters +support_falters CARD 350 - Support Surges support_surges -CARD 351 - Support Falters -support_falters - +CARD 351 - Scare Tactics +scare_tactics +valid_spaces_country_opp +prompt ()=>` from ${country_name(game.vm_active_country)}` +remove_opp_infl 1 \ No newline at end of file diff --git a/play.css b/play.css index 1a9b4dd..ec93266 100644 --- a/play.css +++ b/play.css @@ -391,11 +391,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.power_11 { background-image: url(cards100/power_11.webp) } .card.power_12 { background-image: url(cards100/power_12.webp) } .card.power_13 { background-image: url(cards100/power_13.webp) } -.card.power_14 { background-image: url(cards100/power_14.webp) } +.card.power_14 { background-image: url(cards100/power_18.webp) } .card.power_15 { background-image: url(cards100/power_15.webp) } .card.power_16 { background-image: url(cards100/power_16.webp) } .card.power_17 { background-image: url(cards100/power_17.webp) } -.card.power_18 { background-image: url(cards100/power_18.webp) } +.card.power_18 { background-image: url(cards100/power_14.webp) } .card.power_19 { background-image: url(cards100/power_19.webp) } .card.power_20 { background-image: url(cards100/power_20.webp) } .card.power_21 { background-image: url(cards100/power_21.webp) } diff --git a/play.js b/play.js index dc2c592..03f58f5 100644 --- a/play.js +++ b/play.js @@ -20,7 +20,7 @@ function on_click_action(evt) { const last_space = 74 const last_card = 110 -const last_power_card = 52 +const last_power_card = 54 const countries = [ "Poland", "Hungary", "East_Germany", "Bulgaria", "Czechoslovakia", "Romania" ] const board_events = [ 2, 9, 69, 97 ] @@ -273,9 +273,9 @@ function layout_country(id) { for (let i = 0; i < 6; i++) { // TODO: what number to display? if (view.revolutions[id]) - ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] - else if (view.times_held[id] > 0) ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id] + else if (view.times_held[id] > 0) + ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] else ui.countries[id].className = "marker hide" } diff --git a/rules.js b/rules.js index a691129..bebde72 100644 --- a/rules.js +++ b/rules.js @@ -18,9 +18,9 @@ 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] const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] -const elite_spaces = [12, 15, 27, 43, 51, 69] +const elite_spaces = [11, 14, 26, 42, 50, 68] const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] -const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] +const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] 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] @@ -194,9 +194,9 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card - } else { - view.strategy_discard = game.strategy_discard - } + } + view.strategy_discard = game.strategy_discard + if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -1276,7 +1276,7 @@ states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - // console.log('raise stakes 1 - valid cards', game.valid_cards) + console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand) // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1421,13 +1421,21 @@ states.power_struggle = { } if (game.phase === 1) { if (game.valid_cards.length > 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - gen_action('concede') + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must match or concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` + } + gen_action('concede') for (let card of game.valid_cards) { gen_action_power_card(card) } } else if (game.valid_cards.length === 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + } gen_action('concede') } } @@ -1448,6 +1456,7 @@ states.power_struggle = { discard(card) game.valid_cards=[] game.return_state = 'power_struggle' + if (game.phase === 0) {delete game.proxy_power_card} if (card === 52) { log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) @@ -1463,9 +1472,9 @@ states.power_struggle = { if (card >= 37 && card <= 48) { /*When a leader is played */ game.played_power_card = card game.phase = 3 - } else if (card === 49){ /*Scare Tactics */ + } else if (card === 51){ /*Scare Tactics */ game.return = '' - goto_vm(349) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ + goto_vm(351) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ } else if (card === 50) { /*Support Surges */ if (game.active === DEM) { game.return = COM @@ -1473,9 +1482,9 @@ states.power_struggle = { game.return = DEM } goto_vm(350) - } else if (game.phase === 0 && card === 51) { /*Support Falters */ + } else if (game.phase === 0 && card === 49) { /*Support Falters */ next_player() - goto_vm(351) + goto_vm(349) } else { game.played_power_card = card game.phase = 1 @@ -1527,28 +1536,28 @@ states.power_struggle = { }, strike () { log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) - game.played_power_card = 9 + game.proxy_power_card = 'Strike' game.phase = 1 next_player() do_valid_cards() }, march () { log(`Played: P${power_cards[game.played_power_card].number} as a March`) - game.played_power_card = 21 + game.proxy_power_card = 'March' game.phase = 1 next_player() do_valid_cards() }, rally () { log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) - game.played_power_card = 53 + game.proxy_power_card = 'Rally in the Square' game.phase = 1 next_player() do_valid_cards() }, petition () { log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) - game.played_power_card = 54 + game.proxy_power_card = 'Petition' game.phase = 1 next_player() do_valid_cards() @@ -1629,8 +1638,8 @@ states.support_loss ={ let rally_win = 0 let petition_win = 0 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} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win // Roll modifiers @@ -1647,7 +1656,7 @@ states.support_loss ={ log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -1715,8 +1724,8 @@ states.vp_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} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {petition_win = 2} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win if (game.active === DEM && game.persistent_events.includes(62)) { log('+1 from C62') @@ -1729,7 +1738,7 @@ states.vp_roll = { log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -2810,9 +2819,13 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards.find(card => card && card.number === c); + console.log('card', card, ) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { + } else if (card.name === game.proxy_power_card) { + valid_cards_set.add(card.number) + } + else if (leaders.includes(card.socio) && presence[card.socio]) { valid_cards_set.add(card.number); } else if (card.number === 52) {valid_cards_set.add(card.number)} } @@ -9911,11 +9924,8 @@ CODE[208] = [ // Tiananmen Square space 8 event [ vm_return ], ] -CODE[349] = [ // Scare Tactics - [ vm_scare_tactics ], - [ vm_valid_spaces_country_opp ], - [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], - [ vm_remove_opp_infl, 1 ], +CODE[349] = [ // Support Falters + [ vm_support_falters ], [ vm_return ], ] @@ -9924,9 +9934,16 @@ CODE[350] = [ // Support Surges [ vm_return ], ] -CODE[351] = [ // Support Falters - [ vm_support_falters ], +CODE[351] = [ // Scare Tactics + [ vm_scare_tactics ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 1 ], [ vm_return ], ] + + + + // #endregion -- cgit v1.2.3 From 76375e277603bc144ea1c572ec273bd3f3a79dcb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Oct 2024 22:10:36 +0200 Subject: Generate space and card name constants for code. --- Makefile | 28 ++-- play.js | 418 +++++++++++++++++++++++++++++++++++++++--------------- rules.js | 206 +++++++++++++++++++++++++-- tools/gencode.js | 1 - tools/genconst.js | 25 ++++ 5 files changed, 549 insertions(+), 129 deletions(-) create mode 100644 tools/genconst.js diff --git a/Makefile b/Makefile index daa5c21..fc78fed 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,21 @@ default: rules.js play.js -rules.js: events.txt - sed '/const CODE /,$$d' < rules.js > /tmp/rules.js - node tools/gencode.js >> /tmp/rules.js - cp /tmp/rules.js rules.js -play.js: tools/layout.svg - sed '/var LAYOUT /,$$d' < play.js > /tmp/play.js - node tools/genlayout.js >> /tmp/play.js - cp /tmp/play.js play.js + +rules.js: events.txt data.js + node tools/gencode.js > /tmp/events.inc + node tools/genconst.js > /tmp/const.inc + sed -i \ + -e '/BEGIN CONST/,/END CONST/{//!d}' \ + -e '/BEGIN CONST/r /tmp/const.inc' \ + -e '/BEGIN EVENTS/,/END EVENTS/{//!d}' \ + -e '/BEGIN EVENTS/r /tmp/events.inc' \ + rules.js + +play.js: tools/layout.svg data.js + node tools/genlayout.js > /tmp/layout.inc + node tools/genconst.js > /tmp/const.inc + sed -i \ + -e '/BEGIN CONST/,/END CONST/{//!d}' \ + -e '/BEGIN CONST/r /tmp/const.inc' \ + -e '/BEGIN LAYOUT/,/END LAYOUT/{//!d}' \ + -e '/BEGIN LAYOUT/r /tmp/layout.inc' \ + play.js diff --git a/play.js b/play.js index 03f58f5..f94a7db 100644 --- a/play.js +++ b/play.js @@ -1,5 +1,311 @@ "use strict" +// vim:set foldmethod=marker: + +// BEGIN CONST {{{ + +// SPACES +const S_SCHWERIN = 0 +const S_ROSTOCK = 1 +const S_BERLIN = 2 +const S_GERMAN_WRITERS = 3 +const S_WALTER_ULBRICHT_ACADEMY = 4 +const S_LUTHERAN_CHURCH = 5 +const S_MAGDEBURG = 6 +const S_HALLE = 7 +const S_LEIPZIG = 8 +const S_ERFURT = 9 +const S_KARL_MARX_STADT = 10 +const S_DRESDEN = 11 +const S_SZCZECIN = 12 +const S_GDANSK = 13 +const S_BYDGOSZCZ = 14 +const S_POZNAN = 15 +const S_WARSZAWA = 16 +const S_BIALYSTOK = 17 +const S_WROCLAW = 18 +const S_CATHOLIC_CHURCH_POLAND = 19 +const S_LODZ = 20 +const S_KATOWICE = 21 +const S_KRAKOW = 22 +const S_LUBLIN = 23 +const S_JAGIELLONIAN_UNIVERSITY = 24 +const S_POLISH_WRITERS = 25 +const S_PLZEN = 26 +const S_CESKE_BUDEJOVICE = 27 +const S_PRAHA = 28 +const S_CHARLES_UNIVERSITY = 29 +const S_CZECH_WRITERS = 30 +const S_BRNO = 31 +const S_OSTRAVA = 32 +const S_BRATISLAVA = 33 +const S_CATHOLIC_CHURCH_CZECHOSLOVAKIA = 34 +const S_PRESOV = 35 +const S_KOSICE = 36 +const S_CATHOLIC_CHURCH_HUNGARY = 37 +const S_GYOR = 38 +const S_TATABANYA = 39 +const S_MISKOLC = 40 +const S_DEBRECEN = 41 +const S_SZOMBATHELY = 42 +const S_SZEKESFEHERVAR = 43 +const S_BUDAPEST = 44 +const S_HUNGARIAN_WRITERS = 45 +const S_EOTVOS_LORAND_UNIVERSITY = 46 +const S_SZEGED = 47 +const S_PECS = 48 +const S_TIMISOARA = 49 +const S_CLUJ_NAPOCA = 50 +const S_TARGU_MURES = 51 +const S_IASI = 52 +const S_BABES_BOLYAI_UNIVERSITY = 53 +const S_ROMANIAN_WRITERS = 54 +const S_HARGHITA_COVASNA = 55 +const S_BRASOV = 56 +const S_ORTHODOX_CHURCH_ROMANIA = 57 +const S_PLOIESTI = 58 +const S_CRAIOVA = 59 +const S_BUCURESTI = 60 +const S_GALATI = 61 +const S_CONSTANTA = 62 +const S_PLEVEN = 63 +const S_ORTHODOX_CHURCH_BULGARIA = 64 +const S_RUSE = 65 +const S_SOFIA_UNIVERSITY = 66 +const S_SOFIA = 67 +const S_STARA_ZAGORA = 68 +const S_RAZGRAD = 69 +const S_BURGAS = 70 +const S_VARNA = 71 +const S_BULGARIAN_WRITERS = 72 +const S_PLOVDIV = 73 +const S_SLIVEN = 74 + +// CARDS +const C_LEGACY_OF_MARTIAL_LAW = 1 +const C_SOLIDARITY_LEGALIZED = 2 +const C_WALESA = 3 +const C_MICHNIK = 4 +const C_GENERAL_STRIKE = 5 +const C_BROUGHT_IN_FOR_QUESTIONING = 6 +const C_STATE_RUN_MEDIA = 7 +const C_PRUDENCE = 8 +const C_THE_WALL = 9 +const C_CULT_OF_PERSONALITY = 10 +const C_DISSIDENT_ARRESTED = 11 +const C_APPARATCHIKS = 12 +const C_STASI = 13 +const C_GORBACHEV_CHARMS_THE_WEST = 14 +const C_HONECKER = 15 +const C_NOMENKLATURA = 16 +const C_ROUNDTABLE_TALKS = 17 +const C_POSZGAY_DEFENDS_THE_REVOLUTION = 18 +const C_PAPAL_VISIT = 19 +const C_DEUTSCHE_MARKS = 20 +const C_COMMON_EUROPEAN_HOME = 21 +const C_POWER_STRUGGLE_POLAND = 22 +const C_POWER_STRUGGLE_HUNGARY = 23 +const C_ST_NICHOLAS_CHURCH = 24 +const C_PERESTROIKA = 25 +const C_HELSINKI_FINAL_ACT = 26 +const C_CONSUMERISM = 27 +const C_FACTORY_PARTY_CELLS = 28 +const C_JAN_PALACH_WEEK = 29 +const C_TEAR_GAS = 30 +const C_INTELLIGENTSIA = 31 +const C_PEASANT_PARTIES = 32 +const C_SAJUDIS = 33 +const C_FIDESZ = 34 +const C_HEAL_OUR_BLEEDING_WOUND = 35 +const C_DASH_FOR_THE_WEST = 36 +const C_NAGY_REBURIED = 37 +const C_THE_JULY_CONCEPT = 38 +const C_ECO_GLASNOST = 39 +const C_HUNGARIAN_DEMOCRATIC_FORUM = 40 +const C_CEAUSESCU = 41 +const C_POWER_STRUGGLE_EAST_GERMANY = 42 +const C_POWER_STRUGGLE_BULGARIA = 43 +const C_INFLATIONARY_CURRENCY = 44 +const C_SOVIET_TROOP_WITHDRAWALS = 45 +const C_GOODBYE_LENIN = 46 +const C_BULGARIAN_TURKS_EXPELLED = 47 +const C_WE_ARE_THE_PEOPLE = 48 +const C_FOREIGN_CURRENCY_DEBT_BURDEN = 49 +const C_THE_SINATRA_DOCTRINE = 50 +const C_40TH_ANNIVERSARY_CELEBRATION = 51 +const C_NORMALIZATION = 52 +const C_LI_PENG = 53 +const C_THE_CROWD_TURNS_AGAINST_CEAUSESCU = 54 +const C_POWER_STRUGGLE_CZECHOSLOVAKIA = 55 +const C_FOREIGN_TELEVISION = 56 +const C_CENTRAL_COMMITTEE_RESHUFFLE = 57 +const C_AUSTRIA_HUNGARY_BORDER_REOPENED = 58 +const C_GRENZTRUPPEN = 59 +const C_TOXIC_WASTE = 60 +const C_THE_MONDAY_DEMONSTRATIONS = 61 +const C_YAKOVLEV_COUNSELS_GORBACHEV = 62 +const C_GENSCHER = 63 +const C_LEGACY_OF_1968 = 64 +const C_PRESIDENTIAL_VISIT = 65 +const C_NEW_FORUM = 66 +const C_REFORMER_REHABILITATED = 67 +const C_KLAUS_AND_KOMAREK = 68 +const C_SYSTEMATIZATION = 69 +const C_SECURITATE = 70 +const C_KISS_OF_DEATH = 71 +const C_PEASANT_PARTIES_REVOLT = 72 +const C_LASZLO_TOKES = 73 +const C_FRG_EMBASSIES = 74 +const C_EXIT_VISAS = 75 +const C_WARSAW_PACT_SUMMIT = 76 +const C_SAMIZDAT = 77 +const C_WORKERS_REVOLT = 78 +const C_THE_THIRD_WAY = 79 +const C_NEPOTISM = 80 +const C_THE_BALTIC_WAY = 81 +const C_SPITZEL = 82 +const C_MODROW = 83 +const C_BREAKAWAY_BALTIC_REPUBLICS = 84 +const C_TANK_COLUMN_TANK_MAN = 85 +const C_THE_WALL_MUST_GO = 86 +const C_KOHL_PROPOSES_REUNIFICATION = 87 +const C_ADAMEC = 88 +const C_DOMINO_THEORY = 89 +const C_CIVIC_FORUM = 90 +const C_MY_FIRST_BANANA = 91 +const C_BETRAYAL = 92 +const C_SHOCK_THERAPY = 93 +const C_UNION_OF_DEMOCRATIC_FORCES = 94 +const C_POWER_STRUGGLE_ROMANIA = 95 +const C_THE_CHINESE_SOLUTION = 96 +const C_THE_TYRANT_IS_GONE = 97 +const C_POLITBURO_INTRIGUE = 98 +const C_LIGACHEV = 99 +const C_STAND_FAST = 100 +const C_ELENA = 101 +const C_NATIONAL_SALVATION_FRONT = 102 +const C_GOVERNMENT_RESIGNS = 103 +const C_NEW_YEARS_EVE_PARTY = 104 +const C_PUBLIC_AGAINST_VIOLENCE = 105 +const C_SOCIAL_DEMOCRATIC_PLATFORM_ADOPTED = 106 +const C_MASSACRE_IN_TIMISOARA = 107 +const C_ARMY_BACKS_REVOLUTION = 108 +const C_KREMLIN_COUP = 109 +const C_MALTA_SUMMIT = 110 + +// END CONST }}} +// BEGIN LAYOUT {{{ +var LAYOUT = { + "Babes-Bolyai University": [958,1529,127,75], + "Berlin": [329,148,127,75], + "Bialystok": [1202,436,127,76], + "Brasov": [1339,1556,127,75], + "Bratislava": [539,1013,127,76], + "Brno": [521,904,127,76], + "Bucuresti": [1186,1837,127,76], + "Budapest": [809,1249,127,76], + "Bulgarian Writers": [838,2192,127,76], + "Burgas": [1289,2152,127,76], + "Bydgoszcz": [872,388,127,76], + "Catholic Church, Czechoslovakia": [692,1010,127,75], + "Catholic Church, Hungary": [409,1126,127,76], + "Catholic Church, Poland": [802,558,127,75], + "Ceske Budejovice": [260,765,127,77], + "Charles University": [491,677,128,76], + "Cluj-Napoca": [970,1429,127,76], + "Constanta": [1443,1925,127,76], + "Craiova": [977,1793,127,76], + "Czech Writers": [573,773,127,76], + "Debrecen": [1000,1192,127,76], + "Dresden": [343,479,127,76], + "Eotvos Lorand University": [658,1314,127,76], + "Erfurt": [38,455,127,76], + "Galati": [1409,1778,127,76], + "Gdansk": [896,277,127,76], + "German Writers": [81,239,127,76], + "Gyor": [560,1129,127,76], + "Halle": [231,357,127,75], + "Harghita/Covasna": [1186,1560,127,75], + "Hungarian Writers": [452,1322,127,76], + "Iasi": [1369,1395,127,76], + "Jagiellonian University": [870,867,127,76], + "Karl-Marx-Stadt": [184,492,127,75], + "Katowice": [733,723,127,76], + "Kosice": [995,1037,127,76], + "Krakow": [911,761,127,76], + "Leipzig": [387,379,127,76], + "Lodz": [959,620,127,76], + "Lublin": [1124,754,127,76], + "Lutheran Church": [391,271,127,76], + "Magdeburg": [79,352,127,75], + "Miskolc": [851,1146,127,76], + "Orthodox Church, Bulgaria": [1130,1956,127,76], + "Orthodox Church, Romania": [1094,1700,127,76], + "Ostrava": [673,868,127,75], + "Pecs": [626,1406,127,75], + "Pleven": [979,1948,127,76], + "Ploiesti": [1356,1671,127,76], + "Plovdiv": [987,2209,127,75], + "Plzen": [211,615,127,76], + "Polish Writers": [1051,883,127,75], + "Poznan": [671,452,127,76], + "Praha": [412,782,127,75], + "Presov": [844,1010,127,75], + "Razgrad": [1219,2057,127,76], + "Romanian Writers": [947,1625,127,75], + "Rostock": [299,53,127,76], + "Ruse": [1277,1956,127,76], + "Schwerin": [148,86,127,76], + "Sliven": [1144,2251,127,75], + "Sofia": [983,2098,127,76], + "Sofia University": [828,2095,127,76], + "Stara Zagora": [1133,2153,127,75], + "Szczecin": [574,263,127,75], + "Szeged": [812,1364,127,76], + "Szekesfehervar": [571,1223,127,75], + "Szombathely": [410,1224,127,76], + "Targu Mures": [1169,1443,127,76], + "Tatabanya": [706,1126,127,75], + "Timisoara": [767,1531,127,76], + "Varna": [1387,2051,127,76], + "Walter Ulbricht Academy": [234,240,127,76], + "Warszawa": [1032,490,127,75], + "Wroclaw": [595,565,127,75], + "action_1": [708,143,48,44], + "action_8": [1080,143,47,43], + "country_bulgaria": [915,1999,46,41], + "country_czechoslovakia": [463,624,44,39], + "country_east_germany": [560,160,43,37], + "country_hungary": [1034,1319,44,39], + "country_poland": [1188,292,44,39], + "country_romania": [1287,1349,44,39], + "event_solidarity_legalized": [779,270,44,43], + "event_the_wall": [222,179,40,41], + "tst_com_1": [53,2257,47,47], + "tst_com_7": [469,2257,47,47], + "tst_com_8": [556,2257,47,47], + "tst_dem_1": [53,2128,47,47], + "tst_dem_7": [469,2128,47,47], + "tst_dem_8": [556,2128,47,47], + "turn_1": [655,81,47,48], + "turn_10": [1133,80,48,48], + "ussr_1": [1381,1080,48,48], + "ussr_2": [1381,1134,48,48], + "ussr_3": [1381,1188,48,48], + "ussr_4": [1381,1243,48,48], + "ussr_5": [1381,1297,48,48], + "vp_0": [843,2425,55,51], + "vp_1": [883,2395,55,50], + "vp_19": [1440,2395,55,50], + "vp_2": [913,2455,56,51], + "vp_20": [1471,2455,55,51], + "vp_neg_1": [803,2455,56,51], + "vp_neg_19": [246,2456,55,50], + "vp_neg_2": [772,2395,56,51], + "vp_neg_20": [215,2395,55,51], +} +// END LAYOUT }}} + let action_register = [] function register_action(target, action, id) { @@ -544,115 +850,3 @@ function toggle_removed() { function find_country_index(country) { return countries.indexOf(country) } - -// #region GENERATED LAYOUT DATA - -var LAYOUT = { - "Babes-Bolyai University": [958,1529,127,75], - "Berlin": [329,148,127,75], - "Bialystok": [1202,436,127,76], - "Brasov": [1339,1556,127,75], - "Bratislava": [539,1013,127,76], - "Brno": [521,904,127,76], - "Bucuresti": [1186,1837,127,76], - "Budapest": [809,1249,127,76], - "Bulgarian Writers": [838,2192,127,76], - "Burgas": [1289,2152,127,76], - "Bydgoszcz": [872,388,127,76], - "Catholic Church, Czechoslovakia": [692,1010,127,75], - "Catholic Church, Hungary": [409,1126,127,76], - "Catholic Church, Poland": [802,558,127,75], - "Ceske Budejovice": [260,765,127,77], - "Charles University": [491,677,128,76], - "Cluj-Napoca": [970,1429,127,76], - "Constanta": [1443,1925,127,76], - "Craiova": [977,1793,127,76], - "Czech Writers": [573,773,127,76], - "Debrecen": [1000,1192,127,76], - "Dresden": [343,479,127,76], - "Eotvos Lorand University": [658,1314,127,76], - "Erfurt": [38,455,127,76], - "Galati": [1409,1778,127,76], - "Gdansk": [896,277,127,76], - "German Writers": [81,239,127,76], - "Gyor": [560,1129,127,76], - "Halle": [231,357,127,75], - "Harghita/Covasna": [1186,1560,127,75], - "Hungarian Writers": [452,1322,127,76], - "Iasi": [1369,1395,127,76], - "Jagiellonian University": [870,867,127,76], - "Karl-Marx-Stadt": [184,492,127,75], - "Katowice": [733,723,127,76], - "Kosice": [995,1037,127,76], - "Krakow": [911,761,127,76], - "Leipzig": [387,379,127,76], - "Lodz": [959,620,127,76], - "Lublin": [1124,754,127,76], - "Lutheran Church": [391,271,127,76], - "Magdeburg": [79,352,127,75], - "Miskolc": [851,1146,127,76], - "Orthodox Church, Bulgaria": [1130,1956,127,76], - "Orthodox Church, Romania": [1094,1700,127,76], - "Ostrava": [673,868,127,75], - "Pecs": [626,1406,127,75], - "Pleven": [979,1948,127,76], - "Ploiesti": [1356,1671,127,76], - "Plovdiv": [987,2209,127,75], - "Plzen": [211,615,127,76], - "Polish Writers": [1051,883,127,75], - "Poznan": [671,452,127,76], - "Praha": [412,782,127,75], - "Presov": [844,1010,127,75], - "Razgrad": [1219,2057,127,76], - "Romanian Writers": [947,1625,127,75], - "Rostock": [299,53,127,76], - "Ruse": [1277,1956,127,76], - "Schwerin": [148,86,127,76], - "Sliven": [1144,2251,127,75], - "Sofia": [983,2098,127,76], - "Sofia University": [828,2095,127,76], - "Stara Zagora": [1133,2153,127,75], - "Szczecin": [574,263,127,75], - "Szeged": [812,1364,127,76], - "Szekesfehervar": [571,1223,127,75], - "Szombathely": [410,1224,127,76], - "Targu Mures": [1169,1443,127,76], - "Tatabanya": [706,1126,127,75], - "Timisoara": [767,1531,127,76], - "Varna": [1387,2051,127,76], - "Walter Ulbricht Academy": [234,240,127,76], - "Warszawa": [1032,490,127,75], - "Wroclaw": [595,565,127,75], - "action_1": [708,143,48,44], - "action_8": [1080,143,47,43], - "country_bulgaria": [915,1999,46,41], - "country_czechoslovakia": [463,624,44,39], - "country_east_germany": [560,160,43,37], - "country_hungary": [1034,1319,44,39], - "country_poland": [1188,292,44,39], - "country_romania": [1287,1349,44,39], - "event_solidarity_legalized": [779,270,44,43], - "event_the_wall": [222,179,40,41], - "tst_com_1": [53,2257,47,47], - "tst_com_7": [469,2257,47,47], - "tst_com_8": [556,2257,47,47], - "tst_dem_1": [53,2128,47,47], - "tst_dem_7": [469,2128,47,47], - "tst_dem_8": [556,2128,47,47], - "turn_1": [655,81,47,48], - "turn_10": [1133,80,48,48], - "ussr_1": [1381,1080,48,48], - "ussr_2": [1381,1134,48,48], - "ussr_3": [1381,1188,48,48], - "ussr_4": [1381,1243,48,48], - "ussr_5": [1381,1297,48,48], - "vp_0": [843,2425,55,51], - "vp_1": [883,2395,55,50], - "vp_19": [1440,2395,55,50], - "vp_2": [913,2455,56,51], - "vp_20": [1471,2455,55,51], - "vp_neg_1": [803,2455,56,51], - "vp_neg_19": [246,2456,55,50], - "vp_neg_2": [772,2395,56,51], - "vp_neg_20": [215,2395,55,51], -} \ No newline at end of file diff --git a/rules.js b/rules.js index bebde72..a65383e 100644 --- a/rules.js +++ b/rules.js @@ -1,4 +1,6 @@ -//"use strict" +"use strict" + +// vim:set foldmethod=marker: const { spaces, cards, power_cards } = require("./data.js") @@ -10,6 +12,199 @@ const COM = "Communist" const first_strategy_card = 1 const last_strategy_card = 110 +// BEGIN CONSTANTS {{{ + +// SPACES +const S_SCHWERIN = 0 +const S_ROSTOCK = 1 +const S_BERLIN = 2 +const S_GERMAN_WRITERS = 3 +const S_WALTER_ULBRICHT_ACADEMY = 4 +const S_LUTHERAN_CHURCH = 5 +const S_MAGDEBURG = 6 +const S_HALLE = 7 +const S_LEIPZIG = 8 +const S_ERFURT = 9 +const S_KARL_MARX_STADT = 10 +const S_DRESDEN = 11 +const S_SZCZECIN = 12 +const S_GDANSK = 13 +const S_BYDGOSZCZ = 14 +const S_POZNAN = 15 +const S_WARSZAWA = 16 +const S_BIALYSTOK = 17 +const S_WROCLAW = 18 +const S_CATHOLIC_CHURCH_POLAND = 19 +const S_LODZ = 20 +const S_KATOWICE = 21 +const S_KRAKOW = 22 +const S_LUBLIN = 23 +const S_JAGIELLONIAN_UNIVERSITY = 24 +const S_POLISH_WRITERS = 25 +const S_PLZEN = 26 +const S_CESKE_BUDEJOVICE = 27 +const S_PRAHA = 28 +const S_CHARLES_UNIVERSITY = 29 +const S_CZECH_WRITERS = 30 +const S_BRNO = 31 +const S_OSTRAVA = 32 +const S_BRATISLAVA = 33 +const S_CATHOLIC_CHURCH_CZECHOSLOVAKIA = 34 +const S_PRESOV = 35 +const S_KOSICE = 36 +const S_CATHOLIC_CHURCH_HUNGARY = 37 +const S_GYOR = 38 +const S_TATABANYA = 39 +const S_MISKOLC = 40 +const S_DEBRECEN = 41 +const S_SZOMBATHELY = 42 +const S_SZEKESFEHERVAR = 43 +const S_BUDAPEST = 44 +const S_HUNGARIAN_WRITERS = 45 +const S_EOTVOS_LORAND_UNIVERSITY = 46 +const S_SZEGED = 47 +const S_PECS = 48 +const S_TIMISOARA = 49 +const S_CLUJ_NAPOCA = 50 +const S_TARGU_MURES = 51 +const S_IASI = 52 +const S_BABES_BOLYAI_UNIVERSITY = 53 +const S_ROMANIAN_WRITERS = 54 +const S_HARGHITA_COVASNA = 55 +const S_BRASOV = 56 +const S_ORTHODOX_CHURCH_ROMANIA = 57 +const S_PLOIESTI = 58 +const S_CRAIOVA = 59 +const S_BUCURESTI = 60 +const S_GALATI = 61 +const S_CONSTANTA = 62 +const S_PLEVEN = 63 +const S_ORTHODOX_CHURCH_BULGARIA = 64 +const S_RUSE = 65 +const S_SOFIA_UNIVERSITY = 66 +const S_SOFIA = 67 +const S_STARA_ZAGORA = 68 +const S_RAZGRAD = 69 +const S_BURGAS = 70 +const S_VARNA = 71 +const S_BULGARIAN_WRITERS = 72 +const S_PLOVDIV = 73 +const S_SLIVEN = 74 + +// CARDS +const C_LEGACY_OF_MARTIAL_LAW = 1 +const C_SOLIDARITY_LEGALIZED = 2 +const C_WALESA = 3 +const C_MICHNIK = 4 +const C_GENERAL_STRIKE = 5 +const C_BROUGHT_IN_FOR_QUESTIONING = 6 +const C_STATE_RUN_MEDIA = 7 +const C_PRUDENCE = 8 +const C_THE_WALL = 9 +const C_CULT_OF_PERSONALITY = 10 +const C_DISSIDENT_ARRESTED = 11 +const C_APPARATCHIKS = 12 +const C_STASI = 13 +const C_GORBACHEV_CHARMS_THE_WEST = 14 +const C_HONECKER = 15 +const C_NOMENKLATURA = 16 +const C_ROUNDTABLE_TALKS = 17 +const C_POSZGAY_DEFENDS_THE_REVOLUTION = 18 +const C_PAPAL_VISIT = 19 +const C_DEUTSCHE_MARKS = 20 +const C_COMMON_EUROPEAN_HOME = 21 +const C_POWER_STRUGGLE_POLAND = 22 +const C_POWER_STRUGGLE_HUNGARY = 23 +const C_ST_NICHOLAS_CHURCH = 24 +const C_PERESTROIKA = 25 +const C_HELSINKI_FINAL_ACT = 26 +const C_CONSUMERISM = 27 +const C_FACTORY_PARTY_CELLS = 28 +const C_JAN_PALACH_WEEK = 29 +const C_TEAR_GAS = 30 +const C_INTELLIGENTSIA = 31 +const C_PEASANT_PARTIES = 32 +const C_SAJUDIS = 33 +const C_FIDESZ = 34 +const C_HEAL_OUR_BLEEDING_WOUND = 35 +const C_DASH_FOR_THE_WEST = 36 +const C_NAGY_REBURIED = 37 +const C_THE_JULY_CONCEPT = 38 +const C_ECO_GLASNOST = 39 +const C_HUNGARIAN_DEMOCRATIC_FORUM = 40 +const C_CEAUSESCU = 41 +const C_POWER_STRUGGLE_EAST_GERMANY = 42 +const C_POWER_STRUGGLE_BULGARIA = 43 +const C_INFLATIONARY_CURRENCY = 44 +const C_SOVIET_TROOP_WITHDRAWALS = 45 +const C_GOODBYE_LENIN = 46 +const C_BULGARIAN_TURKS_EXPELLED = 47 +const C_WE_ARE_THE_PEOPLE = 48 +const C_FOREIGN_CURRENCY_DEBT_BURDEN = 49 +const C_THE_SINATRA_DOCTRINE = 50 +const C_40TH_ANNIVERSARY_CELEBRATION = 51 +const C_NORMALIZATION = 52 +const C_LI_PENG = 53 +const C_THE_CROWD_TURNS_AGAINST_CEAUSESCU = 54 +const C_POWER_STRUGGLE_CZECHOSLOVAKIA = 55 +const C_FOREIGN_TELEVISION = 56 +const C_CENTRAL_COMMITTEE_RESHUFFLE = 57 +const C_AUSTRIA_HUNGARY_BORDER_REOPENED = 58 +const C_GRENZTRUPPEN = 59 +const C_TOXIC_WASTE = 60 +const C_THE_MONDAY_DEMONSTRATIONS = 61 +const C_YAKOVLEV_COUNSELS_GORBACHEV = 62 +const C_GENSCHER = 63 +const C_LEGACY_OF_1968 = 64 +const C_PRESIDENTIAL_VISIT = 65 +const C_NEW_FORUM = 66 +const C_REFORMER_REHABILITATED = 67 +const C_KLAUS_AND_KOMAREK = 68 +const C_SYSTEMATIZATION = 69 +const C_SECURITATE = 70 +const C_KISS_OF_DEATH = 71 +const C_PEASANT_PARTIES_REVOLT = 72 +const C_LASZLO_TOKES = 73 +const C_FRG_EMBASSIES = 74 +const C_EXIT_VISAS = 75 +const C_WARSAW_PACT_SUMMIT = 76 +const C_SAMIZDAT = 77 +const C_WORKERS_REVOLT = 78 +const C_THE_THIRD_WAY = 79 +const C_NEPOTISM = 80 +const C_THE_BALTIC_WAY = 81 +const C_SPITZEL = 82 +const C_MODROW = 83 +const C_BREAKAWAY_BALTIC_REPUBLICS = 84 +const C_TANK_COLUMN_TANK_MAN = 85 +const C_THE_WALL_MUST_GO = 86 +const C_KOHL_PROPOSES_REUNIFICATION = 87 +const C_ADAMEC = 88 +const C_DOMINO_THEORY = 89 +const C_CIVIC_FORUM = 90 +const C_MY_FIRST_BANANA = 91 +const C_BETRAYAL = 92 +const C_SHOCK_THERAPY = 93 +const C_UNION_OF_DEMOCRATIC_FORCES = 94 +const C_POWER_STRUGGLE_ROMANIA = 95 +const C_THE_CHINESE_SOLUTION = 96 +const C_THE_TYRANT_IS_GONE = 97 +const C_POLITBURO_INTRIGUE = 98 +const C_LIGACHEV = 99 +const C_STAND_FAST = 100 +const C_ELENA = 101 +const C_NATIONAL_SALVATION_FRONT = 102 +const C_GOVERNMENT_RESIGNS = 103 +const C_NEW_YEARS_EVE_PARTY = 104 +const C_PUBLIC_AGAINST_VIOLENCE = 105 +const C_SOCIAL_DEMOCRATIC_PLATFORM_ADOPTED = 106 +const C_MASSACRE_IN_TIMISOARA = 107 +const C_ARMY_BACKS_REVOLUTION = 108 +const C_KREMLIN_COUP = 109 +const C_MALTA_SUMMIT = 110 + +// END CONSTANTS }}} + 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] @@ -9038,7 +9233,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ -// #region GENERATED EVENT CODE +// BEGIN EVENTS {{{ const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -9941,9 +10136,4 @@ CODE[351] = [ // Scare Tactics [ vm_remove_opp_infl, 1 ], [ vm_return ], ] - - - - -// #endregion - +// END EVENTS }}} diff --git a/tools/gencode.js b/tools/gencode.js index f2e3a26..a46823f 100644 --- a/tools/gencode.js +++ b/tools/gencode.js @@ -103,4 +103,3 @@ for (let line of fs.readFileSync("events.txt", "utf-8").split("\n")) { emit(["return"]) console.log("]") -console.log("// #endregion") diff --git a/tools/genconst.js b/tools/genconst.js new file mode 100644 index 0000000..a2b9235 --- /dev/null +++ b/tools/genconst.js @@ -0,0 +1,25 @@ +const data = require("../data.js") + +function clean_name(s) { + return s.toUpperCase() + .replace(" - ", "_") + .replace(/[ /-]/g, "_") + .replace(/[!,*"'.]/g, "") +} + +console.log("") + +console.log("// SPACES") +for (let s of data.spaces) { + console.log("const S_" + clean_name(s.ascii_name) + " = " + s.space_id) +} + +console.log("") + +console.log("// CARDS") +for (let c of data.cards) { + if (c) + console.log("const C_" + clean_name(c.name) + " = " + c.number) +} + +console.log("") -- cgit v1.2.3 From af8119ac8f66aa81277c307ebc2e4be519219191 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 00:58:11 +0200 Subject: Update favicon. --- favicon.png | Bin 10723 -> 0 bytes images/Hammer_and_sickle.svg | 5 +++++ images/favicon_com.svg | 5 +++++ images/favicon_dem.svg | 39 +++++++++++++++++++++++++++++++++++++++ play.html | 2 +- 5 files changed, 50 insertions(+), 1 deletion(-) delete mode 100644 favicon.png create mode 100644 images/Hammer_and_sickle.svg create mode 100644 images/favicon_com.svg create mode 100644 images/favicon_dem.svg diff --git a/favicon.png b/favicon.png deleted file mode 100644 index 7431f53..0000000 Binary files a/favicon.png and /dev/null differ diff --git a/images/Hammer_and_sickle.svg b/images/Hammer_and_sickle.svg new file mode 100644 index 0000000..4aa6dd0 --- /dev/null +++ b/images/Hammer_and_sickle.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/images/favicon_com.svg b/images/favicon_com.svg new file mode 100644 index 0000000..9f9cc3b --- /dev/null +++ b/images/favicon_com.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/images/favicon_dem.svg b/images/favicon_dem.svg new file mode 100644 index 0000000..d91fcc7 --- /dev/null +++ b/images/favicon_dem.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play.html b/play.html index f510ba0..d90c6ad 100644 --- a/play.html +++ b/play.html @@ -6,7 +6,7 @@ 1989 - + -- cgit v1.2.3 From b8a0e71403e00cdce59f86c576cdfc68a76b7f10 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 01:27:32 +0200 Subject: use card name constants. fix eslint issues in play.js --- .editorconfig | 7 ++ play.js | 217 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 114 insertions(+), 110 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5f2605e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*.js] +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf diff --git a/play.js b/play.js index f94a7db..dcbc928 100644 --- a/play.js +++ b/play.js @@ -2,6 +2,9 @@ // vim:set foldmethod=marker: +/* global view, roles, send_action, action_button, scroll_into_view */ +/* global spaces, cards, power_cards */ + // BEGIN CONST {{{ // SPACES @@ -328,9 +331,30 @@ const last_space = 74 const last_card = 110 const last_power_card = 54 -const countries = [ "Poland", "Hungary", "East_Germany", "Bulgaria", "Czechoslovakia", "Romania" ] -const board_events = [ 2, 9, 69, 97 ] -const box_events = [ 15, 24, 26, 39, 48, 49, 53, 58, 59, 65, 70, 73, 100, 101, 104 ] +const board_events = [ + C_SOLIDARITY_LEGALIZED, + C_THE_WALL, + C_SYSTEMATIZATION, + C_THE_TYRANT_IS_GONE +] + +const box_events = [ + C_HONECKER, + C_ST_NICHOLAS_CHURCH, + C_HELSINKI_FINAL_ACT, + C_ECO_GLASNOST, + C_WE_ARE_THE_PEOPLE, + C_FOREIGN_CURRENCY_DEBT_BURDEN, + C_LI_PENG, + C_AUSTRIA_HUNGARY_BORDER_REOPENED, + C_GRENZTRUPPEN, + C_PRESIDENTIAL_VISIT, + C_SECURITATE, + C_LASZLO_TOKES, + C_STAND_FAST, + C_ELENA, + C_NEW_YEARS_EVE_PARTY, +] const ui = { favicon: document.getElementById("favicon"), @@ -381,8 +405,8 @@ function create_ui() { for (let s = 1; s <= last_space; ++s) { let info = spaces[s] let [ x, y, w, h ] = LAYOUT[info.ascii_name] - let xc = Math.round( x + w / 2 ) - let yc = Math.round( y + h / 2 ) + let xc = Math.round(x + w / 2) + let yc = Math.round(y + h / 2) x -= 6 y -= 6 w += 12 @@ -401,14 +425,14 @@ function create_ui() { let com_e = document.createElement("div") com_e.className = "marker comInfl hide" - com_e.style.left = (xc + 32 - 25) + "px" - com_e.style.top = (yc + 12 - 25) + "px" + com_e.style.left = xc + 32 - 25 + "px" + com_e.style.top = yc + 12 - 25 + "px" ui.com_inf[s] = com_e let dem_e = document.createElement("div") dem_e.className = "marker demInfl hide" - dem_e.style.left = (xc - 32 - 25) + "px" - dem_e.style.top = (yc + 12 - 25) + "px" + dem_e.style.left = xc - 32 - 25 + "px" + dem_e.style.top = yc + 12 - 25 + "px" ui.dem_inf[s] = dem_e document.getElementById("spaces").append(space_e) @@ -416,7 +440,6 @@ function create_ui() { document.getElementById("markers").appendChild(dem_e) } - ui.cards = [] for (let c = 1; c <= last_card; ++c) { const card_e = document.createElement("div") @@ -455,76 +478,20 @@ function create_ui() { create_country(5, "country_romania") } -// SUPPORTING FUNCTIONS - -function on_click_space(evt) { - if (evt.button === 0) { - const space = evt.target.my_space - //console.log('on_click_space_called with space:', space); - if (send_action("space", space)) { - console.log('send_action with space:', space); - evt.stopPropagation() - } else if (send_action("sc", space)) { - //console.log('send_action with sc:', space); - evt.stopPropagation() - } else { - // console.log('send_action failed for space:', space); - } - } - //hide_popup_menu(); -} - -function on_log(text) { - // eslint-disable-line no-unused-vars - - let p = document.createElement("div") - - if (text.match(/^>/)) { - text = text.substring(1) - p.className = "i" - } - - text = text.replace(/_/g, " ") - text = text.replace(/C(\d+)/g, sub_card_name) - text = text.replace(/P(\d+)/g, sub_power_card_name) - text = text.replace(/V(\d+)/g, sub_power_card_value) - text = text.replace(/%(\d+)/g, sub_space_name) - text = text.replace(/D[1-6]/g, sub_die) - - if (text.match(/^\.h1/)) { - text = text.substring(4) - p.className = "h1" - } else if (text.match(/^\.h2d/)) { - text = text.substring(5) - p.className = "h2 dem" - } else if (text.match(/^\.h2c/)) { - text = text.substring(5) - p.className = "h2 com" - } else if (text.match(/^\.h2/)) { - text = text.substring(4) - p.className = "h2" - } else if (text.match(/^\.h3/)) { - text = text.substring(4) - p.className = "h3" - } - - p.innerHTML = text - return p -} - function layout_turn_marker() { let x = 654 + 24 + (view.turn - 1) * 53 let y = 80 + 24 - ui.turn.style.left = (x - 25) + "px" - ui.turn.style.top = (y - 25) + "px" + ui.turn.style.left = x - 25 + "px" + ui.turn.style.top = y - 25 + "px" } function layout_round_marker() { let x = 709 + 24 + (view.turn - 1) * 53 let y = 142 + 24 - ui.round.style.left = (x - 25) + "px" - ui.round.style.top = (y - 25) + "px" - if (view.round_player === "Democrat") // TODO: bit flag? + ui.round.style.left = x - 25 + "px" + ui.round.style.top = y - 25 + "px" + if (view.round_player === "Democrat") + // TODO: bit flag? ui.round.className = "marker dem" else ui.round.className = "marker com" @@ -533,18 +500,18 @@ function layout_round_marker() { function layout_stability_marker() { let x = 24 + 1381 let y = 24 + 1081 + view.stability * 54 - ui.stability.style.left = (x - 25) + "px" - ui.stability.style.top = (y - 25) + "px" + ui.stability.style.left = x - 25 + "px" + ui.stability.style.top = y - 25 + "px" } -let TST_X = [ 53, 53+69, 53+69*2, 53+69*3, 53+69*4, 53+69*5, 53+69*6, 556 ] +let TST_X = [ 53, 53 + 69, 53 + 69 * 2, 53 + 69 * 3, 53 + 69 * 4, 53 + 69 * 5, 53 + 69 * 6, 556 ] let TST_Y = [ 2128, 2257 ] function layout_tst_marker(e, v, top) { let x = TST_X[v] + 24 let y = TST_Y[top] + 24 - e.style.left = (x - 25) + "px" - e.style.top = (y - 25) + "px" + e.style.left = x - 25 + "px" + e.style.top = y - 25 + "px" } function layout_vp_marker() { @@ -552,27 +519,25 @@ function layout_vp_marker() { if (view.vp === 0) { y = 2425 + 25 x = 843 + 28 - } - else if (view.vp < 0) { + } else if (view.vp < 0) { if (view.vp & 1) { y = 2456 + 25 - x = 803 + 28 - (-view.vp - 1)/2 * 62 + x = 803 + 28 - ((-view.vp - 1) / 2) * 62 } else { y = 2395 + 25 - x = 772 + 28 - (-view.vp - 2)/2 * 62 + x = 772 + 28 - ((-view.vp - 2) / 2) * 62 } - } - else if (view.vp > 0) { + } else if (view.vp > 0) { if (view.vp & 1) { y = 2396 + 25 - x = 883 + 28 + (view.vp - 1)/2 * 62 + x = 883 + 28 + ((view.vp - 1) / 2) * 62 } else { y = 2455 + 25 - x = 913 + 28 + (view.vp - 2)/2 * 62 + x = 913 + 28 + ((view.vp - 2) / 2) * 62 } } - ui.vp.style.left = (x - 25) + "px" - ui.vp.style.top = (y - 25) + "px" + ui.vp.style.left = x - 25 + "px" + ui.vp.style.top = y - 25 + "px" } function layout_country(id) { @@ -614,30 +579,30 @@ function on_update() { // UPDATE EVENT MARKERS ON THE BOARD - if (view.persistent_events.includes(2)) - ui.events[2].style.display = "block" + if (view.persistent_events.includes(C_SOLIDARITY_LEGALIZED)) + ui.events[C_SOLIDARITY_LEGALIZED].style.display = "block" else - ui.events[2].style.display = "none" + ui.events[C_SOLIDARITY_LEGALIZED].style.display = "none" - if (view.persistent_events.includes(9)) - ui.events[9].style.display = "block" + if (view.persistent_events.includes(C_THE_WALL)) + ui.events[C_THE_WALL].style.display = "block" else - ui.events[9].style.display = "none" + ui.events[C_THE_WALL].style.display = "none" if (view.persistent_events.includes(69)) { - ui.events[69].style.display = "block" - ui.events[69].style.left = ui.layout_xy[view.systematization][0] - 25 + "px" - ui.events[69].style.top = ui.layout_xy[view.systematization][1] - 25 + "px" + ui.events[C_SYSTEMATIZATION].style.display = "block" + ui.events[C_SYSTEMATIZATION].style.left = ui.layout_xy[view.systematization][0] - 25 + "px" + ui.events[C_SYSTEMATIZATION].style.top = ui.layout_xy[view.systematization][1] - 25 + "px" } else { - ui.events[69].style.display = "none" + ui.events[C_SYSTEMATIZATION].style.display = "none" } - if (view.persistent_events.includes(97)) { - ui.events[97].style.display = "block" - ui.events[97].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" - ui.events[97].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 25 + "px" + if (view.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { + ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" + ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" + ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 25 + "px" } else { - ui.events[97].style.display = "none" + ui.events[C_THE_TYRANT_IS_GONE].style.display = "none" } // EVENT REMINDER LIST @@ -775,22 +740,22 @@ function on_update() { // =========================== LOG FUNCTIONS ============================================== -function sub_card_name(match, p1) { +function sub_card_name(_match, p1) { let x = p1 | 0 return `${cards[x].name}` } -function sub_power_card_name(match, p1) { +function sub_power_card_name(_match, p1) { let x = p1 | 0 return `${power_cards[x].name}` } -function sub_power_card_value(match, p1) { +function sub_power_card_value(_match, p1) { let x = p1 | 0 return `${x}` } -function sub_space_name(match, p1) { +function sub_space_name(_match, p1) { let id = p1 | 0 let name = spaces[id].name_unique return `${name}` @@ -809,6 +774,42 @@ const die = { D6: '', } +function on_log(text) { + let p = document.createElement("div") + + if (text.match(/^>/)) { + text = text.substring(1) + p.className = "i" + } + + text = text.replace(/_/g, " ") + text = text.replace(/C(\d+)/g, sub_card_name) + text = text.replace(/P(\d+)/g, sub_power_card_name) + text = text.replace(/V(\d+)/g, sub_power_card_value) + text = text.replace(/%(\d+)/g, sub_space_name) + text = text.replace(/D[1-6]/g, sub_die) + + if (text.match(/^\.h1/)) { + text = text.substring(4) + p.className = "h1" + } else if (text.match(/^\.h2d/)) { + text = text.substring(5) + p.className = "h2 dem" + } else if (text.match(/^\.h2c/)) { + text = text.substring(5) + p.className = "h2 com" + } else if (text.match(/^\.h2/)) { + text = text.substring(4) + p.className = "h2" + } else if (text.match(/^\.h3/)) { + text = text.substring(4) + p.className = "h3" + } + + p.innerHTML = text + return p +} + // =========================== VISUAL FUNCTIONS ==========================================# function on_focus_card_tip(card_number) { @@ -846,7 +847,3 @@ function toggle_discard() { function toggle_removed() { document.getElementById("removed_panel").classList.toggle("hide") } - -function find_country_index(country) { - return countries.indexOf(country) -} -- cgit v1.2.3 From 129fca876d1efb7b238e277fc82c6589d52ac016 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 07:54:11 +0000 Subject: Working on power cards during struggle --- play.html | 36 ++++++++++++++++++++++++++---------- play.js | 12 +++++++++--- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/play.html b/play.html index f510ba0..249712e 100644 --- a/play.html +++ b/play.html @@ -66,6 +66,32 @@
    + +
    +
    Cards on the Table
    +
    +
    + + +
    +
    Played Card
    +
    + + +
    + + +
    +
    Power Struggle
    +
    +
    Power Struggle
    +
    +
    + +
    +
    Played Power Card
    @@ -80,17 +106,7 @@
    - -
    -
    Cards on the Table
    -
    -
    - -
    -
    Played Card
    -
    -
    diff --git a/play.js b/play.js index 03f58f5..3acf3e8 100644 --- a/play.js +++ b/play.js @@ -40,6 +40,7 @@ const ui = { event_reminder_list: document.getElementById("event_reminder_list"), played_card: document.getElementById("played_card"), + scoring_card: document.getElementById("scoring_card"), played_power_card: document.getElementById("played_power_card"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), @@ -370,9 +371,14 @@ function on_update() { // UPDATE CARD DISPLAYS ui.played_card.replaceChildren() - if (view.played_card > 0) - ui.played_card.appendChild(ui.cards[view.played_card]) - + + if (!view.is_pwr_struggle) { + if (view.played_card > 0) + ui.played_card.appendChild(ui.cards[view.played_card]) + } else { + if (view.played_card > 0) + ui.scoring_card.appendChild(ui.cards[view.played_card]) + } ui.played_power_card.replaceChildren() if (view.played_power_card > 0) ui.played_power_card.appendChild(ui.power_cards[view.played_power_card]) -- cgit v1.2.3 From 2f4c6fd75e33d534e76bf6c03f0352157f026c36 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 09:21:34 +0000 Subject: Update to space constants --- rules.js | 365 +++++++++++++++++++++++++++++++-------------------------------- 1 file 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)) { -- cgit v1.2.3 From 1830a7a920ffb4ebb3fcc04f957352b5386b0f84 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 10:32:20 +0000 Subject: Tidying up code --- rules.js | 984 +++++++-------------------------------------------------------- 1 file changed, 105 insertions(+), 879 deletions(-) diff --git a/rules.js b/rules.js index 467a33d..d29c4d3 100644 --- a/rules.js +++ b/rules.js @@ -208,6 +208,7 @@ const C_MALTA_SUMMIT = 110 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 C_TACTICS_FAILS = 52 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] @@ -337,9 +338,7 @@ function start_game() { 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) - //.log('game.strategy_deck: ', game.strategy_deck[1], 'democrat_hand:', game.democrat_hand) game.valid_spaces = valid_spaces_setup() game.available_ops = 2 @@ -475,18 +474,14 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { - //console.log('argument undefined') view.actions[action] = 1 } else { if (!(action in view.actions)) { - //console.log('push argument') view.actions[action] = [] } view.actions[action].push(argument) } - //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_space(space){ @@ -515,7 +510,6 @@ function gen_action_scoring(){ } exports.action = function (state, player, action, arg) { - //console.log('exports.action called with state:' , state, 'player:', player, 'action: ', action, 'arg: ', arg) game = state if (states[game.state] && action in states[game.state]) { states[game.state][action](arg, player) @@ -533,7 +527,6 @@ 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.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { view.prompt = 'Place starting SPs: done. Start Turn 1.'; gen_action("start"); @@ -586,7 +579,6 @@ 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"); @@ -659,7 +651,6 @@ states.choose_card = { }, pass() { log('No cards remaining. Passed') - //end_round() game.state = 'end_round' } } @@ -681,27 +672,16 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { - /*if (game.phase >= 1) { /*Finish here when playing your own event - console.log('in play card') - view.prompt = `${clean_name(cards[game.played_card].name)}: done. End the Action Round.` - gen_action('end_round') - return - }*/ - view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` if (scoring_cards.includes(game.played_card)) { - /*view.prompt = 'Play for:'*/ gen_action('event') return } // Check for Reformer Rehabilitated - - //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) - - - if (game.played_card === 67 && game.playable_cards.includes(67)){ + + if (game.played_card === C_REFORMER_REHABILITATED && game.playable_cards.includes(C_REFORMER_REHABILITATED)){ if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { gen_action('event') } @@ -711,11 +691,7 @@ states.play_card ={ } //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') } @@ -738,7 +714,6 @@ states.play_card ={ }, event() { push_undo() - //console.log('played event, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) log_gap(`Played C${cards[game.played_card].number} for the event`) game.vm_infl_to_do = false if (scoring_cards.includes(game.played_card)) {game.phase = 0} @@ -746,7 +721,6 @@ states.play_card ={ game.return = game.active if (switch_events.includes(game.played_card)) {next_player()} game.vm_event = game.played_card - //console.log('before event, game.vm_infl_to_do', game.vm_infl_to_do) goto_vm(game.vm_event) }, opp_event() { @@ -789,7 +763,6 @@ states.play_card ={ if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - //game.phase = 1 /*Do I need this? */ game.vm_event_to_do = true } } @@ -848,7 +821,6 @@ states.resolve_opponent_event = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - //console.log('in resolve opponent event: discard', game.strategy_discard) if (game.vm_infl_to_do) { view.prompt = 'Event resolved. Choose to play card for:' gen_action('influence') @@ -906,10 +878,6 @@ states.resolve_opponent_event = { }, end_round() { push_undo() - /*if(game.round_player === COM && game.active === DEM) { - log_h3('End of Communist Action Round') - change_player() - } */ end_round() } } @@ -942,7 +910,6 @@ states.finish_add_infl = { } end_round() - //game.state = 'end_round' } } @@ -952,7 +919,6 @@ states.finish_support_check_prep = { if (game.available_ops === 0) { view.prompt = 'Support checks: done.' gen_action('end_round') - //return } else { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` console.log('valid_spaces', game.valid_spaces) @@ -965,11 +931,9 @@ states.finish_support_check_prep = { push_undo() game.selected_space = space // Check for Austria-Hungary Border Reopened - check on first support check only - //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) if (game.persistent_events.includes(58)){ if (game.active === DEM && game.available_ops > 1) { - //console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', 'austria_hungary_border_reopened']) - 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(58) && game.active === DEM) { game.state = 'finish_austria_hungary_border_reopened_check' return } @@ -979,7 +943,6 @@ states.finish_support_check_prep = { }, end_round () { end_round() - //game.state = 'end_round' } } @@ -1084,7 +1047,6 @@ states.tiananmen_square_attempt_success = { }, done () { push_undo() - //console.log('going to tst award, game.return_state', game.return_state) goto_vm(game.vm_event) }, end_round () { @@ -1102,7 +1064,6 @@ states.tiananmen_square_attempt_fail = { end_round () { push_undo() end_round() - //game.state = 'tiananmen_square_attempt_done' } } @@ -1114,35 +1075,23 @@ states.tiananmen_square_attempt_done = { }, end_round () { end_round() - //game.state = 'end_round' } } states.tst_goddess = { inactive: 'choose whether to discard a card.', prompt() { - //if (game.phase === 0) { view.prompt = 'Tiananmen Square Track award: you may discard a non-Power Struggle Card and draw a replacement.' for (let card of game.valid_cards) { gen_action_card(card) } gen_action('pass') - /*} else { - view.prompt = 'Discard a card: done.' - gen_action('done') - }*/ }, card(card) { push_undo() discard(card) game.valid_cards = [] game.state = 'tst_goddess_draw' - //game.phase++ - /*if (game.active === DEM) { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length +1, game.communist_hand.length) - } else { - draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) - }*/ }, pass() { log('Did not discard') @@ -1207,7 +1156,7 @@ states.tst_goddess_draw = { states.support_check_prep = { inactive: 'do support checks', prompt () { - if (game.available_ops === 0) { /*Needs another check for Support Checks done during Crowd Turns against Ceausescu*/ + if (game.available_ops === 0) { if (game.is_pwr_struggle) { view.prompt = 'The Crowd Turns Against Ceausescu. Support checks: done.' gen_action('done') @@ -1231,18 +1180,16 @@ states.support_check_prep = { game.selected_space = space // Check for Austria-Hungary Border Reopened - check on first support check only - //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) if (game.persistent_events.includes(58)) { if (game.active === DEM && game.available_ops > 1) { if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { game.state = 'austria_hungary_border_reopened_check' return } - //game.state = 'do_support_check' - } /*else { */ + + } } game.state = 'do_support_check' - //} }, end_round() { push_undo() @@ -1266,7 +1213,6 @@ states.support_check_prep = { states.do_support_check = { inactive: 'do support checks.', prompt () { - // console.log('in do_support_check') view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') }, @@ -1321,11 +1267,7 @@ states.draw_power_cards = { draw() { push_undo() game.power_struggle_deck = [...all_power_cards] - // console.log('game.power_struggle_deck.length', game.power_struggle_deck.length) - //console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) - //console.log('test3') let presence = check_presence(game.pwr_struggle_in) - //console.log('test2') if (presence.dem_spaces > 0) { game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1) } else { @@ -1371,21 +1313,18 @@ states.draw_power_cards = { //Draw Power Cards game.is_pwr_struggle = true - //console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit) draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit) if (game.active === DEM) { game.valid_cards = [...game.dem_pwr_hand] } else { game.valid_cards = [...game.com_pwr_hand] } - //game.valid_cards = all_power_cards log(`Communist: ${game.com_pwr_hand.length} cards`) log(`Democrat: ${game.dem_pwr_hand.length} cards`) //Check if The Crowd Turns Against Ceausescu occurs if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { - //console.log('draw cards: crowd subcheck, game.active', game.active) if (game.active === COM) { game.return = COM next_player() @@ -1396,7 +1335,6 @@ states.draw_power_cards = { } else { log_h2('Raise the Stakes') game.state = 'raise_stakes_1' - //console.log('game.state', game.state, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) } } } @@ -1412,7 +1350,6 @@ states.the_crowd_turns_against_ceausescu_prep = { draw() { game.ceausescu_cards = [] draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) - //console.log('game.ceausescu_cards', game.ceausescu_cards) game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) game.vm_available_ops = game.temp * 3 @@ -1483,7 +1420,6 @@ states.raise_stakes_1 = { prompt () { console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand) - // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') @@ -1531,13 +1467,11 @@ states.raise_stakes_1 = { log_gap('Raised the stakes') game.raised_stakes_discard = 0 next_player() - //console.log('game.active', game.active) if (game.active === DEM) { game.valid_cards = [...game.dem_pwr_hand] } else { game.valid_cards = [...game.com_pwr_hand] } - // console.log('game.valid_cards', game.valid_cards) game.state = 'raise_stakes_2' } } @@ -1675,7 +1609,7 @@ states.power_struggle = { } } if (game.phase === 0) { - if (card >= 37 && card <= 48) { /*When a leader is played */ + if (leader_cards.includes(card)) { game.played_power_card = card game.phase = 3 } else if (card === 51){ /*Scare Tactics */ @@ -1732,10 +1666,9 @@ states.power_struggle = { log('Conceded') log_h2('Aftermath') log_h3('Support Loss') - //if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {game.rally_win = 2} - //if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {game.petition_win = 2} if (game.phase === 0) { - game.played_power_card = 0 /*If conceded when held the initiative but had no playable cards, ignore the last played card */ + game.played_power_card = 0 + game.proxy_power_card = 0 /*If conceded when held the initiative but had no playable cards, ignore the last played card */ } game.phase = 0 game.state = 'support_loss' @@ -1768,24 +1701,6 @@ states.power_struggle = { next_player() do_valid_cards() }, - /*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) - } 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)} - game.phase = 0 - next_player() - do_valid_cards() - },*/ - /*infl(space) { - game.remove_opponent_infl = true - remove_infl(space) - game.phase = 6 - }, - discard () { /*Is this still needed? - if (game.active === DEM) {discard_card(game.dem_pwr_hand)} - else {discard_card(game.com_pwr_hand)} - game.available_ops -- - }, */ done () { if (game.phase === 7) { /*Is this ever called anymore? */ game.phase = 0 @@ -1959,10 +1874,8 @@ states.vp_roll = { log(`-${vp_change} VP`) } if (roll >= 4) - //console.log('VP before', game.vp) if (game.active === DEM) {game.vp += vp_change} else {game.vp -= vp_change} - //console.log('VP after', game.vp) if (game.active === DEM && modified_roll >= 4) { game.phase = 1 } else { @@ -2036,21 +1949,6 @@ states.choose_power = { } } } -/* -states.score_country = { - inactive: `score country`, - prompt () { - view.prompt = 'Scoring: done.' - gen_action('done') - }, - done () { - reset_power() - /*if (game.return !== game.active) { - next_player()} - game.state = 'finish_scoring' - } -} -*/ states.the_tyrant_is_gone ={ inactive: 'resolve The Tyrant is Gone.', @@ -2080,7 +1978,6 @@ states.finish_scoring ={ gen_action('done') } , done() { - //console.log('game.return_state', game.return_state) log_msg_gap('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ if (game.persistent_events.includes(111)) { game.state = 'new_years_eve_party' @@ -2091,7 +1988,6 @@ states.finish_scoring ={ } reset_power() end_round() - //game.state = 'end_round' } } @@ -2173,7 +2069,6 @@ states.final_scoring_held = { gen_action('bonus') }, bonus() { - // console.log('game.revolutions: ', game.revolutions) const held_countries = game.revolutions.filter(value => value === false).length let vp_gain = 4*held_countries log(`Communist holds ${held_countries} countries: -${vp_gain} VP`) @@ -2255,10 +2150,7 @@ states.general_strike = { for (let card of available_cards) { gen_action_card(card) } - } /*else if (game.phase >= 1) { - view.prompt = 'General Strike: done.' - gen_action('done') - } */ else if (game.played_card > 0 ) { + } else if (game.played_card > 0 ) { view.prompt = 'General Strike: roll a die.' gen_action('roll') } @@ -2296,13 +2188,9 @@ states.general_strike = { } else { log('The strike continues. Required 6 or more') } - //game.phase = 1 - game.state = 'end_round' - }, /* - done () { - //end_round() + game.state = 'end_round' - }*/ + }, } states.honecker ={ @@ -2407,7 +2295,6 @@ states.new_years_eve_party = { states.stasi_end_round = { inactive: 'choose next card due to Stasi.', prompt() { - //console.log('game.stasi_card', game.stasi_card) let available_cards = game.democrat_hand if (available_cards.length === 0) { view.prompt = 'Stasi: no cards remaining.' @@ -2473,13 +2360,7 @@ states.stasi_confirm = { states.stasi_play_card = { inactive: 'play a card.', - prompt () { /*Should get rid of the play card 'done' prompt for consistency with general play */ - /*if (game.played_card > 0) { - game.state = 'play_card' - view.prompt = 'Play card: done.' - gen_action("done"); - return;*/ - //} else + prompt () { if (game.democrat_hand.length === 0) { view.prompt = 'Stasi: you must pass.' gen_action('pass') @@ -2493,7 +2374,6 @@ states.stasi_play_card = { }, card(card) { push_undo() - //log_msg_gap(`Stasi: played C${card}`) game.played_card = card let find_card find_card = game.democrat_hand.indexOf(card); @@ -2513,7 +2393,6 @@ states.stasi_play_card = { game.state = 'end_round' }, done () { - //game.stasi_card = 0 if (game.democrat_hand.includes(C_COMMON_EUROPEAN_HOME)) { game.state = 'stasi_resolve_common_european_home' } else { @@ -2547,9 +2426,6 @@ states.stasi_resolve_common_european_home = { function add_infl(space) { push_undo() - //console.log('adding infl to', space) - //console.log('at start, event', game.persistent_events['austria_hungary_border_reopened'], 'ahbr', game.austria_hungary_border_reopened, 'tracker', game.austria_hungary_border_reopened_tracker) - //log(`Added 1 influence in %${space}`) log_summary(`Added £ SP in %${space}`) //If AHBR - check AHBR conditions @@ -2596,17 +2472,13 @@ function add_infl(space) { // Check for Genscher & Austria Hungary Border Reopened if (game.available_ops === 1) { - //console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher']) if (game.active === DEM) { if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { - //console.log('in gensher subcheck - remove non-East German controlled ') game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) } else { - //console.log('remove all controlled spaces') game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) } } else { - //console.log('remove all dem controlled spaces') game.valid_spaces = game.valid_spaces.filter(n => !check_opp_control(n)) } } @@ -2619,7 +2491,6 @@ function add_infl(space) { function remove_infl(space) { push_undo() - //log(`Removed 1 influence from %${space}.`) log_summary(`Removed £ SP from %${space}.`) if (game.remove_opponent_infl === true) { @@ -2664,7 +2535,6 @@ function do_sc(space) { game.vp ++ if (check_vp()) { game.state = 'game.over' - //console.log('after check_vp, game.state', game.state) return } } @@ -2674,16 +2544,8 @@ function do_sc(space) { let roll = roll_d6() log(`Roll: D${roll}`) - /* - //Check if support check is being done with game.played_card or a subsequent card (e.g. Common European Home, Dash for the West, etc) - if (game.vm_event > 0) { - roll+= cards[game.vm_event].ops - log(`+${cards[game.vm_event].ops} from card ops`) - } - */ // Check for the Crowd Turns Against Ceausescu - //else if (game.is_pwr_struggle) { roll += game.vm_available_ops logi(`+${game.vm_available_ops} from Ceausescu`) @@ -2697,7 +2559,6 @@ function do_sc(space) { logi('+2 TST award') } else { - //let modifier = 0 let card_ops = get_card_ops(this_card()) roll += card_ops @@ -2748,7 +2609,6 @@ function do_sc(space) { // Events which affect adjacency - The Wall const adj = count_adj(space) - //console.log('adj', adj) if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { logi('No adjacency for Democrats due to C9') logi('C9 no longer in effect') @@ -2819,7 +2679,7 @@ function do_sc(space) { } else { log_msg_gap('Change influence: 0 SP') } - if (game.active === COM && game.persistent_events.includes(39) && spaces[space].space_id === 66) { + if (game.active === COM && game.persistent_events.includes(C_ECO_GLASNOST) && spaces[space].space_id === S_RUSE) { log_msg_gap('+1 VP from C39') game.vp++ if (check_vp()) { @@ -2828,7 +2688,7 @@ function do_sc(space) { } // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany - if (game.persistent_events.includes(58)){ + if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)){ if (game.austria_hungary_border_reopened_tracker) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') } @@ -2840,7 +2700,6 @@ 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 =0 ; i <= 74 ; i++) { space = spaces[i] @@ -2864,7 +2723,6 @@ function valid_spaces_setup() { function valid_spaces_sc() { let valid_spaces_set = new Set(); - //console.log('valid spaces sc, persistent events', game.persistent_events) for (let i = 0 ; i <= 74; i++) { space = spaces[i] @@ -2910,7 +2768,6 @@ function valid_spaces_sc() { function valid_spaces_support_loss() { let valid_spaces_set = new Set(); for (let i = 0; i < game.demInfl.length; i++) { - //console.log('spaces.length', game.demInfl.length, 'i', i) space = spaces[i] if (game.active === DEM) { infl = game.demInfl[i] @@ -2929,38 +2786,9 @@ function valid_spaces_support_loss() { game.valid_spaces = Array.from(valid_spaces_set); return game.valid_spaces; } -/* -function valid_spaces_support_falters() { - let valid_spaces_set = new Set(); - if (game.active === DEM) { - for (let piece of game.pieces) { - if (!piece) continue - let space = spaces.find(s => s && s.space_id === piece.space_id); - if (space && piece.comInfl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } - } else { - for (let piece of game.pieces) { - if (!piece) continue - let space = spaces.find(s => s && s.space_id === piece.space_id); - if (space && piece.demInfl > 0 && space.country === game.pwr_struggle_in) { - valid_spaces_set.add(space.space_id); - } - } - } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; -} - */ function valid_spaces_infl() { - /*if (game.state.startsWith('vm')) { - console.log('valid_spaces_infl called from VM') - } else { - console.log('valid_spaces_infl called not from VM') - }*/ + // Check if function is called from the VM or not, take relevant ops variable let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; @@ -2980,19 +2808,15 @@ function valid_spaces_infl() { let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - //console.log('adj_space_id', adj_space_id) if (adj_space_id) { const adj_piece = spaces[adj_space_id]; - //console.log('adjacent piece name', adj_piece.name_unique) - + // Check if the adjacent space is controlled by the opponent const opponent_control = check_opp_control(adj_piece.space_id) - //console.log('controlled?', opponent_control) - + //Check for Genscher. Can always place in East Germany even with 1 op if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(63)){ - // console.log('space added with genscher') valid_spaces_set.add(adj_piece.space_id) } @@ -3014,7 +2838,7 @@ function valid_cards(player_hand, presence) { if (game.phase === 0) { for (let c of player_hand) { let card = power_cards.find(card => card && card.number === c); - if (card.number === 52) {continue} // Never add tactics fails + if (card.number === C_TACTICS_FAILS) {continue} // Never add tactics fails if (card.name === game.tactics_fails) {continue} //Cannot play the suit of Tactics Fails if (card.socio === 0) { valid_cards_set.add(card.number); @@ -3059,74 +2883,35 @@ function count_adj(id) { for (let adj_space_id of adjacent_spaces) { if (adj_space_id) { const adj_piece = spaces.find(piece => piece && piece.space_id === adj_space_id); - //console.log('adj_piece.space_id', adj_piece.space_id, 'space', space) if (adj_piece && adj_piece.space_id !== space.space_id) { if (check_dem_control(adj_piece.space_id)) { - //console.log('added DEM space', spaces[adj_piece.space_id].name) dem_adj++ } if (check_com_control(adj_piece.space_id)) { - //console.log('added COM space', spaces[adj_piece.space_id].name) com_adj++ } } } } - //console.log('dem_adj: ', dem_adj, 'com_adj: ', com_adj) return {dem_adj, com_adj} } -/*function count_adj_worker(space_id) { - const space = spaces[space_id] - let dem_adj = 0 - let com_adj = 0 - - for (let adj_space_id of space.adjacent) { - if (adj_space_id) { - const adj_space = spaces[adj_space_id] - if (adj_space && adj_space.socio === 4) { - const adj_piece = game.pieces.find(piece => piece && piece.space_id === adj_space_id ); - if (adj_piece) { - if (adj_piece.demCtrl === 1 ) { - dem_adj++ - } - if (adj_piece.comCtrl === 1 ) { - com_adj++ - } - } - } - } - } - return {dem_adj, com_adj} -} */ - function check_control(space_id) { - //console.log('in check control, space', spaces[space_id].name_unique) if ( (game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability) { return true; } else if ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability) { - //console.log('true') return true; } else { - //console.log('false') return false; } } function check_opp_control(space_id) { - if (spaces[space_id].country === 'Romania') { - //console.log('in check opp control, space', spaces[space_id].name_unique) - } if (game.active === DEM && ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability)) { - if (spaces[space_id].country === 'Romania') { - //console.log('control true') - } return true; } else if (game.active === COM && ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability)) { - //console.log('true') return true; } else { - //console.log('false') return false; } } @@ -3352,7 +3137,6 @@ function score_country(country) { let com_vp = 0 //Check for presence let presence = check_presence(country) -// console.log('presence: ', presence) //If one side has domination or control if (presence.dem_control || presence.dem_domination) { @@ -3447,21 +3231,6 @@ function score_country(country) { //Calculate change VP - /*let dem_vp = 0 - if (presence.dem_spaces > 0) {dem_vp += value_presence} - if (presence.dem_domination) {dem_vp += value_presence} - if (presence.dem_control && country !== "Hungary") { - dem_vp += value_control - } - else if (presence.dem_control && country === "Hungary") {dem_vp += 2} - dem_vp += presence.dem_battlegrounds - - let com_vp = 0 - if (presence.com_spaces > 0) {com_vp += value_presence} - if (presence.com_domination) {com_vp += value_presence} - if (presence.com_control && country !== "Hungary") {com_vp += value_presence} - else if (presence.com_control && country === "Hungary") {com_vp += 2} - com_vp += presence.com_battlegrounds */ let change_vp = dem_vp + com_vp game.vp += change_vp if (change_vp > 0 ) { @@ -3489,24 +3258,19 @@ function get_end_infl_prompt() { } function permanently_remove(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') game.table_cards.splice(card_index, 1) } game.strategy_removed.push(card) - //console.log('game.strategy_removed', game.strategy_removed) } function check_vp() { if (game.vp >= 20) { goto_game_over(DEM, `${DEM} won an Automatic Victory!`) - //console.log('after goto_game_over, game.state', game.state) return true } else if(game.vp <= -20) { goto_game_over(COM, `${COM} won an Automatic Victory!`) @@ -3528,13 +3292,11 @@ function goto_game_over(result, victory) { game.victory = victory log_h1("Game Over") log(game.victory) - //console.log('game over, game.state', game.state) return } function reset_austria_hungary_border_reopened() { - //game.austria_hungary_border_reopened_checked = false game.austria_hungary_border_reopened_tracker = false } @@ -3596,7 +3358,6 @@ function select_card(card){ game.persistent_events = game.persistent_events.filter(n => n !== 99) } game.state = 'play_card' - //console.log('game.state', game.state) } function find_event(card) { @@ -3642,9 +3403,8 @@ function get_events(card){ } function event_is_playable(card) { -// console.log('game.stasi_card', game.stasi_card, 'card', card) //Reformer never playable here - if (card === 67) { + if (card === C_REFORMER_REHABILITATED) { return false } //Check for Common European Hmme under Stasi @@ -3802,7 +3562,6 @@ function end_round() { //Check if the game is over! if (game.state === 'game_over') { - // console.log('in end') return} //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. @@ -3812,14 +3571,14 @@ function end_round() { //Reset game.played_card = 0 - game.temp = 0 - game.vm_event = 0 - game.phase = 0 + delete game.temp + delete game.vm_event + delete game.phase game.remove_opponent_infl = false game.is_pwr_struggle = false game.vm_infl_to_do = false /*Can get rid of this and use game.return_state? */ game.vm_event_to_do = false - game.vm_active_country = '' + delete game.vm_active_country game.return_state = '' game.discard = false game.return = '' @@ -3869,9 +3628,6 @@ function end_round() { throw new Error(`Wrong number of cards: ${card_check.length}`) } - - - //console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) //Check if the Reformer is playable check_reformer() @@ -3957,15 +3713,14 @@ function end_round() { } if (game.round_player === DEM) { - if(game.persistent_events.includes(13)) { - // console.log('stasi sub function') + if(game.persistent_events.includes(C_STASI)) { if (game.active !== DEM) { next_player() } log_h3('C13') game.state = 'stasi_end_round' return - } else if(game.round_player === DEM && game.persistent_events.includes(5)){ + } else if(game.round_player === DEM && game.persistent_events.includes(C_GENERAL_STRIKE)){ game.state = 'general_strike' game.round ++ log_h2(`Action Round ${game.round}`) @@ -3985,36 +3740,8 @@ function end_round() { } } } - //game.state = 'choose_card' Does this do anything any more? } -/* -function end_turn(){ - /*End Turn sequence - TST support check - Verify held cards - New Year's Eve Party - Advance Turn Marker - -// CHECK FOR OPTIONAL SUPPORT CHECK - if (game.dem_tst_position >=6 && game.com_tst_position <= 5) { - if (game.active !== DEM) { - next_player_() - } - game.state = 'tst_support_check' - } - if (game.com_tst_position >=6 && game.dem_tst_position <= 5) { - if (game.active !== COM) { - next_player_() - } - game.state = 'tst_support_check' - } - - -//CHECK HELD CARDS - -} */ - function new_turn() { clear_undo() game.turn ++ @@ -4029,10 +3756,10 @@ function new_turn() { delete game.selected_space //Remove events that only last one 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 !== C_HONECKER) /*Honecker*/ + game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) delete game.prudence delete game.stasi_card @@ -4041,26 +3768,22 @@ function new_turn() { game.persistent_events = game.persistent_events.filter(n => n !== 58) delete game.austria_hungary_border_reopened_tracker log(`C58 no longer in effect`) - //permanently_remove(58) } //Elena if (game.persistent_events.includes(101)) { game.persistent_events = game.persistent_events.filter(n => n !== 101) log(`C101 no longer in effect`) - //permanently_remove(101) } //GrenzTruppen if (game.persistent_events.includes(59)) { game.persistent_events = game.persistent_events.filter(n => n !== 59) log(`C59 no longer in effect`) - //permanently_remove(59) } //Foreign Currency Debt Burden if (game.persistent_events.includes(49)) { game.persistent_events = game.persistent_events.filter(n => n !== 49) delete game.foreign_currency_debt_burden log(`C49 no longer in effect`) - //permanently_remove(49) } //FRG Embassies if (game.persistent_events.includes(74)) { @@ -4081,7 +3804,6 @@ function new_turn() { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - //permanently_remove(100) } if (game.samizdat_card > 0 ) { @@ -4098,18 +3820,13 @@ function new_turn() { add_lateyear() } if (game.turn > 1) { - if (game.persistent_events.includes(65)) { + if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 log('Communist draws 7 cards due to C65') - //permanently_remove(65) - game.persistent_events = game.persistent_events.filter(n => n !== 65) + game.persistent_events = game.persistent_events.filter(n => n !== C_PRESIDENTIAL_VISIT) } - //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) - } //Check if TST effects need to be resolved @@ -4134,7 +3851,6 @@ function new_turn() { } else { log_h2("Action Round " + game.round) log_side() - //console.log('in start new AR call, game.active', game.active) if (game.persistent_events.includes(5)) { log_h3('C5') game.state = 'general_strike' @@ -4147,7 +3863,6 @@ function new_turn() { function next_player() { clear_undo() - //console.log('next player called') if (game.active === DEM) game.active = COM else @@ -4158,7 +3873,6 @@ function next_player() { function change_player() { clear_undo() - //console.log('next player called') if (game.active === DEM) game.active = COM else @@ -4190,13 +3904,9 @@ function draw_deck(deck) { } function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { - //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) - 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 ) + //Start with the communist player + let turn = 'communist'; + while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { if (deck.length === 0) { log_h3('--- Reshuffle ---') @@ -4206,16 +3916,12 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han else if (turn === 'communist' && communist_hand.length < com_hand_limit) { communist_hand.push(draw_card(deck)); - //console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards)); - turn = 'democrat'; + turn = 'democrat'; } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { turn = 'democrat'; } else if (turn === 'democrat' && democrat_hand.length < dem_hand_limit) { democrat_hand.push(draw_card(deck)); - //console.log('democrat_hand: ', democrat_hand) - - //console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards)); turn = 'communist'; } else if (turn === 'democrat' && democrat_hand.length === dem_hand_limit) { @@ -4227,8 +3933,6 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han } function draw_card(deck) { - //console.log('draw card called with:', deck) - //console.log('game.strategy_deck before', game.strategy_deck) if (deck.length === 0) { log_h3('--- Reshuffle ---') @@ -4236,13 +3940,10 @@ function draw_card(deck) { game.strategy_discard = [] } const randomIndex = Math.floor(random(deck.length)) - //console.log('card chosen:', randomIndex) - //console.log('game.strategy_deck after', game.strategy_deck) return deck.splice(randomIndex, 1)[0]; } function discard(card) { - //console.log('in discard(card)') let find_card if (!game.is_pwr_struggle) { @@ -4267,11 +3968,9 @@ function discard(card) { } game.power_struggle_discard.push(card) - //log(`Discarded P${power_cards[card].number}`) } } function silent_discard(card) { - //console.log('in discard(card)') let find_card if (!game.is_pwr_struggle) { if (game.active === COM) { @@ -4304,7 +4003,6 @@ function remove_from_discard(card) { } function discard_card(hand) { - //let find_card let card = Math.floor(random(hand.length)) let discarded_card = hand.splice(card, 1)[0] if (game.is_pwr_struggle) { @@ -4364,12 +4062,10 @@ function reset_power() { } if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ permanently_remove(54) - //game.table_cards = game.table_cards.filter(card => card !== 54) + } 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) } } @@ -4405,40 +4101,6 @@ function check_common_european_home() { function this_card() { return game.vm_event > 0 ? game.vm_event : game.played_card } -/* -function get_ops(card) { - let ops = cards[card].ops - if (game.active === COM) { - //Check TST op bonus - if (ops === 1 && game.com_tst_position >=2 && game.dem_tst_position <=1) { - ops++ - } - //Events that influence ops - if (game.persistent_events.includes(25)) { - ops++ - } - if (game.prudence.COM && game.prudence.COM <0) { - ops += game.prudence.COM - } - - } else { - //Check TST op bonus - if (ops === 1 && game.dem_tst_position >=2 && game.com_tst_position <=1) { - ops++ - } - //Events that influence ops - if (game.persistent_events.includes(50)) { - ops++ - } - if (game.prudence.DEM && game.prudence.DEM <0) { - ops += game.prudence.DEM - } - } - //Ops can never be less than one - if (ops <1) { ops = 1 } - return ops -} - */ const pluralize = (count, noun, suffix = 's') => `${count} ${noun}${Math.abs(count) !== 1 ? suffix : ''}` @@ -4652,13 +4314,11 @@ function vm_exec() { } function vm_inst(a) { - //console.log('game.vm.fp', game.vm.fp, 'game.vm.ip', game.vm.ip) return CODE[game.vm.fp][game.vm.ip][a] } function vm_next() { game.vm.ip++; - //console.log('vm_next called, game.vm.ip', game.vm.ip) vm_exec(); } @@ -4681,8 +4341,6 @@ function vm_log() { } function vm_if() { - //console.log('game.temp', game.temp) -// console.log('vm_operand(1)', vm_operand(1)) if (!vm_operand(1)) { let balance = 1 while (balance > 0) { @@ -4715,11 +4373,7 @@ function vm_endif() { } function vm_goto_step(step) { - // console.log('vm_goto_step called, target:', step) - //console.log('game.vm.ip', game.vp.ip) for (let i = game.vm.ip; i < CODE[game.vm.fp].length; i++) { - //console.log('i', i) - //console.log('step', CODE[game.vm.fp][i][0]) if (CODE[game.vm.fp][i][0] === step) { game.vm.ip = i; vm_exec(); @@ -4732,8 +4386,6 @@ function vm_goto_step(step) { function vm_goto(op, nop, dir, step) { - //console.log('vm_inst(0)', vm_inst(0), op, nop) -// console.log('vm_inst(0)', vm_inst(1), op, nop) let balance = 1 while (balance > 0) { game.vm.ip += dir @@ -4749,12 +4401,10 @@ function vm_goto(op, nop, dir, step) { } function event_prompt(str) { - //console.log('event_prompt called with', str) if (typeof str === "undefined") str = CODE[game.vm.fp][game.vm.prompt][1] if (typeof str === "function") str = str() - //console.log('str:', str) if (!str) { str = "" } @@ -4778,9 +4428,6 @@ function pop_vm_prompt() { } function vm_return() { - - //console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) - //Remove temporary vm variables delete game.support_check_modifier delete game.vm_max_infl @@ -4788,7 +4435,7 @@ function vm_return() { delete game.communist_hand_red game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ - if (game.persistent_events.includes(58)) { + if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { reset_austria_hungary_border_reopened() } @@ -4801,33 +4448,11 @@ function vm_return() { vm_end_event() } else { - game.state = 'vm_end_event' - /*if (!game.vm_infl_to_do) { - /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { - game.state = 'vm_end_event' - } else { - game.state = 'vm_end_event' - //end_round() - //} - } else { - console.log('vm_infl_to_do true') - vm_end_event() - }*/ } } function vm_end_event() { - //game.view_opp_hand = false -// console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) - /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { - if (game.round_player !== game.active) { - change_player() - log_h2('End of Action Round') - } - end_round() - return - } /*Go direct to end round if card fully resolved */ if (game.return !== game.active) { next_player()} if (game.return_state === 'power_struggle') { @@ -4835,13 +4460,12 @@ function vm_end_event() { } if (game.return_state && game.return_state !== '') { game.state = game.return_state - //console.log( 'game.state', game.state) } else if (game.vm_infl_to_do) { - game.state = 'resolve_opponent_event'} /*Can use game.return state for this? */ - //else {game.state = "play_card"} - else{ - end_round()} + game.state = 'resolve_opponent_event'} + else { + end_round() + } } /* ================== VM ACTIONS =========================== */ @@ -4893,7 +4517,6 @@ function vm_valid_spaces_opponent () { } } game.valid_spaces = valid_spaces -// console.log('game.valid_spaces', game.valid_spaces) vm_next() } @@ -4988,7 +4611,6 @@ function vm_valid_spaces_country_opp () { function vm_valid_spaces_country_sc () { let valid_spaces = [] let country = '' - //console.log('in vm_valid_spaces_country_sc') if (vm_operand(1)) { country = vm_operand(1) } else { @@ -5018,11 +4640,6 @@ function vm_valid_spaces_country_sc () { } } game.valid_spaces = valid_spaces - - //Check for Foreign Currency Debt Burden - /*if (game.persistent_events.includes(49) && game.active === COM) { - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country !== game.foreign_currency_debt_burden) - }*/ vm_next() } @@ -5097,8 +4714,6 @@ function vm_take_control(space) { if ((current_infl - opponent_infl) < stability) { game.demInfl[space] += stability - current_infl + opponent_infl - //game.pieces[space].demCtrl = 1 - //game.pieces[space].comCtrl = 0 } } else if (game.active === COM) { let current_infl = game.comInfl[space] @@ -5107,8 +4722,6 @@ function vm_take_control(space) { if ((current_infl - opponent_infl) < stability) { game.comInfl[space] += stability - current_infl + opponent_infl - //game.pieces[space].comCtrl = 1 - //game.pieces[space].demCtrl = 0 } } game.valid_spaces = game.valid_spaces.filter(id => id !== space) @@ -5118,14 +4731,10 @@ function vm_take_control(space) { function vm_do_add_infl(space) { push_undo() - //console.log('in vm_do_add_infl, space', space, 'ops', game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58)) - - //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${space}.`) //If AHBR - check AHBR condition - if (game.persistent_events.includes(58)) { + if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { if (spaces[space].country !== 'East_Germany'){ game.austria_hungary_border_reopened_tracker = false } @@ -5156,8 +4765,7 @@ function vm_do_add_infl(space) { check_control_change(space) // Check Austria Hungary Border Reopened is true and condition has been met - if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { - //console.log('in award extra op') + if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { game.vm_available_ops ++ log('+1 Op from C58') game.austria_hungary_border_reopened_tracker = false @@ -5172,7 +4780,7 @@ function vm_do_add_infl(space) { if (game.active === DEM) { //Check Genscher and AHBR - if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { + if (game.persistent_events.includes(C_GENSCHER) || (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker)) { game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) } else { game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) @@ -5190,8 +4798,6 @@ function vm_do_add_infl(space) { function vm_do_add_infl_free(space) { push_undo() - //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${space}.`) // Update influence values @@ -5203,9 +4809,6 @@ function vm_do_add_infl_free(space) { game.vm_available_ops-- // Check whether spaces are controlled check_control_change(space) - - - //console.log('game pieces:', game.pieces[space]) } function vm_add_infl() { @@ -5246,8 +4849,6 @@ function vm_add_limited_infl() { function vm_do_add_limited_infl(space, max_infl) { push_undo() - //log(`Added 1 influence in %${space}.`) - log_summary(`Added £ SP in %${space}.`) game.vm_available_ops -- @@ -5267,8 +4868,6 @@ function vm_do_add_limited_infl(space, max_infl) { game.vm_influence_added[space] ++ - //console.log('valid_spaces before update', game.valid_spaces) - //console.log('influence added:', game.vm_influence_added[space], 'max infl', max_infl) if (game.vm_influence_added[space] === max_infl) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } @@ -5299,7 +4898,6 @@ function vm_remove_x_opp_infl() { function vm_do_remove_infl(space) { push_undo() - //log(`Removed 1 influence from %${space}.`) log_summary(`Removed £ SP from %${space}.`) if (!game.vm_influence_added) { @@ -5519,9 +5117,6 @@ function vm_adamec() { function vm_army_backs_revolution() { 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() } @@ -5529,15 +5124,13 @@ function vm_austria_hungary_border_reopened() { game.persistent_events.push(58) permanently_remove(58) game.austria_hungary_border_reopened_tracker = false - //game.table_cards.push(58) - //remove_from_discard(58) vm_next() } function vm_betrayal() { - if (game.demInfl[58] > 0 ) { game.valid_spaces.push(58) } - if (game.demInfl[65] >0 ) { game.valid_spaces.push(65) } - game.vm_available_ops = Math.max(game.demInfl[58], game.demInfl[65]) + if (game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] > 0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_ROMANIA) } + if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] >0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_BULGARIA) } + game.vm_available_ops = Math.max(game.demInfl[S_ORTHODOX_CHURCH_ROMANIA], game.demInfl[S_ORTHODOX_CHURCH_BULGARIA]) game.state = 'vm_switch_infl' } @@ -5559,7 +5152,6 @@ function vm_brought_in_for_questioning() { if (game.active === COM) { game.active = DEM } - //game.return = game.active game.phase = 0 game.state = 'vm_brought_in_for_questioning' } @@ -5586,7 +5178,6 @@ function vm_ceausescu() { 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 game.state = 'vm_remove_infl' } @@ -5615,15 +5206,14 @@ function vm_civic_forum() { function vm_common_european_home() { let valid_cards = []; for (let c of cards) { - //if (c === null) {continue} if (game.active === DEM) { if (c && c.side === 'C') { - valid_cards.push(c.number) + valid_cards.push(c.number) } } else { - if (c && c.side === 'D') { - valid_cards.push(c.number) - } + if (c && c.side === 'D') { + valid_cards.push(c.number) + } } } game.valid_cards = valid_cards @@ -5678,9 +5268,8 @@ function vm_elena(){ function vm_eliminate(space_id) { log(`Eliminated %${space_id}`) - const adjacent_spaces = spaces[space_id].adjacent.filter(Number.isInteger); - // Eliminate the democrat influence and move the communist influence to Bucuresti +// 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 @@ -5701,24 +5290,17 @@ function vm_eliminate(space_id) { function get_adjusted_adjacency(space_id) { let adjacent_spaces = spaces[space_id].adjacent; if (adjacent_spaces.includes(game.systematization)) { - //console.log('in get adjusted adjacency, systemization',game.systematization) - //console.log('adjacent_spaces', adjacent_spaces) } if (game.systematization !== 0) { - //console.log('in systematization check') let eliminated_space_id = game.systematization; return adjacent_spaces.map(adj_space_id => { if (adj_space_id === eliminated_space_id) { - // Replace the eliminated space with its adjacencies - //console.log('in map check, return', spaces[eliminated_space_id].adjacent) return spaces[eliminated_space_id].adjacent; } - //console.log('2nd check, return', adj_space_id) return adj_space_id; }).flat(); // Flatten in case the eliminated space has multiple adjacencies } - //console.log('final adjacent spaces', adjacent_spaces) return adjacent_spaces; } @@ -5732,8 +5314,6 @@ function vm_foreign_currency_debt_burden() { if (check_vp()) { return } - //game.table_cards.push(49) - //remove_from_discard(49) game.persistent_events.push(49) game.state = 'vm_foreign_currency_debt_burden' } @@ -5780,7 +5360,7 @@ function vm_goodbye_lenin() { game.communist_hand_red.push(card) } } - //Check if these cards are playabl + //Check if these cards are playable for (let card of game.communist_hand_red) { if (cards[card].playable || game.playable_cards.includes(card)) { game.valid_cards.push(card) @@ -5803,8 +5383,6 @@ function vm_government_resigns() { function vm_grenztruppen() { game.persistent_events.push(59) permanently_remove(59) - //game.table_cards.push(59) - //remove_from_discard(59) vm_next() } @@ -5901,8 +5479,6 @@ function vm_kremlin_coup() { return } game.support_check_modifier = 1 - //countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] - //revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} game.temp = [] countries.forEach(country => { if (!game.revolutions[find_country_index(country)]) { @@ -5935,7 +5511,6 @@ function vm_legacy_of_1968() { function vm_li_peng() { game.persistent_events.push(53) - //game.table_cards.push(53) remove_from_discard(53) vm_next() } @@ -6018,25 +5593,9 @@ function vm_poszgay() { } function vm_power_struggle() { - //console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) game.is_pwr_struggle = true - - /* TO DELETE? - //Check if Power Struggle is because of an event - */ - - if (game.vm_event > 0) { - game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] - log_h2(`C${game.vm_event}`) - } -/* - //Otherwise set Power Struggle country normally - else { - console.log('vm_power_struggle, country set normally') - game.pwr_struggle_in = countries[scoring_cards.indexOf(game.played_card)] - log_h2(`C${game.played_card}`) - }*/ - + game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] + log_h2(`C${game.vm_event}`) //Check for Securitate if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)) { @@ -6049,8 +5608,6 @@ function vm_power_struggle() { function vm_presidential_visit() { game.persistent_events.push(65) - //game.table_cards.push(65) - //remove_from_discard(65) log_msg_gap('C65 in effect') vm_next() } @@ -6124,7 +5681,6 @@ function vm_samizdat() { function vm_securitate() { game.persistent_events.push(C_SECURITATE) permanently_remove(C_SECURITATE) - //game.table_cards.push(C_SECURITATE) vm_next() } @@ -6160,7 +5716,6 @@ function vm_stand_fast() { if (game.active === DEM) { game.stand_fast = DEM } else {game.stand_fast = COM} - //game.table_cards.push(100) vm_next() } @@ -6250,13 +5805,10 @@ function vm_the_tyrant_is_gone_prep() { function vm_tyrant_block() { 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(C_THE_WALL) - //game.strategy_removed.push(9) - //game.table_cards.push(9) log_msg_gap('C9 in effect') vm_next() } @@ -6271,7 +5823,6 @@ function vm_the_wall_must_go() { } function vm_warsaw_pact_summit() { - game.warsaw_pact_summit = true /*What does this do? */ game.state = 'vm_warsaw_pact_summit' } @@ -6555,7 +6106,6 @@ states.vm_add_x_infl = { get inactive() { return `resolve ${clean_name(cards[this_card()].name)}: add Support Points.` }, -// inactive: `resolve ${cards[this_card()].name}: add influence.`, prompt () { if (game.vm_event === 101 && game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: the Romanian Elite space no longer exists.` @@ -6567,10 +6117,7 @@ states.vm_add_x_infl = { for (let space_id of game.valid_spaces) { gen_action_space(space_id) } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') - }*/ + } }, space(space) { push_undo() @@ -6602,10 +6149,7 @@ states.vm_add_limited_infl = { for (let space_id of game.valid_spaces) { gen_action_space(space_id); } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` - gen_action('done') - }*/ + } }, space(space) { vm_do_add_limited_infl(space, game.vm_max_infl) @@ -6619,15 +6163,6 @@ states.vm_add_limited_infl = { vm_next() } }, - /*done () { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - game.vm_event_done = true - vm_next() - }*/ } states.vm_remove_infl = { @@ -6693,30 +6228,14 @@ states.vm_remove_x_infl = { for (let space_id of game.valid_spaces) { gen_action_space(space_id); } - } /*else { - if (game.vm_infl_to_do) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` - gen_action('done') - return - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - }*/ + } }, space(space) { vm_do_remove_x_infl(space) - /*if (game.vm_event === 68) { - vm_next() - return - }*/ if (game.vm_available_ops === 0) { game.vm_event_done = true vm_next() } - /*game.vm_event_done = true - vm_next()*/ }, done () { game.vm_event_done = true @@ -6736,17 +6255,7 @@ states.vm_remove_limited_infl = { } 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 { - if (game.vm_infl_to_do) { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done. Return control to phasing player.` - gen_action('done') - return - } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - return - } - }*/ + } }, space(space) { vm_do_remove_limited_infl(space, game.vm_max_infl) @@ -6780,10 +6289,7 @@ states.vm_remove_all_infl = { for (let space_id of game.valid_spaces) { gen_action_space(space_id); } - } /*else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` - gen_action('done') - }*/ + } }, space(space) { vm_do_remove_all_infl(space) @@ -6801,17 +6307,11 @@ states.vm_remove_all_infl = { states.vm_support_check_prep = { inactive: 'do support checks.', prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` - gen_action('done') - } else */ if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') } else { - //if (game.vm_available_ops > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` - //} + view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_space(space_id); @@ -6831,15 +6331,13 @@ 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(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { + 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(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.active === DEM) { game.state = 'vm_austria_hungary_border_reopened_check' return } - //game.state = 'do_support_check' - } /*else { */ + } } game.state = 'vm_do_support_check' }, @@ -6853,11 +6351,6 @@ states.vm_support_check_prep = { states.vm_ceh_support_check_prep = { inactive: 'do support checks.', prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('done') - return - }*/ if (game.vm_available_ops > 0) { view.prompt = `Select a space. ${pluralize(game.vm_available_ops, 'support check')} remaining.` @@ -6871,7 +6364,6 @@ states.vm_ceh_support_check_prep = { game.selected_space = space //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(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { if (game.active === DEM && game.vm_available_ops > 1) { @@ -6879,14 +6371,10 @@ states.vm_ceh_support_check_prep = { game.state = 'vm_austria_hungary_border_reopened_check' return } - //game.state = 'do_support_check' - } /*else { */ + } } game.state = 'vm_ceh_do_support_check' }, - /*done () { - vm_next () - }*/ } @@ -6930,10 +6418,7 @@ states.vm_austria_hungary_border_reopened_check = { states.vm_1_support_check_prep = { inactive: 'do support checks.', prompt () { - /*if (game.vm_available_ops === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}. Support check: done.` - gen_action('done') - } else */if (game.valid_spaces.length === 0) { + if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') } else { @@ -6981,11 +6466,6 @@ states.vm_do_support_check = { states.vm_tiananmen_square_attempt = { inactive: 'do Tiananmen Square', prompt () { - /*if (game.active === DEM && game.dem_tst_attempted_this_turn > 0 || game.active === COM && game.com_tst_attempted_this_turn > 0) { - view.prompt = 'Tiananmen Square Track attempt: done.' - gen_action('done') - return - }*/ view.prompt = 'Tiananmen Square: roll a die' gen_action('roll') }, @@ -6993,9 +6473,6 @@ states.vm_tiananmen_square_attempt = { clear_undo() do_tst_attempt () }, - /*done () { - vm_next() - }*/ } //================================== EVENT SPECIFIC STATES ====================================== @@ -7032,10 +6509,6 @@ states.vm_adamec = { states.vm_brought_in_for_questioning = { inactive: 'discard a card.', prompt() { - /*if (game.phase === 1) { - view.prompt = 'Discard a card: done.' - gen_action('done') - } else */ if (game.democrat_hand.length === 0) { view.prompt = 'Brought in for Questioning. No cards to discard.' gen_action('pass') @@ -7049,7 +6522,6 @@ states.vm_brought_in_for_questioning = { game.vm_event = discard_card(game.democrat_hand) game.phase = 1 if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { - //game.return = game.active if (!game.vm_infl_to_do) { if(game.round_player === DEM) { game.return = COM @@ -7070,9 +6542,6 @@ states.vm_brought_in_for_questioning = { log('No cards to discard') vm_return() }, - /*done() { - vm_return() - }*/ } states.vm_central_committee_reshuffle = { @@ -7093,7 +6562,7 @@ states.vm_central_committee_reshuffle = { if (!game.revolutions[5]) {gen_action('romania')} } }, - east_germany() { /*Updated for zero index spaces*/ + east_germany() { push_undo() game.vm_active_country = "East_Germany" log(`Chose ${country_name(game.vm_active_country)}`) @@ -7155,7 +6624,6 @@ states.vm_common_european_home_choose = { }, card(card) { push_undo() - //log(`Played with C${cards[card].number}`) game.valid_cards = [] silent_discard(card) game.vm_event = card @@ -7174,9 +6642,6 @@ states.vm_common_european_home_play = { 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) { - gen_action('tst') - } */ }, influence(){ push_undo() @@ -7208,13 +6673,8 @@ states.vm_dash_for_the_west = { return `resolve ${clean_name(cards[C_DASH_FOR_THE_WEST].name)}.` }, prompt() { - /* if (game.phase === 1) {*/ - view.prompt = 'Dash for the West: roll a die' - gen_action('roll') - /*} else { - view.prompt = 'Dash for the West: roll a die. Done.' - gen_action('done') - }*/ + view.prompt = 'Dash for the West: roll a die' + gen_action('roll') }, roll() { clear_undo() @@ -7233,13 +6693,9 @@ states.vm_dash_for_the_west = { game.state = 'vm_play_event_from_discard' } else { log(`Fail: more than a ${com_control} required`) - //game.phase++ vm_next() } - },/* - done() { - vm_next() - }*/ + }, } states.vm_play_event_from_discard = { @@ -7256,10 +6712,7 @@ states.vm_play_event_from_discard = { gen_action('pass') gen_action_card(card) } - } /*else { - view.prompt = 'Choose a card: done.' - gen_action('done') - }*/ + } }, card(card) { push_undo() @@ -7267,7 +6720,6 @@ states.vm_play_event_from_discard = { game.vm_event = card game.vm_available_ops = cards[card].ops game.discard = false - //game.return = game.active Does turning this off cause problems? if (switch_events.includes(card)) {next_player()} goto_vm(card) }, @@ -7280,11 +6732,6 @@ states.vm_play_event_from_discard = { } vm_next() }, -/* done(){ - push_undo() - game.discard = false - vm_next() - }*/ } states.vm_deutsche_marks_prep = { @@ -7305,7 +6752,6 @@ states.vm_deutsche_marks_prep = { log(`Gave C${cards[card].number}`) game.valid_cards = [] silent_discard(card) - //next_player() game.state = 'vm_deutsche_marks_confirm' game.vm_event = card }, @@ -7360,12 +6806,6 @@ states.vm_deutsche_marks = { push_undo() log(`Played C${cards[game.vm_event].number} to place SPs`) game.vm_available_ops = get_card_ops(game.vm_event) - - /*cards[game.vm_event].ops - if (game.persistent_events.includes(25)) {game.vm_available_ops++ } - if (game.prudence.COM && game.prudence.COM < 0 ) { - game.vm_available_ops += game.prudence.COM - }*/ valid_spaces_infl() game.state = 'vm_add_infl' }, @@ -7421,10 +6861,7 @@ states.vm_exit_visas_finish = { if (game.temp > 0 ) { view.prompt = 'Exit Visas: draw replacement cards.' gen_action('draw') - } /*else { - view.prompt = 'Exit Visas. Draw cards: done.' - gen_action('done') - } */ + } }, draw() { clear_undo() @@ -7432,9 +6869,6 @@ states.vm_exit_visas_finish = { game.temp = 0 vm_next() }, - /*done() { - vm_next() - }*/ } states.vm_foreign_currency_debt_burden = { @@ -7566,10 +7000,7 @@ states.vm_honecker = { gen_action_card(card) gen_action('pass') } - } /*else { - view.prompt = 'Honecker. Choose a card: done.' - gen_action('done') - }*/ + } }, card(card) { push_undo() @@ -7586,14 +7017,6 @@ states.vm_honecker = { game.discard = false vm_next() }, - /*done(){ - if (game.temp === 0) { - log('Did not take a card') - } - game.discard = false - vm_next() - } */ - } states.vm_inflationary_currency = { @@ -7679,10 +7102,7 @@ states.vm_inflationary_currency_discard = { for (let card of game.valid_cards) { gen_action_card(card) } - } /*else { - view.prompt = 'Inflationary Currency. Discard a card: done.' - gen_action('done') - } */ + } }, card(card) { push_undo() @@ -7703,7 +7123,6 @@ states.vm_inflationary_currency_discard = { next_player() game.vm_available_ops = 1 vm_next() - //game.state = 'vm_support_check_prep' }, done() { if (!game.vm_infl_to_do) { @@ -7764,10 +7183,6 @@ states.vm_kiss_of_death_finish = { } }, event() { - //game.return = game.active - // Remove game.vm_event from the discard - //game.strategy_discard = game.strategy_discard.filter(n => n !== game.vm_event) - goto_vm(game.vm_event) }, done() { @@ -7891,7 +7306,6 @@ states.vm_kremlin_coup_sc_prep = { space(game.selected_space); }, space(space) { - //game.selected_space = space push_undo() game.state = 'vm_kremlin_coup_sc' } @@ -7909,25 +7323,11 @@ states.vm_kremlin_coup_sc = { if (game.temp.length > 0 ){ game.state = 'vm_kremlin_coup_choose_country' } else { - //game.state = 'vm_kremlin_coup_end' vm_next() } } } -/* -states.vm_kremlin_coup_end = { - get inactive() { - return `resolve ${clean_name(cards[this_card()].name)}.` - }, - prompt() { - view.prompt = `${clean_name(cards[this_card()].name)} Support checks: done.` - gen_action('done') - }, - done() { - vm_next() - } -} -*/ + states.vm_laszlo_tokes = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -7944,12 +7344,10 @@ states.vm_laszlo_tokes = { game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') game.phase = 3 vm_next() - //game.state = 'vm_add_infl' }, support_check() { push_undo() game.vm_available_ops = 2 - //game.state = 'vm_support_check_prep' valid_spaces_sc() game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === 'Romania') vm_next() @@ -7965,15 +7363,11 @@ states.vm_switch_infl = { view.prompt = `${clean_name(cards[this_card()].name)}: No SPs to remove.` gen_action('pass') } else { - /*if (game.vm_available_ops > 0 ) {*/ view.prompt = `${clean_name(cards[game.played_card].name)}: ${event_prompt()}.` for (let space_id of game.valid_spaces) { gen_action_space(space_id); } - } /*else { - view.prompt = 'Influence replaced.' - gen_action('done') - }*/ + } }, space(space) { push_undo() @@ -7986,9 +7380,6 @@ states.vm_switch_infl = { pass() { vm_next() } - /*done() { - vm_next() - }*/ } states.vm_malta_summit = { @@ -7996,14 +7387,9 @@ states.vm_malta_summit = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - /*if (game.phase === 1) {*/ - view.prompt = 'Malta Summit: roll a die.' - gen_action('roll') - /*} else { - view.prompt = 'Done.' - gen_action('done') - }*/ - }, + view.prompt = 'Malta Summit: roll a die.' + gen_action('roll') +}, roll() { clear_undo() let roll = roll_d6() @@ -8025,19 +7411,14 @@ states.vm_malta_summit = { 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() } else { log('Summit failed. Required 4 or more') - //game.phase++ vm_goto_step(vm_permanently_remove) } }, - /*done() { - vm_next() - }*/ } states.vm_modrow = { @@ -8070,13 +7451,8 @@ states.vm_nepotism = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - //if (game.phase === 1 ) { - view.prompt = 'Nepotism: roll a die.' - gen_action('roll') - /*} else { - view.prompt = 'Roll a die: done.' - gen_action('done') - }*/ + view.prompt = 'Nepotism: roll a die.' + gen_action('roll') }, roll() { clear_undo() @@ -8090,12 +7466,9 @@ states.vm_nepotism = { else { log(`Roll: D${roll} adds 1 SP`) game.vm_available_ops = 1} - //game.phase = 2 + vm_next() }, - /*done() { - vm_next() - }*/ } states.vm_new_years_eve_party = { @@ -8122,7 +7495,6 @@ states.vm_new_years_eve_party = { if (check_vp()) { return } - //game.table_cards.push(104) permanently_remove(C_NEW_YEARS_EVE_PARTY) vm_next() }, @@ -8206,15 +7578,10 @@ states.vm_nomenklatura_add = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - 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.` - for (let space_id of game.valid_spaces) { - gen_action_space(space_id); - } - //} + view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.` + for (let space_id of game.valid_spaces) { + gen_action_space(space_id); + } }, space(space) { push_undo() @@ -8228,14 +7595,6 @@ states.vm_nomenklatura_add = { vm_next() } }, -/* done() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }*/ } states.vm_samizdat = { @@ -8258,11 +7617,8 @@ states.vm_samizdat = { }, pass() { push_undo() - //if (game.samizdat_card > 0) {game.state = 'vm_samizdat_finish'} - /*else { */ log('Did not set aside a card') vm_next() - //} } } @@ -8271,23 +7627,14 @@ states.vm_samizdat_finish = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - /*if (game.phase ) { - view.prompt = 'Samizdat: done.' - gen_action('done') - } else {*/ - view.prompt = 'Draw a replacement card.' - gen_action('draw') - //} + view.prompt = 'Draw a replacement card.' + gen_action('draw') }, draw() { clear_undo() game.democrat_hand.push(draw_card(game.strategy_deck)) vm_next() - //game.phase ++ }, - /*done() { - vm_next() - }*/ } states.vm_shock_therapy = { @@ -8307,10 +7654,7 @@ states.vm_shock_therapy = { if (game.revolutions[3]) {gen_action('bulgaria')} if (game.revolutions[4]) {gen_action('czechoslovakia')} if (game.revolutions[5]) {gen_action('romania')} - } /*else if (game.phase === 2) { - view.prompt = 'Shock Therapy: done.' - gen_action('done') - } */ + } else { view.prompt = 'Shock Therapy: roll a die.' gen_action('roll') @@ -8364,7 +7708,6 @@ states.vm_shock_therapy = { vm_next() } else { log('C93 is unsuccessful. Required 3 or more') - //game.phase++ permanently_remove(93) vm_return() } @@ -8373,10 +7716,6 @@ states.vm_shock_therapy = { log('Passed') vm_return() } - /*done() { - permanently_remove(93) - vm_return() - }*/ } states.vm_social_democratic_platform_adopted = { @@ -8442,15 +7781,10 @@ states.vm_systematization = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - /*if (game.systematization === 0) { */ - view.prompt = 'Systematization: eliminate a space in Romania.' - for (let space_id of game.valid_spaces) { - gen_action_space(space_id); - } - /*} else { - view.prompt = 'Systematization: done.' - gen_action('done') - }*/ + view.prompt = 'Systematization: eliminate a space in Romania.' + for (let space_id of game.valid_spaces) { + gen_action_space(space_id); + } }, space(space) { push_undo() @@ -8460,9 +7794,6 @@ states.vm_systematization = { game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED?*/ vm_next() }, -/* done() { - vm_next() - } */ } states.vm_the_chinese_solution = { @@ -8574,41 +7905,19 @@ states.vm_the_tyrant_is_gone = { game.the_tyrant_is_gone = space game.valid_spaces = [] game.persistent_events.push(C_THE_TYRANT_IS_GONE) - - // vm_next() }, done () { vm_next() } } -/* -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!" Rolls: done.' - gen_action('done') - } else { */ - view.prompt = ('The Wall Must Go! Roll a die.') - gen_action('roll') - //} + view.prompt = ('The Wall Must Go! Roll a die.') + gen_action('roll') }, roll() { clear_undo() @@ -8667,35 +7976,6 @@ states.vm_the_wall_must_go = { game.the_wall_must_go['com_roll'] = 0 } }, - /*done() { - if (game.the_wall_must_go['dem_wins'] === 2) { - game.persistent_events.push(86) - log('+3 VP') - game.vp += 3 - if (check_vp()) { - return - } - for (let i = 0; i < spaces.length; i++) { - let space = spaces[i] - if (space.country === 'East_Germany' && game.comInfl[i] > 0){ - game.valid_spaces.push(space.space_id) - } - } - if (!game.vm_infl_to_do) { - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - if (game.active === DEM) {next_player()} - vm_next () - } else { - permanently_remove(86) - delete game.the_wall_must_go - vm_return() - } - }*/ } states.vm_warsaw_pact_summit = { @@ -8717,7 +7997,6 @@ states.vm_warsaw_pact_summit = { } game.vm_available_ops = 4 game.phase = 3 - //game.state = 'vm_add_infl' vm_next() }, support_check(){ @@ -8729,7 +8008,6 @@ states.vm_warsaw_pact_summit = { } } game.vm_available_ops = 2 - //game.state = 'vm_support_check_prep' vm_next() } } @@ -8775,12 +8053,6 @@ states.vm_we_are_the_people_add = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - /* if (!game.vm_influence_added[6]) { - view.prompt = '"We are the People!" Add SPs: done.' - gen_action('done') - return - }*/ - 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); @@ -8798,14 +8070,6 @@ states.vm_we_are_the_people_add = { vm_next() } }, - /*done() { - push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }*/ } states.vm_workers_revolt = { @@ -8841,14 +8105,8 @@ states.vm_workers_revolt_finish = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - //if (game.selected_space > 0) { - view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - /* } else { - view.prompt = 'Workers Revolt: done.' - gen_action('done') - }*/ - + view.prompt = `Target: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') }, roll() { clear_undo() @@ -8870,11 +8128,8 @@ states.vm_workers_revolt_finish = { game.selected_space = 0 vm_next() }, - /*done() { - vm_next() - }*/ -} +} // ==================== TIANANMEN SQUARE TRACK STATES ===================== states.vm_tst_3_prep = { @@ -8906,10 +8161,7 @@ states.vm_tst_3 = { for (let card of game.valid_cards) { gen_action_card(card) } - } /*else { - view.prompt = 'Discard cards: done.' - gen_action('done') - }*/ + } }, card(card) { push_undo() @@ -8920,9 +8172,6 @@ states.vm_tst_3 = { vm_next() } }, - /*done() { - vm_next() - }*/ } states.vm_tst_4 = { @@ -8961,18 +8210,12 @@ states.vm_tst_4 = { states.vm_tst_6 = { inactive: 'make their free support check.', prompt() { - /* if (game.vm_available_ops === 0) { - view.prompt = 'Tiananmen Square Track award support check: done.' - gen_action('done') - return - } else {*/ - view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' - for (let space_id of game.valid_spaces) { - if (space_id) { - gen_action_space(space_id); - } + view.prompt = 'Tiananmen Square Track award: you have a free 2 Ops support check.' + for (let space_id of game.valid_spaces) { + if (space_id) { + gen_action_space(space_id); } - //} + } }, space(space) { push_undo() @@ -8982,10 +8225,6 @@ states.vm_tst_6 = { } game.state = 'vm_tst_6_sc' }, - /*done () { - push_undo() - vm_next() - }*/ } states.vm_tst_6_sc = { @@ -9123,22 +8362,13 @@ states.vm_support_surges_1 = { }, 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 after', game.dem_pwr_hand, 'game.temp', game.temp) } else { - //console.log('hand before', game.com_pwr_hand) 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.com_pwr_hand[game.com_pwr_hand.length-1] - //console.log('hand after', game.com_pwr_hand, 'game.temp', game.temp) } game.state = 'vm_support_surges_2' - - //game.phase = 0 - //log('Drew 2 cards') - //log('Surrenders initiative') - //vm_next() } } @@ -9167,10 +8397,6 @@ states.vm_support_surges_2 = { game.temp = game.com_pwr_hand[game.com_pwr_hand.length - 1] } game.state = 'vm_support_surges_3' - /*game.phase = 0 - log('Drew 2 cards') - log('Surrenders initiative') - vm_next()*/ } } -- cgit v1.2.3 From 2beb5e506e370fcda8f885360c799f2c9fe3bff9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 10:38:50 +0000 Subject: Fix Deutsche Marks --- rules.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index d29c4d3..963e78a 100644 --- a/rules.js +++ b/rules.js @@ -6768,8 +6768,10 @@ states.vm_deutsche_marks_confirm = { gen_action('done') }, done() { - if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { - goto_vm(game.vm_event) + if (cards[game.vm_event].side === "C") { + if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { + goto_vm(game.vm_event) + } } else { next_player() game.state = 'vm_deutsche_marks' -- cgit v1.2.3 From 6a60546955f4c9780b395edb0abc881106a40e86 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 10:53:00 +0000 Subject: Fix typo --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 963e78a..6902360 100644 --- a/rules.js +++ b/rules.js @@ -2701,7 +2701,7 @@ function valid_spaces_setup() { game.valid_spaces = [] let valid_spaces_set = new Set(); for (let i =0 ; i <= 74 ; i++) { - space = spaces[i] + let space = spaces[i] if (game.state === 'com_init') { infl = game.demInfl[i] -- cgit v1.2.3 From 49656491a16640952d80e0f9d312a3d80eb7a40a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 11:12:34 +0000 Subject: Fix undeclared variables --- rules.js | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/rules.js b/rules.js index 6902360..6c7c9b6 100644 --- a/rules.js +++ b/rules.js @@ -210,6 +210,8 @@ const com_tst_req = [6, 6, 7, 7, 8, 7, 6, 5] const scoring_cards = [22, 23, 42, 43, 55, 95] const C_TACTICS_FAILS = 52 const leader_cards = [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] +const rallies = [1, 2, 3, 4, 5, 6] +const petitions = [31, 32, 33, 34, 35, 36] const wildcards = [49, 50, 51, 52] const elite_leaders = [37, 38, 39, 40] const leaders = [1, 4, 5, 6, 7] @@ -322,10 +324,8 @@ function start_game() { //Set starting influence spaces.forEach((space, index) => { - if (space !== null) { game.demInfl[index] = space.demInfl game.comInfl[index] = space.comInfl - } }) //Set starting placement ops @@ -1759,13 +1759,13 @@ states.support_loss ={ let rally_win = 0 let petition_win = 0 log(`Roll: D${roll}`) - if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} + if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win // Roll modifiers - if (game.active === COM && game.persistent_events.includes(62)) { - log('+1 from C62') + if (game.active === COM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) modified_roll ++ } @@ -1845,11 +1845,11 @@ states.vp_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.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} + if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win - if (game.active === DEM && game.persistent_events.includes(62)) { - log('+1 from C62') + if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) modified_roll ++ } if (modified_roll < 0) {modified_roll = 0} @@ -2700,17 +2700,17 @@ function do_sc(space) { function valid_spaces_setup() { game.valid_spaces = [] let valid_spaces_set = new Set(); - for (let i =0 ; i <= 74 ; i++) { + for (let i =0 ; i < spaces.length ; i++) { let space = spaces[i] if (game.state === 'com_init') { - infl = game.demInfl[i] + let infl = game.demInfl[i] if (infl === 0) { valid_spaces_set.add(space.space_id); } } else if (game.state === 'dem_init') { - infl = game.comInfl[i] + let infl = game.comInfl[i] if (infl === 0) { valid_spaces_set.add(space.space_id); } @@ -2724,16 +2724,16 @@ function valid_spaces_setup() { function valid_spaces_sc() { let valid_spaces_set = new Set(); - for (let i = 0 ; i <= 74; i++) { - space = spaces[i] + for (let i = 0 ; i < spaces.length; i++) { + let space = spaces[i] if (game.active === DEM) { - infl = game.comInfl[i] + let infl = game.comInfl[i] if (infl !== 0 ) { valid_spaces_set.add(space.space_id); } } else { - infl = game.demInfl[i] + let infl = game.demInfl[i] if (infl !== 0 ) { // Check Solidarity Legalised if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} @@ -2768,14 +2768,14 @@ function valid_spaces_sc() { function valid_spaces_support_loss() { let valid_spaces_set = new Set(); for (let i = 0; i < game.demInfl.length; i++) { - space = spaces[i] + let space = spaces[i] if (game.active === DEM) { - infl = game.demInfl[i] + let infl = game.demInfl[i] if (infl > 0 && space.country === game.pwr_struggle_in) { valid_spaces_set.add(space.space_id); } } else { - infl = game.comInfl[i] + let infl = game.comInfl[i] if (infl > 0 && space.country === game.pwr_struggle_in) { valid_spaces_set.add(space.space_id); } @@ -2796,7 +2796,7 @@ function valid_spaces_infl() { // Iterate over all spaces to find the ones with the player's influence for (let i = 0; i < game.demInfl.length; i++) { //piece = game.pieces[i] - space = spaces[i] + let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; @@ -3261,7 +3261,7 @@ function permanently_remove(card) { if (game.strategy_removed.includes(card)) {return} remove_from_discard(card) - card_index = game.table_cards.indexOf(card) + let card_index = game.table_cards.indexOf(card) if (card_index !== -1) { game.table_cards.splice(card_index, 1) } @@ -4510,7 +4510,7 @@ function vm_valid_spaces_opponent () { valid_spaces.push(space.space_id) } } else { - infl = game.demInfl[i] + let infl = game.demInfl[i] if (infl > 0) { valid_spaces.push(space.space_id) } @@ -5500,7 +5500,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); @@ -7991,7 +7991,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); @@ -8003,7 +8003,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) -- cgit v1.2.3 From 955c6426061dd9e8c6653b0059b201b50e0a5bd5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 13:45:39 +0000 Subject: Fix typo --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index 014c4b7..8049f2f 100644 --- a/play.js +++ b/play.js @@ -689,7 +689,7 @@ function on_update() { ui.removed.replaceChildren() for (let c of view.strategy_removed) - ui.discard.appendChild(ui.cards[c]) + ui.removed.appendChild(ui.cards[c]) ui.table_cards.replaceChildren() if (view.table_cards) -- cgit v1.2.3 From ec35a3f7c712ccef78ff4b5aefbd6d2dd2935a9e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 13:48:15 +0000 Subject: Hide discards by default --- play.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play.html b/play.html index 795d874..50fb00d 100644 --- a/play.html +++ b/play.html @@ -132,13 +132,13 @@
    -
    +
    Permanently Removed Events
    -
    +
    Discard
    -- cgit v1.2.3 From a044d9e162b4863a0fcd420f88d00ff1e67097bb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 14:11:33 +0000 Subject: Add Army Backs Revolution to table_cards --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index 6c7c9b6..fe34bd0 100644 --- a/rules.js +++ b/rules.js @@ -5117,6 +5117,7 @@ function vm_adamec() { function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) + game.table_cards.push(C_ARMY_BACKS_REVOLUTION) vm_next() } -- cgit v1.2.3 From 50c8e4d663ed6fc61374dad9fd6d7d5e7bdaa796 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 14:55:24 +0000 Subject: Remove trailing asterix in log --- play.js | 1 + 1 file changed, 1 insertion(+) diff --git a/play.js b/play.js index 8049f2f..cf78f62 100644 --- a/play.js +++ b/play.js @@ -812,6 +812,7 @@ function on_log(text) { p.className = "h3" } + text = text.replace(/\*/g, "") p.innerHTML = text return p } -- cgit v1.2.3 From 6d04226467871e4327be2d913dcbb65b9cbff0e7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 14:56:02 +0000 Subject: Fix vm_permanently_remove --- rules.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index fe34bd0..a9fa127 100644 --- a/rules.js +++ b/rules.js @@ -855,10 +855,11 @@ states.resolve_opponent_event = { opp_event() { game.vm_event_to_do = false game.return_state = 'resolve_opponent_event' + game.vm_event = game.played_card if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { game.return = game.active log(`Played C${game.played_card} for the event`) - goto_vm(game.played_card)} + goto_vm(game.vm_event)} else { if (game.active === DEM) { game.return = COM @@ -867,7 +868,7 @@ states.resolve_opponent_event = { } next_player() log(`C${game.played_card}`) - goto_vm(game.played_card) + goto_vm(game.vm_event) } }, tst_7() { @@ -5869,6 +5870,7 @@ function vm_yakovlev_counsels_gorbachev() { function vm_permanently_remove () { // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! + console.log('game.vm_event', game.vm_event) if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { permanently_remove(game.vm_event) } -- cgit v1.2.3 From ac994f2e4e8e1db0faa0a189683030fa390a40aa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 15:03:03 +0000 Subject: Simplify vm support_check code --- rules.js | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/rules.js b/rules.js index a9fa127..7f51d2a 100644 --- a/rules.js +++ b/rules.js @@ -4610,37 +4610,14 @@ function vm_valid_spaces_country_opp () { } function vm_valid_spaces_country_sc () { - let valid_spaces = [] - let country = '' + let active_country if (vm_operand(1)) { - country = vm_operand(1) } + active_country = vm_operand(1) } else { - country = game.vm_active_country - } - for (let space of spaces) { - if (!space) continue - if (game.active === DEM) { - if (space.country === country && game.comInfl[space.space_id] >0) { - valid_spaces.push(space.space_id); - } - } else { - if (space.country === country && game.demInfl[space.space_id] >0) { - //Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === S_GDANSK) {continue} - - //Check Civic Forum - 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 === S_LEIPZIG) {continue} - valid_spaces.push(space.space_id); - - //Check Foreign Currency Debt Burden - if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} - } - } + active_country = game.vm_active_country } - game.valid_spaces = valid_spaces + valid_spaces_sc() + game.valid_spaces = game.valid_spaces.filter( s => spaces[s].country === active_country) vm_next() } @@ -5870,7 +5847,6 @@ function vm_yakovlev_counsels_gorbachev() { function vm_permanently_remove () { // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! - console.log('game.vm_event', game.vm_event) if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { permanently_remove(game.vm_event) } -- cgit v1.2.3 From c7a017fbf75a15a6870545f44c57401c8e848e0a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 15:21:16 +0000 Subject: Only remove trailing asterixes --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index cf78f62..f786be2 100644 --- a/play.js +++ b/play.js @@ -812,7 +812,7 @@ function on_log(text) { p.className = "h3" } - text = text.replace(/\*/g, "") + text = text.replace(/([a-zA-Z])\*/g, "") p.innerHTML = text return p } -- cgit v1.2.3 From 0e7691d3bb2d01e4795473e28b14cfa0420dd2bb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 10:20:58 +0100 Subject: Use card numbers directly. --- rules.js | 146 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 80 insertions(+), 66 deletions(-) diff --git a/rules.js b/rules.js index 7f51d2a..8406816 100644 --- a/rules.js +++ b/rules.js @@ -208,7 +208,6 @@ const C_MALTA_SUMMIT = 110 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 C_TACTICS_FAILS = 52 const leader_cards = [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] const rallies = [1, 2, 3, 4, 5, 6] const petitions = [31, 32, 33, 34, 35, 36] @@ -224,6 +223,8 @@ 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] +const PC_TACTICS_FAILS = 52 + // COUNTRY CONSTANTS const S_EAST_GERMANY = [0,1,2,3,4,5,6,7,8,9,10,11] @@ -319,7 +320,7 @@ function start_game() { //console.log('start game') - game.strategy_deck = draw_deck(cards) + game.strategy_deck = draw_deck() reset_power() //Set starting influence @@ -714,7 +715,7 @@ states.play_card ={ }, event() { push_undo() - log_gap(`Played C${cards[game.played_card].number} for the event`) + log_gap(`Played C${game.played_card} for the event`) game.vm_infl_to_do = false if (scoring_cards.includes(game.played_card)) {game.phase = 0} else {game.phase = 1} @@ -725,7 +726,7 @@ states.play_card ={ }, opp_event() { push_undo() - log_gap(`Played C${cards[game.played_card].number} for the event`) + log_gap(`Played C${game.played_card} for the event`) game.phase = 1 /*Do I still need this?*/ game.vm_infl_to_do = true game.return = game.active @@ -740,7 +741,7 @@ states.play_card ={ }, influence() { push_undo() - log_gap(`Played C${cards[game.played_card].number} to place SPs`) + log_gap(`Played C${game.played_card} to place SPs`) // Check if Common European Home played for influence @@ -776,12 +777,12 @@ states.play_card ={ }, tst() { push_undo() - log_gap(`Played C${cards[game.played_card].number} to the Tiananmen Square Track`) + log_gap(`Played C${game.played_card} to the Tiananmen Square Track`) game.state='tiananmen_square_attempt' }, support_check() { push_undo() - log_gap(`Played C${cards[game.played_card].number} for support checks`) + log_gap(`Played C${game.played_card} for support checks`) // Check if card is opponent card with event that needs to be resolved @@ -1599,7 +1600,7 @@ states.power_struggle = { game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} if (card === 52) { - log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) + log_gap(`Played P52: P${game.played_power_card} no longer playable`) } else { if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ @@ -1675,28 +1676,28 @@ states.power_struggle = { game.state = 'support_loss' }, strike () { - log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) + log(`Played: P${game.played_power_card} as a Strike`) game.proxy_power_card = 'Strike' game.phase = 1 next_player() do_valid_cards() }, march () { - log(`Played: P${power_cards[game.played_power_card].number} as a March`) + log(`Played: P${game.played_power_card} as a March`) game.proxy_power_card = 'March' game.phase = 1 next_player() do_valid_cards() }, rally () { - log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) + log(`Played: P${game.played_power_card} as a Rally in the Square`) game.proxy_power_card = 'Rally in the Square' game.phase = 1 next_player() do_valid_cards() }, petition () { - log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) + log(`Played: P${game.played_power_card} as a Petition`) game.proxy_power_card = 'Petition' game.phase = 1 next_player() @@ -2169,7 +2170,7 @@ states.general_strike = { game.return_state = 'general_strike' goto_vm(game.vm_event) } else { - log(`Discarded C${cards[card].number}`) + log(`Discarded C${card}`) } }, roll() { @@ -2310,7 +2311,7 @@ states.stasi_end_round = { }, card(card) { push_undo() - log_gap(`Democrat selected C${cards[card].number} as next card.`) + log_gap(`Democrat selected C${card} as next card.`) game.stasi_card = card game.state = 'stasi_finish' }, @@ -2835,34 +2836,41 @@ function valid_spaces_infl() { } function valid_cards(player_hand, presence) { - const valid_cards_set= new Set(); + const valid_cards_set = new Set() if (game.phase === 0) { - for (let c of player_hand) { - let card = power_cards.find(card => card && card.number === c); - if (card.number === C_TACTICS_FAILS) {continue} // Never add tactics fails - if (card.name === game.tactics_fails) {continue} //Cannot play the suit of Tactics Fails - if (card.socio === 0) { - valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { - valid_cards_set.add(card.number); - } - } + for (let c of player_hand) { + let card = power_cards[c] + if (c === PC_TACTICS_FAILS) { + continue + } + // Never add tactics fails + if (card.name === game.tactics_fails) { + continue + } + // Cannot play the suit of Tactics Fails + if (card.socio === 0) { + valid_cards_set.add(c) + } else if (leaders.includes(card.socio) && presence[card.socio]) { + valid_cards_set.add(c) + } + } } else if (game.phase === 1) { - for (let c of player_hand) { - let card = power_cards.find(card => card && card.number === c); - console.log('card', card, ) - if (card.name === power_cards[game.played_power_card].name) { - valid_cards_set.add(card.number); - } else if (card.name === game.proxy_power_card) { - valid_cards_set.add(card.number) - } - else if (leaders.includes(card.socio) && presence[card.socio]) { - valid_cards_set.add(card.number); - } else if (card.number === 52) {valid_cards_set.add(card.number)} - } - } - game.valid_cards = Array.from(valid_cards_set); - return game.valid_cards; + for (let c of player_hand) { + let card = power_cards[c] + console.log("card", card) + if (card.name === power_cards[game.played_power_card].name) { + valid_cards_set.add(c) + } else if (card.name === game.proxy_power_card) { + valid_cards_set.add(c) + } else if (leaders.includes(card.socio) && presence[card.socio]) { + valid_cards_set.add(c) + } else if (c === PC_TACTICS_FAILS) { + valid_cards_set.add(c) + } + } + } + game.valid_cards = Array.from(valid_cards_set) + return game.valid_cards } function do_valid_cards() { @@ -3900,8 +3908,12 @@ function find_country_index(country) { return countries.indexOf(country) } -function draw_deck(deck) { - return deck.filter(card => card && card.period === 1).map(card => card.number) +function draw_deck() { + let hand = [] + for (let c = first_strategy_card; c <= last_strategy_card; ++c) + if (cards[c].period === 1) + hand.push(c) + return c } function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { @@ -3957,7 +3969,7 @@ function discard(card) { } if (!game.strategy_discard.includes(card)) { game.strategy_discard.push(card) - log(`Discarded C${cards[card].number}`) + log(`Discarded C${card}`) } } else if (game.is_pwr_struggle) { if (game.active === COM) { @@ -4013,7 +4025,7 @@ function discard_card(hand) { log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) } } else { - log(`Discarded C${cards[discarded_card].number}`) + log(`Discarded C${discarded_card}`) game.strategy_discard.push(discarded_card) } return discarded_card @@ -4027,15 +4039,17 @@ function discard_from_table(card) { function add_midyear() { - const mid_year = cards.filter(card => card && card.period === 2).map(card => card.number); - game.strategy_deck.push(...mid_year); + for (let c = first_strategy_card; c <= last_strategy_card; ++c) + if (cards[c].period === 2) + game.strategy_deck.push(c) log_h3('Mid-year cards added to draw deck') } function add_lateyear() { - const late_year = cards.filter(card => card && card.period === 3).map(card => card.number) - game.strategy_deck.push(...late_year) + for (let c = first_strategy_card; c <= last_strategy_card; ++c) + if (cards[c].period === 3) + game.strategy_deck.push(c) log_h3('Late-year cards added to draw deck') } @@ -5183,20 +5197,20 @@ function vm_civic_forum() { } function vm_common_european_home() { - let valid_cards = []; - for (let c of cards) { + let valid_cards = [] + for (let c = first_strategy_card; c <= last_strategy_card; ++c) { if (game.active === DEM) { - if (c && c.side === 'C') { - valid_cards.push(c.number) - } + if (cards[c].side === 'C') { + valid_cards.push(c) + } } else { - if (c && c.side === 'D') { - valid_cards.push(c.number) + if (cards[c].side === 'D') { + valid_cards.push(c) } } } game.valid_cards = valid_cards - game.state = 'vm_common_european_home_choose' + game.state = "vm_common_european_home_choose" } function vm_dash_for_the_west() { @@ -6624,7 +6638,7 @@ states.vm_common_european_home_play = { }, influence(){ push_undo() - log_gap(`Played C${cards[game.vm_event].number} to place SPs`) + log_gap(`Played C${game.vm_event} to place SPs`) game.vm_available_ops = cards[game.vm_event].ops valid_spaces_infl() // If ABHR - Set AHBR tracker to true @@ -6635,14 +6649,14 @@ states.vm_common_european_home_play = { }, support_check() { push_undo() - log_gap(`Played C${cards[game.vm_event].number} for support checks`) + log_gap(`Played C${game.vm_event} for support checks`) game.vm_available_ops = 2 game.state = 'vm_ceh_support_check_prep' valid_spaces_sc() }, tst() { push_undo() - log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) + log_gap(`Played C${game.vm_event} to the Tiananmen Square Track`) game.state = 'vm_tiananmen_square_attempt' } } @@ -6695,7 +6709,7 @@ states.vm_play_event_from_discard = { }, card(card) { push_undo() - log(`Chose C${cards[card].number}`) + log(`Chose C${card}`) game.vm_event = card game.vm_available_ops = cards[card].ops game.discard = false @@ -6728,7 +6742,7 @@ states.vm_deutsche_marks_prep = { }, card(card) { push_undo() - log(`Gave C${cards[card].number}`) + log(`Gave C${card}`) game.valid_cards = [] silent_discard(card) game.state = 'vm_deutsche_marks_confirm' @@ -6777,7 +6791,7 @@ states.vm_deutsche_marks = { }, event() { push_undo() - log(`Played C${cards[game.vm_event].number} for the event`) + log(`Played C${game.vm_event} for the event`) if (!game.vm_infl_to_do) { game.return = game.active } @@ -6785,21 +6799,21 @@ states.vm_deutsche_marks = { }, influence() { push_undo() - log(`Played C${cards[game.vm_event].number} to place SPs`) + log(`Played C${game.vm_event} to place SPs`) game.vm_available_ops = get_card_ops(game.vm_event) valid_spaces_infl() game.state = 'vm_add_infl' }, support_check() { push_undo() - log_gap(`Played C${cards[game.vm_event].number} for support checks`) + log_gap(`Played C${game.vm_event} for support checks`) game.vm_available_ops = 2 game.state='vm_support_check_prep' valid_spaces_sc() }, tst() { push_undo() - log_gap(`Played C${cards[game.vm_event].number} to the Tiananmen Square Track`) + log_gap(`Played C${game.vm_event} to the Tiananmen Square Track`) game.state='vm_tiananmen_square_attempt' } } @@ -6986,7 +7000,7 @@ states.vm_honecker = { card(card) { push_undo() game.valid_cards = [] - log(`Took C${cards[card].number} into hand`) + log(`Took C${card} into hand`) game.temp = card let card_index = game.strategy_discard.indexOf(card) game.strategy_discard.splice(card_index, 1) -- cgit v1.2.3 From 4b0adc2ac27e905913e5c3a2f08ebf3d80f20d82 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 10:24:56 +0100 Subject: ASSETS power cards without numbers avif insteaf of jpeg/webp map75, cards100 avif default map150, carsd200 avif --min 15 --max 63 --- 1989_card_back_ps.gif | Bin 42223 -> 0 bytes cards100/event_1.avif | Bin 0 -> 10374 bytes cards100/event_1.webp | Bin 12636 -> 0 bytes cards100/event_10.avif | Bin 0 -> 10493 bytes cards100/event_10.webp | Bin 13494 -> 0 bytes cards100/event_100.avif | Bin 0 -> 12763 bytes cards100/event_100.webp | Bin 15370 -> 0 bytes cards100/event_101.avif | Bin 0 -> 11372 bytes cards100/event_101.webp | Bin 14638 -> 0 bytes cards100/event_102.avif | Bin 0 -> 13714 bytes cards100/event_102.webp | Bin 18222 -> 0 bytes cards100/event_103.avif | Bin 0 -> 11124 bytes cards100/event_103.webp | Bin 13502 -> 0 bytes cards100/event_104.avif | Bin 0 -> 17294 bytes cards100/event_104.webp | Bin 22266 -> 0 bytes cards100/event_105.avif | Bin 0 -> 12115 bytes cards100/event_105.webp | Bin 13408 -> 0 bytes cards100/event_106.avif | Bin 0 -> 12027 bytes cards100/event_106.webp | Bin 15728 -> 0 bytes cards100/event_107.avif | Bin 0 -> 18057 bytes cards100/event_107.webp | Bin 21704 -> 0 bytes cards100/event_108.avif | Bin 0 -> 10231 bytes cards100/event_108.webp | Bin 12730 -> 0 bytes cards100/event_109.avif | Bin 0 -> 15704 bytes cards100/event_109.webp | Bin 19910 -> 0 bytes cards100/event_11.avif | Bin 0 -> 9353 bytes cards100/event_11.webp | Bin 11164 -> 0 bytes cards100/event_110.avif | Bin 0 -> 12565 bytes cards100/event_110.webp | Bin 16400 -> 0 bytes cards100/event_12.avif | Bin 0 -> 9706 bytes cards100/event_12.webp | Bin 11730 -> 0 bytes cards100/event_13.avif | Bin 0 -> 9560 bytes cards100/event_13.webp | Bin 11840 -> 0 bytes cards100/event_14.avif | Bin 0 -> 11441 bytes cards100/event_14.webp | Bin 15016 -> 0 bytes cards100/event_15.avif | Bin 0 -> 11925 bytes cards100/event_15.webp | Bin 15512 -> 0 bytes cards100/event_16.avif | Bin 0 -> 15725 bytes cards100/event_16.webp | Bin 18432 -> 0 bytes cards100/event_17.avif | Bin 0 -> 17878 bytes cards100/event_17.webp | Bin 21604 -> 0 bytes cards100/event_18.avif | Bin 0 -> 15200 bytes cards100/event_18.webp | Bin 18034 -> 0 bytes cards100/event_19.avif | Bin 0 -> 22613 bytes cards100/event_19.webp | Bin 21442 -> 0 bytes cards100/event_2.avif | Bin 0 -> 13326 bytes cards100/event_2.webp | Bin 16970 -> 0 bytes cards100/event_20.avif | Bin 0 -> 12151 bytes cards100/event_20.webp | Bin 16270 -> 0 bytes cards100/event_21.avif | Bin 0 -> 11292 bytes cards100/event_21.webp | Bin 14340 -> 0 bytes cards100/event_22.avif | Bin 0 -> 15889 bytes cards100/event_22.webp | Bin 20670 -> 0 bytes cards100/event_23.avif | Bin 0 -> 8007 bytes cards100/event_23.webp | Bin 11554 -> 0 bytes cards100/event_24.avif | Bin 0 -> 11694 bytes cards100/event_24.webp | Bin 14884 -> 0 bytes cards100/event_25.avif | Bin 0 -> 7745 bytes cards100/event_25.webp | Bin 10078 -> 0 bytes cards100/event_26.avif | Bin 0 -> 13237 bytes cards100/event_26.webp | Bin 16412 -> 0 bytes cards100/event_27.avif | Bin 0 -> 10574 bytes cards100/event_27.webp | Bin 13336 -> 0 bytes cards100/event_28.avif | Bin 0 -> 11722 bytes cards100/event_28.webp | Bin 13738 -> 0 bytes cards100/event_29.avif | Bin 0 -> 12170 bytes cards100/event_29.webp | Bin 14200 -> 0 bytes cards100/event_3.avif | Bin 0 -> 10983 bytes cards100/event_3.webp | Bin 15042 -> 0 bytes cards100/event_30.avif | Bin 0 -> 9220 bytes cards100/event_30.webp | Bin 12188 -> 0 bytes cards100/event_31.avif | Bin 0 -> 8857 bytes cards100/event_31.webp | Bin 11286 -> 0 bytes cards100/event_32.avif | Bin 0 -> 13981 bytes cards100/event_32.webp | Bin 15700 -> 0 bytes cards100/event_33.avif | Bin 0 -> 10079 bytes cards100/event_33.webp | Bin 12710 -> 0 bytes cards100/event_34.avif | Bin 0 -> 7426 bytes cards100/event_34.webp | Bin 8704 -> 0 bytes cards100/event_35.avif | Bin 0 -> 13532 bytes cards100/event_35.webp | Bin 16288 -> 0 bytes cards100/event_36.avif | Bin 0 -> 15984 bytes cards100/event_36.webp | Bin 19860 -> 0 bytes cards100/event_37.avif | Bin 0 -> 14992 bytes cards100/event_37.webp | Bin 17518 -> 0 bytes cards100/event_38.avif | Bin 0 -> 9831 bytes cards100/event_38.webp | Bin 12192 -> 0 bytes cards100/event_39.avif | Bin 0 -> 6748 bytes cards100/event_39.webp | Bin 8782 -> 0 bytes cards100/event_4.avif | Bin 0 -> 9990 bytes cards100/event_4.webp | Bin 12420 -> 0 bytes cards100/event_40.avif | Bin 0 -> 10094 bytes cards100/event_40.webp | Bin 12514 -> 0 bytes cards100/event_41.avif | Bin 0 -> 12070 bytes cards100/event_41.webp | Bin 16286 -> 0 bytes cards100/event_42.avif | Bin 0 -> 18480 bytes cards100/event_42.webp | Bin 22484 -> 0 bytes cards100/event_43.avif | Bin 0 -> 10074 bytes cards100/event_43.webp | Bin 14034 -> 0 bytes cards100/event_44.avif | Bin 0 -> 17197 bytes cards100/event_44.webp | Bin 20892 -> 0 bytes cards100/event_45.avif | Bin 0 -> 13019 bytes cards100/event_45.webp | Bin 15918 -> 0 bytes cards100/event_46.avif | Bin 0 -> 14870 bytes cards100/event_46.webp | Bin 19222 -> 0 bytes cards100/event_47.avif | Bin 0 -> 11868 bytes cards100/event_47.webp | Bin 14414 -> 0 bytes cards100/event_48.avif | Bin 0 -> 11849 bytes cards100/event_48.webp | Bin 15884 -> 0 bytes cards100/event_49.avif | Bin 0 -> 10685 bytes cards100/event_49.webp | Bin 13442 -> 0 bytes cards100/event_5.avif | Bin 0 -> 18788 bytes cards100/event_5.webp | Bin 22454 -> 0 bytes cards100/event_50.avif | Bin 0 -> 9070 bytes cards100/event_50.webp | Bin 11174 -> 0 bytes cards100/event_51.avif | Bin 0 -> 13044 bytes cards100/event_51.webp | Bin 15520 -> 0 bytes cards100/event_52.avif | Bin 0 -> 8858 bytes cards100/event_52.webp | Bin 11508 -> 0 bytes cards100/event_53.avif | Bin 0 -> 10808 bytes cards100/event_53.webp | Bin 13168 -> 0 bytes cards100/event_54.avif | Bin 0 -> 13294 bytes cards100/event_54.webp | Bin 19138 -> 0 bytes cards100/event_55.avif | Bin 0 -> 16122 bytes cards100/event_55.webp | Bin 20786 -> 0 bytes cards100/event_56.avif | Bin 0 -> 12253 bytes cards100/event_56.webp | Bin 14936 -> 0 bytes cards100/event_57.avif | Bin 0 -> 9854 bytes cards100/event_57.webp | Bin 12296 -> 0 bytes cards100/event_58.avif | Bin 0 -> 13769 bytes cards100/event_58.webp | Bin 17462 -> 0 bytes cards100/event_59.avif | Bin 0 -> 13815 bytes cards100/event_59.webp | Bin 16646 -> 0 bytes cards100/event_6.avif | Bin 0 -> 10970 bytes cards100/event_6.webp | Bin 14008 -> 0 bytes cards100/event_60.avif | Bin 0 -> 6598 bytes cards100/event_60.webp | Bin 8392 -> 0 bytes cards100/event_61.avif | Bin 0 -> 20356 bytes cards100/event_61.webp | Bin 23890 -> 0 bytes cards100/event_62.avif | Bin 0 -> 12524 bytes cards100/event_62.webp | Bin 16860 -> 0 bytes cards100/event_63.avif | Bin 0 -> 9283 bytes cards100/event_63.webp | Bin 11594 -> 0 bytes cards100/event_64.avif | Bin 0 -> 13876 bytes cards100/event_64.webp | Bin 16588 -> 0 bytes cards100/event_65.avif | Bin 0 -> 11902 bytes cards100/event_65.webp | Bin 14156 -> 0 bytes cards100/event_66.avif | Bin 0 -> 9471 bytes cards100/event_66.webp | Bin 11662 -> 0 bytes cards100/event_67.avif | Bin 0 -> 11095 bytes cards100/event_67.webp | Bin 14428 -> 0 bytes cards100/event_68.avif | Bin 0 -> 10730 bytes cards100/event_68.webp | Bin 13438 -> 0 bytes cards100/event_69.avif | Bin 0 -> 14811 bytes cards100/event_69.webp | Bin 19296 -> 0 bytes cards100/event_7.avif | Bin 0 -> 7424 bytes cards100/event_7.webp | Bin 9586 -> 0 bytes cards100/event_70.avif | Bin 0 -> 10664 bytes cards100/event_70.webp | Bin 14106 -> 0 bytes cards100/event_71.avif | Bin 0 -> 10198 bytes cards100/event_71.webp | Bin 12930 -> 0 bytes cards100/event_72.avif | Bin 0 -> 14858 bytes cards100/event_72.webp | Bin 19642 -> 0 bytes cards100/event_73.avif | Bin 0 -> 12166 bytes cards100/event_73.webp | Bin 15930 -> 0 bytes cards100/event_74.avif | Bin 0 -> 10707 bytes cards100/event_74.webp | Bin 13590 -> 0 bytes cards100/event_75.avif | Bin 0 -> 12301 bytes cards100/event_75.webp | Bin 15346 -> 0 bytes cards100/event_76.avif | Bin 0 -> 12759 bytes cards100/event_76.webp | Bin 17154 -> 0 bytes cards100/event_77.avif | Bin 0 -> 14205 bytes cards100/event_77.webp | Bin 18044 -> 0 bytes cards100/event_78.avif | Bin 0 -> 12723 bytes cards100/event_78.webp | Bin 16814 -> 0 bytes cards100/event_79.avif | Bin 0 -> 13820 bytes cards100/event_79.webp | Bin 16672 -> 0 bytes cards100/event_8.avif | Bin 0 -> 8669 bytes cards100/event_8.webp | Bin 10462 -> 0 bytes cards100/event_80.avif | Bin 0 -> 12546 bytes cards100/event_80.webp | Bin 15786 -> 0 bytes cards100/event_81.avif | Bin 0 -> 12274 bytes cards100/event_81.webp | Bin 15386 -> 0 bytes cards100/event_82.avif | Bin 0 -> 8367 bytes cards100/event_82.webp | Bin 9982 -> 0 bytes cards100/event_83.avif | Bin 0 -> 10340 bytes cards100/event_83.webp | Bin 13948 -> 0 bytes cards100/event_84.avif | Bin 0 -> 20169 bytes cards100/event_84.webp | Bin 24642 -> 0 bytes cards100/event_85.avif | Bin 0 -> 9615 bytes cards100/event_85.webp | Bin 12100 -> 0 bytes cards100/event_86.avif | Bin 0 -> 13776 bytes cards100/event_86.webp | Bin 19254 -> 0 bytes cards100/event_87.avif | Bin 0 -> 15863 bytes cards100/event_87.webp | Bin 19714 -> 0 bytes cards100/event_88.avif | Bin 0 -> 12507 bytes cards100/event_88.webp | Bin 16276 -> 0 bytes cards100/event_89.avif | Bin 0 -> 16933 bytes cards100/event_89.webp | Bin 18980 -> 0 bytes cards100/event_9.avif | Bin 0 -> 14507 bytes cards100/event_9.webp | Bin 18502 -> 0 bytes cards100/event_90.avif | Bin 0 -> 14531 bytes cards100/event_90.webp | Bin 18634 -> 0 bytes cards100/event_91.avif | Bin 0 -> 9591 bytes cards100/event_91.webp | Bin 11960 -> 0 bytes cards100/event_92.avif | Bin 0 -> 11400 bytes cards100/event_92.webp | Bin 13518 -> 0 bytes cards100/event_93.avif | Bin 0 -> 11277 bytes cards100/event_93.webp | Bin 15294 -> 0 bytes cards100/event_94.avif | Bin 0 -> 17481 bytes cards100/event_94.webp | Bin 21390 -> 0 bytes cards100/event_95.avif | Bin 0 -> 8770 bytes cards100/event_95.webp | Bin 12652 -> 0 bytes cards100/event_96.avif | Bin 0 -> 14661 bytes cards100/event_96.webp | Bin 19046 -> 0 bytes cards100/event_97.avif | Bin 0 -> 11322 bytes cards100/event_97.webp | Bin 14846 -> 0 bytes cards100/event_98.avif | Bin 0 -> 10359 bytes cards100/event_98.webp | Bin 13440 -> 0 bytes cards100/event_99.avif | Bin 0 -> 10068 bytes cards100/event_99.webp | Bin 13244 -> 0 bytes cards100/event_back.avif | Bin 0 -> 7023 bytes cards100/event_back.webp | Bin 10168 -> 0 bytes cards100/power_1.png | Bin 42902 -> 0 bytes cards100/power_1.webp | Bin 13770 -> 0 bytes cards100/power_10.png | Bin 37010 -> 0 bytes cards100/power_10.webp | Bin 10306 -> 0 bytes cards100/power_11.png | Bin 36610 -> 0 bytes cards100/power_11.webp | Bin 10226 -> 0 bytes cards100/power_11_14.avif | Bin 0 -> 6400 bytes cards100/power_11_14.png | Bin 0 -> 38058 bytes cards100/power_12.png | Bin 36673 -> 0 bytes cards100/power_12.webp | Bin 10238 -> 0 bytes cards100/power_13.png | Bin 36661 -> 0 bytes cards100/power_13.webp | Bin 10244 -> 0 bytes cards100/power_14.png | Bin 37178 -> 0 bytes cards100/power_14.webp | Bin 10378 -> 0 bytes cards100/power_15.png | Bin 37201 -> 0 bytes cards100/power_15.webp | Bin 10384 -> 0 bytes cards100/power_15_18.avif | Bin 0 -> 6487 bytes cards100/power_15_18.png | Bin 0 -> 38685 bytes cards100/power_16.png | Bin 37203 -> 0 bytes cards100/power_16.webp | Bin 10396 -> 0 bytes cards100/power_17.png | Bin 37182 -> 0 bytes cards100/power_17.webp | Bin 10374 -> 0 bytes cards100/power_18.png | Bin 36688 -> 0 bytes cards100/power_18.webp | Bin 10250 -> 0 bytes cards100/power_19.png | Bin 54167 -> 0 bytes cards100/power_19.webp | Bin 17218 -> 0 bytes cards100/power_19_20.avif | Bin 0 -> 11572 bytes cards100/power_19_20.png | Bin 0 -> 61541 bytes cards100/power_1_6.avif | Bin 0 -> 8674 bytes cards100/power_1_6.png | Bin 0 -> 47514 bytes cards100/power_2.png | Bin 42961 -> 0 bytes cards100/power_2.webp | Bin 13764 -> 0 bytes cards100/power_20.png | Bin 54211 -> 0 bytes cards100/power_20.webp | Bin 17194 -> 0 bytes cards100/power_21.png | Bin 54037 -> 0 bytes cards100/power_21.webp | Bin 17130 -> 0 bytes cards100/power_21_22.avif | Bin 0 -> 11550 bytes cards100/power_21_22.png | Bin 0 -> 61324 bytes cards100/power_22.png | Bin 54098 -> 0 bytes cards100/power_22.webp | Bin 17152 -> 0 bytes cards100/power_23.png | Bin 53892 -> 0 bytes cards100/power_23.webp | Bin 17110 -> 0 bytes cards100/power_23_26.avif | Bin 0 -> 11548 bytes cards100/power_23_26.png | Bin 0 -> 61041 bytes cards100/power_24.png | Bin 53889 -> 0 bytes cards100/power_24.webp | Bin 17132 -> 0 bytes cards100/power_25.png | Bin 53895 -> 0 bytes cards100/power_25.webp | Bin 17106 -> 0 bytes cards100/power_26.png | Bin 53941 -> 0 bytes cards100/power_26.webp | Bin 17132 -> 0 bytes cards100/power_27.png | Bin 54288 -> 0 bytes cards100/power_27.webp | Bin 17206 -> 0 bytes cards100/power_27_30.avif | Bin 0 -> 11575 bytes cards100/power_27_30.png | Bin 0 -> 61581 bytes cards100/power_28.png | Bin 54297 -> 0 bytes cards100/power_28.webp | Bin 17208 -> 0 bytes cards100/power_29.png | Bin 54301 -> 0 bytes cards100/power_29.webp | Bin 17210 -> 0 bytes cards100/power_3.png | Bin 42936 -> 0 bytes cards100/power_3.webp | Bin 13774 -> 0 bytes cards100/power_30.png | Bin 54292 -> 0 bytes cards100/power_30.webp | Bin 17206 -> 0 bytes cards100/power_31.png | Bin 33118 -> 0 bytes cards100/power_31.webp | Bin 9882 -> 0 bytes cards100/power_31_33.avif | Bin 0 -> 6119 bytes cards100/power_31_33.png | Bin 0 -> 36542 bytes cards100/power_32.png | Bin 33169 -> 0 bytes cards100/power_32.webp | Bin 9916 -> 0 bytes cards100/power_33.png | Bin 33157 -> 0 bytes cards100/power_33.webp | Bin 9898 -> 0 bytes cards100/power_34.png | Bin 32980 -> 0 bytes cards100/power_34.webp | Bin 9836 -> 0 bytes cards100/power_34_36.avif | Bin 0 -> 6099 bytes cards100/power_34_36.png | Bin 0 -> 36324 bytes cards100/power_35.png | Bin 32977 -> 0 bytes cards100/power_35.webp | Bin 9838 -> 0 bytes cards100/power_36.png | Bin 32987 -> 0 bytes cards100/power_36.webp | Bin 9848 -> 0 bytes cards100/power_37.avif | Bin 0 -> 7301 bytes cards100/power_37.png | Bin 36820 -> 41576 bytes cards100/power_37.webp | Bin 11018 -> 0 bytes cards100/power_38.avif | Bin 0 -> 6944 bytes cards100/power_38.png | Bin 34916 -> 38428 bytes cards100/power_38.webp | Bin 11092 -> 0 bytes cards100/power_39.avif | Bin 0 -> 7605 bytes cards100/power_39.png | Bin 37792 -> 42744 bytes cards100/power_39.webp | Bin 11622 -> 0 bytes cards100/power_4.png | Bin 42952 -> 0 bytes cards100/power_4.webp | Bin 13744 -> 0 bytes cards100/power_40.avif | Bin 0 -> 6267 bytes cards100/power_40.png | Bin 31504 -> 34279 bytes cards100/power_40.webp | Bin 9760 -> 0 bytes cards100/power_41.avif | Bin 0 -> 6482 bytes cards100/power_41.png | Bin 32190 -> 35768 bytes cards100/power_41.webp | Bin 9844 -> 0 bytes cards100/power_42.avif | Bin 0 -> 7787 bytes cards100/power_42.png | Bin 38115 -> 43449 bytes cards100/power_42.webp | Bin 11646 -> 0 bytes cards100/power_43.avif | Bin 0 -> 5486 bytes cards100/power_43.png | Bin 27677 -> 30403 bytes cards100/power_43.webp | Bin 8264 -> 0 bytes cards100/power_44.avif | Bin 0 -> 5233 bytes cards100/power_44.png | Bin 26394 -> 28699 bytes cards100/power_44.webp | Bin 7780 -> 0 bytes cards100/power_45.avif | Bin 0 -> 5702 bytes cards100/power_45.png | Bin 29391 -> 32392 bytes cards100/power_45.webp | Bin 8992 -> 0 bytes cards100/power_46.avif | Bin 0 -> 9189 bytes cards100/power_46.png | Bin 46648 -> 52749 bytes cards100/power_46.webp | Bin 13752 -> 0 bytes cards100/power_47.avif | Bin 0 -> 8123 bytes cards100/power_47.png | Bin 38594 -> 44777 bytes cards100/power_47.webp | Bin 12066 -> 0 bytes cards100/power_48.avif | Bin 0 -> 9604 bytes cards100/power_48.png | Bin 47714 -> 56463 bytes cards100/power_48.webp | Bin 14626 -> 0 bytes cards100/power_49.avif | Bin 0 -> 5689 bytes cards100/power_49.png | Bin 26478 -> 29311 bytes cards100/power_49.webp | Bin 8538 -> 0 bytes cards100/power_5.png | Bin 42956 -> 0 bytes cards100/power_5.webp | Bin 13768 -> 0 bytes cards100/power_50.avif | Bin 0 -> 7246 bytes cards100/power_50.png | Bin 34179 -> 38324 bytes cards100/power_50.webp | Bin 10990 -> 0 bytes cards100/power_51.avif | Bin 0 -> 7119 bytes cards100/power_51.png | Bin 34691 -> 37921 bytes cards100/power_51.webp | Bin 10736 -> 0 bytes cards100/power_52.avif | Bin 0 -> 8034 bytes cards100/power_52.png | Bin 38437 -> 42402 bytes cards100/power_52.webp | Bin 11920 -> 0 bytes cards100/power_6.png | Bin 42962 -> 0 bytes cards100/power_6.webp | Bin 13758 -> 0 bytes cards100/power_7.png | Bin 37016 -> 0 bytes cards100/power_7.webp | Bin 10348 -> 0 bytes cards100/power_7_8.avif | Bin 0 -> 6460 bytes cards100/power_7_8.png | Bin 0 -> 38575 bytes cards100/power_8.png | Bin 37035 -> 0 bytes cards100/power_8.webp | Bin 10338 -> 0 bytes cards100/power_9.png | Bin 36937 -> 0 bytes cards100/power_9.webp | Bin 10286 -> 0 bytes cards100/power_9_10.avif | Bin 0 -> 6460 bytes cards100/power_9_10.png | Bin 0 -> 38402 bytes cards100/power_back.avif | Bin 0 -> 7597 bytes cards100/power_back.png | Bin 80928 -> 88907 bytes cards100/power_back.webp | Bin 10072 -> 0 bytes cards200/event_1.avif | Bin 0 -> 15431 bytes cards200/event_10.avif | Bin 0 -> 14788 bytes cards200/event_100.avif | Bin 0 -> 19991 bytes cards200/event_101.avif | Bin 0 -> 16443 bytes cards200/event_102.avif | Bin 0 -> 20056 bytes cards200/event_103.avif | Bin 0 -> 13907 bytes cards200/event_104.avif | Bin 0 -> 28256 bytes cards200/event_105.avif | Bin 0 -> 16930 bytes cards200/event_106.avif | Bin 0 -> 16601 bytes cards200/event_107.avif | Bin 0 -> 29213 bytes cards200/event_108.avif | Bin 0 -> 13030 bytes cards200/event_109.avif | Bin 0 -> 24766 bytes cards200/event_11.avif | Bin 0 -> 13424 bytes cards200/event_110.avif | Bin 0 -> 19530 bytes cards200/event_12.avif | Bin 0 -> 13510 bytes cards200/event_13.avif | Bin 0 -> 14567 bytes cards200/event_14.avif | Bin 0 -> 15895 bytes cards200/event_15.avif | Bin 0 -> 18137 bytes cards200/event_16.avif | Bin 0 -> 27352 bytes cards200/event_17.avif | Bin 0 -> 30929 bytes cards200/event_18.avif | Bin 0 -> 26353 bytes cards200/event_19.avif | Bin 0 -> 34802 bytes cards200/event_2.avif | Bin 0 -> 19825 bytes cards200/event_20.avif | Bin 0 -> 18246 bytes cards200/event_21.avif | Bin 0 -> 15285 bytes cards200/event_22.avif | Bin 0 -> 22661 bytes cards200/event_23.avif | Bin 0 -> 11067 bytes cards200/event_24.avif | Bin 0 -> 18692 bytes cards200/event_25.avif | Bin 0 -> 10366 bytes cards200/event_26.avif | Bin 0 -> 18433 bytes cards200/event_27.avif | Bin 0 -> 14801 bytes cards200/event_28.avif | Bin 0 -> 15610 bytes cards200/event_29.avif | Bin 0 -> 18966 bytes cards200/event_3.avif | Bin 0 -> 16696 bytes cards200/event_30.avif | Bin 0 -> 13587 bytes cards200/event_31.avif | Bin 0 -> 11871 bytes cards200/event_32.avif | Bin 0 -> 20660 bytes cards200/event_33.avif | Bin 0 -> 13251 bytes cards200/event_34.avif | Bin 0 -> 9499 bytes cards200/event_35.avif | Bin 0 -> 19786 bytes cards200/event_36.avif | Bin 0 -> 21680 bytes cards200/event_37.avif | Bin 0 -> 22785 bytes cards200/event_38.avif | Bin 0 -> 12260 bytes cards200/event_39.avif | Bin 0 -> 10494 bytes cards200/event_4.avif | Bin 0 -> 13000 bytes cards200/event_40.avif | Bin 0 -> 16579 bytes cards200/event_41.avif | Bin 0 -> 19109 bytes cards200/event_42.avif | Bin 0 -> 27868 bytes cards200/event_43.avif | Bin 0 -> 12937 bytes cards200/event_44.avif | Bin 0 -> 26028 bytes cards200/event_45.avif | Bin 0 -> 16832 bytes cards200/event_46.avif | Bin 0 -> 22078 bytes cards200/event_47.avif | Bin 0 -> 15329 bytes cards200/event_48.avif | Bin 0 -> 16762 bytes cards200/event_49.avif | Bin 0 -> 15860 bytes cards200/event_5.avif | Bin 0 -> 30177 bytes cards200/event_50.avif | Bin 0 -> 11421 bytes cards200/event_51.avif | Bin 0 -> 20173 bytes cards200/event_52.avif | Bin 0 -> 12115 bytes cards200/event_53.avif | Bin 0 -> 14985 bytes cards200/event_54.avif | Bin 0 -> 20308 bytes cards200/event_55.avif | Bin 0 -> 20181 bytes cards200/event_56.avif | Bin 0 -> 17542 bytes cards200/event_57.avif | Bin 0 -> 13991 bytes cards200/event_58.avif | Bin 0 -> 19504 bytes cards200/event_59.avif | Bin 0 -> 20491 bytes cards200/event_6.avif | Bin 0 -> 14750 bytes cards200/event_60.avif | Bin 0 -> 8429 bytes cards200/event_61.avif | Bin 0 -> 32413 bytes cards200/event_62.avif | Bin 0 -> 18162 bytes cards200/event_63.avif | Bin 0 -> 12387 bytes cards200/event_64.avif | Bin 0 -> 21117 bytes cards200/event_65.avif | Bin 0 -> 16189 bytes cards200/event_66.avif | Bin 0 -> 13816 bytes cards200/event_67.avif | Bin 0 -> 14785 bytes cards200/event_68.avif | Bin 0 -> 15572 bytes cards200/event_69.avif | Bin 0 -> 21293 bytes cards200/event_7.avif | Bin 0 -> 9901 bytes cards200/event_70.avif | Bin 0 -> 15121 bytes cards200/event_71.avif | Bin 0 -> 13257 bytes cards200/event_72.avif | Bin 0 -> 25473 bytes cards200/event_73.avif | Bin 0 -> 17374 bytes cards200/event_74.avif | Bin 0 -> 13495 bytes cards200/event_75.avif | Bin 0 -> 16355 bytes cards200/event_76.avif | Bin 0 -> 19001 bytes cards200/event_77.avif | Bin 0 -> 22123 bytes cards200/event_78.avif | Bin 0 -> 17546 bytes cards200/event_79.avif | Bin 0 -> 19108 bytes cards200/event_8.avif | Bin 0 -> 11231 bytes cards200/event_80.avif | Bin 0 -> 17962 bytes cards200/event_81.avif | Bin 0 -> 17818 bytes cards200/event_82.avif | Bin 0 -> 12037 bytes cards200/event_83.avif | Bin 0 -> 15407 bytes cards200/event_84.avif | Bin 0 -> 33334 bytes cards200/event_85.avif | Bin 0 -> 13548 bytes cards200/event_86.avif | Bin 0 -> 19605 bytes cards200/event_87.avif | Bin 0 -> 23007 bytes cards200/event_88.avif | Bin 0 -> 18371 bytes cards200/event_89.avif | Bin 0 -> 26693 bytes cards200/event_9.avif | Bin 0 -> 23039 bytes cards200/event_90.avif | Bin 0 -> 21171 bytes cards200/event_91.avif | Bin 0 -> 14083 bytes cards200/event_92.avif | Bin 0 -> 15652 bytes cards200/event_93.avif | Bin 0 -> 17056 bytes cards200/event_94.avif | Bin 0 -> 28299 bytes cards200/event_95.avif | Bin 0 -> 11914 bytes cards200/event_96.avif | Bin 0 -> 23030 bytes cards200/event_97.avif | Bin 0 -> 18610 bytes cards200/event_98.avif | Bin 0 -> 14944 bytes cards200/event_99.avif | Bin 0 -> 15531 bytes cards200/event_back.avif | Bin 0 -> 7318 bytes cards200/power_1.png | Bin 119267 -> 0 bytes cards200/power_1.webp | Bin 19256 -> 0 bytes cards200/power_10.png | Bin 96222 -> 0 bytes cards200/power_10.webp | Bin 13904 -> 0 bytes cards200/power_11.png | Bin 94980 -> 0 bytes cards200/power_11.webp | Bin 13784 -> 0 bytes cards200/power_11_14.png | Bin 0 -> 77721 bytes cards200/power_12.png | Bin 95286 -> 0 bytes cards200/power_12.webp | Bin 13788 -> 0 bytes cards200/power_13.png | Bin 95316 -> 0 bytes cards200/power_13.webp | Bin 13806 -> 0 bytes cards200/power_14.png | Bin 97096 -> 0 bytes cards200/power_14.webp | Bin 13982 -> 0 bytes cards200/power_15.png | Bin 97175 -> 0 bytes cards200/power_15.webp | Bin 13934 -> 0 bytes cards200/power_15_18.png | Bin 0 -> 79359 bytes cards200/power_16.png | Bin 97196 -> 0 bytes cards200/power_16.webp | Bin 13964 -> 0 bytes cards200/power_17.png | Bin 97100 -> 0 bytes cards200/power_17.webp | Bin 13958 -> 0 bytes cards200/power_18.png | Bin 95356 -> 0 bytes cards200/power_18.webp | Bin 13844 -> 0 bytes cards200/power_19.png | Bin 161130 -> 0 bytes cards200/power_19.webp | Bin 26318 -> 0 bytes cards200/power_19_20.png | Bin 0 -> 135381 bytes cards200/power_1_6.png | Bin 0 -> 97989 bytes cards200/power_2.png | Bin 119571 -> 0 bytes cards200/power_2.webp | Bin 19256 -> 0 bytes cards200/power_20.png | Bin 161344 -> 0 bytes cards200/power_20.webp | Bin 26356 -> 0 bytes cards200/power_21.png | Bin 160412 -> 0 bytes cards200/power_21.webp | Bin 26194 -> 0 bytes cards200/power_21_22.png | Bin 0 -> 134849 bytes cards200/power_22.png | Bin 160639 -> 0 bytes cards200/power_22.webp | Bin 26264 -> 0 bytes cards200/power_23.png | Bin 159830 -> 0 bytes cards200/power_23.webp | Bin 26210 -> 0 bytes cards200/power_23_26.png | Bin 0 -> 134244 bytes cards200/power_24.png | Bin 159749 -> 0 bytes cards200/power_24.webp | Bin 26226 -> 0 bytes cards200/power_25.png | Bin 159814 -> 0 bytes cards200/power_25.webp | Bin 26244 -> 0 bytes cards200/power_26.png | Bin 159887 -> 0 bytes cards200/power_26.webp | Bin 26252 -> 0 bytes cards200/power_27.png | Bin 161489 -> 0 bytes cards200/power_27.webp | Bin 26366 -> 0 bytes cards200/power_27_30.png | Bin 0 -> 135502 bytes cards200/power_28.png | Bin 161673 -> 0 bytes cards200/power_28.webp | Bin 26318 -> 0 bytes cards200/power_29.png | Bin 161599 -> 0 bytes cards200/power_29.webp | Bin 26348 -> 0 bytes cards200/power_3.png | Bin 119573 -> 0 bytes cards200/power_3.webp | Bin 19274 -> 0 bytes cards200/power_30.png | Bin 161572 -> 0 bytes cards200/power_30.webp | Bin 26390 -> 0 bytes cards200/power_31.png | Bin 94374 -> 0 bytes cards200/power_31.webp | Bin 14926 -> 0 bytes cards200/power_31_33.png | Bin 0 -> 78200 bytes cards200/power_32.png | Bin 94567 -> 0 bytes cards200/power_32.webp | Bin 14958 -> 0 bytes cards200/power_33.png | Bin 94574 -> 0 bytes cards200/power_33.webp | Bin 14922 -> 0 bytes cards200/power_34.png | Bin 93876 -> 0 bytes cards200/power_34.webp | Bin 14842 -> 0 bytes cards200/power_34_36.png | Bin 0 -> 77631 bytes cards200/power_35.png | Bin 93950 -> 0 bytes cards200/power_35.webp | Bin 14868 -> 0 bytes cards200/power_36.png | Bin 93976 -> 0 bytes cards200/power_36.webp | Bin 14876 -> 0 bytes cards200/power_37.png | Bin 110540 -> 95613 bytes cards200/power_37.webp | Bin 17438 -> 0 bytes cards200/power_38.png | Bin 97988 -> 80927 bytes cards200/power_38.webp | Bin 16072 -> 0 bytes cards200/power_39.png | Bin 112614 -> 95897 bytes cards200/power_39.webp | Bin 18004 -> 0 bytes cards200/power_4.png | Bin 119484 -> 0 bytes cards200/power_4.webp | Bin 19260 -> 0 bytes cards200/power_40.png | Bin 86923 -> 73691 bytes cards200/power_40.webp | Bin 14552 -> 0 bytes cards200/power_41.png | Bin 91195 -> 76173 bytes cards200/power_41.webp | Bin 14796 -> 0 bytes cards200/power_42.png | Bin 115789 -> 100072 bytes cards200/power_42.webp | Bin 18322 -> 0 bytes cards200/power_43.png | Bin 79245 -> 66373 bytes cards200/power_43.webp | Bin 12750 -> 0 bytes cards200/power_44.png | Bin 77193 -> 66348 bytes cards200/power_44.webp | Bin 12374 -> 0 bytes cards200/power_45.png | Bin 80386 -> 66027 bytes cards200/power_45.webp | Bin 13316 -> 0 bytes cards200/power_46.png | Bin 143761 -> 125682 bytes cards200/power_46.webp | Bin 22676 -> 0 bytes cards200/power_47.png | Bin 118574 -> 102159 bytes cards200/power_47.webp | Bin 18916 -> 0 bytes cards200/power_48.png | Bin 152412 -> 130883 bytes cards200/power_48.webp | Bin 23208 -> 0 bytes cards200/power_49.png | Bin 73102 -> 60660 bytes cards200/power_49.webp | Bin 13124 -> 0 bytes cards200/power_5.png | Bin 119572 -> 0 bytes cards200/power_5.webp | Bin 19240 -> 0 bytes cards200/power_50.png | Bin 96707 -> 80368 bytes cards200/power_50.webp | Bin 15928 -> 0 bytes cards200/power_51.png | Bin 95681 -> 79523 bytes cards200/power_51.webp | Bin 16456 -> 0 bytes cards200/power_52.png | Bin 108892 -> 91454 bytes cards200/power_52.webp | Bin 18602 -> 0 bytes cards200/power_6.png | Bin 119582 -> 0 bytes cards200/power_6.webp | Bin 19304 -> 0 bytes cards200/power_7.png | Bin 96589 -> 0 bytes cards200/power_7.webp | Bin 13920 -> 0 bytes cards200/power_7_8.png | Bin 0 -> 79130 bytes cards200/power_8.png | Bin 96724 -> 0 bytes cards200/power_8.webp | Bin 13938 -> 0 bytes cards200/power_9.png | Bin 96028 -> 0 bytes cards200/power_9.webp | Bin 13830 -> 0 bytes cards200/power_9_10.png | Bin 0 -> 78478 bytes cards200/power_back.png | Bin 319956 -> 319956 bytes cards200/power_back.webp | Bin 13868 -> 0 bytes map150.avif | Bin 0 -> 582101 bytes map75.avif | Bin 0 -> 565994 bytes 598 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 1989_card_back_ps.gif create mode 100644 cards100/event_1.avif delete mode 100644 cards100/event_1.webp create mode 100644 cards100/event_10.avif delete mode 100644 cards100/event_10.webp create mode 100644 cards100/event_100.avif delete mode 100644 cards100/event_100.webp create mode 100644 cards100/event_101.avif delete mode 100644 cards100/event_101.webp create mode 100644 cards100/event_102.avif delete mode 100644 cards100/event_102.webp create mode 100644 cards100/event_103.avif delete mode 100644 cards100/event_103.webp create mode 100644 cards100/event_104.avif delete mode 100644 cards100/event_104.webp create mode 100644 cards100/event_105.avif delete mode 100644 cards100/event_105.webp create mode 100644 cards100/event_106.avif delete mode 100644 cards100/event_106.webp create mode 100644 cards100/event_107.avif delete mode 100644 cards100/event_107.webp create mode 100644 cards100/event_108.avif delete mode 100644 cards100/event_108.webp create mode 100644 cards100/event_109.avif delete mode 100644 cards100/event_109.webp create mode 100644 cards100/event_11.avif delete mode 100644 cards100/event_11.webp create mode 100644 cards100/event_110.avif delete mode 100644 cards100/event_110.webp create mode 100644 cards100/event_12.avif delete mode 100644 cards100/event_12.webp create mode 100644 cards100/event_13.avif delete mode 100644 cards100/event_13.webp create mode 100644 cards100/event_14.avif delete mode 100644 cards100/event_14.webp create mode 100644 cards100/event_15.avif delete mode 100644 cards100/event_15.webp create mode 100644 cards100/event_16.avif delete mode 100644 cards100/event_16.webp create mode 100644 cards100/event_17.avif delete mode 100644 cards100/event_17.webp create mode 100644 cards100/event_18.avif delete mode 100644 cards100/event_18.webp create mode 100644 cards100/event_19.avif delete mode 100644 cards100/event_19.webp create mode 100644 cards100/event_2.avif delete mode 100644 cards100/event_2.webp create mode 100644 cards100/event_20.avif delete mode 100644 cards100/event_20.webp create mode 100644 cards100/event_21.avif delete mode 100644 cards100/event_21.webp create mode 100644 cards100/event_22.avif delete mode 100644 cards100/event_22.webp create mode 100644 cards100/event_23.avif delete mode 100644 cards100/event_23.webp create mode 100644 cards100/event_24.avif delete mode 100644 cards100/event_24.webp create mode 100644 cards100/event_25.avif delete mode 100644 cards100/event_25.webp create mode 100644 cards100/event_26.avif delete mode 100644 cards100/event_26.webp create mode 100644 cards100/event_27.avif delete mode 100644 cards100/event_27.webp create mode 100644 cards100/event_28.avif delete mode 100644 cards100/event_28.webp create mode 100644 cards100/event_29.avif delete mode 100644 cards100/event_29.webp create mode 100644 cards100/event_3.avif delete mode 100644 cards100/event_3.webp create mode 100644 cards100/event_30.avif delete mode 100644 cards100/event_30.webp create mode 100644 cards100/event_31.avif delete mode 100644 cards100/event_31.webp create mode 100644 cards100/event_32.avif delete mode 100644 cards100/event_32.webp create mode 100644 cards100/event_33.avif delete mode 100644 cards100/event_33.webp create mode 100644 cards100/event_34.avif delete mode 100644 cards100/event_34.webp create mode 100644 cards100/event_35.avif delete mode 100644 cards100/event_35.webp create mode 100644 cards100/event_36.avif delete mode 100644 cards100/event_36.webp create mode 100644 cards100/event_37.avif delete mode 100644 cards100/event_37.webp create mode 100644 cards100/event_38.avif delete mode 100644 cards100/event_38.webp create mode 100644 cards100/event_39.avif delete mode 100644 cards100/event_39.webp create mode 100644 cards100/event_4.avif delete mode 100644 cards100/event_4.webp create mode 100644 cards100/event_40.avif delete mode 100644 cards100/event_40.webp create mode 100644 cards100/event_41.avif delete mode 100644 cards100/event_41.webp create mode 100644 cards100/event_42.avif delete mode 100644 cards100/event_42.webp create mode 100644 cards100/event_43.avif delete mode 100644 cards100/event_43.webp create mode 100644 cards100/event_44.avif delete mode 100644 cards100/event_44.webp create mode 100644 cards100/event_45.avif delete mode 100644 cards100/event_45.webp create mode 100644 cards100/event_46.avif delete mode 100644 cards100/event_46.webp create mode 100644 cards100/event_47.avif delete mode 100644 cards100/event_47.webp create mode 100644 cards100/event_48.avif delete mode 100644 cards100/event_48.webp create mode 100644 cards100/event_49.avif delete mode 100644 cards100/event_49.webp create mode 100644 cards100/event_5.avif delete mode 100644 cards100/event_5.webp create mode 100644 cards100/event_50.avif delete mode 100644 cards100/event_50.webp create mode 100644 cards100/event_51.avif delete mode 100644 cards100/event_51.webp create mode 100644 cards100/event_52.avif delete mode 100644 cards100/event_52.webp create mode 100644 cards100/event_53.avif delete mode 100644 cards100/event_53.webp create mode 100644 cards100/event_54.avif delete mode 100644 cards100/event_54.webp create mode 100644 cards100/event_55.avif delete mode 100644 cards100/event_55.webp create mode 100644 cards100/event_56.avif delete mode 100644 cards100/event_56.webp create mode 100644 cards100/event_57.avif delete mode 100644 cards100/event_57.webp create mode 100644 cards100/event_58.avif delete mode 100644 cards100/event_58.webp create mode 100644 cards100/event_59.avif delete mode 100644 cards100/event_59.webp create mode 100644 cards100/event_6.avif delete mode 100644 cards100/event_6.webp create mode 100644 cards100/event_60.avif delete mode 100644 cards100/event_60.webp create mode 100644 cards100/event_61.avif delete mode 100644 cards100/event_61.webp create mode 100644 cards100/event_62.avif delete mode 100644 cards100/event_62.webp create mode 100644 cards100/event_63.avif delete mode 100644 cards100/event_63.webp create mode 100644 cards100/event_64.avif delete mode 100644 cards100/event_64.webp create mode 100644 cards100/event_65.avif delete mode 100644 cards100/event_65.webp create mode 100644 cards100/event_66.avif delete mode 100644 cards100/event_66.webp create mode 100644 cards100/event_67.avif delete mode 100644 cards100/event_67.webp create mode 100644 cards100/event_68.avif delete mode 100644 cards100/event_68.webp create mode 100644 cards100/event_69.avif delete mode 100644 cards100/event_69.webp create mode 100644 cards100/event_7.avif delete mode 100644 cards100/event_7.webp create mode 100644 cards100/event_70.avif delete mode 100644 cards100/event_70.webp create mode 100644 cards100/event_71.avif delete mode 100644 cards100/event_71.webp create mode 100644 cards100/event_72.avif delete mode 100644 cards100/event_72.webp create mode 100644 cards100/event_73.avif delete mode 100644 cards100/event_73.webp create mode 100644 cards100/event_74.avif delete mode 100644 cards100/event_74.webp create mode 100644 cards100/event_75.avif delete mode 100644 cards100/event_75.webp create mode 100644 cards100/event_76.avif delete mode 100644 cards100/event_76.webp create mode 100644 cards100/event_77.avif delete mode 100644 cards100/event_77.webp create mode 100644 cards100/event_78.avif delete mode 100644 cards100/event_78.webp create mode 100644 cards100/event_79.avif delete mode 100644 cards100/event_79.webp create mode 100644 cards100/event_8.avif delete mode 100644 cards100/event_8.webp create mode 100644 cards100/event_80.avif delete mode 100644 cards100/event_80.webp create mode 100644 cards100/event_81.avif delete mode 100644 cards100/event_81.webp create mode 100644 cards100/event_82.avif delete mode 100644 cards100/event_82.webp create mode 100644 cards100/event_83.avif delete mode 100644 cards100/event_83.webp create mode 100644 cards100/event_84.avif delete mode 100644 cards100/event_84.webp create mode 100644 cards100/event_85.avif delete mode 100644 cards100/event_85.webp create mode 100644 cards100/event_86.avif delete mode 100644 cards100/event_86.webp create mode 100644 cards100/event_87.avif delete mode 100644 cards100/event_87.webp create mode 100644 cards100/event_88.avif delete mode 100644 cards100/event_88.webp create mode 100644 cards100/event_89.avif delete mode 100644 cards100/event_89.webp create mode 100644 cards100/event_9.avif delete mode 100644 cards100/event_9.webp create mode 100644 cards100/event_90.avif delete mode 100644 cards100/event_90.webp create mode 100644 cards100/event_91.avif delete mode 100644 cards100/event_91.webp create mode 100644 cards100/event_92.avif delete mode 100644 cards100/event_92.webp create mode 100644 cards100/event_93.avif delete mode 100644 cards100/event_93.webp create mode 100644 cards100/event_94.avif delete mode 100644 cards100/event_94.webp create mode 100644 cards100/event_95.avif delete mode 100644 cards100/event_95.webp create mode 100644 cards100/event_96.avif delete mode 100644 cards100/event_96.webp create mode 100644 cards100/event_97.avif delete mode 100644 cards100/event_97.webp create mode 100644 cards100/event_98.avif delete mode 100644 cards100/event_98.webp create mode 100644 cards100/event_99.avif delete mode 100644 cards100/event_99.webp create mode 100644 cards100/event_back.avif delete mode 100644 cards100/event_back.webp delete mode 100644 cards100/power_1.png delete mode 100644 cards100/power_1.webp delete mode 100644 cards100/power_10.png delete mode 100644 cards100/power_10.webp delete mode 100644 cards100/power_11.png delete mode 100644 cards100/power_11.webp create mode 100644 cards100/power_11_14.avif create mode 100644 cards100/power_11_14.png delete mode 100644 cards100/power_12.png delete mode 100644 cards100/power_12.webp delete mode 100644 cards100/power_13.png delete mode 100644 cards100/power_13.webp delete mode 100644 cards100/power_14.png delete mode 100644 cards100/power_14.webp delete mode 100644 cards100/power_15.png delete mode 100644 cards100/power_15.webp create mode 100644 cards100/power_15_18.avif create mode 100644 cards100/power_15_18.png delete mode 100644 cards100/power_16.png delete mode 100644 cards100/power_16.webp delete mode 100644 cards100/power_17.png delete mode 100644 cards100/power_17.webp delete mode 100644 cards100/power_18.png delete mode 100644 cards100/power_18.webp delete mode 100644 cards100/power_19.png delete mode 100644 cards100/power_19.webp create mode 100644 cards100/power_19_20.avif create mode 100644 cards100/power_19_20.png create mode 100644 cards100/power_1_6.avif create mode 100644 cards100/power_1_6.png delete mode 100644 cards100/power_2.png delete mode 100644 cards100/power_2.webp delete mode 100644 cards100/power_20.png delete mode 100644 cards100/power_20.webp delete mode 100644 cards100/power_21.png delete mode 100644 cards100/power_21.webp create mode 100644 cards100/power_21_22.avif create mode 100644 cards100/power_21_22.png delete mode 100644 cards100/power_22.png delete mode 100644 cards100/power_22.webp delete mode 100644 cards100/power_23.png delete mode 100644 cards100/power_23.webp create mode 100644 cards100/power_23_26.avif create mode 100644 cards100/power_23_26.png delete mode 100644 cards100/power_24.png delete mode 100644 cards100/power_24.webp delete mode 100644 cards100/power_25.png delete mode 100644 cards100/power_25.webp delete mode 100644 cards100/power_26.png delete mode 100644 cards100/power_26.webp delete mode 100644 cards100/power_27.png delete mode 100644 cards100/power_27.webp create mode 100644 cards100/power_27_30.avif create mode 100644 cards100/power_27_30.png delete mode 100644 cards100/power_28.png delete mode 100644 cards100/power_28.webp delete mode 100644 cards100/power_29.png delete mode 100644 cards100/power_29.webp delete mode 100644 cards100/power_3.png delete mode 100644 cards100/power_3.webp delete mode 100644 cards100/power_30.png delete mode 100644 cards100/power_30.webp delete mode 100644 cards100/power_31.png delete mode 100644 cards100/power_31.webp create mode 100644 cards100/power_31_33.avif create mode 100644 cards100/power_31_33.png delete mode 100644 cards100/power_32.png delete mode 100644 cards100/power_32.webp delete mode 100644 cards100/power_33.png delete mode 100644 cards100/power_33.webp delete mode 100644 cards100/power_34.png delete mode 100644 cards100/power_34.webp create mode 100644 cards100/power_34_36.avif create mode 100644 cards100/power_34_36.png delete mode 100644 cards100/power_35.png delete mode 100644 cards100/power_35.webp delete mode 100644 cards100/power_36.png delete mode 100644 cards100/power_36.webp create mode 100644 cards100/power_37.avif delete mode 100644 cards100/power_37.webp create mode 100644 cards100/power_38.avif delete mode 100644 cards100/power_38.webp create mode 100644 cards100/power_39.avif delete mode 100644 cards100/power_39.webp delete mode 100644 cards100/power_4.png delete mode 100644 cards100/power_4.webp create mode 100644 cards100/power_40.avif delete mode 100644 cards100/power_40.webp create mode 100644 cards100/power_41.avif delete mode 100644 cards100/power_41.webp create mode 100644 cards100/power_42.avif delete mode 100644 cards100/power_42.webp create mode 100644 cards100/power_43.avif delete mode 100644 cards100/power_43.webp create mode 100644 cards100/power_44.avif delete mode 100644 cards100/power_44.webp create mode 100644 cards100/power_45.avif delete mode 100644 cards100/power_45.webp create mode 100644 cards100/power_46.avif delete mode 100644 cards100/power_46.webp create mode 100644 cards100/power_47.avif delete mode 100644 cards100/power_47.webp create mode 100644 cards100/power_48.avif delete mode 100644 cards100/power_48.webp create mode 100644 cards100/power_49.avif delete mode 100644 cards100/power_49.webp delete mode 100644 cards100/power_5.png delete mode 100644 cards100/power_5.webp create mode 100644 cards100/power_50.avif delete mode 100644 cards100/power_50.webp create mode 100644 cards100/power_51.avif delete mode 100644 cards100/power_51.webp create mode 100644 cards100/power_52.avif delete mode 100644 cards100/power_52.webp delete mode 100644 cards100/power_6.png delete mode 100644 cards100/power_6.webp delete mode 100644 cards100/power_7.png delete mode 100644 cards100/power_7.webp create mode 100644 cards100/power_7_8.avif create mode 100644 cards100/power_7_8.png delete mode 100644 cards100/power_8.png delete mode 100644 cards100/power_8.webp delete mode 100644 cards100/power_9.png delete mode 100644 cards100/power_9.webp create mode 100644 cards100/power_9_10.avif create mode 100644 cards100/power_9_10.png create mode 100644 cards100/power_back.avif delete mode 100644 cards100/power_back.webp create mode 100644 cards200/event_1.avif create mode 100644 cards200/event_10.avif create mode 100644 cards200/event_100.avif create mode 100644 cards200/event_101.avif create mode 100644 cards200/event_102.avif create mode 100644 cards200/event_103.avif create mode 100644 cards200/event_104.avif create mode 100644 cards200/event_105.avif create mode 100644 cards200/event_106.avif create mode 100644 cards200/event_107.avif create mode 100644 cards200/event_108.avif create mode 100644 cards200/event_109.avif create mode 100644 cards200/event_11.avif create mode 100644 cards200/event_110.avif create mode 100644 cards200/event_12.avif create mode 100644 cards200/event_13.avif create mode 100644 cards200/event_14.avif create mode 100644 cards200/event_15.avif create mode 100644 cards200/event_16.avif create mode 100644 cards200/event_17.avif create mode 100644 cards200/event_18.avif create mode 100644 cards200/event_19.avif create mode 100644 cards200/event_2.avif create mode 100644 cards200/event_20.avif create mode 100644 cards200/event_21.avif create mode 100644 cards200/event_22.avif create mode 100644 cards200/event_23.avif create mode 100644 cards200/event_24.avif create mode 100644 cards200/event_25.avif create mode 100644 cards200/event_26.avif create mode 100644 cards200/event_27.avif create mode 100644 cards200/event_28.avif create mode 100644 cards200/event_29.avif create mode 100644 cards200/event_3.avif create mode 100644 cards200/event_30.avif create mode 100644 cards200/event_31.avif create mode 100644 cards200/event_32.avif create mode 100644 cards200/event_33.avif create mode 100644 cards200/event_34.avif create mode 100644 cards200/event_35.avif create mode 100644 cards200/event_36.avif create mode 100644 cards200/event_37.avif create mode 100644 cards200/event_38.avif create mode 100644 cards200/event_39.avif create mode 100644 cards200/event_4.avif create mode 100644 cards200/event_40.avif create mode 100644 cards200/event_41.avif create mode 100644 cards200/event_42.avif create mode 100644 cards200/event_43.avif create mode 100644 cards200/event_44.avif create mode 100644 cards200/event_45.avif create mode 100644 cards200/event_46.avif create mode 100644 cards200/event_47.avif create mode 100644 cards200/event_48.avif create mode 100644 cards200/event_49.avif create mode 100644 cards200/event_5.avif create mode 100644 cards200/event_50.avif create mode 100644 cards200/event_51.avif create mode 100644 cards200/event_52.avif create mode 100644 cards200/event_53.avif create mode 100644 cards200/event_54.avif create mode 100644 cards200/event_55.avif create mode 100644 cards200/event_56.avif create mode 100644 cards200/event_57.avif create mode 100644 cards200/event_58.avif create mode 100644 cards200/event_59.avif create mode 100644 cards200/event_6.avif create mode 100644 cards200/event_60.avif create mode 100644 cards200/event_61.avif create mode 100644 cards200/event_62.avif create mode 100644 cards200/event_63.avif create mode 100644 cards200/event_64.avif create mode 100644 cards200/event_65.avif create mode 100644 cards200/event_66.avif create mode 100644 cards200/event_67.avif create mode 100644 cards200/event_68.avif create mode 100644 cards200/event_69.avif create mode 100644 cards200/event_7.avif create mode 100644 cards200/event_70.avif create mode 100644 cards200/event_71.avif create mode 100644 cards200/event_72.avif create mode 100644 cards200/event_73.avif create mode 100644 cards200/event_74.avif create mode 100644 cards200/event_75.avif create mode 100644 cards200/event_76.avif create mode 100644 cards200/event_77.avif create mode 100644 cards200/event_78.avif create mode 100644 cards200/event_79.avif create mode 100644 cards200/event_8.avif create mode 100644 cards200/event_80.avif create mode 100644 cards200/event_81.avif create mode 100644 cards200/event_82.avif create mode 100644 cards200/event_83.avif create mode 100644 cards200/event_84.avif create mode 100644 cards200/event_85.avif create mode 100644 cards200/event_86.avif create mode 100644 cards200/event_87.avif create mode 100644 cards200/event_88.avif create mode 100644 cards200/event_89.avif create mode 100644 cards200/event_9.avif create mode 100644 cards200/event_90.avif create mode 100644 cards200/event_91.avif create mode 100644 cards200/event_92.avif create mode 100644 cards200/event_93.avif create mode 100644 cards200/event_94.avif create mode 100644 cards200/event_95.avif create mode 100644 cards200/event_96.avif create mode 100644 cards200/event_97.avif create mode 100644 cards200/event_98.avif create mode 100644 cards200/event_99.avif create mode 100644 cards200/event_back.avif delete mode 100644 cards200/power_1.png delete mode 100644 cards200/power_1.webp delete mode 100644 cards200/power_10.png delete mode 100644 cards200/power_10.webp delete mode 100644 cards200/power_11.png delete mode 100644 cards200/power_11.webp create mode 100644 cards200/power_11_14.png delete mode 100644 cards200/power_12.png delete mode 100644 cards200/power_12.webp delete mode 100644 cards200/power_13.png delete mode 100644 cards200/power_13.webp delete mode 100644 cards200/power_14.png delete mode 100644 cards200/power_14.webp delete mode 100644 cards200/power_15.png delete mode 100644 cards200/power_15.webp create mode 100644 cards200/power_15_18.png delete mode 100644 cards200/power_16.png delete mode 100644 cards200/power_16.webp delete mode 100644 cards200/power_17.png delete mode 100644 cards200/power_17.webp delete mode 100644 cards200/power_18.png delete mode 100644 cards200/power_18.webp delete mode 100644 cards200/power_19.png delete mode 100644 cards200/power_19.webp create mode 100644 cards200/power_19_20.png create mode 100644 cards200/power_1_6.png delete mode 100644 cards200/power_2.png delete mode 100644 cards200/power_2.webp delete mode 100644 cards200/power_20.png delete mode 100644 cards200/power_20.webp delete mode 100644 cards200/power_21.png delete mode 100644 cards200/power_21.webp create mode 100644 cards200/power_21_22.png delete mode 100644 cards200/power_22.png delete mode 100644 cards200/power_22.webp delete mode 100644 cards200/power_23.png delete mode 100644 cards200/power_23.webp create mode 100644 cards200/power_23_26.png delete mode 100644 cards200/power_24.png delete mode 100644 cards200/power_24.webp delete mode 100644 cards200/power_25.png delete mode 100644 cards200/power_25.webp delete mode 100644 cards200/power_26.png delete mode 100644 cards200/power_26.webp delete mode 100644 cards200/power_27.png delete mode 100644 cards200/power_27.webp create mode 100644 cards200/power_27_30.png delete mode 100644 cards200/power_28.png delete mode 100644 cards200/power_28.webp delete mode 100644 cards200/power_29.png delete mode 100644 cards200/power_29.webp delete mode 100644 cards200/power_3.png delete mode 100644 cards200/power_3.webp delete mode 100644 cards200/power_30.png delete mode 100644 cards200/power_30.webp delete mode 100644 cards200/power_31.png delete mode 100644 cards200/power_31.webp create mode 100644 cards200/power_31_33.png delete mode 100644 cards200/power_32.png delete mode 100644 cards200/power_32.webp delete mode 100644 cards200/power_33.png delete mode 100644 cards200/power_33.webp delete mode 100644 cards200/power_34.png delete mode 100644 cards200/power_34.webp create mode 100644 cards200/power_34_36.png delete mode 100644 cards200/power_35.png delete mode 100644 cards200/power_35.webp delete mode 100644 cards200/power_36.png delete mode 100644 cards200/power_36.webp delete mode 100644 cards200/power_37.webp delete mode 100644 cards200/power_38.webp delete mode 100644 cards200/power_39.webp delete mode 100644 cards200/power_4.png delete mode 100644 cards200/power_4.webp delete mode 100644 cards200/power_40.webp delete mode 100644 cards200/power_41.webp delete mode 100644 cards200/power_42.webp delete mode 100644 cards200/power_43.webp delete mode 100644 cards200/power_44.webp delete mode 100644 cards200/power_45.webp delete mode 100644 cards200/power_46.webp delete mode 100644 cards200/power_47.webp delete mode 100644 cards200/power_48.webp delete mode 100644 cards200/power_49.webp delete mode 100644 cards200/power_5.png delete mode 100644 cards200/power_5.webp delete mode 100644 cards200/power_50.webp delete mode 100644 cards200/power_51.webp delete mode 100644 cards200/power_52.webp delete mode 100644 cards200/power_6.png delete mode 100644 cards200/power_6.webp delete mode 100644 cards200/power_7.png delete mode 100644 cards200/power_7.webp create mode 100644 cards200/power_7_8.png delete mode 100644 cards200/power_8.png delete mode 100644 cards200/power_8.webp delete mode 100644 cards200/power_9.png delete mode 100644 cards200/power_9.webp create mode 100644 cards200/power_9_10.png delete mode 100644 cards200/power_back.webp create mode 100644 map150.avif create mode 100644 map75.avif diff --git a/1989_card_back_ps.gif b/1989_card_back_ps.gif deleted file mode 100644 index d77b791..0000000 Binary files a/1989_card_back_ps.gif and /dev/null differ diff --git a/cards100/event_1.avif b/cards100/event_1.avif new file mode 100644 index 0000000..7a383a2 Binary files /dev/null and b/cards100/event_1.avif differ diff --git a/cards100/event_1.webp b/cards100/event_1.webp deleted file mode 100644 index b1aca56..0000000 Binary files a/cards100/event_1.webp and /dev/null differ diff --git a/cards100/event_10.avif b/cards100/event_10.avif new file mode 100644 index 0000000..a1f3ac1 Binary files /dev/null and b/cards100/event_10.avif differ diff --git a/cards100/event_10.webp b/cards100/event_10.webp deleted file mode 100644 index 821396b..0000000 Binary files a/cards100/event_10.webp and /dev/null differ diff --git a/cards100/event_100.avif b/cards100/event_100.avif new file mode 100644 index 0000000..a951296 Binary files /dev/null and b/cards100/event_100.avif differ diff --git a/cards100/event_100.webp b/cards100/event_100.webp deleted file mode 100644 index a744526..0000000 Binary files a/cards100/event_100.webp and /dev/null differ diff --git a/cards100/event_101.avif b/cards100/event_101.avif new file mode 100644 index 0000000..a133130 Binary files /dev/null and b/cards100/event_101.avif differ diff --git a/cards100/event_101.webp b/cards100/event_101.webp deleted file mode 100644 index 90388c0..0000000 Binary files a/cards100/event_101.webp and /dev/null differ diff --git a/cards100/event_102.avif b/cards100/event_102.avif new file mode 100644 index 0000000..5805b5b Binary files /dev/null and b/cards100/event_102.avif differ diff --git a/cards100/event_102.webp b/cards100/event_102.webp deleted file mode 100644 index 811442f..0000000 Binary files a/cards100/event_102.webp and /dev/null differ diff --git a/cards100/event_103.avif b/cards100/event_103.avif new file mode 100644 index 0000000..82f5c1b Binary files /dev/null and b/cards100/event_103.avif differ diff --git a/cards100/event_103.webp b/cards100/event_103.webp deleted file mode 100644 index bd34acf..0000000 Binary files a/cards100/event_103.webp and /dev/null differ diff --git a/cards100/event_104.avif b/cards100/event_104.avif new file mode 100644 index 0000000..dbcf3b5 Binary files /dev/null and b/cards100/event_104.avif differ diff --git a/cards100/event_104.webp b/cards100/event_104.webp deleted file mode 100644 index 193f6e7..0000000 Binary files a/cards100/event_104.webp and /dev/null differ diff --git a/cards100/event_105.avif b/cards100/event_105.avif new file mode 100644 index 0000000..c2b7de9 Binary files /dev/null and b/cards100/event_105.avif differ diff --git a/cards100/event_105.webp b/cards100/event_105.webp deleted file mode 100644 index 20043ee..0000000 Binary files a/cards100/event_105.webp and /dev/null differ diff --git a/cards100/event_106.avif b/cards100/event_106.avif new file mode 100644 index 0000000..1d07b62 Binary files /dev/null and b/cards100/event_106.avif differ diff --git a/cards100/event_106.webp b/cards100/event_106.webp deleted file mode 100644 index 23fb4b3..0000000 Binary files a/cards100/event_106.webp and /dev/null differ diff --git a/cards100/event_107.avif b/cards100/event_107.avif new file mode 100644 index 0000000..ae06cef Binary files /dev/null and b/cards100/event_107.avif differ diff --git a/cards100/event_107.webp b/cards100/event_107.webp deleted file mode 100644 index d405e47..0000000 Binary files a/cards100/event_107.webp and /dev/null differ diff --git a/cards100/event_108.avif b/cards100/event_108.avif new file mode 100644 index 0000000..32b0da4 Binary files /dev/null and b/cards100/event_108.avif differ diff --git a/cards100/event_108.webp b/cards100/event_108.webp deleted file mode 100644 index d79e324..0000000 Binary files a/cards100/event_108.webp and /dev/null differ diff --git a/cards100/event_109.avif b/cards100/event_109.avif new file mode 100644 index 0000000..6e07636 Binary files /dev/null and b/cards100/event_109.avif differ diff --git a/cards100/event_109.webp b/cards100/event_109.webp deleted file mode 100644 index ab803bc..0000000 Binary files a/cards100/event_109.webp and /dev/null differ diff --git a/cards100/event_11.avif b/cards100/event_11.avif new file mode 100644 index 0000000..0910b8d Binary files /dev/null and b/cards100/event_11.avif differ diff --git a/cards100/event_11.webp b/cards100/event_11.webp deleted file mode 100644 index d01abcb..0000000 Binary files a/cards100/event_11.webp and /dev/null differ diff --git a/cards100/event_110.avif b/cards100/event_110.avif new file mode 100644 index 0000000..0d6b569 Binary files /dev/null and b/cards100/event_110.avif differ diff --git a/cards100/event_110.webp b/cards100/event_110.webp deleted file mode 100644 index 67e66a6..0000000 Binary files a/cards100/event_110.webp and /dev/null differ diff --git a/cards100/event_12.avif b/cards100/event_12.avif new file mode 100644 index 0000000..818a213 Binary files /dev/null and b/cards100/event_12.avif differ diff --git a/cards100/event_12.webp b/cards100/event_12.webp deleted file mode 100644 index c4de21e..0000000 Binary files a/cards100/event_12.webp and /dev/null differ diff --git a/cards100/event_13.avif b/cards100/event_13.avif new file mode 100644 index 0000000..37518a3 Binary files /dev/null and b/cards100/event_13.avif differ diff --git a/cards100/event_13.webp b/cards100/event_13.webp deleted file mode 100644 index e8354e6..0000000 Binary files a/cards100/event_13.webp and /dev/null differ diff --git a/cards100/event_14.avif b/cards100/event_14.avif new file mode 100644 index 0000000..c18803d Binary files /dev/null and b/cards100/event_14.avif differ diff --git a/cards100/event_14.webp b/cards100/event_14.webp deleted file mode 100644 index b8c0a39..0000000 Binary files a/cards100/event_14.webp and /dev/null differ diff --git a/cards100/event_15.avif b/cards100/event_15.avif new file mode 100644 index 0000000..037c600 Binary files /dev/null and b/cards100/event_15.avif differ diff --git a/cards100/event_15.webp b/cards100/event_15.webp deleted file mode 100644 index 401fc24..0000000 Binary files a/cards100/event_15.webp and /dev/null differ diff --git a/cards100/event_16.avif b/cards100/event_16.avif new file mode 100644 index 0000000..1a2ed1c Binary files /dev/null and b/cards100/event_16.avif differ diff --git a/cards100/event_16.webp b/cards100/event_16.webp deleted file mode 100644 index 7c5b2e2..0000000 Binary files a/cards100/event_16.webp and /dev/null differ diff --git a/cards100/event_17.avif b/cards100/event_17.avif new file mode 100644 index 0000000..108cc12 Binary files /dev/null and b/cards100/event_17.avif differ diff --git a/cards100/event_17.webp b/cards100/event_17.webp deleted file mode 100644 index 7d2a9da..0000000 Binary files a/cards100/event_17.webp and /dev/null differ diff --git a/cards100/event_18.avif b/cards100/event_18.avif new file mode 100644 index 0000000..adccd2f Binary files /dev/null and b/cards100/event_18.avif differ diff --git a/cards100/event_18.webp b/cards100/event_18.webp deleted file mode 100644 index a3b5b53..0000000 Binary files a/cards100/event_18.webp and /dev/null differ diff --git a/cards100/event_19.avif b/cards100/event_19.avif new file mode 100644 index 0000000..4fceeab Binary files /dev/null and b/cards100/event_19.avif differ diff --git a/cards100/event_19.webp b/cards100/event_19.webp deleted file mode 100644 index 7361c87..0000000 Binary files a/cards100/event_19.webp and /dev/null differ diff --git a/cards100/event_2.avif b/cards100/event_2.avif new file mode 100644 index 0000000..4b8117d Binary files /dev/null and b/cards100/event_2.avif differ diff --git a/cards100/event_2.webp b/cards100/event_2.webp deleted file mode 100644 index be1d878..0000000 Binary files a/cards100/event_2.webp and /dev/null differ diff --git a/cards100/event_20.avif b/cards100/event_20.avif new file mode 100644 index 0000000..600b113 Binary files /dev/null and b/cards100/event_20.avif differ diff --git a/cards100/event_20.webp b/cards100/event_20.webp deleted file mode 100644 index a8ea73a..0000000 Binary files a/cards100/event_20.webp and /dev/null differ diff --git a/cards100/event_21.avif b/cards100/event_21.avif new file mode 100644 index 0000000..ee11de1 Binary files /dev/null and b/cards100/event_21.avif differ diff --git a/cards100/event_21.webp b/cards100/event_21.webp deleted file mode 100644 index 96b6c6d..0000000 Binary files a/cards100/event_21.webp and /dev/null differ diff --git a/cards100/event_22.avif b/cards100/event_22.avif new file mode 100644 index 0000000..60a9100 Binary files /dev/null and b/cards100/event_22.avif differ diff --git a/cards100/event_22.webp b/cards100/event_22.webp deleted file mode 100644 index 059da40..0000000 Binary files a/cards100/event_22.webp and /dev/null differ diff --git a/cards100/event_23.avif b/cards100/event_23.avif new file mode 100644 index 0000000..4bc9229 Binary files /dev/null and b/cards100/event_23.avif differ diff --git a/cards100/event_23.webp b/cards100/event_23.webp deleted file mode 100644 index ac5bc4e..0000000 Binary files a/cards100/event_23.webp and /dev/null differ diff --git a/cards100/event_24.avif b/cards100/event_24.avif new file mode 100644 index 0000000..ad3cc88 Binary files /dev/null and b/cards100/event_24.avif differ diff --git a/cards100/event_24.webp b/cards100/event_24.webp deleted file mode 100644 index 91f8aeb..0000000 Binary files a/cards100/event_24.webp and /dev/null differ diff --git a/cards100/event_25.avif b/cards100/event_25.avif new file mode 100644 index 0000000..70a3513 Binary files /dev/null and b/cards100/event_25.avif differ diff --git a/cards100/event_25.webp b/cards100/event_25.webp deleted file mode 100644 index 1d786e9..0000000 Binary files a/cards100/event_25.webp and /dev/null differ diff --git a/cards100/event_26.avif b/cards100/event_26.avif new file mode 100644 index 0000000..ac2df7c Binary files /dev/null and b/cards100/event_26.avif differ diff --git a/cards100/event_26.webp b/cards100/event_26.webp deleted file mode 100644 index 6857624..0000000 Binary files a/cards100/event_26.webp and /dev/null differ diff --git a/cards100/event_27.avif b/cards100/event_27.avif new file mode 100644 index 0000000..4048947 Binary files /dev/null and b/cards100/event_27.avif differ diff --git a/cards100/event_27.webp b/cards100/event_27.webp deleted file mode 100644 index 1df14e8..0000000 Binary files a/cards100/event_27.webp and /dev/null differ diff --git a/cards100/event_28.avif b/cards100/event_28.avif new file mode 100644 index 0000000..681af23 Binary files /dev/null and b/cards100/event_28.avif differ diff --git a/cards100/event_28.webp b/cards100/event_28.webp deleted file mode 100644 index 0cc20de..0000000 Binary files a/cards100/event_28.webp and /dev/null differ diff --git a/cards100/event_29.avif b/cards100/event_29.avif new file mode 100644 index 0000000..151129c Binary files /dev/null and b/cards100/event_29.avif differ diff --git a/cards100/event_29.webp b/cards100/event_29.webp deleted file mode 100644 index 5936d7a..0000000 Binary files a/cards100/event_29.webp and /dev/null differ diff --git a/cards100/event_3.avif b/cards100/event_3.avif new file mode 100644 index 0000000..b2e60ae Binary files /dev/null and b/cards100/event_3.avif differ diff --git a/cards100/event_3.webp b/cards100/event_3.webp deleted file mode 100644 index 615215e..0000000 Binary files a/cards100/event_3.webp and /dev/null differ diff --git a/cards100/event_30.avif b/cards100/event_30.avif new file mode 100644 index 0000000..3adc58f Binary files /dev/null and b/cards100/event_30.avif differ diff --git a/cards100/event_30.webp b/cards100/event_30.webp deleted file mode 100644 index 654531c..0000000 Binary files a/cards100/event_30.webp and /dev/null differ diff --git a/cards100/event_31.avif b/cards100/event_31.avif new file mode 100644 index 0000000..c992c0b Binary files /dev/null and b/cards100/event_31.avif differ diff --git a/cards100/event_31.webp b/cards100/event_31.webp deleted file mode 100644 index 75cac9e..0000000 Binary files a/cards100/event_31.webp and /dev/null differ diff --git a/cards100/event_32.avif b/cards100/event_32.avif new file mode 100644 index 0000000..f555c22 Binary files /dev/null and b/cards100/event_32.avif differ diff --git a/cards100/event_32.webp b/cards100/event_32.webp deleted file mode 100644 index 5be58d1..0000000 Binary files a/cards100/event_32.webp and /dev/null differ diff --git a/cards100/event_33.avif b/cards100/event_33.avif new file mode 100644 index 0000000..0ddbabf Binary files /dev/null and b/cards100/event_33.avif differ diff --git a/cards100/event_33.webp b/cards100/event_33.webp deleted file mode 100644 index 8c73999..0000000 Binary files a/cards100/event_33.webp and /dev/null differ diff --git a/cards100/event_34.avif b/cards100/event_34.avif new file mode 100644 index 0000000..c3051b8 Binary files /dev/null and b/cards100/event_34.avif differ diff --git a/cards100/event_34.webp b/cards100/event_34.webp deleted file mode 100644 index 9206713..0000000 Binary files a/cards100/event_34.webp and /dev/null differ diff --git a/cards100/event_35.avif b/cards100/event_35.avif new file mode 100644 index 0000000..1c15ddd Binary files /dev/null and b/cards100/event_35.avif differ diff --git a/cards100/event_35.webp b/cards100/event_35.webp deleted file mode 100644 index 0f82965..0000000 Binary files a/cards100/event_35.webp and /dev/null differ diff --git a/cards100/event_36.avif b/cards100/event_36.avif new file mode 100644 index 0000000..7458365 Binary files /dev/null and b/cards100/event_36.avif differ diff --git a/cards100/event_36.webp b/cards100/event_36.webp deleted file mode 100644 index 6554efc..0000000 Binary files a/cards100/event_36.webp and /dev/null differ diff --git a/cards100/event_37.avif b/cards100/event_37.avif new file mode 100644 index 0000000..c1e057d Binary files /dev/null and b/cards100/event_37.avif differ diff --git a/cards100/event_37.webp b/cards100/event_37.webp deleted file mode 100644 index 0559a8d..0000000 Binary files a/cards100/event_37.webp and /dev/null differ diff --git a/cards100/event_38.avif b/cards100/event_38.avif new file mode 100644 index 0000000..25c31ef Binary files /dev/null and b/cards100/event_38.avif differ diff --git a/cards100/event_38.webp b/cards100/event_38.webp deleted file mode 100644 index 752ebe4..0000000 Binary files a/cards100/event_38.webp and /dev/null differ diff --git a/cards100/event_39.avif b/cards100/event_39.avif new file mode 100644 index 0000000..2d419e9 Binary files /dev/null and b/cards100/event_39.avif differ diff --git a/cards100/event_39.webp b/cards100/event_39.webp deleted file mode 100644 index b07edb8..0000000 Binary files a/cards100/event_39.webp and /dev/null differ diff --git a/cards100/event_4.avif b/cards100/event_4.avif new file mode 100644 index 0000000..c9c40e9 Binary files /dev/null and b/cards100/event_4.avif differ diff --git a/cards100/event_4.webp b/cards100/event_4.webp deleted file mode 100644 index 85b8f97..0000000 Binary files a/cards100/event_4.webp and /dev/null differ diff --git a/cards100/event_40.avif b/cards100/event_40.avif new file mode 100644 index 0000000..6e97826 Binary files /dev/null and b/cards100/event_40.avif differ diff --git a/cards100/event_40.webp b/cards100/event_40.webp deleted file mode 100644 index 005159f..0000000 Binary files a/cards100/event_40.webp and /dev/null differ diff --git a/cards100/event_41.avif b/cards100/event_41.avif new file mode 100644 index 0000000..e2682e8 Binary files /dev/null and b/cards100/event_41.avif differ diff --git a/cards100/event_41.webp b/cards100/event_41.webp deleted file mode 100644 index 049d0d1..0000000 Binary files a/cards100/event_41.webp and /dev/null differ diff --git a/cards100/event_42.avif b/cards100/event_42.avif new file mode 100644 index 0000000..23c0187 Binary files /dev/null and b/cards100/event_42.avif differ diff --git a/cards100/event_42.webp b/cards100/event_42.webp deleted file mode 100644 index 1aa629a..0000000 Binary files a/cards100/event_42.webp and /dev/null differ diff --git a/cards100/event_43.avif b/cards100/event_43.avif new file mode 100644 index 0000000..26dfa15 Binary files /dev/null and b/cards100/event_43.avif differ diff --git a/cards100/event_43.webp b/cards100/event_43.webp deleted file mode 100644 index 7c10f17..0000000 Binary files a/cards100/event_43.webp and /dev/null differ diff --git a/cards100/event_44.avif b/cards100/event_44.avif new file mode 100644 index 0000000..73b583a Binary files /dev/null and b/cards100/event_44.avif differ diff --git a/cards100/event_44.webp b/cards100/event_44.webp deleted file mode 100644 index 0bd7e7a..0000000 Binary files a/cards100/event_44.webp and /dev/null differ diff --git a/cards100/event_45.avif b/cards100/event_45.avif new file mode 100644 index 0000000..c16c96d Binary files /dev/null and b/cards100/event_45.avif differ diff --git a/cards100/event_45.webp b/cards100/event_45.webp deleted file mode 100644 index 4ecc80a..0000000 Binary files a/cards100/event_45.webp and /dev/null differ diff --git a/cards100/event_46.avif b/cards100/event_46.avif new file mode 100644 index 0000000..18b63da Binary files /dev/null and b/cards100/event_46.avif differ diff --git a/cards100/event_46.webp b/cards100/event_46.webp deleted file mode 100644 index 0da492b..0000000 Binary files a/cards100/event_46.webp and /dev/null differ diff --git a/cards100/event_47.avif b/cards100/event_47.avif new file mode 100644 index 0000000..ab72cc5 Binary files /dev/null and b/cards100/event_47.avif differ diff --git a/cards100/event_47.webp b/cards100/event_47.webp deleted file mode 100644 index 1e328c4..0000000 Binary files a/cards100/event_47.webp and /dev/null differ diff --git a/cards100/event_48.avif b/cards100/event_48.avif new file mode 100644 index 0000000..2a18459 Binary files /dev/null and b/cards100/event_48.avif differ diff --git a/cards100/event_48.webp b/cards100/event_48.webp deleted file mode 100644 index 4080080..0000000 Binary files a/cards100/event_48.webp and /dev/null differ diff --git a/cards100/event_49.avif b/cards100/event_49.avif new file mode 100644 index 0000000..ced038d Binary files /dev/null and b/cards100/event_49.avif differ diff --git a/cards100/event_49.webp b/cards100/event_49.webp deleted file mode 100644 index d5839a9..0000000 Binary files a/cards100/event_49.webp and /dev/null differ diff --git a/cards100/event_5.avif b/cards100/event_5.avif new file mode 100644 index 0000000..f7b344c Binary files /dev/null and b/cards100/event_5.avif differ diff --git a/cards100/event_5.webp b/cards100/event_5.webp deleted file mode 100644 index 216f8aa..0000000 Binary files a/cards100/event_5.webp and /dev/null differ diff --git a/cards100/event_50.avif b/cards100/event_50.avif new file mode 100644 index 0000000..8613ee9 Binary files /dev/null and b/cards100/event_50.avif differ diff --git a/cards100/event_50.webp b/cards100/event_50.webp deleted file mode 100644 index 2a9a351..0000000 Binary files a/cards100/event_50.webp and /dev/null differ diff --git a/cards100/event_51.avif b/cards100/event_51.avif new file mode 100644 index 0000000..0f186a9 Binary files /dev/null and b/cards100/event_51.avif differ diff --git a/cards100/event_51.webp b/cards100/event_51.webp deleted file mode 100644 index 21f241e..0000000 Binary files a/cards100/event_51.webp and /dev/null differ diff --git a/cards100/event_52.avif b/cards100/event_52.avif new file mode 100644 index 0000000..45b2bdb Binary files /dev/null and b/cards100/event_52.avif differ diff --git a/cards100/event_52.webp b/cards100/event_52.webp deleted file mode 100644 index 3543cc5..0000000 Binary files a/cards100/event_52.webp and /dev/null differ diff --git a/cards100/event_53.avif b/cards100/event_53.avif new file mode 100644 index 0000000..aeca080 Binary files /dev/null and b/cards100/event_53.avif differ diff --git a/cards100/event_53.webp b/cards100/event_53.webp deleted file mode 100644 index 9c400d4..0000000 Binary files a/cards100/event_53.webp and /dev/null differ diff --git a/cards100/event_54.avif b/cards100/event_54.avif new file mode 100644 index 0000000..535f399 Binary files /dev/null and b/cards100/event_54.avif differ diff --git a/cards100/event_54.webp b/cards100/event_54.webp deleted file mode 100644 index 5e3cb7a..0000000 Binary files a/cards100/event_54.webp and /dev/null differ diff --git a/cards100/event_55.avif b/cards100/event_55.avif new file mode 100644 index 0000000..cd04fed Binary files /dev/null and b/cards100/event_55.avif differ diff --git a/cards100/event_55.webp b/cards100/event_55.webp deleted file mode 100644 index a375e55..0000000 Binary files a/cards100/event_55.webp and /dev/null differ diff --git a/cards100/event_56.avif b/cards100/event_56.avif new file mode 100644 index 0000000..a6746f4 Binary files /dev/null and b/cards100/event_56.avif differ diff --git a/cards100/event_56.webp b/cards100/event_56.webp deleted file mode 100644 index 77144ff..0000000 Binary files a/cards100/event_56.webp and /dev/null differ diff --git a/cards100/event_57.avif b/cards100/event_57.avif new file mode 100644 index 0000000..a0457d2 Binary files /dev/null and b/cards100/event_57.avif differ diff --git a/cards100/event_57.webp b/cards100/event_57.webp deleted file mode 100644 index 563918a..0000000 Binary files a/cards100/event_57.webp and /dev/null differ diff --git a/cards100/event_58.avif b/cards100/event_58.avif new file mode 100644 index 0000000..cd37b4b Binary files /dev/null and b/cards100/event_58.avif differ diff --git a/cards100/event_58.webp b/cards100/event_58.webp deleted file mode 100644 index ac42fd3..0000000 Binary files a/cards100/event_58.webp and /dev/null differ diff --git a/cards100/event_59.avif b/cards100/event_59.avif new file mode 100644 index 0000000..80100da Binary files /dev/null and b/cards100/event_59.avif differ diff --git a/cards100/event_59.webp b/cards100/event_59.webp deleted file mode 100644 index c9c0343..0000000 Binary files a/cards100/event_59.webp and /dev/null differ diff --git a/cards100/event_6.avif b/cards100/event_6.avif new file mode 100644 index 0000000..0406527 Binary files /dev/null and b/cards100/event_6.avif differ diff --git a/cards100/event_6.webp b/cards100/event_6.webp deleted file mode 100644 index f269f09..0000000 Binary files a/cards100/event_6.webp and /dev/null differ diff --git a/cards100/event_60.avif b/cards100/event_60.avif new file mode 100644 index 0000000..b55b62e Binary files /dev/null and b/cards100/event_60.avif differ diff --git a/cards100/event_60.webp b/cards100/event_60.webp deleted file mode 100644 index 5d9af39..0000000 Binary files a/cards100/event_60.webp and /dev/null differ diff --git a/cards100/event_61.avif b/cards100/event_61.avif new file mode 100644 index 0000000..65c72e6 Binary files /dev/null and b/cards100/event_61.avif differ diff --git a/cards100/event_61.webp b/cards100/event_61.webp deleted file mode 100644 index dd061c5..0000000 Binary files a/cards100/event_61.webp and /dev/null differ diff --git a/cards100/event_62.avif b/cards100/event_62.avif new file mode 100644 index 0000000..94c450c Binary files /dev/null and b/cards100/event_62.avif differ diff --git a/cards100/event_62.webp b/cards100/event_62.webp deleted file mode 100644 index 4923062..0000000 Binary files a/cards100/event_62.webp and /dev/null differ diff --git a/cards100/event_63.avif b/cards100/event_63.avif new file mode 100644 index 0000000..cf804d4 Binary files /dev/null and b/cards100/event_63.avif differ diff --git a/cards100/event_63.webp b/cards100/event_63.webp deleted file mode 100644 index 1f19b96..0000000 Binary files a/cards100/event_63.webp and /dev/null differ diff --git a/cards100/event_64.avif b/cards100/event_64.avif new file mode 100644 index 0000000..26ac12a Binary files /dev/null and b/cards100/event_64.avif differ diff --git a/cards100/event_64.webp b/cards100/event_64.webp deleted file mode 100644 index 3dff036..0000000 Binary files a/cards100/event_64.webp and /dev/null differ diff --git a/cards100/event_65.avif b/cards100/event_65.avif new file mode 100644 index 0000000..2148e6f Binary files /dev/null and b/cards100/event_65.avif differ diff --git a/cards100/event_65.webp b/cards100/event_65.webp deleted file mode 100644 index bb59d6d..0000000 Binary files a/cards100/event_65.webp and /dev/null differ diff --git a/cards100/event_66.avif b/cards100/event_66.avif new file mode 100644 index 0000000..cb06200 Binary files /dev/null and b/cards100/event_66.avif differ diff --git a/cards100/event_66.webp b/cards100/event_66.webp deleted file mode 100644 index f9ae20e..0000000 Binary files a/cards100/event_66.webp and /dev/null differ diff --git a/cards100/event_67.avif b/cards100/event_67.avif new file mode 100644 index 0000000..8ec0229 Binary files /dev/null and b/cards100/event_67.avif differ diff --git a/cards100/event_67.webp b/cards100/event_67.webp deleted file mode 100644 index 163a191..0000000 Binary files a/cards100/event_67.webp and /dev/null differ diff --git a/cards100/event_68.avif b/cards100/event_68.avif new file mode 100644 index 0000000..f05faf9 Binary files /dev/null and b/cards100/event_68.avif differ diff --git a/cards100/event_68.webp b/cards100/event_68.webp deleted file mode 100644 index 693c794..0000000 Binary files a/cards100/event_68.webp and /dev/null differ diff --git a/cards100/event_69.avif b/cards100/event_69.avif new file mode 100644 index 0000000..ee3328f Binary files /dev/null and b/cards100/event_69.avif differ diff --git a/cards100/event_69.webp b/cards100/event_69.webp deleted file mode 100644 index a1c3bab..0000000 Binary files a/cards100/event_69.webp and /dev/null differ diff --git a/cards100/event_7.avif b/cards100/event_7.avif new file mode 100644 index 0000000..afa9d5b Binary files /dev/null and b/cards100/event_7.avif differ diff --git a/cards100/event_7.webp b/cards100/event_7.webp deleted file mode 100644 index 10a2e23..0000000 Binary files a/cards100/event_7.webp and /dev/null differ diff --git a/cards100/event_70.avif b/cards100/event_70.avif new file mode 100644 index 0000000..fe115d3 Binary files /dev/null and b/cards100/event_70.avif differ diff --git a/cards100/event_70.webp b/cards100/event_70.webp deleted file mode 100644 index 20866fb..0000000 Binary files a/cards100/event_70.webp and /dev/null differ diff --git a/cards100/event_71.avif b/cards100/event_71.avif new file mode 100644 index 0000000..6c9d371 Binary files /dev/null and b/cards100/event_71.avif differ diff --git a/cards100/event_71.webp b/cards100/event_71.webp deleted file mode 100644 index e82535a..0000000 Binary files a/cards100/event_71.webp and /dev/null differ diff --git a/cards100/event_72.avif b/cards100/event_72.avif new file mode 100644 index 0000000..12f6823 Binary files /dev/null and b/cards100/event_72.avif differ diff --git a/cards100/event_72.webp b/cards100/event_72.webp deleted file mode 100644 index b95bf49..0000000 Binary files a/cards100/event_72.webp and /dev/null differ diff --git a/cards100/event_73.avif b/cards100/event_73.avif new file mode 100644 index 0000000..a5ed01f Binary files /dev/null and b/cards100/event_73.avif differ diff --git a/cards100/event_73.webp b/cards100/event_73.webp deleted file mode 100644 index 1485ec9..0000000 Binary files a/cards100/event_73.webp and /dev/null differ diff --git a/cards100/event_74.avif b/cards100/event_74.avif new file mode 100644 index 0000000..b4b3e7a Binary files /dev/null and b/cards100/event_74.avif differ diff --git a/cards100/event_74.webp b/cards100/event_74.webp deleted file mode 100644 index a70215d..0000000 Binary files a/cards100/event_74.webp and /dev/null differ diff --git a/cards100/event_75.avif b/cards100/event_75.avif new file mode 100644 index 0000000..d141715 Binary files /dev/null and b/cards100/event_75.avif differ diff --git a/cards100/event_75.webp b/cards100/event_75.webp deleted file mode 100644 index a02e14f..0000000 Binary files a/cards100/event_75.webp and /dev/null differ diff --git a/cards100/event_76.avif b/cards100/event_76.avif new file mode 100644 index 0000000..9a41b7c Binary files /dev/null and b/cards100/event_76.avif differ diff --git a/cards100/event_76.webp b/cards100/event_76.webp deleted file mode 100644 index b545394..0000000 Binary files a/cards100/event_76.webp and /dev/null differ diff --git a/cards100/event_77.avif b/cards100/event_77.avif new file mode 100644 index 0000000..3f60046 Binary files /dev/null and b/cards100/event_77.avif differ diff --git a/cards100/event_77.webp b/cards100/event_77.webp deleted file mode 100644 index 1d6f894..0000000 Binary files a/cards100/event_77.webp and /dev/null differ diff --git a/cards100/event_78.avif b/cards100/event_78.avif new file mode 100644 index 0000000..f197dc2 Binary files /dev/null and b/cards100/event_78.avif differ diff --git a/cards100/event_78.webp b/cards100/event_78.webp deleted file mode 100644 index 86d9b7a..0000000 Binary files a/cards100/event_78.webp and /dev/null differ diff --git a/cards100/event_79.avif b/cards100/event_79.avif new file mode 100644 index 0000000..39fa388 Binary files /dev/null and b/cards100/event_79.avif differ diff --git a/cards100/event_79.webp b/cards100/event_79.webp deleted file mode 100644 index 2645194..0000000 Binary files a/cards100/event_79.webp and /dev/null differ diff --git a/cards100/event_8.avif b/cards100/event_8.avif new file mode 100644 index 0000000..50d83a9 Binary files /dev/null and b/cards100/event_8.avif differ diff --git a/cards100/event_8.webp b/cards100/event_8.webp deleted file mode 100644 index 45f5d54..0000000 Binary files a/cards100/event_8.webp and /dev/null differ diff --git a/cards100/event_80.avif b/cards100/event_80.avif new file mode 100644 index 0000000..2dd6515 Binary files /dev/null and b/cards100/event_80.avif differ diff --git a/cards100/event_80.webp b/cards100/event_80.webp deleted file mode 100644 index 8f0121b..0000000 Binary files a/cards100/event_80.webp and /dev/null differ diff --git a/cards100/event_81.avif b/cards100/event_81.avif new file mode 100644 index 0000000..ef1fe2d Binary files /dev/null and b/cards100/event_81.avif differ diff --git a/cards100/event_81.webp b/cards100/event_81.webp deleted file mode 100644 index 6a11c26..0000000 Binary files a/cards100/event_81.webp and /dev/null differ diff --git a/cards100/event_82.avif b/cards100/event_82.avif new file mode 100644 index 0000000..40bd53e Binary files /dev/null and b/cards100/event_82.avif differ diff --git a/cards100/event_82.webp b/cards100/event_82.webp deleted file mode 100644 index 0150f59..0000000 Binary files a/cards100/event_82.webp and /dev/null differ diff --git a/cards100/event_83.avif b/cards100/event_83.avif new file mode 100644 index 0000000..e533c8a Binary files /dev/null and b/cards100/event_83.avif differ diff --git a/cards100/event_83.webp b/cards100/event_83.webp deleted file mode 100644 index ba1aa9c..0000000 Binary files a/cards100/event_83.webp and /dev/null differ diff --git a/cards100/event_84.avif b/cards100/event_84.avif new file mode 100644 index 0000000..693ba84 Binary files /dev/null and b/cards100/event_84.avif differ diff --git a/cards100/event_84.webp b/cards100/event_84.webp deleted file mode 100644 index 18faf7c..0000000 Binary files a/cards100/event_84.webp and /dev/null differ diff --git a/cards100/event_85.avif b/cards100/event_85.avif new file mode 100644 index 0000000..f1483a4 Binary files /dev/null and b/cards100/event_85.avif differ diff --git a/cards100/event_85.webp b/cards100/event_85.webp deleted file mode 100644 index 55aec5f..0000000 Binary files a/cards100/event_85.webp and /dev/null differ diff --git a/cards100/event_86.avif b/cards100/event_86.avif new file mode 100644 index 0000000..ed7694d Binary files /dev/null and b/cards100/event_86.avif differ diff --git a/cards100/event_86.webp b/cards100/event_86.webp deleted file mode 100644 index 405d128..0000000 Binary files a/cards100/event_86.webp and /dev/null differ diff --git a/cards100/event_87.avif b/cards100/event_87.avif new file mode 100644 index 0000000..4809e10 Binary files /dev/null and b/cards100/event_87.avif differ diff --git a/cards100/event_87.webp b/cards100/event_87.webp deleted file mode 100644 index 946e7f2..0000000 Binary files a/cards100/event_87.webp and /dev/null differ diff --git a/cards100/event_88.avif b/cards100/event_88.avif new file mode 100644 index 0000000..3ff4500 Binary files /dev/null and b/cards100/event_88.avif differ diff --git a/cards100/event_88.webp b/cards100/event_88.webp deleted file mode 100644 index 616d762..0000000 Binary files a/cards100/event_88.webp and /dev/null differ diff --git a/cards100/event_89.avif b/cards100/event_89.avif new file mode 100644 index 0000000..1d75010 Binary files /dev/null and b/cards100/event_89.avif differ diff --git a/cards100/event_89.webp b/cards100/event_89.webp deleted file mode 100644 index a443a43..0000000 Binary files a/cards100/event_89.webp and /dev/null differ diff --git a/cards100/event_9.avif b/cards100/event_9.avif new file mode 100644 index 0000000..b5969d3 Binary files /dev/null and b/cards100/event_9.avif differ diff --git a/cards100/event_9.webp b/cards100/event_9.webp deleted file mode 100644 index 4e13dce..0000000 Binary files a/cards100/event_9.webp and /dev/null differ diff --git a/cards100/event_90.avif b/cards100/event_90.avif new file mode 100644 index 0000000..05af165 Binary files /dev/null and b/cards100/event_90.avif differ diff --git a/cards100/event_90.webp b/cards100/event_90.webp deleted file mode 100644 index fc59998..0000000 Binary files a/cards100/event_90.webp and /dev/null differ diff --git a/cards100/event_91.avif b/cards100/event_91.avif new file mode 100644 index 0000000..ea1c3b3 Binary files /dev/null and b/cards100/event_91.avif differ diff --git a/cards100/event_91.webp b/cards100/event_91.webp deleted file mode 100644 index 76cc566..0000000 Binary files a/cards100/event_91.webp and /dev/null differ diff --git a/cards100/event_92.avif b/cards100/event_92.avif new file mode 100644 index 0000000..1d04c24 Binary files /dev/null and b/cards100/event_92.avif differ diff --git a/cards100/event_92.webp b/cards100/event_92.webp deleted file mode 100644 index b3af374..0000000 Binary files a/cards100/event_92.webp and /dev/null differ diff --git a/cards100/event_93.avif b/cards100/event_93.avif new file mode 100644 index 0000000..1a7bae8 Binary files /dev/null and b/cards100/event_93.avif differ diff --git a/cards100/event_93.webp b/cards100/event_93.webp deleted file mode 100644 index 6c0cb28..0000000 Binary files a/cards100/event_93.webp and /dev/null differ diff --git a/cards100/event_94.avif b/cards100/event_94.avif new file mode 100644 index 0000000..5349a30 Binary files /dev/null and b/cards100/event_94.avif differ diff --git a/cards100/event_94.webp b/cards100/event_94.webp deleted file mode 100644 index 7b936ba..0000000 Binary files a/cards100/event_94.webp and /dev/null differ diff --git a/cards100/event_95.avif b/cards100/event_95.avif new file mode 100644 index 0000000..5af37d7 Binary files /dev/null and b/cards100/event_95.avif differ diff --git a/cards100/event_95.webp b/cards100/event_95.webp deleted file mode 100644 index 0e56227..0000000 Binary files a/cards100/event_95.webp and /dev/null differ diff --git a/cards100/event_96.avif b/cards100/event_96.avif new file mode 100644 index 0000000..54aea89 Binary files /dev/null and b/cards100/event_96.avif differ diff --git a/cards100/event_96.webp b/cards100/event_96.webp deleted file mode 100644 index e7aa49b..0000000 Binary files a/cards100/event_96.webp and /dev/null differ diff --git a/cards100/event_97.avif b/cards100/event_97.avif new file mode 100644 index 0000000..dcd0d63 Binary files /dev/null and b/cards100/event_97.avif differ diff --git a/cards100/event_97.webp b/cards100/event_97.webp deleted file mode 100644 index ad176d6..0000000 Binary files a/cards100/event_97.webp and /dev/null differ diff --git a/cards100/event_98.avif b/cards100/event_98.avif new file mode 100644 index 0000000..0c4b3dc Binary files /dev/null and b/cards100/event_98.avif differ diff --git a/cards100/event_98.webp b/cards100/event_98.webp deleted file mode 100644 index d77bdd9..0000000 Binary files a/cards100/event_98.webp and /dev/null differ diff --git a/cards100/event_99.avif b/cards100/event_99.avif new file mode 100644 index 0000000..bf16fa2 Binary files /dev/null and b/cards100/event_99.avif differ diff --git a/cards100/event_99.webp b/cards100/event_99.webp deleted file mode 100644 index f3c0353..0000000 Binary files a/cards100/event_99.webp and /dev/null differ diff --git a/cards100/event_back.avif b/cards100/event_back.avif new file mode 100644 index 0000000..715ef09 Binary files /dev/null and b/cards100/event_back.avif differ diff --git a/cards100/event_back.webp b/cards100/event_back.webp deleted file mode 100644 index 1831576..0000000 Binary files a/cards100/event_back.webp and /dev/null differ diff --git a/cards100/power_1.png b/cards100/power_1.png deleted file mode 100644 index 36d5b6c..0000000 Binary files a/cards100/power_1.png and /dev/null differ diff --git a/cards100/power_1.webp b/cards100/power_1.webp deleted file mode 100644 index e01bdc9..0000000 Binary files a/cards100/power_1.webp and /dev/null differ diff --git a/cards100/power_10.png b/cards100/power_10.png deleted file mode 100644 index 328d6b1..0000000 Binary files a/cards100/power_10.png and /dev/null differ diff --git a/cards100/power_10.webp b/cards100/power_10.webp deleted file mode 100644 index 4c67d42..0000000 Binary files a/cards100/power_10.webp and /dev/null differ diff --git a/cards100/power_11.png b/cards100/power_11.png deleted file mode 100644 index d2f472a..0000000 Binary files a/cards100/power_11.png and /dev/null differ diff --git a/cards100/power_11.webp b/cards100/power_11.webp deleted file mode 100644 index c81b9d1..0000000 Binary files a/cards100/power_11.webp and /dev/null differ diff --git a/cards100/power_11_14.avif b/cards100/power_11_14.avif new file mode 100644 index 0000000..99a94d6 Binary files /dev/null and b/cards100/power_11_14.avif differ diff --git a/cards100/power_11_14.png b/cards100/power_11_14.png new file mode 100644 index 0000000..851d3a6 Binary files /dev/null and b/cards100/power_11_14.png differ diff --git a/cards100/power_12.png b/cards100/power_12.png deleted file mode 100644 index 951d0d5..0000000 Binary files a/cards100/power_12.png and /dev/null differ diff --git a/cards100/power_12.webp b/cards100/power_12.webp deleted file mode 100644 index 42e0ba3..0000000 Binary files a/cards100/power_12.webp and /dev/null differ diff --git a/cards100/power_13.png b/cards100/power_13.png deleted file mode 100644 index 84ff247..0000000 Binary files a/cards100/power_13.png and /dev/null differ diff --git a/cards100/power_13.webp b/cards100/power_13.webp deleted file mode 100644 index 2de981f..0000000 Binary files a/cards100/power_13.webp and /dev/null differ diff --git a/cards100/power_14.png b/cards100/power_14.png deleted file mode 100644 index bc76c71..0000000 Binary files a/cards100/power_14.png and /dev/null differ diff --git a/cards100/power_14.webp b/cards100/power_14.webp deleted file mode 100644 index 0d0fdc3..0000000 Binary files a/cards100/power_14.webp and /dev/null differ diff --git a/cards100/power_15.png b/cards100/power_15.png deleted file mode 100644 index ad89b9f..0000000 Binary files a/cards100/power_15.png and /dev/null differ diff --git a/cards100/power_15.webp b/cards100/power_15.webp deleted file mode 100644 index 3962a61..0000000 Binary files a/cards100/power_15.webp and /dev/null differ diff --git a/cards100/power_15_18.avif b/cards100/power_15_18.avif new file mode 100644 index 0000000..567c985 Binary files /dev/null and b/cards100/power_15_18.avif differ diff --git a/cards100/power_15_18.png b/cards100/power_15_18.png new file mode 100644 index 0000000..c423193 Binary files /dev/null and b/cards100/power_15_18.png differ diff --git a/cards100/power_16.png b/cards100/power_16.png deleted file mode 100644 index 5b5bea9..0000000 Binary files a/cards100/power_16.png and /dev/null differ diff --git a/cards100/power_16.webp b/cards100/power_16.webp deleted file mode 100644 index 8b6b67e..0000000 Binary files a/cards100/power_16.webp and /dev/null differ diff --git a/cards100/power_17.png b/cards100/power_17.png deleted file mode 100644 index 1c59736..0000000 Binary files a/cards100/power_17.png and /dev/null differ diff --git a/cards100/power_17.webp b/cards100/power_17.webp deleted file mode 100644 index 4badde7..0000000 Binary files a/cards100/power_17.webp and /dev/null differ diff --git a/cards100/power_18.png b/cards100/power_18.png deleted file mode 100644 index 620d7fe..0000000 Binary files a/cards100/power_18.png and /dev/null differ diff --git a/cards100/power_18.webp b/cards100/power_18.webp deleted file mode 100644 index 539fe52..0000000 Binary files a/cards100/power_18.webp and /dev/null differ diff --git a/cards100/power_19.png b/cards100/power_19.png deleted file mode 100644 index 1597664..0000000 Binary files a/cards100/power_19.png and /dev/null differ diff --git a/cards100/power_19.webp b/cards100/power_19.webp deleted file mode 100644 index 959f1b6..0000000 Binary files a/cards100/power_19.webp and /dev/null differ diff --git a/cards100/power_19_20.avif b/cards100/power_19_20.avif new file mode 100644 index 0000000..d294643 Binary files /dev/null and b/cards100/power_19_20.avif differ diff --git a/cards100/power_19_20.png b/cards100/power_19_20.png new file mode 100644 index 0000000..5f4051c Binary files /dev/null and b/cards100/power_19_20.png differ diff --git a/cards100/power_1_6.avif b/cards100/power_1_6.avif new file mode 100644 index 0000000..d32d9f7 Binary files /dev/null and b/cards100/power_1_6.avif differ diff --git a/cards100/power_1_6.png b/cards100/power_1_6.png new file mode 100644 index 0000000..6f11210 Binary files /dev/null and b/cards100/power_1_6.png differ diff --git a/cards100/power_2.png b/cards100/power_2.png deleted file mode 100644 index d0b22aa..0000000 Binary files a/cards100/power_2.png and /dev/null differ diff --git a/cards100/power_2.webp b/cards100/power_2.webp deleted file mode 100644 index 53f0f22..0000000 Binary files a/cards100/power_2.webp and /dev/null differ diff --git a/cards100/power_20.png b/cards100/power_20.png deleted file mode 100644 index 5edde2b..0000000 Binary files a/cards100/power_20.png and /dev/null differ diff --git a/cards100/power_20.webp b/cards100/power_20.webp deleted file mode 100644 index f3a3152..0000000 Binary files a/cards100/power_20.webp and /dev/null differ diff --git a/cards100/power_21.png b/cards100/power_21.png deleted file mode 100644 index 903b1f3..0000000 Binary files a/cards100/power_21.png and /dev/null differ diff --git a/cards100/power_21.webp b/cards100/power_21.webp deleted file mode 100644 index 27398d3..0000000 Binary files a/cards100/power_21.webp and /dev/null differ diff --git a/cards100/power_21_22.avif b/cards100/power_21_22.avif new file mode 100644 index 0000000..7c53244 Binary files /dev/null and b/cards100/power_21_22.avif differ diff --git a/cards100/power_21_22.png b/cards100/power_21_22.png new file mode 100644 index 0000000..374f43d Binary files /dev/null and b/cards100/power_21_22.png differ diff --git a/cards100/power_22.png b/cards100/power_22.png deleted file mode 100644 index e3594c6..0000000 Binary files a/cards100/power_22.png and /dev/null differ diff --git a/cards100/power_22.webp b/cards100/power_22.webp deleted file mode 100644 index f62db58..0000000 Binary files a/cards100/power_22.webp and /dev/null differ diff --git a/cards100/power_23.png b/cards100/power_23.png deleted file mode 100644 index 294582f..0000000 Binary files a/cards100/power_23.png and /dev/null differ diff --git a/cards100/power_23.webp b/cards100/power_23.webp deleted file mode 100644 index c2f4b33..0000000 Binary files a/cards100/power_23.webp and /dev/null differ diff --git a/cards100/power_23_26.avif b/cards100/power_23_26.avif new file mode 100644 index 0000000..5383a86 Binary files /dev/null and b/cards100/power_23_26.avif differ diff --git a/cards100/power_23_26.png b/cards100/power_23_26.png new file mode 100644 index 0000000..3c7f2d1 Binary files /dev/null and b/cards100/power_23_26.png differ diff --git a/cards100/power_24.png b/cards100/power_24.png deleted file mode 100644 index 28266a4..0000000 Binary files a/cards100/power_24.png and /dev/null differ diff --git a/cards100/power_24.webp b/cards100/power_24.webp deleted file mode 100644 index 6c843d1..0000000 Binary files a/cards100/power_24.webp and /dev/null differ diff --git a/cards100/power_25.png b/cards100/power_25.png deleted file mode 100644 index 52fa015..0000000 Binary files a/cards100/power_25.png and /dev/null differ diff --git a/cards100/power_25.webp b/cards100/power_25.webp deleted file mode 100644 index 1c399c6..0000000 Binary files a/cards100/power_25.webp and /dev/null differ diff --git a/cards100/power_26.png b/cards100/power_26.png deleted file mode 100644 index e150da5..0000000 Binary files a/cards100/power_26.png and /dev/null differ diff --git a/cards100/power_26.webp b/cards100/power_26.webp deleted file mode 100644 index 60cfba3..0000000 Binary files a/cards100/power_26.webp and /dev/null differ diff --git a/cards100/power_27.png b/cards100/power_27.png deleted file mode 100644 index b249ff4..0000000 Binary files a/cards100/power_27.png and /dev/null differ diff --git a/cards100/power_27.webp b/cards100/power_27.webp deleted file mode 100644 index 9cafa90..0000000 Binary files a/cards100/power_27.webp and /dev/null differ diff --git a/cards100/power_27_30.avif b/cards100/power_27_30.avif new file mode 100644 index 0000000..5d87825 Binary files /dev/null and b/cards100/power_27_30.avif differ diff --git a/cards100/power_27_30.png b/cards100/power_27_30.png new file mode 100644 index 0000000..ee5f176 Binary files /dev/null and b/cards100/power_27_30.png differ diff --git a/cards100/power_28.png b/cards100/power_28.png deleted file mode 100644 index 25f52c7..0000000 Binary files a/cards100/power_28.png and /dev/null differ diff --git a/cards100/power_28.webp b/cards100/power_28.webp deleted file mode 100644 index e2c5498..0000000 Binary files a/cards100/power_28.webp and /dev/null differ diff --git a/cards100/power_29.png b/cards100/power_29.png deleted file mode 100644 index 8448731..0000000 Binary files a/cards100/power_29.png and /dev/null differ diff --git a/cards100/power_29.webp b/cards100/power_29.webp deleted file mode 100644 index 38a2d25..0000000 Binary files a/cards100/power_29.webp and /dev/null differ diff --git a/cards100/power_3.png b/cards100/power_3.png deleted file mode 100644 index 3b76698..0000000 Binary files a/cards100/power_3.png and /dev/null differ diff --git a/cards100/power_3.webp b/cards100/power_3.webp deleted file mode 100644 index ea0c4ee..0000000 Binary files a/cards100/power_3.webp and /dev/null differ diff --git a/cards100/power_30.png b/cards100/power_30.png deleted file mode 100644 index d507cbb..0000000 Binary files a/cards100/power_30.png and /dev/null differ diff --git a/cards100/power_30.webp b/cards100/power_30.webp deleted file mode 100644 index 4020aa5..0000000 Binary files a/cards100/power_30.webp and /dev/null differ diff --git a/cards100/power_31.png b/cards100/power_31.png deleted file mode 100644 index 7d839f7..0000000 Binary files a/cards100/power_31.png and /dev/null differ diff --git a/cards100/power_31.webp b/cards100/power_31.webp deleted file mode 100644 index a6b94b4..0000000 Binary files a/cards100/power_31.webp and /dev/null differ diff --git a/cards100/power_31_33.avif b/cards100/power_31_33.avif new file mode 100644 index 0000000..b2eb010 Binary files /dev/null and b/cards100/power_31_33.avif differ diff --git a/cards100/power_31_33.png b/cards100/power_31_33.png new file mode 100644 index 0000000..4893bb7 Binary files /dev/null and b/cards100/power_31_33.png differ diff --git a/cards100/power_32.png b/cards100/power_32.png deleted file mode 100644 index d5f9f8f..0000000 Binary files a/cards100/power_32.png and /dev/null differ diff --git a/cards100/power_32.webp b/cards100/power_32.webp deleted file mode 100644 index 159dbf3..0000000 Binary files a/cards100/power_32.webp and /dev/null differ diff --git a/cards100/power_33.png b/cards100/power_33.png deleted file mode 100644 index 20ec7ed..0000000 Binary files a/cards100/power_33.png and /dev/null differ diff --git a/cards100/power_33.webp b/cards100/power_33.webp deleted file mode 100644 index 52844cd..0000000 Binary files a/cards100/power_33.webp and /dev/null differ diff --git a/cards100/power_34.png b/cards100/power_34.png deleted file mode 100644 index 2eec511..0000000 Binary files a/cards100/power_34.png and /dev/null differ diff --git a/cards100/power_34.webp b/cards100/power_34.webp deleted file mode 100644 index 79fbab6..0000000 Binary files a/cards100/power_34.webp and /dev/null differ diff --git a/cards100/power_34_36.avif b/cards100/power_34_36.avif new file mode 100644 index 0000000..ba41c68 Binary files /dev/null and b/cards100/power_34_36.avif differ diff --git a/cards100/power_34_36.png b/cards100/power_34_36.png new file mode 100644 index 0000000..1323183 Binary files /dev/null and b/cards100/power_34_36.png differ diff --git a/cards100/power_35.png b/cards100/power_35.png deleted file mode 100644 index a06db14..0000000 Binary files a/cards100/power_35.png and /dev/null differ diff --git a/cards100/power_35.webp b/cards100/power_35.webp deleted file mode 100644 index e71905d..0000000 Binary files a/cards100/power_35.webp and /dev/null differ diff --git a/cards100/power_36.png b/cards100/power_36.png deleted file mode 100644 index 9c07e35..0000000 Binary files a/cards100/power_36.png and /dev/null differ diff --git a/cards100/power_36.webp b/cards100/power_36.webp deleted file mode 100644 index 40b707e..0000000 Binary files a/cards100/power_36.webp and /dev/null differ diff --git a/cards100/power_37.avif b/cards100/power_37.avif new file mode 100644 index 0000000..a253b5e Binary files /dev/null and b/cards100/power_37.avif differ diff --git a/cards100/power_37.png b/cards100/power_37.png index ed22a02..6547778 100644 Binary files a/cards100/power_37.png and b/cards100/power_37.png differ diff --git a/cards100/power_37.webp b/cards100/power_37.webp deleted file mode 100644 index bca0b98..0000000 Binary files a/cards100/power_37.webp and /dev/null differ diff --git a/cards100/power_38.avif b/cards100/power_38.avif new file mode 100644 index 0000000..177dbcb Binary files /dev/null and b/cards100/power_38.avif differ diff --git a/cards100/power_38.png b/cards100/power_38.png index f2d19c2..82f3409 100644 Binary files a/cards100/power_38.png and b/cards100/power_38.png differ diff --git a/cards100/power_38.webp b/cards100/power_38.webp deleted file mode 100644 index eb0ff2e..0000000 Binary files a/cards100/power_38.webp and /dev/null differ diff --git a/cards100/power_39.avif b/cards100/power_39.avif new file mode 100644 index 0000000..93fec10 Binary files /dev/null and b/cards100/power_39.avif differ diff --git a/cards100/power_39.png b/cards100/power_39.png index 8056a8c..66401f1 100644 Binary files a/cards100/power_39.png and b/cards100/power_39.png differ diff --git a/cards100/power_39.webp b/cards100/power_39.webp deleted file mode 100644 index 8affe3b..0000000 Binary files a/cards100/power_39.webp and /dev/null differ diff --git a/cards100/power_4.png b/cards100/power_4.png deleted file mode 100644 index 898b8a5..0000000 Binary files a/cards100/power_4.png and /dev/null differ diff --git a/cards100/power_4.webp b/cards100/power_4.webp deleted file mode 100644 index a7a0967..0000000 Binary files a/cards100/power_4.webp and /dev/null differ diff --git a/cards100/power_40.avif b/cards100/power_40.avif new file mode 100644 index 0000000..4749fa6 Binary files /dev/null and b/cards100/power_40.avif differ diff --git a/cards100/power_40.png b/cards100/power_40.png index 1295beb..de465a1 100644 Binary files a/cards100/power_40.png and b/cards100/power_40.png differ diff --git a/cards100/power_40.webp b/cards100/power_40.webp deleted file mode 100644 index d212e3f..0000000 Binary files a/cards100/power_40.webp and /dev/null differ diff --git a/cards100/power_41.avif b/cards100/power_41.avif new file mode 100644 index 0000000..545eb46 Binary files /dev/null and b/cards100/power_41.avif differ diff --git a/cards100/power_41.png b/cards100/power_41.png index b623ee7..f041011 100644 Binary files a/cards100/power_41.png and b/cards100/power_41.png differ diff --git a/cards100/power_41.webp b/cards100/power_41.webp deleted file mode 100644 index 28b500d..0000000 Binary files a/cards100/power_41.webp and /dev/null differ diff --git a/cards100/power_42.avif b/cards100/power_42.avif new file mode 100644 index 0000000..7bc72e2 Binary files /dev/null and b/cards100/power_42.avif differ diff --git a/cards100/power_42.png b/cards100/power_42.png index d6e4fc5..a90d36d 100644 Binary files a/cards100/power_42.png and b/cards100/power_42.png differ diff --git a/cards100/power_42.webp b/cards100/power_42.webp deleted file mode 100644 index aac8880..0000000 Binary files a/cards100/power_42.webp and /dev/null differ diff --git a/cards100/power_43.avif b/cards100/power_43.avif new file mode 100644 index 0000000..60d4c88 Binary files /dev/null and b/cards100/power_43.avif differ diff --git a/cards100/power_43.png b/cards100/power_43.png index 42d51e8..615cef9 100644 Binary files a/cards100/power_43.png and b/cards100/power_43.png differ diff --git a/cards100/power_43.webp b/cards100/power_43.webp deleted file mode 100644 index 7d46505..0000000 Binary files a/cards100/power_43.webp and /dev/null differ diff --git a/cards100/power_44.avif b/cards100/power_44.avif new file mode 100644 index 0000000..e726f93 Binary files /dev/null and b/cards100/power_44.avif differ diff --git a/cards100/power_44.png b/cards100/power_44.png index cf1405e..53c8352 100644 Binary files a/cards100/power_44.png and b/cards100/power_44.png differ diff --git a/cards100/power_44.webp b/cards100/power_44.webp deleted file mode 100644 index b91e3e0..0000000 Binary files a/cards100/power_44.webp and /dev/null differ diff --git a/cards100/power_45.avif b/cards100/power_45.avif new file mode 100644 index 0000000..f0b2264 Binary files /dev/null and b/cards100/power_45.avif differ diff --git a/cards100/power_45.png b/cards100/power_45.png index 41a2452..e4cf94b 100644 Binary files a/cards100/power_45.png and b/cards100/power_45.png differ diff --git a/cards100/power_45.webp b/cards100/power_45.webp deleted file mode 100644 index 29a6c9a..0000000 Binary files a/cards100/power_45.webp and /dev/null differ diff --git a/cards100/power_46.avif b/cards100/power_46.avif new file mode 100644 index 0000000..5f60764 Binary files /dev/null and b/cards100/power_46.avif differ diff --git a/cards100/power_46.png b/cards100/power_46.png index 95e6656..83e61f5 100644 Binary files a/cards100/power_46.png and b/cards100/power_46.png differ diff --git a/cards100/power_46.webp b/cards100/power_46.webp deleted file mode 100644 index c234226..0000000 Binary files a/cards100/power_46.webp and /dev/null differ diff --git a/cards100/power_47.avif b/cards100/power_47.avif new file mode 100644 index 0000000..0660baa Binary files /dev/null and b/cards100/power_47.avif differ diff --git a/cards100/power_47.png b/cards100/power_47.png index f9f61f0..ecccc20 100644 Binary files a/cards100/power_47.png and b/cards100/power_47.png differ diff --git a/cards100/power_47.webp b/cards100/power_47.webp deleted file mode 100644 index 172684a..0000000 Binary files a/cards100/power_47.webp and /dev/null differ diff --git a/cards100/power_48.avif b/cards100/power_48.avif new file mode 100644 index 0000000..bf54c7f Binary files /dev/null and b/cards100/power_48.avif differ diff --git a/cards100/power_48.png b/cards100/power_48.png index f4383cf..8ac724d 100644 Binary files a/cards100/power_48.png and b/cards100/power_48.png differ diff --git a/cards100/power_48.webp b/cards100/power_48.webp deleted file mode 100644 index 6b84ae8..0000000 Binary files a/cards100/power_48.webp and /dev/null differ diff --git a/cards100/power_49.avif b/cards100/power_49.avif new file mode 100644 index 0000000..772118a Binary files /dev/null and b/cards100/power_49.avif differ diff --git a/cards100/power_49.png b/cards100/power_49.png index 62d0af2..b1c6d23 100644 Binary files a/cards100/power_49.png and b/cards100/power_49.png differ diff --git a/cards100/power_49.webp b/cards100/power_49.webp deleted file mode 100644 index bc7d68a..0000000 Binary files a/cards100/power_49.webp and /dev/null differ diff --git a/cards100/power_5.png b/cards100/power_5.png deleted file mode 100644 index 8e61d06..0000000 Binary files a/cards100/power_5.png and /dev/null differ diff --git a/cards100/power_5.webp b/cards100/power_5.webp deleted file mode 100644 index 7f8d1a8..0000000 Binary files a/cards100/power_5.webp and /dev/null differ diff --git a/cards100/power_50.avif b/cards100/power_50.avif new file mode 100644 index 0000000..35e6390 Binary files /dev/null and b/cards100/power_50.avif differ diff --git a/cards100/power_50.png b/cards100/power_50.png index ea6b15f..6f9d90a 100644 Binary files a/cards100/power_50.png and b/cards100/power_50.png differ diff --git a/cards100/power_50.webp b/cards100/power_50.webp deleted file mode 100644 index 1991d98..0000000 Binary files a/cards100/power_50.webp and /dev/null differ diff --git a/cards100/power_51.avif b/cards100/power_51.avif new file mode 100644 index 0000000..d94c98c Binary files /dev/null and b/cards100/power_51.avif differ diff --git a/cards100/power_51.png b/cards100/power_51.png index 102aab0..f1d1bb9 100644 Binary files a/cards100/power_51.png and b/cards100/power_51.png differ diff --git a/cards100/power_51.webp b/cards100/power_51.webp deleted file mode 100644 index 1cea87c..0000000 Binary files a/cards100/power_51.webp and /dev/null differ diff --git a/cards100/power_52.avif b/cards100/power_52.avif new file mode 100644 index 0000000..c467932 Binary files /dev/null and b/cards100/power_52.avif differ diff --git a/cards100/power_52.png b/cards100/power_52.png index 90865ce..489a5ca 100644 Binary files a/cards100/power_52.png and b/cards100/power_52.png differ diff --git a/cards100/power_52.webp b/cards100/power_52.webp deleted file mode 100644 index 0c66b00..0000000 Binary files a/cards100/power_52.webp and /dev/null differ diff --git a/cards100/power_6.png b/cards100/power_6.png deleted file mode 100644 index 70c889b..0000000 Binary files a/cards100/power_6.png and /dev/null differ diff --git a/cards100/power_6.webp b/cards100/power_6.webp deleted file mode 100644 index df790b4..0000000 Binary files a/cards100/power_6.webp and /dev/null differ diff --git a/cards100/power_7.png b/cards100/power_7.png deleted file mode 100644 index d848d3f..0000000 Binary files a/cards100/power_7.png and /dev/null differ diff --git a/cards100/power_7.webp b/cards100/power_7.webp deleted file mode 100644 index 1232080..0000000 Binary files a/cards100/power_7.webp and /dev/null differ diff --git a/cards100/power_7_8.avif b/cards100/power_7_8.avif new file mode 100644 index 0000000..40ef1ac Binary files /dev/null and b/cards100/power_7_8.avif differ diff --git a/cards100/power_7_8.png b/cards100/power_7_8.png new file mode 100644 index 0000000..5a5afce Binary files /dev/null and b/cards100/power_7_8.png differ diff --git a/cards100/power_8.png b/cards100/power_8.png deleted file mode 100644 index 1f4f19f..0000000 Binary files a/cards100/power_8.png and /dev/null differ diff --git a/cards100/power_8.webp b/cards100/power_8.webp deleted file mode 100644 index 6233375..0000000 Binary files a/cards100/power_8.webp and /dev/null differ diff --git a/cards100/power_9.png b/cards100/power_9.png deleted file mode 100644 index f0274ce..0000000 Binary files a/cards100/power_9.png and /dev/null differ diff --git a/cards100/power_9.webp b/cards100/power_9.webp deleted file mode 100644 index 37ad104..0000000 Binary files a/cards100/power_9.webp and /dev/null differ diff --git a/cards100/power_9_10.avif b/cards100/power_9_10.avif new file mode 100644 index 0000000..a2ef4d3 Binary files /dev/null and b/cards100/power_9_10.avif differ diff --git a/cards100/power_9_10.png b/cards100/power_9_10.png new file mode 100644 index 0000000..bfaa5aa Binary files /dev/null and b/cards100/power_9_10.png differ diff --git a/cards100/power_back.avif b/cards100/power_back.avif new file mode 100644 index 0000000..415313f Binary files /dev/null and b/cards100/power_back.avif differ diff --git a/cards100/power_back.png b/cards100/power_back.png index a5e7824..ea26bb5 100644 Binary files a/cards100/power_back.png and b/cards100/power_back.png differ diff --git a/cards100/power_back.webp b/cards100/power_back.webp deleted file mode 100644 index cc3ed96..0000000 Binary files a/cards100/power_back.webp and /dev/null differ diff --git a/cards200/event_1.avif b/cards200/event_1.avif new file mode 100644 index 0000000..37676d7 Binary files /dev/null and b/cards200/event_1.avif differ diff --git a/cards200/event_10.avif b/cards200/event_10.avif new file mode 100644 index 0000000..a7469e4 Binary files /dev/null and b/cards200/event_10.avif differ diff --git a/cards200/event_100.avif b/cards200/event_100.avif new file mode 100644 index 0000000..6149bc9 Binary files /dev/null and b/cards200/event_100.avif differ diff --git a/cards200/event_101.avif b/cards200/event_101.avif new file mode 100644 index 0000000..3b25133 Binary files /dev/null and b/cards200/event_101.avif differ diff --git a/cards200/event_102.avif b/cards200/event_102.avif new file mode 100644 index 0000000..4525531 Binary files /dev/null and b/cards200/event_102.avif differ diff --git a/cards200/event_103.avif b/cards200/event_103.avif new file mode 100644 index 0000000..66e3242 Binary files /dev/null and b/cards200/event_103.avif differ diff --git a/cards200/event_104.avif b/cards200/event_104.avif new file mode 100644 index 0000000..7ceb594 Binary files /dev/null and b/cards200/event_104.avif differ diff --git a/cards200/event_105.avif b/cards200/event_105.avif new file mode 100644 index 0000000..2db14ee Binary files /dev/null and b/cards200/event_105.avif differ diff --git a/cards200/event_106.avif b/cards200/event_106.avif new file mode 100644 index 0000000..3bb4f2b Binary files /dev/null and b/cards200/event_106.avif differ diff --git a/cards200/event_107.avif b/cards200/event_107.avif new file mode 100644 index 0000000..37c4282 Binary files /dev/null and b/cards200/event_107.avif differ diff --git a/cards200/event_108.avif b/cards200/event_108.avif new file mode 100644 index 0000000..8bf84af Binary files /dev/null and b/cards200/event_108.avif differ diff --git a/cards200/event_109.avif b/cards200/event_109.avif new file mode 100644 index 0000000..a62f174 Binary files /dev/null and b/cards200/event_109.avif differ diff --git a/cards200/event_11.avif b/cards200/event_11.avif new file mode 100644 index 0000000..1346b29 Binary files /dev/null and b/cards200/event_11.avif differ diff --git a/cards200/event_110.avif b/cards200/event_110.avif new file mode 100644 index 0000000..371c0e4 Binary files /dev/null and b/cards200/event_110.avif differ diff --git a/cards200/event_12.avif b/cards200/event_12.avif new file mode 100644 index 0000000..f4b2e39 Binary files /dev/null and b/cards200/event_12.avif differ diff --git a/cards200/event_13.avif b/cards200/event_13.avif new file mode 100644 index 0000000..ca95700 Binary files /dev/null and b/cards200/event_13.avif differ diff --git a/cards200/event_14.avif b/cards200/event_14.avif new file mode 100644 index 0000000..a90ee46 Binary files /dev/null and b/cards200/event_14.avif differ diff --git a/cards200/event_15.avif b/cards200/event_15.avif new file mode 100644 index 0000000..8830002 Binary files /dev/null and b/cards200/event_15.avif differ diff --git a/cards200/event_16.avif b/cards200/event_16.avif new file mode 100644 index 0000000..4279e72 Binary files /dev/null and b/cards200/event_16.avif differ diff --git a/cards200/event_17.avif b/cards200/event_17.avif new file mode 100644 index 0000000..0bb8fd6 Binary files /dev/null and b/cards200/event_17.avif differ diff --git a/cards200/event_18.avif b/cards200/event_18.avif new file mode 100644 index 0000000..4e614b8 Binary files /dev/null and b/cards200/event_18.avif differ diff --git a/cards200/event_19.avif b/cards200/event_19.avif new file mode 100644 index 0000000..425a5fb Binary files /dev/null and b/cards200/event_19.avif differ diff --git a/cards200/event_2.avif b/cards200/event_2.avif new file mode 100644 index 0000000..e0b104f Binary files /dev/null and b/cards200/event_2.avif differ diff --git a/cards200/event_20.avif b/cards200/event_20.avif new file mode 100644 index 0000000..4e8d106 Binary files /dev/null and b/cards200/event_20.avif differ diff --git a/cards200/event_21.avif b/cards200/event_21.avif new file mode 100644 index 0000000..fec487f Binary files /dev/null and b/cards200/event_21.avif differ diff --git a/cards200/event_22.avif b/cards200/event_22.avif new file mode 100644 index 0000000..92d8304 Binary files /dev/null and b/cards200/event_22.avif differ diff --git a/cards200/event_23.avif b/cards200/event_23.avif new file mode 100644 index 0000000..b69c19c Binary files /dev/null and b/cards200/event_23.avif differ diff --git a/cards200/event_24.avif b/cards200/event_24.avif new file mode 100644 index 0000000..34a08af Binary files /dev/null and b/cards200/event_24.avif differ diff --git a/cards200/event_25.avif b/cards200/event_25.avif new file mode 100644 index 0000000..9df39c4 Binary files /dev/null and b/cards200/event_25.avif differ diff --git a/cards200/event_26.avif b/cards200/event_26.avif new file mode 100644 index 0000000..ac2b501 Binary files /dev/null and b/cards200/event_26.avif differ diff --git a/cards200/event_27.avif b/cards200/event_27.avif new file mode 100644 index 0000000..c9f465b Binary files /dev/null and b/cards200/event_27.avif differ diff --git a/cards200/event_28.avif b/cards200/event_28.avif new file mode 100644 index 0000000..3177398 Binary files /dev/null and b/cards200/event_28.avif differ diff --git a/cards200/event_29.avif b/cards200/event_29.avif new file mode 100644 index 0000000..e2eb1f1 Binary files /dev/null and b/cards200/event_29.avif differ diff --git a/cards200/event_3.avif b/cards200/event_3.avif new file mode 100644 index 0000000..99ecc4e Binary files /dev/null and b/cards200/event_3.avif differ diff --git a/cards200/event_30.avif b/cards200/event_30.avif new file mode 100644 index 0000000..c7733a7 Binary files /dev/null and b/cards200/event_30.avif differ diff --git a/cards200/event_31.avif b/cards200/event_31.avif new file mode 100644 index 0000000..233b023 Binary files /dev/null and b/cards200/event_31.avif differ diff --git a/cards200/event_32.avif b/cards200/event_32.avif new file mode 100644 index 0000000..03a9d97 Binary files /dev/null and b/cards200/event_32.avif differ diff --git a/cards200/event_33.avif b/cards200/event_33.avif new file mode 100644 index 0000000..37b2411 Binary files /dev/null and b/cards200/event_33.avif differ diff --git a/cards200/event_34.avif b/cards200/event_34.avif new file mode 100644 index 0000000..0bb191a Binary files /dev/null and b/cards200/event_34.avif differ diff --git a/cards200/event_35.avif b/cards200/event_35.avif new file mode 100644 index 0000000..8f04e43 Binary files /dev/null and b/cards200/event_35.avif differ diff --git a/cards200/event_36.avif b/cards200/event_36.avif new file mode 100644 index 0000000..e752c9b Binary files /dev/null and b/cards200/event_36.avif differ diff --git a/cards200/event_37.avif b/cards200/event_37.avif new file mode 100644 index 0000000..89dc908 Binary files /dev/null and b/cards200/event_37.avif differ diff --git a/cards200/event_38.avif b/cards200/event_38.avif new file mode 100644 index 0000000..9319277 Binary files /dev/null and b/cards200/event_38.avif differ diff --git a/cards200/event_39.avif b/cards200/event_39.avif new file mode 100644 index 0000000..c05be8b Binary files /dev/null and b/cards200/event_39.avif differ diff --git a/cards200/event_4.avif b/cards200/event_4.avif new file mode 100644 index 0000000..a87302b Binary files /dev/null and b/cards200/event_4.avif differ diff --git a/cards200/event_40.avif b/cards200/event_40.avif new file mode 100644 index 0000000..4341b04 Binary files /dev/null and b/cards200/event_40.avif differ diff --git a/cards200/event_41.avif b/cards200/event_41.avif new file mode 100644 index 0000000..70a94cd Binary files /dev/null and b/cards200/event_41.avif differ diff --git a/cards200/event_42.avif b/cards200/event_42.avif new file mode 100644 index 0000000..f5f1c8c Binary files /dev/null and b/cards200/event_42.avif differ diff --git a/cards200/event_43.avif b/cards200/event_43.avif new file mode 100644 index 0000000..c9afc33 Binary files /dev/null and b/cards200/event_43.avif differ diff --git a/cards200/event_44.avif b/cards200/event_44.avif new file mode 100644 index 0000000..0909fa3 Binary files /dev/null and b/cards200/event_44.avif differ diff --git a/cards200/event_45.avif b/cards200/event_45.avif new file mode 100644 index 0000000..d6e5762 Binary files /dev/null and b/cards200/event_45.avif differ diff --git a/cards200/event_46.avif b/cards200/event_46.avif new file mode 100644 index 0000000..1d7e138 Binary files /dev/null and b/cards200/event_46.avif differ diff --git a/cards200/event_47.avif b/cards200/event_47.avif new file mode 100644 index 0000000..4c3560c Binary files /dev/null and b/cards200/event_47.avif differ diff --git a/cards200/event_48.avif b/cards200/event_48.avif new file mode 100644 index 0000000..8dffbdd Binary files /dev/null and b/cards200/event_48.avif differ diff --git a/cards200/event_49.avif b/cards200/event_49.avif new file mode 100644 index 0000000..d9e890e Binary files /dev/null and b/cards200/event_49.avif differ diff --git a/cards200/event_5.avif b/cards200/event_5.avif new file mode 100644 index 0000000..7a2a4ec Binary files /dev/null and b/cards200/event_5.avif differ diff --git a/cards200/event_50.avif b/cards200/event_50.avif new file mode 100644 index 0000000..470453d Binary files /dev/null and b/cards200/event_50.avif differ diff --git a/cards200/event_51.avif b/cards200/event_51.avif new file mode 100644 index 0000000..04e3828 Binary files /dev/null and b/cards200/event_51.avif differ diff --git a/cards200/event_52.avif b/cards200/event_52.avif new file mode 100644 index 0000000..6c89f4b Binary files /dev/null and b/cards200/event_52.avif differ diff --git a/cards200/event_53.avif b/cards200/event_53.avif new file mode 100644 index 0000000..996fbe8 Binary files /dev/null and b/cards200/event_53.avif differ diff --git a/cards200/event_54.avif b/cards200/event_54.avif new file mode 100644 index 0000000..35fb210 Binary files /dev/null and b/cards200/event_54.avif differ diff --git a/cards200/event_55.avif b/cards200/event_55.avif new file mode 100644 index 0000000..c3737e3 Binary files /dev/null and b/cards200/event_55.avif differ diff --git a/cards200/event_56.avif b/cards200/event_56.avif new file mode 100644 index 0000000..7c2dbf5 Binary files /dev/null and b/cards200/event_56.avif differ diff --git a/cards200/event_57.avif b/cards200/event_57.avif new file mode 100644 index 0000000..6d9e4a5 Binary files /dev/null and b/cards200/event_57.avif differ diff --git a/cards200/event_58.avif b/cards200/event_58.avif new file mode 100644 index 0000000..fcea69f Binary files /dev/null and b/cards200/event_58.avif differ diff --git a/cards200/event_59.avif b/cards200/event_59.avif new file mode 100644 index 0000000..abc5bad Binary files /dev/null and b/cards200/event_59.avif differ diff --git a/cards200/event_6.avif b/cards200/event_6.avif new file mode 100644 index 0000000..b460229 Binary files /dev/null and b/cards200/event_6.avif differ diff --git a/cards200/event_60.avif b/cards200/event_60.avif new file mode 100644 index 0000000..f346cbd Binary files /dev/null and b/cards200/event_60.avif differ diff --git a/cards200/event_61.avif b/cards200/event_61.avif new file mode 100644 index 0000000..f7b82d2 Binary files /dev/null and b/cards200/event_61.avif differ diff --git a/cards200/event_62.avif b/cards200/event_62.avif new file mode 100644 index 0000000..0e17428 Binary files /dev/null and b/cards200/event_62.avif differ diff --git a/cards200/event_63.avif b/cards200/event_63.avif new file mode 100644 index 0000000..3fa01b4 Binary files /dev/null and b/cards200/event_63.avif differ diff --git a/cards200/event_64.avif b/cards200/event_64.avif new file mode 100644 index 0000000..e97ac01 Binary files /dev/null and b/cards200/event_64.avif differ diff --git a/cards200/event_65.avif b/cards200/event_65.avif new file mode 100644 index 0000000..6c1f69c Binary files /dev/null and b/cards200/event_65.avif differ diff --git a/cards200/event_66.avif b/cards200/event_66.avif new file mode 100644 index 0000000..df72c90 Binary files /dev/null and b/cards200/event_66.avif differ diff --git a/cards200/event_67.avif b/cards200/event_67.avif new file mode 100644 index 0000000..bd9dccd Binary files /dev/null and b/cards200/event_67.avif differ diff --git a/cards200/event_68.avif b/cards200/event_68.avif new file mode 100644 index 0000000..267b562 Binary files /dev/null and b/cards200/event_68.avif differ diff --git a/cards200/event_69.avif b/cards200/event_69.avif new file mode 100644 index 0000000..5d40d1b Binary files /dev/null and b/cards200/event_69.avif differ diff --git a/cards200/event_7.avif b/cards200/event_7.avif new file mode 100644 index 0000000..6384ba6 Binary files /dev/null and b/cards200/event_7.avif differ diff --git a/cards200/event_70.avif b/cards200/event_70.avif new file mode 100644 index 0000000..0efc38b Binary files /dev/null and b/cards200/event_70.avif differ diff --git a/cards200/event_71.avif b/cards200/event_71.avif new file mode 100644 index 0000000..7a05cc6 Binary files /dev/null and b/cards200/event_71.avif differ diff --git a/cards200/event_72.avif b/cards200/event_72.avif new file mode 100644 index 0000000..d8755eb Binary files /dev/null and b/cards200/event_72.avif differ diff --git a/cards200/event_73.avif b/cards200/event_73.avif new file mode 100644 index 0000000..03ef25e Binary files /dev/null and b/cards200/event_73.avif differ diff --git a/cards200/event_74.avif b/cards200/event_74.avif new file mode 100644 index 0000000..d003b23 Binary files /dev/null and b/cards200/event_74.avif differ diff --git a/cards200/event_75.avif b/cards200/event_75.avif new file mode 100644 index 0000000..63ae0cf Binary files /dev/null and b/cards200/event_75.avif differ diff --git a/cards200/event_76.avif b/cards200/event_76.avif new file mode 100644 index 0000000..3968aaa Binary files /dev/null and b/cards200/event_76.avif differ diff --git a/cards200/event_77.avif b/cards200/event_77.avif new file mode 100644 index 0000000..c1c7a7e Binary files /dev/null and b/cards200/event_77.avif differ diff --git a/cards200/event_78.avif b/cards200/event_78.avif new file mode 100644 index 0000000..f43c986 Binary files /dev/null and b/cards200/event_78.avif differ diff --git a/cards200/event_79.avif b/cards200/event_79.avif new file mode 100644 index 0000000..1b6eba7 Binary files /dev/null and b/cards200/event_79.avif differ diff --git a/cards200/event_8.avif b/cards200/event_8.avif new file mode 100644 index 0000000..a2809b8 Binary files /dev/null and b/cards200/event_8.avif differ diff --git a/cards200/event_80.avif b/cards200/event_80.avif new file mode 100644 index 0000000..285ffdb Binary files /dev/null and b/cards200/event_80.avif differ diff --git a/cards200/event_81.avif b/cards200/event_81.avif new file mode 100644 index 0000000..83b6c0d Binary files /dev/null and b/cards200/event_81.avif differ diff --git a/cards200/event_82.avif b/cards200/event_82.avif new file mode 100644 index 0000000..472cc98 Binary files /dev/null and b/cards200/event_82.avif differ diff --git a/cards200/event_83.avif b/cards200/event_83.avif new file mode 100644 index 0000000..3ada107 Binary files /dev/null and b/cards200/event_83.avif differ diff --git a/cards200/event_84.avif b/cards200/event_84.avif new file mode 100644 index 0000000..a7b222c Binary files /dev/null and b/cards200/event_84.avif differ diff --git a/cards200/event_85.avif b/cards200/event_85.avif new file mode 100644 index 0000000..81144fa Binary files /dev/null and b/cards200/event_85.avif differ diff --git a/cards200/event_86.avif b/cards200/event_86.avif new file mode 100644 index 0000000..8aeb528 Binary files /dev/null and b/cards200/event_86.avif differ diff --git a/cards200/event_87.avif b/cards200/event_87.avif new file mode 100644 index 0000000..cf100e1 Binary files /dev/null and b/cards200/event_87.avif differ diff --git a/cards200/event_88.avif b/cards200/event_88.avif new file mode 100644 index 0000000..2e70d36 Binary files /dev/null and b/cards200/event_88.avif differ diff --git a/cards200/event_89.avif b/cards200/event_89.avif new file mode 100644 index 0000000..0d0ee43 Binary files /dev/null and b/cards200/event_89.avif differ diff --git a/cards200/event_9.avif b/cards200/event_9.avif new file mode 100644 index 0000000..fb0ca38 Binary files /dev/null and b/cards200/event_9.avif differ diff --git a/cards200/event_90.avif b/cards200/event_90.avif new file mode 100644 index 0000000..04d0f6b Binary files /dev/null and b/cards200/event_90.avif differ diff --git a/cards200/event_91.avif b/cards200/event_91.avif new file mode 100644 index 0000000..0dca4a4 Binary files /dev/null and b/cards200/event_91.avif differ diff --git a/cards200/event_92.avif b/cards200/event_92.avif new file mode 100644 index 0000000..ef7020e Binary files /dev/null and b/cards200/event_92.avif differ diff --git a/cards200/event_93.avif b/cards200/event_93.avif new file mode 100644 index 0000000..2b946c2 Binary files /dev/null and b/cards200/event_93.avif differ diff --git a/cards200/event_94.avif b/cards200/event_94.avif new file mode 100644 index 0000000..1b76bd4 Binary files /dev/null and b/cards200/event_94.avif differ diff --git a/cards200/event_95.avif b/cards200/event_95.avif new file mode 100644 index 0000000..e502853 Binary files /dev/null and b/cards200/event_95.avif differ diff --git a/cards200/event_96.avif b/cards200/event_96.avif new file mode 100644 index 0000000..48c25f0 Binary files /dev/null and b/cards200/event_96.avif differ diff --git a/cards200/event_97.avif b/cards200/event_97.avif new file mode 100644 index 0000000..fc49e63 Binary files /dev/null and b/cards200/event_97.avif differ diff --git a/cards200/event_98.avif b/cards200/event_98.avif new file mode 100644 index 0000000..c9170d0 Binary files /dev/null and b/cards200/event_98.avif differ diff --git a/cards200/event_99.avif b/cards200/event_99.avif new file mode 100644 index 0000000..df735d4 Binary files /dev/null and b/cards200/event_99.avif differ diff --git a/cards200/event_back.avif b/cards200/event_back.avif new file mode 100644 index 0000000..7a3e1fa Binary files /dev/null and b/cards200/event_back.avif differ diff --git a/cards200/power_1.png b/cards200/power_1.png deleted file mode 100644 index 98df73d..0000000 Binary files a/cards200/power_1.png and /dev/null differ diff --git a/cards200/power_1.webp b/cards200/power_1.webp deleted file mode 100644 index 9b5f61d..0000000 Binary files a/cards200/power_1.webp and /dev/null differ diff --git a/cards200/power_10.png b/cards200/power_10.png deleted file mode 100644 index 08fb78a..0000000 Binary files a/cards200/power_10.png and /dev/null differ diff --git a/cards200/power_10.webp b/cards200/power_10.webp deleted file mode 100644 index f24e04f..0000000 Binary files a/cards200/power_10.webp and /dev/null differ diff --git a/cards200/power_11.png b/cards200/power_11.png deleted file mode 100644 index bb1aeb9..0000000 Binary files a/cards200/power_11.png and /dev/null differ diff --git a/cards200/power_11.webp b/cards200/power_11.webp deleted file mode 100644 index 5bb27f0..0000000 Binary files a/cards200/power_11.webp and /dev/null differ diff --git a/cards200/power_11_14.png b/cards200/power_11_14.png new file mode 100644 index 0000000..7dbfecb Binary files /dev/null and b/cards200/power_11_14.png differ diff --git a/cards200/power_12.png b/cards200/power_12.png deleted file mode 100644 index e652055..0000000 Binary files a/cards200/power_12.png and /dev/null differ diff --git a/cards200/power_12.webp b/cards200/power_12.webp deleted file mode 100644 index ff100b0..0000000 Binary files a/cards200/power_12.webp and /dev/null differ diff --git a/cards200/power_13.png b/cards200/power_13.png deleted file mode 100644 index 64dcf8c..0000000 Binary files a/cards200/power_13.png and /dev/null differ diff --git a/cards200/power_13.webp b/cards200/power_13.webp deleted file mode 100644 index 951b677..0000000 Binary files a/cards200/power_13.webp and /dev/null differ diff --git a/cards200/power_14.png b/cards200/power_14.png deleted file mode 100644 index 37f9973..0000000 Binary files a/cards200/power_14.png and /dev/null differ diff --git a/cards200/power_14.webp b/cards200/power_14.webp deleted file mode 100644 index c1af6a8..0000000 Binary files a/cards200/power_14.webp and /dev/null differ diff --git a/cards200/power_15.png b/cards200/power_15.png deleted file mode 100644 index cbd9b1a..0000000 Binary files a/cards200/power_15.png and /dev/null differ diff --git a/cards200/power_15.webp b/cards200/power_15.webp deleted file mode 100644 index e0dfb2e..0000000 Binary files a/cards200/power_15.webp and /dev/null differ diff --git a/cards200/power_15_18.png b/cards200/power_15_18.png new file mode 100644 index 0000000..529ebd6 Binary files /dev/null and b/cards200/power_15_18.png differ diff --git a/cards200/power_16.png b/cards200/power_16.png deleted file mode 100644 index 9d1f46e..0000000 Binary files a/cards200/power_16.png and /dev/null differ diff --git a/cards200/power_16.webp b/cards200/power_16.webp deleted file mode 100644 index 10103a2..0000000 Binary files a/cards200/power_16.webp and /dev/null differ diff --git a/cards200/power_17.png b/cards200/power_17.png deleted file mode 100644 index e544d7b..0000000 Binary files a/cards200/power_17.png and /dev/null differ diff --git a/cards200/power_17.webp b/cards200/power_17.webp deleted file mode 100644 index a8dff31..0000000 Binary files a/cards200/power_17.webp and /dev/null differ diff --git a/cards200/power_18.png b/cards200/power_18.png deleted file mode 100644 index abcd13d..0000000 Binary files a/cards200/power_18.png and /dev/null differ diff --git a/cards200/power_18.webp b/cards200/power_18.webp deleted file mode 100644 index 8f94bf0..0000000 Binary files a/cards200/power_18.webp and /dev/null differ diff --git a/cards200/power_19.png b/cards200/power_19.png deleted file mode 100644 index f3ddd37..0000000 Binary files a/cards200/power_19.png and /dev/null differ diff --git a/cards200/power_19.webp b/cards200/power_19.webp deleted file mode 100644 index f5d36b4..0000000 Binary files a/cards200/power_19.webp and /dev/null differ diff --git a/cards200/power_19_20.png b/cards200/power_19_20.png new file mode 100644 index 0000000..9ae5fa2 Binary files /dev/null and b/cards200/power_19_20.png differ diff --git a/cards200/power_1_6.png b/cards200/power_1_6.png new file mode 100644 index 0000000..f916eda Binary files /dev/null and b/cards200/power_1_6.png differ diff --git a/cards200/power_2.png b/cards200/power_2.png deleted file mode 100644 index 3faccb9..0000000 Binary files a/cards200/power_2.png and /dev/null differ diff --git a/cards200/power_2.webp b/cards200/power_2.webp deleted file mode 100644 index 686229c..0000000 Binary files a/cards200/power_2.webp and /dev/null differ diff --git a/cards200/power_20.png b/cards200/power_20.png deleted file mode 100644 index b3fcc80..0000000 Binary files a/cards200/power_20.png and /dev/null differ diff --git a/cards200/power_20.webp b/cards200/power_20.webp deleted file mode 100644 index b462559..0000000 Binary files a/cards200/power_20.webp and /dev/null differ diff --git a/cards200/power_21.png b/cards200/power_21.png deleted file mode 100644 index 18745bb..0000000 Binary files a/cards200/power_21.png and /dev/null differ diff --git a/cards200/power_21.webp b/cards200/power_21.webp deleted file mode 100644 index be2c405..0000000 Binary files a/cards200/power_21.webp and /dev/null differ diff --git a/cards200/power_21_22.png b/cards200/power_21_22.png new file mode 100644 index 0000000..da5f8fb Binary files /dev/null and b/cards200/power_21_22.png differ diff --git a/cards200/power_22.png b/cards200/power_22.png deleted file mode 100644 index 911feb6..0000000 Binary files a/cards200/power_22.png and /dev/null differ diff --git a/cards200/power_22.webp b/cards200/power_22.webp deleted file mode 100644 index 4bb6160..0000000 Binary files a/cards200/power_22.webp and /dev/null differ diff --git a/cards200/power_23.png b/cards200/power_23.png deleted file mode 100644 index 6036935..0000000 Binary files a/cards200/power_23.png and /dev/null differ diff --git a/cards200/power_23.webp b/cards200/power_23.webp deleted file mode 100644 index 293ca37..0000000 Binary files a/cards200/power_23.webp and /dev/null differ diff --git a/cards200/power_23_26.png b/cards200/power_23_26.png new file mode 100644 index 0000000..5daa248 Binary files /dev/null and b/cards200/power_23_26.png differ diff --git a/cards200/power_24.png b/cards200/power_24.png deleted file mode 100644 index 956509d..0000000 Binary files a/cards200/power_24.png and /dev/null differ diff --git a/cards200/power_24.webp b/cards200/power_24.webp deleted file mode 100644 index 07ac041..0000000 Binary files a/cards200/power_24.webp and /dev/null differ diff --git a/cards200/power_25.png b/cards200/power_25.png deleted file mode 100644 index 203f104..0000000 Binary files a/cards200/power_25.png and /dev/null differ diff --git a/cards200/power_25.webp b/cards200/power_25.webp deleted file mode 100644 index f5acaff..0000000 Binary files a/cards200/power_25.webp and /dev/null differ diff --git a/cards200/power_26.png b/cards200/power_26.png deleted file mode 100644 index 6a82872..0000000 Binary files a/cards200/power_26.png and /dev/null differ diff --git a/cards200/power_26.webp b/cards200/power_26.webp deleted file mode 100644 index 0d628b2..0000000 Binary files a/cards200/power_26.webp and /dev/null differ diff --git a/cards200/power_27.png b/cards200/power_27.png deleted file mode 100644 index 0df4d7b..0000000 Binary files a/cards200/power_27.png and /dev/null differ diff --git a/cards200/power_27.webp b/cards200/power_27.webp deleted file mode 100644 index eb39574..0000000 Binary files a/cards200/power_27.webp and /dev/null differ diff --git a/cards200/power_27_30.png b/cards200/power_27_30.png new file mode 100644 index 0000000..1284aa8 Binary files /dev/null and b/cards200/power_27_30.png differ diff --git a/cards200/power_28.png b/cards200/power_28.png deleted file mode 100644 index 897885d..0000000 Binary files a/cards200/power_28.png and /dev/null differ diff --git a/cards200/power_28.webp b/cards200/power_28.webp deleted file mode 100644 index d387557..0000000 Binary files a/cards200/power_28.webp and /dev/null differ diff --git a/cards200/power_29.png b/cards200/power_29.png deleted file mode 100644 index 3354196..0000000 Binary files a/cards200/power_29.png and /dev/null differ diff --git a/cards200/power_29.webp b/cards200/power_29.webp deleted file mode 100644 index e99dc5a..0000000 Binary files a/cards200/power_29.webp and /dev/null differ diff --git a/cards200/power_3.png b/cards200/power_3.png deleted file mode 100644 index 8fcc32a..0000000 Binary files a/cards200/power_3.png and /dev/null differ diff --git a/cards200/power_3.webp b/cards200/power_3.webp deleted file mode 100644 index a36b1e9..0000000 Binary files a/cards200/power_3.webp and /dev/null differ diff --git a/cards200/power_30.png b/cards200/power_30.png deleted file mode 100644 index 9cb9e20..0000000 Binary files a/cards200/power_30.png and /dev/null differ diff --git a/cards200/power_30.webp b/cards200/power_30.webp deleted file mode 100644 index 20125e6..0000000 Binary files a/cards200/power_30.webp and /dev/null differ diff --git a/cards200/power_31.png b/cards200/power_31.png deleted file mode 100644 index 520f67e..0000000 Binary files a/cards200/power_31.png and /dev/null differ diff --git a/cards200/power_31.webp b/cards200/power_31.webp deleted file mode 100644 index a6ff963..0000000 Binary files a/cards200/power_31.webp and /dev/null differ diff --git a/cards200/power_31_33.png b/cards200/power_31_33.png new file mode 100644 index 0000000..10afdfe Binary files /dev/null and b/cards200/power_31_33.png differ diff --git a/cards200/power_32.png b/cards200/power_32.png deleted file mode 100644 index 28e75ae..0000000 Binary files a/cards200/power_32.png and /dev/null differ diff --git a/cards200/power_32.webp b/cards200/power_32.webp deleted file mode 100644 index 69ece76..0000000 Binary files a/cards200/power_32.webp and /dev/null differ diff --git a/cards200/power_33.png b/cards200/power_33.png deleted file mode 100644 index 0d331ee..0000000 Binary files a/cards200/power_33.png and /dev/null differ diff --git a/cards200/power_33.webp b/cards200/power_33.webp deleted file mode 100644 index 22e8b4e..0000000 Binary files a/cards200/power_33.webp and /dev/null differ diff --git a/cards200/power_34.png b/cards200/power_34.png deleted file mode 100644 index ef35663..0000000 Binary files a/cards200/power_34.png and /dev/null differ diff --git a/cards200/power_34.webp b/cards200/power_34.webp deleted file mode 100644 index 845b39a..0000000 Binary files a/cards200/power_34.webp and /dev/null differ diff --git a/cards200/power_34_36.png b/cards200/power_34_36.png new file mode 100644 index 0000000..be737dc Binary files /dev/null and b/cards200/power_34_36.png differ diff --git a/cards200/power_35.png b/cards200/power_35.png deleted file mode 100644 index 840b53a..0000000 Binary files a/cards200/power_35.png and /dev/null differ diff --git a/cards200/power_35.webp b/cards200/power_35.webp deleted file mode 100644 index b05ce45..0000000 Binary files a/cards200/power_35.webp and /dev/null differ diff --git a/cards200/power_36.png b/cards200/power_36.png deleted file mode 100644 index a67f287..0000000 Binary files a/cards200/power_36.png and /dev/null differ diff --git a/cards200/power_36.webp b/cards200/power_36.webp deleted file mode 100644 index 092b033..0000000 Binary files a/cards200/power_36.webp and /dev/null differ diff --git a/cards200/power_37.png b/cards200/power_37.png index e851e20..d1ed481 100644 Binary files a/cards200/power_37.png and b/cards200/power_37.png differ diff --git a/cards200/power_37.webp b/cards200/power_37.webp deleted file mode 100644 index 8059cff..0000000 Binary files a/cards200/power_37.webp and /dev/null differ diff --git a/cards200/power_38.png b/cards200/power_38.png index 3af1ece..6b5dd21 100644 Binary files a/cards200/power_38.png and b/cards200/power_38.png differ diff --git a/cards200/power_38.webp b/cards200/power_38.webp deleted file mode 100644 index 1448c4a..0000000 Binary files a/cards200/power_38.webp and /dev/null differ diff --git a/cards200/power_39.png b/cards200/power_39.png index 750f30a..6adbcf8 100644 Binary files a/cards200/power_39.png and b/cards200/power_39.png differ diff --git a/cards200/power_39.webp b/cards200/power_39.webp deleted file mode 100644 index 3118a3c..0000000 Binary files a/cards200/power_39.webp and /dev/null differ diff --git a/cards200/power_4.png b/cards200/power_4.png deleted file mode 100644 index e483d3d..0000000 Binary files a/cards200/power_4.png and /dev/null differ diff --git a/cards200/power_4.webp b/cards200/power_4.webp deleted file mode 100644 index d34d8a0..0000000 Binary files a/cards200/power_4.webp and /dev/null differ diff --git a/cards200/power_40.png b/cards200/power_40.png index 2cc4006..49968a5 100644 Binary files a/cards200/power_40.png and b/cards200/power_40.png differ diff --git a/cards200/power_40.webp b/cards200/power_40.webp deleted file mode 100644 index ca6b110..0000000 Binary files a/cards200/power_40.webp and /dev/null differ diff --git a/cards200/power_41.png b/cards200/power_41.png index e07b7d0..76e627e 100644 Binary files a/cards200/power_41.png and b/cards200/power_41.png differ diff --git a/cards200/power_41.webp b/cards200/power_41.webp deleted file mode 100644 index 9976e6c..0000000 Binary files a/cards200/power_41.webp and /dev/null differ diff --git a/cards200/power_42.png b/cards200/power_42.png index c8f4383..40f85e9 100644 Binary files a/cards200/power_42.png and b/cards200/power_42.png differ diff --git a/cards200/power_42.webp b/cards200/power_42.webp deleted file mode 100644 index ff95220..0000000 Binary files a/cards200/power_42.webp and /dev/null differ diff --git a/cards200/power_43.png b/cards200/power_43.png index 992e747..56ada46 100644 Binary files a/cards200/power_43.png and b/cards200/power_43.png differ diff --git a/cards200/power_43.webp b/cards200/power_43.webp deleted file mode 100644 index 09c14d9..0000000 Binary files a/cards200/power_43.webp and /dev/null differ diff --git a/cards200/power_44.png b/cards200/power_44.png index 0e0fb0d..3e39d36 100644 Binary files a/cards200/power_44.png and b/cards200/power_44.png differ diff --git a/cards200/power_44.webp b/cards200/power_44.webp deleted file mode 100644 index 8154856..0000000 Binary files a/cards200/power_44.webp and /dev/null differ diff --git a/cards200/power_45.png b/cards200/power_45.png index 3906296..12ce927 100644 Binary files a/cards200/power_45.png and b/cards200/power_45.png differ diff --git a/cards200/power_45.webp b/cards200/power_45.webp deleted file mode 100644 index c881f4a..0000000 Binary files a/cards200/power_45.webp and /dev/null differ diff --git a/cards200/power_46.png b/cards200/power_46.png index 9364156..6f58d9e 100644 Binary files a/cards200/power_46.png and b/cards200/power_46.png differ diff --git a/cards200/power_46.webp b/cards200/power_46.webp deleted file mode 100644 index 1dafa80..0000000 Binary files a/cards200/power_46.webp and /dev/null differ diff --git a/cards200/power_47.png b/cards200/power_47.png index 9c38e9f..92dafa3 100644 Binary files a/cards200/power_47.png and b/cards200/power_47.png differ diff --git a/cards200/power_47.webp b/cards200/power_47.webp deleted file mode 100644 index 4cee530..0000000 Binary files a/cards200/power_47.webp and /dev/null differ diff --git a/cards200/power_48.png b/cards200/power_48.png index 0eea0e3..539335b 100644 Binary files a/cards200/power_48.png and b/cards200/power_48.png differ diff --git a/cards200/power_48.webp b/cards200/power_48.webp deleted file mode 100644 index 56638e6..0000000 Binary files a/cards200/power_48.webp and /dev/null differ diff --git a/cards200/power_49.png b/cards200/power_49.png index 3b0cc9a..e2db71f 100644 Binary files a/cards200/power_49.png and b/cards200/power_49.png differ diff --git a/cards200/power_49.webp b/cards200/power_49.webp deleted file mode 100644 index 019c3b8..0000000 Binary files a/cards200/power_49.webp and /dev/null differ diff --git a/cards200/power_5.png b/cards200/power_5.png deleted file mode 100644 index 31c0dfc..0000000 Binary files a/cards200/power_5.png and /dev/null differ diff --git a/cards200/power_5.webp b/cards200/power_5.webp deleted file mode 100644 index c2f72b0..0000000 Binary files a/cards200/power_5.webp and /dev/null differ diff --git a/cards200/power_50.png b/cards200/power_50.png index 4cdd3b2..1cacc9e 100644 Binary files a/cards200/power_50.png and b/cards200/power_50.png differ diff --git a/cards200/power_50.webp b/cards200/power_50.webp deleted file mode 100644 index fec2b61..0000000 Binary files a/cards200/power_50.webp and /dev/null differ diff --git a/cards200/power_51.png b/cards200/power_51.png index 8b5a0ff..37b6c53 100644 Binary files a/cards200/power_51.png and b/cards200/power_51.png differ diff --git a/cards200/power_51.webp b/cards200/power_51.webp deleted file mode 100644 index 642eb5c..0000000 Binary files a/cards200/power_51.webp and /dev/null differ diff --git a/cards200/power_52.png b/cards200/power_52.png index d1d8f32..8b576f5 100644 Binary files a/cards200/power_52.png and b/cards200/power_52.png differ diff --git a/cards200/power_52.webp b/cards200/power_52.webp deleted file mode 100644 index 3615a9e..0000000 Binary files a/cards200/power_52.webp and /dev/null differ diff --git a/cards200/power_6.png b/cards200/power_6.png deleted file mode 100644 index 3e63fb4..0000000 Binary files a/cards200/power_6.png and /dev/null differ diff --git a/cards200/power_6.webp b/cards200/power_6.webp deleted file mode 100644 index fbf68b0..0000000 Binary files a/cards200/power_6.webp and /dev/null differ diff --git a/cards200/power_7.png b/cards200/power_7.png deleted file mode 100644 index aee9613..0000000 Binary files a/cards200/power_7.png and /dev/null differ diff --git a/cards200/power_7.webp b/cards200/power_7.webp deleted file mode 100644 index 0055b94..0000000 Binary files a/cards200/power_7.webp and /dev/null differ diff --git a/cards200/power_7_8.png b/cards200/power_7_8.png new file mode 100644 index 0000000..f12ad6f Binary files /dev/null and b/cards200/power_7_8.png differ diff --git a/cards200/power_8.png b/cards200/power_8.png deleted file mode 100644 index 4dff234..0000000 Binary files a/cards200/power_8.png and /dev/null differ diff --git a/cards200/power_8.webp b/cards200/power_8.webp deleted file mode 100644 index 3ed5f0a..0000000 Binary files a/cards200/power_8.webp and /dev/null differ diff --git a/cards200/power_9.png b/cards200/power_9.png deleted file mode 100644 index beffaad..0000000 Binary files a/cards200/power_9.png and /dev/null differ diff --git a/cards200/power_9.webp b/cards200/power_9.webp deleted file mode 100644 index 1f0a8f2..0000000 Binary files a/cards200/power_9.webp and /dev/null differ diff --git a/cards200/power_9_10.png b/cards200/power_9_10.png new file mode 100644 index 0000000..3766e04 Binary files /dev/null and b/cards200/power_9_10.png differ diff --git a/cards200/power_back.png b/cards200/power_back.png index ad32921..95c7a04 100644 Binary files a/cards200/power_back.png and b/cards200/power_back.png differ diff --git a/cards200/power_back.webp b/cards200/power_back.webp deleted file mode 100644 index aa9d351..0000000 Binary files a/cards200/power_back.webp and /dev/null differ diff --git a/map150.avif b/map150.avif new file mode 100644 index 0000000..f0a738c Binary files /dev/null and b/map150.avif differ diff --git a/map75.avif b/map75.avif new file mode 100644 index 0000000..3f11728 Binary files /dev/null and b/map75.avif differ -- cgit v1.2.3 From 071612221465ec4bf05cf855043278230636f966 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 10:21:29 +0100 Subject: New power card image numbering. --- data.js | 107 +++++++++--------- info/cards.html | 336 +++++++++++++++++++++++++++++--------------------------- play.css | 334 +++++++++++++++++++++++++++---------------------------- play.js | 2 +- 4 files changed, 394 insertions(+), 385 deletions(-) diff --git a/data.js b/data.js index 17291e8..dceeca1 100644 --- a/data.js +++ b/data.js @@ -1275,6 +1275,7 @@ const spaces = [         ascii_name: "Sliven", }, ] + const cards = [ null, {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, @@ -1390,59 +1391,59 @@ const cards = [ ] const power_cards = [ -null, -{number: 1, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 2, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 3, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 4, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 5, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 6, name: 'Rally in the Square', value: 1, socio: 0}, -{number: 7, name: 'Strike', value: 6, socio: 0}, -{number: 8, name: 'Strike', value: 6, socio: 0}, -{number: 9, name: 'Strike', value: 5, socio: 0}, -{number: 10, name: 'Strike', value: 5, socio: 0}, -{number: 11, name: 'Strike', value: 4, socio: 0}, -{number: 12, name: 'Strike', value: 4, socio: 0}, -{number: 13, name: 'Strike', value: 4, socio: 0}, -{number: 14, name: 'Strike', value: 3, socio: 0}, -{number: 15, name: 'Strike', value: 3, socio: 0}, -{number: 16, name: 'Strike', value: 3, socio: 0}, -{number: 17, name: 'Strike', value: 3, socio: 0}, -{number: 18, name: 'Strike', value: 4, socio: 0}, -{number: 19, name: 'March', value: 6, socio: 0}, -{number: 20, name: 'March', value: 6, socio: 0}, -{number: 21, name: 'March', value: 5, socio: 0}, -{number: 22, name: 'March', value: 5, socio: 0}, -{number: 23, name: 'March', value: 4, socio: 0}, -{number: 24, name: 'March', value: 4, socio: 0}, -{number: 25, name: 'March', value: 4, socio: 0}, -{number: 26, name: 'March', value: 4, socio: 0}, -{number: 27, name: 'March', value: 3, socio: 0}, -{number: 28, name: 'March', value: 3, socio: 0}, -{number: 29, name: 'March', value: 3, socio: 0}, -{number: 30, name: 'March', value: 3, socio: 0}, -{number: 31, name: 'Petition', value: 6, socio: 0}, -{number: 32, name: 'Petition', value: 6, socio: 0}, -{number: 33, name: 'Petition', value: 6, socio: 0}, -{number: 34, name: 'Petition', value: 5, socio: 0}, -{number: 35, name: 'Petition', value: 5, socio: 0}, -{number: 36, name: 'Petition', value: 5, socio: 0}, -{number: 37, name: 'Intellectual Leader', value: 3, socio: 5}, -{number: 38, name: 'Intellectual Leader', value: 3, socio: 5}, -{number: 39, name: 'Intellectual Leader', value: 3, socio: 5}, -{number: 40, name: 'Intellectual Leader', value: 3, socio: 5}, -{number: 41, name: 'Elite Leader', value: 3, socio: 1}, -{number: 42, name: 'Elite Leader', value: 3, socio: 1}, -{number: 43, name: 'Elite Leader', value: 3, socio: 1}, -{number: 44, name: 'Elite Leader', value: 3, socio: 1}, -{number: 45, name: 'Worker Leader', value: 3, socio: 4}, -{number: 46, name: 'Worker Leader', value: 3, socio: 4}, -{number: 47, name: 'Student Leader', value: 3, socio: 6}, -{number: 48, name: 'Church Leader', value: 3, socio: 7}, -{number: 49, name: 'Support Falters', value: '', socio: 0}, -{number: 50, name: 'Support Surges', value: '', socio: 0}, -{number: 51, name: 'Scare Tactics', value: '', socio: 0}, -{number: 52, name: 'Tactic Fails', value: '', socio: 0}, + null, + { number: 1, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 2, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 3, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 4, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 5, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 6, name: "Rally in the Square", value: 1, socio: 0 }, + { number: 7, name: "Strike", value: 6, socio: 0 }, + { number: 8, name: "Strike", value: 6, socio: 0 }, + { number: 9, name: "Strike", value: 5, socio: 0 }, + { number: 10, name: "Strike", value: 5, socio: 0 }, + { number: 11, name: "Strike", value: 4, socio: 0 }, + { number: 12, name: "Strike", value: 4, socio: 0 }, + { number: 13, name: "Strike", value: 4, socio: 0 }, + { number: 18, name: "Strike", value: 4, socio: 0 }, + { number: 14, name: "Strike", value: 3, socio: 0 }, + { number: 15, name: "Strike", value: 3, socio: 0 }, + { number: 16, name: "Strike", value: 3, socio: 0 }, + { number: 17, name: "Strike", value: 3, socio: 0 }, + { number: 19, name: "March", value: 6, socio: 0 }, + { number: 20, name: "March", value: 6, socio: 0 }, + { number: 21, name: "March", value: 5, socio: 0 }, + { number: 22, name: "March", value: 5, socio: 0 }, + { number: 23, name: "March", value: 4, socio: 0 }, + { number: 24, name: "March", value: 4, socio: 0 }, + { number: 25, name: "March", value: 4, socio: 0 }, + { number: 26, name: "March", value: 4, socio: 0 }, + { number: 27, name: "March", value: 3, socio: 0 }, + { number: 28, name: "March", value: 3, socio: 0 }, + { number: 29, name: "March", value: 3, socio: 0 }, + { number: 30, name: "March", value: 3, socio: 0 }, + { number: 31, name: "Petition", value: 6, socio: 0 }, + { number: 32, name: "Petition", value: 6, socio: 0 }, + { number: 33, name: "Petition", value: 6, socio: 0 }, + { number: 34, name: "Petition", value: 5, socio: 0 }, + { number: 35, name: "Petition", value: 5, socio: 0 }, + { number: 36, name: "Petition", value: 5, socio: 0 }, + { number: 37, name: "Intellectual Leader", value: 3, socio: 5 }, + { number: 38, name: "Intellectual Leader", value: 3, socio: 5 }, + { number: 39, name: "Intellectual Leader", value: 3, socio: 5 }, + { number: 40, name: "Intellectual Leader", value: 3, socio: 5 }, + { number: 41, name: "Elite Leader", value: 3, socio: 1 }, + { number: 42, name: "Elite Leader", value: 3, socio: 1 }, + { number: 43, name: "Elite Leader", value: 3, socio: 1 }, + { number: 44, name: "Elite Leader", value: 3, socio: 1 }, + { number: 45, name: "Worker Leader", value: 3, socio: 4 }, + { number: 46, name: "Worker Leader", value: 3, socio: 4 }, + { number: 47, name: "Student Leader", value: 3, socio: 6 }, + { number: 48, name: "Church Leader", value: 3, socio: 7 }, + { number: 49, name: "Support Falters", value: 0, socio: 0 }, + { number: 50, name: "Support Surges", value: 0, socio: 0 }, + { number: 51, name: "Scare Tactics", value: 0, socio: 0 }, + { number: 52, name: "Tactic Fails", value: 0, socio: 0 }, ] if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } diff --git a/info/cards.html b/info/cards.html index 479867d..8498d00 100644 --- a/info/cards.html +++ b/info/cards.html @@ -21,173 +21,181 @@ img {
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/play.css b/play.css index ec93266..90a5a57 100644 --- a/play.css +++ b/play.css @@ -64,9 +64,9 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } box-shadow: 0px 1px 10px #0008; } -#map { background-image: url("map75.jpg") } +#map { background-image: url("map75.avif") } @media (min-resolution: 97dpi) { - #map { background-image: url("map150.jpg") } + #map { background-image: url("map150.avif") } } /* SPACES */ @@ -265,168 +265,168 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } box-shadow: 0 0 0 1px #444, 0 0 0 4px yellow; } -.card.event_0 { background-image: url(cards100/event_back.webp) } -.card.event_1 { background-image: url(cards100/event_1.webp) } -.card.event_2 { background-image: url(cards100/event_2.webp) } -.card.event_3 { background-image: url(cards100/event_3.webp) } -.card.event_4 { background-image: url(cards100/event_4.webp) } -.card.event_5 { background-image: url(cards100/event_5.webp) } -.card.event_6 { background-image: url(cards100/event_6.webp) } -.card.event_7 { background-image: url(cards100/event_7.webp) } -.card.event_8 { background-image: url(cards100/event_8.webp) } -.card.event_9 { background-image: url(cards100/event_9.webp) } -.card.event_10 { background-image: url(cards100/event_10.webp) } -.card.event_11 { background-image: url(cards100/event_11.webp) } -.card.event_12 { background-image: url(cards100/event_12.webp) } -.card.event_13 { background-image: url(cards100/event_13.webp) } -.card.event_14 { background-image: url(cards100/event_14.webp) } -.card.event_15 { background-image: url(cards100/event_15.webp) } -.card.event_16 { background-image: url(cards100/event_16.webp) } -.card.event_17 { background-image: url(cards100/event_17.webp) } -.card.event_18 { background-image: url(cards100/event_18.webp) } -.card.event_19 { background-image: url(cards100/event_19.webp) } -.card.event_20 { background-image: url(cards100/event_20.webp) } -.card.event_21 { background-image: url(cards100/event_21.webp) } -.card.event_22 { background-image: url(cards100/event_22.webp) } -.card.event_23 { background-image: url(cards100/event_23.webp) } -.card.event_24 { background-image: url(cards100/event_24.webp) } -.card.event_25 { background-image: url(cards100/event_25.webp) } -.card.event_26 { background-image: url(cards100/event_26.webp) } -.card.event_27 { background-image: url(cards100/event_27.webp) } -.card.event_28 { background-image: url(cards100/event_28.webp) } -.card.event_29 { background-image: url(cards100/event_29.webp) } -.card.event_30 { background-image: url(cards100/event_30.webp) } -.card.event_31 { background-image: url(cards100/event_31.webp) } -.card.event_32 { background-image: url(cards100/event_32.webp) } -.card.event_33 { background-image: url(cards100/event_33.webp) } -.card.event_34 { background-image: url(cards100/event_34.webp) } -.card.event_35 { background-image: url(cards100/event_35.webp) } -.card.event_36 { background-image: url(cards100/event_36.webp) } -.card.event_37 { background-image: url(cards100/event_37.webp) } -.card.event_38 { background-image: url(cards100/event_38.webp) } -.card.event_39 { background-image: url(cards100/event_39.webp) } -.card.event_40 { background-image: url(cards100/event_40.webp) } -.card.event_41 { background-image: url(cards100/event_41.webp) } -.card.event_42 { background-image: url(cards100/event_42.webp) } -.card.event_43 { background-image: url(cards100/event_43.webp) } -.card.event_44 { background-image: url(cards100/event_44.webp) } -.card.event_45 { background-image: url(cards100/event_45.webp) } -.card.event_46 { background-image: url(cards100/event_46.webp) } -.card.event_47 { background-image: url(cards100/event_47.webp) } -.card.event_48 { background-image: url(cards100/event_48.webp) } -.card.event_49 { background-image: url(cards100/event_49.webp) } -.card.event_50 { background-image: url(cards100/event_50.webp) } -.card.event_51 { background-image: url(cards100/event_51.webp) } -.card.event_52 { background-image: url(cards100/event_52.webp) } -.card.event_53 { background-image: url(cards100/event_53.webp) } -.card.event_54 { background-image: url(cards100/event_54.webp) } -.card.event_55 { background-image: url(cards100/event_55.webp) } -.card.event_56 { background-image: url(cards100/event_56.webp) } -.card.event_57 { background-image: url(cards100/event_57.webp) } -.card.event_58 { background-image: url(cards100/event_58.webp) } -.card.event_59 { background-image: url(cards100/event_59.webp) } -.card.event_60 { background-image: url(cards100/event_60.webp) } -.card.event_61 { background-image: url(cards100/event_61.webp) } -.card.event_62 { background-image: url(cards100/event_62.webp) } -.card.event_63 { background-image: url(cards100/event_63.webp) } -.card.event_64 { background-image: url(cards100/event_64.webp) } -.card.event_65 { background-image: url(cards100/event_65.webp) } -.card.event_66 { background-image: url(cards100/event_66.webp) } -.card.event_67 { background-image: url(cards100/event_67.webp) } -.card.event_68 { background-image: url(cards100/event_68.webp) } -.card.event_69 { background-image: url(cards100/event_69.webp) } -.card.event_70 { background-image: url(cards100/event_70.webp) } -.card.event_71 { background-image: url(cards100/event_71.webp) } -.card.event_72 { background-image: url(cards100/event_72.webp) } -.card.event_73 { background-image: url(cards100/event_73.webp) } -.card.event_74 { background-image: url(cards100/event_74.webp) } -.card.event_75 { background-image: url(cards100/event_75.webp) } -.card.event_76 { background-image: url(cards100/event_76.webp) } -.card.event_77 { background-image: url(cards100/event_77.webp) } -.card.event_78 { background-image: url(cards100/event_78.webp) } -.card.event_79 { background-image: url(cards100/event_79.webp) } -.card.event_80 { background-image: url(cards100/event_80.webp) } -.card.event_81 { background-image: url(cards100/event_81.webp) } -.card.event_82 { background-image: url(cards100/event_82.webp) } -.card.event_83 { background-image: url(cards100/event_83.webp) } -.card.event_84 { background-image: url(cards100/event_84.webp) } -.card.event_85 { background-image: url(cards100/event_85.webp) } -.card.event_86 { background-image: url(cards100/event_86.webp) } -.card.event_87 { background-image: url(cards100/event_87.webp) } -.card.event_88 { background-image: url(cards100/event_88.webp) } -.card.event_89 { background-image: url(cards100/event_89.webp) } -.card.event_90 { background-image: url(cards100/event_90.webp) } -.card.event_91 { background-image: url(cards100/event_91.webp) } -.card.event_92 { background-image: url(cards100/event_92.webp) } -.card.event_93 { background-image: url(cards100/event_93.webp) } -.card.event_94 { background-image: url(cards100/event_94.webp) } -.card.event_95 { background-image: url(cards100/event_95.webp) } -.card.event_96 { background-image: url(cards100/event_96.webp) } -.card.event_97 { background-image: url(cards100/event_97.webp) } -.card.event_98 { background-image: url(cards100/event_98.webp) } -.card.event_99 { background-image: url(cards100/event_99.webp) } -.card.event_100 { background-image: url(cards100/event_100.webp) } -.card.event_101 { background-image: url(cards100/event_101.webp) } -.card.event_102 { background-image: url(cards100/event_102.webp) } -.card.event_103 { background-image: url(cards100/event_103.webp) } -.card.event_104 { background-image: url(cards100/event_104.webp) } -.card.event_105 { background-image: url(cards100/event_105.webp) } -.card.event_106 { background-image: url(cards100/event_106.webp) } -.card.event_107 { background-image: url(cards100/event_107.webp) } -.card.event_108 { background-image: url(cards100/event_108.webp) } -.card.event_109 { background-image: url(cards100/event_109.webp) } -.card.event_110 { background-image: url(cards100/event_110.webp) } - -.card.power_0 { background-image: url(cards100/power_back.webp) } -.card.power_1 { background-image: url(cards100/power_1.webp) } -.card.power_2 { background-image: url(cards100/power_2.webp) } -.card.power_3 { background-image: url(cards100/power_3.webp) } -.card.power_4 { background-image: url(cards100/power_4.webp) } -.card.power_5 { background-image: url(cards100/power_5.webp) } -.card.power_6 { background-image: url(cards100/power_6.webp) } -.card.power_7 { background-image: url(cards100/power_7.webp) } -.card.power_8 { background-image: url(cards100/power_8.webp) } -.card.power_9 { background-image: url(cards100/power_9.webp) } -.card.power_10 { background-image: url(cards100/power_10.webp) } -.card.power_11 { background-image: url(cards100/power_11.webp) } -.card.power_12 { background-image: url(cards100/power_12.webp) } -.card.power_13 { background-image: url(cards100/power_13.webp) } -.card.power_14 { background-image: url(cards100/power_18.webp) } -.card.power_15 { background-image: url(cards100/power_15.webp) } -.card.power_16 { background-image: url(cards100/power_16.webp) } -.card.power_17 { background-image: url(cards100/power_17.webp) } -.card.power_18 { background-image: url(cards100/power_14.webp) } -.card.power_19 { background-image: url(cards100/power_19.webp) } -.card.power_20 { background-image: url(cards100/power_20.webp) } -.card.power_21 { background-image: url(cards100/power_21.webp) } -.card.power_22 { background-image: url(cards100/power_22.webp) } -.card.power_23 { background-image: url(cards100/power_23.webp) } -.card.power_24 { background-image: url(cards100/power_24.webp) } -.card.power_25 { background-image: url(cards100/power_25.webp) } -.card.power_26 { background-image: url(cards100/power_26.webp) } -.card.power_27 { background-image: url(cards100/power_27.webp) } -.card.power_28 { background-image: url(cards100/power_28.webp) } -.card.power_29 { background-image: url(cards100/power_29.webp) } -.card.power_30 { background-image: url(cards100/power_30.webp) } -.card.power_31 { background-image: url(cards100/power_31.webp) } -.card.power_32 { background-image: url(cards100/power_32.webp) } -.card.power_33 { background-image: url(cards100/power_33.webp) } -.card.power_34 { background-image: url(cards100/power_34.webp) } -.card.power_35 { background-image: url(cards100/power_35.webp) } -.card.power_36 { background-image: url(cards100/power_36.webp) } -.card.power_37 { background-image: url(cards100/power_37.webp) } -.card.power_38 { background-image: url(cards100/power_38.webp) } -.card.power_39 { background-image: url(cards100/power_39.webp) } -.card.power_40 { background-image: url(cards100/power_40.webp) } -.card.power_41 { background-image: url(cards100/power_41.webp) } -.card.power_42 { background-image: url(cards100/power_42.webp) } -.card.power_43 { background-image: url(cards100/power_43.webp) } -.card.power_44 { background-image: url(cards100/power_44.webp) } -.card.power_45 { background-image: url(cards100/power_45.webp) } -.card.power_46 { background-image: url(cards100/power_46.webp) } -.card.power_47 { background-image: url(cards100/power_47.webp) } -.card.power_48 { background-image: url(cards100/power_48.webp) } -.card.power_49 { background-image: url(cards100/power_49.webp) } -.card.power_50 { background-image: url(cards100/power_50.webp) } -.card.power_51 { background-image: url(cards100/power_51.webp) } -.card.power_52 { background-image: url(cards100/power_52.webp) } +.card.event_0 { background-image: url(cards100/event_back.avif) } +.card.event_1 { background-image: url(cards100/event_1.avif) } +.card.event_2 { background-image: url(cards100/event_2.avif) } +.card.event_3 { background-image: url(cards100/event_3.avif) } +.card.event_4 { background-image: url(cards100/event_4.avif) } +.card.event_5 { background-image: url(cards100/event_5.avif) } +.card.event_6 { background-image: url(cards100/event_6.avif) } +.card.event_7 { background-image: url(cards100/event_7.avif) } +.card.event_8 { background-image: url(cards100/event_8.avif) } +.card.event_9 { background-image: url(cards100/event_9.avif) } +.card.event_10 { background-image: url(cards100/event_10.avif) } +.card.event_11 { background-image: url(cards100/event_11.avif) } +.card.event_12 { background-image: url(cards100/event_12.avif) } +.card.event_13 { background-image: url(cards100/event_13.avif) } +.card.event_14 { background-image: url(cards100/event_14.avif) } +.card.event_15 { background-image: url(cards100/event_15.avif) } +.card.event_16 { background-image: url(cards100/event_16.avif) } +.card.event_17 { background-image: url(cards100/event_17.avif) } +.card.event_18 { background-image: url(cards100/event_18.avif) } +.card.event_19 { background-image: url(cards100/event_19.avif) } +.card.event_20 { background-image: url(cards100/event_20.avif) } +.card.event_21 { background-image: url(cards100/event_21.avif) } +.card.event_22 { background-image: url(cards100/event_22.avif) } +.card.event_23 { background-image: url(cards100/event_23.avif) } +.card.event_24 { background-image: url(cards100/event_24.avif) } +.card.event_25 { background-image: url(cards100/event_25.avif) } +.card.event_26 { background-image: url(cards100/event_26.avif) } +.card.event_27 { background-image: url(cards100/event_27.avif) } +.card.event_28 { background-image: url(cards100/event_28.avif) } +.card.event_29 { background-image: url(cards100/event_29.avif) } +.card.event_30 { background-image: url(cards100/event_30.avif) } +.card.event_31 { background-image: url(cards100/event_31.avif) } +.card.event_32 { background-image: url(cards100/event_32.avif) } +.card.event_33 { background-image: url(cards100/event_33.avif) } +.card.event_34 { background-image: url(cards100/event_34.avif) } +.card.event_35 { background-image: url(cards100/event_35.avif) } +.card.event_36 { background-image: url(cards100/event_36.avif) } +.card.event_37 { background-image: url(cards100/event_37.avif) } +.card.event_38 { background-image: url(cards100/event_38.avif) } +.card.event_39 { background-image: url(cards100/event_39.avif) } +.card.event_40 { background-image: url(cards100/event_40.avif) } +.card.event_41 { background-image: url(cards100/event_41.avif) } +.card.event_42 { background-image: url(cards100/event_42.avif) } +.card.event_43 { background-image: url(cards100/event_43.avif) } +.card.event_44 { background-image: url(cards100/event_44.avif) } +.card.event_45 { background-image: url(cards100/event_45.avif) } +.card.event_46 { background-image: url(cards100/event_46.avif) } +.card.event_47 { background-image: url(cards100/event_47.avif) } +.card.event_48 { background-image: url(cards100/event_48.avif) } +.card.event_49 { background-image: url(cards100/event_49.avif) } +.card.event_50 { background-image: url(cards100/event_50.avif) } +.card.event_51 { background-image: url(cards100/event_51.avif) } +.card.event_52 { background-image: url(cards100/event_52.avif) } +.card.event_53 { background-image: url(cards100/event_53.avif) } +.card.event_54 { background-image: url(cards100/event_54.avif) } +.card.event_55 { background-image: url(cards100/event_55.avif) } +.card.event_56 { background-image: url(cards100/event_56.avif) } +.card.event_57 { background-image: url(cards100/event_57.avif) } +.card.event_58 { background-image: url(cards100/event_58.avif) } +.card.event_59 { background-image: url(cards100/event_59.avif) } +.card.event_60 { background-image: url(cards100/event_60.avif) } +.card.event_61 { background-image: url(cards100/event_61.avif) } +.card.event_62 { background-image: url(cards100/event_62.avif) } +.card.event_63 { background-image: url(cards100/event_63.avif) } +.card.event_64 { background-image: url(cards100/event_64.avif) } +.card.event_65 { background-image: url(cards100/event_65.avif) } +.card.event_66 { background-image: url(cards100/event_66.avif) } +.card.event_67 { background-image: url(cards100/event_67.avif) } +.card.event_68 { background-image: url(cards100/event_68.avif) } +.card.event_69 { background-image: url(cards100/event_69.avif) } +.card.event_70 { background-image: url(cards100/event_70.avif) } +.card.event_71 { background-image: url(cards100/event_71.avif) } +.card.event_72 { background-image: url(cards100/event_72.avif) } +.card.event_73 { background-image: url(cards100/event_73.avif) } +.card.event_74 { background-image: url(cards100/event_74.avif) } +.card.event_75 { background-image: url(cards100/event_75.avif) } +.card.event_76 { background-image: url(cards100/event_76.avif) } +.card.event_77 { background-image: url(cards100/event_77.avif) } +.card.event_78 { background-image: url(cards100/event_78.avif) } +.card.event_79 { background-image: url(cards100/event_79.avif) } +.card.event_80 { background-image: url(cards100/event_80.avif) } +.card.event_81 { background-image: url(cards100/event_81.avif) } +.card.event_82 { background-image: url(cards100/event_82.avif) } +.card.event_83 { background-image: url(cards100/event_83.avif) } +.card.event_84 { background-image: url(cards100/event_84.avif) } +.card.event_85 { background-image: url(cards100/event_85.avif) } +.card.event_86 { background-image: url(cards100/event_86.avif) } +.card.event_87 { background-image: url(cards100/event_87.avif) } +.card.event_88 { background-image: url(cards100/event_88.avif) } +.card.event_89 { background-image: url(cards100/event_89.avif) } +.card.event_90 { background-image: url(cards100/event_90.avif) } +.card.event_91 { background-image: url(cards100/event_91.avif) } +.card.event_92 { background-image: url(cards100/event_92.avif) } +.card.event_93 { background-image: url(cards100/event_93.avif) } +.card.event_94 { background-image: url(cards100/event_94.avif) } +.card.event_95 { background-image: url(cards100/event_95.avif) } +.card.event_96 { background-image: url(cards100/event_96.avif) } +.card.event_97 { background-image: url(cards100/event_97.avif) } +.card.event_98 { background-image: url(cards100/event_98.avif) } +.card.event_99 { background-image: url(cards100/event_99.avif) } +.card.event_100 { background-image: url(cards100/event_100.avif) } +.card.event_101 { background-image: url(cards100/event_101.avif) } +.card.event_102 { background-image: url(cards100/event_102.avif) } +.card.event_103 { background-image: url(cards100/event_103.avif) } +.card.event_104 { background-image: url(cards100/event_104.avif) } +.card.event_105 { background-image: url(cards100/event_105.avif) } +.card.event_106 { background-image: url(cards100/event_106.avif) } +.card.event_107 { background-image: url(cards100/event_107.avif) } +.card.event_108 { background-image: url(cards100/event_108.avif) } +.card.event_109 { background-image: url(cards100/event_109.avif) } +.card.event_110 { background-image: url(cards100/event_110.avif) } + +.card.power_0 { background-image: url(cards100/power_back.avif) } +.card.power_1 { background-image: url(cards100/power_1_6.avif) } +.card.power_2 { background-image: url(cards100/power_1_6.avif) } +.card.power_3 { background-image: url(cards100/power_1_6.avif) } +.card.power_4 { background-image: url(cards100/power_1_6.avif) } +.card.power_5 { background-image: url(cards100/power_1_6.avif) } +.card.power_6 { background-image: url(cards100/power_1_6.avif) } +.card.power_7 { background-image: url(cards100/power_7_8.avif) } +.card.power_8 { background-image: url(cards100/power_7_8.avif) } +.card.power_9 { background-image: url(cards100/power_9_10.avif) } +.card.power_10 { background-image: url(cards100/power_9_10.avif) } +.card.power_11 { background-image: url(cards100/power_11_14.avif) } +.card.power_12 { background-image: url(cards100/power_11_14.avif) } +.card.power_13 { background-image: url(cards100/power_11_14.avif) } +.card.power_14 { background-image: url(cards100/power_11_14.avif) } +.card.power_15 { background-image: url(cards100/power_15_18.avif) } +.card.power_16 { background-image: url(cards100/power_15_18.avif) } +.card.power_17 { background-image: url(cards100/power_15_18.avif) } +.card.power_18 { background-image: url(cards100/power_15_18.avif) } +.card.power_19 { background-image: url(cards100/power_19_20.avif) } +.card.power_20 { background-image: url(cards100/power_19_20.avif) } +.card.power_21 { background-image: url(cards100/power_21_22.avif) } +.card.power_22 { background-image: url(cards100/power_21_22.avif) } +.card.power_23 { background-image: url(cards100/power_23_26.avif) } +.card.power_24 { background-image: url(cards100/power_23_26.avif) } +.card.power_25 { background-image: url(cards100/power_23_26.avif) } +.card.power_26 { background-image: url(cards100/power_23_26.avif) } +.card.power_27 { background-image: url(cards100/power_27_30.avif) } +.card.power_28 { background-image: url(cards100/power_27_30.avif) } +.card.power_29 { background-image: url(cards100/power_27_30.avif) } +.card.power_30 { background-image: url(cards100/power_27_30.avif) } +.card.power_31 { background-image: url(cards100/power_31_33.avif) } +.card.power_32 { background-image: url(cards100/power_31_33.avif) } +.card.power_33 { background-image: url(cards100/power_31_33.avif) } +.card.power_34 { background-image: url(cards100/power_34_36.avif) } +.card.power_35 { background-image: url(cards100/power_34_36.avif) } +.card.power_36 { background-image: url(cards100/power_34_36.avif) } +.card.power_37 { background-image: url(cards100/power_37.avif) } +.card.power_38 { background-image: url(cards100/power_38.avif) } +.card.power_39 { background-image: url(cards100/power_39.avif) } +.card.power_40 { background-image: url(cards100/power_40.avif) } +.card.power_41 { background-image: url(cards100/power_41.avif) } +.card.power_42 { background-image: url(cards100/power_42.avif) } +.card.power_43 { background-image: url(cards100/power_43.avif) } +.card.power_44 { background-image: url(cards100/power_44.avif) } +.card.power_45 { background-image: url(cards100/power_45.avif) } +.card.power_46 { background-image: url(cards100/power_46.avif) } +.card.power_47 { background-image: url(cards100/power_47.avif) } +.card.power_48 { background-image: url(cards100/power_48.avif) } +.card.power_49 { background-image: url(cards100/power_49.avif) } +.card.power_50 { background-image: url(cards100/power_50.avif) } +.card.power_51 { background-image: url(cards100/power_51.avif) } +.card.power_52 { background-image: url(cards100/power_52.avif) } diff --git a/play.js b/play.js index cf78f62..3c6b1af 100644 --- a/play.js +++ b/play.js @@ -329,7 +329,7 @@ function on_click_action(evt) { const last_space = 74 const last_card = 110 -const last_power_card = 54 +const last_power_card = 52 const board_events = [ C_SOLIDARITY_LEGALIZED, -- cgit v1.2.3 From e11d375f616296f632c831e990d097e6bc18b233 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 15:24:33 +0000 Subject: Remove unnecessary power struggle states --- rules.js | 47 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/rules.js b/rules.js index 7f51d2a..9d5fc40 100644 --- a/rules.js +++ b/rules.js @@ -1517,34 +1517,14 @@ states.raise_stakes_2 = { }, pass() { log('Did not raise the stakes') - game.raised_stakes_discard = 0 - game.valid_cards = [] - log_h2('Play Cards') - next_player() - game.state = 'begin_power_struggle' + goto_struggle() }, done () { log_gap('Raised the stakes') - game.raised_stakes_discard = 0 - game.valid_cards = [] - log_h2('Play Cards') - next_player() - game.state = 'begin_power_struggle' + goto_struggle() }, } -states.begin_power_struggle = { - inactive: 'begin power struggle.', - prompt() { - view.prompt = 'Begin power struggle.' - gen_action('struggle') - }, - struggle () { - do_valid_cards() - game.state = 'power_struggle' - } -} - states.power_struggle = { inactive: 'play a card.', prompt () { @@ -2046,23 +2026,11 @@ states.end_turn_4_5_4 = { game.state = 'final_scoring_held' } else { - game.return_state = '' - game.state = 'end_turn' + new_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() { @@ -3297,6 +3265,15 @@ function goto_game_over(result, victory) { } +function goto_struggle(){ + game.raised_stakes_discard = 0 + game.valid_cards = [] + log_h2('Play Cards') + next_player() + game.state = 'power_struggle' + do_valid_cards() +} + function reset_austria_hungary_border_reopened() { game.austria_hungary_border_reopened_tracker = false } -- cgit v1.2.3 From 23069d322e91060bb5e5bb6de56fa4876a95e762 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 27 Oct 2024 16:26:19 +0100 Subject: Use correct povel card title in constant! --- rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 8406816..34d8364 100644 --- a/rules.js +++ b/rules.js @@ -223,7 +223,7 @@ 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] -const PC_TACTICS_FAILS = 52 +const PC_TACTIC_FAILS = 52 // COUNTRY CONSTANTS @@ -2840,7 +2840,7 @@ function valid_cards(player_hand, presence) { if (game.phase === 0) { for (let c of player_hand) { let card = power_cards[c] - if (c === PC_TACTICS_FAILS) { + if (c === PC_TACTIC_FAILS) { continue } // Never add tactics fails @@ -2864,7 +2864,7 @@ function valid_cards(player_hand, presence) { valid_cards_set.add(c) } else if (leaders.includes(card.socio) && presence[card.socio]) { valid_cards_set.add(c) - } else if (c === PC_TACTICS_FAILS) { + } else if (c === PC_TACTIC_FAILS) { valid_cards_set.add(c) } } -- cgit v1.2.3 From 882e4d532cd05476d3cb7e13b85cc6afe5953dbb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 15:52:14 +0000 Subject: Start TST markers off the track --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index f786be2..23d7c45 100644 --- a/play.js +++ b/play.js @@ -505,7 +505,7 @@ function layout_stability_marker() { ui.stability.style.top = y - 25 + "px" } -let TST_X = [ 53, 53 + 69, 53 + 69 * 2, 53 + 69 * 3, 53 + 69 * 4, 53 + 69 * 5, 53 + 69 * 6, 556 ] +let TST_X = [ 0, 53, 53 + 69, 53 + 69 * 2, 53 + 69 * 3, 53 + 69 * 4, 53 + 69 * 5, 53 + 69 * 6, 556 ] let TST_Y = [ 2128, 2257 ] function layout_tst_marker(e, v, top) { -- cgit v1.2.3 From 9971dc265828ac89d465ed9955efd3f86b3fe956 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 15:52:34 +0000 Subject: Tidy up code --- rules.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rules.js b/rules.js index 9d5fc40..c780550 100644 --- a/rules.js +++ b/rules.js @@ -1420,7 +1420,6 @@ states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') @@ -1528,7 +1527,6 @@ states.raise_stakes_2 = { states.power_struggle = { inactive: 'play a card.', prompt () { - console.log('game.vm_event', game.vm_event) if (game.phase === 0) { if (game.valid_cards.length > 0) { view.prompt = "Play a card." @@ -2818,7 +2816,6 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards.find(card => card && card.number === c); - console.log('card', card, ) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(card.number); } else if (card.name === game.proxy_power_card) { @@ -7133,7 +7130,6 @@ states.vm_kiss_of_death_finish = { prompt() { 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') } else { view.prompt = 'Event does not occur.' -- cgit v1.2.3 From 54bbd6d6c9b5758884b1a42fbac6cff727873642 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 16:00:37 +0000 Subject: Add check for view.show_opp_hand --- play.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play.js b/play.js index 23d7c45..d118b74 100644 --- a/play.js +++ b/play.js @@ -666,9 +666,9 @@ function on_update() { if (view.power_hand) for (let c of view.power_hand) ui.power_hand.appendChild(ui.power_cards[c]) - + ui.opp_hand.replaceChildren() - if (view.opp_hand) + if (view.show_opp_hand && view.opp_hand) for (let c of view.opp_hand) ui.opp_hand.appendChild(ui.cards[c]) -- cgit v1.2.3 From ff5a0e37d7ba8c20be1d82079ff19cec96005f10 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 16:10:21 +0000 Subject: Fix typo in Raise the Stakes --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index c780550..3269638 100644 --- a/rules.js +++ b/rules.js @@ -8357,8 +8357,14 @@ states.vm_support_surges_2 = { states.vm_support_surges_3 = { inactive: 'draw cards.', prompt() { - if (numberless_cards.includes(game.temp)) { + if (wildcards.includes(game.temp)) { view.prompt = `Support Surges: you drew ${power_cards[game.temp].name}. Done.` + } + else if (elite_leaders.includes(game.temp)) { + view.prompt = `Support Surges: you drew an ${power_cards[game.temp].name}. Done.` + } + else 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.` } -- cgit v1.2.3 From 3e36074596d23d78b48c0a999b57d5a6f3808030 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 20:41:10 +0000 Subject: New power struggle card layout --- play.css | 12 ++++++++++++ play.html | 13 +++++++------ play.js | 19 +++++++++++++++---- rules.js | 22 +++++++++++++++++----- 4 files changed, 51 insertions(+), 15 deletions(-) diff --git a/play.css b/play.css index 90a5a57..a0d7094 100644 --- a/play.css +++ b/play.css @@ -237,6 +237,18 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } display: none; } +#scoring_card_panel { + display: flex; + flex-direction: column; + width: 100%; +} + +#scoring_card_panel .card_row { + display: flex; + gap: 10px; +} + + /* CARD IMAGES */ #tooltip { diff --git a/play.html b/play.html index 50fb00d..97882fd 100644 --- a/play.html +++ b/play.html @@ -85,16 +85,17 @@
    Power Struggle
    -
    -
    Power Struggle
    -
    -
    - +
    +
    +
    +
    +
    +
    -
    Played Power Card
    +
    Power Struggle
    diff --git a/play.js b/play.js index 9e00d94..7446aad 100644 --- a/play.js +++ b/play.js @@ -372,6 +372,8 @@ const ui = { played_card: document.getElementById("played_card"), scoring_card: document.getElementById("scoring_card"), played_power_card: document.getElementById("played_power_card"), + power_card_1: document.getElementById("power_card_1"), + power_card_2: document.getElementById("power_card_2"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), opp_hand: document.getElementById("opp_hand"), @@ -642,17 +644,26 @@ function on_update() { // UPDATE CARD DISPLAYS ui.played_card.replaceChildren() - + ui.power_card_1.replaceChildren() + ui.power_card_2.replaceChildren() + + console.log('view.is_pwr_struggle', view.is_pwr_struggle, 'view.power_card_1', view.power_card_1, 'view.power_card_2', view.power_card_2) if (!view.is_pwr_struggle) { if (view.played_card > 0) ui.played_card.appendChild(ui.cards[view.played_card]) + document.getElementById("scoring_card_panel").style.display = "none" } else { + document.getElementById("scoring_card_panel").style.display = "flex" if (view.played_card > 0) ui.scoring_card.appendChild(ui.cards[view.played_card]) + if (view.power_card_1) + ui.power_card_1.appendChild(ui.power_cards[view.power_card_1]) + if (view.power_card_2) + ui.power_card_2.appendChild(ui.power_cards[view.power_card_2]) } - ui.played_power_card.replaceChildren() +/* ui.played_power_card.replaceChildren() if (view.played_power_card > 0) - ui.played_power_card.appendChild(ui.power_cards[view.played_power_card]) + ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ ui.samizdat_card.replaceChildren() if (view.samizdat > 0) @@ -812,7 +823,7 @@ function on_log(text) { p.className = "h3" } - text = text.replace(/([a-zA-Z])\*/g, "") + text = text.replace(/([a-zA-Z])\*/g, "$1") p.innerHTML = text return p } diff --git a/rules.js b/rules.js index 48b34af..5654997 100644 --- a/rules.js +++ b/rules.js @@ -400,6 +400,9 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card + console.log('game.com_power_card', game.com_power_card, 'game.dem_power_card', game.dem_power_card) + view.power_card_1 = game.power_card_1 + view.power_card_2 = game.power_card_2 } view.strategy_discard = game.strategy_discard @@ -1574,6 +1577,13 @@ states.power_struggle = { power_card(card) { push_undo() discard(card) + if (game.phase === 0) { + game.power_card_1 = card + delete game.power_card_2 + } + if (game.phase === 1) { + game.power_card_2 = card + } game.valid_cards=[] game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} @@ -1643,6 +1653,8 @@ states.power_struggle = { concede () { push_undo() game.valid_cards = [] + delete game.power_card_1 + delete game.power_card_2 log('Conceded') log_h2('Aftermath') log_h3('Support Loss') @@ -2114,8 +2126,8 @@ states.general_strike = { prompt() { if (game.played_card === 0 ) { view.prompt = 'General Strike: you must discard a card or play a Scoring Card.' - available_cards = game.communist_hand - for (let card of available_cards) { + game.communist_hand + for (let card of game.communist_hand) { gen_action_card(card) } } else if (game.played_card > 0 ) { @@ -3884,11 +3896,11 @@ function find_country_index(country) { } function draw_deck() { - let hand = [] + let deck = [] for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 1) - hand.push(c) - return c + deck.push(c) + return deck } function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { -- cgit v1.2.3 From 84c87bb49f4e4dd5dad535b2f0403d91dd9fdfb2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 27 Oct 2024 22:22:00 +0000 Subject: Fix undeclared variable --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 5654997..54cfd26 100644 --- a/rules.js +++ b/rules.js @@ -4019,7 +4019,7 @@ function discard_card(hand) { } function discard_from_table(card) { - find_card = game.table_cards.indexOf(card) + let find_card = game.table_cards.indexOf(card) game.table_cards.splice(find_card, 1) game.strategy_discard.push(card) } -- cgit v1.2.3 From b7c261893c9b85a38fdd6cc3bc3210c69c908125 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 07:59:56 +0000 Subject: Fix game.played_card and show discard for events --- play.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/play.js b/play.js index 7446aad..bfe4578 100644 --- a/play.js +++ b/play.js @@ -647,7 +647,6 @@ function on_update() { ui.power_card_1.replaceChildren() ui.power_card_2.replaceChildren() - console.log('view.is_pwr_struggle', view.is_pwr_struggle, 'view.power_card_1', view.power_card_1, 'view.power_card_2', view.power_card_2) if (!view.is_pwr_struggle) { if (view.played_card > 0) ui.played_card.appendChild(ui.cards[view.played_card]) @@ -695,17 +694,24 @@ function on_update() { ui.ceausescu_hand.appendChild(ui.power_cards[c]) ui.discard.replaceChildren() - for (let c of view.strategy_discard) - ui.discard.appendChild(ui.cards[c]) + for (let c of view.strategy_discard) { + if (c === view.played_card) continue + ui.discard.appendChild(ui.cards[c]) } + if (view.discard) + document.getElementById("discard_panel").classList.remove("hide") + else + document.getElementById("discard_panel").classList.add("hide") ui.removed.replaceChildren() - for (let c of view.strategy_removed) - ui.removed.appendChild(ui.cards[c]) + for (let c of view.strategy_removed) { + if (c === view.played_card) continue + ui.removed.appendChild(ui.cards[c]) } ui.table_cards.replaceChildren() if (view.table_cards) - for (let c of view.table_cards) - ui.table_cards.appendChild(ui.cards[c]) + for (let c of view.table_cards) { + if (c === view.played_card) continue + ui.table_cards.appendChild(ui.cards[c]) } for (let e of action_register) e.classList.toggle("action", is_action(e.my_action, e.my_id)) -- cgit v1.2.3 From b595b4be88dd7a2ea291ab08d54c41b895d8663d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Oct 2024 12:24:57 +0100 Subject: Remove card asterisk in sub_card_name instead of all asterisks. --- play.css | 1 + play.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/play.css b/play.css index a0d7094..d33f84e 100644 --- a/play.css +++ b/play.css @@ -39,6 +39,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log { background-color: floralwhite } #log .h1 { background-color: tan } #log .h2 { background-color: wheat } +#log .h3 { background-color: wheat } #log .h2.dem { background-color: hsl(206, 85%, 80%); } #log .h2.com { background-color: hsl(355, 70%, 80%); } diff --git a/play.js b/play.js index bfe4578..b0c0644 100644 --- a/play.js +++ b/play.js @@ -765,7 +765,7 @@ function on_update() { function sub_card_name(_match, p1) { let x = p1 | 0 - return `${cards[x].name}` + return `${cards[x].name.replace("*", "")}` } function sub_power_card_name(_match, p1) { @@ -829,7 +829,6 @@ function on_log(text) { p.className = "h3" } - text = text.replace(/([a-zA-Z])\*/g, "$1") p.innerHTML = text return p } -- cgit v1.2.3 From 372d26d9ff82c772a6161465764eeb209f1d2752 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Oct 2024 12:24:31 +0100 Subject: WIP card display order --- play.css | 14 +----------- play.html | 60 ++++++++++++++++----------------------------------- play.js | 73 ++++++++++++++++++++++----------------------------------------- 3 files changed, 44 insertions(+), 103 deletions(-) diff --git a/play.css b/play.css index d33f84e..710ba57 100644 --- a/play.css +++ b/play.css @@ -234,22 +234,10 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } min-height: 350px; } -.panel:has(.panel_body:empty) { +.panel.autohide:has(.panel_body:empty) { display: none; } -#scoring_card_panel { - display: flex; - flex-direction: column; - width: 100%; -} - -#scoring_card_panel .card_row { - display: flex; - gap: 10px; -} - - /* CARD IMAGES */ #tooltip { diff --git a/play.html b/play.html index 97882fd..3dfa2a7 100644 --- a/play.html +++ b/play.html @@ -66,72 +66,49 @@
    - -
    -
    Cards on the Table
    -
    -
    - -
    Played Card
    - - -
    - - -
    -
    Power Struggle
    -
    -
    -
    -
    -
    - - -
    -
    Power Struggle
    -
    -
    -
    -
    Ceausescu Cards
    -
    -
    -
    +
    Power Struggle Hand
    +
    +
    The Crowd Turns Against Ceausescu
    +
    +
    +
    +
    Power Struggle Discard
    +
    +
    -
    Hand
    -
    +
    Opponent Hand
    -
    -
    Opponent Power Struggle Hand
    -
    -
    - -
    -
    Samizdat Card
    +
    +
    Samizdat
    + +
    +
    Persistent Events on the Table
    +
    +
    +
    Permanently Removed Events
    @@ -144,7 +121,6 @@
    -
    diff --git a/play.js b/play.js index b0c0644..6babd3b 100644 --- a/play.js +++ b/play.js @@ -370,17 +370,13 @@ const ui = { event_reminder_list: document.getElementById("event_reminder_list"), played_card: document.getElementById("played_card"), - scoring_card: document.getElementById("scoring_card"), - played_power_card: document.getElementById("played_power_card"), - power_card_1: document.getElementById("power_card_1"), - power_card_2: document.getElementById("power_card_2"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), + power_discard: document.getElementById("power_discard"), opp_hand: document.getElementById("opp_hand"), - opp_power_hand: document.getElementById("opp_power_hand"), discard: document.getElementById("discard"), removed: document.getElementById("removed"), - table_cards: document.getElementById("table_cards"), + persistent: document.getElementById("persistent"), ceausescu_hand: document.getElementById("ceausescu_hand"), samizdat_card: document.getElementById("samizdat_card"), @@ -643,27 +639,6 @@ function on_update() { // UPDATE CARD DISPLAYS - ui.played_card.replaceChildren() - ui.power_card_1.replaceChildren() - ui.power_card_2.replaceChildren() - - if (!view.is_pwr_struggle) { - if (view.played_card > 0) - ui.played_card.appendChild(ui.cards[view.played_card]) - document.getElementById("scoring_card_panel").style.display = "none" - } else { - document.getElementById("scoring_card_panel").style.display = "flex" - if (view.played_card > 0) - ui.scoring_card.appendChild(ui.cards[view.played_card]) - if (view.power_card_1) - ui.power_card_1.appendChild(ui.power_cards[view.power_card_1]) - if (view.power_card_2) - ui.power_card_2.appendChild(ui.power_cards[view.power_card_2]) - } -/* ui.played_power_card.replaceChildren() - if (view.played_power_card > 0) - ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ - ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) @@ -676,14 +651,16 @@ function on_update() { if (view.power_hand) for (let c of view.power_hand) ui.power_hand.appendChild(ui.power_cards[c]) - + + ui.power_discard.replaceChildren() + if (view.power_struggle_discard) + for (let c of view.power_struggle_discard) + ui.power_discard.appendChild(ui.power_cards[c]) + ui.opp_hand.replaceChildren() - if (view.show_opp_hand && view.opp_hand) + if (view.opp_hand) for (let c of view.opp_hand) ui.opp_hand.appendChild(ui.cards[c]) - - // TODO: fix rules to set view.opp_power_hand - ui.opp_power_hand.replaceChildren() if (view.opp_power_hand) for (let c of view.opp_power_hand) ui.opp_hand.appendChild(ui.power_cards[c]) @@ -694,24 +671,24 @@ function on_update() { ui.ceausescu_hand.appendChild(ui.power_cards[c]) ui.discard.replaceChildren() - for (let c of view.strategy_discard) { - if (c === view.played_card) continue - ui.discard.appendChild(ui.cards[c]) } - if (view.discard) - document.getElementById("discard_panel").classList.remove("hide") - else - document.getElementById("discard_panel").classList.add("hide") + for (let c of view.strategy_discard) + ui.discard.appendChild(ui.cards[c]) ui.removed.replaceChildren() - for (let c of view.strategy_removed) { - if (c === view.played_card) continue - ui.removed.appendChild(ui.cards[c]) } - - ui.table_cards.replaceChildren() - if (view.table_cards) - for (let c of view.table_cards) { - if (c === view.played_card) continue - ui.table_cards.appendChild(ui.cards[c]) } + for (let c of view.strategy_removed) + ui.removed.appendChild(ui.cards[c]) + + ui.persistent.replaceChildren() + for (let c of view.persistent_events) + ui.persistent.appendChild(ui.cards[c]) + + ui.played_card.replaceChildren() + if (view.played_card > 0) + ui.played_card.appendChild(ui.cards[view.played_card]) + if (view.power_card_1 > 0) + ui.played_card.appendChild(ui.power_cards[view.power_card_1]) + if (view.power_card_2 > 0) + ui.played_card.appendChild(ui.power_cards[view.power_card_2]) for (let e of action_register) e.classList.toggle("action", is_action(e.my_action, e.my_id)) -- cgit v1.2.3 From aa9dcde5f89f51297f74e3568233514be64a6dbe Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Oct 2024 14:31:28 +0100 Subject: ASSETS: Small 75dpi power cards. --- cards150/power_11_14.avif | Bin 0 -> 5229 bytes cards150/power_11_14.png | Bin 0 -> 47745 bytes cards150/power_15_18.avif | Bin 0 -> 5338 bytes cards150/power_15_18.png | Bin 0 -> 48545 bytes cards150/power_19_20.avif | Bin 0 -> 10236 bytes cards150/power_19_20.png | Bin 0 -> 75909 bytes cards150/power_1_6.avif | Bin 0 -> 7535 bytes cards150/power_1_6.png | Bin 0 -> 56232 bytes cards150/power_21_22.avif | Bin 0 -> 10209 bytes cards150/power_21_22.png | Bin 0 -> 75707 bytes cards150/power_23_26.avif | Bin 0 -> 10150 bytes cards150/power_23_26.png | Bin 0 -> 75440 bytes cards150/power_27_30.avif | Bin 0 -> 10219 bytes cards150/power_27_30.png | Bin 0 -> 75945 bytes cards150/power_31_33.avif | Bin 0 -> 5465 bytes cards150/power_31_33.png | Bin 0 -> 45714 bytes cards150/power_34_36.avif | Bin 0 -> 5461 bytes cards150/power_34_36.png | Bin 0 -> 45385 bytes cards150/power_37.avif | Bin 0 -> 6494 bytes cards150/power_37.png | Bin 0 -> 52511 bytes cards150/power_38.avif | Bin 0 -> 5874 bytes cards150/power_38.png | Bin 0 -> 46511 bytes cards150/power_39.avif | Bin 0 -> 6783 bytes cards150/power_39.png | Bin 0 -> 52692 bytes cards150/power_40.avif | Bin 0 -> 5326 bytes cards150/power_40.png | Bin 0 -> 42140 bytes cards150/power_41.avif | Bin 0 -> 5467 bytes cards150/power_41.png | Bin 0 -> 42879 bytes cards150/power_42.avif | Bin 0 -> 7152 bytes cards150/power_42.png | Bin 0 -> 53459 bytes cards150/power_43.avif | Bin 0 -> 4719 bytes cards150/power_43.png | Bin 0 -> 37679 bytes cards150/power_44.avif | Bin 0 -> 4635 bytes cards150/power_44.png | Bin 0 -> 36666 bytes cards150/power_45.avif | Bin 0 -> 4718 bytes cards150/power_45.png | Bin 0 -> 37837 bytes cards150/power_46.avif | Bin 0 -> 8754 bytes cards150/power_46.png | Bin 0 -> 65902 bytes cards150/power_47.avif | Bin 0 -> 7156 bytes cards150/power_47.png | Bin 0 -> 54927 bytes cards150/power_48.avif | Bin 0 -> 8849 bytes cards150/power_48.png | Bin 0 -> 68467 bytes cards150/power_49.avif | Bin 0 -> 5163 bytes cards150/power_49.png | Bin 0 -> 35375 bytes cards150/power_50.avif | Bin 0 -> 6245 bytes cards150/power_50.png | Bin 0 -> 45351 bytes cards150/power_51.avif | Bin 0 -> 6531 bytes cards150/power_51.png | Bin 0 -> 46021 bytes cards150/power_52.avif | Bin 0 -> 7369 bytes cards150/power_52.png | Bin 0 -> 52690 bytes cards150/power_7_8.avif | Bin 0 -> 5290 bytes cards150/power_7_8.png | Bin 0 -> 48453 bytes cards150/power_9_10.avif | Bin 0 -> 5261 bytes cards150/power_9_10.png | Bin 0 -> 48211 bytes cards150/power_back.avif | Bin 0 -> 6271 bytes cards150/power_back.png | Bin 0 -> 179479 bytes cards75/power_11_14.avif | Bin 0 -> 4722 bytes cards75/power_11_14.png | Bin 0 -> 27616 bytes cards75/power_15_18.avif | Bin 0 -> 4775 bytes cards75/power_15_18.png | Bin 0 -> 27962 bytes cards75/power_19_20.avif | Bin 0 -> 8170 bytes cards75/power_19_20.png | Bin 0 -> 42427 bytes cards75/power_1_6.avif | Bin 0 -> 6346 bytes cards75/power_1_6.png | Bin 0 -> 33456 bytes cards75/power_21_22.avif | Bin 0 -> 8116 bytes cards75/power_21_22.png | Bin 0 -> 42296 bytes cards75/power_23_26.avif | Bin 0 -> 8096 bytes cards75/power_23_26.png | Bin 0 -> 42154 bytes cards75/power_27_30.avif | Bin 0 -> 8185 bytes cards75/power_27_30.png | Bin 0 -> 42441 bytes cards75/power_31_33.avif | Bin 0 -> 4395 bytes cards75/power_31_33.png | Bin 0 -> 25599 bytes cards75/power_34_36.avif | Bin 0 -> 4376 bytes cards75/power_34_36.png | Bin 0 -> 25473 bytes cards75/power_37.avif | Bin 0 -> 5125 bytes cards75/power_37.png | Bin 0 -> 28776 bytes cards75/power_38.avif | Bin 0 -> 5011 bytes cards75/power_38.png | Bin 0 -> 27499 bytes cards75/power_39.avif | Bin 0 -> 5362 bytes cards75/power_39.png | Bin 0 -> 29822 bytes cards75/power_40.avif | Bin 0 -> 4461 bytes cards75/power_40.png | Bin 0 -> 24275 bytes cards75/power_41.avif | Bin 0 -> 4693 bytes cards75/power_41.png | Bin 0 -> 25238 bytes cards75/power_42.avif | Bin 0 -> 5519 bytes cards75/power_42.png | Bin 0 -> 30121 bytes cards75/power_43.avif | Bin 0 -> 3936 bytes cards75/power_43.png | Bin 0 -> 21595 bytes cards75/power_44.avif | Bin 0 -> 3732 bytes cards75/power_44.png | Bin 0 -> 20414 bytes cards75/power_45.avif | Bin 0 -> 4254 bytes cards75/power_45.png | Bin 0 -> 23051 bytes cards75/power_46.avif | Bin 0 -> 6361 bytes cards75/power_46.png | Bin 0 -> 36124 bytes cards75/power_47.avif | Bin 0 -> 5658 bytes cards75/power_47.png | Bin 0 -> 30728 bytes cards75/power_48.avif | Bin 0 -> 6765 bytes cards75/power_48.png | Bin 0 -> 38695 bytes cards75/power_49.avif | Bin 0 -> 4112 bytes cards75/power_49.png | Bin 0 -> 20622 bytes cards75/power_50.avif | Bin 0 -> 5241 bytes cards75/power_50.png | Bin 0 -> 27130 bytes cards75/power_51.avif | Bin 0 -> 5126 bytes cards75/power_51.png | Bin 0 -> 26487 bytes cards75/power_52.avif | Bin 0 -> 5647 bytes cards75/power_52.png | Bin 0 -> 29560 bytes cards75/power_7_8.avif | Bin 0 -> 4771 bytes cards75/power_7_8.png | Bin 0 -> 27880 bytes cards75/power_9_10.avif | Bin 0 -> 4739 bytes cards75/power_9_10.png | Bin 0 -> 27771 bytes cards75/power_back.avif | Bin 0 -> 5387 bytes cards75/power_back.png | Bin 0 -> 50112 bytes 112 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cards150/power_11_14.avif create mode 100644 cards150/power_11_14.png create mode 100644 cards150/power_15_18.avif create mode 100644 cards150/power_15_18.png create mode 100644 cards150/power_19_20.avif create mode 100644 cards150/power_19_20.png create mode 100644 cards150/power_1_6.avif create mode 100644 cards150/power_1_6.png create mode 100644 cards150/power_21_22.avif create mode 100644 cards150/power_21_22.png create mode 100644 cards150/power_23_26.avif create mode 100644 cards150/power_23_26.png create mode 100644 cards150/power_27_30.avif create mode 100644 cards150/power_27_30.png create mode 100644 cards150/power_31_33.avif create mode 100644 cards150/power_31_33.png create mode 100644 cards150/power_34_36.avif create mode 100644 cards150/power_34_36.png create mode 100644 cards150/power_37.avif create mode 100644 cards150/power_37.png create mode 100644 cards150/power_38.avif create mode 100644 cards150/power_38.png create mode 100644 cards150/power_39.avif create mode 100644 cards150/power_39.png create mode 100644 cards150/power_40.avif create mode 100644 cards150/power_40.png create mode 100644 cards150/power_41.avif create mode 100644 cards150/power_41.png create mode 100644 cards150/power_42.avif create mode 100644 cards150/power_42.png create mode 100644 cards150/power_43.avif create mode 100644 cards150/power_43.png create mode 100644 cards150/power_44.avif create mode 100644 cards150/power_44.png create mode 100644 cards150/power_45.avif create mode 100644 cards150/power_45.png create mode 100644 cards150/power_46.avif create mode 100644 cards150/power_46.png create mode 100644 cards150/power_47.avif create mode 100644 cards150/power_47.png create mode 100644 cards150/power_48.avif create mode 100644 cards150/power_48.png create mode 100644 cards150/power_49.avif create mode 100644 cards150/power_49.png create mode 100644 cards150/power_50.avif create mode 100644 cards150/power_50.png create mode 100644 cards150/power_51.avif create mode 100644 cards150/power_51.png create mode 100644 cards150/power_52.avif create mode 100644 cards150/power_52.png create mode 100644 cards150/power_7_8.avif create mode 100644 cards150/power_7_8.png create mode 100644 cards150/power_9_10.avif create mode 100644 cards150/power_9_10.png create mode 100644 cards150/power_back.avif create mode 100644 cards150/power_back.png create mode 100644 cards75/power_11_14.avif create mode 100644 cards75/power_11_14.png create mode 100644 cards75/power_15_18.avif create mode 100644 cards75/power_15_18.png create mode 100644 cards75/power_19_20.avif create mode 100644 cards75/power_19_20.png create mode 100644 cards75/power_1_6.avif create mode 100644 cards75/power_1_6.png create mode 100644 cards75/power_21_22.avif create mode 100644 cards75/power_21_22.png create mode 100644 cards75/power_23_26.avif create mode 100644 cards75/power_23_26.png create mode 100644 cards75/power_27_30.avif create mode 100644 cards75/power_27_30.png create mode 100644 cards75/power_31_33.avif create mode 100644 cards75/power_31_33.png create mode 100644 cards75/power_34_36.avif create mode 100644 cards75/power_34_36.png create mode 100644 cards75/power_37.avif create mode 100644 cards75/power_37.png create mode 100644 cards75/power_38.avif create mode 100644 cards75/power_38.png create mode 100644 cards75/power_39.avif create mode 100644 cards75/power_39.png create mode 100644 cards75/power_40.avif create mode 100644 cards75/power_40.png create mode 100644 cards75/power_41.avif create mode 100644 cards75/power_41.png create mode 100644 cards75/power_42.avif create mode 100644 cards75/power_42.png create mode 100644 cards75/power_43.avif create mode 100644 cards75/power_43.png create mode 100644 cards75/power_44.avif create mode 100644 cards75/power_44.png create mode 100644 cards75/power_45.avif create mode 100644 cards75/power_45.png create mode 100644 cards75/power_46.avif create mode 100644 cards75/power_46.png create mode 100644 cards75/power_47.avif create mode 100644 cards75/power_47.png create mode 100644 cards75/power_48.avif create mode 100644 cards75/power_48.png create mode 100644 cards75/power_49.avif create mode 100644 cards75/power_49.png create mode 100644 cards75/power_50.avif create mode 100644 cards75/power_50.png create mode 100644 cards75/power_51.avif create mode 100644 cards75/power_51.png create mode 100644 cards75/power_52.avif create mode 100644 cards75/power_52.png create mode 100644 cards75/power_7_8.avif create mode 100644 cards75/power_7_8.png create mode 100644 cards75/power_9_10.avif create mode 100644 cards75/power_9_10.png create mode 100644 cards75/power_back.avif create mode 100644 cards75/power_back.png diff --git a/cards150/power_11_14.avif b/cards150/power_11_14.avif new file mode 100644 index 0000000..60be195 Binary files /dev/null and b/cards150/power_11_14.avif differ diff --git a/cards150/power_11_14.png b/cards150/power_11_14.png new file mode 100644 index 0000000..f406e04 Binary files /dev/null and b/cards150/power_11_14.png differ diff --git a/cards150/power_15_18.avif b/cards150/power_15_18.avif new file mode 100644 index 0000000..0d5fa12 Binary files /dev/null and b/cards150/power_15_18.avif differ diff --git a/cards150/power_15_18.png b/cards150/power_15_18.png new file mode 100644 index 0000000..737f367 Binary files /dev/null and b/cards150/power_15_18.png differ diff --git a/cards150/power_19_20.avif b/cards150/power_19_20.avif new file mode 100644 index 0000000..fae7847 Binary files /dev/null and b/cards150/power_19_20.avif differ diff --git a/cards150/power_19_20.png b/cards150/power_19_20.png new file mode 100644 index 0000000..5d8b367 Binary files /dev/null and b/cards150/power_19_20.png differ diff --git a/cards150/power_1_6.avif b/cards150/power_1_6.avif new file mode 100644 index 0000000..16e5188 Binary files /dev/null and b/cards150/power_1_6.avif differ diff --git a/cards150/power_1_6.png b/cards150/power_1_6.png new file mode 100644 index 0000000..814a525 Binary files /dev/null and b/cards150/power_1_6.png differ diff --git a/cards150/power_21_22.avif b/cards150/power_21_22.avif new file mode 100644 index 0000000..e3cff40 Binary files /dev/null and b/cards150/power_21_22.avif differ diff --git a/cards150/power_21_22.png b/cards150/power_21_22.png new file mode 100644 index 0000000..0507797 Binary files /dev/null and b/cards150/power_21_22.png differ diff --git a/cards150/power_23_26.avif b/cards150/power_23_26.avif new file mode 100644 index 0000000..ac6bc3c Binary files /dev/null and b/cards150/power_23_26.avif differ diff --git a/cards150/power_23_26.png b/cards150/power_23_26.png new file mode 100644 index 0000000..7391a5f Binary files /dev/null and b/cards150/power_23_26.png differ diff --git a/cards150/power_27_30.avif b/cards150/power_27_30.avif new file mode 100644 index 0000000..f25e44b Binary files /dev/null and b/cards150/power_27_30.avif differ diff --git a/cards150/power_27_30.png b/cards150/power_27_30.png new file mode 100644 index 0000000..c2af3e8 Binary files /dev/null and b/cards150/power_27_30.png differ diff --git a/cards150/power_31_33.avif b/cards150/power_31_33.avif new file mode 100644 index 0000000..00f69bd Binary files /dev/null and b/cards150/power_31_33.avif differ diff --git a/cards150/power_31_33.png b/cards150/power_31_33.png new file mode 100644 index 0000000..fd9559f Binary files /dev/null and b/cards150/power_31_33.png differ diff --git a/cards150/power_34_36.avif b/cards150/power_34_36.avif new file mode 100644 index 0000000..0658e28 Binary files /dev/null and b/cards150/power_34_36.avif differ diff --git a/cards150/power_34_36.png b/cards150/power_34_36.png new file mode 100644 index 0000000..7a247f6 Binary files /dev/null and b/cards150/power_34_36.png differ diff --git a/cards150/power_37.avif b/cards150/power_37.avif new file mode 100644 index 0000000..dfe46c1 Binary files /dev/null and b/cards150/power_37.avif differ diff --git a/cards150/power_37.png b/cards150/power_37.png new file mode 100644 index 0000000..dc2bbd0 Binary files /dev/null and b/cards150/power_37.png differ diff --git a/cards150/power_38.avif b/cards150/power_38.avif new file mode 100644 index 0000000..ec01486 Binary files /dev/null and b/cards150/power_38.avif differ diff --git a/cards150/power_38.png b/cards150/power_38.png new file mode 100644 index 0000000..ec0c371 Binary files /dev/null and b/cards150/power_38.png differ diff --git a/cards150/power_39.avif b/cards150/power_39.avif new file mode 100644 index 0000000..0537140 Binary files /dev/null and b/cards150/power_39.avif differ diff --git a/cards150/power_39.png b/cards150/power_39.png new file mode 100644 index 0000000..4a8c514 Binary files /dev/null and b/cards150/power_39.png differ diff --git a/cards150/power_40.avif b/cards150/power_40.avif new file mode 100644 index 0000000..db88422 Binary files /dev/null and b/cards150/power_40.avif differ diff --git a/cards150/power_40.png b/cards150/power_40.png new file mode 100644 index 0000000..c0e49ff Binary files /dev/null and b/cards150/power_40.png differ diff --git a/cards150/power_41.avif b/cards150/power_41.avif new file mode 100644 index 0000000..a954dda Binary files /dev/null and b/cards150/power_41.avif differ diff --git a/cards150/power_41.png b/cards150/power_41.png new file mode 100644 index 0000000..1dce21c Binary files /dev/null and b/cards150/power_41.png differ diff --git a/cards150/power_42.avif b/cards150/power_42.avif new file mode 100644 index 0000000..41bd14a Binary files /dev/null and b/cards150/power_42.avif differ diff --git a/cards150/power_42.png b/cards150/power_42.png new file mode 100644 index 0000000..33c35cb Binary files /dev/null and b/cards150/power_42.png differ diff --git a/cards150/power_43.avif b/cards150/power_43.avif new file mode 100644 index 0000000..a309046 Binary files /dev/null and b/cards150/power_43.avif differ diff --git a/cards150/power_43.png b/cards150/power_43.png new file mode 100644 index 0000000..7aec913 Binary files /dev/null and b/cards150/power_43.png differ diff --git a/cards150/power_44.avif b/cards150/power_44.avif new file mode 100644 index 0000000..eb0e496 Binary files /dev/null and b/cards150/power_44.avif differ diff --git a/cards150/power_44.png b/cards150/power_44.png new file mode 100644 index 0000000..ea208b6 Binary files /dev/null and b/cards150/power_44.png differ diff --git a/cards150/power_45.avif b/cards150/power_45.avif new file mode 100644 index 0000000..0c6b812 Binary files /dev/null and b/cards150/power_45.avif differ diff --git a/cards150/power_45.png b/cards150/power_45.png new file mode 100644 index 0000000..fb92a03 Binary files /dev/null and b/cards150/power_45.png differ diff --git a/cards150/power_46.avif b/cards150/power_46.avif new file mode 100644 index 0000000..c9f53bd Binary files /dev/null and b/cards150/power_46.avif differ diff --git a/cards150/power_46.png b/cards150/power_46.png new file mode 100644 index 0000000..9d26e49 Binary files /dev/null and b/cards150/power_46.png differ diff --git a/cards150/power_47.avif b/cards150/power_47.avif new file mode 100644 index 0000000..4a24bc2 Binary files /dev/null and b/cards150/power_47.avif differ diff --git a/cards150/power_47.png b/cards150/power_47.png new file mode 100644 index 0000000..37be57a Binary files /dev/null and b/cards150/power_47.png differ diff --git a/cards150/power_48.avif b/cards150/power_48.avif new file mode 100644 index 0000000..fd143e5 Binary files /dev/null and b/cards150/power_48.avif differ diff --git a/cards150/power_48.png b/cards150/power_48.png new file mode 100644 index 0000000..81f98e6 Binary files /dev/null and b/cards150/power_48.png differ diff --git a/cards150/power_49.avif b/cards150/power_49.avif new file mode 100644 index 0000000..d269d21 Binary files /dev/null and b/cards150/power_49.avif differ diff --git a/cards150/power_49.png b/cards150/power_49.png new file mode 100644 index 0000000..b82a1a4 Binary files /dev/null and b/cards150/power_49.png differ diff --git a/cards150/power_50.avif b/cards150/power_50.avif new file mode 100644 index 0000000..4acf139 Binary files /dev/null and b/cards150/power_50.avif differ diff --git a/cards150/power_50.png b/cards150/power_50.png new file mode 100644 index 0000000..7988f80 Binary files /dev/null and b/cards150/power_50.png differ diff --git a/cards150/power_51.avif b/cards150/power_51.avif new file mode 100644 index 0000000..8bf7a59 Binary files /dev/null and b/cards150/power_51.avif differ diff --git a/cards150/power_51.png b/cards150/power_51.png new file mode 100644 index 0000000..b342cfd Binary files /dev/null and b/cards150/power_51.png differ diff --git a/cards150/power_52.avif b/cards150/power_52.avif new file mode 100644 index 0000000..64b2c66 Binary files /dev/null and b/cards150/power_52.avif differ diff --git a/cards150/power_52.png b/cards150/power_52.png new file mode 100644 index 0000000..c9243d8 Binary files /dev/null and b/cards150/power_52.png differ diff --git a/cards150/power_7_8.avif b/cards150/power_7_8.avif new file mode 100644 index 0000000..3959742 Binary files /dev/null and b/cards150/power_7_8.avif differ diff --git a/cards150/power_7_8.png b/cards150/power_7_8.png new file mode 100644 index 0000000..8829696 Binary files /dev/null and b/cards150/power_7_8.png differ diff --git a/cards150/power_9_10.avif b/cards150/power_9_10.avif new file mode 100644 index 0000000..416ad4b Binary files /dev/null and b/cards150/power_9_10.avif differ diff --git a/cards150/power_9_10.png b/cards150/power_9_10.png new file mode 100644 index 0000000..dcdf959 Binary files /dev/null and b/cards150/power_9_10.png differ diff --git a/cards150/power_back.avif b/cards150/power_back.avif new file mode 100644 index 0000000..7faacac Binary files /dev/null and b/cards150/power_back.avif differ diff --git a/cards150/power_back.png b/cards150/power_back.png new file mode 100644 index 0000000..a11dcd9 Binary files /dev/null and b/cards150/power_back.png differ diff --git a/cards75/power_11_14.avif b/cards75/power_11_14.avif new file mode 100644 index 0000000..5488f01 Binary files /dev/null and b/cards75/power_11_14.avif differ diff --git a/cards75/power_11_14.png b/cards75/power_11_14.png new file mode 100644 index 0000000..040c518 Binary files /dev/null and b/cards75/power_11_14.png differ diff --git a/cards75/power_15_18.avif b/cards75/power_15_18.avif new file mode 100644 index 0000000..ef3c3ee Binary files /dev/null and b/cards75/power_15_18.avif differ diff --git a/cards75/power_15_18.png b/cards75/power_15_18.png new file mode 100644 index 0000000..e46f823 Binary files /dev/null and b/cards75/power_15_18.png differ diff --git a/cards75/power_19_20.avif b/cards75/power_19_20.avif new file mode 100644 index 0000000..f6c641a Binary files /dev/null and b/cards75/power_19_20.avif differ diff --git a/cards75/power_19_20.png b/cards75/power_19_20.png new file mode 100644 index 0000000..0a44c0d Binary files /dev/null and b/cards75/power_19_20.png differ diff --git a/cards75/power_1_6.avif b/cards75/power_1_6.avif new file mode 100644 index 0000000..ca0280b Binary files /dev/null and b/cards75/power_1_6.avif differ diff --git a/cards75/power_1_6.png b/cards75/power_1_6.png new file mode 100644 index 0000000..2d8735a Binary files /dev/null and b/cards75/power_1_6.png differ diff --git a/cards75/power_21_22.avif b/cards75/power_21_22.avif new file mode 100644 index 0000000..8c9c907 Binary files /dev/null and b/cards75/power_21_22.avif differ diff --git a/cards75/power_21_22.png b/cards75/power_21_22.png new file mode 100644 index 0000000..710e0af Binary files /dev/null and b/cards75/power_21_22.png differ diff --git a/cards75/power_23_26.avif b/cards75/power_23_26.avif new file mode 100644 index 0000000..346c49a Binary files /dev/null and b/cards75/power_23_26.avif differ diff --git a/cards75/power_23_26.png b/cards75/power_23_26.png new file mode 100644 index 0000000..751510a Binary files /dev/null and b/cards75/power_23_26.png differ diff --git a/cards75/power_27_30.avif b/cards75/power_27_30.avif new file mode 100644 index 0000000..7de3cc4 Binary files /dev/null and b/cards75/power_27_30.avif differ diff --git a/cards75/power_27_30.png b/cards75/power_27_30.png new file mode 100644 index 0000000..9ee10f7 Binary files /dev/null and b/cards75/power_27_30.png differ diff --git a/cards75/power_31_33.avif b/cards75/power_31_33.avif new file mode 100644 index 0000000..36e9a11 Binary files /dev/null and b/cards75/power_31_33.avif differ diff --git a/cards75/power_31_33.png b/cards75/power_31_33.png new file mode 100644 index 0000000..b48084c Binary files /dev/null and b/cards75/power_31_33.png differ diff --git a/cards75/power_34_36.avif b/cards75/power_34_36.avif new file mode 100644 index 0000000..d3129e2 Binary files /dev/null and b/cards75/power_34_36.avif differ diff --git a/cards75/power_34_36.png b/cards75/power_34_36.png new file mode 100644 index 0000000..bedb784 Binary files /dev/null and b/cards75/power_34_36.png differ diff --git a/cards75/power_37.avif b/cards75/power_37.avif new file mode 100644 index 0000000..6a56779 Binary files /dev/null and b/cards75/power_37.avif differ diff --git a/cards75/power_37.png b/cards75/power_37.png new file mode 100644 index 0000000..8841551 Binary files /dev/null and b/cards75/power_37.png differ diff --git a/cards75/power_38.avif b/cards75/power_38.avif new file mode 100644 index 0000000..3966407 Binary files /dev/null and b/cards75/power_38.avif differ diff --git a/cards75/power_38.png b/cards75/power_38.png new file mode 100644 index 0000000..2193650 Binary files /dev/null and b/cards75/power_38.png differ diff --git a/cards75/power_39.avif b/cards75/power_39.avif new file mode 100644 index 0000000..82f4b4a Binary files /dev/null and b/cards75/power_39.avif differ diff --git a/cards75/power_39.png b/cards75/power_39.png new file mode 100644 index 0000000..0da6f14 Binary files /dev/null and b/cards75/power_39.png differ diff --git a/cards75/power_40.avif b/cards75/power_40.avif new file mode 100644 index 0000000..e3fe0c1 Binary files /dev/null and b/cards75/power_40.avif differ diff --git a/cards75/power_40.png b/cards75/power_40.png new file mode 100644 index 0000000..034c504 Binary files /dev/null and b/cards75/power_40.png differ diff --git a/cards75/power_41.avif b/cards75/power_41.avif new file mode 100644 index 0000000..dab5e03 Binary files /dev/null and b/cards75/power_41.avif differ diff --git a/cards75/power_41.png b/cards75/power_41.png new file mode 100644 index 0000000..745f38f Binary files /dev/null and b/cards75/power_41.png differ diff --git a/cards75/power_42.avif b/cards75/power_42.avif new file mode 100644 index 0000000..c299c52 Binary files /dev/null and b/cards75/power_42.avif differ diff --git a/cards75/power_42.png b/cards75/power_42.png new file mode 100644 index 0000000..c81a2be Binary files /dev/null and b/cards75/power_42.png differ diff --git a/cards75/power_43.avif b/cards75/power_43.avif new file mode 100644 index 0000000..d7a6e76 Binary files /dev/null and b/cards75/power_43.avif differ diff --git a/cards75/power_43.png b/cards75/power_43.png new file mode 100644 index 0000000..4999cff Binary files /dev/null and b/cards75/power_43.png differ diff --git a/cards75/power_44.avif b/cards75/power_44.avif new file mode 100644 index 0000000..60054e6 Binary files /dev/null and b/cards75/power_44.avif differ diff --git a/cards75/power_44.png b/cards75/power_44.png new file mode 100644 index 0000000..34d5518 Binary files /dev/null and b/cards75/power_44.png differ diff --git a/cards75/power_45.avif b/cards75/power_45.avif new file mode 100644 index 0000000..959bc4a Binary files /dev/null and b/cards75/power_45.avif differ diff --git a/cards75/power_45.png b/cards75/power_45.png new file mode 100644 index 0000000..e104c7c Binary files /dev/null and b/cards75/power_45.png differ diff --git a/cards75/power_46.avif b/cards75/power_46.avif new file mode 100644 index 0000000..727df34 Binary files /dev/null and b/cards75/power_46.avif differ diff --git a/cards75/power_46.png b/cards75/power_46.png new file mode 100644 index 0000000..eb8c1c0 Binary files /dev/null and b/cards75/power_46.png differ diff --git a/cards75/power_47.avif b/cards75/power_47.avif new file mode 100644 index 0000000..17fdedb Binary files /dev/null and b/cards75/power_47.avif differ diff --git a/cards75/power_47.png b/cards75/power_47.png new file mode 100644 index 0000000..e75894d Binary files /dev/null and b/cards75/power_47.png differ diff --git a/cards75/power_48.avif b/cards75/power_48.avif new file mode 100644 index 0000000..d65080b Binary files /dev/null and b/cards75/power_48.avif differ diff --git a/cards75/power_48.png b/cards75/power_48.png new file mode 100644 index 0000000..9bcbd0a Binary files /dev/null and b/cards75/power_48.png differ diff --git a/cards75/power_49.avif b/cards75/power_49.avif new file mode 100644 index 0000000..f862562 Binary files /dev/null and b/cards75/power_49.avif differ diff --git a/cards75/power_49.png b/cards75/power_49.png new file mode 100644 index 0000000..f6e4349 Binary files /dev/null and b/cards75/power_49.png differ diff --git a/cards75/power_50.avif b/cards75/power_50.avif new file mode 100644 index 0000000..af77e6b Binary files /dev/null and b/cards75/power_50.avif differ diff --git a/cards75/power_50.png b/cards75/power_50.png new file mode 100644 index 0000000..e5a1582 Binary files /dev/null and b/cards75/power_50.png differ diff --git a/cards75/power_51.avif b/cards75/power_51.avif new file mode 100644 index 0000000..bcdf23b Binary files /dev/null and b/cards75/power_51.avif differ diff --git a/cards75/power_51.png b/cards75/power_51.png new file mode 100644 index 0000000..0e9de51 Binary files /dev/null and b/cards75/power_51.png differ diff --git a/cards75/power_52.avif b/cards75/power_52.avif new file mode 100644 index 0000000..4d77f9c Binary files /dev/null and b/cards75/power_52.avif differ diff --git a/cards75/power_52.png b/cards75/power_52.png new file mode 100644 index 0000000..c909f71 Binary files /dev/null and b/cards75/power_52.png differ diff --git a/cards75/power_7_8.avif b/cards75/power_7_8.avif new file mode 100644 index 0000000..590e627 Binary files /dev/null and b/cards75/power_7_8.avif differ diff --git a/cards75/power_7_8.png b/cards75/power_7_8.png new file mode 100644 index 0000000..82acce3 Binary files /dev/null and b/cards75/power_7_8.png differ diff --git a/cards75/power_9_10.avif b/cards75/power_9_10.avif new file mode 100644 index 0000000..b5b8aa6 Binary files /dev/null and b/cards75/power_9_10.avif differ diff --git a/cards75/power_9_10.png b/cards75/power_9_10.png new file mode 100644 index 0000000..db8daa4 Binary files /dev/null and b/cards75/power_9_10.png differ diff --git a/cards75/power_back.avif b/cards75/power_back.avif new file mode 100644 index 0000000..a73f412 Binary files /dev/null and b/cards75/power_back.avif differ diff --git a/cards75/power_back.png b/cards75/power_back.png new file mode 100644 index 0000000..4f7725d Binary files /dev/null and b/cards75/power_back.png differ -- cgit v1.2.3 From 2a3049cec4d0d0153395b77d9974b3c50106b3d0 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Oct 2024 14:33:09 +0100 Subject: WIP use smaller power cards. --- info/cards.html | 106 +++++++++++++++++++++++++-------------------------- play.css | 116 ++++++++++++++++++++++++++++++-------------------------- play.html | 6 +-- play.js | 2 +- 4 files changed, 120 insertions(+), 110 deletions(-) diff --git a/info/cards.html b/info/cards.html index 8498d00..81b808c 100644 --- a/info/cards.html +++ b/info/cards.html @@ -143,59 +143,59 @@ img {
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/play.css b/play.css index 710ba57..e574797 100644 --- a/play.css +++ b/play.css @@ -234,6 +234,10 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } min-height: 350px; } +.panel_body.power { + min-height: 263px; +} + .panel.autohide:has(.panel_body:empty) { display: none; } @@ -258,6 +262,12 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } box-shadow: 0 0 0 1px #444, 1px 2px 4px #0004; } +.power_card { + width: 188px; + height: 263px; + border-radius: 12px; +} + .card.action { box-shadow: 0 0 0 1px #444, 0 0 0 4px white; } @@ -378,56 +388,56 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.event_109 { background-image: url(cards100/event_109.avif) } .card.event_110 { background-image: url(cards100/event_110.avif) } -.card.power_0 { background-image: url(cards100/power_back.avif) } -.card.power_1 { background-image: url(cards100/power_1_6.avif) } -.card.power_2 { background-image: url(cards100/power_1_6.avif) } -.card.power_3 { background-image: url(cards100/power_1_6.avif) } -.card.power_4 { background-image: url(cards100/power_1_6.avif) } -.card.power_5 { background-image: url(cards100/power_1_6.avif) } -.card.power_6 { background-image: url(cards100/power_1_6.avif) } -.card.power_7 { background-image: url(cards100/power_7_8.avif) } -.card.power_8 { background-image: url(cards100/power_7_8.avif) } -.card.power_9 { background-image: url(cards100/power_9_10.avif) } -.card.power_10 { background-image: url(cards100/power_9_10.avif) } -.card.power_11 { background-image: url(cards100/power_11_14.avif) } -.card.power_12 { background-image: url(cards100/power_11_14.avif) } -.card.power_13 { background-image: url(cards100/power_11_14.avif) } -.card.power_14 { background-image: url(cards100/power_11_14.avif) } -.card.power_15 { background-image: url(cards100/power_15_18.avif) } -.card.power_16 { background-image: url(cards100/power_15_18.avif) } -.card.power_17 { background-image: url(cards100/power_15_18.avif) } -.card.power_18 { background-image: url(cards100/power_15_18.avif) } -.card.power_19 { background-image: url(cards100/power_19_20.avif) } -.card.power_20 { background-image: url(cards100/power_19_20.avif) } -.card.power_21 { background-image: url(cards100/power_21_22.avif) } -.card.power_22 { background-image: url(cards100/power_21_22.avif) } -.card.power_23 { background-image: url(cards100/power_23_26.avif) } -.card.power_24 { background-image: url(cards100/power_23_26.avif) } -.card.power_25 { background-image: url(cards100/power_23_26.avif) } -.card.power_26 { background-image: url(cards100/power_23_26.avif) } -.card.power_27 { background-image: url(cards100/power_27_30.avif) } -.card.power_28 { background-image: url(cards100/power_27_30.avif) } -.card.power_29 { background-image: url(cards100/power_27_30.avif) } -.card.power_30 { background-image: url(cards100/power_27_30.avif) } -.card.power_31 { background-image: url(cards100/power_31_33.avif) } -.card.power_32 { background-image: url(cards100/power_31_33.avif) } -.card.power_33 { background-image: url(cards100/power_31_33.avif) } -.card.power_34 { background-image: url(cards100/power_34_36.avif) } -.card.power_35 { background-image: url(cards100/power_34_36.avif) } -.card.power_36 { background-image: url(cards100/power_34_36.avif) } -.card.power_37 { background-image: url(cards100/power_37.avif) } -.card.power_38 { background-image: url(cards100/power_38.avif) } -.card.power_39 { background-image: url(cards100/power_39.avif) } -.card.power_40 { background-image: url(cards100/power_40.avif) } -.card.power_41 { background-image: url(cards100/power_41.avif) } -.card.power_42 { background-image: url(cards100/power_42.avif) } -.card.power_43 { background-image: url(cards100/power_43.avif) } -.card.power_44 { background-image: url(cards100/power_44.avif) } -.card.power_45 { background-image: url(cards100/power_45.avif) } -.card.power_46 { background-image: url(cards100/power_46.avif) } -.card.power_47 { background-image: url(cards100/power_47.avif) } -.card.power_48 { background-image: url(cards100/power_48.avif) } -.card.power_49 { background-image: url(cards100/power_49.avif) } -.card.power_50 { background-image: url(cards100/power_50.avif) } -.card.power_51 { background-image: url(cards100/power_51.avif) } -.card.power_52 { background-image: url(cards100/power_52.avif) } +.card.power_0 { background-image: url(cards75/power_back.avif) } +.card.power_1 { background-image: url(cards75/power_1_6.avif) } +.card.power_2 { background-image: url(cards75/power_1_6.avif) } +.card.power_3 { background-image: url(cards75/power_1_6.avif) } +.card.power_4 { background-image: url(cards75/power_1_6.avif) } +.card.power_5 { background-image: url(cards75/power_1_6.avif) } +.card.power_6 { background-image: url(cards75/power_1_6.avif) } +.card.power_7 { background-image: url(cards75/power_7_8.avif) } +.card.power_8 { background-image: url(cards75/power_7_8.avif) } +.card.power_9 { background-image: url(cards75/power_9_10.avif) } +.card.power_10 { background-image: url(cards75/power_9_10.avif) } +.card.power_11 { background-image: url(cards75/power_11_14.avif) } +.card.power_12 { background-image: url(cards75/power_11_14.avif) } +.card.power_13 { background-image: url(cards75/power_11_14.avif) } +.card.power_14 { background-image: url(cards75/power_11_14.avif) } +.card.power_15 { background-image: url(cards75/power_15_18.avif) } +.card.power_16 { background-image: url(cards75/power_15_18.avif) } +.card.power_17 { background-image: url(cards75/power_15_18.avif) } +.card.power_18 { background-image: url(cards75/power_15_18.avif) } +.card.power_19 { background-image: url(cards75/power_19_20.avif) } +.card.power_20 { background-image: url(cards75/power_19_20.avif) } +.card.power_21 { background-image: url(cards75/power_21_22.avif) } +.card.power_22 { background-image: url(cards75/power_21_22.avif) } +.card.power_23 { background-image: url(cards75/power_23_26.avif) } +.card.power_24 { background-image: url(cards75/power_23_26.avif) } +.card.power_25 { background-image: url(cards75/power_23_26.avif) } +.card.power_26 { background-image: url(cards75/power_23_26.avif) } +.card.power_27 { background-image: url(cards75/power_27_30.avif) } +.card.power_28 { background-image: url(cards75/power_27_30.avif) } +.card.power_29 { background-image: url(cards75/power_27_30.avif) } +.card.power_30 { background-image: url(cards75/power_27_30.avif) } +.card.power_31 { background-image: url(cards75/power_31_33.avif) } +.card.power_32 { background-image: url(cards75/power_31_33.avif) } +.card.power_33 { background-image: url(cards75/power_31_33.avif) } +.card.power_34 { background-image: url(cards75/power_34_36.avif) } +.card.power_35 { background-image: url(cards75/power_34_36.avif) } +.card.power_36 { background-image: url(cards75/power_34_36.avif) } +.card.power_37 { background-image: url(cards75/power_37.avif) } +.card.power_38 { background-image: url(cards75/power_38.avif) } +.card.power_39 { background-image: url(cards75/power_39.avif) } +.card.power_40 { background-image: url(cards75/power_40.avif) } +.card.power_41 { background-image: url(cards75/power_41.avif) } +.card.power_42 { background-image: url(cards75/power_42.avif) } +.card.power_43 { background-image: url(cards75/power_43.avif) } +.card.power_44 { background-image: url(cards75/power_44.avif) } +.card.power_45 { background-image: url(cards75/power_45.avif) } +.card.power_46 { background-image: url(cards75/power_46.avif) } +.card.power_47 { background-image: url(cards75/power_47.avif) } +.card.power_48 { background-image: url(cards75/power_48.avif) } +.card.power_49 { background-image: url(cards75/power_49.avif) } +.card.power_50 { background-image: url(cards75/power_50.avif) } +.card.power_51 { background-image: url(cards75/power_51.avif) } +.card.power_52 { background-image: url(cards75/power_52.avif) } diff --git a/play.html b/play.html index 3dfa2a7..59974f4 100644 --- a/play.html +++ b/play.html @@ -73,17 +73,17 @@
    Power Struggle Hand
    -
    +
    The Crowd Turns Against Ceausescu
    -
    +
    Power Struggle Discard
    -
    +
    diff --git a/play.js b/play.js index 6babd3b..ddfcf58 100644 --- a/play.js +++ b/play.js @@ -451,7 +451,7 @@ function create_ui() { for (let c = 1; c <= last_power_card; ++c) { const power_card_e = document.createElement("div") register_action(power_card_e, "power_card", c) - power_card_e.className = "card power_" + c + power_card_e.className = "card power_card power_" + c ui.power_cards[c] = power_card_e } -- cgit v1.2.3 From 990faf9a6d27a795d87e89286ba499fccbd24a4d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:05:47 +0000 Subject: Updates to Table Cards and cleanup --- events.txt | 3 --- rules.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/events.txt b/events.txt index eaf585d..637f6c7 100644 --- a/events.txt +++ b/events.txt @@ -95,7 +95,6 @@ add_infl_free 3 CARD 13 - Stasi # For the rest this turn the Democratic Player must reveal the card he will play this action round before the Communist plays his card. -permanently_remove stasi @@ -173,7 +172,6 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. -permanently_remove perestroika @@ -376,7 +374,6 @@ foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -permanently_remove the_sinatra_doctrine diff --git a/rules.js b/rules.js index 54cfd26..0593375 100644 --- a/rules.js +++ b/rules.js @@ -222,6 +222,7 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] 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] +const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 @@ -3752,7 +3753,27 @@ function new_turn() { delete game.selected_space //Remove events that only last one turn - game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + + for (let e of one_turn_events) { + if (game.persistent_events.includes(e)) { + end_one_turn_event(e) + } + } + if (game.prudence) { + delete game.prudence + log_summary(`C${8}`) + } + if (game.summary.length > 0) { + log('No longer in effect:') + pop_summary_i() + log_br() + } + delete game.stasi_card + delete game.stand_fast + +/* TODO: Add log for events no longer in effect */ + + /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) @@ -3795,12 +3816,18 @@ function new_turn() { discard_from_table(63) permanently_remove(63) } + //Stasi + if (game.persistent_events.includes(C_STASI)) { + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + discard_from_table(C_STASI) + log(`C${C_STASI} no longer in effect`) + } //Stand Fast if (game.persistent_events.includes(100)) { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - } + }*/ if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) @@ -3857,6 +3884,12 @@ function new_turn() { } } +function end_one_turn_event(event) { + game.persistent_events = game.persistent_events.filter(n => n !== event) + discard_from_table(event) + log_summary(`C${event}`) +} + function next_player() { clear_undo() if (game.active === DEM) @@ -4020,8 +4053,12 @@ function discard_card(hand) { function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(card) + if (find_card !== -1) { + game.table_cards.splice(find_card, 1) + if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) + } else {game.strategy_discard.push(card) } + } } @@ -4214,6 +4251,19 @@ function pop_summary() { game.summary = [] } +function pop_summary_i() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + logi(msg.replace("£ SP", `${n} SPs`)); + } else { + logi(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) @@ -5556,8 +5606,9 @@ function vm_peasant_parties_revolt() { } function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') + game.persistent_events.push(C_PERESTROIKA) + game.table_cards.push(C_PERESTROIKA) + log_msg_gap(`C${C_PERESTROIKA} in effect`) vm_next() } @@ -5687,6 +5738,7 @@ function vm_st_nicholas_church () { function vm_stasi() { log_msg_gap('C13 in effect') + game.table_cards.push(C_STASI) game.persistent_events.push(C_STASI) vm_next() } @@ -5754,7 +5806,8 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap('C50 in effect') + game.table_cards.push(C_THE_SINATRA_DOCTRINE) + log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) vm_next() } @@ -8537,7 +8590,6 @@ CODE[12] = [ // Apparatchicks ] CODE[13] = [ // Stasi - [ vm_permanently_remove ], [ vm_stasi ], [ vm_return ], ] @@ -8615,7 +8667,6 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika - [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] @@ -8818,7 +8869,6 @@ CODE[49] = [ // Foreign Currency Debt Burden* ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_permanently_remove ], [ vm_the_sinatra_doctrine ], [ vm_return ], ] -- cgit v1.2.3 From 012f927264045fc5ae18188d4891dd530d903939 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:25:25 +0000 Subject: Tor updates --- play.html | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/play.html b/play.html index 97882fd..78eee67 100644 --- a/play.html +++ b/play.html @@ -76,38 +76,23 @@
    Played Card
    - -
    - -
    -
    Power Struggle
    -
    -
    -
    -
    -
    -
    - - -
    -
    Power Struggle
    -
    -
    -
    -
    Ceausescu Cards
    -
    -
    -
    +
    Power Struggle Hand
    -
    +
    +
    +
    The Crowd Turns Against Ceausescu
    +
    +
    +
    +
    Power Struggle Discard
    +
    +
    -- cgit v1.2.3 From abaad8ee7552e1d40ca12a100d737e789d53e733 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:30:55 +0000 Subject: Tor updates --- play.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/play.html b/play.html index 78eee67..d2f1546 100644 --- a/play.html +++ b/play.html @@ -67,9 +67,9 @@
    -
    -
    Cards on the Table
    -
    +
    +
    Cards on the Table
    +
    -- cgit v1.2.3 From 6a884f647be0060cbdab7300a8afa850425a60a1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:37:01 +0000 Subject: Tor updates --- play.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/play.js b/play.js index bfe4578..8b5d3d7 100644 --- a/play.js +++ b/play.js @@ -370,17 +370,13 @@ const ui = { event_reminder_list: document.getElementById("event_reminder_list"), played_card: document.getElementById("played_card"), - scoring_card: document.getElementById("scoring_card"), - played_power_card: document.getElementById("played_power_card"), - power_card_1: document.getElementById("power_card_1"), - power_card_2: document.getElementById("power_card_2"), hand: document.getElementById("hand"), power_hand: document.getElementById("power_hand"), opp_hand: document.getElementById("opp_hand"), opp_power_hand: document.getElementById("opp_power_hand"), discard: document.getElementById("discard"), removed: document.getElementById("removed"), - table_cards: document.getElementById("table_cards"), + persistent: document.getElementById("persistent"), ceausescu_hand: document.getElementById("ceausescu_hand"), samizdat_card: document.getElementById("samizdat_card"), @@ -703,15 +699,20 @@ function on_update() { document.getElementById("discard_panel").classList.add("hide") ui.removed.replaceChildren() - for (let c of view.strategy_removed) { - if (c === view.played_card) continue - ui.removed.appendChild(ui.cards[c]) } + for (let c of view.strategy_removed) + ui.removed.appendChild(ui.cards[c]) + + ui.persistent.replaceChildren() + for (let c of view.persistent_events) + ui.persistent.appendChild(ui.cards[c]) - ui.table_cards.replaceChildren() - if (view.table_cards) - for (let c of view.table_cards) { - if (c === view.played_card) continue - ui.table_cards.appendChild(ui.cards[c]) } + ui.played_card.replaceChildren() + if (view.played_card > 0) + ui.played_card.appendChild(ui.cards[view.played_card]) + if (view.power_card_1 > 0) + ui.played_card.appendChild(ui.power_cards[view.power_card_1]) + if (view.power_card_2 > 0) + ui.played_card.appendChild(ui.power_cards[view.power_card_2]) for (let e of action_register) e.classList.toggle("action", is_action(e.my_action, e.my_id)) -- cgit v1.2.3 From f3f081112743272aca1aecc66344e10e787dc954 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:46:35 +0000 Subject: Fix log for Honecker --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 0593375..8541df9 100644 --- a/rules.js +++ b/rules.js @@ -2184,6 +2184,8 @@ states.honecker ={ extra() { push_undo() game.round++ + log(`Communist chooses to take an extra Action Round due to C${C_HONECKER}`) + log_h2(`Action Round ${game.round}`) game.round_player = COM game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) game.state = 'choose_card' @@ -4878,7 +4880,7 @@ function vm_add_limited_infl() { function vm_do_add_limited_infl(space, max_infl) { push_undo() - log_summary(`Added £ SP in %${space}.`) + log_summary(`Added £ SP in %${space}`) game.vm_available_ops -- if (!game.vm_influence_added) { -- cgit v1.2.3 From 9565333f487e538a78f14ecfad6305e195682d10 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:53:46 +0000 Subject: fix round marker --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index 8b5d3d7..49ab1f3 100644 --- a/play.js +++ b/play.js @@ -485,7 +485,7 @@ function layout_turn_marker() { } function layout_round_marker() { - let x = 709 + 24 + (view.turn - 1) * 53 + let x = 709 + 24 + (view.round - 1) * 53 let y = 142 + 24 ui.round.style.left = x - 25 + "px" ui.round.style.top = y - 25 + "px" -- cgit v1.2.3 From 73efed05a32ae5a581e905e1865c9e4f3abf9c20 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 19:05:50 +0000 Subject: Tidying up code --- rules.js | 575 ++++++++++++++++----------------------------------------------- 1 file changed, 142 insertions(+), 433 deletions(-) diff --git a/rules.js b/rules.js index 8541df9..55f064c 100644 --- a/rules.js +++ b/rules.js @@ -307,20 +307,13 @@ exports.setup = function (seed, scenario, options) { } log_h1("1989 Dawn of Freedom") - game.active = COM start_game() - return game } function start_game() { - //starting influence - // Draw cards - - //console.log('start game') - game.strategy_deck = draw_deck() reset_power() @@ -344,12 +337,11 @@ function start_game() { game.valid_spaces = valid_spaces_setup() game.available_ops = 2 - game.phase = 0 + //game.phase = 0 /* Now redundant? */ log_h1("Place starting Support Points") log_side() } - exports.view = function(state, player) { game = state @@ -394,20 +386,16 @@ exports.view = function(state, player) { hand: [], set_aside: [], pwr_hand: [], - - } if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card - console.log('game.com_power_card', game.com_power_card, 'game.dem_power_card', game.dem_power_card) view.power_card_1 = game.power_card_1 view.power_card_2 = game.power_card_2 } view.strategy_discard = game.strategy_discard - if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -471,11 +459,9 @@ exports.view = function(state, player) { view.actions.undo = 0 } } - return view } - // === ACTIONS =========== function gen_action(action, argument) { @@ -493,11 +479,6 @@ function gen_action_space(space){ gen_action("space", space) } - -function gen_action_infl(space){ - gen_action("infl", space) -} - function gen_action_card(card){ gen_action("card", card) } @@ -506,14 +487,6 @@ function gen_action_power_card(card){ gen_action("power_card", card) } -function gen_action_sc(space){ - gen_action("sc", space) -} - -function gen_action_scoring(){ - gen_action("scoring") -} - exports.action = function (state, player, action, arg) { game = state if (states[game.state] && action in states[game.state]) { @@ -550,14 +523,9 @@ states.com_init = { }, space(space) { add_infl(space) - }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.starting_infl.com_starting_infl++ if (game.starting_infl.com_starting_infl == 1){ game.available_ops = 3 @@ -575,6 +543,7 @@ states.com_init = { } }, start() { + do_log_summary() new_turn() clear_undo() game.state = 'choose_card' @@ -600,13 +569,8 @@ states.dem_init = { space(space) { add_infl(space) }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.starting_infl.dem_starting_infl++ if (game.starting_infl.dem_starting_infl == 1){ game.available_ops = 3 @@ -619,7 +583,6 @@ states.dem_init = { } } - states.choose_card = { inactive: 'choose a card.', prompt() { @@ -685,7 +648,6 @@ states.play_card ={ } // Check for Reformer Rehabilitated - if (game.played_card === C_REFORMER_REHABILITATED && game.playable_cards.includes(C_REFORMER_REHABILITATED)){ if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { gen_action('event') @@ -700,7 +662,6 @@ states.play_card ={ 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') } @@ -715,14 +676,11 @@ states.play_card ={ 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() log_gap(`Played C${game.played_card} for the event`) game.vm_infl_to_do = false - if (scoring_cards.includes(game.played_card)) {game.phase = 0} - else {game.phase = 1} game.return = game.active if (switch_events.includes(game.played_card)) {next_player()} game.vm_event = game.played_card @@ -731,7 +689,7 @@ states.play_card ={ opp_event() { push_undo() log_gap(`Played C${game.played_card} for the event`) - game.phase = 1 /*Do I still need this?*/ + //game.phase = 1 /*Do I still need this?*/ game.vm_infl_to_do = true game.return = game.active game.vm_event = game.played_card @@ -746,22 +704,18 @@ states.play_card ={ influence() { push_undo() log_gap(`Played C${game.played_card} to place SPs`) - // Check if Common European Home played for influence if (game.played_card === C_COMMON_EUROPEAN_HOME) { if (game.active === DEM) { game.vp -- log('-1 VP') - if (check_vp()) { - return - } } else { game.vp ++ log('+1 VP') - if (check_vp()) { - return - } + } + if (check_vp()) { + return } } // Check if card is opponent card with event that needs to be resolved @@ -818,7 +772,6 @@ states.play_card ={ end_round () { end_round() } - } states.resolve_opponent_event = { @@ -888,7 +841,6 @@ states.resolve_opponent_event = { } } - states.finish_add_infl = { inactive: 'add SPs.', prompt () { @@ -897,10 +849,7 @@ states.finish_add_infl = { gen_action("end_round") return; } - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces for (let space_id of game.valid_spaces) { gen_action_space(space_id) } @@ -910,11 +859,7 @@ states.finish_add_infl = { }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() end_round() } } @@ -997,10 +942,7 @@ states.add_influence = { gen_action('done') } } else { - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces for (let space_id of game.valid_spaces) { gen_action_space(space_id); } @@ -1011,17 +953,11 @@ states.add_influence = { }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() end_round() }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event' } @@ -1101,33 +1037,8 @@ states.tst_goddess = { }, pass() { log('Did not discard') - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } + end_goddess() }, - done() { - - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } - } } states.tst_goddess_draw = { @@ -1142,23 +1053,10 @@ states.tst_goddess_draw = { } else { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) } - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } + end_goddess() } } - - states.support_check_prep = { inactive: 'do support checks', prompt () { @@ -1175,7 +1073,6 @@ states.support_check_prep = { } } else if (game.available_ops > 0) { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - for (let space_id of game.valid_spaces) { gen_action_space(space_id) } @@ -1192,7 +1089,6 @@ states.support_check_prep = { game.state = 'austria_hungary_border_reopened_check' return } - } } game.state = 'do_support_check' @@ -1285,15 +1181,15 @@ states.draw_power_cards = { game.com_pwr_hand_limit = 0 } // Events which affect cards drawn - if (game.persistent_events.includes(17) && game.com_pwr_hand_limit >= 2) { - log('Democrat receives 2 cards from Communist due to C17') + if (game.persistent_events.includes(C_ROUNDTABLE_TALKS) && game.com_pwr_hand_limit >= 2) { + log(`Democrat receives 2 cards from Communist due to C${C_ROUNDTABLE_TALKS}`) game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 - discard_from_table(17) - game.persistent_events = game.persistent_events.filter(n => n !== 17) + discard_from_table(C_ROUNDTABLE_TALKS) + game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) } - if (game.persistent_events.includes(72)) { + if (game.persistent_events.includes(C_PEASANT_PARTIES_REVOLT)) { let farmer_check for (let space of spaces) { if (space && space.country === game.pwr_struggle_in && space.socio === 3 && check_dem_control(space.space_id)) { @@ -1301,20 +1197,20 @@ states.draw_power_cards = { } } if (farmer_check && game.com_pwr_hand_limit > 0) { - log('Democrat receives 1 cards from Communist due to C72') + log(`Democrat receives 1 cards from Communist due to C${C_PEASANT_PARTIES_REVOLT}`) game.dem_pwr_hand_limit += 1 game.com_pwr_hand_limit -= 1 - permanently_remove(72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) + permanently_remove(C_PEASANT_PARTIES_REVOLT) + game.persistent_events = game.persistent_events.filter(n => n !== C_PEASANT_PARTIES_REVOLT) } } - if (game.persistent_events.includes(102) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { - log('Communist receives 2 cards from Democrat due to C102') + if (game.persistent_events.includes(C_NATIONAL_SALVATION_FRONT) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { + log(`Communist receives 2 cards from Democrat due to C${C_NATIONAL_SALVATION_FRONT}`) game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 - permanently_remove(102) - game.persistent_events = game.persistent_events.filter(n => n !== 102) + permanently_remove(C_NATIONAL_SALVATION_FRONT) + game.persistent_events = game.persistent_events.filter(n => n !== C_NATIONAL_SALVATION_FRONT) } //Draw Power Cards @@ -1330,13 +1226,13 @@ states.draw_power_cards = { log(`Democrat: ${game.dem_pwr_hand.length} cards`) //Check if The Crowd Turns Against Ceausescu occurs - if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { + if (game.table_cards.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && game.pwr_struggle_in === 'Romania') { if (game.active === COM) { game.return = COM next_player() } - log_h3('C54') - game.persistent_events.push(54) + log_h3(`C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU}`) + game.persistent_events.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) game.state = 'the_crowd_turns_against_ceausescu_prep' } else { log_h2('Raise the Stakes') @@ -1347,7 +1243,7 @@ states.draw_power_cards = { states.the_crowd_turns_against_ceausescu_prep = { get inactive() { - return `resolve ${clean_name(cards[54].name)}.` + return `resolve ${clean_name(cards[C_THE_CROWD_TURNS_AGAINST_CEAUSESCU].name)}.` }, prompt() { view.prompt = 'The Crowd Turns Against Ceausescu: draw cards.' @@ -1356,7 +1252,7 @@ states.the_crowd_turns_against_ceausescu_prep = { draw() { game.ceausescu_cards = [] draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) - game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length + game.temp = game.ceausescu_cards.filter(card => rallies.includes(card)).length log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) game.vm_available_ops = game.temp * 3 log(`Democrat takes a ${game.vm_available_ops} Action Round`) @@ -1366,7 +1262,7 @@ states.the_crowd_turns_against_ceausescu_prep = { states.vm_the_crowd_turns_against_ceausescu = { get inactive() { - return `resolve ${clean_name(cards[54].name)}.` + return `resolve ${clean_name(cards[C_THE_CROWD_TURNS_AGAINST_CEAUSESCU].name)}.` }, prompt() { view.prompt = `You have ${game.vm_available_ops} operations points. Play for:` @@ -1408,11 +1304,7 @@ states.the_crowd_turns_against_ceausescu_infl = { vm_do_add_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() if (game.return !== game.active) { next_player() } @@ -1423,7 +1315,6 @@ states.the_crowd_turns_against_ceausescu_infl = { states.raise_stakes_1 = { inactive: 'raise the stakes.', - prompt () { if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1483,7 +1374,6 @@ states.raise_stakes_1 = { states.raise_stakes_2 = { inactive: 'raise the stakes.', - prompt () { if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1517,7 +1407,6 @@ states.raise_stakes_2 = { game.raised_stakes++ game.valid_cards = [] } - }, pass() { log('Did not raise the stakes') @@ -1544,24 +1433,16 @@ states.power_struggle = { } } if (game.phase === 1) { + let base_prompt = `${power_cards[game.played_power_card].name} played` + (leader_cards.includes(game.played_power_card) ? ` as a ${game.proxy_power_card}.` : ".") if (game.valid_cards.length > 0) { - if (leader_cards.includes(game.played_power_card)) { - view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must match or concede.` - } else { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - } - gen_action('concede') + view.prompt = `${base_prompt} You must match or concede.`; for (let card of game.valid_cards) { - gen_action_power_card(card) - } - } else if (game.valid_cards.length === 0) { - if (leader_cards.includes(game.played_power_card)) { - view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must concede.` - } else { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + gen_action_power_card(card); } - gen_action('concede') - } + } else { + view.prompt = `${base_prompt} You must concede.`; + } + gen_action('concede') } else if (game.phase === 2) { view.prompt = 'You matched. Roll a die.' @@ -1588,9 +1469,8 @@ states.power_struggle = { game.valid_cards=[] game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} - if (card === 52) { - log_gap(`Played P52: P${game.played_power_card} no longer playable`) - + if (card === PC_TACTIC_FAILS) { + log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) } else { if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ else if (numberless_cards.includes(card)) { @@ -1623,7 +1503,7 @@ states.power_struggle = { do_valid_cards() } } else if (game.phase === 1) { - if (card === 52) { + if (card === PC_TACTIC_FAILS) { game.tactics_fails = power_cards[game.played_power_card].name game.phase = 0 next_player() @@ -1694,8 +1574,8 @@ states.power_struggle = { next_player() do_valid_cards() }, - done () { - if (game.phase === 7) { /*Is this ever called anymore? */ + /*done () { + if (game.phase === 7) { game.phase = 0 log_msg_gap('Takes initiative') do_valid_cards() @@ -1704,81 +1584,32 @@ states.power_struggle = { next_player() do_valid_cards() } - } + }*/ } states.support_loss ={ inactive: 'do Support Loss.', prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') - } - } else { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + let ps_state = game.persistent_events.includes(111) ? "New Year's Eve Party" : "Power Struggle" + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') + for (let space_id of game.valid_spaces) { + gen_action_space(space_id) } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') } }, roll () { - clear_undo() - let roll = roll_d6() - let rally_win = 0 - let petition_win = 0 - log(`Roll: D${roll}`) - if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} - let modified_roll = roll + game.raised_stakes + rally_win - petition_win - - // Roll modifiers - if (game.active === COM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) - modified_roll ++ - } - - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P1') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - game.available_ops = support_loss_roll[modified_roll] + game.available_ops = support_loss_roll[get_aftermath_roll()] if (game.available_ops === 0) { log('Does not remove SPs') } @@ -1795,10 +1626,7 @@ states.support_loss ={ } }, done () { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() next_player() log_h3('Victory Point') game.phase = 0 @@ -1809,58 +1637,20 @@ states.support_loss ={ states.vp_roll = { inactive: 'do VP Roll.', prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } - } else { - if (game.phase === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } + let ps_state = game.persistent_events.includes(111) ? "New Year's Eve Party" : "Power Struggle" + if (game.phase === 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') } }, roll () { - let roll = roll_d6() - log(`Roll: D${roll}`) - let rally_win = 0 - let petition_win = 0 - if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} - let modified_roll = roll + game.raised_stakes + rally_win - petition_win - if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) - modified_roll ++ - } - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P1') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - let vp_change = vp_roll[modified_roll] + let vp_change = vp_roll[get_aftermath_roll()] if (game.active === DEM) { log(`+${vp_change} VP`) } else { @@ -1879,7 +1669,6 @@ states.vp_roll = { }, take () { push_undo() - //Find name of scoring card let scoring_card = scoring_cards[countries.indexOf(game.pwr_struggle_in)] permanently_remove(scoring_card) take_power(game.pwr_struggle_in) @@ -1959,7 +1748,7 @@ states.the_tyrant_is_gone ={ game.return = DEM } log_h3(`C97`) - game.vm_event = 97 + game.vm_event = C_THE_TYRANT_IS_GONE goto_vm(game.vm_event) } } @@ -3247,6 +3036,37 @@ function get_end_infl_prompt() { } } +function get_aftermath_roll() { + clear_undo() + let roll = roll_d6() + log(`Roll: D${roll}`) + let rally_win = 0 + let petition_win = 0 + if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} + let modified_roll = roll + game.raised_stakes + rally_win - petition_win + if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + modified_roll ++ + } + if (modified_roll < 0) {modified_roll = 0} + else if (modified_roll > 7) {modified_roll = 7} + + if (game.raised_stakes !== 0) { + log(`+${game.raised_stakes} from Raising the Stakes`) + } + if (rally_win !== 0) { + log('+2 from winning on a P1') + } + if (petition_win !== 0) { + log('-2 from winning on a P31') + } + if (modified_roll !== roll) { + log(`Modified roll: ${modified_roll}`) + } + return modified_roll +} + function permanently_remove(card) { if (game.strategy_removed.includes(card)) {return} remove_from_discard(card) @@ -3313,6 +3133,20 @@ function end_stasi_choose_card() { } } +function end_goddess() { + log_h2("Action Round " + game.round) + if (game.active === DEM) { + next_player() + } else { + log_side() + } + if (game.persistent_events.includes(5)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } +} + function check_reformer() { if (game.dem_tst_position !== game.com_tst_position) { if (!game.playable_cards.includes(67)) { @@ -3773,64 +3607,6 @@ function new_turn() { delete game.stasi_card delete game.stand_fast -/* TODO: Add log for events no longer in effect */ - - /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) - game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) - game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) - game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) - delete game.prudence - delete game.stasi_card - - //Austria Hungary Border Reopened - if (game.persistent_events.includes(58)) { - game.persistent_events = game.persistent_events.filter(n => n !== 58) - delete game.austria_hungary_border_reopened_tracker - log(`C58 no longer in effect`) - } - //Elena - if (game.persistent_events.includes(101)) { - game.persistent_events = game.persistent_events.filter(n => n !== 101) - log(`C101 no longer in effect`) - } - //GrenzTruppen - if (game.persistent_events.includes(59)) { - game.persistent_events = game.persistent_events.filter(n => n !== 59) - log(`C59 no longer in effect`) - } - //Foreign Currency Debt Burden - if (game.persistent_events.includes(49)) { - game.persistent_events = game.persistent_events.filter(n => n !== 49) - delete game.foreign_currency_debt_burden - log(`C49 no longer in effect`) - } - //FRG Embassies - if (game.persistent_events.includes(74)) { - game.persistent_events = game.persistent_events.filter(n => n !== 74) - log(`C74 no longer in effect`) - discard_from_table(74) - permanently_remove(74) - } - //Genscher - if (game.persistent_events.includes(63)) { - game.persistent_events = game.persistent_events.filter(n => n !== 63) - log(`C63 no longer in effect`) - discard_from_table(63) - permanently_remove(63) - } - //Stasi - if (game.persistent_events.includes(C_STASI)) { - game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) - discard_from_table(C_STASI) - log(`C${C_STASI} no longer in effect`) - } - //Stand Fast - if (game.persistent_events.includes(100)) { - game.persistent_events = game.persistent_events.filter(n => n !== 100) - delete game.stand_fast - log(`C100 no longer in effect`) - }*/ - if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) delete game.samizdat_card @@ -4084,7 +3860,7 @@ function reset_power() { game.power_struggle_discard = [] game.dem_pwr_hand = [] game.com_pwr_hand = [] - game.phase = 1 + //game.phase = 1 game.raised_stakes_round = 0 game.raised_stakes = 0 game.played_power_card = 0 @@ -4266,24 +4042,11 @@ function pop_summary_i() { game.summary = [] } -function log_summary_place(p) { - let from = piece_space(p) - if (from !== AVAILABLE) - log_summary("% " + piece_name(p) + " from S" + from) - else - log_summary("% " + piece_name(p)) -} - -function log_summary_move_to_from(p, to) { - log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p)) -} - -function log_summary_remove(p) { - log_summary("Removed % " + piece_name(p)) -} - -function log_summary_activated(p) { - log_summary("Activated % " + piece_faction_name(p)) +function do_log_summary() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } } // ============ UNDO FUNCTIONS ================== @@ -5627,6 +5390,7 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true + game.phase = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -6053,32 +5817,20 @@ states.vm_add_infl = { vm_do_add_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } }, done () { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } @@ -6106,11 +5858,7 @@ states.vm_add_infl_free = { vm_do_add_infl_free(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } @@ -6119,20 +5867,14 @@ states.vm_add_infl_free = { push_undo() game.valid_spaces = [] game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() }, end_round () { push_undo() game.valid_spaces = [] game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -6190,10 +5932,7 @@ states.vm_add_limited_infl = { vm_do_add_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() game.vm_event_done = true vm_next() } @@ -6230,19 +5969,13 @@ states.vm_remove_infl = { game.vm_active_country = spaces[space].country if (game.vm_event !== C_INFLATIONARY_CURRENCY) { if (game.vm_available_ops === 0 ) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -6296,19 +6029,13 @@ states.vm_remove_limited_infl = { vm_do_remove_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0) { game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, done () { game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -7624,10 +7351,7 @@ states.vm_nomenklatura_add = { vm_do_add_infl_free(space) if (game.vm_available_ops === 0 ) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, @@ -8071,10 +7795,7 @@ states.vm_we_are_the_people_remove = { vm_do_remove_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() if (!game.vm_influence_added[S_LUTHERAN_CHURCH]) { log('No SPs removed') vm_next() @@ -8099,10 +7820,7 @@ states.vm_we_are_the_people_add = { 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() - log_br() - } + do_log_summary() vm_next() } }, @@ -8227,18 +7945,12 @@ states.vm_tst_4 = { space(space) { vm_do_remove_infl(space) if (game.vm_available_ops === 0) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -8382,10 +8094,7 @@ states.vm_scare_tactics = { vm_do_remove_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } -- cgit v1.2.3 From a9dcf6d2956e53295f75039799f722e060dcc0a1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 23:50:59 +0000 Subject: Tidy up code --- rules.js | 237 +++++++++++++++++++-------------------------------------------- 1 file changed, 70 insertions(+), 167 deletions(-) diff --git a/rules.js b/rules.js index 55f064c..f77eb6e 100644 --- a/rules.js +++ b/rules.js @@ -1945,9 +1945,7 @@ states.general_strike = { clear_undo() let roll = roll_d6() log(`Roll: D${roll}`) - logi(`+${game.available_ops} ops`) - let total = roll + game.available_ops log(`Total: ${total}`) @@ -1958,7 +1956,6 @@ states.general_strike = { } else { log('The strike continues. Required 6 or more') } - game.state = 'end_round' }, } @@ -2059,7 +2056,7 @@ states.new_years_eve_party = { } else if (game.vp < 0) { goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) } else if (game.vp === 0) { - goto_game_over('', `CNew Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ + goto_game_over('', `New Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ } } } @@ -2067,15 +2064,14 @@ states.new_years_eve_party = { states.stasi_end_round = { inactive: 'choose next card due to Stasi.', prompt() { - let available_cards = game.democrat_hand - if (available_cards.length === 0) { + if (game.democrat_hand.length === 0) { view.prompt = 'Stasi: no cards remaining.' gen_action('pass') return } view.prompt = 'Stasi: you must select your next card to play.' - for (let card of available_cards) { + for (let card of game.democrat_hand) { gen_action_card(card) } }, @@ -2090,14 +2086,6 @@ states.stasi_end_round = { game.stasi_card = 0 end_stasi_choose_card() }, - end_round() { - push_undo() - if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } - } } states.stasi_finish = { @@ -2119,10 +2107,8 @@ states.stasi_finish = { states.stasi_confirm = { inactive: 'choose next card due to Stasi.', prompt() { - 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') - } + 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 !== C_COMMON_EUROPEAN_HOME) @@ -2138,10 +2124,7 @@ states.stasi_play_card = { gen_action('pass') } else { view.prompt = `Stasi: you must play ${clean_name(cards[game.stasi_card].name)}.` - let available_cards = [game.stasi_card] - for (let card of available_cards) { - gen_action_card(card) - } + gen_action_card(game.stasi_card) } }, card(card) { @@ -2157,7 +2140,6 @@ states.stasi_play_card = { } else { game.state = 'play_card' } - }, pass () { log('No cards remaining. Passed') @@ -2208,14 +2190,14 @@ function add_infl(space) { } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { + if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { game.available_ops-- - log_summary(`(-1 op due to C63)`) + log_summary(`(-1 op due to C${C_GENSCHER})`) } else if (check_opp_control(space)) { game.available_ops -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative if (game.available_ops < 0) { - log_summary(`(Used +1 op from C58)`) + log_summary(`(Used +1 op from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED})`) } } else { game.available_ops-- @@ -2332,7 +2314,6 @@ function do_sc(space) { } else { let card_ops = get_card_ops(this_card()) - roll += card_ops logi(`+${card_ops} from card ops`) } @@ -2343,37 +2324,31 @@ function do_sc(space) { } // Events which modify SC rolls - //Tear Gas - if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { + if (game.active === COM && game.persistent_events.includes(C_TEAR_GAS) && spaces[space].socio === 6) { roll ++ - logi('+1 from C30') - permanently_remove(30) - game.persistent_events = game.persistent_events.filter(n => n !== 30) + logi(`+1 from C${C_TEAR_GAS}`) + permanently_remove(C_TEAR_GAS) + game.persistent_events = game.persistent_events.filter(n => n !== C_TEAR_GAS) } - //FRG Embassies - if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { + if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(C_FRG_EMBASSIES)) { roll++ - logi('+1 from C74') + logi(`+1 from C${C_FRG_EMBASSIES}`) } - //GrenzTruppen - if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { + if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(C_GRENZTRUPPEN)) { roll-- - logi('-1 from C59') + logi(`-1 from C${C_GRENZTRUPPEN}`) } - //Stand Fast if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ roll-- - logi('-1 from C100') + logi(`-1 from C${C_STAND_FAST}`) } - //Elena - if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { + if (game.active === DEM && game.persistent_events.includes(C_ELENA) && spaces[space].country === 'Romania') { roll-- - logi('-1 from C101') + logi(`-1 from C${C_ELENA}`) } - //Austria Hungary Border Reopened - if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { + if (game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { roll++ - logi(`+1 from C58`) + logi(`+1 from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED}`) } // Continue with logic - check for adjacency @@ -2381,14 +2356,14 @@ function do_sc(space) { // Events which affect adjacency - The Wall const adj = count_adj(space) - if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { - logi('No adjacency for Democrats due to C9') - logi('C9 no longer in effect') + if (game.active === COM && game.persistent_events.includes(C_THE_WALL) && spaces[space].country === 'East_Germany') { + logi(`No adjacency for Democrats due to C${C_THE_WALL}`) + logi(`C${C_THE_WALL} no longer in effect`) roll += adj.com_adj if (adj.com_adj > 0) { logi(`+${adj.com_adj} adjacency`) } - game.persistent_events = game.persistent_events.filter(n => n !== 9) + game.persistent_events = game.persistent_events.filter(n => n !== C_THE_WALL) // Standard adjacency } else { @@ -2413,7 +2388,6 @@ function do_sc(space) { } } } - } // Support check calcs @@ -2466,11 +2440,9 @@ function do_sc(space) { } } game.selected_space = 0 - } function valid_spaces_setup() { - game.valid_spaces = [] let valid_spaces_set = new Set(); for (let i =0 ; i < spaces.length ; i++) { let space = spaces[i] @@ -2507,31 +2479,20 @@ function valid_spaces_sc() { } else { let infl = game.demInfl[i] if (infl !== 0 ) { - // Check Solidarity Legalised + // Check Events that block support checks in a given space if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} - - // Check Civic Forum 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(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue} - - //Check for Foreign Currency Debt Burden - if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && 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); - - } } } } - - - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); //Check for the Crown Turns Against Ceausescu - if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') } return game.valid_spaces; @@ -2553,42 +2514,33 @@ function valid_spaces_support_loss() { } } } - - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); return game.valid_spaces; } function valid_spaces_infl() { - // Check if function is called from the VM or not, take relevant ops variable let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; let valid_spaces_set = new Set(); - // Iterate over all spaces to find the ones with the player's influence for (let i = 0; i < game.demInfl.length; i++) { - //piece = game.pieces[i] let space = spaces[i] - let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); - - // Check adjacency information let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { if (adj_space_id) { - const adj_piece = spaces[adj_space_id]; // Check if the adjacent space is controlled by the opponent const opponent_control = check_opp_control(adj_piece.space_id) //Check for Genscher. Can always place in East Germany even with 1 op - if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(63)){ + if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(C_GENSCHER)){ valid_spaces_set.add(adj_piece.space_id) } @@ -2600,7 +2552,6 @@ function valid_spaces_infl() { } } } - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); return game.valid_spaces; } @@ -2610,14 +2561,15 @@ function valid_cards(player_hand, presence) { if (game.phase === 0) { for (let c of player_hand) { let card = power_cards[c] + // Never add tactics fails if (c === PC_TACTIC_FAILS) { continue } - // Never add tactics fails + // Cannot play the suit of Tactics Fails if (card.name === game.tactics_fails) { continue } - // Cannot play the suit of Tactics Fails + if (card.socio === 0) { valid_cards_set.add(c) } else if (leaders.includes(card.socio) && presence[card.socio]) { @@ -2627,7 +2579,6 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards[c] - console.log("card", card) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(c) } else if (card.name === game.proxy_power_card) { @@ -2647,7 +2598,6 @@ function do_valid_cards() { let presence = check_presence(game.pwr_struggle_in) if (game.active === DEM) { valid_cards(game.dem_pwr_hand, presence.dem_leaders) - } else { valid_cards(game.com_pwr_hand, presence.com_leaders)} } @@ -2883,11 +2833,9 @@ function battlegrounds(country) { } function take_power(country) { - log(`Democrat takes power in ${game.pwr_struggle_in}`) game.revolutions[find_country_index(country)] = true game.times_held[find_country_index(country)] = 1 - } function retain_power(country){ @@ -2910,7 +2858,6 @@ function score_country(country) { } else { value_control = 4 } -//Log for scoring let dem_vp = 0 let com_vp = 0 @@ -2944,7 +2891,6 @@ function score_country(country) { } else { log('No presence: 0 VP') } - } else if (presence.com_control || presence.com_domination) { log('Communist:') @@ -2972,7 +2918,6 @@ function score_country(country) { } else { log('No presence: 0 VP') } - } //Otherwise, presence and battlegrounds @@ -3007,7 +2952,6 @@ function score_country(country) { log('No presence: 0 VP') } } - //Calculate change VP let change_vp = dem_vp + com_vp @@ -3103,7 +3047,6 @@ function goto_game_over(result, victory) { log_h1("Game Over") log(game.victory) return - } function goto_struggle(){ @@ -3147,7 +3090,7 @@ function end_goddess() { } } -function check_reformer() { +function check_reformer() { /*Is this function still used?*/ if (game.dem_tst_position !== game.com_tst_position) { if (!game.playable_cards.includes(67)) { game.playable_cards.push(67) @@ -3155,7 +3098,6 @@ function check_reformer() { } else { game.playable_cards = game.playable_cards.filter(n => n !== 67) } - } function count_scoring_cards() { @@ -3193,23 +3135,18 @@ function select_card(card){ game.state = 'play_card' } -function find_event(card) { - return variable_events.indexOf(card) -} - function is_auto_resolve(card) { - let ceausecu_events = [10, 41, 101, 107] - if (card === 97) { - if (!game.persistent_events.includes(54)) { + if (card === C_THE_TYRANT_IS_GONE) { + if (!game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { return true } } - else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { + else if (ceausecu_events.includes(card) && game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { return true } - else if (card === 87 && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { + else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true } else if (auto_resolve_events.includes(card)) { @@ -3245,7 +3182,7 @@ function event_is_playable(card) { return false } //Check for The Chinese Solution - else if (game.com_tst_position === 8 && card === 96) { + else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } //Then check normally @@ -3264,15 +3201,15 @@ function get_card_ops(card) { if (card) { ops = cards[card].ops } - if (game.persistent_events.includes(25) && game.active === COM) { + if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card') { - log('+1 op from C25') + log(`+1 op from C${C_PERESTROIKA}`) } ops ++ } - if (game.persistent_events.includes(50) && game.active === DEM) { + if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { - log('+1 op from C50') + log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) } ops ++ } @@ -3287,10 +3224,10 @@ function get_card_ops(card) { if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { if (ops > 2) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) + log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { if (ops > 1) { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } } } @@ -3304,9 +3241,9 @@ function get_card_ops(card) { if (game.active === COM && game.prudence && game.prudence.COM < 0) { if(game.state === 'choose_card') { if (ops > 2) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) + log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else if (ops > 1) { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } } ops += game.prudence.COM @@ -3318,38 +3255,32 @@ function get_card_ops(card) { function get_tst_6_ops() { let ops = 0 - - if (game.persistent_events.includes(25) && game.active === COM) { - log('+1 op from C25') + if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { + log(`+1 op from C${C_PERESTROIKA}`) ops ++ } - if (game.persistent_events.includes(50) && game.active === DEM) { - log('+1 op from C50') + if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { + log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) ops ++ } - if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { if (ops > 0) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) + log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C8`) - } - + log(`-1 op from C${C_PRUDENCE}`) + } ops += game.prudence.DEM - if (ops < -1) { ops = -1 } } if (game.active === COM && game.prudence && game.prudence.COM < 0) { - if (ops > 0) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) + log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } - ops += game.prudence.COM if (ops < -1) { ops = -1 @@ -3388,11 +3319,9 @@ function finish_the_wall() { } } - // =========== MOVING THROUGH TURNS ============ function end_round() { - //Check if the game is over! if (game.state === 'game_over') { return} @@ -3420,7 +3349,6 @@ function end_round() { check_common_european_home() reset_austria_hungary_border_reopened() /*This should be redundant! */ - // Check for duplicate card entries let card_check if (game.samizdat_card > 0) { @@ -3503,7 +3431,7 @@ function end_round() { // Resolve end action round //Stasi check - if(game.round_player === COM && game.persistent_events.includes(13)) { + if(game.round_player === COM && game.persistent_events.includes(C_STASI)) { //If in Honecker, turn ends if (game.round === 8) { clear_undo() @@ -3614,12 +3542,9 @@ function new_turn() { log_h1("Turn " + game.turn) - if (game.turn === 4) { - add_midyear() - } - if (game.turn === 8) { - add_lateyear() - } + if (game.turn === 4) { add_midyear() } + if (game.turn === 8) { add_lateyear() } + if (game.turn > 1) { if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 @@ -3631,24 +3556,18 @@ function new_turn() { } //Check if TST effects need to be resolved - if (game.dem_tst_position >=5 && game.com_tst_position <= 4) { + if ((game.dem_tst_position >=5 && game.com_tst_position <= 4) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4)) { log_h2('Tiananmen Square Track award') - if(game.active !== DEM) { next_player() } - for (let card of game.democrat_hand) { + + if ((game.dem_tst_position >= 5 && game.com_tst_position <= 4 && game.active !== DEM) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4 && game.active !== COM)) { + next_player() + } + let hand = game.dem_tst_position >=5 ? game.democrat_hand : game.communist_hand + for (let card of hand) { if (scoring_cards.includes(card)) continue game.valid_cards.push(card) } - game.state = 'tst_goddess' /* Goddess only name of Democrat bonus, not Communist*/ - return - } - else if (game.com_tst_position >=5 && game.dem_tst_position <= 4) { - log_h2('Tiananmen Square Track award') - if(game.active !== COM) { next_player() } - for (let card of game.communist_hand) { - if (scoring_cards.includes(card)) continue - game.valid_cards.push(card) - } - game.state = 'tst_goddess' + game.state = 'tst_goddess' } else { log_h2("Action Round " + game.round) log_side() @@ -3674,7 +3593,6 @@ function next_player() { game.active = COM else game.active = DEM - log_side() } @@ -3687,9 +3605,6 @@ function change_player() { } function random(range) { - // An MLCG using integer arithmetic with doubles. - // https://www.ams.org/journals/mcom/1999-68-225/S0025-5718-99-00996-5/S0025-5718-99-00996-5.pdf - // m = 2**35 − 31 return (game.seed = game.seed * 200105 % 34359738337) % range } @@ -3697,7 +3612,6 @@ function roll_d6() { return random(6) + 1 } - function find_space_index(name_unique) { return spaces.findIndex(space => space && space.name_unique === name_unique) } @@ -3720,12 +3634,9 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { if (deck.length === 0) { log_h3('--- Reshuffle ---') - deck.push(...game.strategy_discard) game.strategy_discard = [] - } - - else if (turn === 'communist' && communist_hand.length < com_hand_limit) { + } else if (turn === 'communist' && communist_hand.length < com_hand_limit) { communist_hand.push(draw_card(deck)); turn = 'democrat'; } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { @@ -3739,14 +3650,12 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han turn = 'communist'; } } - clear_undo() } function draw_card(deck) { if (deck.length === 0) { log_h3('--- Reshuffle ---') - deck.push(...game.strategy_discard) game.strategy_discard = [] } @@ -3757,7 +3666,6 @@ function draw_card(deck) { function discard(card) { let find_card if (!game.is_pwr_struggle) { - if (game.active === COM) { find_card = game.communist_hand.indexOf(card) game.communist_hand.splice(find_card, 1) @@ -3777,7 +3685,6 @@ function discard(card) { find_card = game.dem_pwr_hand.indexOf(card); game.dem_pwr_hand.splice(find_card, 1); } - game.power_struggle_discard.push(card) } } @@ -3839,7 +3746,6 @@ function discard_from_table(card) { } } - function add_midyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 2) @@ -3847,7 +3753,6 @@ function add_midyear() { log_h3('Mid-year cards added to draw deck') } - function add_lateyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 3) @@ -3878,9 +3783,7 @@ function reset_power() { game.persistent_events = game.persistent_events.filter(n => n !== 62) } if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ - permanently_remove(54) - - + permanently_remove(54) } if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)){ game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) -- cgit v1.2.3 From eede40e76a57ac378e68c1fffbb1bc2e21193e17 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 08:18:12 +0000 Subject: Tidying up code --- rules.js | 241 ++++++++++++++++++++++----------------------------------------- 1 file changed, 82 insertions(+), 159 deletions(-) diff --git a/rules.js b/rules.js index f77eb6e..c42160f 100644 --- a/rules.js +++ b/rules.js @@ -2209,9 +2209,7 @@ function add_infl(space) { } else { game.demInfl[space]++ } - - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met if (game.available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { @@ -2259,7 +2257,7 @@ function remove_infl(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(space) + check_tyrant() } else { if (game.active === COM) { @@ -2273,7 +2271,7 @@ function remove_infl(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(space) + check_tyrant() } game.available_ops-- } @@ -2420,7 +2418,7 @@ function do_sc(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } - check_control_change(space) + check_tyrant() } else { log_msg_gap('Change influence: 0 SP') @@ -3769,31 +3767,24 @@ function reset_power() { game.raised_stakes_round = 0 game.raised_stakes = 0 game.played_power_card = 0 - game.tactics_fails = '' + delete game.tactics_fails game.view_opp_hand = false - if (game.persistent_events.includes(72)){ - permanently_remove(72) - game.table_cards = game.table_cards.filter(card => card !== 72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) - } - if (game.persistent_events.includes(62)) { - permanently_remove(62) - game.table_cards = game.table_cards.filter(card => card !== 62) - game.persistent_events = game.persistent_events.filter(n => n !== 62) - } - if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ - permanently_remove(54) - } - if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)){ - game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU, C_SECURITATE] + for (let e of scoring_events ) { + if ( e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU && game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { + permanently_remove(e) + } else if (e === C_SECURITATE && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(e)){ + game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + } else if (game.persistent_events.includes(e)) { + permanently_remove(e) + game.table_cards = game.table_cards.filter(card => card !== e) + game.persistent_events = game.persistent_events.filter(n => n !== e) + } } } -function check_control_change(space_id) { - - // Check if the Tyrant is Gone has been fulfilled - +function check_tyrant() { if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 @@ -3805,8 +3796,7 @@ function check_control_change(space_id) { } } -function check_systematization() { - // Check for Systematization - may not use this space +function check_systematization() { /* Check for Systematization - may not use this space */ if (game.systematization > 0) { game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) } @@ -4049,17 +4039,6 @@ function vm_operand(a) { return x } -function vm_assert_argcount(n) { - const argcount = CODE[game.vm.fp][game.vm.ip].length - 1 - if (argcount !== n) - throw Error(`ASSERT Invalid number of arguments on event ${game.vm.fp}: ${argcount} instead of ${n}`) -} - -function vm_log() { - log(vm_operand(1)); - vm_next(); -} - function vm_if() { if (!vm_operand(1)) { let balance = 1 @@ -4138,15 +4117,6 @@ function vm_prompt() { vm_next() } -function pop_vm_prompt() { - if (game.vm._prompt) { - game.vm.prompt = game.vm._prompt - delete game.vm._prompt - } else { - game.vm.prompt = 0 - } -} - function vm_return() { //Remove temporary vm variables delete game.support_check_modifier @@ -4190,33 +4160,16 @@ function vm_end_event() { /* ================== VM ACTIONS =========================== */ -function vm_opp_hand_false() { - game.view_opp_hand = false - vm_next() -} - function vm_valid_spaces() { - let space_1 - let space_2 - let space_3 - let space_4 - let space_5 - let space_6 - - if (vm_operand(1)) { space_1 = spaces.find(space => space.ascii_name === vm_operand(1)).space_id} - if (vm_operand(2)) { space_2 = spaces.find(space => space.ascii_name === vm_operand(2)).space_id} - if (vm_operand(3)) { space_3 = spaces.find(space => space.ascii_name === vm_operand(3)).space_id} - if (vm_operand(4)) { space_4 = spaces.find(space => space.ascii_name === vm_operand(4)).space_id} - if (vm_operand(5)) { space_5 = spaces.find(space => space.ascii_name === vm_operand(5)).space_id} - if (vm_operand(6)) { space_6 = spaces.find(space => space.ascii_name === vm_operand(6)).space_id} - - game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] - game.valid_spaces = game.valid_spaces.filter( n => n ) - - // Check for Systematization - may not use this space - check_systematization() - - vm_next() + for (let i = 1; i <= 6; i++) { + let operand = vm_operand(i) + if (operand) { + let space = spaces.find(space => space.ascii_name === operand) + game.valid_spaces.push(space.space_id) + } + } + check_systematization(); + vm_next(); } function vm_valid_spaces_opponent () { @@ -4244,17 +4197,12 @@ function vm_valid_spaces_socio () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] - if (space.socio === vm_operand(1)) { valid_spaces.push(space.space_id) } } game.valid_spaces = valid_spaces - - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4262,7 +4210,6 @@ function vm_valid_spaces_opponent_socio () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] - if (game.active === DEM) { let infl = game.comInfl[i] if (infl > 0 && space.socio === vm_operand(1)) { @@ -4276,10 +4223,7 @@ function vm_valid_spaces_opponent_socio () { } } game.valid_spaces = valid_spaces - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4293,10 +4237,7 @@ function vm_valid_spaces_country () { game.valid_spaces.push(space.space_id); } } - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4307,7 +4248,6 @@ function vm_valid_spaces_sc () { function vm_valid_spaces_country_opp () { let country = '' - if (vm_operand(1)) { country = vm_operand(1) } else { @@ -4438,7 +4378,7 @@ function vm_do_add_infl(space) { } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { + if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany') { game.vm_available_ops-- log_summary(`(-1 op due to C63)`) } else if (check_opp_control(space)) { @@ -4457,9 +4397,7 @@ function vm_do_add_infl(space) { } else { game.demInfl[space]++ } - - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { @@ -4496,16 +4434,13 @@ function vm_do_add_infl(space) { function vm_do_add_infl_free(space) { push_undo() log_summary(`Added £ SP in %${space}.`) - - // Update influence values if (game.active === COM) { game.comInfl[space]++ } else { game.demInfl[space]++ } game.vm_available_ops-- - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() } function vm_add_infl() { @@ -4526,14 +4461,12 @@ function vm_add_x_infl() { function vm_do_add_x_infl(space) { push_undo() log(`Added ${game.vm_available_ops} SPs in %${space}.`) - - if (game.active === COM) { game.comInfl[space] += game.vm_available_ops } else { game.demInfl[space] += game.vm_available_ops } - check_control_change(space) + check_tyrant() game.vm_available_ops = 0 game.valid_spaces = [] } @@ -4568,7 +4501,7 @@ function vm_do_add_limited_infl(space, max_infl) { if (game.vm_influence_added[space] === max_infl) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(space) + check_tyrant() if (game.vm_available_ops === 0) {game.valid_spaces = [] } } @@ -4631,7 +4564,7 @@ function vm_do_remove_infl(space) { } } } - check_control_change(space) + check_tyrant() game.vm_influence_added[space]++ game.vm_available_ops-- if (game.vm_available_ops===0) {game.valid_spaces = []} @@ -4675,8 +4608,7 @@ function vm_do_remove_x_infl(space) { } log(`Removed ${game.vm_available_ops} SPs from %${space}`) - check_control_change(space) - + check_tyrant() game.vm_available_ops = 0 game.valid_spaces = [] } @@ -4693,7 +4625,6 @@ function vm_do_remove_limited_infl(space, max_infl) { log(`Removed SP from %${space}.`) game.vm_available_ops -- - if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -4720,7 +4651,7 @@ function vm_do_remove_limited_infl(space, max_infl) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(space) + check_tyrant() if (game.vm_available_ops === 0) {game.valid_spaces = []} } @@ -4739,7 +4670,7 @@ function vm_do_remove_all_infl(space) { } else { game.comInfl[space] = 0 } - check_control_change(space) + check_tyrant() } else { if (game.active === COM) { @@ -4747,7 +4678,7 @@ function vm_do_remove_all_infl(space) { } else { game.demInfl[space] = 0 } - check_control_change(space) + check_tyrant() } game.vm_available_ops -- game.valid_spaces = game.valid_spaces.filter(id => id !== space) @@ -4761,7 +4692,7 @@ function vm_replace_all_infl(space_id) { game.comInfl[space_id] += game.demInfl[space_id] game.demInfl[space_id] = 0 } - check_control_change(space_id) + check_tyrant() } function vm_1_support_check() { @@ -4781,13 +4712,12 @@ function vm_support_check_modified() { } function vm_switch_infl(id){ - push_undo() - + push_undo() game.demInfl[id] -= game.vm_available_ops game.comInfl[id] += game.vm_available_ops log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${id}`) game.vm_available_ops = 0 - check_control_change(id) + check_tyrant() } /* ===================== EVENT SPECIFIC FUNCTIONS ========== */ @@ -4819,8 +4749,8 @@ function vm_army_backs_revolution() { } function vm_austria_hungary_border_reopened() { - game.persistent_events.push(58) - permanently_remove(58) + game.persistent_events.push(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + permanently_remove(C_AUSTRIA_HUNGARY_BORDER_REOPENED) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4839,7 +4769,7 @@ function vm_breakaway_baltic_republics() { if (check_vp()) { return } - game.playable_cards.push(109) + game.playable_cards.push(C_KREMLIN_COUP) 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)} @@ -4960,14 +4890,12 @@ function vm_eco_glasnost() { } function vm_elena(){ - game.persistent_events.push(101) + game.persistent_events.push(C_ELENA) vm_next() } -function vm_eliminate(space_id) { +function vm_eliminate(space_id) { // Eliminate the democrat influence and move the communist influence to Bucuresti log(`Eliminated %${space_id}`) - -// 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 @@ -4979,10 +4907,6 @@ function vm_eliminate(space_id) { } game.comInfl[space_id] = 0 } - //Update control in the eliminated space and in Bucuresti - check_control_change(space_id) - check_control_change(S_BUCURESTI) - } function get_adjusted_adjacency(space_id) { @@ -5012,7 +4936,7 @@ function vm_foreign_currency_debt_burden() { if (check_vp()) { return } - game.persistent_events.push(49) + game.persistent_events.push(C_FOREIGN_CURRENCY_DEBT_BURDEN) game.state = 'vm_foreign_currency_debt_burden' } @@ -5026,26 +4950,26 @@ function vm_foreign_television() { vm_next() } function vm_frg_embassies() { - game.persistent_events.push(74) - game.table_cards.push(74) - remove_from_discard(74) - log('C74 in effect') + game.persistent_events.push(C_FRG_EMBASSIES) + game.table_cards.push(C_FRG_EMBASSIES) + remove_from_discard(C_FRG_EMBASSIES) + log(`C${C_FRG_EMBASSIES} in effect`) vm_next() } function vm_general_strike() { - game.persistent_events.push(5) - game.table_cards.push(5) - remove_from_discard(5) - log('C5 in effect') + game.persistent_events.push(C_GENERAL_STRIKE) + game.table_cards.push(C_GENERAL_STRIKE) + remove_from_discard(C_GENERAL_STRIKE) + log(`C${C_GENERAL_STRIKE} in effect`) vm_next() } function vm_genscher() { - game.persistent_events.push(63) - game.table_cards.push(63) - remove_from_discard(63) - log(`C63 in effect`) + game.persistent_events.push(C_GENSCHER) + game.table_cards.push(C_GENSCHER) + remove_from_discard(C_GENSCHER) + log(`C${C_GENSCHER} in effect`) vm_next() } @@ -5079,8 +5003,8 @@ function vm_government_resigns() { } function vm_grenztruppen() { - game.persistent_events.push(59) - permanently_remove(59) + game.persistent_events.push(C_GRENZTRUPPEN) + permanently_remove(C_GRENZTRUPPEN) vm_next() } @@ -5102,7 +5026,7 @@ function vm_heal_our_bleeding_wounds() { } function vm_helsinki_final_act() { - game.persistent_events.push(26) + game.persistent_events.push(C_HELSINKI_FINAL_ACT) vm_next() } @@ -5159,11 +5083,11 @@ function vm_kohl_proposes_reunification() { if (check_vp()) { return } - if (game.persistent_events.includes(86)) { - game.vm_event = 87 + if (game.persistent_events.includes(C_THE_WALL_MUST_GO)) { + game.vm_event = C_KOHL_PROPOSES_REUNIFICATION game.state = 'vm_common_european_home_play' } else { - permanently_remove(87) + permanently_remove(C_KOHL_PROPOSES_REUNIFICATION) vm_return() } @@ -5208,13 +5132,13 @@ function vm_legacy_of_1968() { } function vm_li_peng() { - game.persistent_events.push(53) - remove_from_discard(53) + game.persistent_events.push(C_LI_PENG) + remove_from_discard(C_LI_PENG) vm_next() } function vm_ligachev() { - game.persistent_events.push(99) + game.persistent_events.push(C_LIGACHEV) vm_next() } @@ -5240,9 +5164,9 @@ function vm_nagy_reburied(){ } function vm_national_salvation_front() { - game.persistent_events.push(102) - game.table_cards.push(102) - remove_from_discard(102) + game.persistent_events.push(C_NATIONAL_SALVATION_FRONT) + game.table_cards.push(C_NATIONAL_SALVATION_FRONT) + remove_from_discard(C_NATIONAL_SALVATION_FRONT) vm_next() } @@ -5266,10 +5190,10 @@ function vm_normalisation() { } function vm_peasant_parties_revolt() { - game.persistent_events.push(72) - log_msg_gap('C72 in effect') - game.table_cards.push(72) - remove_from_discard(72) + game.persistent_events.push(C_PEASANT_PARTIES_REVOLT) + log_msg_gap(`C${C_PEASANT_PARTIES_REVOLT} in effect`) + game.table_cards.push(C_PEASANT_PARTIES_REVOLT) + remove_from_discard(C_PEASANT_PARTIES_REVOLT) vm_next() } @@ -5307,8 +5231,8 @@ function vm_power_struggle() { } function vm_presidential_visit() { - game.persistent_events.push(65) - log_msg_gap('C65 in effect') + game.persistent_events.push(C_PRESIDENTIAL_VISIT) + log_msg_gap(`C${C_PRESIDENTIAL_VISIT} in effect`) vm_next() } @@ -5332,7 +5256,7 @@ function vm_public_against_violence() { } function vm_reformer_rehabilitated () { - permanently_remove(67) + permanently_remove(C_REFORMER_REHABILITATED) game.discard = true for (let card of game.strategy_discard) { if (!event_is_playable(card)) continue @@ -5439,7 +5363,7 @@ function vm_tear_gas () { 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') + log_msg_gap(`C${C_TEAR_GAS} in effect`) vm_next() } @@ -5497,7 +5421,6 @@ function vm_the_tyrant_is_gone() { game.state = 'vm_the_tyrant_is_gone' } - function vm_the_tyrant_is_gone_prep() { game.table_cards.push(C_THE_TYRANT_IS_GONE) remove_from_discard(C_THE_TYRANT_IS_GONE) @@ -5562,7 +5485,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { game.persistent_events.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - log_msg_gap('C62 in effect') + log_msg_gap(`C${C_YAKOVLEV_COUNSELS_GORBACHEV} in effect`) game.table_cards.push(C_YAKOVLEV_COUNSELS_GORBACHEV) remove_from_discard(C_YAKOVLEV_COUNSELS_GORBACHEV) vm_next() -- cgit v1.2.3 From 74dd934f137d8026efb8ffe16be8e55dee6086e7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 08:43:15 +0000 Subject: Tidying up code --- rules.js | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/rules.js b/rules.js index c42160f..f4490db 100644 --- a/rules.js +++ b/rules.js @@ -5818,7 +5818,6 @@ states.vm_remove_x_infl = { } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` - for (let space_id of game.valid_spaces) { gen_action_space(space_id); } @@ -5975,7 +5974,6 @@ states.vm_ceh_do_support_check = { roll() { clear_undo() do_sc(game.selected_space) - game.vm_available_ops-- if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -6011,7 +6009,6 @@ states.vm_1_support_check_prep = { gen_action('done') } else { view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}.` - for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_space(space_id); @@ -6197,7 +6194,6 @@ states.vm_central_committee_reshuffle = { log('Passed') vm_return() } - } states.vm_common_european_home_choose = { @@ -6294,7 +6290,7 @@ states.vm_play_event_from_discard = { if (game.valid_cards.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid cards in discard.` gen_action('pass') - } else if (game.temp === 0) { + } else { view.prompt = `${event_prompt()}.` for (let card of game.valid_cards) { gen_action('pass') @@ -6686,7 +6682,7 @@ states.vm_inflationary_currency_discard = { if (game.valid_cards.length === 0 ) { view.prompt = 'Inflationary Currency: no valid cards to discard. You must pass.' gen_action('pass') - } else if (game.temp === 0 ) { + } else { view.prompt = 'Inflationary Currency: you may discard a 3 op or higher value card to cancel the support check.' gen_action('pass') for (let card of game.valid_cards) { @@ -6714,16 +6710,6 @@ states.vm_inflationary_currency_discard = { game.vm_available_ops = 1 vm_next() }, - done() { - if (!game.vm_infl_to_do) { - if(game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - vm_next() - } } @@ -7055,7 +7041,6 @@ states.vm_nepotism = { else { log(`Roll: D${roll} adds 1 SP`) game.vm_available_ops = 1} - vm_next() }, } @@ -7332,12 +7317,14 @@ states.vm_social_democratic_platform_adopted = { push_undo() game.vm_active_country = 'Poland' log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, + vm_next() + }, czechoslovakia() { push_undo() game.vm_active_country = 'Czechoslovakia' log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, + vm_next() + }, hungary() { push_undo() game.vm_active_country = 'Hungary' @@ -7377,7 +7364,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED?*/ + game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ vm_next() }, } @@ -7464,7 +7451,7 @@ states.vm_the_chinese_solution = { }, pass() { push_undo() - permanently_remove(96) + permanently_remove(C_THE_CHINESE_SOLUTION) vm_return() } } @@ -7679,7 +7666,6 @@ states.vm_workers_revolt = { } } - states.vm_workers_revolt_finish = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -7708,7 +7694,6 @@ states.vm_workers_revolt_finish = { game.selected_space = 0 vm_next() }, - } // ==================== TIANANMEN SQUARE TRACK STATES ===================== @@ -7863,7 +7848,6 @@ states.vm_tst_8 = { } } - states.vm_tst_8_ops = { inactive: 'play card for operations.', prompt() { -- cgit v1.2.3 From bfb923a855359093a01578d8033181ed2d422176 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:31:51 +0000 Subject: Remove double undo steps --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index f4490db..ef4a9af 100644 --- a/rules.js +++ b/rules.js @@ -7158,7 +7158,6 @@ states.vm_nomenklatura_add = { } }, space(space) { - push_undo() vm_do_add_infl_free(space) if (game.vm_available_ops === 0 ) { game.valid_spaces = [] -- cgit v1.2.3 From dd88d678112054dcff779fb35fd8f0ff0ebb6224 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:51:38 +0000 Subject: Pulled cards75 from tor branch --- cards75/power_11_14.avif | Bin 0 -> 4722 bytes cards75/power_11_14.png | Bin 0 -> 27616 bytes cards75/power_15_18.avif | Bin 0 -> 4775 bytes cards75/power_15_18.png | Bin 0 -> 27962 bytes cards75/power_19_20.avif | Bin 0 -> 8170 bytes cards75/power_19_20.png | Bin 0 -> 42427 bytes cards75/power_1_6.avif | Bin 0 -> 6346 bytes cards75/power_1_6.png | Bin 0 -> 33456 bytes cards75/power_21_22.avif | Bin 0 -> 8116 bytes cards75/power_21_22.png | Bin 0 -> 42296 bytes cards75/power_23_26.avif | Bin 0 -> 8096 bytes cards75/power_23_26.png | Bin 0 -> 42154 bytes cards75/power_27_30.avif | Bin 0 -> 8185 bytes cards75/power_27_30.png | Bin 0 -> 42441 bytes cards75/power_31_33.avif | Bin 0 -> 4395 bytes cards75/power_31_33.png | Bin 0 -> 25599 bytes cards75/power_34_36.avif | Bin 0 -> 4376 bytes cards75/power_34_36.png | Bin 0 -> 25473 bytes cards75/power_37.avif | Bin 0 -> 5125 bytes cards75/power_37.png | Bin 0 -> 28776 bytes cards75/power_38.avif | Bin 0 -> 5011 bytes cards75/power_38.png | Bin 0 -> 27499 bytes cards75/power_39.avif | Bin 0 -> 5362 bytes cards75/power_39.png | Bin 0 -> 29822 bytes cards75/power_40.avif | Bin 0 -> 4461 bytes cards75/power_40.png | Bin 0 -> 24275 bytes cards75/power_41.avif | Bin 0 -> 4693 bytes cards75/power_41.png | Bin 0 -> 25238 bytes cards75/power_42.avif | Bin 0 -> 5519 bytes cards75/power_42.png | Bin 0 -> 30121 bytes cards75/power_43.avif | Bin 0 -> 3936 bytes cards75/power_43.png | Bin 0 -> 21595 bytes cards75/power_44.avif | Bin 0 -> 3732 bytes cards75/power_44.png | Bin 0 -> 20414 bytes cards75/power_45.avif | Bin 0 -> 4254 bytes cards75/power_45.png | Bin 0 -> 23051 bytes cards75/power_46.avif | Bin 0 -> 6361 bytes cards75/power_46.png | Bin 0 -> 36124 bytes cards75/power_47.avif | Bin 0 -> 5658 bytes cards75/power_47.png | Bin 0 -> 30728 bytes cards75/power_48.avif | Bin 0 -> 6765 bytes cards75/power_48.png | Bin 0 -> 38695 bytes cards75/power_49.avif | Bin 0 -> 4112 bytes cards75/power_49.png | Bin 0 -> 20622 bytes cards75/power_50.avif | Bin 0 -> 5241 bytes cards75/power_50.png | Bin 0 -> 27130 bytes cards75/power_51.avif | Bin 0 -> 5126 bytes cards75/power_51.png | Bin 0 -> 26487 bytes cards75/power_52.avif | Bin 0 -> 5647 bytes cards75/power_52.png | Bin 0 -> 29560 bytes cards75/power_7_8.avif | Bin 0 -> 4771 bytes cards75/power_7_8.png | Bin 0 -> 27880 bytes cards75/power_9_10.avif | Bin 0 -> 4739 bytes cards75/power_9_10.png | Bin 0 -> 27771 bytes cards75/power_back.avif | Bin 0 -> 5387 bytes cards75/power_back.png | Bin 0 -> 50112 bytes 56 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cards75/power_11_14.avif create mode 100644 cards75/power_11_14.png create mode 100644 cards75/power_15_18.avif create mode 100644 cards75/power_15_18.png create mode 100644 cards75/power_19_20.avif create mode 100644 cards75/power_19_20.png create mode 100644 cards75/power_1_6.avif create mode 100644 cards75/power_1_6.png create mode 100644 cards75/power_21_22.avif create mode 100644 cards75/power_21_22.png create mode 100644 cards75/power_23_26.avif create mode 100644 cards75/power_23_26.png create mode 100644 cards75/power_27_30.avif create mode 100644 cards75/power_27_30.png create mode 100644 cards75/power_31_33.avif create mode 100644 cards75/power_31_33.png create mode 100644 cards75/power_34_36.avif create mode 100644 cards75/power_34_36.png create mode 100644 cards75/power_37.avif create mode 100644 cards75/power_37.png create mode 100644 cards75/power_38.avif create mode 100644 cards75/power_38.png create mode 100644 cards75/power_39.avif create mode 100644 cards75/power_39.png create mode 100644 cards75/power_40.avif create mode 100644 cards75/power_40.png create mode 100644 cards75/power_41.avif create mode 100644 cards75/power_41.png create mode 100644 cards75/power_42.avif create mode 100644 cards75/power_42.png create mode 100644 cards75/power_43.avif create mode 100644 cards75/power_43.png create mode 100644 cards75/power_44.avif create mode 100644 cards75/power_44.png create mode 100644 cards75/power_45.avif create mode 100644 cards75/power_45.png create mode 100644 cards75/power_46.avif create mode 100644 cards75/power_46.png create mode 100644 cards75/power_47.avif create mode 100644 cards75/power_47.png create mode 100644 cards75/power_48.avif create mode 100644 cards75/power_48.png create mode 100644 cards75/power_49.avif create mode 100644 cards75/power_49.png create mode 100644 cards75/power_50.avif create mode 100644 cards75/power_50.png create mode 100644 cards75/power_51.avif create mode 100644 cards75/power_51.png create mode 100644 cards75/power_52.avif create mode 100644 cards75/power_52.png create mode 100644 cards75/power_7_8.avif create mode 100644 cards75/power_7_8.png create mode 100644 cards75/power_9_10.avif create mode 100644 cards75/power_9_10.png create mode 100644 cards75/power_back.avif create mode 100644 cards75/power_back.png diff --git a/cards75/power_11_14.avif b/cards75/power_11_14.avif new file mode 100644 index 0000000..5488f01 Binary files /dev/null and b/cards75/power_11_14.avif differ diff --git a/cards75/power_11_14.png b/cards75/power_11_14.png new file mode 100644 index 0000000..040c518 Binary files /dev/null and b/cards75/power_11_14.png differ diff --git a/cards75/power_15_18.avif b/cards75/power_15_18.avif new file mode 100644 index 0000000..ef3c3ee Binary files /dev/null and b/cards75/power_15_18.avif differ diff --git a/cards75/power_15_18.png b/cards75/power_15_18.png new file mode 100644 index 0000000..e46f823 Binary files /dev/null and b/cards75/power_15_18.png differ diff --git a/cards75/power_19_20.avif b/cards75/power_19_20.avif new file mode 100644 index 0000000..f6c641a Binary files /dev/null and b/cards75/power_19_20.avif differ diff --git a/cards75/power_19_20.png b/cards75/power_19_20.png new file mode 100644 index 0000000..0a44c0d Binary files /dev/null and b/cards75/power_19_20.png differ diff --git a/cards75/power_1_6.avif b/cards75/power_1_6.avif new file mode 100644 index 0000000..ca0280b Binary files /dev/null and b/cards75/power_1_6.avif differ diff --git a/cards75/power_1_6.png b/cards75/power_1_6.png new file mode 100644 index 0000000..2d8735a Binary files /dev/null and b/cards75/power_1_6.png differ diff --git a/cards75/power_21_22.avif b/cards75/power_21_22.avif new file mode 100644 index 0000000..8c9c907 Binary files /dev/null and b/cards75/power_21_22.avif differ diff --git a/cards75/power_21_22.png b/cards75/power_21_22.png new file mode 100644 index 0000000..710e0af Binary files /dev/null and b/cards75/power_21_22.png differ diff --git a/cards75/power_23_26.avif b/cards75/power_23_26.avif new file mode 100644 index 0000000..346c49a Binary files /dev/null and b/cards75/power_23_26.avif differ diff --git a/cards75/power_23_26.png b/cards75/power_23_26.png new file mode 100644 index 0000000..751510a Binary files /dev/null and b/cards75/power_23_26.png differ diff --git a/cards75/power_27_30.avif b/cards75/power_27_30.avif new file mode 100644 index 0000000..7de3cc4 Binary files /dev/null and b/cards75/power_27_30.avif differ diff --git a/cards75/power_27_30.png b/cards75/power_27_30.png new file mode 100644 index 0000000..9ee10f7 Binary files /dev/null and b/cards75/power_27_30.png differ diff --git a/cards75/power_31_33.avif b/cards75/power_31_33.avif new file mode 100644 index 0000000..36e9a11 Binary files /dev/null and b/cards75/power_31_33.avif differ diff --git a/cards75/power_31_33.png b/cards75/power_31_33.png new file mode 100644 index 0000000..b48084c Binary files /dev/null and b/cards75/power_31_33.png differ diff --git a/cards75/power_34_36.avif b/cards75/power_34_36.avif new file mode 100644 index 0000000..d3129e2 Binary files /dev/null and b/cards75/power_34_36.avif differ diff --git a/cards75/power_34_36.png b/cards75/power_34_36.png new file mode 100644 index 0000000..bedb784 Binary files /dev/null and b/cards75/power_34_36.png differ diff --git a/cards75/power_37.avif b/cards75/power_37.avif new file mode 100644 index 0000000..6a56779 Binary files /dev/null and b/cards75/power_37.avif differ diff --git a/cards75/power_37.png b/cards75/power_37.png new file mode 100644 index 0000000..8841551 Binary files /dev/null and b/cards75/power_37.png differ diff --git a/cards75/power_38.avif b/cards75/power_38.avif new file mode 100644 index 0000000..3966407 Binary files /dev/null and b/cards75/power_38.avif differ diff --git a/cards75/power_38.png b/cards75/power_38.png new file mode 100644 index 0000000..2193650 Binary files /dev/null and b/cards75/power_38.png differ diff --git a/cards75/power_39.avif b/cards75/power_39.avif new file mode 100644 index 0000000..82f4b4a Binary files /dev/null and b/cards75/power_39.avif differ diff --git a/cards75/power_39.png b/cards75/power_39.png new file mode 100644 index 0000000..0da6f14 Binary files /dev/null and b/cards75/power_39.png differ diff --git a/cards75/power_40.avif b/cards75/power_40.avif new file mode 100644 index 0000000..e3fe0c1 Binary files /dev/null and b/cards75/power_40.avif differ diff --git a/cards75/power_40.png b/cards75/power_40.png new file mode 100644 index 0000000..034c504 Binary files /dev/null and b/cards75/power_40.png differ diff --git a/cards75/power_41.avif b/cards75/power_41.avif new file mode 100644 index 0000000..dab5e03 Binary files /dev/null and b/cards75/power_41.avif differ diff --git a/cards75/power_41.png b/cards75/power_41.png new file mode 100644 index 0000000..745f38f Binary files /dev/null and b/cards75/power_41.png differ diff --git a/cards75/power_42.avif b/cards75/power_42.avif new file mode 100644 index 0000000..c299c52 Binary files /dev/null and b/cards75/power_42.avif differ diff --git a/cards75/power_42.png b/cards75/power_42.png new file mode 100644 index 0000000..c81a2be Binary files /dev/null and b/cards75/power_42.png differ diff --git a/cards75/power_43.avif b/cards75/power_43.avif new file mode 100644 index 0000000..d7a6e76 Binary files /dev/null and b/cards75/power_43.avif differ diff --git a/cards75/power_43.png b/cards75/power_43.png new file mode 100644 index 0000000..4999cff Binary files /dev/null and b/cards75/power_43.png differ diff --git a/cards75/power_44.avif b/cards75/power_44.avif new file mode 100644 index 0000000..60054e6 Binary files /dev/null and b/cards75/power_44.avif differ diff --git a/cards75/power_44.png b/cards75/power_44.png new file mode 100644 index 0000000..34d5518 Binary files /dev/null and b/cards75/power_44.png differ diff --git a/cards75/power_45.avif b/cards75/power_45.avif new file mode 100644 index 0000000..959bc4a Binary files /dev/null and b/cards75/power_45.avif differ diff --git a/cards75/power_45.png b/cards75/power_45.png new file mode 100644 index 0000000..e104c7c Binary files /dev/null and b/cards75/power_45.png differ diff --git a/cards75/power_46.avif b/cards75/power_46.avif new file mode 100644 index 0000000..727df34 Binary files /dev/null and b/cards75/power_46.avif differ diff --git a/cards75/power_46.png b/cards75/power_46.png new file mode 100644 index 0000000..eb8c1c0 Binary files /dev/null and b/cards75/power_46.png differ diff --git a/cards75/power_47.avif b/cards75/power_47.avif new file mode 100644 index 0000000..17fdedb Binary files /dev/null and b/cards75/power_47.avif differ diff --git a/cards75/power_47.png b/cards75/power_47.png new file mode 100644 index 0000000..e75894d Binary files /dev/null and b/cards75/power_47.png differ diff --git a/cards75/power_48.avif b/cards75/power_48.avif new file mode 100644 index 0000000..d65080b Binary files /dev/null and b/cards75/power_48.avif differ diff --git a/cards75/power_48.png b/cards75/power_48.png new file mode 100644 index 0000000..9bcbd0a Binary files /dev/null and b/cards75/power_48.png differ diff --git a/cards75/power_49.avif b/cards75/power_49.avif new file mode 100644 index 0000000..f862562 Binary files /dev/null and b/cards75/power_49.avif differ diff --git a/cards75/power_49.png b/cards75/power_49.png new file mode 100644 index 0000000..f6e4349 Binary files /dev/null and b/cards75/power_49.png differ diff --git a/cards75/power_50.avif b/cards75/power_50.avif new file mode 100644 index 0000000..af77e6b Binary files /dev/null and b/cards75/power_50.avif differ diff --git a/cards75/power_50.png b/cards75/power_50.png new file mode 100644 index 0000000..e5a1582 Binary files /dev/null and b/cards75/power_50.png differ diff --git a/cards75/power_51.avif b/cards75/power_51.avif new file mode 100644 index 0000000..bcdf23b Binary files /dev/null and b/cards75/power_51.avif differ diff --git a/cards75/power_51.png b/cards75/power_51.png new file mode 100644 index 0000000..0e9de51 Binary files /dev/null and b/cards75/power_51.png differ diff --git a/cards75/power_52.avif b/cards75/power_52.avif new file mode 100644 index 0000000..4d77f9c Binary files /dev/null and b/cards75/power_52.avif differ diff --git a/cards75/power_52.png b/cards75/power_52.png new file mode 100644 index 0000000..c909f71 Binary files /dev/null and b/cards75/power_52.png differ diff --git a/cards75/power_7_8.avif b/cards75/power_7_8.avif new file mode 100644 index 0000000..590e627 Binary files /dev/null and b/cards75/power_7_8.avif differ diff --git a/cards75/power_7_8.png b/cards75/power_7_8.png new file mode 100644 index 0000000..82acce3 Binary files /dev/null and b/cards75/power_7_8.png differ diff --git a/cards75/power_9_10.avif b/cards75/power_9_10.avif new file mode 100644 index 0000000..b5b8aa6 Binary files /dev/null and b/cards75/power_9_10.avif differ diff --git a/cards75/power_9_10.png b/cards75/power_9_10.png new file mode 100644 index 0000000..db8daa4 Binary files /dev/null and b/cards75/power_9_10.png differ diff --git a/cards75/power_back.avif b/cards75/power_back.avif new file mode 100644 index 0000000..a73f412 Binary files /dev/null and b/cards75/power_back.avif differ diff --git a/cards75/power_back.png b/cards75/power_back.png new file mode 100644 index 0000000..4f7725d Binary files /dev/null and b/cards75/power_back.png differ -- cgit v1.2.3 From 3598e7f1f7b2a3ec6ebb1458baae576e4e65aa95 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:53:37 +0000 Subject: Add small power cards --- play.css | 129 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/play.css b/play.css index a0d7094..0619a98 100644 --- a/play.css +++ b/play.css @@ -39,6 +39,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log { background-color: floralwhite } #log .h1 { background-color: tan } #log .h2 { background-color: wheat } +#log .h3 { background-color: wheat } #log .h2.dem { background-color: hsl(206, 85%, 80%); } #log .h2.com { background-color: hsl(355, 70%, 80%); } @@ -233,22 +234,14 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } min-height: 350px; } -.panel:has(.panel_body:empty) { - display: none; +.panel_body.power { + min-height: 263px; } -#scoring_card_panel { - display: flex; - flex-direction: column; - width: 100%; -} - -#scoring_card_panel .card_row { - display: flex; - gap: 10px; +.panel.autohide:has(.panel_body:empty) { + display: none; } - /* CARD IMAGES */ #tooltip { @@ -269,6 +262,12 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } box-shadow: 0 0 0 1px #444, 1px 2px 4px #0004; } +.power_card { + width: 188px; + height: 263px; + border-radius: 12px; +} + .card.action { box-shadow: 0 0 0 1px #444, 0 0 0 4px white; } @@ -389,56 +388,56 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.event_109 { background-image: url(cards100/event_109.avif) } .card.event_110 { background-image: url(cards100/event_110.avif) } -.card.power_0 { background-image: url(cards100/power_back.avif) } -.card.power_1 { background-image: url(cards100/power_1_6.avif) } -.card.power_2 { background-image: url(cards100/power_1_6.avif) } -.card.power_3 { background-image: url(cards100/power_1_6.avif) } -.card.power_4 { background-image: url(cards100/power_1_6.avif) } -.card.power_5 { background-image: url(cards100/power_1_6.avif) } -.card.power_6 { background-image: url(cards100/power_1_6.avif) } -.card.power_7 { background-image: url(cards100/power_7_8.avif) } -.card.power_8 { background-image: url(cards100/power_7_8.avif) } -.card.power_9 { background-image: url(cards100/power_9_10.avif) } -.card.power_10 { background-image: url(cards100/power_9_10.avif) } -.card.power_11 { background-image: url(cards100/power_11_14.avif) } -.card.power_12 { background-image: url(cards100/power_11_14.avif) } -.card.power_13 { background-image: url(cards100/power_11_14.avif) } -.card.power_14 { background-image: url(cards100/power_11_14.avif) } -.card.power_15 { background-image: url(cards100/power_15_18.avif) } -.card.power_16 { background-image: url(cards100/power_15_18.avif) } -.card.power_17 { background-image: url(cards100/power_15_18.avif) } -.card.power_18 { background-image: url(cards100/power_15_18.avif) } -.card.power_19 { background-image: url(cards100/power_19_20.avif) } -.card.power_20 { background-image: url(cards100/power_19_20.avif) } -.card.power_21 { background-image: url(cards100/power_21_22.avif) } -.card.power_22 { background-image: url(cards100/power_21_22.avif) } -.card.power_23 { background-image: url(cards100/power_23_26.avif) } -.card.power_24 { background-image: url(cards100/power_23_26.avif) } -.card.power_25 { background-image: url(cards100/power_23_26.avif) } -.card.power_26 { background-image: url(cards100/power_23_26.avif) } -.card.power_27 { background-image: url(cards100/power_27_30.avif) } -.card.power_28 { background-image: url(cards100/power_27_30.avif) } -.card.power_29 { background-image: url(cards100/power_27_30.avif) } -.card.power_30 { background-image: url(cards100/power_27_30.avif) } -.card.power_31 { background-image: url(cards100/power_31_33.avif) } -.card.power_32 { background-image: url(cards100/power_31_33.avif) } -.card.power_33 { background-image: url(cards100/power_31_33.avif) } -.card.power_34 { background-image: url(cards100/power_34_36.avif) } -.card.power_35 { background-image: url(cards100/power_34_36.avif) } -.card.power_36 { background-image: url(cards100/power_34_36.avif) } -.card.power_37 { background-image: url(cards100/power_37.avif) } -.card.power_38 { background-image: url(cards100/power_38.avif) } -.card.power_39 { background-image: url(cards100/power_39.avif) } -.card.power_40 { background-image: url(cards100/power_40.avif) } -.card.power_41 { background-image: url(cards100/power_41.avif) } -.card.power_42 { background-image: url(cards100/power_42.avif) } -.card.power_43 { background-image: url(cards100/power_43.avif) } -.card.power_44 { background-image: url(cards100/power_44.avif) } -.card.power_45 { background-image: url(cards100/power_45.avif) } -.card.power_46 { background-image: url(cards100/power_46.avif) } -.card.power_47 { background-image: url(cards100/power_47.avif) } -.card.power_48 { background-image: url(cards100/power_48.avif) } -.card.power_49 { background-image: url(cards100/power_49.avif) } -.card.power_50 { background-image: url(cards100/power_50.avif) } -.card.power_51 { background-image: url(cards100/power_51.avif) } -.card.power_52 { background-image: url(cards100/power_52.avif) } +.card.power_0 { background-image: url(cards75/power_back.avif) } +.card.power_1 { background-image: url(cards75/power_1_6.avif) } +.card.power_2 { background-image: url(cards75/power_1_6.avif) } +.card.power_3 { background-image: url(cards75/power_1_6.avif) } +.card.power_4 { background-image: url(cards75/power_1_6.avif) } +.card.power_5 { background-image: url(cards75/power_1_6.avif) } +.card.power_6 { background-image: url(cards75/power_1_6.avif) } +.card.power_7 { background-image: url(cards75/power_7_8.avif) } +.card.power_8 { background-image: url(cards75/power_7_8.avif) } +.card.power_9 { background-image: url(cards75/power_9_10.avif) } +.card.power_10 { background-image: url(cards75/power_9_10.avif) } +.card.power_11 { background-image: url(cards75/power_11_14.avif) } +.card.power_12 { background-image: url(cards75/power_11_14.avif) } +.card.power_13 { background-image: url(cards75/power_11_14.avif) } +.card.power_14 { background-image: url(cards75/power_11_14.avif) } +.card.power_15 { background-image: url(cards75/power_15_18.avif) } +.card.power_16 { background-image: url(cards75/power_15_18.avif) } +.card.power_17 { background-image: url(cards75/power_15_18.avif) } +.card.power_18 { background-image: url(cards75/power_15_18.avif) } +.card.power_19 { background-image: url(cards75/power_19_20.avif) } +.card.power_20 { background-image: url(cards75/power_19_20.avif) } +.card.power_21 { background-image: url(cards75/power_21_22.avif) } +.card.power_22 { background-image: url(cards75/power_21_22.avif) } +.card.power_23 { background-image: url(cards75/power_23_26.avif) } +.card.power_24 { background-image: url(cards75/power_23_26.avif) } +.card.power_25 { background-image: url(cards75/power_23_26.avif) } +.card.power_26 { background-image: url(cards75/power_23_26.avif) } +.card.power_27 { background-image: url(cards75/power_27_30.avif) } +.card.power_28 { background-image: url(cards75/power_27_30.avif) } +.card.power_29 { background-image: url(cards75/power_27_30.avif) } +.card.power_30 { background-image: url(cards75/power_27_30.avif) } +.card.power_31 { background-image: url(cards75/power_31_33.avif) } +.card.power_32 { background-image: url(cards75/power_31_33.avif) } +.card.power_33 { background-image: url(cards75/power_31_33.avif) } +.card.power_34 { background-image: url(cards75/power_34_36.avif) } +.card.power_35 { background-image: url(cards75/power_34_36.avif) } +.card.power_36 { background-image: url(cards75/power_34_36.avif) } +.card.power_37 { background-image: url(cards75/power_37.avif) } +.card.power_38 { background-image: url(cards75/power_38.avif) } +.card.power_39 { background-image: url(cards75/power_39.avif) } +.card.power_40 { background-image: url(cards75/power_40.avif) } +.card.power_41 { background-image: url(cards75/power_41.avif) } +.card.power_42 { background-image: url(cards75/power_42.avif) } +.card.power_43 { background-image: url(cards75/power_43.avif) } +.card.power_44 { background-image: url(cards75/power_44.avif) } +.card.power_45 { background-image: url(cards75/power_45.avif) } +.card.power_46 { background-image: url(cards75/power_46.avif) } +.card.power_47 { background-image: url(cards75/power_47.avif) } +.card.power_48 { background-image: url(cards75/power_48.avif) } +.card.power_49 { background-image: url(cards75/power_49.avif) } +.card.power_50 { background-image: url(cards75/power_50.avif) } +.card.power_51 { background-image: url(cards75/power_51.avif) } +.card.power_52 { background-image: url(cards75/power_52.avif) } \ No newline at end of file -- cgit v1.2.3 From 413fdebf2e51d83fff0d6179508da7080d1c981e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:59:05 +0000 Subject: Tor updates --- play.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/play.js b/play.js index 49ab1f3..2528f4e 100644 --- a/play.js +++ b/play.js @@ -640,22 +640,7 @@ function on_update() { // UPDATE CARD DISPLAYS ui.played_card.replaceChildren() - ui.power_card_1.replaceChildren() - ui.power_card_2.replaceChildren() - if (!view.is_pwr_struggle) { - if (view.played_card > 0) - ui.played_card.appendChild(ui.cards[view.played_card]) - document.getElementById("scoring_card_panel").style.display = "none" - } else { - document.getElementById("scoring_card_panel").style.display = "flex" - if (view.played_card > 0) - ui.scoring_card.appendChild(ui.cards[view.played_card]) - if (view.power_card_1) - ui.power_card_1.appendChild(ui.power_cards[view.power_card_1]) - if (view.power_card_2) - ui.power_card_2.appendChild(ui.power_cards[view.power_card_2]) - } /* ui.played_power_card.replaceChildren() if (view.played_power_card > 0) ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ -- cgit v1.2.3 From 0e8b7cf6d84c6be64f3ee8ec082e900a201cbe28 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 18:44:01 +0000 Subject: Fix Deutsche Marks --- Map.docx | Bin 0 -> 44689 bytes data.xlsx | Bin 0 -> 340281 bytes output.txt | 0 rules.js | 21 +++++++++------------ server.code-workspace | 10 ++++++++++ 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 Map.docx create mode 100644 data.xlsx create mode 100644 output.txt create mode 100644 server.code-workspace diff --git a/Map.docx b/Map.docx new file mode 100644 index 0000000..e23d852 Binary files /dev/null and b/Map.docx differ diff --git a/data.xlsx b/data.xlsx new file mode 100644 index 0000000..fd1cb69 Binary files /dev/null and b/data.xlsx differ diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/rules.js b/rules.js index ef4a9af..30b7848 100644 --- a/rules.js +++ b/rules.js @@ -1650,16 +1650,16 @@ states.vp_roll = { } }, roll () { - let vp_change = vp_roll[get_aftermath_roll()] + let roll = get_aftermath_roll() + let vp_change = vp_roll[roll] if (game.active === DEM) { log(`+${vp_change} VP`) } else { log(`-${vp_change} VP`) } - if (roll >= 4) if (game.active === DEM) {game.vp += vp_change} else {game.vp -= vp_change} - if (game.active === DEM && modified_roll >= 4) { + if (game.active === DEM && roll >= 4) { game.phase = 1 } else { game.phase = 0 @@ -4832,19 +4832,18 @@ function vm_civic_forum() { } function vm_common_european_home() { - let valid_cards = [] - for (let c = first_strategy_card; c <= last_strategy_card; ++c) { + let hands = [...game.democrat_hand, ...game.communist_hand] + for (let c of hands) { if (game.active === DEM) { if (cards[c].side === 'C') { - valid_cards.push(c) + game.valid_cards.push(c) } } else { if (cards[c].side === 'D') { - valid_cards.push(c) + game.valid_cards.push(c) } } } - game.valid_cards = valid_cards game.state = "vm_common_european_home_choose" } @@ -6352,10 +6351,8 @@ states.vm_deutsche_marks_confirm = { gen_action('done') }, done() { - if (cards[game.vm_event].side === "C") { - if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { - goto_vm(game.vm_event) - } + if (cards[game.vm_event].side === "C" && (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event))) { + goto_vm(game.vm_event) } else { next_player() game.state = 'vm_deutsche_marks' diff --git a/server.code-workspace b/server.code-workspace new file mode 100644 index 0000000..449c3b1 --- /dev/null +++ b/server.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../.." + } + ] +} \ No newline at end of file -- cgit v1.2.3 From 0eecf99578c091875c8b34c233218e76f0898b94 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 19:26:09 +0000 Subject: Fix spaces starting at 0 not 1 --- play.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/play.js b/play.js index 2528f4e..10eeb96 100644 --- a/play.js +++ b/play.js @@ -401,7 +401,7 @@ function create_ui() { ui.dem_inf = [] ui.com_inf = [] - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { let info = spaces[s] let [ x, y, w, h ] = LAYOUT[info.ascii_name] let xc = Math.round(x + w / 2) @@ -451,10 +451,9 @@ function create_ui() { for (let c = 1; c <= last_power_card; ++c) { const power_card_e = document.createElement("div") register_action(power_card_e, "power_card", c) - power_card_e.className = "card power_" + c + power_card_e.className = "card power_card power_" + c ui.power_cards[c] = power_card_e } - ui.events = [] for (let id of box_events) { ui.events[id] = document.createElement("div") @@ -613,7 +612,7 @@ function on_update() { // UPDATE INFLUENCE VALUES - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] @@ -662,9 +661,6 @@ function on_update() { if (view.show_opp_hand && view.opp_hand) for (let c of view.opp_hand) ui.opp_hand.appendChild(ui.cards[c]) - - // TODO: fix rules to set view.opp_power_hand - ui.opp_power_hand.replaceChildren() if (view.opp_power_hand) for (let c of view.opp_power_hand) ui.opp_hand.appendChild(ui.power_cards[c]) -- cgit v1.2.3 From 580883baca6c5daabebbdfd3d2f9fb4aecc286af Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 19:26:49 +0000 Subject: Tor updates --- play.html | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/play.html b/play.html index d2f1546..8499da2 100644 --- a/play.html +++ b/play.html @@ -66,19 +66,11 @@
    - -
    -
    Cards on the Table
    -
    -
    - -
    Played Card
    -
    Power Struggle Hand
    @@ -94,29 +86,29 @@
    -
    Hand
    -
    +
    Opponent Hand
    -
    -
    Opponent Power Struggle Hand
    -
    -
    - -
    -
    Samizdat Card
    +
    +
    Samizdat
    + +
    +
    Persistent Events on the Table
    +
    +
    +
    Permanently Removed Events
    @@ -129,9 +121,8 @@
    -
    - + \ No newline at end of file -- cgit v1.2.3 From 4090f2cebe2bae78979260bb8aa7f5ee7e9a4b72 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 09:31:25 +0000 Subject: Increase size of systematisation marker --- play.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/play.css b/play.css index 0619a98..8b8d19f 100644 --- a/play.css +++ b/play.css @@ -209,6 +209,9 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } /* The Wall */ #event_9 { top: 175px; left: 216px; } +/* Systematisation */ +#event_69 {height: 65px; width: 65px; background-size: cover;} + /* CARD PANELS */ .panel { -- cgit v1.2.3 From 0c627a1927caa1ce7cf4e3b750c3f5536f4f4359 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 09:33:40 +0000 Subject: Small fixes --- play.js | 8 ++------ rules.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/play.js b/play.js index 10eeb96..fd2852c 100644 --- a/play.js +++ b/play.js @@ -638,12 +638,6 @@ function on_update() { // UPDATE CARD DISPLAYS - ui.played_card.replaceChildren() - -/* ui.played_power_card.replaceChildren() - if (view.played_power_card > 0) - ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ - ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) @@ -741,6 +735,8 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") + +console.log('view.valid_cards', view.valid_cards, 'view.power_hand', view.power_hand) } // =========================== LOG FUNCTIONS ============================================== diff --git a/rules.js b/rules.js index 30b7848..1af9405 100644 --- a/rules.js +++ b/rules.js @@ -2577,7 +2577,7 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards[c] - if (card.name === power_cards[game.played_power_card].name) { + if (!leader_cards.includes(c) && card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(c) } else if (card.name === game.proxy_power_card) { valid_cards_set.add(c) @@ -4232,7 +4232,6 @@ function vm_valid_spaces_country () { if (vm_operand(1)) {country = vm_operand(1)} else {country = game.vm_active_country} for (let space of spaces) { - if (!space) continue if (space.country === country) { game.valid_spaces.push(space.space_id); } @@ -5800,7 +5799,12 @@ states.vm_remove_infl = { } }, done() { - do_log_summary() + if (game.summary.length > 0) { + pop_summary() + log_br() + } else { + log('No influence to remove') + } vm_next() } } @@ -5952,7 +5956,6 @@ states.vm_ceh_support_check_prep = { //Then check Austria-Hungary Border Reopened normally 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) { game.state = 'vm_austria_hungary_border_reopened_check' return @@ -6229,7 +6232,7 @@ states.vm_common_european_home_play = { influence(){ push_undo() log_gap(`Played C${game.vm_event} to place SPs`) - game.vm_available_ops = cards[game.vm_event].ops + game.vm_available_ops = get_card_ops(game.vm_event) valid_spaces_infl() // If ABHR - Set AHBR tracker to true if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { -- cgit v1.2.3 From b2918e33f757e32fb5c04efad6a3063f40949361 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 19:11:14 +0000 Subject: Fix Tank Man/Tank Column not going to TST award --- rules.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/rules.js b/rules.js index 1af9405..7c69d1b 100644 --- a/rules.js +++ b/rules.js @@ -5354,6 +5354,31 @@ function vm_tank_column() { game.com_tst_position++ game.com_tst_attempted = 0 } + // Check if TST Awards occur + if (game.active === DEM) { + if (game.dem_tst_position === 3 && game.com_tst_position < 3) { + game.vm_event = 203 + goto_vm(game.vm_event) + return + } + else if (game.dem_tst_position === 4 && game.com_tst_position < 4) { + console.log('in space 4 check') + game.vm_event = 204 + goto_vm(game.vm_event) + return + } + + } else { + if (game.com_tst_position === 3 && game.dem_tst_position < 3) { + game.vm_event = 203 + goto_vm(game.vm_event) + return + } + else if (game.com_tst_position === 4 && game.dem_tst_position < 4) { + game.vm_event = 204} + goto_vm(game.vm_event) + return + } vm_next() } -- cgit v1.2.3 From 158e551a2371d96a6af9b10bb30c2de61c00caac Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 19:23:02 +0000 Subject: Fix Kremlin Coup --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 7c69d1b..5e3168c 100644 --- a/rules.js +++ b/rules.js @@ -6903,7 +6903,7 @@ states.vm_kremlin_coup_sc_prep = { }, prompt() { view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` - space(game.selected_space); + gen_action_space(game.selected_space); }, space(space) { push_undo() @@ -6995,7 +6995,7 @@ states.vm_malta_summit = { let roll = roll_d6() log(`Roll: D${roll}`) if (game.stability > 0) { - log(`+${game.stability} from USSR Stability Track`) + logi(`+${game.stability} from USSR Stability Track`) log(`Modified roll: ${roll + game.stability}`) } if (roll + game.stability > 3) { -- cgit v1.2.3 From 94d52e8ea1f8919d2e9c0931318c460360828944 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 23:00:48 +0000 Subject: Remove unnecessary states and functions --- rules.js | 269 +++++++-------------------------------------------------------- 1 file changed, 28 insertions(+), 241 deletions(-) diff --git a/rules.js b/rules.js index 5e3168c..8344fdb 100644 --- a/rules.js +++ b/rules.js @@ -522,7 +522,7 @@ states.com_init = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, done() { do_log_summary() @@ -567,7 +567,7 @@ states.dem_init = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, done() { do_log_summary() @@ -801,13 +801,13 @@ states.resolve_opponent_event = { if (game.persistent_events.includes(58)) { game.austria_hungary_border_reopened_tracker = true } - game.state = 'finish_add_infl' + game.state = 'add_influence' valid_spaces_infl() }, support_check() { push_undo() game.available_ops = 2 - game.state = 'finish_support_check_prep' + game.state = 'support_check_prep' valid_spaces_sc() }, opp_event() { @@ -841,96 +841,6 @@ states.resolve_opponent_event = { } } -states.finish_add_infl = { - inactive: 'add SPs.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Place SPs: done.' - gen_action("end_round") - return; - } - view.prompt = `Add SPs: ${game.available_ops} remaining.` - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - }, - space(space) { - add_infl(space) - }, - end_round() { - push_undo() - do_log_summary() - end_round() - } -} - -states.finish_support_check_prep = { - inactive: 'do support checks.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('end_round') - } else { - view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - console.log('valid_spaces', game.valid_spaces) - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } - }, - space(space) { - push_undo() - game.selected_space = space - // Check for Austria-Hungary Border Reopened - check on first support check only - if (game.persistent_events.includes(58)){ - if (game.active === DEM && game.available_ops > 1) { - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'finish_austria_hungary_border_reopened_check' - return - } - } - } - game.state = 'finish_do_support_check' - }, - end_round () { - end_round() - } -} - -states.finish_austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened', - prompt() { - view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' - gen_action('yes') - gen_action('no') - }, - yes() { - game.austria_hungary_border_reopened_tracker = true - game.state = 'finish_do_support_check' - }, - no() { - game.state = 'finish_do_support_check' - } -} - -states.finish_do_support_check = { - inactive: 'do support checks', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.available_ops-- - if (game.available_ops === 0) { - game.valid_spaces = [] - } - game.state = 'finish_support_check_prep' - return - } -} - states.add_influence = { inactive: 'add SPs.', prompt () { @@ -938,7 +848,7 @@ states.add_influence = { view.prompt = 'Place SPs: done.' if (!game.vm_event_to_do) { gen_action("end_round") - } else { + } else {add_influence gen_action('done') } } else { @@ -949,7 +859,7 @@ states.add_influence = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, end_round() { push_undo() @@ -1301,7 +1211,7 @@ states.the_crowd_turns_against_ceausescu_infl = { } }, space(space) { - vm_do_add_infl(space) + add_infl(space, 'vm_available_ops') }, done() { do_log_summary() @@ -1620,10 +1530,7 @@ states.support_loss ={ }, space(space) { game.remove_opponent_infl = false /* Don't know why this is needed... */ - remove_infl(space) - if (game.available_ops === 0 ) { - game.valid_spaces = [] - } + remove_infl(space, 'available_ops') }, done () { do_log_summary() @@ -2178,7 +2085,7 @@ states.stasi_resolve_common_european_home = { // ==================== SUPPORTING STATE FUNCTIONS ============================= -function add_infl(space) { +function add_infl(space, ops) { push_undo() log_summary(`Added £ SP in %${space}`) @@ -2191,16 +2098,16 @@ function add_infl(space) { // Check Genscher if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { - game.available_ops-- + game[ops]-- log_summary(`(-1 op due to C${C_GENSCHER})`) } else if (check_opp_control(space)) { - game.available_ops -= 2 + game[ops] -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative - if (game.available_ops < 0) { + if (game[ops] < 0) { log_summary(`(Used +1 op from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED})`) } } else { - game.available_ops-- + game[ops]-- } // Update influence values @@ -2212,8 +2119,8 @@ function add_infl(space) { check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met - 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 ++ + if (game[ops] === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { + game[ops] ++ log('+1 op from C58') game.austria_hungary_border_reopened_tracker = false game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') @@ -2223,7 +2130,7 @@ function add_infl(space) { // Check for Genscher & Austria Hungary Border Reopened - if (game.available_ops === 1) { + if (game[ops] === 1) { if (game.active === DEM) { if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) @@ -2236,12 +2143,12 @@ function add_infl(space) { } //Clear valid spaces if no IP remaining. - if (game.available_ops <= 0 ) { + if (game[ops] <= 0 ) { game.valid_spaces = [] } } -function remove_infl(space) { +function remove_infl(space, ops) { push_undo() log_summary(`Removed £ SP from %${space}.`) @@ -2273,7 +2180,9 @@ function remove_infl(space) { } check_tyrant() } - game.available_ops-- + game[ops]-- + if (game.vm_influence_added && game.vm_influence_added[space]) {game.vm_influence_added[space]++} + if (game[ops]===0) {game.valid_spaces = []} } function do_sc(space) { @@ -4364,84 +4273,6 @@ function vm_take_control(space) { log(`Took control of %${space}`) } - -function vm_do_add_infl(space) { - push_undo() - log_summary(`Added £ SP in %${space}.`) - - //If AHBR - check AHBR condition - if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { - if (spaces[space].country !== 'East_Germany'){ - game.austria_hungary_border_reopened_tracker = false - } - } - - // Check Genscher - if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany') { - game.vm_available_ops-- - log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(space)) { - game.vm_available_ops -= 2 - //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative - if (game.vm_available_ops < 0) { - log_summary(`(Used +1 op from C58)`) - } - } else { - game.vm_available_ops-- - } - - // Update influence values - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - check_tyrant() - - // Check Austria Hungary Border Reopened is true and condition has been met - if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { - game.vm_available_ops ++ - log('+1 Op from C58') - game.austria_hungary_border_reopened_tracker = false - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') - } - - // If only 1 IP remaining, may not place in opponent controlled spaces - - // Check for Genscher & Austria Hungary Border Reopened - - if (game.vm_available_ops === 1) { - - if (game.active === DEM) { - //Check Genscher and AHBR - if (game.persistent_events.includes(C_GENSCHER) || (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker)) { - game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) - } - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_dem_control(n)) - } - } - - //Clear valid spaces if no IP remaining. - if (game.vm_available_ops <= 0 ) { - game.valid_spaces = [] - } -} - -function vm_do_add_infl_free(space) { - push_undo() - log_summary(`Added £ SP in %${space}.`) - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - game.vm_available_ops-- - check_tyrant() -} - function vm_add_infl() { if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} game.state = 'vm_add_infl' @@ -4525,50 +4356,6 @@ function vm_remove_x_opp_infl() { game.state = 'vm_remove_x_infl' } -function vm_do_remove_infl(space) { - push_undo() - log_summary(`Removed £ SP from %${space}.`) - - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - - if (!game.vm_influence_added[space]) { - game.vm_influence_added[space] = 0; - } - if (game.remove_opponent_infl === true) { - if (game.active === COM) { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - - - } else { - if (game.active === COM) { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - } - check_tyrant() - game.vm_influence_added[space]++ - game.vm_available_ops-- - if (game.vm_available_ops===0) {game.valid_spaces = []} -} - function vm_do_remove_x_infl(space) { push_undo() @@ -5663,7 +5450,7 @@ states.vm_add_infl = { } }, space(space) { - vm_do_add_infl(space) + add_infl(space, 'vm_available_ops') if (game.vm_available_ops === 0) { game.valid_spaces = [] do_log_summary() @@ -5813,8 +5600,7 @@ states.vm_remove_infl = { } }, space(space) { - push_undo() - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') game.vm_active_country = spaces[space].country if (game.vm_event !== C_INFLATIONARY_CURRENCY) { if (game.vm_available_ops === 0 ) { @@ -7237,11 +7023,12 @@ states.vm_shock_therapy = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { + console.log('game.vm_active_country', game.vm_active_country) if (game.revolutions.every(n => n === false)) { view.prompt = 'Shock Therapy: no countries to choose.' gen_action('pass') } else { - if (game.vm_active_country === '' ) { + if (!game.vm_active_country || game.vm_active_country === '' ) { view.prompt = 'Shock Therapy: choose a country where you hold Power:' if (game.revolutions[0]) {gen_action('poland')} if (game.revolutions[1]) {gen_action('hungary')} @@ -7629,7 +7416,7 @@ states.vm_we_are_the_people_remove = { } }, space(space) { - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') }, done() { do_log_summary() @@ -7778,7 +7565,7 @@ states.vm_tst_4 = { } }, space(space) { - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') if (game.vm_available_ops === 0) { do_log_summary() vm_next() @@ -7925,7 +7712,7 @@ states.vm_scare_tactics = { }, space(space) { push_undo() - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') }, done() { do_log_summary() -- cgit v1.2.3 From 1810f44f3d0e4684e1ac4b65b05190353f6f3310 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 11:58:31 +0000 Subject: Restore vm_add_infl_free --- rules.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 8344fdb..ea99c2c 100644 --- a/rules.js +++ b/rules.js @@ -848,7 +848,7 @@ states.add_influence = { view.prompt = 'Place SPs: done.' if (!game.vm_event_to_do) { gen_action("end_round") - } else {add_influence + } else { gen_action('done') } } else { @@ -4273,6 +4273,20 @@ function vm_take_control(space) { log(`Took control of %${space}`) } +function vm_do_add_infl_free(space) { + push_undo() + log_summary(`Added £ SP in %${space}.`) + + // Update influence values + if (game.active === COM) { + game.comInfl[space]++ + } else { + game.demInfl[space]++ + } + game.vm_available_ops-- + check_tyrant() +} + function vm_add_infl() { if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} game.state = 'vm_add_infl' -- cgit v1.2.3 From 62455b0bc56621a57ac9cab2818b033f6e415dcf Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 11:58:48 +0000 Subject: Fix for New Year's Eve party --- play.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/play.js b/play.js index fd2852c..c4e139f 100644 --- a/play.js +++ b/play.js @@ -679,7 +679,8 @@ function on_update() { ui.persistent.replaceChildren() for (let c of view.persistent_events) - ui.persistent.appendChild(ui.cards[c]) + if (c < 111) + ui.persistent.appendChild(ui.cards[c]) ui.played_card.replaceChildren() if (view.played_card > 0) @@ -735,8 +736,6 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - -console.log('view.valid_cards', view.valid_cards, 'view.power_hand', view.power_hand) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From 2dd7882a6f465d5a4cf9c1045dfe3bc2491ee9ca Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 12:29:26 +0000 Subject: Single starting state, tidy up game object --- rules.js | 100 ++++++++++++++------------------------------------------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/rules.js b/rules.js index ea99c2c..22e0975 100644 --- a/rules.js +++ b/rules.js @@ -248,7 +248,7 @@ exports.setup = function (seed, scenario, options) { undo: [], summary: [], active: null, - state: "com_init", + state: 'place_starting_infl', return: '', vm: null, vm_event: 0, @@ -290,20 +290,13 @@ exports.setup = function (seed, scenario, options) { democrat_hand: [], communist_hand: [], - pwr_struggle_in: [], is_pwr_struggle: false, dem_pwr_hand_limit: 0, com_pwr_hand_limit: 0, dem_pwr_hand: [], com_pwr_hand: [], - raised_stakes_discard: 0, - raised_stakes: 0, - raised_stakes_round: 0, - phase: 0, times_held: [0, 0, 0, 0, 0, 0], revolutions: [false, false, false, false, false, false], - remove_opponent_infl: false, - tactics_fails: '', } log_h1("1989 Dawn of Freedom") @@ -324,10 +317,8 @@ function start_game() { }) //Set starting placement ops - game.starting_infl = { - com_starting_infl: 0, - dem_starting_infl: 0 - }, + game.starting_infl = [2, 3, 3, 4, 2] + game.temp = 0 // Set variable event cards where event is playable at start of game @@ -335,9 +326,8 @@ function start_game() { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) - game.valid_spaces = valid_spaces_setup() + valid_spaces_setup() game.available_ops = 2 - //game.phase = 0 /* Now redundant? */ log_h1("Place starting Support Points") log_side() } @@ -502,17 +492,17 @@ exports.action = function (state, player, action, arg) { // ============= GAME STATES ======================= -states.com_init = { +states.place_starting_infl = { inactive: 'place starting SPs.', prompt() { - if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { + if (game.temp === 4 && game.available_ops === 0 ) { view.prompt = 'Place starting SPs: done. Start Turn 1.'; gen_action("start"); } else if (game.available_ops === 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; - } else if (game.starting_infl.dem_starting_infl === 2) { + } else if (game.temp > 2) { view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` } else { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` @@ -526,63 +516,20 @@ states.com_init = { }, done() { do_log_summary() - game.starting_infl.com_starting_infl++ - if (game.starting_infl.com_starting_infl == 1){ - game.available_ops = 3 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 2) { - game.available_ops = 4 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 3) { - delete game.starting_infl - game.state = 'start_game' - } + game.temp ++ + game.available_ops = game.starting_infl[game.temp] + next_player() + valid_spaces_setup() }, start() { do_log_summary() + delete game.starting_infl new_turn() clear_undo() game.state = 'choose_card' } } -states.dem_init = { - inactive: 'place starting SPs.', - prompt() { - if (game.available_ops == 0) { - view.prompt = 'Place starting SPs: done.'; - gen_action("done"); - return; - } else if (game.starting_infl.com_starting_infl === 2) { - view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` - } else { - view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` - } - for (let space_id of game.valid_spaces) { - gen_action_space(space_id); - } - }, - space(space) { - add_infl(space, 'available_ops') - }, - done() { - do_log_summary() - game.starting_infl.dem_starting_infl++ - if (game.starting_infl.dem_starting_infl == 1){ - game.available_ops = 3 - } else if (game.starting_infl.dem_starting_infl == 2) { - game.available_ops = 2 - } - game.state = 'com_init' - valid_spaces_setup() - next_player() - } -} - states.choose_card = { inactive: 'choose a card.', prompt() { @@ -2350,26 +2297,22 @@ function do_sc(space) { } function valid_spaces_setup() { - let valid_spaces_set = new Set(); for (let i =0 ; i < spaces.length ; i++) { let space = spaces[i] - if (game.state === 'com_init') { + if (game.active === COM) { let infl = game.demInfl[i] if (infl === 0) { - valid_spaces_set.add(space.space_id); + game.valid_spaces.push(space.space_id); } - } else if (game.state === 'dem_init') { + } else { let infl = game.comInfl[i] if (infl === 0) { - valid_spaces_set.add(space.space_id); + game.valid_spaces.push(space.space_id); } } } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; } function valid_spaces_sc() { @@ -3672,10 +3615,10 @@ function reset_power() { game.power_struggle_discard = [] game.dem_pwr_hand = [] game.com_pwr_hand = [] - //game.phase = 1 - game.raised_stakes_round = 0 - game.raised_stakes = 0 - game.played_power_card = 0 + delete game.phase + delete game.raised_stakes_round + delete game.raised_stakes + delete game.played_power_card delete game.tactics_fails game.view_opp_hand = false @@ -5017,6 +4960,7 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true game.phase = 0 + game.raised_stakes_round = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -5163,7 +5107,6 @@ function vm_tank_column() { return } else if (game.dem_tst_position === 4 && game.com_tst_position < 4) { - console.log('in space 4 check') game.vm_event = 204 goto_vm(game.vm_event) return @@ -7037,7 +6980,6 @@ states.vm_shock_therapy = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('game.vm_active_country', game.vm_active_country) if (game.revolutions.every(n => n === false)) { view.prompt = 'Shock Therapy: no countries to choose.' gen_action('pass') -- cgit v1.2.3 From 74f6d1f269ef0eb5fb1cd616f6cb791d9041d756 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 12:32:48 +0000 Subject: Shorten game object --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 22e0975..d022769 100644 --- a/rules.js +++ b/rules.js @@ -3189,7 +3189,8 @@ function end_round() { game.remove_opponent_infl = false game.is_pwr_struggle = false game.vm_infl_to_do = false /*Can get rid of this and use game.return_state? */ - game.vm_event_to_do = false + delete game.vm_event_to_do + delete game.vm_infl_to_do delete game.vm_active_country game.return_state = '' game.discard = false -- cgit v1.2.3 From 051b5d19a9420a7c60db6c6e97cd165c32cecc49 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:27:15 +0000 Subject: Tidy up persistent events --- rules.js | 114 ++++++++++++++++++++++++--------------------------------------- 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/rules.js b/rules.js index d022769..c8ab1dc 100644 --- a/rules.js +++ b/rules.js @@ -252,8 +252,6 @@ exports.setup = function (seed, scenario, options) { return: '', vm: null, vm_event: 0, - vm_event_to_do: false, - vm_infl_to_do: false, played_card: 0, table_cards: [], @@ -1655,11 +1653,11 @@ states.end_turn_4_5_4 = { log('Communist player has a held scoring card') goto_game_over(DEM, `${DEM} won by held scoring card!`) } - else if (game.persistent_events.includes(104)) { + else if (game.persistent_events.includes(C_NEW_YEARS_EVE_PARTY)) { log_h1(`New Year's Eve Party`) game.vm_event = 104 //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } @@ -1674,7 +1672,7 @@ states.end_turn_4_5_4 = { log_h2('Final Scoring') //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } @@ -2861,6 +2859,13 @@ function get_aftermath_roll() { return modified_roll } +function add_to_persistent_events(card) { + game.persistent_events.push(card) + game.table_cards.push(card) + remove_from_discard(card) + log(`C${card} in effect`) +} + function permanently_remove(card) { if (game.strategy_removed.includes(card)) {return} remove_from_discard(card) @@ -3141,7 +3146,7 @@ function get_tst_6_ops() { function finish_the_wall() { if (game.the_wall_must_go['dem_wins'] === 2) { - game.persistent_events.push(86) + game.persistent_events.push(C_THE_WALL_MUST_GO) log('+3 VP') game.vp += 3 if (check_vp()) { @@ -3619,6 +3624,7 @@ function reset_power() { delete game.phase delete game.raised_stakes_round delete game.raised_stakes + delete game.raised_stakes_discard delete game.played_power_card delete game.tactics_fails game.view_opp_hand = false @@ -4493,8 +4499,7 @@ function vm_army_backs_revolution() { } function vm_austria_hungary_border_reopened() { - game.persistent_events.push(C_AUSTRIA_HUNGARY_BORDER_REOPENED) - permanently_remove(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4566,7 +4571,7 @@ function vm_civic_forum() { if (check_vp()) { return } - game.persistent_events.push(C_CIVIC_FORUM) + add_to_persistent_events(C_CIVIC_FORUM) if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { @@ -4628,12 +4633,12 @@ function vm_domino_theory() { } function vm_eco_glasnost() { - game.persistent_events.push(39) + add_to_persistent_events(C_ECO_GLASNOST) vm_next() } function vm_elena(){ - game.persistent_events.push(C_ELENA) + add_to_persistent_events(C_ELENA) vm_next() } @@ -4679,7 +4684,7 @@ function vm_foreign_currency_debt_burden() { if (check_vp()) { return } - game.persistent_events.push(C_FOREIGN_CURRENCY_DEBT_BURDEN) + add_to_persistent_events(C_FOREIGN_CURRENCY_DEBT_BURDEN) game.state = 'vm_foreign_currency_debt_burden' } @@ -4693,26 +4698,17 @@ function vm_foreign_television() { vm_next() } function vm_frg_embassies() { - game.persistent_events.push(C_FRG_EMBASSIES) - game.table_cards.push(C_FRG_EMBASSIES) - remove_from_discard(C_FRG_EMBASSIES) - log(`C${C_FRG_EMBASSIES} in effect`) + add_to_persistent_events(C_FRG_EMBASSIES) vm_next() } function vm_general_strike() { - game.persistent_events.push(C_GENERAL_STRIKE) - game.table_cards.push(C_GENERAL_STRIKE) - remove_from_discard(C_GENERAL_STRIKE) - log(`C${C_GENERAL_STRIKE} in effect`) + add_to_persistent_events(C_GENERAL_STRIKE) vm_next() } function vm_genscher() { - game.persistent_events.push(C_GENSCHER) - game.table_cards.push(C_GENSCHER) - remove_from_discard(C_GENSCHER) - log(`C${C_GENSCHER} in effect`) + add_to_persistent_events(C_GENSCHER) vm_next() } @@ -4746,8 +4742,7 @@ function vm_government_resigns() { } function vm_grenztruppen() { - game.persistent_events.push(C_GRENZTRUPPEN) - permanently_remove(C_GRENZTRUPPEN) + add_to_persistent_events(C_GRENZTRUPPEN) vm_next() } @@ -4769,12 +4764,12 @@ function vm_heal_our_bleeding_wounds() { } function vm_helsinki_final_act() { - game.persistent_events.push(C_HELSINKI_FINAL_ACT) + add_to_persistent_events(C_HELSINKI_FINAL_ACT) vm_next() } function vm_honecker() { - game.persistent_events.push(C_HONECKER) + add_to_persistent_events(C_HONECKER) game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -4854,7 +4849,7 @@ function vm_kremlin_coup() { } function vm_laszlo_tokes() { - game.persistent_events.push(C_LASZLO_TOKES) + add_to_persistent_events(C_LASZLO_TOKES) game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) game.state = 'vm_laszlo_tokes' } @@ -4875,13 +4870,12 @@ function vm_legacy_of_1968() { } function vm_li_peng() { - game.persistent_events.push(C_LI_PENG) - remove_from_discard(C_LI_PENG) + add_to_persistent_events(C_LI_PENG) vm_next() } function vm_ligachev() { - game.persistent_events.push(C_LIGACHEV) + add_to_persistent_events(C_LIGACHEV) vm_next() } @@ -4907,9 +4901,7 @@ function vm_nagy_reburied(){ } function vm_national_salvation_front() { - game.persistent_events.push(C_NATIONAL_SALVATION_FRONT) - game.table_cards.push(C_NATIONAL_SALVATION_FRONT) - remove_from_discard(C_NATIONAL_SALVATION_FRONT) + add_to_persistent_events(C_NATIONAL_SALVATION_FRONT) vm_next() } @@ -4933,17 +4925,12 @@ function vm_normalisation() { } function vm_peasant_parties_revolt() { - game.persistent_events.push(C_PEASANT_PARTIES_REVOLT) - log_msg_gap(`C${C_PEASANT_PARTIES_REVOLT} in effect`) - game.table_cards.push(C_PEASANT_PARTIES_REVOLT) - remove_from_discard(C_PEASANT_PARTIES_REVOLT) + add_to_persistent_events(C_PEASANT_PARTIES_REVOLT) vm_next() } function vm_perestroika() { - game.persistent_events.push(C_PERESTROIKA) - game.table_cards.push(C_PERESTROIKA) - log_msg_gap(`C${C_PERESTROIKA} in effect`) + add_to_persistent_events(C_PERESTROIKA) vm_next() } @@ -4961,7 +4948,9 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true game.phase = 0 + game.raised_stakes = 0 game.raised_stakes_round = 0 + game.raised_stakes_discard = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -4975,7 +4964,7 @@ function vm_power_struggle() { } function vm_presidential_visit() { - game.persistent_events.push(C_PRESIDENTIAL_VISIT) + add_to_persistent_events(C_PRESIDENTIAL_VISIT) log_msg_gap(`C${C_PRESIDENTIAL_VISIT} in effect`) vm_next() } @@ -5014,10 +5003,8 @@ function vm_reformer_rehabilitated () { } function vm_roundtable_talks() { - game.persistent_events.push(17) - game.table_cards.push(17) - remove_from_discard(17) - log_msg_gap('C17 in effect') + add_to_persistent_events(C_ROUNDTABLE_TALKS) + vm_next() } @@ -5047,8 +5034,7 @@ function vm_samizdat() { } function vm_securitate() { - game.persistent_events.push(C_SECURITATE) - permanently_remove(C_SECURITATE) + add_to_persistent_events(C_SECURITATE) vm_next() } @@ -5061,27 +5047,24 @@ function vm_social_democratic_platform_adopted() { } function vm_solidarity_legalised() { - log_msg_gap(`C2 in effect`) game.playable_cards.push(C_WALESA) - game.persistent_events.push(C_SOLIDARITY_LEGALIZED) + add_to_persistent_events(C_SOLIDARITY_LEGALIZED) vm_next() } function vm_st_nicholas_church () { - game.persistent_events.push(C_ST_NICHOLAS_CHURCH) + add_to_persistent_events(C_ST_NICHOLAS_CHURCH) game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { - log_msg_gap('C13 in effect') - game.table_cards.push(C_STASI) - game.persistent_events.push(C_STASI) + add_to_persistent_events(C_STASI) vm_next() } function vm_stand_fast() { - game.persistent_events.push(C_STAND_FASTd) + add_to_persistent_events(C_STAND_FAST) if (game.active === DEM) { game.stand_fast = DEM } else {game.stand_fast = COM} @@ -5128,10 +5111,7 @@ function vm_tank_column() { } function vm_tear_gas () { - game.persistent_events.push(C_TEAR_GAS) - game.table_cards.push(C_TEAR_GAS) - remove_from_discard(C_TEAR_GAS) - log_msg_gap(`C${C_TEAR_GAS} in effect`) + add_to_persistent_events(C_TEAR_GAS) vm_next() } @@ -5166,9 +5146,7 @@ function vm_the_monday_demonstrations() { } function vm_the_sinatra_doctrine() { - game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - game.table_cards.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) + add_to_persistent_events(C_THE_SINATRA_DOCTRINE) vm_next() } @@ -5201,8 +5179,7 @@ function vm_tyrant_block() { } function vm_the_wall () { - game.persistent_events.push(C_THE_WALL) - log_msg_gap('C9 in effect') + add_to_persistent_events(C_THE_WALL) vm_next() } @@ -5221,7 +5198,7 @@ function vm_warsaw_pact_summit() { function vm_we_are_the_people() { if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]} - game.persistent_events.push(C_WE_ARE_THE_PEOPLE) + add_to_persistent_events(C_WE_ARE_THE_PEOPLE) if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -5252,10 +5229,7 @@ function vm_workers_revolt() { } function vm_yakovlev_counsels_gorbachev() { - game.persistent_events.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - log_msg_gap(`C${C_YAKOVLEV_COUNSELS_GORBACHEV} in effect`) - game.table_cards.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - remove_from_discard(C_YAKOVLEV_COUNSELS_GORBACHEV) + add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) vm_next() } -- cgit v1.2.3 From 63ad1be3add6374185139d2798cb6d07dedb1c68 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:48:17 +0000 Subject: Improve log --- rules.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index c8ab1dc..2bc7fd2 100644 --- a/rules.js +++ b/rules.js @@ -2773,31 +2773,31 @@ function score_country(country) { log("No domination or control") log_gap(`Communist:`) if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) + logi(`Presence: -${value_presence} VP`) com_vp -= value_presence if (presence.com_battlegrounds > 0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } else { - log('No battlegrounds') + logi('No battlegrounds') } - log(`Total: ${com_vp} VP`) + logi(`Total: ${com_vp} VP`) } else { - log('No presence: 0 VP') + logi('No presence: 0 VP') } log_gap('Democrat:') if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) + logi(`Presence: +${value_presence} VP`) dem_vp += value_presence if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds } else { - log('No battlegrounds') + logi('No battlegrounds') } - log(`Total: +${dem_vp} VP`) + logi(`Total: +${dem_vp} VP`) } else { - log('No presence: 0 VP') + logi('No presence: 0 VP') } } @@ -2805,9 +2805,9 @@ function score_country(country) { let change_vp = dem_vp + com_vp game.vp += change_vp if (change_vp > 0 ) { - log_gap(`Final change VP: +${change_vp} VP`) + log_gap(`Scoring: +${change_vp} VP`) } else { - log_gap(`Final change VP: ${change_vp} VP`) + log_gap(`Scoring: ${change_vp} VP`) } } @@ -5864,6 +5864,7 @@ states.vm_brought_in_for_questioning = { } goto_vm(game.vm_event) } else { + log('Event does not occur') game.return = DEM vm_return() } -- cgit v1.2.3 From 59dc05f266a3e6ee4e13fe7c06059258ee62fad6 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:51:20 +0000 Subject: Don't permanently remove events now played to table --- rules.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rules.js b/rules.js index 2bc7fd2..13aaa53 100644 --- a/rules.js +++ b/rules.js @@ -8127,7 +8127,6 @@ CODE[48] = [ // We are the People!* ] CODE[49] = [ // Foreign Currency Debt Burden* - [ vm_permanently_remove ], [ vm_foreign_currency_debt_burden ], [ vm_return ], ] @@ -8522,13 +8521,11 @@ CODE[99] = [ // Ligachev* ] CODE[100] = [ // 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, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], @@ -8598,7 +8595,6 @@ CODE[107] = [ // Massacre in Timisoara* ] CODE[108] = [ // Army Backs Revolution* - [ vm_permanently_remove ], [ vm_army_backs_revolution ], [ vm_return ], ] -- cgit v1.2.3 From 5c373ae78fd9f0f0948412f153ab3a09ee5b8d49 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:52:21 +0000 Subject: Don't permanently remove events now played to table --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index 13aaa53..25a2f4b 100644 --- a/rules.js +++ b/rules.js @@ -8155,7 +8155,6 @@ CODE[52] = [ // Normalisation ] CODE[53] = [ // Li Peng* - [ vm_permanently_remove ], [ vm_li_peng ], [ vm_return ], ] -- cgit v1.2.3 From 102d457b47c56aaaf1a81e3390db6c602b8b7609 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 14:17:34 +0000 Subject: Fix new remove influence state --- rules.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 25a2f4b..a7a462c 100644 --- a/rules.js +++ b/rules.js @@ -2126,7 +2126,7 @@ function remove_infl(space, ops) { check_tyrant() } game[ops]-- - if (game.vm_influence_added && game.vm_influence_added[space]) {game.vm_influence_added[space]++} + if (game.vm_influence_added && game.vm_influence_added[space] >= 0) {game.vm_influence_added[space]++} if (game[ops]===0) {game.valid_spaces = []} } @@ -8285,7 +8285,6 @@ CODE[72] = [ // Peasant Parties Revolt ] CODE[73] = [ // Laszlo Tokes* - [ vm_permanently_remove ], [ vm_valid_spaces, 'Timisoara', 'Harghita/Covasna' ], [ vm_prompt, 'in Timisoara and Harghita/Covasna' ], [ vm_add_limited_infl, 2, 1 ], -- cgit v1.2.3 From 7b10f6e1f438fd29057222f0dfbefb01f9b3fc71 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 14:37:42 +0000 Subject: Fix persistent events being permanently removed --- events.txt | 9 --------- rules.js | 8 +++----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/events.txt b/events.txt index 637f6c7..4f0158f 100644 --- a/events.txt +++ b/events.txt @@ -362,13 +362,11 @@ remove_all_infl 1 CARD 48 - We are the People!* # The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig. -permanently_remove we_are_the_people CARD 49 - Foreign Currency Debt Burden* # The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country. -permanently_remove foreign_currency_debt_burden @@ -397,7 +395,6 @@ remove_all_infl 2 CARD 53 - Li Peng* # +1 modifier to all Communist Tiananmen Square track attempts for the rest of the game -permanently_remove li_peng @@ -528,7 +525,6 @@ peasant_parties_revolt CARD 73 - Laszlo Tokes* # Place 1 Democratic SP in Timisoara and Harghita/Covasna. The Democratic may then place SPs or make Support Check rolls in Romania using the Ops value of this card. Allows play of Massacre in Timisoara. -permanently_remove valid_spaces 'Timisoara', 'Harghita/Covasna' prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 @@ -614,7 +610,6 @@ remove_opp_infl 2 CARD 83 - Modrow* # Roll a die. If the die roll exceeds the number of Democratically controlled spaces in Germany, then place 4 Communist SPs in Germany, no more than 2 per space. -permanently_remove modrow valid_spaces_country 'East_Germany' prompt 'East Germany, no more than 2 per space' @@ -672,7 +667,6 @@ domino_theory CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. -permanently_remove valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 @@ -766,13 +760,11 @@ ligachev CARD 100 - Stand Fast* # -1 to opponent Support Checks in spaces you control for the rest of this turn. -permanently_remove stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -permanently_remove if !game.the_tyrant_is_gone valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' @@ -842,7 +834,6 @@ endif CARD 108 - Army Backs Revolution* # Place in front of the Democratic Player. Cancels effects of Securitate* event. -permanently_remove army_backs_revolution diff --git a/rules.js b/rules.js index a7a462c..05d1365 100644 --- a/rules.js +++ b/rules.js @@ -4890,6 +4890,7 @@ function vm_massacre_in_timisoara() { function vm_modrow() { game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER) + add_to_persistent_events(C_MODROW) game.state = 'vm_modrow' } @@ -7756,7 +7757,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ -// BEGIN EVENTS {{{ +// #region GENERATED EVENT CODE const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -8121,7 +8122,6 @@ CODE[47] = [ // Bulgarian Turks Expelled* ] CODE[48] = [ // We are the People!* - [ vm_permanently_remove ], [ vm_we_are_the_people ], [ vm_return ], ] @@ -8370,7 +8370,6 @@ CODE[82] = [ // Spitzel* ] CODE[83] = [ // Modrow* - [ vm_permanently_remove ], [ vm_modrow ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, 'East Germany, no more than 2 per space' ], @@ -8425,7 +8424,6 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* - [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -8650,4 +8648,4 @@ CODE[351] = [ // Scare Tactics [ vm_remove_opp_infl, 1 ], [ vm_return ], ] -// END EVENTS }}} +// #endregion -- cgit v1.2.3 From 8c35d6f14ca93044afa3ded1c687c8834eb20b69 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:09:12 +0000 Subject: More tweaks to permanently remove --- events.txt | 1 - rules.js | 36 +++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/events.txt b/events.txt index 4f0158f..0cccd73 100644 --- a/events.txt +++ b/events.txt @@ -472,7 +472,6 @@ add_limited_infl 11 1 CARD 65 - Presidential Visit* # The Communist's hand size is reduced to 7 next turn. -permanently_remove presidential_visit diff --git a/rules.js b/rules.js index 05d1365..9d5fb0d 100644 --- a/rules.js +++ b/rules.js @@ -1803,7 +1803,7 @@ states.general_strike = { if (total > 5) { log('The strike is over.') - permanently_remove(5) + permanently_remove(C_GENERAL_STRIKE) game.persistent_events = game.persistent_events.filter(n => n !== 5) } else { log('The strike continues. Required 6 or more') @@ -2374,14 +2374,14 @@ function valid_spaces_infl() { for (let i = 0; i < game.demInfl.length; i++) { let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; - + // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - if (adj_space_id) { + if (adj_space_id >= 0) { const adj_piece = spaces[adj_space_id]; // Check if the adjacent space is controlled by the opponent @@ -2391,9 +2391,9 @@ function valid_spaces_infl() { if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(C_GENSCHER)){ valid_spaces_set.add(adj_piece.space_id) } - + // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent - if (ops >= 2 || !opponent_control) { + if (ops >= 2 || !opponent_control) { valid_spaces_set.add(adj_piece.space_id) } } @@ -2867,9 +2867,9 @@ function add_to_persistent_events(card) { } function permanently_remove(card) { - if (game.strategy_removed.includes(card)) {return} + discard_from_table(card) remove_from_discard(card) - + if (game.strategy_removed.includes(card)) {return} let card_index = game.table_cards.indexOf(card) if (card_index !== -1) { game.table_cards.splice(card_index, 1) @@ -3405,7 +3405,8 @@ function new_turn() { if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 log('Communist draws 7 cards due to C65') - game.persistent_events = game.persistent_events.filter(n => n !== C_PRESIDENTIAL_VISIT) + permanently_remove(C_PRESIDENTIAL_VISIT) + game.persistent_events = game.persistent_events.filter( card => card !== C_PRESIDENTIAL_VISIT) } draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) game.com_hand_limit = 8 @@ -3596,8 +3597,9 @@ function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) if (find_card !== -1) { game.table_cards.splice(find_card, 1) - if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { - game.strategy_removed.push(card) + if (cards[card].remove === 1) { + if (!game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) } } else {game.strategy_discard.push(card) } } } @@ -4031,6 +4033,16 @@ function vm_valid_spaces() { vm_next(); } +function vm_valid_spaces_com() { + let operand = vm_operand(1) + let space = spaces.find(space => space.ascii_name === operand) + if (game.comInfl[space.space_id] >0) { + game.valid_spaces.push(space.space_id) + } + check_systematization(); + vm_next(); +} + function vm_valid_spaces_opponent () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { @@ -8232,7 +8244,6 @@ CODE[64] = [ // Legacy of 1968* ] CODE[65] = [ // Presidential Visit* - [ vm_permanently_remove ], [ vm_presidential_visit ], [ vm_return ], ] @@ -8488,7 +8499,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_valid_spaces_com, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8511,7 +8522,6 @@ CODE[98] = [ // Politburo Intrigue* ] CODE[99] = [ // Ligachev* - [ vm_permanently_remove ], [ vm_ligachev ], [ vm_return ], ] -- cgit v1.2.3 From 2f06b63bf6a38f33161fbdb9513077c12e1e7cbc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:15:20 +0000 Subject: Fix Gorby after Breakaway Baltic republics --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9d5fb0d..142002f 100644 --- a/rules.js +++ b/rules.js @@ -585,6 +585,7 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { + console.log('game.playable_cards', game.playable_cards) view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` if (scoring_cards.includes(game.played_card)) { @@ -3032,7 +3033,7 @@ function event_is_playable(card) { if (card === C_REFORMER_REHABILITATED) { return false } - //Check for Common European Hmme under Stasi + //Check for Common European Home under Stasi else if (game.stasi_card === C_COMMON_EUROPEAN_HOME && card === C_COMMON_EUROPEAN_HOME && game.active === DEM) { return false } @@ -3040,6 +3041,11 @@ function event_is_playable(card) { else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } + + //Check for Gorbachev Charms the West after Breakaway Baltic Republics + else if (card === C_GORBACHEV_CHARMS_THE_WEST && !game.playable_cards.includes(C_GORBACHEV_CHARMS_THE_WEST)) { + return false + } //Then check normally else if (cards[card].playable) { return true -- cgit v1.2.3 From 23ca7e8de0d66aa9ac65980fa016a7a94cfde7e5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:30:15 +0000 Subject: Fix the Tyrant is gone --- rules.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 142002f..56e31cb 100644 --- a/rules.js +++ b/rules.js @@ -585,7 +585,6 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { - console.log('game.playable_cards', game.playable_cards) view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` if (scoring_cards.includes(game.played_card)) { @@ -3652,14 +3651,14 @@ function reset_power() { } function check_tyrant() { - if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { + if (game.the_tyrant_is_gone > 0 && game.the_tyrant_is_gone !== 111 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 if (check_vp()) { return } game.persistent_events = game.persistent_events.filter(n => n !== C_THE_TYRANT_IS_GONE) - delete game.the_tyrant_is_gone + game.the_tyrant_is_gone = 111 } } -- cgit v1.2.3 From f9512f66f3fbca1fb3f92549588e84f410deb77a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:35:05 +0000 Subject: Fix Malta Summit when at max stability track --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 56e31cb..50df92b 100644 --- a/rules.js +++ b/rules.js @@ -6732,8 +6732,8 @@ states.vm_malta_summit = { let roll = roll_d6() log(`Roll: D${roll}`) if (game.stability > 0) { - logi(`+${game.stability} from USSR Stability Track`) - log(`Modified roll: ${roll + game.stability}`) + logi(`+${Math.min(game.stability, 3)} from USSR Stability Track`) + log(`Modified roll: ${roll + Math.min(game.stability, 3)}`) } if (roll + game.stability > 3) { log('Summit successful') -- cgit v1.2.3 From 859c41f4e1c6682f07e2ee5f16899e8dadf161f9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:09:44 +0000 Subject: Remove table cards --- rules.js | 76 ++++++++++++++++++---------------------------------------------- 1 file changed, 21 insertions(+), 55 deletions(-) diff --git a/rules.js b/rules.js index 50df92b..40d58b3 100644 --- a/rules.js +++ b/rules.js @@ -225,6 +225,7 @@ const switch_events = [6, 20, 71] const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 +const THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED = 540 // COUNTRY CONSTANTS @@ -254,7 +255,6 @@ exports.setup = function (seed, scenario, options) { vm_event: 0, played_card: 0, - table_cards: [], available_ops: 0, vm_available_ops: 0, valid_spaces: [], @@ -340,7 +340,6 @@ exports.view = function(state, player) { actions: null, played_card: game.played_card, - table_cards: game.table_cards, valid_spaces: game.valid_spaces, valid_cards: game.valid_cards, @@ -1040,7 +1039,6 @@ states.draw_power_cards = { log(`Democrat receives 2 cards from Communist due to C${C_ROUNDTABLE_TALKS}`) game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 - discard_from_table(C_ROUNDTABLE_TALKS) game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) } @@ -1081,13 +1079,13 @@ states.draw_power_cards = { log(`Democrat: ${game.dem_pwr_hand.length} cards`) //Check if The Crowd Turns Against Ceausescu occurs - if (game.table_cards.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && game.pwr_struggle_in === 'Romania') { + if (game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && !game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) && game.pwr_struggle_in === 'Romania') { if (game.active === COM) { game.return = COM next_player() } log_h3(`C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU}`) - game.persistent_events.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + game.persistent_events.push(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) game.state = 'the_crowd_turns_against_ceausescu_prep' } else { log_h2('Raise the Stakes') @@ -1428,18 +1426,7 @@ states.power_struggle = { game.phase = 1 next_player() do_valid_cards() - }, - /*done () { - if (game.phase === 7) { - game.phase = 0 - log_msg_gap('Takes initiative') - do_valid_cards() - } else { - game.phase = 0 - next_player() - do_valid_cards() - } - }*/ + } } states.support_loss ={ @@ -1532,7 +1519,9 @@ states.vp_roll = { score_country(game.pwr_struggle_in) //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { + game.persistent_events = game.persistent_events.filter (c => c !== C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + game.persistent_events = game.persistent_events.filter (c => c !== THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) game.return_state = 'finish_scoring' if (game.active !== DEM) { next_player() @@ -1572,7 +1561,7 @@ states.choose_power = { score_country(game.pwr_struggle_in) //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { game.return_state = 'finish_scoring' if (game.active !== DEM) { next_player() @@ -1599,7 +1588,7 @@ states.the_tyrant_is_gone ={ } else { game.return = DEM } - log_h3(`C97`) + log_h3(`C${C_THE_TYRANT_IS_GONE}`) game.vm_event = C_THE_TYRANT_IS_GONE goto_vm(game.vm_event) } @@ -2861,20 +2850,15 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) - game.table_cards.push(card) remove_from_discard(card) log(`C${card} in effect`) } function permanently_remove(card) { - discard_from_table(card) remove_from_discard(card) - if (game.strategy_removed.includes(card)) {return} - let card_index = game.table_cards.indexOf(card) - if (card_index !== -1) { - game.table_cards.splice(card_index, 1) + if (!game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) } - game.strategy_removed.push(card) } function check_vp() { @@ -3186,8 +3170,8 @@ function end_round() { if (game.state === 'game_over') { return} - //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. - if (!game.strategy_removed.includes(game.played_card) && !game.table_cards.includes(game.played_card) && game.played_card > 0) { + //Check if the card needs to be discarded. + if (!game.strategy_removed.includes(game.played_card) && game.played_card > 0) { game.strategy_discard.push(game.played_card) } @@ -3213,9 +3197,9 @@ function end_round() { // Check for duplicate card entries let card_check if (game.samizdat_card > 0) { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; } else { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand]; + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand]; } function check_duplicates(array) { @@ -3227,12 +3211,12 @@ function end_round() { return [...new Set(duplicates)]; } - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) if (check_duplicates(card_check)) { console.log('card check', card_check) const duplicates = find_duplicates(card_check) - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) } //console.log('cards in game', card_check.length) @@ -3445,7 +3429,6 @@ function new_turn() { function end_one_turn_event(event) { game.persistent_events = game.persistent_events.filter(n => n !== event) - discard_from_table(event) log_summary(`C${event}`) } @@ -3598,17 +3581,6 @@ function discard_card(hand) { return discarded_card } -function discard_from_table(card) { - let find_card = game.table_cards.indexOf(card) - if (find_card !== -1) { - game.table_cards.splice(find_card, 1) - if (cards[card].remove === 1) { - if (!game.strategy_removed.includes(card)) { - game.strategy_removed.push(card) } - } else {game.strategy_discard.push(card) } - } -} - function add_midyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 2) @@ -3644,7 +3616,6 @@ function reset_power() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) } else if (game.persistent_events.includes(e)) { permanently_remove(e) - game.table_cards = game.table_cards.filter(card => card !== e) game.persistent_events = game.persistent_events.filter(n => n !== e) } } @@ -4511,7 +4482,7 @@ function vm_adamec() { function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) - game.table_cards.push(C_ARMY_BACKS_REVOLUTION) + add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) vm_next() } @@ -5012,7 +4983,6 @@ function vm_reformer_rehabilitated () { for (let card of game.strategy_discard) { if (!event_is_playable(card)) continue if (card === game.played_card) continue - if (game.table_cards.includes(card)) continue if (scoring_cards.includes(card)) continue game.valid_cards.push(card) @@ -5022,7 +4992,6 @@ function vm_reformer_rehabilitated () { function vm_roundtable_talks() { add_to_persistent_events(C_ROUNDTABLE_TALKS) - vm_next() } @@ -5151,8 +5120,7 @@ function vm_the_chinese_solution() { } function vm_the_crowd_turns_against_ceausescu() { - game.table_cards.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - remove_from_discard(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5186,8 +5154,7 @@ function vm_the_tyrant_is_gone() { } function vm_the_tyrant_is_gone_prep() { - game.table_cards.push(C_THE_TYRANT_IS_GONE) - remove_from_discard(C_THE_TYRANT_IS_GONE) + add_to_persistent_events(C_THE_TYRANT_IS_GONE) vm_next() } @@ -7238,7 +7205,6 @@ 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(C_THE_TYRANT_IS_GONE) }, done () { vm_next() @@ -8503,7 +8469,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], [ vm_valid_spaces_com, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], -- cgit v1.2.3 From 61bf91de549df935c4cfac0ba9173e1fd7dbeb5d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:10:05 +0000 Subject: Fix Ligachev --- events.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/events.txt b/events.txt index 0cccd73..827524b 100644 --- a/events.txt +++ b/events.txt @@ -753,7 +753,6 @@ prompt 'make a support check in Bulgaria' CARD 99 - Ligachev* # -3 VP if the Democrat does not play Gorbachev Charms the West for the event his next action round. -3 VPs take effect as soon as the Democrat plays his card but before the effect of the Democrat's card takes place. -permanently_remove ligachev -- cgit v1.2.3 From 0a935628e0b952615058493c3f317bb804de5169 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:22:18 +0000 Subject: Tidy up TST Award logging --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 40d58b3..4275ee8 100644 --- a/rules.js +++ b/rules.js @@ -3403,7 +3403,7 @@ function new_turn() { //Check if TST effects need to be resolved if ((game.dem_tst_position >=5 && game.com_tst_position <= 4) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4)) { - log_h2('Tiananmen Square Track award') + log_h2('Tiananmen Square Track Award') if ((game.dem_tst_position >= 5 && game.com_tst_position <= 4 && game.active !== DEM) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4 && game.active !== COM)) { next_player() -- cgit v1.2.3 From b126d10c7e6044d55924f66c8e60c873898284c1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:22:43 +0000 Subject: Tidy up TST Award logging --- rules.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index 4275ee8..ce9fc11 100644 --- a/rules.js +++ b/rules.js @@ -3247,7 +3247,6 @@ function end_round() { return } else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') if (game.active !== DEM) { next_player() } @@ -3257,7 +3256,6 @@ function end_round() { goto_vm(206) return } else if (game.com_tst_position >= 6 && game.dem_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') if (game.active !== COM) { next_player() } @@ -5236,18 +5234,18 @@ function discarded_card() { // =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== function vm_tst_3() { - log_gap('Tiananmen Square Track award') + log_gap('Tiananmen Square Track Award') game.state = 'vm_tst_3_prep' } function vm_tst_4() { - log_gap('Tiananmen Square Track award') + log_gap('Tiananmen Square Track Award') game.vm_available_ops = 2 game.remove_opponent_infl = true game.state = 'vm_tst_4' } function vm_tst_6() { - log_h3('Tiananmen Square Track award') + log_h3('Tiananmen Square Track Award') game.vm_available_ops = 1 game.temp = 1 //Set temp to 1, so that Card 1 is called during the support check, which has 2 ops game.state = 'vm_tst_6' -- cgit v1.2.3 From 671fe0aba81c3b81189f15bd2a1a440b7d75ebeb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:26:57 +0000 Subject: Reposition Tyrant is Gone --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index c4e139f..6099ece 100644 --- a/play.js +++ b/play.js @@ -598,7 +598,7 @@ function on_update() { if (view.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" - ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 25 + "px" + ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" } else { ui.events[C_THE_TYRANT_IS_GONE].style.display = "none" } -- cgit v1.2.3 From cad6d1d612b3175b472864e73adbb4757c020fec Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:39:02 +0000 Subject: Don't permanently remove eco-glasnost --- events.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/events.txt b/events.txt index 827524b..de4a3b4 100644 --- a/events.txt +++ b/events.txt @@ -278,7 +278,6 @@ add_infl_free 3 CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. -permanently_remove valid_spaces 'Ruse' prompt 'Ruse' add_x_infl 4 -- cgit v1.2.3 From 10f3686689682ca788d6900520868ab51eae6c7e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:39:51 +0000 Subject: Don't permanently remove eco-glasnost --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index ce9fc11..53166de 100644 --- a/rules.js +++ b/rules.js @@ -8019,7 +8019,6 @@ CODE[38] = [ // July Concept ] CODE[39] = [ // Eco-Glasnost* - [ vm_permanently_remove ], [ vm_valid_spaces, 'Ruse' ], [ vm_prompt, 'Ruse' ], [ vm_add_x_infl, 4 ], -- cgit v1.2.3 From 5bed0a2b0e502886ec582135d5736ac58c077995 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:46:39 +0000 Subject: Fix end of round discarding --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 53166de..b437f6c 100644 --- a/rules.js +++ b/rules.js @@ -3171,7 +3171,8 @@ function end_round() { return} //Check if the card needs to be discarded. - if (!game.strategy_removed.includes(game.played_card) && game.played_card > 0) { + let discard_check = [...game.strategy_removed, ...game.persistent_events] + if (!discard_check.includes(game.played_card) && game.played_card > 0) { game.strategy_discard.push(game.played_card) } -- cgit v1.2.3 From 7a9bb9defa7a1652ce0d337325718a137a86fc30 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:53:46 +0000 Subject: More table cards tidying --- rules.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/rules.js b/rules.js index b437f6c..4c3d26a 100644 --- a/rules.js +++ b/rules.js @@ -7754,7 +7754,6 @@ CODE[1] = [ // Legacy of Martial Law* ] 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' ], @@ -7905,7 +7904,6 @@ CODE[23] = [ // Power Struggle - Hungary ] CODE[24] = [ // St Nicolas Church - [ vm_permanently_remove ], [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], @@ -7919,7 +7917,6 @@ CODE[25] = [ // Perestroika ] CODE[26] = [ // Helsinki Final Act* - [ vm_permanently_remove ], [ vm_helsinki_final_act ], [ vm_return ], ] -- cgit v1.2.3 From 7464c8c7d1c89e6b47051583ab6dc91a25eeb474 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:56:56 +0000 Subject: More table cards tidying --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index 4c3d26a..8c8a753 100644 --- a/rules.js +++ b/rules.js @@ -7803,7 +7803,6 @@ CODE[8] = [ // Prudence ] CODE[9] = [ // The Wall* - [ vm_permanently_remove ], [ vm_the_wall ], [ vm_return ], ] -- cgit v1.2.3 From f152a7f88fe5d8b7d28e792f98dea96f3f7e4eae Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 23:02:58 +0000 Subject: More table cards tidying --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 8c8a753..dff42c5 100644 --- a/rules.js +++ b/rules.js @@ -3428,6 +3428,7 @@ function new_turn() { function end_one_turn_event(event) { game.persistent_events = game.persistent_events.filter(n => n !== event) + game.strategy_removed.push(event) log_summary(`C${event}`) } @@ -7849,7 +7850,6 @@ CODE[14] = [ // Gorbachev Charms the West ] CODE[15] = [ // Honecker - [ vm_permanently_remove ], [ vm_honecker ], [ vm_return ], ] -- cgit v1.2.3 From ac1d0084681864a652a462acb79a82fa2ab5529f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 23:17:09 +0000 Subject: More table cards tidying --- events.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/events.txt b/events.txt index de4a3b4..4176519 100644 --- a/events.txt +++ b/events.txt @@ -12,7 +12,6 @@ prompt 'make a Support Check in Poland' CARD 2 - Solidarity Legalised* # Place a Democratic SP in every uncontrolled Worker and Farmer space in Poland. Allows play of Walesa. -permanently_remove solidarity_legalised valid_spaces_solidarity_legalised prompt 'to every uncontrolled Worker and Farmer space in Poland' @@ -62,7 +61,6 @@ prudence CARD 9 - The Wall* # Place in front of the Communist Player. In his next Support Check in Germany cancel drm for any adjacent spaces controlled by the Democratic Player. -permanently_remove the_wall @@ -109,7 +107,6 @@ prompt 'select a space for the Support Check' CARD 15 - Honecker # The Communist Player may take any non-Power Struggle - card in the discard pile and put it in his hand. The Communist Player may take one extra action round this turn. May not be played as event after Modrow*. -permanently_remove honecker @@ -163,7 +160,6 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. -permanently_remove valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 @@ -177,7 +173,6 @@ perestroika CARD 26 - Helsinki Final Act* # +1 VP for every Support Check die roll by the Communist Player in Student or Intellectual spaces the rest of the game. -permanently_remove helsinki_final_act -- cgit v1.2.3 From 4beb59206e3471ba971d1974d15d0a8c8b56d7c7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Oct 2024 12:24:57 +0100 Subject: Remove card asterisk in sub_card_name instead of all asterisks. --- play.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/play.js b/play.js index 6099ece..73357fe 100644 --- a/play.js +++ b/play.js @@ -742,7 +742,7 @@ function on_update() { function sub_card_name(_match, p1) { let x = p1 | 0 - return `${cards[x].name}` + return `${cards[x].name.replace("*", "")}` } function sub_power_card_name(_match, p1) { @@ -806,7 +806,6 @@ function on_log(text) { p.className = "h3" } - text = text.replace(/([a-zA-Z])\*/g, "$1") p.innerHTML = text return p } -- cgit v1.2.3 From 1640855336f524cf44f61571b0bb25c10f70c34b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Nov 2024 00:13:34 +0100 Subject: stack influence markers to go above 8 --- play.css | 1 + play.js | 50 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/play.css b/play.css index 8b8d19f..f2113ed 100644 --- a/play.css +++ b/play.css @@ -266,6 +266,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } } .power_card { + background-color: #093a5b; width: 188px; height: 263px; border-radius: 12px; diff --git a/play.js b/play.js index 73357fe..aa7a8b6 100644 --- a/play.js +++ b/play.js @@ -395,11 +395,16 @@ function create_country(id, name) { document.getElementById("markers").appendChild(e) } +const INF_DX = 35 +const INF_DY = 10 + function create_ui() { ui.layout_xy = [] ui.spaces = [] ui.dem_inf = [] ui.com_inf = [] + ui.dem_inf2 = [] + ui.com_inf2 = [] for (let s = 0; s <= last_space; ++s) { let info = spaces[s] @@ -428,15 +433,29 @@ function create_ui() { com_e.style.top = yc + 12 - 25 + "px" ui.com_inf[s] = com_e + let com_e2 = document.createElement("div") + com_e2.className = "marker comInfl hide" + com_e2.style.left = xc + 32 - 25 + INF_DX + "px" + com_e2.style.top = yc + 12 - 25 + INF_DY + "px" + ui.com_inf2[s] = com_e2 + let dem_e = document.createElement("div") dem_e.className = "marker demInfl hide" dem_e.style.left = xc - 32 - 25 + "px" dem_e.style.top = yc + 12 - 25 + "px" ui.dem_inf[s] = dem_e + let dem_e2 = document.createElement("div") + dem_e2.className = "marker demInfl hide" + dem_e2.style.left = xc - 32 - 25 - INF_DX + "px" + dem_e2.style.top = yc + 12 - 25 + INF_DY + "px" + ui.dem_inf2[s] = dem_e2 + document.getElementById("spaces").append(space_e) document.getElementById("markers").appendChild(com_e) + document.getElementById("markers").appendChild(com_e2) document.getElementById("markers").appendChild(dem_e) + document.getElementById("markers").appendChild(dem_e2) } ui.cards = [] @@ -550,6 +569,21 @@ function layout_country(id) { } } +function layout_inf_markers(cn, one, two, v, ctl) { + if (ctl) + cn += " ctl" + if (v > 8) { + one.className = cn + " v" + 8 + two.className = cn + " v" + (v - 8) + } else if (v > 0) { + one.className = cn + " v" + v + two.className = "hide" + } else { + one.className = "hide" + two.className = "hide" + } +} + function on_update() { if (!ui.spaces) create_ui() @@ -615,20 +649,8 @@ function on_update() { for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] - - if (demInfl - comInfl >= spaces[s].stability) - ui.dem_inf[s].className = "marker demInfl ctl v" + demInfl - else if (demInfl > 0) - ui.dem_inf[s].className = "marker demInfl v" + demInfl - else - ui.dem_inf[s].className = "marker demInfl hide" - - if (comInfl - demInfl >= spaces[s].stability) - ui.com_inf[s].className = "marker comInfl ctl v" + comInfl - else if (comInfl > 0) - ui.com_inf[s].className = "marker comInfl v" + comInfl - else - ui.com_inf[s].className = "marker comInfl hide" + layout_inf_markers("marker demInfl", ui.dem_inf[s], ui.dem_inf2[s], demInfl, demInfl - comInfl >= spaces[s].stability) + layout_inf_markers("marker comInfl", ui.com_inf[s], ui.com_inf2[s], comInfl, comInfl - demInfl >= spaces[s].stability) } // UPDATE COUNTRY MARKERS -- cgit v1.2.3 From 64fa63421fb188db9c23c244ef6b81335cb10752 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:05:47 +0000 Subject: Updates to Table Cards and cleanup --- events.txt | 3 --- rules.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/events.txt b/events.txt index eaf585d..637f6c7 100644 --- a/events.txt +++ b/events.txt @@ -95,7 +95,6 @@ add_infl_free 3 CARD 13 - Stasi # For the rest this turn the Democratic Player must reveal the card he will play this action round before the Communist plays his card. -permanently_remove stasi @@ -173,7 +172,6 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. -permanently_remove perestroika @@ -376,7 +374,6 @@ foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -permanently_remove the_sinatra_doctrine diff --git a/rules.js b/rules.js index 54cfd26..0593375 100644 --- a/rules.js +++ b/rules.js @@ -222,6 +222,7 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] 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] +const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 @@ -3752,7 +3753,27 @@ function new_turn() { delete game.selected_space //Remove events that only last one turn - game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + + for (let e of one_turn_events) { + if (game.persistent_events.includes(e)) { + end_one_turn_event(e) + } + } + if (game.prudence) { + delete game.prudence + log_summary(`C${8}`) + } + if (game.summary.length > 0) { + log('No longer in effect:') + pop_summary_i() + log_br() + } + delete game.stasi_card + delete game.stand_fast + +/* TODO: Add log for events no longer in effect */ + + /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) @@ -3795,12 +3816,18 @@ function new_turn() { discard_from_table(63) permanently_remove(63) } + //Stasi + if (game.persistent_events.includes(C_STASI)) { + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + discard_from_table(C_STASI) + log(`C${C_STASI} no longer in effect`) + } //Stand Fast if (game.persistent_events.includes(100)) { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - } + }*/ if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) @@ -3857,6 +3884,12 @@ function new_turn() { } } +function end_one_turn_event(event) { + game.persistent_events = game.persistent_events.filter(n => n !== event) + discard_from_table(event) + log_summary(`C${event}`) +} + function next_player() { clear_undo() if (game.active === DEM) @@ -4020,8 +4053,12 @@ function discard_card(hand) { function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(card) + if (find_card !== -1) { + game.table_cards.splice(find_card, 1) + if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) + } else {game.strategy_discard.push(card) } + } } @@ -4214,6 +4251,19 @@ function pop_summary() { game.summary = [] } +function pop_summary_i() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + logi(msg.replace("£ SP", `${n} SPs`)); + } else { + logi(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) @@ -5556,8 +5606,9 @@ function vm_peasant_parties_revolt() { } function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') + game.persistent_events.push(C_PERESTROIKA) + game.table_cards.push(C_PERESTROIKA) + log_msg_gap(`C${C_PERESTROIKA} in effect`) vm_next() } @@ -5687,6 +5738,7 @@ function vm_st_nicholas_church () { function vm_stasi() { log_msg_gap('C13 in effect') + game.table_cards.push(C_STASI) game.persistent_events.push(C_STASI) vm_next() } @@ -5754,7 +5806,8 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap('C50 in effect') + game.table_cards.push(C_THE_SINATRA_DOCTRINE) + log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) vm_next() } @@ -8537,7 +8590,6 @@ CODE[12] = [ // Apparatchicks ] CODE[13] = [ // Stasi - [ vm_permanently_remove ], [ vm_stasi ], [ vm_return ], ] @@ -8615,7 +8667,6 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika - [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] @@ -8818,7 +8869,6 @@ CODE[49] = [ // Foreign Currency Debt Burden* ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_permanently_remove ], [ vm_the_sinatra_doctrine ], [ vm_return ], ] -- cgit v1.2.3 From b0d937bc128b17aa90fb441c7ff35876c605300b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:25:25 +0000 Subject: Offset overlay markers --- play.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/play.html b/play.html index 59974f4..2601222 100644 --- a/play.html +++ b/play.html @@ -71,6 +71,7 @@
    +
    Power Struggle Hand
    @@ -86,6 +87,7 @@
    +
    Hand
    -- cgit v1.2.3 From 3475bfc74ab6ed8c8c387a77ed58450dc3ef393d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:30:55 +0000 Subject: Tor updates --- play.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/play.html b/play.html index 2601222..f36d2dd 100644 --- a/play.html +++ b/play.html @@ -66,6 +66,13 @@
    + +
    +
    Cards on the Table
    +
    +
    + +
    Played Card
    -- cgit v1.2.3 From 0e852be2acf9062eb77e3c60349e8837a3682076 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:46:35 +0000 Subject: Fix log for Honecker --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 0593375..8541df9 100644 --- a/rules.js +++ b/rules.js @@ -2184,6 +2184,8 @@ states.honecker ={ extra() { push_undo() game.round++ + log(`Communist chooses to take an extra Action Round due to C${C_HONECKER}`) + log_h2(`Action Round ${game.round}`) game.round_player = COM game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) game.state = 'choose_card' @@ -4878,7 +4880,7 @@ function vm_add_limited_infl() { function vm_do_add_limited_infl(space, max_infl) { push_undo() - log_summary(`Added £ SP in %${space}.`) + log_summary(`Added £ SP in %${space}`) game.vm_available_ops -- if (!game.vm_influence_added) { -- cgit v1.2.3 From 1e59d478cfddc04353d2b5da20d2562342d83c65 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:53:46 +0000 Subject: fix round marker --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index ddfcf58..536beb6 100644 --- a/play.js +++ b/play.js @@ -485,7 +485,7 @@ function layout_turn_marker() { } function layout_round_marker() { - let x = 709 + 24 + (view.turn - 1) * 53 + let x = 709 + 24 + (view.round - 1) * 53 let y = 142 + 24 ui.round.style.left = x - 25 + "px" ui.round.style.top = y - 25 + "px" -- cgit v1.2.3 From e77155fe35c22f290be7e6f6458a8e1356f51761 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 19:05:50 +0000 Subject: Tidying up code --- rules.js | 575 ++++++++++++++++----------------------------------------------- 1 file changed, 142 insertions(+), 433 deletions(-) diff --git a/rules.js b/rules.js index 8541df9..55f064c 100644 --- a/rules.js +++ b/rules.js @@ -307,20 +307,13 @@ exports.setup = function (seed, scenario, options) { } log_h1("1989 Dawn of Freedom") - game.active = COM start_game() - return game } function start_game() { - //starting influence - // Draw cards - - //console.log('start game') - game.strategy_deck = draw_deck() reset_power() @@ -344,12 +337,11 @@ function start_game() { game.valid_spaces = valid_spaces_setup() game.available_ops = 2 - game.phase = 0 + //game.phase = 0 /* Now redundant? */ log_h1("Place starting Support Points") log_side() } - exports.view = function(state, player) { game = state @@ -394,20 +386,16 @@ exports.view = function(state, player) { hand: [], set_aside: [], pwr_hand: [], - - } if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card - console.log('game.com_power_card', game.com_power_card, 'game.dem_power_card', game.dem_power_card) view.power_card_1 = game.power_card_1 view.power_card_2 = game.power_card_2 } view.strategy_discard = game.strategy_discard - if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -471,11 +459,9 @@ exports.view = function(state, player) { view.actions.undo = 0 } } - return view } - // === ACTIONS =========== function gen_action(action, argument) { @@ -493,11 +479,6 @@ function gen_action_space(space){ gen_action("space", space) } - -function gen_action_infl(space){ - gen_action("infl", space) -} - function gen_action_card(card){ gen_action("card", card) } @@ -506,14 +487,6 @@ function gen_action_power_card(card){ gen_action("power_card", card) } -function gen_action_sc(space){ - gen_action("sc", space) -} - -function gen_action_scoring(){ - gen_action("scoring") -} - exports.action = function (state, player, action, arg) { game = state if (states[game.state] && action in states[game.state]) { @@ -550,14 +523,9 @@ states.com_init = { }, space(space) { add_infl(space) - }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.starting_infl.com_starting_infl++ if (game.starting_infl.com_starting_infl == 1){ game.available_ops = 3 @@ -575,6 +543,7 @@ states.com_init = { } }, start() { + do_log_summary() new_turn() clear_undo() game.state = 'choose_card' @@ -600,13 +569,8 @@ states.dem_init = { space(space) { add_infl(space) }, - done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.starting_infl.dem_starting_infl++ if (game.starting_infl.dem_starting_infl == 1){ game.available_ops = 3 @@ -619,7 +583,6 @@ states.dem_init = { } } - states.choose_card = { inactive: 'choose a card.', prompt() { @@ -685,7 +648,6 @@ states.play_card ={ } // Check for Reformer Rehabilitated - if (game.played_card === C_REFORMER_REHABILITATED && game.playable_cards.includes(C_REFORMER_REHABILITATED)){ if (game.active === DEM && (game.dem_tst_position > game.com_tst_position)) { gen_action('event') @@ -700,7 +662,6 @@ states.play_card ={ 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') } @@ -715,14 +676,11 @@ states.play_card ={ 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() log_gap(`Played C${game.played_card} for the event`) game.vm_infl_to_do = false - if (scoring_cards.includes(game.played_card)) {game.phase = 0} - else {game.phase = 1} game.return = game.active if (switch_events.includes(game.played_card)) {next_player()} game.vm_event = game.played_card @@ -731,7 +689,7 @@ states.play_card ={ opp_event() { push_undo() log_gap(`Played C${game.played_card} for the event`) - game.phase = 1 /*Do I still need this?*/ + //game.phase = 1 /*Do I still need this?*/ game.vm_infl_to_do = true game.return = game.active game.vm_event = game.played_card @@ -746,22 +704,18 @@ states.play_card ={ influence() { push_undo() log_gap(`Played C${game.played_card} to place SPs`) - // Check if Common European Home played for influence if (game.played_card === C_COMMON_EUROPEAN_HOME) { if (game.active === DEM) { game.vp -- log('-1 VP') - if (check_vp()) { - return - } } else { game.vp ++ log('+1 VP') - if (check_vp()) { - return - } + } + if (check_vp()) { + return } } // Check if card is opponent card with event that needs to be resolved @@ -818,7 +772,6 @@ states.play_card ={ end_round () { end_round() } - } states.resolve_opponent_event = { @@ -888,7 +841,6 @@ states.resolve_opponent_event = { } } - states.finish_add_infl = { inactive: 'add SPs.', prompt () { @@ -897,10 +849,7 @@ states.finish_add_infl = { gen_action("end_round") return; } - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces for (let space_id of game.valid_spaces) { gen_action_space(space_id) } @@ -910,11 +859,7 @@ states.finish_add_infl = { }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() end_round() } } @@ -997,10 +942,7 @@ states.add_influence = { gen_action('done') } } else { - view.prompt = `Add SPs: ${game.available_ops} remaining.` - - // Generate actions for valid spaces for (let space_id of game.valid_spaces) { gen_action_space(space_id); } @@ -1011,17 +953,11 @@ states.add_influence = { }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() end_round() }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event' } @@ -1101,33 +1037,8 @@ states.tst_goddess = { }, pass() { log('Did not discard') - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } + end_goddess() }, - done() { - - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } - } } states.tst_goddess_draw = { @@ -1142,23 +1053,10 @@ states.tst_goddess_draw = { } else { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) } - log_h2("Action Round " + game.round) - if (game.active === DEM) { - next_player() - } else { - log_side() - } - game.phase = 0 - if (game.persistent_events.includes(5)) { - game.state = 'general_strike' - } else { - game.state = 'choose_card' - } + end_goddess() } } - - states.support_check_prep = { inactive: 'do support checks', prompt () { @@ -1175,7 +1073,6 @@ states.support_check_prep = { } } else if (game.available_ops > 0) { view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - for (let space_id of game.valid_spaces) { gen_action_space(space_id) } @@ -1192,7 +1089,6 @@ states.support_check_prep = { game.state = 'austria_hungary_border_reopened_check' return } - } } game.state = 'do_support_check' @@ -1285,15 +1181,15 @@ states.draw_power_cards = { game.com_pwr_hand_limit = 0 } // Events which affect cards drawn - if (game.persistent_events.includes(17) && game.com_pwr_hand_limit >= 2) { - log('Democrat receives 2 cards from Communist due to C17') + if (game.persistent_events.includes(C_ROUNDTABLE_TALKS) && game.com_pwr_hand_limit >= 2) { + log(`Democrat receives 2 cards from Communist due to C${C_ROUNDTABLE_TALKS}`) game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 - discard_from_table(17) - game.persistent_events = game.persistent_events.filter(n => n !== 17) + discard_from_table(C_ROUNDTABLE_TALKS) + game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) } - if (game.persistent_events.includes(72)) { + if (game.persistent_events.includes(C_PEASANT_PARTIES_REVOLT)) { let farmer_check for (let space of spaces) { if (space && space.country === game.pwr_struggle_in && space.socio === 3 && check_dem_control(space.space_id)) { @@ -1301,20 +1197,20 @@ states.draw_power_cards = { } } if (farmer_check && game.com_pwr_hand_limit > 0) { - log('Democrat receives 1 cards from Communist due to C72') + log(`Democrat receives 1 cards from Communist due to C${C_PEASANT_PARTIES_REVOLT}`) game.dem_pwr_hand_limit += 1 game.com_pwr_hand_limit -= 1 - permanently_remove(72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) + permanently_remove(C_PEASANT_PARTIES_REVOLT) + game.persistent_events = game.persistent_events.filter(n => n !== C_PEASANT_PARTIES_REVOLT) } } - if (game.persistent_events.includes(102) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { - log('Communist receives 2 cards from Democrat due to C102') + if (game.persistent_events.includes(C_NATIONAL_SALVATION_FRONT) && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { + log(`Communist receives 2 cards from Democrat due to C${C_NATIONAL_SALVATION_FRONT}`) game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 - permanently_remove(102) - game.persistent_events = game.persistent_events.filter(n => n !== 102) + permanently_remove(C_NATIONAL_SALVATION_FRONT) + game.persistent_events = game.persistent_events.filter(n => n !== C_NATIONAL_SALVATION_FRONT) } //Draw Power Cards @@ -1330,13 +1226,13 @@ states.draw_power_cards = { log(`Democrat: ${game.dem_pwr_hand.length} cards`) //Check if The Crowd Turns Against Ceausescu occurs - if (game.table_cards.includes(54) && game.pwr_struggle_in === 'Romania') { + if (game.table_cards.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && game.pwr_struggle_in === 'Romania') { if (game.active === COM) { game.return = COM next_player() } - log_h3('C54') - game.persistent_events.push(54) + log_h3(`C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU}`) + game.persistent_events.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) game.state = 'the_crowd_turns_against_ceausescu_prep' } else { log_h2('Raise the Stakes') @@ -1347,7 +1243,7 @@ states.draw_power_cards = { states.the_crowd_turns_against_ceausescu_prep = { get inactive() { - return `resolve ${clean_name(cards[54].name)}.` + return `resolve ${clean_name(cards[C_THE_CROWD_TURNS_AGAINST_CEAUSESCU].name)}.` }, prompt() { view.prompt = 'The Crowd Turns Against Ceausescu: draw cards.' @@ -1356,7 +1252,7 @@ states.the_crowd_turns_against_ceausescu_prep = { draw() { game.ceausescu_cards = [] draw_cards(game.power_struggle_deck, game.ceausescu_cards, game.com_pwr_hand, 15, game.com_pwr_hand.length) - game.temp = game.ceausescu_cards.filter(card => card && card >=25 && card <= 30).length + game.temp = game.ceausescu_cards.filter(card => rallies.includes(card)).length log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) game.vm_available_ops = game.temp * 3 log(`Democrat takes a ${game.vm_available_ops} Action Round`) @@ -1366,7 +1262,7 @@ states.the_crowd_turns_against_ceausescu_prep = { states.vm_the_crowd_turns_against_ceausescu = { get inactive() { - return `resolve ${clean_name(cards[54].name)}.` + return `resolve ${clean_name(cards[C_THE_CROWD_TURNS_AGAINST_CEAUSESCU].name)}.` }, prompt() { view.prompt = `You have ${game.vm_available_ops} operations points. Play for:` @@ -1408,11 +1304,7 @@ states.the_crowd_turns_against_ceausescu_infl = { vm_do_add_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() if (game.return !== game.active) { next_player() } @@ -1423,7 +1315,6 @@ states.the_crowd_turns_against_ceausescu_infl = { states.raise_stakes_1 = { inactive: 'raise the stakes.', - prompt () { if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1483,7 +1374,6 @@ states.raise_stakes_1 = { states.raise_stakes_2 = { inactive: 'raise the stakes.', - prompt () { if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1517,7 +1407,6 @@ states.raise_stakes_2 = { game.raised_stakes++ game.valid_cards = [] } - }, pass() { log('Did not raise the stakes') @@ -1544,24 +1433,16 @@ states.power_struggle = { } } if (game.phase === 1) { + let base_prompt = `${power_cards[game.played_power_card].name} played` + (leader_cards.includes(game.played_power_card) ? ` as a ${game.proxy_power_card}.` : ".") if (game.valid_cards.length > 0) { - if (leader_cards.includes(game.played_power_card)) { - view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must match or concede.` - } else { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - } - gen_action('concede') + view.prompt = `${base_prompt} You must match or concede.`; for (let card of game.valid_cards) { - gen_action_power_card(card) - } - } else if (game.valid_cards.length === 0) { - if (leader_cards.includes(game.played_power_card)) { - view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must concede.` - } else { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + gen_action_power_card(card); } - gen_action('concede') - } + } else { + view.prompt = `${base_prompt} You must concede.`; + } + gen_action('concede') } else if (game.phase === 2) { view.prompt = 'You matched. Roll a die.' @@ -1588,9 +1469,8 @@ states.power_struggle = { game.valid_cards=[] game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} - if (card === 52) { - log_gap(`Played P52: P${game.played_power_card} no longer playable`) - + if (card === PC_TACTIC_FAILS) { + log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) } else { if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ else if (numberless_cards.includes(card)) { @@ -1623,7 +1503,7 @@ states.power_struggle = { do_valid_cards() } } else if (game.phase === 1) { - if (card === 52) { + if (card === PC_TACTIC_FAILS) { game.tactics_fails = power_cards[game.played_power_card].name game.phase = 0 next_player() @@ -1694,8 +1574,8 @@ states.power_struggle = { next_player() do_valid_cards() }, - done () { - if (game.phase === 7) { /*Is this ever called anymore? */ + /*done () { + if (game.phase === 7) { game.phase = 0 log_msg_gap('Takes initiative') do_valid_cards() @@ -1704,81 +1584,32 @@ states.power_struggle = { next_player() do_valid_cards() } - } + }*/ } states.support_loss ={ inactive: 'do Support Loss.', prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') - } - } else { - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + let ps_state = game.persistent_events.includes(111) ? "New Year's Eve Party" : "Power Struggle" + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` - gen_action('done') + for (let space_id of game.valid_spaces) { + gen_action_space(space_id) } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') } }, roll () { - clear_undo() - let roll = roll_d6() - let rally_win = 0 - let petition_win = 0 - log(`Roll: D${roll}`) - if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} - let modified_roll = roll + game.raised_stakes + rally_win - petition_win - - // Roll modifiers - if (game.active === COM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) - modified_roll ++ - } - - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P1') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - game.available_ops = support_loss_roll[modified_roll] + game.available_ops = support_loss_roll[get_aftermath_roll()] if (game.available_ops === 0) { log('Does not remove SPs') } @@ -1795,10 +1626,7 @@ states.support_loss ={ } }, done () { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() next_player() log_h3('Victory Point') game.phase = 0 @@ -1809,58 +1637,20 @@ states.support_loss ={ states.vp_roll = { inactive: 'do VP Roll.', prompt () { - if (!game.persistent_events.includes(111)) { - if (game.phase === 0) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } - } else { - if (game.phase === 0) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` - gen_action('scoring') - } + let ps_state = game.persistent_events.includes(111) ? "New Year's Eve Party" : "Power Struggle" + if (game.phase === 0) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `${ps_state} - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') } }, roll () { - let roll = roll_d6() - log(`Roll: D${roll}`) - let rally_win = 0 - let petition_win = 0 - if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} - if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} - let modified_roll = roll + game.raised_stakes + rally_win - petition_win - if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) - modified_roll ++ - } - if (modified_roll < 0) {modified_roll = 0} - else if (modified_roll > 7) {modified_roll = 7} - - if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) - } - if (rally_win !== 0) { - log('+2 from winning on a P1') - } - if (petition_win !== 0) { - log('-2 from winning on a P31') - } - if (modified_roll !== roll) { - log(`Modified roll: ${modified_roll}`) - } - let vp_change = vp_roll[modified_roll] + let vp_change = vp_roll[get_aftermath_roll()] if (game.active === DEM) { log(`+${vp_change} VP`) } else { @@ -1879,7 +1669,6 @@ states.vp_roll = { }, take () { push_undo() - //Find name of scoring card let scoring_card = scoring_cards[countries.indexOf(game.pwr_struggle_in)] permanently_remove(scoring_card) take_power(game.pwr_struggle_in) @@ -1959,7 +1748,7 @@ states.the_tyrant_is_gone ={ game.return = DEM } log_h3(`C97`) - game.vm_event = 97 + game.vm_event = C_THE_TYRANT_IS_GONE goto_vm(game.vm_event) } } @@ -3247,6 +3036,37 @@ function get_end_infl_prompt() { } } +function get_aftermath_roll() { + clear_undo() + let roll = roll_d6() + log(`Roll: D${roll}`) + let rally_win = 0 + let petition_win = 0 + if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} + let modified_roll = roll + game.raised_stakes + rally_win - petition_win + if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + modified_roll ++ + } + if (modified_roll < 0) {modified_roll = 0} + else if (modified_roll > 7) {modified_roll = 7} + + if (game.raised_stakes !== 0) { + log(`+${game.raised_stakes} from Raising the Stakes`) + } + if (rally_win !== 0) { + log('+2 from winning on a P1') + } + if (petition_win !== 0) { + log('-2 from winning on a P31') + } + if (modified_roll !== roll) { + log(`Modified roll: ${modified_roll}`) + } + return modified_roll +} + function permanently_remove(card) { if (game.strategy_removed.includes(card)) {return} remove_from_discard(card) @@ -3313,6 +3133,20 @@ function end_stasi_choose_card() { } } +function end_goddess() { + log_h2("Action Round " + game.round) + if (game.active === DEM) { + next_player() + } else { + log_side() + } + if (game.persistent_events.includes(5)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } +} + function check_reformer() { if (game.dem_tst_position !== game.com_tst_position) { if (!game.playable_cards.includes(67)) { @@ -3773,64 +3607,6 @@ function new_turn() { delete game.stasi_card delete game.stand_fast -/* TODO: Add log for events no longer in effect */ - - /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) - game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) - game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) - game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) - delete game.prudence - delete game.stasi_card - - //Austria Hungary Border Reopened - if (game.persistent_events.includes(58)) { - game.persistent_events = game.persistent_events.filter(n => n !== 58) - delete game.austria_hungary_border_reopened_tracker - log(`C58 no longer in effect`) - } - //Elena - if (game.persistent_events.includes(101)) { - game.persistent_events = game.persistent_events.filter(n => n !== 101) - log(`C101 no longer in effect`) - } - //GrenzTruppen - if (game.persistent_events.includes(59)) { - game.persistent_events = game.persistent_events.filter(n => n !== 59) - log(`C59 no longer in effect`) - } - //Foreign Currency Debt Burden - if (game.persistent_events.includes(49)) { - game.persistent_events = game.persistent_events.filter(n => n !== 49) - delete game.foreign_currency_debt_burden - log(`C49 no longer in effect`) - } - //FRG Embassies - if (game.persistent_events.includes(74)) { - game.persistent_events = game.persistent_events.filter(n => n !== 74) - log(`C74 no longer in effect`) - discard_from_table(74) - permanently_remove(74) - } - //Genscher - if (game.persistent_events.includes(63)) { - game.persistent_events = game.persistent_events.filter(n => n !== 63) - log(`C63 no longer in effect`) - discard_from_table(63) - permanently_remove(63) - } - //Stasi - if (game.persistent_events.includes(C_STASI)) { - game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) - discard_from_table(C_STASI) - log(`C${C_STASI} no longer in effect`) - } - //Stand Fast - if (game.persistent_events.includes(100)) { - game.persistent_events = game.persistent_events.filter(n => n !== 100) - delete game.stand_fast - log(`C100 no longer in effect`) - }*/ - if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) delete game.samizdat_card @@ -4084,7 +3860,7 @@ function reset_power() { game.power_struggle_discard = [] game.dem_pwr_hand = [] game.com_pwr_hand = [] - game.phase = 1 + //game.phase = 1 game.raised_stakes_round = 0 game.raised_stakes = 0 game.played_power_card = 0 @@ -4266,24 +4042,11 @@ function pop_summary_i() { game.summary = [] } -function log_summary_place(p) { - let from = piece_space(p) - if (from !== AVAILABLE) - log_summary("% " + piece_name(p) + " from S" + from) - else - log_summary("% " + piece_name(p)) -} - -function log_summary_move_to_from(p, to) { - log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p)) -} - -function log_summary_remove(p) { - log_summary("Removed % " + piece_name(p)) -} - -function log_summary_activated(p) { - log_summary("Activated % " + piece_faction_name(p)) +function do_log_summary() { + if (game.summary.length > 0) { + pop_summary() + log_br() + } } // ============ UNDO FUNCTIONS ================== @@ -5627,6 +5390,7 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true + game.phase = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -6053,32 +5817,20 @@ states.vm_add_infl = { vm_do_add_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } }, done () { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() }, end_round() { push_undo() - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } @@ -6106,11 +5858,7 @@ states.vm_add_infl_free = { vm_do_add_infl_free(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } - + do_log_summary() game.vm_event_done = true vm_next() } @@ -6119,20 +5867,14 @@ states.vm_add_infl_free = { push_undo() game.valid_spaces = [] game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() }, end_round () { push_undo() game.valid_spaces = [] game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -6190,10 +5932,7 @@ states.vm_add_limited_infl = { vm_do_add_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() game.vm_event_done = true vm_next() } @@ -6230,19 +5969,13 @@ states.vm_remove_infl = { game.vm_active_country = spaces[space].country if (game.vm_event !== C_INFLATIONARY_CURRENCY) { if (game.vm_available_ops === 0 ) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -6296,19 +6029,13 @@ states.vm_remove_limited_infl = { vm_do_remove_limited_infl(space, game.vm_max_infl) if (game.vm_available_ops === 0) { game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, done () { game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -7624,10 +7351,7 @@ states.vm_nomenklatura_add = { vm_do_add_infl_free(space) if (game.vm_available_ops === 0 ) { game.valid_spaces = [] - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, @@ -8071,10 +7795,7 @@ states.vm_we_are_the_people_remove = { vm_do_remove_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() if (!game.vm_influence_added[S_LUTHERAN_CHURCH]) { log('No SPs removed') vm_next() @@ -8099,10 +7820,7 @@ states.vm_we_are_the_people_add = { 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() - log_br() - } + do_log_summary() vm_next() } }, @@ -8227,18 +7945,12 @@ states.vm_tst_4 = { space(space) { vm_do_remove_infl(space) if (game.vm_available_ops === 0) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } @@ -8382,10 +8094,7 @@ states.vm_scare_tactics = { vm_do_remove_infl(space) }, done() { - if (game.summary.length > 0) { - pop_summary() - log_br() - } + do_log_summary() vm_next() } } -- cgit v1.2.3 From 9643ad342f7ea0e877c64be7952cddee6fb7cb12 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 23:50:59 +0000 Subject: Tidy up code --- rules.js | 237 +++++++++++++++++++-------------------------------------------- 1 file changed, 70 insertions(+), 167 deletions(-) diff --git a/rules.js b/rules.js index 55f064c..f77eb6e 100644 --- a/rules.js +++ b/rules.js @@ -1945,9 +1945,7 @@ states.general_strike = { clear_undo() let roll = roll_d6() log(`Roll: D${roll}`) - logi(`+${game.available_ops} ops`) - let total = roll + game.available_ops log(`Total: ${total}`) @@ -1958,7 +1956,6 @@ states.general_strike = { } else { log('The strike continues. Required 6 or more') } - game.state = 'end_round' }, } @@ -2059,7 +2056,7 @@ states.new_years_eve_party = { } else if (game.vp < 0) { goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`) } else if (game.vp === 0) { - goto_game_over('', `CNew Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ + goto_game_over('', `New Year's Eve Party: The game is tied!`) /*Not sure what to pass for result */ } } } @@ -2067,15 +2064,14 @@ states.new_years_eve_party = { states.stasi_end_round = { inactive: 'choose next card due to Stasi.', prompt() { - let available_cards = game.democrat_hand - if (available_cards.length === 0) { + if (game.democrat_hand.length === 0) { view.prompt = 'Stasi: no cards remaining.' gen_action('pass') return } view.prompt = 'Stasi: you must select your next card to play.' - for (let card of available_cards) { + for (let card of game.democrat_hand) { gen_action_card(card) } }, @@ -2090,14 +2086,6 @@ states.stasi_end_round = { game.stasi_card = 0 end_stasi_choose_card() }, - end_round() { - push_undo() - if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } - } } states.stasi_finish = { @@ -2119,10 +2107,8 @@ states.stasi_finish = { states.stasi_confirm = { inactive: 'choose next card due to Stasi.', prompt() { - 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') - } + 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 !== C_COMMON_EUROPEAN_HOME) @@ -2138,10 +2124,7 @@ states.stasi_play_card = { gen_action('pass') } else { view.prompt = `Stasi: you must play ${clean_name(cards[game.stasi_card].name)}.` - let available_cards = [game.stasi_card] - for (let card of available_cards) { - gen_action_card(card) - } + gen_action_card(game.stasi_card) } }, card(card) { @@ -2157,7 +2140,6 @@ states.stasi_play_card = { } else { game.state = 'play_card' } - }, pass () { log('No cards remaining. Passed') @@ -2208,14 +2190,14 @@ function add_infl(space) { } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { + if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { game.available_ops-- - log_summary(`(-1 op due to C63)`) + log_summary(`(-1 op due to C${C_GENSCHER})`) } else if (check_opp_control(space)) { game.available_ops -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative if (game.available_ops < 0) { - log_summary(`(Used +1 op from C58)`) + log_summary(`(Used +1 op from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED})`) } } else { game.available_ops-- @@ -2332,7 +2314,6 @@ function do_sc(space) { } else { let card_ops = get_card_ops(this_card()) - roll += card_ops logi(`+${card_ops} from card ops`) } @@ -2343,37 +2324,31 @@ function do_sc(space) { } // Events which modify SC rolls - //Tear Gas - if (game.active === COM && game.persistent_events.includes(30) && spaces[space].socio === 6) { + if (game.active === COM && game.persistent_events.includes(C_TEAR_GAS) && spaces[space].socio === 6) { roll ++ - logi('+1 from C30') - permanently_remove(30) - game.persistent_events = game.persistent_events.filter(n => n !== 30) + logi(`+1 from C${C_TEAR_GAS}`) + permanently_remove(C_TEAR_GAS) + game.persistent_events = game.persistent_events.filter(n => n !== C_TEAR_GAS) } - //FRG Embassies - if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { + if (game.active === DEM && spaces[space].region === 'Eastern Europe' && game.persistent_events.includes(C_FRG_EMBASSIES)) { roll++ - logi('+1 from C74') + logi(`+1 from C${C_FRG_EMBASSIES}`) } - //GrenzTruppen - if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(59)) { + if (game.active === DEM && spaces[space].country === 'East_Germany' && game.persistent_events.includes(C_GRENZTRUPPEN)) { roll-- - logi('-1 from C59') + logi(`-1 from C${C_GRENZTRUPPEN}`) } - //Stand Fast if ((game.active === COM && game.stand_fast === DEM && check_dem_control(space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(space))){ roll-- - logi('-1 from C100') + logi(`-1 from C${C_STAND_FAST}`) } - //Elena - if (game.active === DEM && game.persistent_events.includes(101) && spaces[space].country === 'Romania') { + if (game.active === DEM && game.persistent_events.includes(C_ELENA) && spaces[space].country === 'Romania') { roll-- - logi('-1 from C101') + logi(`-1 from C${C_ELENA}`) } - //Austria Hungary Border Reopened - if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { + if (game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { roll++ - logi(`+1 from C58`) + logi(`+1 from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED}`) } // Continue with logic - check for adjacency @@ -2381,14 +2356,14 @@ function do_sc(space) { // Events which affect adjacency - The Wall const adj = count_adj(space) - if (game.active === COM && game.persistent_events.includes(9) && spaces[space].country === 'East_Germany') { - logi('No adjacency for Democrats due to C9') - logi('C9 no longer in effect') + if (game.active === COM && game.persistent_events.includes(C_THE_WALL) && spaces[space].country === 'East_Germany') { + logi(`No adjacency for Democrats due to C${C_THE_WALL}`) + logi(`C${C_THE_WALL} no longer in effect`) roll += adj.com_adj if (adj.com_adj > 0) { logi(`+${adj.com_adj} adjacency`) } - game.persistent_events = game.persistent_events.filter(n => n !== 9) + game.persistent_events = game.persistent_events.filter(n => n !== C_THE_WALL) // Standard adjacency } else { @@ -2413,7 +2388,6 @@ function do_sc(space) { } } } - } // Support check calcs @@ -2466,11 +2440,9 @@ function do_sc(space) { } } game.selected_space = 0 - } function valid_spaces_setup() { - game.valid_spaces = [] let valid_spaces_set = new Set(); for (let i =0 ; i < spaces.length ; i++) { let space = spaces[i] @@ -2507,31 +2479,20 @@ function valid_spaces_sc() { } else { let infl = game.demInfl[i] if (infl !== 0 ) { - // Check Solidarity Legalised + // Check Events that block support checks in a given space if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} - - // Check Civic Forum 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(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue} - - //Check for Foreign Currency Debt Burden - if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && 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); - - } } } } - - - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); //Check for the Crown Turns Against Ceausescu - if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.is_pwr_struggle && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania') } return game.valid_spaces; @@ -2553,42 +2514,33 @@ function valid_spaces_support_loss() { } } } - - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); return game.valid_spaces; } function valid_spaces_infl() { - // Check if function is called from the VM or not, take relevant ops variable let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; let valid_spaces_set = new Set(); - // Iterate over all spaces to find the ones with the player's influence for (let i = 0; i < game.demInfl.length; i++) { - //piece = game.pieces[i] let space = spaces[i] - let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); - - // Check adjacency information let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { if (adj_space_id) { - const adj_piece = spaces[adj_space_id]; // Check if the adjacent space is controlled by the opponent const opponent_control = check_opp_control(adj_piece.space_id) //Check for Genscher. Can always place in East Germany even with 1 op - if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(63)){ + if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(C_GENSCHER)){ valid_spaces_set.add(adj_piece.space_id) } @@ -2600,7 +2552,6 @@ function valid_spaces_infl() { } } } - // Convert the set to an array before returning game.valid_spaces = Array.from(valid_spaces_set); return game.valid_spaces; } @@ -2610,14 +2561,15 @@ function valid_cards(player_hand, presence) { if (game.phase === 0) { for (let c of player_hand) { let card = power_cards[c] + // Never add tactics fails if (c === PC_TACTIC_FAILS) { continue } - // Never add tactics fails + // Cannot play the suit of Tactics Fails if (card.name === game.tactics_fails) { continue } - // Cannot play the suit of Tactics Fails + if (card.socio === 0) { valid_cards_set.add(c) } else if (leaders.includes(card.socio) && presence[card.socio]) { @@ -2627,7 +2579,6 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards[c] - console.log("card", card) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(c) } else if (card.name === game.proxy_power_card) { @@ -2647,7 +2598,6 @@ function do_valid_cards() { let presence = check_presence(game.pwr_struggle_in) if (game.active === DEM) { valid_cards(game.dem_pwr_hand, presence.dem_leaders) - } else { valid_cards(game.com_pwr_hand, presence.com_leaders)} } @@ -2883,11 +2833,9 @@ function battlegrounds(country) { } function take_power(country) { - log(`Democrat takes power in ${game.pwr_struggle_in}`) game.revolutions[find_country_index(country)] = true game.times_held[find_country_index(country)] = 1 - } function retain_power(country){ @@ -2910,7 +2858,6 @@ function score_country(country) { } else { value_control = 4 } -//Log for scoring let dem_vp = 0 let com_vp = 0 @@ -2944,7 +2891,6 @@ function score_country(country) { } else { log('No presence: 0 VP') } - } else if (presence.com_control || presence.com_domination) { log('Communist:') @@ -2972,7 +2918,6 @@ function score_country(country) { } else { log('No presence: 0 VP') } - } //Otherwise, presence and battlegrounds @@ -3007,7 +2952,6 @@ function score_country(country) { log('No presence: 0 VP') } } - //Calculate change VP let change_vp = dem_vp + com_vp @@ -3103,7 +3047,6 @@ function goto_game_over(result, victory) { log_h1("Game Over") log(game.victory) return - } function goto_struggle(){ @@ -3147,7 +3090,7 @@ function end_goddess() { } } -function check_reformer() { +function check_reformer() { /*Is this function still used?*/ if (game.dem_tst_position !== game.com_tst_position) { if (!game.playable_cards.includes(67)) { game.playable_cards.push(67) @@ -3155,7 +3098,6 @@ function check_reformer() { } else { game.playable_cards = game.playable_cards.filter(n => n !== 67) } - } function count_scoring_cards() { @@ -3193,23 +3135,18 @@ function select_card(card){ game.state = 'play_card' } -function find_event(card) { - return variable_events.indexOf(card) -} - function is_auto_resolve(card) { - let ceausecu_events = [10, 41, 101, 107] - if (card === 97) { - if (!game.persistent_events.includes(54)) { + if (card === C_THE_TYRANT_IS_GONE) { + if (!game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { return true } } - else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { + else if (ceausecu_events.includes(card) && game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { return true } - else if (card === 87 && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { + else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true } else if (auto_resolve_events.includes(card)) { @@ -3245,7 +3182,7 @@ function event_is_playable(card) { return false } //Check for The Chinese Solution - else if (game.com_tst_position === 8 && card === 96) { + else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } //Then check normally @@ -3264,15 +3201,15 @@ function get_card_ops(card) { if (card) { ops = cards[card].ops } - if (game.persistent_events.includes(25) && game.active === COM) { + if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card') { - log('+1 op from C25') + log(`+1 op from C${C_PERESTROIKA}`) } ops ++ } - if (game.persistent_events.includes(50) && game.active === DEM) { + if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { - log('+1 op from C50') + log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) } ops ++ } @@ -3287,10 +3224,10 @@ function get_card_ops(card) { if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { if (ops > 2) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) + log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { if (ops > 1) { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } } } @@ -3304,9 +3241,9 @@ function get_card_ops(card) { if (game.active === COM && game.prudence && game.prudence.COM < 0) { if(game.state === 'choose_card') { if (ops > 2) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) + log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else if (ops > 1) { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } } ops += game.prudence.COM @@ -3318,38 +3255,32 @@ function get_card_ops(card) { function get_tst_6_ops() { let ops = 0 - - if (game.persistent_events.includes(25) && game.active === COM) { - log('+1 op from C25') + if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { + log(`+1 op from C${C_PERESTROIKA}`) ops ++ } - if (game.persistent_events.includes(50) && game.active === DEM) { - log('+1 op from C50') + if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { + log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) ops ++ } - if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { if (ops > 0) { - log(`${pluralize(game.prudence.DEM,'op')} from C8`) + log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C8`) - } - + log(`-1 op from C${C_PRUDENCE}`) + } ops += game.prudence.DEM - if (ops < -1) { ops = -1 } } if (game.active === COM && game.prudence && game.prudence.COM < 0) { - if (ops > 0) { - log(`${pluralize(game.prudence.COM,'op')} from C8`) + log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C8`) + log(`-1 op from C${C_PRUDENCE}`) } - ops += game.prudence.COM if (ops < -1) { ops = -1 @@ -3388,11 +3319,9 @@ function finish_the_wall() { } } - // =========== MOVING THROUGH TURNS ============ function end_round() { - //Check if the game is over! if (game.state === 'game_over') { return} @@ -3420,7 +3349,6 @@ function end_round() { check_common_european_home() reset_austria_hungary_border_reopened() /*This should be redundant! */ - // Check for duplicate card entries let card_check if (game.samizdat_card > 0) { @@ -3503,7 +3431,7 @@ function end_round() { // Resolve end action round //Stasi check - if(game.round_player === COM && game.persistent_events.includes(13)) { + if(game.round_player === COM && game.persistent_events.includes(C_STASI)) { //If in Honecker, turn ends if (game.round === 8) { clear_undo() @@ -3614,12 +3542,9 @@ function new_turn() { log_h1("Turn " + game.turn) - if (game.turn === 4) { - add_midyear() - } - if (game.turn === 8) { - add_lateyear() - } + if (game.turn === 4) { add_midyear() } + if (game.turn === 8) { add_lateyear() } + if (game.turn > 1) { if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 @@ -3631,24 +3556,18 @@ function new_turn() { } //Check if TST effects need to be resolved - if (game.dem_tst_position >=5 && game.com_tst_position <= 4) { + if ((game.dem_tst_position >=5 && game.com_tst_position <= 4) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4)) { log_h2('Tiananmen Square Track award') - if(game.active !== DEM) { next_player() } - for (let card of game.democrat_hand) { + + if ((game.dem_tst_position >= 5 && game.com_tst_position <= 4 && game.active !== DEM) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4 && game.active !== COM)) { + next_player() + } + let hand = game.dem_tst_position >=5 ? game.democrat_hand : game.communist_hand + for (let card of hand) { if (scoring_cards.includes(card)) continue game.valid_cards.push(card) } - game.state = 'tst_goddess' /* Goddess only name of Democrat bonus, not Communist*/ - return - } - else if (game.com_tst_position >=5 && game.dem_tst_position <= 4) { - log_h2('Tiananmen Square Track award') - if(game.active !== COM) { next_player() } - for (let card of game.communist_hand) { - if (scoring_cards.includes(card)) continue - game.valid_cards.push(card) - } - game.state = 'tst_goddess' + game.state = 'tst_goddess' } else { log_h2("Action Round " + game.round) log_side() @@ -3674,7 +3593,6 @@ function next_player() { game.active = COM else game.active = DEM - log_side() } @@ -3687,9 +3605,6 @@ function change_player() { } function random(range) { - // An MLCG using integer arithmetic with doubles. - // https://www.ams.org/journals/mcom/1999-68-225/S0025-5718-99-00996-5/S0025-5718-99-00996-5.pdf - // m = 2**35 − 31 return (game.seed = game.seed * 200105 % 34359738337) % range } @@ -3697,7 +3612,6 @@ function roll_d6() { return random(6) + 1 } - function find_space_index(name_unique) { return spaces.findIndex(space => space && space.name_unique === name_unique) } @@ -3720,12 +3634,9 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { if (deck.length === 0) { log_h3('--- Reshuffle ---') - deck.push(...game.strategy_discard) game.strategy_discard = [] - } - - else if (turn === 'communist' && communist_hand.length < com_hand_limit) { + } else if (turn === 'communist' && communist_hand.length < com_hand_limit) { communist_hand.push(draw_card(deck)); turn = 'democrat'; } else if(turn === 'communist' && communist_hand.length === com_hand_limit) { @@ -3739,14 +3650,12 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han turn = 'communist'; } } - clear_undo() } function draw_card(deck) { if (deck.length === 0) { log_h3('--- Reshuffle ---') - deck.push(...game.strategy_discard) game.strategy_discard = [] } @@ -3757,7 +3666,6 @@ function draw_card(deck) { function discard(card) { let find_card if (!game.is_pwr_struggle) { - if (game.active === COM) { find_card = game.communist_hand.indexOf(card) game.communist_hand.splice(find_card, 1) @@ -3777,7 +3685,6 @@ function discard(card) { find_card = game.dem_pwr_hand.indexOf(card); game.dem_pwr_hand.splice(find_card, 1); } - game.power_struggle_discard.push(card) } } @@ -3839,7 +3746,6 @@ function discard_from_table(card) { } } - function add_midyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 2) @@ -3847,7 +3753,6 @@ function add_midyear() { log_h3('Mid-year cards added to draw deck') } - function add_lateyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 3) @@ -3878,9 +3783,7 @@ function reset_power() { game.persistent_events = game.persistent_events.filter(n => n !== 62) } if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ - permanently_remove(54) - - + permanently_remove(54) } if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)){ game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) -- cgit v1.2.3 From 5b71e759a74b8bea8809a2c51e83edb4956254ea Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 08:18:12 +0000 Subject: Tidying up code --- rules.js | 241 ++++++++++++++++++++++----------------------------------------- 1 file changed, 82 insertions(+), 159 deletions(-) diff --git a/rules.js b/rules.js index f77eb6e..c42160f 100644 --- a/rules.js +++ b/rules.js @@ -2209,9 +2209,7 @@ function add_infl(space) { } else { game.demInfl[space]++ } - - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met if (game.available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { @@ -2259,7 +2257,7 @@ function remove_infl(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(space) + check_tyrant() } else { if (game.active === COM) { @@ -2273,7 +2271,7 @@ function remove_infl(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } } - check_control_change(space) + check_tyrant() } game.available_ops-- } @@ -2420,7 +2418,7 @@ function do_sc(space) { game.valid_spaces = game.valid_spaces.filter(id => id !== space) } } - check_control_change(space) + check_tyrant() } else { log_msg_gap('Change influence: 0 SP') @@ -3769,31 +3767,24 @@ function reset_power() { game.raised_stakes_round = 0 game.raised_stakes = 0 game.played_power_card = 0 - game.tactics_fails = '' + delete game.tactics_fails game.view_opp_hand = false - if (game.persistent_events.includes(72)){ - permanently_remove(72) - game.table_cards = game.table_cards.filter(card => card !== 72) - game.persistent_events = game.persistent_events.filter(n => n !== 72) - } - if (game.persistent_events.includes(62)) { - permanently_remove(62) - game.table_cards = game.table_cards.filter(card => card !== 62) - game.persistent_events = game.persistent_events.filter(n => n !== 62) - } - if (game.persistent_events.includes(54) && game.pwr_struggle_in === 'Romania'){ - permanently_remove(54) - } - if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)){ - game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU, C_SECURITATE] + for (let e of scoring_events ) { + if ( e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU && game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { + permanently_remove(e) + } else if (e === C_SECURITATE && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(e)){ + game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + } else if (game.persistent_events.includes(e)) { + permanently_remove(e) + game.table_cards = game.table_cards.filter(card => card !== e) + game.persistent_events = game.persistent_events.filter(n => n !== e) + } } } -function check_control_change(space_id) { - - // Check if the Tyrant is Gone has been fulfilled - +function check_tyrant() { if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 @@ -3805,8 +3796,7 @@ function check_control_change(space_id) { } } -function check_systematization() { - // Check for Systematization - may not use this space +function check_systematization() { /* Check for Systematization - may not use this space */ if (game.systematization > 0) { game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) } @@ -4049,17 +4039,6 @@ function vm_operand(a) { return x } -function vm_assert_argcount(n) { - const argcount = CODE[game.vm.fp][game.vm.ip].length - 1 - if (argcount !== n) - throw Error(`ASSERT Invalid number of arguments on event ${game.vm.fp}: ${argcount} instead of ${n}`) -} - -function vm_log() { - log(vm_operand(1)); - vm_next(); -} - function vm_if() { if (!vm_operand(1)) { let balance = 1 @@ -4138,15 +4117,6 @@ function vm_prompt() { vm_next() } -function pop_vm_prompt() { - if (game.vm._prompt) { - game.vm.prompt = game.vm._prompt - delete game.vm._prompt - } else { - game.vm.prompt = 0 - } -} - function vm_return() { //Remove temporary vm variables delete game.support_check_modifier @@ -4190,33 +4160,16 @@ function vm_end_event() { /* ================== VM ACTIONS =========================== */ -function vm_opp_hand_false() { - game.view_opp_hand = false - vm_next() -} - function vm_valid_spaces() { - let space_1 - let space_2 - let space_3 - let space_4 - let space_5 - let space_6 - - if (vm_operand(1)) { space_1 = spaces.find(space => space.ascii_name === vm_operand(1)).space_id} - if (vm_operand(2)) { space_2 = spaces.find(space => space.ascii_name === vm_operand(2)).space_id} - if (vm_operand(3)) { space_3 = spaces.find(space => space.ascii_name === vm_operand(3)).space_id} - if (vm_operand(4)) { space_4 = spaces.find(space => space.ascii_name === vm_operand(4)).space_id} - if (vm_operand(5)) { space_5 = spaces.find(space => space.ascii_name === vm_operand(5)).space_id} - if (vm_operand(6)) { space_6 = spaces.find(space => space.ascii_name === vm_operand(6)).space_id} - - game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] - game.valid_spaces = game.valid_spaces.filter( n => n ) - - // Check for Systematization - may not use this space - check_systematization() - - vm_next() + for (let i = 1; i <= 6; i++) { + let operand = vm_operand(i) + if (operand) { + let space = spaces.find(space => space.ascii_name === operand) + game.valid_spaces.push(space.space_id) + } + } + check_systematization(); + vm_next(); } function vm_valid_spaces_opponent () { @@ -4244,17 +4197,12 @@ function vm_valid_spaces_socio () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] - if (space.socio === vm_operand(1)) { valid_spaces.push(space.space_id) } } game.valid_spaces = valid_spaces - - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4262,7 +4210,6 @@ function vm_valid_spaces_opponent_socio () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] - if (game.active === DEM) { let infl = game.comInfl[i] if (infl > 0 && space.socio === vm_operand(1)) { @@ -4276,10 +4223,7 @@ function vm_valid_spaces_opponent_socio () { } } game.valid_spaces = valid_spaces - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4293,10 +4237,7 @@ function vm_valid_spaces_country () { game.valid_spaces.push(space.space_id); } } - // Check for Systematization - may not use this space - if (game.systematization && game.systematization > 0) { - game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) - } + check_systematization() vm_next() } @@ -4307,7 +4248,6 @@ function vm_valid_spaces_sc () { function vm_valid_spaces_country_opp () { let country = '' - if (vm_operand(1)) { country = vm_operand(1) } else { @@ -4438,7 +4378,7 @@ function vm_do_add_infl(space) { } // Check Genscher - if (game.persistent_events.includes(63) && game.active === DEM && spaces[space].country === 'East_Germany') { + if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany') { game.vm_available_ops-- log_summary(`(-1 op due to C63)`) } else if (check_opp_control(space)) { @@ -4457,9 +4397,7 @@ function vm_do_add_infl(space) { } else { game.demInfl[space]++ } - - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { @@ -4496,16 +4434,13 @@ function vm_do_add_infl(space) { function vm_do_add_infl_free(space) { push_undo() log_summary(`Added £ SP in %${space}.`) - - // Update influence values if (game.active === COM) { game.comInfl[space]++ } else { game.demInfl[space]++ } game.vm_available_ops-- - // Check whether spaces are controlled - check_control_change(space) + check_tyrant() } function vm_add_infl() { @@ -4526,14 +4461,12 @@ function vm_add_x_infl() { function vm_do_add_x_infl(space) { push_undo() log(`Added ${game.vm_available_ops} SPs in %${space}.`) - - if (game.active === COM) { game.comInfl[space] += game.vm_available_ops } else { game.demInfl[space] += game.vm_available_ops } - check_control_change(space) + check_tyrant() game.vm_available_ops = 0 game.valid_spaces = [] } @@ -4568,7 +4501,7 @@ function vm_do_add_limited_infl(space, max_infl) { if (game.vm_influence_added[space] === max_infl) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(space) + check_tyrant() if (game.vm_available_ops === 0) {game.valid_spaces = [] } } @@ -4631,7 +4564,7 @@ function vm_do_remove_infl(space) { } } } - check_control_change(space) + check_tyrant() game.vm_influence_added[space]++ game.vm_available_ops-- if (game.vm_available_ops===0) {game.valid_spaces = []} @@ -4675,8 +4608,7 @@ function vm_do_remove_x_infl(space) { } log(`Removed ${game.vm_available_ops} SPs from %${space}`) - check_control_change(space) - + check_tyrant() game.vm_available_ops = 0 game.valid_spaces = [] } @@ -4693,7 +4625,6 @@ function vm_do_remove_limited_infl(space, max_infl) { log(`Removed SP from %${space}.`) game.vm_available_ops -- - if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -4720,7 +4651,7 @@ function vm_do_remove_limited_infl(space, max_infl) { game.valid_spaces = game.valid_spaces.filter(id => id !== space); } - check_control_change(space) + check_tyrant() if (game.vm_available_ops === 0) {game.valid_spaces = []} } @@ -4739,7 +4670,7 @@ function vm_do_remove_all_infl(space) { } else { game.comInfl[space] = 0 } - check_control_change(space) + check_tyrant() } else { if (game.active === COM) { @@ -4747,7 +4678,7 @@ function vm_do_remove_all_infl(space) { } else { game.demInfl[space] = 0 } - check_control_change(space) + check_tyrant() } game.vm_available_ops -- game.valid_spaces = game.valid_spaces.filter(id => id !== space) @@ -4761,7 +4692,7 @@ function vm_replace_all_infl(space_id) { game.comInfl[space_id] += game.demInfl[space_id] game.demInfl[space_id] = 0 } - check_control_change(space_id) + check_tyrant() } function vm_1_support_check() { @@ -4781,13 +4712,12 @@ function vm_support_check_modified() { } function vm_switch_infl(id){ - push_undo() - + push_undo() game.demInfl[id] -= game.vm_available_ops game.comInfl[id] += game.vm_available_ops log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${id}`) game.vm_available_ops = 0 - check_control_change(id) + check_tyrant() } /* ===================== EVENT SPECIFIC FUNCTIONS ========== */ @@ -4819,8 +4749,8 @@ function vm_army_backs_revolution() { } function vm_austria_hungary_border_reopened() { - game.persistent_events.push(58) - permanently_remove(58) + game.persistent_events.push(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + permanently_remove(C_AUSTRIA_HUNGARY_BORDER_REOPENED) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4839,7 +4769,7 @@ function vm_breakaway_baltic_republics() { if (check_vp()) { return } - game.playable_cards.push(109) + game.playable_cards.push(C_KREMLIN_COUP) 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)} @@ -4960,14 +4890,12 @@ function vm_eco_glasnost() { } function vm_elena(){ - game.persistent_events.push(101) + game.persistent_events.push(C_ELENA) vm_next() } -function vm_eliminate(space_id) { +function vm_eliminate(space_id) { // Eliminate the democrat influence and move the communist influence to Bucuresti log(`Eliminated %${space_id}`) - -// 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 @@ -4979,10 +4907,6 @@ function vm_eliminate(space_id) { } game.comInfl[space_id] = 0 } - //Update control in the eliminated space and in Bucuresti - check_control_change(space_id) - check_control_change(S_BUCURESTI) - } function get_adjusted_adjacency(space_id) { @@ -5012,7 +4936,7 @@ function vm_foreign_currency_debt_burden() { if (check_vp()) { return } - game.persistent_events.push(49) + game.persistent_events.push(C_FOREIGN_CURRENCY_DEBT_BURDEN) game.state = 'vm_foreign_currency_debt_burden' } @@ -5026,26 +4950,26 @@ function vm_foreign_television() { vm_next() } function vm_frg_embassies() { - game.persistent_events.push(74) - game.table_cards.push(74) - remove_from_discard(74) - log('C74 in effect') + game.persistent_events.push(C_FRG_EMBASSIES) + game.table_cards.push(C_FRG_EMBASSIES) + remove_from_discard(C_FRG_EMBASSIES) + log(`C${C_FRG_EMBASSIES} in effect`) vm_next() } function vm_general_strike() { - game.persistent_events.push(5) - game.table_cards.push(5) - remove_from_discard(5) - log('C5 in effect') + game.persistent_events.push(C_GENERAL_STRIKE) + game.table_cards.push(C_GENERAL_STRIKE) + remove_from_discard(C_GENERAL_STRIKE) + log(`C${C_GENERAL_STRIKE} in effect`) vm_next() } function vm_genscher() { - game.persistent_events.push(63) - game.table_cards.push(63) - remove_from_discard(63) - log(`C63 in effect`) + game.persistent_events.push(C_GENSCHER) + game.table_cards.push(C_GENSCHER) + remove_from_discard(C_GENSCHER) + log(`C${C_GENSCHER} in effect`) vm_next() } @@ -5079,8 +5003,8 @@ function vm_government_resigns() { } function vm_grenztruppen() { - game.persistent_events.push(59) - permanently_remove(59) + game.persistent_events.push(C_GRENZTRUPPEN) + permanently_remove(C_GRENZTRUPPEN) vm_next() } @@ -5102,7 +5026,7 @@ function vm_heal_our_bleeding_wounds() { } function vm_helsinki_final_act() { - game.persistent_events.push(26) + game.persistent_events.push(C_HELSINKI_FINAL_ACT) vm_next() } @@ -5159,11 +5083,11 @@ function vm_kohl_proposes_reunification() { if (check_vp()) { return } - if (game.persistent_events.includes(86)) { - game.vm_event = 87 + if (game.persistent_events.includes(C_THE_WALL_MUST_GO)) { + game.vm_event = C_KOHL_PROPOSES_REUNIFICATION game.state = 'vm_common_european_home_play' } else { - permanently_remove(87) + permanently_remove(C_KOHL_PROPOSES_REUNIFICATION) vm_return() } @@ -5208,13 +5132,13 @@ function vm_legacy_of_1968() { } function vm_li_peng() { - game.persistent_events.push(53) - remove_from_discard(53) + game.persistent_events.push(C_LI_PENG) + remove_from_discard(C_LI_PENG) vm_next() } function vm_ligachev() { - game.persistent_events.push(99) + game.persistent_events.push(C_LIGACHEV) vm_next() } @@ -5240,9 +5164,9 @@ function vm_nagy_reburied(){ } function vm_national_salvation_front() { - game.persistent_events.push(102) - game.table_cards.push(102) - remove_from_discard(102) + game.persistent_events.push(C_NATIONAL_SALVATION_FRONT) + game.table_cards.push(C_NATIONAL_SALVATION_FRONT) + remove_from_discard(C_NATIONAL_SALVATION_FRONT) vm_next() } @@ -5266,10 +5190,10 @@ function vm_normalisation() { } function vm_peasant_parties_revolt() { - game.persistent_events.push(72) - log_msg_gap('C72 in effect') - game.table_cards.push(72) - remove_from_discard(72) + game.persistent_events.push(C_PEASANT_PARTIES_REVOLT) + log_msg_gap(`C${C_PEASANT_PARTIES_REVOLT} in effect`) + game.table_cards.push(C_PEASANT_PARTIES_REVOLT) + remove_from_discard(C_PEASANT_PARTIES_REVOLT) vm_next() } @@ -5307,8 +5231,8 @@ function vm_power_struggle() { } function vm_presidential_visit() { - game.persistent_events.push(65) - log_msg_gap('C65 in effect') + game.persistent_events.push(C_PRESIDENTIAL_VISIT) + log_msg_gap(`C${C_PRESIDENTIAL_VISIT} in effect`) vm_next() } @@ -5332,7 +5256,7 @@ function vm_public_against_violence() { } function vm_reformer_rehabilitated () { - permanently_remove(67) + permanently_remove(C_REFORMER_REHABILITATED) game.discard = true for (let card of game.strategy_discard) { if (!event_is_playable(card)) continue @@ -5439,7 +5363,7 @@ function vm_tear_gas () { 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') + log_msg_gap(`C${C_TEAR_GAS} in effect`) vm_next() } @@ -5497,7 +5421,6 @@ function vm_the_tyrant_is_gone() { game.state = 'vm_the_tyrant_is_gone' } - function vm_the_tyrant_is_gone_prep() { game.table_cards.push(C_THE_TYRANT_IS_GONE) remove_from_discard(C_THE_TYRANT_IS_GONE) @@ -5562,7 +5485,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { game.persistent_events.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - log_msg_gap('C62 in effect') + log_msg_gap(`C${C_YAKOVLEV_COUNSELS_GORBACHEV} in effect`) game.table_cards.push(C_YAKOVLEV_COUNSELS_GORBACHEV) remove_from_discard(C_YAKOVLEV_COUNSELS_GORBACHEV) vm_next() -- cgit v1.2.3 From 8d30191b69368d51652457da86e54dbcee9e8e85 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 08:43:15 +0000 Subject: Tidying up code --- rules.js | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/rules.js b/rules.js index c42160f..f4490db 100644 --- a/rules.js +++ b/rules.js @@ -5818,7 +5818,6 @@ states.vm_remove_x_infl = { } else if (game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')} from ${event_prompt()}.` - for (let space_id of game.valid_spaces) { gen_action_space(space_id); } @@ -5975,7 +5974,6 @@ states.vm_ceh_do_support_check = { roll() { clear_undo() do_sc(game.selected_space) - game.vm_available_ops-- if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -6011,7 +6009,6 @@ states.vm_1_support_check_prep = { gen_action('done') } else { view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}.` - for (let space_id of game.valid_spaces) { if (!space_id) continue gen_action_space(space_id); @@ -6197,7 +6194,6 @@ states.vm_central_committee_reshuffle = { log('Passed') vm_return() } - } states.vm_common_european_home_choose = { @@ -6294,7 +6290,7 @@ states.vm_play_event_from_discard = { if (game.valid_cards.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid cards in discard.` gen_action('pass') - } else if (game.temp === 0) { + } else { view.prompt = `${event_prompt()}.` for (let card of game.valid_cards) { gen_action('pass') @@ -6686,7 +6682,7 @@ states.vm_inflationary_currency_discard = { if (game.valid_cards.length === 0 ) { view.prompt = 'Inflationary Currency: no valid cards to discard. You must pass.' gen_action('pass') - } else if (game.temp === 0 ) { + } else { view.prompt = 'Inflationary Currency: you may discard a 3 op or higher value card to cancel the support check.' gen_action('pass') for (let card of game.valid_cards) { @@ -6714,16 +6710,6 @@ states.vm_inflationary_currency_discard = { game.vm_available_ops = 1 vm_next() }, - done() { - if (!game.vm_infl_to_do) { - if(game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } - vm_next() - } } @@ -7055,7 +7041,6 @@ states.vm_nepotism = { else { log(`Roll: D${roll} adds 1 SP`) game.vm_available_ops = 1} - vm_next() }, } @@ -7332,12 +7317,14 @@ states.vm_social_democratic_platform_adopted = { push_undo() game.vm_active_country = 'Poland' log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, + vm_next() + }, czechoslovakia() { push_undo() game.vm_active_country = 'Czechoslovakia' log(`Selected ${country_name(game.vm_active_country)}`) - vm_next()}, + vm_next() + }, hungary() { push_undo() game.vm_active_country = 'Hungary' @@ -7377,7 +7364,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED?*/ + game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ vm_next() }, } @@ -7464,7 +7451,7 @@ states.vm_the_chinese_solution = { }, pass() { push_undo() - permanently_remove(96) + permanently_remove(C_THE_CHINESE_SOLUTION) vm_return() } } @@ -7679,7 +7666,6 @@ states.vm_workers_revolt = { } } - states.vm_workers_revolt_finish = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -7708,7 +7694,6 @@ states.vm_workers_revolt_finish = { game.selected_space = 0 vm_next() }, - } // ==================== TIANANMEN SQUARE TRACK STATES ===================== @@ -7863,7 +7848,6 @@ states.vm_tst_8 = { } } - states.vm_tst_8_ops = { inactive: 'play card for operations.', prompt() { -- cgit v1.2.3 From b006bcdd2ba47d8157d4aba73589eef2094104f9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:31:51 +0000 Subject: Remove double undo steps --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index f4490db..ef4a9af 100644 --- a/rules.js +++ b/rules.js @@ -7158,7 +7158,6 @@ states.vm_nomenklatura_add = { } }, space(space) { - push_undo() vm_do_add_infl_free(space) if (game.vm_available_ops === 0 ) { game.valid_spaces = [] -- cgit v1.2.3 From c62df44216dc3b640597ad7d069bd35c0f4bf7fa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:53:37 +0000 Subject: Add small power cards --- play.css | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/play.css b/play.css index e574797..d14a5e5 100644 --- a/play.css +++ b/play.css @@ -40,6 +40,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .h1 { background-color: tan } #log .h2 { background-color: wheat } #log .h3 { background-color: wheat } +#log .h3 { background-color: wheat } #log .h2.dem { background-color: hsl(206, 85%, 80%); } #log .h2.com { background-color: hsl(355, 70%, 80%); } @@ -238,6 +239,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } min-height: 263px; } +.panel.autohide:has(.panel_body:empty) { +.panel_body.power { + min-height: 263px; +} + .panel.autohide:has(.panel_body:empty) { display: none; } @@ -268,6 +274,12 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } border-radius: 12px; } +.power_card { + width: 188px; + height: 263px; + border-radius: 12px; +} + .card.action { box-shadow: 0 0 0 1px #444, 0 0 0 4px white; } @@ -440,4 +452,4 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.power_49 { background-image: url(cards75/power_49.avif) } .card.power_50 { background-image: url(cards75/power_50.avif) } .card.power_51 { background-image: url(cards75/power_51.avif) } -.card.power_52 { background-image: url(cards75/power_52.avif) } +.card.power_52 { background-image: url(cards75/power_52.avif) } \ No newline at end of file -- cgit v1.2.3 From 19416752502804d00046456a798569c622e7800c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 17:59:05 +0000 Subject: Tor updates --- play.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/play.js b/play.js index 536beb6..c7e20ca 100644 --- a/play.js +++ b/play.js @@ -639,6 +639,12 @@ function on_update() { // UPDATE CARD DISPLAYS + ui.played_card.replaceChildren() + +/* ui.played_power_card.replaceChildren() + if (view.played_power_card > 0) + ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ + ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) -- cgit v1.2.3 From da0546400fb89739aaccc83e182569dab67d5cb2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 18:44:01 +0000 Subject: Fix Deutsche Marks --- Map.docx | Bin 0 -> 44689 bytes data.xlsx | Bin 0 -> 340281 bytes output.txt | 0 rules.js | 21 +++++++++------------ server.code-workspace | 10 ++++++++++ 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 Map.docx create mode 100644 data.xlsx create mode 100644 output.txt create mode 100644 server.code-workspace diff --git a/Map.docx b/Map.docx new file mode 100644 index 0000000..e23d852 Binary files /dev/null and b/Map.docx differ diff --git a/data.xlsx b/data.xlsx new file mode 100644 index 0000000..fd1cb69 Binary files /dev/null and b/data.xlsx differ diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/rules.js b/rules.js index ef4a9af..30b7848 100644 --- a/rules.js +++ b/rules.js @@ -1650,16 +1650,16 @@ states.vp_roll = { } }, roll () { - let vp_change = vp_roll[get_aftermath_roll()] + let roll = get_aftermath_roll() + let vp_change = vp_roll[roll] if (game.active === DEM) { log(`+${vp_change} VP`) } else { log(`-${vp_change} VP`) } - if (roll >= 4) if (game.active === DEM) {game.vp += vp_change} else {game.vp -= vp_change} - if (game.active === DEM && modified_roll >= 4) { + if (game.active === DEM && roll >= 4) { game.phase = 1 } else { game.phase = 0 @@ -4832,19 +4832,18 @@ function vm_civic_forum() { } function vm_common_european_home() { - let valid_cards = [] - for (let c = first_strategy_card; c <= last_strategy_card; ++c) { + let hands = [...game.democrat_hand, ...game.communist_hand] + for (let c of hands) { if (game.active === DEM) { if (cards[c].side === 'C') { - valid_cards.push(c) + game.valid_cards.push(c) } } else { if (cards[c].side === 'D') { - valid_cards.push(c) + game.valid_cards.push(c) } } } - game.valid_cards = valid_cards game.state = "vm_common_european_home_choose" } @@ -6352,10 +6351,8 @@ states.vm_deutsche_marks_confirm = { gen_action('done') }, done() { - if (cards[game.vm_event].side === "C") { - if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { - goto_vm(game.vm_event) - } + if (cards[game.vm_event].side === "C" && (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event))) { + goto_vm(game.vm_event) } else { next_player() game.state = 'vm_deutsche_marks' diff --git a/server.code-workspace b/server.code-workspace new file mode 100644 index 0000000..449c3b1 --- /dev/null +++ b/server.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../.." + } + ] +} \ No newline at end of file -- cgit v1.2.3 From aea07a9d0eff6bfc0b8c3fd366f6aef1c6710d22 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 19:26:09 +0000 Subject: Fix spaces starting at 0 not 1 --- play.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/play.js b/play.js index c7e20ca..5c68d8e 100644 --- a/play.js +++ b/play.js @@ -401,7 +401,7 @@ function create_ui() { ui.dem_inf = [] ui.com_inf = [] - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { let info = spaces[s] let [ x, y, w, h ] = LAYOUT[info.ascii_name] let xc = Math.round(x + w / 2) @@ -454,7 +454,6 @@ function create_ui() { power_card_e.className = "card power_card power_" + c ui.power_cards[c] = power_card_e } - ui.events = [] for (let id of box_events) { ui.events[id] = document.createElement("div") @@ -613,7 +612,7 @@ function on_update() { // UPDATE INFLUENCE VALUES - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] -- cgit v1.2.3 From d5f2e313c06eb2f264ef78cdc39a34de8d067442 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 19:26:49 +0000 Subject: Tor updates --- play.html | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/play.html b/play.html index f36d2dd..8499da2 100644 --- a/play.html +++ b/play.html @@ -66,19 +66,11 @@
    - -
    -
    Cards on the Table
    -
    -
    - -
    Played Card
    -
    Power Struggle Hand
    @@ -94,7 +86,6 @@
    -
    Hand
    @@ -134,4 +125,4 @@
    - + \ No newline at end of file -- cgit v1.2.3 From acbd70b2dda9555217bc31767a507322468e97fe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 09:31:25 +0000 Subject: Increase size of systematisation marker --- play.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/play.css b/play.css index d14a5e5..78c538f 100644 --- a/play.css +++ b/play.css @@ -210,6 +210,9 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } /* The Wall */ #event_9 { top: 175px; left: 216px; } +/* Systematisation */ +#event_69 {height: 65px; width: 65px; background-size: cover;} + /* CARD PANELS */ .panel { -- cgit v1.2.3 From a4e62015e0f0cdd6a8dd39622b4d606c1b9a5446 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 09:33:40 +0000 Subject: Small fixes --- play.js | 8 ++------ rules.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/play.js b/play.js index 5c68d8e..44f7b15 100644 --- a/play.js +++ b/play.js @@ -638,12 +638,6 @@ function on_update() { // UPDATE CARD DISPLAYS - ui.played_card.replaceChildren() - -/* ui.played_power_card.replaceChildren() - if (view.played_power_card > 0) - ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/ - ui.samizdat_card.replaceChildren() if (view.samizdat > 0) ui.samizdat_card.appendChild(ui.cards[view.samizdat]) @@ -741,6 +735,8 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") + +console.log('view.valid_cards', view.valid_cards, 'view.power_hand', view.power_hand) } // =========================== LOG FUNCTIONS ============================================== diff --git a/rules.js b/rules.js index 30b7848..1af9405 100644 --- a/rules.js +++ b/rules.js @@ -2577,7 +2577,7 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards[c] - if (card.name === power_cards[game.played_power_card].name) { + if (!leader_cards.includes(c) && card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(c) } else if (card.name === game.proxy_power_card) { valid_cards_set.add(c) @@ -4232,7 +4232,6 @@ function vm_valid_spaces_country () { if (vm_operand(1)) {country = vm_operand(1)} else {country = game.vm_active_country} for (let space of spaces) { - if (!space) continue if (space.country === country) { game.valid_spaces.push(space.space_id); } @@ -5800,7 +5799,12 @@ states.vm_remove_infl = { } }, done() { - do_log_summary() + if (game.summary.length > 0) { + pop_summary() + log_br() + } else { + log('No influence to remove') + } vm_next() } } @@ -5952,7 +5956,6 @@ states.vm_ceh_support_check_prep = { //Then check Austria-Hungary Border Reopened normally 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) { game.state = 'vm_austria_hungary_border_reopened_check' return @@ -6229,7 +6232,7 @@ states.vm_common_european_home_play = { influence(){ push_undo() log_gap(`Played C${game.vm_event} to place SPs`) - game.vm_available_ops = cards[game.vm_event].ops + game.vm_available_ops = get_card_ops(game.vm_event) valid_spaces_infl() // If ABHR - Set AHBR tracker to true if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { -- cgit v1.2.3 From 04fcb8518cb5909b16a3d2bb3ed97efd8f8b4704 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 19:11:14 +0000 Subject: Fix Tank Man/Tank Column not going to TST award --- rules.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/rules.js b/rules.js index 1af9405..7c69d1b 100644 --- a/rules.js +++ b/rules.js @@ -5354,6 +5354,31 @@ function vm_tank_column() { game.com_tst_position++ game.com_tst_attempted = 0 } + // Check if TST Awards occur + if (game.active === DEM) { + if (game.dem_tst_position === 3 && game.com_tst_position < 3) { + game.vm_event = 203 + goto_vm(game.vm_event) + return + } + else if (game.dem_tst_position === 4 && game.com_tst_position < 4) { + console.log('in space 4 check') + game.vm_event = 204 + goto_vm(game.vm_event) + return + } + + } else { + if (game.com_tst_position === 3 && game.dem_tst_position < 3) { + game.vm_event = 203 + goto_vm(game.vm_event) + return + } + else if (game.com_tst_position === 4 && game.dem_tst_position < 4) { + game.vm_event = 204} + goto_vm(game.vm_event) + return + } vm_next() } -- cgit v1.2.3 From 04490869aaf287131f8a15b286b704d2332f9102 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 19:23:02 +0000 Subject: Fix Kremlin Coup --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 7c69d1b..5e3168c 100644 --- a/rules.js +++ b/rules.js @@ -6903,7 +6903,7 @@ states.vm_kremlin_coup_sc_prep = { }, prompt() { view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` - space(game.selected_space); + gen_action_space(game.selected_space); }, space(space) { push_undo() @@ -6995,7 +6995,7 @@ states.vm_malta_summit = { let roll = roll_d6() log(`Roll: D${roll}`) if (game.stability > 0) { - log(`+${game.stability} from USSR Stability Track`) + logi(`+${game.stability} from USSR Stability Track`) log(`Modified roll: ${roll + game.stability}`) } if (roll + game.stability > 3) { -- cgit v1.2.3 From 394327bdf97daf2803d04f660e81d512030c5ad9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 31 Oct 2024 23:00:48 +0000 Subject: Remove unnecessary states and functions --- rules.js | 269 +++++++-------------------------------------------------------- 1 file changed, 28 insertions(+), 241 deletions(-) diff --git a/rules.js b/rules.js index 5e3168c..8344fdb 100644 --- a/rules.js +++ b/rules.js @@ -522,7 +522,7 @@ states.com_init = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, done() { do_log_summary() @@ -567,7 +567,7 @@ states.dem_init = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, done() { do_log_summary() @@ -801,13 +801,13 @@ states.resolve_opponent_event = { if (game.persistent_events.includes(58)) { game.austria_hungary_border_reopened_tracker = true } - game.state = 'finish_add_infl' + game.state = 'add_influence' valid_spaces_infl() }, support_check() { push_undo() game.available_ops = 2 - game.state = 'finish_support_check_prep' + game.state = 'support_check_prep' valid_spaces_sc() }, opp_event() { @@ -841,96 +841,6 @@ states.resolve_opponent_event = { } } -states.finish_add_infl = { - inactive: 'add SPs.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Place SPs: done.' - gen_action("end_round") - return; - } - view.prompt = `Add SPs: ${game.available_ops} remaining.` - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - }, - space(space) { - add_infl(space) - }, - end_round() { - push_undo() - do_log_summary() - end_round() - } -} - -states.finish_support_check_prep = { - inactive: 'do support checks.', - prompt () { - if (game.available_ops === 0) { - view.prompt = 'Support checks: done.' - gen_action('end_round') - } else { - view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` - console.log('valid_spaces', game.valid_spaces) - for (let space_id of game.valid_spaces) { - gen_action_space(space_id) - } - } - }, - space(space) { - push_undo() - game.selected_space = space - // Check for Austria-Hungary Border Reopened - check on first support check only - if (game.persistent_events.includes(58)){ - if (game.active === DEM && game.available_ops > 1) { - if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events.includes(58) && game.active === DEM) { - game.state = 'finish_austria_hungary_border_reopened_check' - return - } - } - } - game.state = 'finish_do_support_check' - }, - end_round () { - end_round() - } -} - -states.finish_austria_hungary_border_reopened_check = { - inactive: 'decide Austria-Hungary Border Reopened', - prompt() { - view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' - gen_action('yes') - gen_action('no') - }, - yes() { - game.austria_hungary_border_reopened_tracker = true - game.state = 'finish_do_support_check' - }, - no() { - game.state = 'finish_do_support_check' - } -} - -states.finish_do_support_check = { - inactive: 'do support checks', - prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` - gen_action('roll') - }, - roll() { - clear_undo() - do_sc(game.selected_space) - game.available_ops-- - if (game.available_ops === 0) { - game.valid_spaces = [] - } - game.state = 'finish_support_check_prep' - return - } -} - states.add_influence = { inactive: 'add SPs.', prompt () { @@ -938,7 +848,7 @@ states.add_influence = { view.prompt = 'Place SPs: done.' if (!game.vm_event_to_do) { gen_action("end_round") - } else { + } else {add_influence gen_action('done') } } else { @@ -949,7 +859,7 @@ states.add_influence = { } }, space(space) { - add_infl(space) + add_infl(space, 'available_ops') }, end_round() { push_undo() @@ -1301,7 +1211,7 @@ states.the_crowd_turns_against_ceausescu_infl = { } }, space(space) { - vm_do_add_infl(space) + add_infl(space, 'vm_available_ops') }, done() { do_log_summary() @@ -1620,10 +1530,7 @@ states.support_loss ={ }, space(space) { game.remove_opponent_infl = false /* Don't know why this is needed... */ - remove_infl(space) - if (game.available_ops === 0 ) { - game.valid_spaces = [] - } + remove_infl(space, 'available_ops') }, done () { do_log_summary() @@ -2178,7 +2085,7 @@ states.stasi_resolve_common_european_home = { // ==================== SUPPORTING STATE FUNCTIONS ============================= -function add_infl(space) { +function add_infl(space, ops) { push_undo() log_summary(`Added £ SP in %${space}`) @@ -2191,16 +2098,16 @@ function add_infl(space) { // Check Genscher if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany' && check_com_control(space)) { - game.available_ops-- + game[ops]-- log_summary(`(-1 op due to C${C_GENSCHER})`) } else if (check_opp_control(space)) { - game.available_ops -= 2 + game[ops] -= 2 //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.available_op will be negative - if (game.available_ops < 0) { + if (game[ops] < 0) { log_summary(`(Used +1 op from C${C_AUSTRIA_HUNGARY_BORDER_REOPENED})`) } } else { - game.available_ops-- + game[ops]-- } // Update influence values @@ -2212,8 +2119,8 @@ function add_infl(space) { check_tyrant() // Check Austria Hungary Border Reopened is true and condition has been met - 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 ++ + if (game[ops] === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { + game[ops] ++ log('+1 op from C58') game.austria_hungary_border_reopened_tracker = false game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') @@ -2223,7 +2130,7 @@ function add_infl(space) { // Check for Genscher & Austria Hungary Border Reopened - if (game.available_ops === 1) { + if (game[ops] === 1) { if (game.active === DEM) { if (game.persistent_events.includes(63) || (game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker)) { game.valid_spaces = game.valid_spaces.filter(n => !(check_opp_control(n) && spaces[n].country !== 'East_Germany')) @@ -2236,12 +2143,12 @@ function add_infl(space) { } //Clear valid spaces if no IP remaining. - if (game.available_ops <= 0 ) { + if (game[ops] <= 0 ) { game.valid_spaces = [] } } -function remove_infl(space) { +function remove_infl(space, ops) { push_undo() log_summary(`Removed £ SP from %${space}.`) @@ -2273,7 +2180,9 @@ function remove_infl(space) { } check_tyrant() } - game.available_ops-- + game[ops]-- + if (game.vm_influence_added && game.vm_influence_added[space]) {game.vm_influence_added[space]++} + if (game[ops]===0) {game.valid_spaces = []} } function do_sc(space) { @@ -4364,84 +4273,6 @@ function vm_take_control(space) { log(`Took control of %${space}`) } - -function vm_do_add_infl(space) { - push_undo() - log_summary(`Added £ SP in %${space}.`) - - //If AHBR - check AHBR condition - if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { - if (spaces[space].country !== 'East_Germany'){ - game.austria_hungary_border_reopened_tracker = false - } - } - - // Check Genscher - if (game.persistent_events.includes(C_GENSCHER) && game.active === DEM && spaces[space].country === 'East_Germany') { - game.vm_available_ops-- - log_summary(`(-1 op due to C63)`) - } else if (check_opp_control(space)) { - game.vm_available_ops -= 2 - //Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative - if (game.vm_available_ops < 0) { - log_summary(`(Used +1 op from C58)`) - } - } else { - game.vm_available_ops-- - } - - // Update influence values - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - check_tyrant() - - // Check Austria Hungary Border Reopened is true and condition has been met - if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker) { - game.vm_available_ops ++ - log('+1 Op from C58') - game.austria_hungary_border_reopened_tracker = false - game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') - } - - // If only 1 IP remaining, may not place in opponent controlled spaces - - // Check for Genscher & Austria Hungary Border Reopened - - if (game.vm_available_ops === 1) { - - if (game.active === DEM) { - //Check Genscher and AHBR - if (game.persistent_events.includes(C_GENSCHER) || (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) && game.austria_hungary_border_reopened_tracker)) { - game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) - } - } else { - game.valid_spaces = game.valid_spaces.filter(n => !check_dem_control(n)) - } - } - - //Clear valid spaces if no IP remaining. - if (game.vm_available_ops <= 0 ) { - game.valid_spaces = [] - } -} - -function vm_do_add_infl_free(space) { - push_undo() - log_summary(`Added £ SP in %${space}.`) - if (game.active === COM) { - game.comInfl[space]++ - } else { - game.demInfl[space]++ - } - game.vm_available_ops-- - check_tyrant() -} - function vm_add_infl() { if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} game.state = 'vm_add_infl' @@ -4525,50 +4356,6 @@ function vm_remove_x_opp_infl() { game.state = 'vm_remove_x_infl' } -function vm_do_remove_infl(space) { - push_undo() - log_summary(`Removed £ SP from %${space}.`) - - if (!game.vm_influence_added) { - game.vm_influence_added = {}; - } - - if (!game.vm_influence_added[space]) { - game.vm_influence_added[space] = 0; - } - if (game.remove_opponent_infl === true) { - if (game.active === COM) { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - - - } else { - if (game.active === COM) { - game.comInfl[space]-- - if (game.comInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } else { - game.demInfl[space]-- - if (game.demInfl[space] === 0) { - game.valid_spaces = game.valid_spaces.filter(id => id !== space); - } - } - } - check_tyrant() - game.vm_influence_added[space]++ - game.vm_available_ops-- - if (game.vm_available_ops===0) {game.valid_spaces = []} -} - function vm_do_remove_x_infl(space) { push_undo() @@ -5663,7 +5450,7 @@ states.vm_add_infl = { } }, space(space) { - vm_do_add_infl(space) + add_infl(space, 'vm_available_ops') if (game.vm_available_ops === 0) { game.valid_spaces = [] do_log_summary() @@ -5813,8 +5600,7 @@ states.vm_remove_infl = { } }, space(space) { - push_undo() - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') game.vm_active_country = spaces[space].country if (game.vm_event !== C_INFLATIONARY_CURRENCY) { if (game.vm_available_ops === 0 ) { @@ -7237,11 +7023,12 @@ states.vm_shock_therapy = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { + console.log('game.vm_active_country', game.vm_active_country) if (game.revolutions.every(n => n === false)) { view.prompt = 'Shock Therapy: no countries to choose.' gen_action('pass') } else { - if (game.vm_active_country === '' ) { + if (!game.vm_active_country || game.vm_active_country === '' ) { view.prompt = 'Shock Therapy: choose a country where you hold Power:' if (game.revolutions[0]) {gen_action('poland')} if (game.revolutions[1]) {gen_action('hungary')} @@ -7629,7 +7416,7 @@ states.vm_we_are_the_people_remove = { } }, space(space) { - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') }, done() { do_log_summary() @@ -7778,7 +7565,7 @@ states.vm_tst_4 = { } }, space(space) { - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') if (game.vm_available_ops === 0) { do_log_summary() vm_next() @@ -7925,7 +7712,7 @@ states.vm_scare_tactics = { }, space(space) { push_undo() - vm_do_remove_infl(space) + remove_infl(space, 'vm_available_ops') }, done() { do_log_summary() -- cgit v1.2.3 From 5d4a154685f03885fb1017f8208b8ea3fb66ddb9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 11:58:31 +0000 Subject: Restore vm_add_infl_free --- rules.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 8344fdb..ea99c2c 100644 --- a/rules.js +++ b/rules.js @@ -848,7 +848,7 @@ states.add_influence = { view.prompt = 'Place SPs: done.' if (!game.vm_event_to_do) { gen_action("end_round") - } else {add_influence + } else { gen_action('done') } } else { @@ -4273,6 +4273,20 @@ function vm_take_control(space) { log(`Took control of %${space}`) } +function vm_do_add_infl_free(space) { + push_undo() + log_summary(`Added £ SP in %${space}.`) + + // Update influence values + if (game.active === COM) { + game.comInfl[space]++ + } else { + game.demInfl[space]++ + } + game.vm_available_ops-- + check_tyrant() +} + function vm_add_infl() { if (vm_operand(1)) {game.vm_available_ops = vm_operand(1)} game.state = 'vm_add_infl' -- cgit v1.2.3 From 00ed233ebc5fc58e5763f3be3f2fa0db931da87d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 11:58:48 +0000 Subject: Fix for New Year's Eve party --- play.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/play.js b/play.js index 44f7b15..c5b3aaa 100644 --- a/play.js +++ b/play.js @@ -679,7 +679,8 @@ function on_update() { ui.persistent.replaceChildren() for (let c of view.persistent_events) - ui.persistent.appendChild(ui.cards[c]) + if (c < 111) + ui.persistent.appendChild(ui.cards[c]) ui.played_card.replaceChildren() if (view.played_card > 0) @@ -735,8 +736,6 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - -console.log('view.valid_cards', view.valid_cards, 'view.power_hand', view.power_hand) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From 49a0fcff3a85f533b5b75fed5b0987fc1dc543cb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 12:29:26 +0000 Subject: Single starting state, tidy up game object --- rules.js | 100 ++++++++++++++------------------------------------------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/rules.js b/rules.js index ea99c2c..22e0975 100644 --- a/rules.js +++ b/rules.js @@ -248,7 +248,7 @@ exports.setup = function (seed, scenario, options) { undo: [], summary: [], active: null, - state: "com_init", + state: 'place_starting_infl', return: '', vm: null, vm_event: 0, @@ -290,20 +290,13 @@ exports.setup = function (seed, scenario, options) { democrat_hand: [], communist_hand: [], - pwr_struggle_in: [], is_pwr_struggle: false, dem_pwr_hand_limit: 0, com_pwr_hand_limit: 0, dem_pwr_hand: [], com_pwr_hand: [], - raised_stakes_discard: 0, - raised_stakes: 0, - raised_stakes_round: 0, - phase: 0, times_held: [0, 0, 0, 0, 0, 0], revolutions: [false, false, false, false, false, false], - remove_opponent_infl: false, - tactics_fails: '', } log_h1("1989 Dawn of Freedom") @@ -324,10 +317,8 @@ function start_game() { }) //Set starting placement ops - game.starting_infl = { - com_starting_infl: 0, - dem_starting_infl: 0 - }, + game.starting_infl = [2, 3, 3, 4, 2] + game.temp = 0 // Set variable event cards where event is playable at start of game @@ -335,9 +326,8 @@ function start_game() { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) - game.valid_spaces = valid_spaces_setup() + valid_spaces_setup() game.available_ops = 2 - //game.phase = 0 /* Now redundant? */ log_h1("Place starting Support Points") log_side() } @@ -502,17 +492,17 @@ exports.action = function (state, player, action, arg) { // ============= GAME STATES ======================= -states.com_init = { +states.place_starting_infl = { inactive: 'place starting SPs.', prompt() { - if (game.starting_infl.dem_starting_infl === 2 && game.available_ops === 0 ) { + if (game.temp === 4 && game.available_ops === 0 ) { view.prompt = 'Place starting SPs: done. Start Turn 1.'; gen_action("start"); } else if (game.available_ops === 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; - } else if (game.starting_infl.dem_starting_infl === 2) { + } else if (game.temp > 2) { view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` } else { view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` @@ -526,63 +516,20 @@ states.com_init = { }, done() { do_log_summary() - game.starting_infl.com_starting_infl++ - if (game.starting_infl.com_starting_infl == 1){ - game.available_ops = 3 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 2) { - game.available_ops = 4 - game.state = 'dem_init' - valid_spaces_setup() - next_player() - } else if (game.starting_infl.com_starting_infl == 3) { - delete game.starting_infl - game.state = 'start_game' - } + game.temp ++ + game.available_ops = game.starting_infl[game.temp] + next_player() + valid_spaces_setup() }, start() { do_log_summary() + delete game.starting_infl new_turn() clear_undo() game.state = 'choose_card' } } -states.dem_init = { - inactive: 'place starting SPs.', - prompt() { - if (game.available_ops == 0) { - view.prompt = 'Place starting SPs: done.'; - gen_action("done"); - return; - } else if (game.starting_infl.com_starting_infl === 2) { - view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` - } else { - view.prompt = `Place ${pluralize(game.available_ops,'starting SP')}.` - } - for (let space_id of game.valid_spaces) { - gen_action_space(space_id); - } - }, - space(space) { - add_infl(space, 'available_ops') - }, - done() { - do_log_summary() - game.starting_infl.dem_starting_infl++ - if (game.starting_infl.dem_starting_infl == 1){ - game.available_ops = 3 - } else if (game.starting_infl.dem_starting_infl == 2) { - game.available_ops = 2 - } - game.state = 'com_init' - valid_spaces_setup() - next_player() - } -} - states.choose_card = { inactive: 'choose a card.', prompt() { @@ -2350,26 +2297,22 @@ function do_sc(space) { } function valid_spaces_setup() { - let valid_spaces_set = new Set(); for (let i =0 ; i < spaces.length ; i++) { let space = spaces[i] - if (game.state === 'com_init') { + if (game.active === COM) { let infl = game.demInfl[i] if (infl === 0) { - valid_spaces_set.add(space.space_id); + game.valid_spaces.push(space.space_id); } - } else if (game.state === 'dem_init') { + } else { let infl = game.comInfl[i] if (infl === 0) { - valid_spaces_set.add(space.space_id); + game.valid_spaces.push(space.space_id); } } } - // Convert the set to an array before returning - game.valid_spaces = Array.from(valid_spaces_set); - return game.valid_spaces; } function valid_spaces_sc() { @@ -3672,10 +3615,10 @@ function reset_power() { game.power_struggle_discard = [] game.dem_pwr_hand = [] game.com_pwr_hand = [] - //game.phase = 1 - game.raised_stakes_round = 0 - game.raised_stakes = 0 - game.played_power_card = 0 + delete game.phase + delete game.raised_stakes_round + delete game.raised_stakes + delete game.played_power_card delete game.tactics_fails game.view_opp_hand = false @@ -5017,6 +4960,7 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true game.phase = 0 + game.raised_stakes_round = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -5163,7 +5107,6 @@ function vm_tank_column() { return } else if (game.dem_tst_position === 4 && game.com_tst_position < 4) { - console.log('in space 4 check') game.vm_event = 204 goto_vm(game.vm_event) return @@ -7037,7 +6980,6 @@ states.vm_shock_therapy = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - console.log('game.vm_active_country', game.vm_active_country) if (game.revolutions.every(n => n === false)) { view.prompt = 'Shock Therapy: no countries to choose.' gen_action('pass') -- cgit v1.2.3 From d3893ad84c1da64fbfb8c19ae31045e6bebf66f1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 12:32:48 +0000 Subject: Shorten game object --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 22e0975..d022769 100644 --- a/rules.js +++ b/rules.js @@ -3189,7 +3189,8 @@ function end_round() { game.remove_opponent_infl = false game.is_pwr_struggle = false game.vm_infl_to_do = false /*Can get rid of this and use game.return_state? */ - game.vm_event_to_do = false + delete game.vm_event_to_do + delete game.vm_infl_to_do delete game.vm_active_country game.return_state = '' game.discard = false -- cgit v1.2.3 From b08cdc4fd508e615ecd3563614575dc54c90e93f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:27:15 +0000 Subject: Tidy up persistent events --- rules.js | 114 ++++++++++++++++++++++++--------------------------------------- 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/rules.js b/rules.js index d022769..c8ab1dc 100644 --- a/rules.js +++ b/rules.js @@ -252,8 +252,6 @@ exports.setup = function (seed, scenario, options) { return: '', vm: null, vm_event: 0, - vm_event_to_do: false, - vm_infl_to_do: false, played_card: 0, table_cards: [], @@ -1655,11 +1653,11 @@ states.end_turn_4_5_4 = { log('Communist player has a held scoring card') goto_game_over(DEM, `${DEM} won by held scoring card!`) } - else if (game.persistent_events.includes(104)) { + else if (game.persistent_events.includes(C_NEW_YEARS_EVE_PARTY)) { log_h1(`New Year's Eve Party`) game.vm_event = 104 //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } @@ -1674,7 +1672,7 @@ states.end_turn_4_5_4 = { log_h2('Final Scoring') //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(97)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } @@ -2861,6 +2859,13 @@ function get_aftermath_roll() { return modified_roll } +function add_to_persistent_events(card) { + game.persistent_events.push(card) + game.table_cards.push(card) + remove_from_discard(card) + log(`C${card} in effect`) +} + function permanently_remove(card) { if (game.strategy_removed.includes(card)) {return} remove_from_discard(card) @@ -3141,7 +3146,7 @@ function get_tst_6_ops() { function finish_the_wall() { if (game.the_wall_must_go['dem_wins'] === 2) { - game.persistent_events.push(86) + game.persistent_events.push(C_THE_WALL_MUST_GO) log('+3 VP') game.vp += 3 if (check_vp()) { @@ -3619,6 +3624,7 @@ function reset_power() { delete game.phase delete game.raised_stakes_round delete game.raised_stakes + delete game.raised_stakes_discard delete game.played_power_card delete game.tactics_fails game.view_opp_hand = false @@ -4493,8 +4499,7 @@ function vm_army_backs_revolution() { } function vm_austria_hungary_border_reopened() { - game.persistent_events.push(C_AUSTRIA_HUNGARY_BORDER_REOPENED) - permanently_remove(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4566,7 +4571,7 @@ function vm_civic_forum() { if (check_vp()) { return } - game.persistent_events.push(C_CIVIC_FORUM) + add_to_persistent_events(C_CIVIC_FORUM) if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { @@ -4628,12 +4633,12 @@ function vm_domino_theory() { } function vm_eco_glasnost() { - game.persistent_events.push(39) + add_to_persistent_events(C_ECO_GLASNOST) vm_next() } function vm_elena(){ - game.persistent_events.push(C_ELENA) + add_to_persistent_events(C_ELENA) vm_next() } @@ -4679,7 +4684,7 @@ function vm_foreign_currency_debt_burden() { if (check_vp()) { return } - game.persistent_events.push(C_FOREIGN_CURRENCY_DEBT_BURDEN) + add_to_persistent_events(C_FOREIGN_CURRENCY_DEBT_BURDEN) game.state = 'vm_foreign_currency_debt_burden' } @@ -4693,26 +4698,17 @@ function vm_foreign_television() { vm_next() } function vm_frg_embassies() { - game.persistent_events.push(C_FRG_EMBASSIES) - game.table_cards.push(C_FRG_EMBASSIES) - remove_from_discard(C_FRG_EMBASSIES) - log(`C${C_FRG_EMBASSIES} in effect`) + add_to_persistent_events(C_FRG_EMBASSIES) vm_next() } function vm_general_strike() { - game.persistent_events.push(C_GENERAL_STRIKE) - game.table_cards.push(C_GENERAL_STRIKE) - remove_from_discard(C_GENERAL_STRIKE) - log(`C${C_GENERAL_STRIKE} in effect`) + add_to_persistent_events(C_GENERAL_STRIKE) vm_next() } function vm_genscher() { - game.persistent_events.push(C_GENSCHER) - game.table_cards.push(C_GENSCHER) - remove_from_discard(C_GENSCHER) - log(`C${C_GENSCHER} in effect`) + add_to_persistent_events(C_GENSCHER) vm_next() } @@ -4746,8 +4742,7 @@ function vm_government_resigns() { } function vm_grenztruppen() { - game.persistent_events.push(C_GRENZTRUPPEN) - permanently_remove(C_GRENZTRUPPEN) + add_to_persistent_events(C_GRENZTRUPPEN) vm_next() } @@ -4769,12 +4764,12 @@ function vm_heal_our_bleeding_wounds() { } function vm_helsinki_final_act() { - game.persistent_events.push(C_HELSINKI_FINAL_ACT) + add_to_persistent_events(C_HELSINKI_FINAL_ACT) vm_next() } function vm_honecker() { - game.persistent_events.push(C_HONECKER) + add_to_persistent_events(C_HONECKER) game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -4854,7 +4849,7 @@ function vm_kremlin_coup() { } function vm_laszlo_tokes() { - game.persistent_events.push(C_LASZLO_TOKES) + add_to_persistent_events(C_LASZLO_TOKES) game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) game.state = 'vm_laszlo_tokes' } @@ -4875,13 +4870,12 @@ function vm_legacy_of_1968() { } function vm_li_peng() { - game.persistent_events.push(C_LI_PENG) - remove_from_discard(C_LI_PENG) + add_to_persistent_events(C_LI_PENG) vm_next() } function vm_ligachev() { - game.persistent_events.push(C_LIGACHEV) + add_to_persistent_events(C_LIGACHEV) vm_next() } @@ -4907,9 +4901,7 @@ function vm_nagy_reburied(){ } function vm_national_salvation_front() { - game.persistent_events.push(C_NATIONAL_SALVATION_FRONT) - game.table_cards.push(C_NATIONAL_SALVATION_FRONT) - remove_from_discard(C_NATIONAL_SALVATION_FRONT) + add_to_persistent_events(C_NATIONAL_SALVATION_FRONT) vm_next() } @@ -4933,17 +4925,12 @@ function vm_normalisation() { } function vm_peasant_parties_revolt() { - game.persistent_events.push(C_PEASANT_PARTIES_REVOLT) - log_msg_gap(`C${C_PEASANT_PARTIES_REVOLT} in effect`) - game.table_cards.push(C_PEASANT_PARTIES_REVOLT) - remove_from_discard(C_PEASANT_PARTIES_REVOLT) + add_to_persistent_events(C_PEASANT_PARTIES_REVOLT) vm_next() } function vm_perestroika() { - game.persistent_events.push(C_PERESTROIKA) - game.table_cards.push(C_PERESTROIKA) - log_msg_gap(`C${C_PERESTROIKA} in effect`) + add_to_persistent_events(C_PERESTROIKA) vm_next() } @@ -4961,7 +4948,9 @@ function vm_poszgay() { function vm_power_struggle() { game.is_pwr_struggle = true game.phase = 0 + game.raised_stakes = 0 game.raised_stakes_round = 0 + game.raised_stakes_discard = 0 game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)] log_h2(`C${game.vm_event}`) @@ -4975,7 +4964,7 @@ function vm_power_struggle() { } function vm_presidential_visit() { - game.persistent_events.push(C_PRESIDENTIAL_VISIT) + add_to_persistent_events(C_PRESIDENTIAL_VISIT) log_msg_gap(`C${C_PRESIDENTIAL_VISIT} in effect`) vm_next() } @@ -5014,10 +5003,8 @@ function vm_reformer_rehabilitated () { } function vm_roundtable_talks() { - game.persistent_events.push(17) - game.table_cards.push(17) - remove_from_discard(17) - log_msg_gap('C17 in effect') + add_to_persistent_events(C_ROUNDTABLE_TALKS) + vm_next() } @@ -5047,8 +5034,7 @@ function vm_samizdat() { } function vm_securitate() { - game.persistent_events.push(C_SECURITATE) - permanently_remove(C_SECURITATE) + add_to_persistent_events(C_SECURITATE) vm_next() } @@ -5061,27 +5047,24 @@ function vm_social_democratic_platform_adopted() { } function vm_solidarity_legalised() { - log_msg_gap(`C2 in effect`) game.playable_cards.push(C_WALESA) - game.persistent_events.push(C_SOLIDARITY_LEGALIZED) + add_to_persistent_events(C_SOLIDARITY_LEGALIZED) vm_next() } function vm_st_nicholas_church () { - game.persistent_events.push(C_ST_NICHOLAS_CHURCH) + add_to_persistent_events(C_ST_NICHOLAS_CHURCH) game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { - log_msg_gap('C13 in effect') - game.table_cards.push(C_STASI) - game.persistent_events.push(C_STASI) + add_to_persistent_events(C_STASI) vm_next() } function vm_stand_fast() { - game.persistent_events.push(C_STAND_FASTd) + add_to_persistent_events(C_STAND_FAST) if (game.active === DEM) { game.stand_fast = DEM } else {game.stand_fast = COM} @@ -5128,10 +5111,7 @@ function vm_tank_column() { } function vm_tear_gas () { - game.persistent_events.push(C_TEAR_GAS) - game.table_cards.push(C_TEAR_GAS) - remove_from_discard(C_TEAR_GAS) - log_msg_gap(`C${C_TEAR_GAS} in effect`) + add_to_persistent_events(C_TEAR_GAS) vm_next() } @@ -5166,9 +5146,7 @@ function vm_the_monday_demonstrations() { } function vm_the_sinatra_doctrine() { - game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - game.table_cards.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) + add_to_persistent_events(C_THE_SINATRA_DOCTRINE) vm_next() } @@ -5201,8 +5179,7 @@ function vm_tyrant_block() { } function vm_the_wall () { - game.persistent_events.push(C_THE_WALL) - log_msg_gap('C9 in effect') + add_to_persistent_events(C_THE_WALL) vm_next() } @@ -5221,7 +5198,7 @@ function vm_warsaw_pact_summit() { function vm_we_are_the_people() { if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]} - game.persistent_events.push(C_WE_ARE_THE_PEOPLE) + add_to_persistent_events(C_WE_ARE_THE_PEOPLE) if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -5252,10 +5229,7 @@ function vm_workers_revolt() { } function vm_yakovlev_counsels_gorbachev() { - game.persistent_events.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - log_msg_gap(`C${C_YAKOVLEV_COUNSELS_GORBACHEV} in effect`) - game.table_cards.push(C_YAKOVLEV_COUNSELS_GORBACHEV) - remove_from_discard(C_YAKOVLEV_COUNSELS_GORBACHEV) + add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) vm_next() } -- cgit v1.2.3 From 3ad232feb826c3d65384871bb27e73f199a819f9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:48:17 +0000 Subject: Improve log --- rules.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index c8ab1dc..2bc7fd2 100644 --- a/rules.js +++ b/rules.js @@ -2773,31 +2773,31 @@ function score_country(country) { log("No domination or control") log_gap(`Communist:`) if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) + logi(`Presence: -${value_presence} VP`) com_vp -= value_presence if (presence.com_battlegrounds > 0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } else { - log('No battlegrounds') + logi('No battlegrounds') } - log(`Total: ${com_vp} VP`) + logi(`Total: ${com_vp} VP`) } else { - log('No presence: 0 VP') + logi('No presence: 0 VP') } log_gap('Democrat:') if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) + logi(`Presence: +${value_presence} VP`) dem_vp += value_presence if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds } else { - log('No battlegrounds') + logi('No battlegrounds') } - log(`Total: +${dem_vp} VP`) + logi(`Total: +${dem_vp} VP`) } else { - log('No presence: 0 VP') + logi('No presence: 0 VP') } } @@ -2805,9 +2805,9 @@ function score_country(country) { let change_vp = dem_vp + com_vp game.vp += change_vp if (change_vp > 0 ) { - log_gap(`Final change VP: +${change_vp} VP`) + log_gap(`Scoring: +${change_vp} VP`) } else { - log_gap(`Final change VP: ${change_vp} VP`) + log_gap(`Scoring: ${change_vp} VP`) } } @@ -5864,6 +5864,7 @@ states.vm_brought_in_for_questioning = { } goto_vm(game.vm_event) } else { + log('Event does not occur') game.return = DEM vm_return() } -- cgit v1.2.3 From cd95ec65dcf7e640ef14aa7d0ef3b05286d1b9fa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:51:20 +0000 Subject: Don't permanently remove events now played to table --- rules.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rules.js b/rules.js index 2bc7fd2..13aaa53 100644 --- a/rules.js +++ b/rules.js @@ -8127,7 +8127,6 @@ CODE[48] = [ // We are the People!* ] CODE[49] = [ // Foreign Currency Debt Burden* - [ vm_permanently_remove ], [ vm_foreign_currency_debt_burden ], [ vm_return ], ] @@ -8522,13 +8521,11 @@ CODE[99] = [ // Ligachev* ] CODE[100] = [ // 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, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], @@ -8598,7 +8595,6 @@ CODE[107] = [ // Massacre in Timisoara* ] CODE[108] = [ // Army Backs Revolution* - [ vm_permanently_remove ], [ vm_army_backs_revolution ], [ vm_return ], ] -- cgit v1.2.3 From 6dddaba63d19d4fde768cdd44ea8de7f720b8491 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 13:52:21 +0000 Subject: Don't permanently remove events now played to table --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index 13aaa53..25a2f4b 100644 --- a/rules.js +++ b/rules.js @@ -8155,7 +8155,6 @@ CODE[52] = [ // Normalisation ] CODE[53] = [ // Li Peng* - [ vm_permanently_remove ], [ vm_li_peng ], [ vm_return ], ] -- cgit v1.2.3 From fd2926842979dac6e30e7cc8423e24140474db11 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 14:17:34 +0000 Subject: Fix new remove influence state --- rules.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 25a2f4b..a7a462c 100644 --- a/rules.js +++ b/rules.js @@ -2126,7 +2126,7 @@ function remove_infl(space, ops) { check_tyrant() } game[ops]-- - if (game.vm_influence_added && game.vm_influence_added[space]) {game.vm_influence_added[space]++} + if (game.vm_influence_added && game.vm_influence_added[space] >= 0) {game.vm_influence_added[space]++} if (game[ops]===0) {game.valid_spaces = []} } @@ -8285,7 +8285,6 @@ CODE[72] = [ // Peasant Parties Revolt ] CODE[73] = [ // Laszlo Tokes* - [ vm_permanently_remove ], [ vm_valid_spaces, 'Timisoara', 'Harghita/Covasna' ], [ vm_prompt, 'in Timisoara and Harghita/Covasna' ], [ vm_add_limited_infl, 2, 1 ], -- cgit v1.2.3 From 1b63e91f7ce8e1f80cd69c2d8c96c85d89b1db7e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 14:37:42 +0000 Subject: Fix persistent events being permanently removed --- events.txt | 9 --------- rules.js | 8 +++----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/events.txt b/events.txt index 637f6c7..4f0158f 100644 --- a/events.txt +++ b/events.txt @@ -362,13 +362,11 @@ remove_all_infl 1 CARD 48 - We are the People!* # The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig. -permanently_remove we_are_the_people CARD 49 - Foreign Currency Debt Burden* # The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country. -permanently_remove foreign_currency_debt_burden @@ -397,7 +395,6 @@ remove_all_infl 2 CARD 53 - Li Peng* # +1 modifier to all Communist Tiananmen Square track attempts for the rest of the game -permanently_remove li_peng @@ -528,7 +525,6 @@ peasant_parties_revolt CARD 73 - Laszlo Tokes* # Place 1 Democratic SP in Timisoara and Harghita/Covasna. The Democratic may then place SPs or make Support Check rolls in Romania using the Ops value of this card. Allows play of Massacre in Timisoara. -permanently_remove valid_spaces 'Timisoara', 'Harghita/Covasna' prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 @@ -614,7 +610,6 @@ remove_opp_infl 2 CARD 83 - Modrow* # Roll a die. If the die roll exceeds the number of Democratically controlled spaces in Germany, then place 4 Communist SPs in Germany, no more than 2 per space. -permanently_remove modrow valid_spaces_country 'East_Germany' prompt 'East Germany, no more than 2 per space' @@ -672,7 +667,6 @@ domino_theory CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. -permanently_remove valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 @@ -766,13 +760,11 @@ ligachev CARD 100 - Stand Fast* # -1 to opponent Support Checks in spaces you control for the rest of this turn. -permanently_remove stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -permanently_remove if !game.the_tyrant_is_gone valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' @@ -842,7 +834,6 @@ endif CARD 108 - Army Backs Revolution* # Place in front of the Democratic Player. Cancels effects of Securitate* event. -permanently_remove army_backs_revolution diff --git a/rules.js b/rules.js index a7a462c..05d1365 100644 --- a/rules.js +++ b/rules.js @@ -4890,6 +4890,7 @@ function vm_massacre_in_timisoara() { function vm_modrow() { game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER) + add_to_persistent_events(C_MODROW) game.state = 'vm_modrow' } @@ -7756,7 +7757,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ -// BEGIN EVENTS {{{ +// #region GENERATED EVENT CODE const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -8121,7 +8122,6 @@ CODE[47] = [ // Bulgarian Turks Expelled* ] CODE[48] = [ // We are the People!* - [ vm_permanently_remove ], [ vm_we_are_the_people ], [ vm_return ], ] @@ -8370,7 +8370,6 @@ CODE[82] = [ // Spitzel* ] CODE[83] = [ // Modrow* - [ vm_permanently_remove ], [ vm_modrow ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, 'East Germany, no more than 2 per space' ], @@ -8425,7 +8424,6 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* - [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -8650,4 +8648,4 @@ CODE[351] = [ // Scare Tactics [ vm_remove_opp_infl, 1 ], [ vm_return ], ] -// END EVENTS }}} +// #endregion -- cgit v1.2.3 From dc3d2c0e71f8b024cc80416fe029aa1d73222d58 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:09:12 +0000 Subject: More tweaks to permanently remove --- events.txt | 1 - rules.js | 36 +++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/events.txt b/events.txt index 4f0158f..0cccd73 100644 --- a/events.txt +++ b/events.txt @@ -472,7 +472,6 @@ add_limited_infl 11 1 CARD 65 - Presidential Visit* # The Communist's hand size is reduced to 7 next turn. -permanently_remove presidential_visit diff --git a/rules.js b/rules.js index 05d1365..9d5fb0d 100644 --- a/rules.js +++ b/rules.js @@ -1803,7 +1803,7 @@ states.general_strike = { if (total > 5) { log('The strike is over.') - permanently_remove(5) + permanently_remove(C_GENERAL_STRIKE) game.persistent_events = game.persistent_events.filter(n => n !== 5) } else { log('The strike continues. Required 6 or more') @@ -2374,14 +2374,14 @@ function valid_spaces_infl() { for (let i = 0; i < game.demInfl.length; i++) { let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; - + // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - if (adj_space_id) { + if (adj_space_id >= 0) { const adj_piece = spaces[adj_space_id]; // Check if the adjacent space is controlled by the opponent @@ -2391,9 +2391,9 @@ function valid_spaces_infl() { if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(C_GENSCHER)){ valid_spaces_set.add(adj_piece.space_id) } - + // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent - if (ops >= 2 || !opponent_control) { + if (ops >= 2 || !opponent_control) { valid_spaces_set.add(adj_piece.space_id) } } @@ -2867,9 +2867,9 @@ function add_to_persistent_events(card) { } function permanently_remove(card) { - if (game.strategy_removed.includes(card)) {return} + discard_from_table(card) remove_from_discard(card) - + if (game.strategy_removed.includes(card)) {return} let card_index = game.table_cards.indexOf(card) if (card_index !== -1) { game.table_cards.splice(card_index, 1) @@ -3405,7 +3405,8 @@ function new_turn() { if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 log('Communist draws 7 cards due to C65') - game.persistent_events = game.persistent_events.filter(n => n !== C_PRESIDENTIAL_VISIT) + permanently_remove(C_PRESIDENTIAL_VISIT) + game.persistent_events = game.persistent_events.filter( card => card !== C_PRESIDENTIAL_VISIT) } draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) game.com_hand_limit = 8 @@ -3596,8 +3597,9 @@ function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) if (find_card !== -1) { game.table_cards.splice(find_card, 1) - if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { - game.strategy_removed.push(card) + if (cards[card].remove === 1) { + if (!game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) } } else {game.strategy_discard.push(card) } } } @@ -4031,6 +4033,16 @@ function vm_valid_spaces() { vm_next(); } +function vm_valid_spaces_com() { + let operand = vm_operand(1) + let space = spaces.find(space => space.ascii_name === operand) + if (game.comInfl[space.space_id] >0) { + game.valid_spaces.push(space.space_id) + } + check_systematization(); + vm_next(); +} + function vm_valid_spaces_opponent () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { @@ -8232,7 +8244,6 @@ CODE[64] = [ // Legacy of 1968* ] CODE[65] = [ // Presidential Visit* - [ vm_permanently_remove ], [ vm_presidential_visit ], [ vm_return ], ] @@ -8488,7 +8499,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_valid_spaces_com, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8511,7 +8522,6 @@ CODE[98] = [ // Politburo Intrigue* ] CODE[99] = [ // Ligachev* - [ vm_permanently_remove ], [ vm_ligachev ], [ vm_return ], ] -- cgit v1.2.3 From dca4c68dd6987769fa98a0425a389eac336df434 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:15:20 +0000 Subject: Fix Gorby after Breakaway Baltic republics --- rules.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9d5fb0d..142002f 100644 --- a/rules.js +++ b/rules.js @@ -585,6 +585,7 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { + console.log('game.playable_cards', game.playable_cards) view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` if (scoring_cards.includes(game.played_card)) { @@ -3032,7 +3033,7 @@ function event_is_playable(card) { if (card === C_REFORMER_REHABILITATED) { return false } - //Check for Common European Hmme under Stasi + //Check for Common European Home under Stasi else if (game.stasi_card === C_COMMON_EUROPEAN_HOME && card === C_COMMON_EUROPEAN_HOME && game.active === DEM) { return false } @@ -3040,6 +3041,11 @@ function event_is_playable(card) { else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } + + //Check for Gorbachev Charms the West after Breakaway Baltic Republics + else if (card === C_GORBACHEV_CHARMS_THE_WEST && !game.playable_cards.includes(C_GORBACHEV_CHARMS_THE_WEST)) { + return false + } //Then check normally else if (cards[card].playable) { return true -- cgit v1.2.3 From cba31c4958fb137fe45bad52d1965038022b35ea Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:30:15 +0000 Subject: Fix the Tyrant is gone --- rules.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 142002f..56e31cb 100644 --- a/rules.js +++ b/rules.js @@ -585,7 +585,6 @@ states.play_card ={ return `play ${clean_name(cards[game.played_card].name)}.` }, prompt () { - console.log('game.playable_cards', game.playable_cards) view.prompt = `Play ${clean_name(cards[game.played_card].name)} for:` if (scoring_cards.includes(game.played_card)) { @@ -3652,14 +3651,14 @@ function reset_power() { } function check_tyrant() { - if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { + if (game.the_tyrant_is_gone > 0 && game.the_tyrant_is_gone !== 111 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 if (check_vp()) { return } game.persistent_events = game.persistent_events.filter(n => n !== C_THE_TYRANT_IS_GONE) - delete game.the_tyrant_is_gone + game.the_tyrant_is_gone = 111 } } -- cgit v1.2.3 From e53604ad8fe138be665cd20c4f48fb12b3ebc19a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:35:05 +0000 Subject: Fix Malta Summit when at max stability track --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 56e31cb..50df92b 100644 --- a/rules.js +++ b/rules.js @@ -6732,8 +6732,8 @@ states.vm_malta_summit = { let roll = roll_d6() log(`Roll: D${roll}`) if (game.stability > 0) { - logi(`+${game.stability} from USSR Stability Track`) - log(`Modified roll: ${roll + game.stability}`) + logi(`+${Math.min(game.stability, 3)} from USSR Stability Track`) + log(`Modified roll: ${roll + Math.min(game.stability, 3)}`) } if (roll + game.stability > 3) { log('Summit successful') -- cgit v1.2.3 From 984898844a97e31a5264077d2547b686ece4d563 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:09:44 +0000 Subject: Remove table cards --- rules.js | 76 ++++++++++++++++++---------------------------------------------- 1 file changed, 21 insertions(+), 55 deletions(-) diff --git a/rules.js b/rules.js index 50df92b..40d58b3 100644 --- a/rules.js +++ b/rules.js @@ -225,6 +225,7 @@ const switch_events = [6, 20, 71] const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 +const THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED = 540 // COUNTRY CONSTANTS @@ -254,7 +255,6 @@ exports.setup = function (seed, scenario, options) { vm_event: 0, played_card: 0, - table_cards: [], available_ops: 0, vm_available_ops: 0, valid_spaces: [], @@ -340,7 +340,6 @@ exports.view = function(state, player) { actions: null, played_card: game.played_card, - table_cards: game.table_cards, valid_spaces: game.valid_spaces, valid_cards: game.valid_cards, @@ -1040,7 +1039,6 @@ states.draw_power_cards = { log(`Democrat receives 2 cards from Communist due to C${C_ROUNDTABLE_TALKS}`) game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 - discard_from_table(C_ROUNDTABLE_TALKS) game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) } @@ -1081,13 +1079,13 @@ states.draw_power_cards = { log(`Democrat: ${game.dem_pwr_hand.length} cards`) //Check if The Crowd Turns Against Ceausescu occurs - if (game.table_cards.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && game.pwr_struggle_in === 'Romania') { + if (game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) && !game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) && game.pwr_struggle_in === 'Romania') { if (game.active === COM) { game.return = COM next_player() } log_h3(`C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU}`) - game.persistent_events.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + game.persistent_events.push(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) game.state = 'the_crowd_turns_against_ceausescu_prep' } else { log_h2('Raise the Stakes') @@ -1428,18 +1426,7 @@ states.power_struggle = { game.phase = 1 next_player() do_valid_cards() - }, - /*done () { - if (game.phase === 7) { - game.phase = 0 - log_msg_gap('Takes initiative') - do_valid_cards() - } else { - game.phase = 0 - next_player() - do_valid_cards() - } - }*/ + } } states.support_loss ={ @@ -1532,7 +1519,9 @@ states.vp_roll = { score_country(game.pwr_struggle_in) //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { + game.persistent_events = game.persistent_events.filter (c => c !== C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + game.persistent_events = game.persistent_events.filter (c => c !== THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) game.return_state = 'finish_scoring' if (game.active !== DEM) { next_player() @@ -1572,7 +1561,7 @@ states.choose_power = { score_country(game.pwr_struggle_in) //Check if The Tyrant is Gone occurs - if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(54)) { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { game.return_state = 'finish_scoring' if (game.active !== DEM) { next_player() @@ -1599,7 +1588,7 @@ states.the_tyrant_is_gone ={ } else { game.return = DEM } - log_h3(`C97`) + log_h3(`C${C_THE_TYRANT_IS_GONE}`) game.vm_event = C_THE_TYRANT_IS_GONE goto_vm(game.vm_event) } @@ -2861,20 +2850,15 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) - game.table_cards.push(card) remove_from_discard(card) log(`C${card} in effect`) } function permanently_remove(card) { - discard_from_table(card) remove_from_discard(card) - if (game.strategy_removed.includes(card)) {return} - let card_index = game.table_cards.indexOf(card) - if (card_index !== -1) { - game.table_cards.splice(card_index, 1) + if (!game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) } - game.strategy_removed.push(card) } function check_vp() { @@ -3186,8 +3170,8 @@ function end_round() { if (game.state === 'game_over') { return} - //Check if the card has been removed or played to table, and if a card has been not been played. If not, discard. - if (!game.strategy_removed.includes(game.played_card) && !game.table_cards.includes(game.played_card) && game.played_card > 0) { + //Check if the card needs to be discarded. + if (!game.strategy_removed.includes(game.played_card) && game.played_card > 0) { game.strategy_discard.push(game.played_card) } @@ -3213,9 +3197,9 @@ function end_round() { // Check for duplicate card entries let card_check if (game.samizdat_card > 0) { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card]; } else { - card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.table_cards, ...game.communist_hand, ... game.democrat_hand]; + card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand]; } function check_duplicates(array) { @@ -3227,12 +3211,12 @@ function end_round() { return [...new Set(duplicates)]; } - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) if (check_duplicates(card_check)) { console.log('card check', card_check) const duplicates = find_duplicates(card_check) - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) } //console.log('cards in game', card_check.length) @@ -3445,7 +3429,6 @@ function new_turn() { function end_one_turn_event(event) { game.persistent_events = game.persistent_events.filter(n => n !== event) - discard_from_table(event) log_summary(`C${event}`) } @@ -3598,17 +3581,6 @@ function discard_card(hand) { return discarded_card } -function discard_from_table(card) { - let find_card = game.table_cards.indexOf(card) - if (find_card !== -1) { - game.table_cards.splice(find_card, 1) - if (cards[card].remove === 1) { - if (!game.strategy_removed.includes(card)) { - game.strategy_removed.push(card) } - } else {game.strategy_discard.push(card) } - } -} - function add_midyear() { for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 2) @@ -3644,7 +3616,6 @@ function reset_power() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) } else if (game.persistent_events.includes(e)) { permanently_remove(e) - game.table_cards = game.table_cards.filter(card => card !== e) game.persistent_events = game.persistent_events.filter(n => n !== e) } } @@ -4511,7 +4482,7 @@ function vm_adamec() { function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) - game.table_cards.push(C_ARMY_BACKS_REVOLUTION) + add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) vm_next() } @@ -5012,7 +4983,6 @@ function vm_reformer_rehabilitated () { for (let card of game.strategy_discard) { if (!event_is_playable(card)) continue if (card === game.played_card) continue - if (game.table_cards.includes(card)) continue if (scoring_cards.includes(card)) continue game.valid_cards.push(card) @@ -5022,7 +4992,6 @@ function vm_reformer_rehabilitated () { function vm_roundtable_talks() { add_to_persistent_events(C_ROUNDTABLE_TALKS) - vm_next() } @@ -5151,8 +5120,7 @@ function vm_the_chinese_solution() { } function vm_the_crowd_turns_against_ceausescu() { - game.table_cards.push(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - remove_from_discard(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5186,8 +5154,7 @@ function vm_the_tyrant_is_gone() { } function vm_the_tyrant_is_gone_prep() { - game.table_cards.push(C_THE_TYRANT_IS_GONE) - remove_from_discard(C_THE_TYRANT_IS_GONE) + add_to_persistent_events(C_THE_TYRANT_IS_GONE) vm_next() } @@ -7238,7 +7205,6 @@ 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(C_THE_TYRANT_IS_GONE) }, done () { vm_next() @@ -8503,7 +8469,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], [ vm_valid_spaces_com, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], -- cgit v1.2.3 From d4901969f9b83b17b8a929feff64d80ee2f5c5e6 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:10:05 +0000 Subject: Fix Ligachev --- events.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/events.txt b/events.txt index 0cccd73..827524b 100644 --- a/events.txt +++ b/events.txt @@ -753,7 +753,6 @@ prompt 'make a support check in Bulgaria' CARD 99 - Ligachev* # -3 VP if the Democrat does not play Gorbachev Charms the West for the event his next action round. -3 VPs take effect as soon as the Democrat plays his card but before the effect of the Democrat's card takes place. -permanently_remove ligachev -- cgit v1.2.3 From 6712dce38ddd84a2426770f50f6c5a196097cda6 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:22:18 +0000 Subject: Tidy up TST Award logging --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 40d58b3..4275ee8 100644 --- a/rules.js +++ b/rules.js @@ -3403,7 +3403,7 @@ function new_turn() { //Check if TST effects need to be resolved if ((game.dem_tst_position >=5 && game.com_tst_position <= 4) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4)) { - log_h2('Tiananmen Square Track award') + log_h2('Tiananmen Square Track Award') if ((game.dem_tst_position >= 5 && game.com_tst_position <= 4 && game.active !== DEM) || (game.com_tst_position >= 5 && game.dem_tst_position <= 4 && game.active !== COM)) { next_player() -- cgit v1.2.3 From dac81dddc5883db6bad9a1e5699a8d51d23093af Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:22:43 +0000 Subject: Tidy up TST Award logging --- rules.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index 4275ee8..ce9fc11 100644 --- a/rules.js +++ b/rules.js @@ -3247,7 +3247,6 @@ function end_round() { return } else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') if (game.active !== DEM) { next_player() } @@ -3257,7 +3256,6 @@ function end_round() { goto_vm(206) return } else if (game.com_tst_position >= 6 && game.dem_tst_position <= 5) { - log_h2('Tiananmen Square Track Award') if (game.active !== COM) { next_player() } @@ -5236,18 +5234,18 @@ function discarded_card() { // =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== function vm_tst_3() { - log_gap('Tiananmen Square Track award') + log_gap('Tiananmen Square Track Award') game.state = 'vm_tst_3_prep' } function vm_tst_4() { - log_gap('Tiananmen Square Track award') + log_gap('Tiananmen Square Track Award') game.vm_available_ops = 2 game.remove_opponent_infl = true game.state = 'vm_tst_4' } function vm_tst_6() { - log_h3('Tiananmen Square Track award') + log_h3('Tiananmen Square Track Award') game.vm_available_ops = 1 game.temp = 1 //Set temp to 1, so that Card 1 is called during the support check, which has 2 ops game.state = 'vm_tst_6' -- cgit v1.2.3 From d35cf229559d5005d2e742742f8a1b87381f4d38 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:26:57 +0000 Subject: Reposition Tyrant is Gone --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index c5b3aaa..a46b49b 100644 --- a/play.js +++ b/play.js @@ -598,7 +598,7 @@ function on_update() { if (view.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" - ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 25 + "px" + ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" } else { ui.events[C_THE_TYRANT_IS_GONE].style.display = "none" } -- cgit v1.2.3 From 40aacfb71684d31d451813a40c139fdacb712153 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:39:02 +0000 Subject: Don't permanently remove eco-glasnost --- events.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/events.txt b/events.txt index 827524b..de4a3b4 100644 --- a/events.txt +++ b/events.txt @@ -278,7 +278,6 @@ add_infl_free 3 CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. -permanently_remove valid_spaces 'Ruse' prompt 'Ruse' add_x_infl 4 -- cgit v1.2.3 From 94d0d4db0d0fe1a600dd11aed0343ec23f8989f7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:39:51 +0000 Subject: Don't permanently remove eco-glasnost --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index ce9fc11..53166de 100644 --- a/rules.js +++ b/rules.js @@ -8019,7 +8019,6 @@ CODE[38] = [ // July Concept ] CODE[39] = [ // Eco-Glasnost* - [ vm_permanently_remove ], [ vm_valid_spaces, 'Ruse' ], [ vm_prompt, 'Ruse' ], [ vm_add_x_infl, 4 ], -- cgit v1.2.3 From 8f627b9c0ad5a1ba920c5dd1261c7ab9e89e0350 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:46:39 +0000 Subject: Fix end of round discarding --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 53166de..b437f6c 100644 --- a/rules.js +++ b/rules.js @@ -3171,7 +3171,8 @@ function end_round() { return} //Check if the card needs to be discarded. - if (!game.strategy_removed.includes(game.played_card) && game.played_card > 0) { + let discard_check = [...game.strategy_removed, ...game.persistent_events] + if (!discard_check.includes(game.played_card) && game.played_card > 0) { game.strategy_discard.push(game.played_card) } -- cgit v1.2.3 From b511614a05b19d6c4b97758573cf583db91cda68 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:53:46 +0000 Subject: More table cards tidying --- rules.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/rules.js b/rules.js index b437f6c..4c3d26a 100644 --- a/rules.js +++ b/rules.js @@ -7754,7 +7754,6 @@ CODE[1] = [ // Legacy of Martial Law* ] 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' ], @@ -7905,7 +7904,6 @@ CODE[23] = [ // Power Struggle - Hungary ] CODE[24] = [ // St Nicolas Church - [ vm_permanently_remove ], [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], @@ -7919,7 +7917,6 @@ CODE[25] = [ // Perestroika ] CODE[26] = [ // Helsinki Final Act* - [ vm_permanently_remove ], [ vm_helsinki_final_act ], [ vm_return ], ] -- cgit v1.2.3 From fe86d1ca1439e49715bfbaffc6cea90929670684 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:56:56 +0000 Subject: More table cards tidying --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index 4c3d26a..8c8a753 100644 --- a/rules.js +++ b/rules.js @@ -7803,7 +7803,6 @@ CODE[8] = [ // Prudence ] CODE[9] = [ // The Wall* - [ vm_permanently_remove ], [ vm_the_wall ], [ vm_return ], ] -- cgit v1.2.3 From d7c2df93a0dbfa462b482d26d470d69833c0a974 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 23:02:58 +0000 Subject: More table cards tidying --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 8c8a753..dff42c5 100644 --- a/rules.js +++ b/rules.js @@ -3428,6 +3428,7 @@ function new_turn() { function end_one_turn_event(event) { game.persistent_events = game.persistent_events.filter(n => n !== event) + game.strategy_removed.push(event) log_summary(`C${event}`) } @@ -7849,7 +7850,6 @@ CODE[14] = [ // Gorbachev Charms the West ] CODE[15] = [ // Honecker - [ vm_permanently_remove ], [ vm_honecker ], [ vm_return ], ] -- cgit v1.2.3 From c47245d2ff8f255ea2ad5bc1f45a721286bae235 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 23:17:09 +0000 Subject: More table cards tidying --- events.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/events.txt b/events.txt index de4a3b4..4176519 100644 --- a/events.txt +++ b/events.txt @@ -12,7 +12,6 @@ prompt 'make a Support Check in Poland' CARD 2 - Solidarity Legalised* # Place a Democratic SP in every uncontrolled Worker and Farmer space in Poland. Allows play of Walesa. -permanently_remove solidarity_legalised valid_spaces_solidarity_legalised prompt 'to every uncontrolled Worker and Farmer space in Poland' @@ -62,7 +61,6 @@ prudence CARD 9 - The Wall* # Place in front of the Communist Player. In his next Support Check in Germany cancel drm for any adjacent spaces controlled by the Democratic Player. -permanently_remove the_wall @@ -109,7 +107,6 @@ prompt 'select a space for the Support Check' CARD 15 - Honecker # The Communist Player may take any non-Power Struggle - card in the discard pile and put it in his hand. The Communist Player may take one extra action round this turn. May not be played as event after Modrow*. -permanently_remove honecker @@ -163,7 +160,6 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. -permanently_remove valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 @@ -177,7 +173,6 @@ perestroika CARD 26 - Helsinki Final Act* # +1 VP for every Support Check die roll by the Communist Player in Student or Intellectual spaces the rest of the game. -permanently_remove helsinki_final_act -- cgit v1.2.3 From ba32a0a6f63b56dba4e910ee7f1dff79c849727f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 07:50:36 +0000 Subject: Tracking persistent events --- data.xlsx | Bin 340281 -> 340959 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data.xlsx b/data.xlsx index fd1cb69..68c7c7f 100644 Binary files a/data.xlsx and b/data.xlsx differ -- cgit v1.2.3 From 28afa9183690236d77f5526a9ddc3ebed9637491 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 19:18:17 +0000 Subject: Update when can play Gorbachev Charms the West --- data.js | 2 +- data.xlsx | Bin 340959 -> 340946 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/data.js b/data.js index dceeca1..983cdab 100644 --- a/data.js +++ b/data.js @@ -1291,7 +1291,7 @@ const cards = [ {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false}, {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false}, {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, playable: true, red: false}, - {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: true, red: false}, + {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: false, red: false}, {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, playable: true, red: false}, {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, playable: true, red: false}, {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, playable: true, red: false}, diff --git a/data.xlsx b/data.xlsx index 68c7c7f..f04c786 100644 Binary files a/data.xlsx and b/data.xlsx differ -- cgit v1.2.3 From 7e5158ecaf5cb53c9bed95e58d197a06201f5d9d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 19:22:45 +0000 Subject: Verbose logs --- events.txt | 2 ++ rules.js | 69 ++++++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/events.txt b/events.txt index 4176519..84bfe37 100644 --- a/events.txt +++ b/events.txt @@ -362,6 +362,7 @@ we_are_the_people CARD 49 - Foreign Currency Debt Burden* # The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country. foreign_currency_debt_burden +logi `Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` CARD 50 - The Sinatra Doctrine* @@ -660,6 +661,7 @@ domino_theory CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. +permanently_remove valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 diff --git a/rules.js b/rules.js index dff42c5..2ee3e8a 100644 --- a/rules.js +++ b/rules.js @@ -306,7 +306,6 @@ exports.setup = function (seed, scenario, options) { function start_game() { // Draw cards game.strategy_deck = draw_deck() - reset_power() //Set starting influence spaces.forEach((space, index) => { @@ -2318,7 +2317,6 @@ function valid_spaces_sc() { if (infl !== 0 ) { // Check Events that block support checks in a given space if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} - if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue} if (game.persistent_events.includes(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue} if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && space.country === game.foreign_currency_debt_burden) {continue} @@ -2851,7 +2849,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - log(`C${card} in effect`) + log(`C${card} in effect:`) } function permanently_remove(card) { @@ -3024,15 +3022,10 @@ function event_is_playable(card) { else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } - - //Check for Gorbachev Charms the West after Breakaway Baltic Republics - else if (card === C_GORBACHEV_CHARMS_THE_WEST && !game.playable_cards.includes(C_GORBACHEV_CHARMS_THE_WEST)) { - return false - } //Then check normally - else if (cards[card].playable) { + else if (game.playable_cards.includes(card)) { return true - } else if (game.playable_cards.includes(card)) { + } else if (cards[card].playable) { return true } else { return false @@ -3040,11 +3033,7 @@ function event_is_playable(card) { } function get_card_ops(card) { - let ops = 0 - - if (card) { - ops = cards[card].ops - } + let ops = cards[card].ops if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card') { log(`+1 op from C${C_PERESTROIKA}`) @@ -3166,7 +3155,7 @@ function finish_the_wall() { // =========== MOVING THROUGH TURNS ============ function end_round() { - //Check if the game is over! + //Check if the game is over! WHY IS THIS NEEDED? if (game.state === 'game_over') { return} @@ -3288,7 +3277,6 @@ function end_round() { next_player() } else { log_h3('Democratic Action Round') - } if (game.democrat_hand.includes(game.stasi_card)) { log_h3('C13') @@ -3457,10 +3445,6 @@ function roll_d6() { return random(6) + 1 } -function find_space_index(name_unique) { - return spaces.findIndex(space => space && space.name_unique === name_unique) -} - function find_country_index(country) { return countries.indexOf(country) } @@ -3869,6 +3853,11 @@ function vm_next() { vm_exec(); } +function vm_logi(){ + logi(vm_operand(1)) + vm_next() +} + function vm_operand(a) { let x = CODE[game.vm.fp][game.vm.ip][a] if (a > 0 && typeof x === "function") @@ -4483,11 +4472,13 @@ function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) + logi(`${C_SECURITATE} no longer has any effect`) vm_next() } function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4495,7 +4486,6 @@ function vm_austria_hungary_border_reopened() { function vm_betrayal() { if (game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] > 0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_ROMANIA) } if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] >0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_BULGARIA) } - game.vm_available_ops = Math.max(game.demInfl[S_ORTHODOX_CHURCH_ROMANIA], game.demInfl[S_ORTHODOX_CHURCH_BULGARIA]) game.state = 'vm_switch_infl' } @@ -4559,7 +4549,6 @@ function vm_civic_forum() { if (check_vp()) { return } - add_to_persistent_events(C_CIVIC_FORUM) if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { @@ -4622,11 +4611,13 @@ function vm_domino_theory() { function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) + logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) vm_next() } function vm_elena(){ add_to_persistent_events(C_ELENA) + logi(`-1 modifier to Democratic Support checks in Romania for the rest of this turn`) vm_next() } @@ -4687,16 +4678,19 @@ function vm_foreign_television() { } function vm_frg_embassies() { add_to_persistent_events(C_FRG_EMBASSIES) + logi(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`) vm_next() } function vm_general_strike() { add_to_persistent_events(C_GENERAL_STRIKE) + logi(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`) vm_next() } function vm_genscher() { add_to_persistent_events(C_GENSCHER) + logi(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`) vm_next() } @@ -4731,6 +4725,7 @@ function vm_government_resigns() { function vm_grenztruppen() { add_to_persistent_events(C_GRENZTRUPPEN) + logi(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`) vm_next() } @@ -4753,11 +4748,13 @@ function vm_heal_our_bleeding_wounds() { function vm_helsinki_final_act() { add_to_persistent_events(C_HELSINKI_FINAL_ACT) + logi(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`) vm_next() } function vm_honecker() { add_to_persistent_events(C_HONECKER) + logi(`The Communist may take one extra Action Round this turn`) game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -4838,6 +4835,7 @@ function vm_kremlin_coup() { function vm_laszlo_tokes() { add_to_persistent_events(C_LASZLO_TOKES) + logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`) game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) game.state = 'vm_laszlo_tokes' } @@ -5041,20 +5039,25 @@ function vm_solidarity_legalised() { function vm_st_nicholas_church () { add_to_persistent_events(C_ST_NICHOLAS_CHURCH) + logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`) game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { add_to_persistent_events(C_STASI) + logi(`For the rest of this turn the Democrat must reveal the card he will play this Action Round before the Communist player plays his card`) vm_next() } function vm_stand_fast() { add_to_persistent_events(C_STAND_FAST) if (game.active === DEM) { + logi(`-1 Modifier to Support Checks in Democratic controlled spaces for the rest of this turn`) game.stand_fast = DEM - } else {game.stand_fast = COM} + } else { + logi(`-1 Modifier to Support Checks in Communist controlled spaces for the rest of this turn`) + game.stand_fast = COM} vm_next() } @@ -5099,6 +5102,7 @@ function vm_tank_column() { function vm_tear_gas () { add_to_persistent_events(C_TEAR_GAS) + logi(`+1 modifier to the next Communist Support Check in a Student space`) vm_next() } @@ -5121,6 +5125,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) + logi(`After the players draw cards for the next Power Struggle in Romania, the Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops equal to 3 times the number of Rally cards drawn. Allows play of C${C_THE_TYRANT_IS_GONE}`) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5133,6 +5138,7 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { add_to_persistent_events(C_THE_SINATRA_DOCTRINE) + logi(`+1 Ops value for cards played by the Democrat for the rest of this turn`) vm_next() } @@ -5165,6 +5171,7 @@ function vm_tyrant_block() { function vm_the_wall () { add_to_persistent_events(C_THE_WALL) + logi(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`) vm_next() } @@ -5184,6 +5191,7 @@ function vm_warsaw_pact_summit() { function vm_we_are_the_people() { if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]} add_to_persistent_events(C_WE_ARE_THE_PEOPLE) + logi(`The Communist may no longer make Support Checks in Leipzig`) if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -5215,6 +5223,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) + logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if he wins the next Power Struggle`) vm_next() } @@ -6675,6 +6684,9 @@ states.vm_switch_infl = { }, space(space) { push_undo() + if (game.vm_event === C_BETRAYAL) { + game.vm_available_ops = game.demInfl[space] + } vm_switch_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -7092,7 +7104,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ + //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ vm_next() }, } @@ -8105,6 +8117,7 @@ CODE[48] = [ // We are the People!* CODE[49] = [ // Foreign Currency Debt Burden* [ vm_foreign_currency_debt_burden ], + [ vm_logi, ()=>`Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` ], [ vm_return ], ] @@ -8400,6 +8413,7 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -8463,8 +8477,8 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces_com, 'Cluj-Napoca' ], + [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8624,3 +8638,4 @@ CODE[351] = [ // Scare Tactics [ vm_return ], ] // #endregion + -- cgit v1.2.3 From a85c0c22164362eb47916dc746dd747ea64602bd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 19:25:22 +0000 Subject: Fix merge error --- play.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/play.css b/play.css index 78c538f..f4c028f 100644 --- a/play.css +++ b/play.css @@ -242,11 +242,6 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } min-height: 263px; } -.panel.autohide:has(.panel_body:empty) { -.panel_body.power { - min-height: 263px; -} - .panel.autohide:has(.panel_body:empty) { display: none; } -- cgit v1.2.3 From ebadbb3e0414803b979cc03d84d92a1971fadb0c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 19:26:11 +0000 Subject: Add influence markers above 8 --- play.js | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/play.js b/play.js index a46b49b..ea3f70a 100644 --- a/play.js +++ b/play.js @@ -395,11 +395,16 @@ function create_country(id, name) { document.getElementById("markers").appendChild(e) } +const INF_DX = 35 +const INF_DY = 10 + function create_ui() { ui.layout_xy = [] ui.spaces = [] ui.dem_inf = [] ui.com_inf = [] + ui.dem_inf2 = [] + ui.com_inf2 = [] for (let s = 0; s <= last_space; ++s) { let info = spaces[s] @@ -428,15 +433,29 @@ function create_ui() { com_e.style.top = yc + 12 - 25 + "px" ui.com_inf[s] = com_e + let com_e2 = document.createElement("div") + com_e2.className = "marker comInfl hide" + com_e2.style.left = xc + 32 - 25 + INF_DX + "px" + com_e2.style.top = yc + 12 - 25 + INF_DY + "px" + ui.com_inf2[s] = com_e2 + let dem_e = document.createElement("div") dem_e.className = "marker demInfl hide" dem_e.style.left = xc - 32 - 25 + "px" dem_e.style.top = yc + 12 - 25 + "px" ui.dem_inf[s] = dem_e + let dem_e2 = document.createElement("div") + dem_e2.className = "marker demInfl hide" + dem_e2.style.left = xc - 32 - 25 - INF_DX + "px" + dem_e2.style.top = yc + 12 - 25 + INF_DY + "px" + ui.dem_inf2[s] = dem_e2 + document.getElementById("spaces").append(space_e) document.getElementById("markers").appendChild(com_e) + document.getElementById("markers").appendChild(com_e2) document.getElementById("markers").appendChild(dem_e) + document.getElementById("markers").appendChild(dem_e2) } ui.cards = [] @@ -550,6 +569,21 @@ function layout_country(id) { } } +function layout_inf_markers(cn, one, two, v, ctl) { + if (ctl) + cn += " ctl" + if (v > 8) { + one.className = cn + " v" + 8 + two.className = cn + " v" + (v - 8) + } else if (v > 0) { + one.className = cn + " v" + v + two.className = "hide" + } else { + one.className = "hide" + two.className = "hide" + } +} + function on_update() { if (!ui.spaces) create_ui() @@ -615,20 +649,8 @@ function on_update() { for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] - - if (demInfl - comInfl >= spaces[s].stability) - ui.dem_inf[s].className = "marker demInfl ctl v" + demInfl - else if (demInfl > 0) - ui.dem_inf[s].className = "marker demInfl v" + demInfl - else - ui.dem_inf[s].className = "marker demInfl hide" - - if (comInfl - demInfl >= spaces[s].stability) - ui.com_inf[s].className = "marker comInfl ctl v" + comInfl - else if (comInfl > 0) - ui.com_inf[s].className = "marker comInfl v" + comInfl - else - ui.com_inf[s].className = "marker comInfl hide" + layout_inf_markers("marker demInfl", ui.dem_inf[s], ui.dem_inf2[s], demInfl, demInfl - comInfl >= spaces[s].stability) + layout_inf_markers("marker comInfl", ui.com_inf[s], ui.com_inf2[s], comInfl, comInfl - demInfl >= spaces[s].stability) } // UPDATE COUNTRY MARKERS @@ -645,6 +667,7 @@ function on_update() { ui.hand.replaceChildren() for (let c of view.hand) ui.hand.appendChild(ui.cards[c]) + console.log('ui.hand', ui.hand) ui.power_hand.replaceChildren() if (view.power_hand) @@ -736,6 +759,8 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") + console.log('view.hand', view.hand) + console.log('ui.hand',ui.hand) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From 1d073110c0937e2a057efd0eeeef5223036c1187 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Nov 2024 20:36:16 +0100 Subject: Highlight selected space. --- play.css | 5 +++++ play.js | 3 +++ rules.js | 17 +++-------------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/play.css b/play.css index f2113ed..dc801f8 100644 --- a/play.css +++ b/play.css @@ -90,6 +90,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .space.Romania.action { border-color: peachpuff; } .space.Bulgaria.action { border-color: palegreen; } +.space.selected { + border-color: aqua; + box-shadow: 0 0 0 1px black, inset 0 0 0 1px black; +} + .space.tip { border-color: lime; box-shadow: 0 0 0 1px black, inset 0 0 0 1px black; diff --git a/play.js b/play.js index aa7a8b6..a201e8a 100644 --- a/play.js +++ b/play.js @@ -715,6 +715,9 @@ function on_update() { for (let e of action_register) e.classList.toggle("action", is_action(e.my_action, e.my_id)) + for (let s = 0; s <= last_space; ++s) + ui.spaces[s].classList.toggle("selected", view.selected_space === s) + action_button("yes", "Yes") action_button("no", "No") action_button("start", "Start") diff --git a/rules.js b/rules.js index dff42c5..3e4a867 100644 --- a/rules.js +++ b/rules.js @@ -387,19 +387,8 @@ exports.view = function(state, player) { view.drawn = game.vm.draw if (player === game.active) { - if (game.selected_space) { - view.valid_spaces = [game.selected_space] - } else { - view.valid_spaces = game.valid_spaces - } - } else { - view.valid_spaces = [] - } - - if (player === game.active) { - view.valid_cards = game.valid_cards - } else { - view.valid_cards = [] + if (game.selected_space >= 0) + view.selected_space = game.selected_space } if (player === DEM) { @@ -422,7 +411,7 @@ exports.view = function(state, player) { if (game.state === "game_over") { view.prompt = game.victory - } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { + } else if (game.active !== player) { if (states[game.state]) { let inactive = states[game.state].inactive if (typeof inactive === "function") -- cgit v1.2.3 From 677818d36c8491ea9f6978e547f1e5428e280628 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 20:33:57 +0000 Subject: Verbose logs --- rules.js | 123 ++++++++++++++------------------------------------------------- 1 file changed, 27 insertions(+), 96 deletions(-) diff --git a/rules.js b/rules.js index 6b3b7d8..82a98a3 100644 --- a/rules.js +++ b/rules.js @@ -250,6 +250,7 @@ exports.setup = function (seed, scenario, options) { summary: [], active: null, state: 'place_starting_infl', + state: 'place_starting_infl', return: '', vm: null, vm_event: 0, @@ -316,6 +317,8 @@ function start_game() { //Set starting placement ops game.starting_infl = [2, 3, 3, 4, 2] game.temp = 0 + game.starting_infl = [2, 3, 3, 4, 2] + game.temp = 0 // Set variable event cards where event is playable at start of game @@ -323,6 +326,7 @@ function start_game() { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) + valid_spaces_setup() valid_spaces_setup() game.available_ops = 2 log_h1("Place starting Support Points") @@ -382,6 +386,7 @@ exports.view = function(state, player) { } view.strategy_discard = game.strategy_discard + if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -410,7 +415,7 @@ exports.view = function(state, player) { if (game.state === "game_over") { view.prompt = game.victory - } else if (game.active !== player) { + } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { if (states[game.state]) { let inactive = states[game.state].inactive if (typeof inactive === "function") @@ -487,6 +492,7 @@ states.place_starting_infl = { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; + } else if (game.temp > 2) { } else if (game.temp > 2) { view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` } else { @@ -505,8 +511,15 @@ states.place_starting_infl = { game.available_ops = game.starting_infl[game.temp] next_player() valid_spaces_setup() + do_log_summary() + game.temp ++ + game.available_ops = game.starting_infl[game.temp] + next_player() + valid_spaces_setup() }, start() { + do_log_summary() + delete game.starting_infl do_log_summary() delete game.starting_infl new_turn() @@ -622,6 +635,7 @@ states.play_card ={ push_undo() log_gap(`Played C${game.played_card} for the event`) //game.phase = 1 /*Do I still need this?*/ + //game.phase = 1 /*Do I still need this?*/ game.vm_infl_to_do = true game.return = game.active game.vm_event = game.played_card @@ -649,6 +663,9 @@ states.play_card ={ if (check_vp()) { return } + if (check_vp()) { + return + } } // Check if card is opponent card with event that needs to be resolved @@ -734,12 +751,14 @@ states.resolve_opponent_event = { game.austria_hungary_border_reopened_tracker = true } game.state = 'add_influence' + game.state = 'add_influence' valid_spaces_infl() }, support_check() { push_undo() game.available_ops = 2 game.state = 'support_check_prep' + game.state = 'support_check_prep' valid_spaces_sc() }, opp_event() { @@ -792,13 +811,16 @@ states.add_influence = { }, space(space) { add_infl(space, 'available_ops') + add_infl(space, 'available_ops') }, end_round() { push_undo() do_log_summary() + do_log_summary() end_round() }, done() { + do_log_summary() do_log_summary() reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event' @@ -896,6 +918,7 @@ states.tst_goddess_draw = { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) } end_goddess() + end_goddess() } } @@ -2306,10 +2329,6 @@ function valid_spaces_sc() { if (infl !== 0 ) { // Check Events that block support checks in a given space if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} -<<<<<<< HEAD -======= - if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue} ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 if (game.persistent_events.includes(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue} if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && space.country === game.foreign_currency_debt_burden) {continue} @@ -2355,6 +2374,7 @@ function valid_spaces_infl() { let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; + // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); @@ -2372,6 +2392,7 @@ function valid_spaces_infl() { valid_spaces_set.add(adj_piece.space_id) } + // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent if (ops >= 2 || !opponent_control) { valid_spaces_set.add(adj_piece.space_id) @@ -2398,6 +2419,7 @@ function valid_cards(player_hand, presence) { continue } + if (card.socio === 0) { valid_cards_set.add(c) } else if (leaders.includes(card.socio) && presence[card.socio]) { @@ -2842,11 +2864,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) -<<<<<<< HEAD log(`C${card} in effect:`) -======= - log(`C${card} in effect`) ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 } function permanently_remove(card) { @@ -3035,15 +3053,7 @@ function event_is_playable(card) { } function get_card_ops(card) { -<<<<<<< HEAD let ops = cards[card].ops -======= - let ops = 0 - - if (card) { - ops = cards[card].ops - } ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card') { log(`+1 op from C${C_PERESTROIKA}`) @@ -3165,11 +3175,7 @@ function finish_the_wall() { // =========== MOVING THROUGH TURNS ============ function end_round() { -<<<<<<< HEAD //Check if the game is over! WHY IS THIS NEEDED? -======= - //Check if the game is over! ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 if (game.state === 'game_over') { return} @@ -3459,13 +3465,6 @@ function roll_d6() { return random(6) + 1 } -<<<<<<< HEAD -======= -function find_space_index(name_unique) { - return spaces.findIndex(space => space && space.name_unique === name_unique) -} - ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 function find_country_index(country) { return countries.indexOf(country) } @@ -4493,19 +4492,13 @@ function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) -<<<<<<< HEAD logi(`${C_SECURITATE} no longer has any effect`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) -<<<<<<< HEAD logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4576,10 +4569,6 @@ function vm_civic_forum() { if (check_vp()) { return } -<<<<<<< HEAD -======= - add_to_persistent_events(C_CIVIC_FORUM) ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { @@ -4642,19 +4631,13 @@ function vm_domino_theory() { function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) -<<<<<<< HEAD logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } function vm_elena(){ add_to_persistent_events(C_ELENA) -<<<<<<< HEAD logi(`-1 modifier to Democratic Support checks in Romania for the rest of this turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -4715,28 +4698,19 @@ function vm_foreign_television() { } function vm_frg_embassies() { add_to_persistent_events(C_FRG_EMBASSIES) -<<<<<<< HEAD logi(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } function vm_general_strike() { add_to_persistent_events(C_GENERAL_STRIKE) -<<<<<<< HEAD logi(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } function vm_genscher() { add_to_persistent_events(C_GENSCHER) -<<<<<<< HEAD logi(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -4771,10 +4745,7 @@ function vm_government_resigns() { function vm_grenztruppen() { add_to_persistent_events(C_GRENZTRUPPEN) -<<<<<<< HEAD logi(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -4797,19 +4768,13 @@ function vm_heal_our_bleeding_wounds() { function vm_helsinki_final_act() { add_to_persistent_events(C_HELSINKI_FINAL_ACT) -<<<<<<< HEAD logi(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } function vm_honecker() { add_to_persistent_events(C_HONECKER) -<<<<<<< HEAD logi(`The Communist may take one extra Action Round this turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -4890,10 +4855,7 @@ function vm_kremlin_coup() { function vm_laszlo_tokes() { add_to_persistent_events(C_LASZLO_TOKES) -<<<<<<< HEAD logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) game.state = 'vm_laszlo_tokes' } @@ -5097,20 +5059,14 @@ function vm_solidarity_legalised() { function vm_st_nicholas_church () { add_to_persistent_events(C_ST_NICHOLAS_CHURCH) -<<<<<<< HEAD logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { add_to_persistent_events(C_STASI) -<<<<<<< HEAD logi(`For the rest of this turn the Democrat must reveal the card he will play this Action Round before the Communist player plays his card`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -5166,10 +5122,7 @@ function vm_tank_column() { function vm_tear_gas () { add_to_persistent_events(C_TEAR_GAS) -<<<<<<< HEAD logi(`+1 modifier to the next Communist Support Check in a Student space`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -5192,10 +5145,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) -<<<<<<< HEAD logi(`After the players draw cards for the next Power Struggle in Romania, the Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops equal to 3 times the number of Rally cards drawn. Allows play of C${C_THE_TYRANT_IS_GONE}`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5208,10 +5158,7 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { add_to_persistent_events(C_THE_SINATRA_DOCTRINE) -<<<<<<< HEAD logi(`+1 Ops value for cards played by the Democrat for the rest of this turn`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -5244,10 +5191,7 @@ function vm_tyrant_block() { function vm_the_wall () { add_to_persistent_events(C_THE_WALL) -<<<<<<< HEAD logi(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -5267,10 +5211,7 @@ function vm_warsaw_pact_summit() { function vm_we_are_the_people() { if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]} add_to_persistent_events(C_WE_ARE_THE_PEOPLE) -<<<<<<< HEAD logi(`The Communist may no longer make Support Checks in Leipzig`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -5302,10 +5243,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) -<<<<<<< HEAD logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if he wins the next Power Struggle`) -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() } @@ -7186,11 +7124,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space -<<<<<<< HEAD //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ -======= - game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 vm_next() }, } @@ -8723,7 +8657,4 @@ CODE[351] = [ // Scare Tactics [ vm_return ], ] // #endregion -<<<<<<< HEAD -======= ->>>>>>> 1d073110c0937e2a057efd0eeeef5223036c1187 -- cgit v1.2.3 From 3b1f1fcecea5f891131ae891299a5884fc12db0c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 08:10:13 +0000 Subject: Auto show discard for events --- play.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index 8672373..3517802 100644 --- a/play.js +++ b/play.js @@ -667,7 +667,6 @@ function on_update() { ui.hand.replaceChildren() for (let c of view.hand) ui.hand.appendChild(ui.cards[c]) - console.log('ui.hand', ui.hand) ui.power_hand.replaceChildren() if (view.power_hand) @@ -695,6 +694,10 @@ function on_update() { ui.discard.replaceChildren() for (let c of view.strategy_discard) ui.discard.appendChild(ui.cards[c]) + if (view.discard) + document.getElementById("discard_panel").classList.remove("hide") + else + document.getElementById("discard_panel").classList.add("hide") ui.removed.replaceChildren() for (let c of view.strategy_removed) -- cgit v1.2.3 From efe638d90fbfc954dddadb2ff34598f0f3e08c73 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 08:48:19 +0000 Subject: Verbose logs --- rules.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/rules.js b/rules.js index 82a98a3..af568aa 100644 --- a/rules.js +++ b/rules.js @@ -811,16 +811,13 @@ states.add_influence = { }, space(space) { add_infl(space, 'available_ops') - add_infl(space, 'available_ops') }, end_round() { push_undo() do_log_summary() - do_log_summary() end_round() }, done() { - do_log_summary() do_log_summary() reset_austria_hungary_border_reopened() game.state = 'resolve_opponent_event' @@ -918,7 +915,6 @@ states.tst_goddess_draw = { draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.democrat_hand.length, game.communist_hand.length +1) } end_goddess() - end_goddess() } } @@ -1825,13 +1821,13 @@ states.honecker ={ log(`Communist chooses to take an extra Action Round due to C${C_HONECKER}`) log_h2(`Action Round ${game.round}`) game.round_player = COM - game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) + permanently_remove(C_HONECKER) game.state = 'choose_card' }, pass() { + push_undo() log(`C${C_HONECKER}: passed`) - game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) - //end_round() + permanently_remove(C_HONECKER) game.state = 'end_round' } } @@ -2868,6 +2864,7 @@ function add_to_persistent_events(card) { } function permanently_remove(card) { + game.persistent_events = game.persistent_events.filter( c => c !== card) remove_from_discard(card) if (!game.strategy_removed.includes(card)) { game.strategy_removed.push(card) @@ -3055,7 +3052,7 @@ function event_is_playable(card) { function get_card_ops(card) { let ops = cards[card].ops if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'general_strike') { log(`+1 op from C${C_PERESTROIKA}`) } ops ++ @@ -3092,7 +3089,7 @@ function get_card_ops(card) { } if (game.active === COM && game.prudence && game.prudence.COM < 0) { - if(game.state === 'choose_card') { + if(game.state === 'choose_card' || game.state === 'general_strike') { if (ops > 2) { log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else if (ops > 1) { @@ -3234,6 +3231,7 @@ function end_round() { //console.log('cards in game', card_check) if (game.turn <= 3) { if (card_check.length !== 40) { + console.log('cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (game.turn <=7) { @@ -4877,11 +4875,13 @@ function vm_legacy_of_1968() { function vm_li_peng() { add_to_persistent_events(C_LI_PENG) + logi(`+1 modifier to all Communist Tiananmen Square Track attempts for the rest of the game`) vm_next() } function vm_ligachev() { add_to_persistent_events(C_LIGACHEV) + logi(`-3VPs if the Democrat does not play C${C_GORBACHEV_CHARMS_THE_WEST} next Action Round`) vm_next() } @@ -4933,11 +4933,13 @@ function vm_normalisation() { function vm_peasant_parties_revolt() { add_to_persistent_events(C_PEASANT_PARTIES_REVOLT) + logi(`In the next Power Stuggle, if the Democrat controls a Farmer space draw 1 Power Struggle card at random from the Communist hand`) vm_next() } function vm_perestroika() { add_to_persistent_events(C_PERESTROIKA) + logi(`+1 Ops value for cards played by the Communist for the rest of this turn`) vm_next() } @@ -4982,10 +4984,10 @@ function vm_prudence() { } if (game.active === DEM) { game.prudence.COM -- - log(`${game.prudence.COM} to Communist ops this turn`) + log(`${game.prudence.COM} to Communist Ops this turn`) } else { game.prudence.DEM -- - log(`${game.prudence.DEM} to Democrat ops this turn`)} + log(`${game.prudence.DEM} to Democrat Ops this turn`)} vm_next() } -- cgit v1.2.3 From 0f97242b7812957b63fe11b33246260ad7eb8e3c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 08:58:16 +0000 Subject: Verbose logs --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index af568aa..38a003d 100644 --- a/rules.js +++ b/rules.js @@ -4897,6 +4897,7 @@ function vm_massacre_in_timisoara() { function vm_modrow() { game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER) add_to_persistent_events(C_MODROW) + logi(`Prevents play of C${C_HONECKER} for the event`) game.state = 'vm_modrow' } @@ -4909,6 +4910,7 @@ function vm_nagy_reburied(){ function vm_national_salvation_front() { add_to_persistent_events(C_NATIONAL_SALVATION_FRONT) + logi(`In the next Power Struggle in the Balkans, the Communist draws 2 random Power Struggle cards from the Democrat hand`) vm_next() } @@ -4974,7 +4976,7 @@ function vm_power_struggle() { function vm_presidential_visit() { add_to_persistent_events(C_PRESIDENTIAL_VISIT) - log_msg_gap(`C${C_PRESIDENTIAL_VISIT} in effect`) + logi(`Communist hand size is reduced to 7 next turn`) vm_next() } @@ -5012,6 +5014,7 @@ function vm_reformer_rehabilitated () { function vm_roundtable_talks() { add_to_persistent_events(C_ROUNDTABLE_TALKS) + logi(`In the next Power Struggle the Democrat draws 2 random Power Struggle cards from the Communist hand`) vm_next() } @@ -5042,6 +5045,7 @@ function vm_samizdat() { function vm_securitate() { add_to_persistent_events(C_SECURITATE) + logi(`The Democrat must reveal his Power Struggle cards at the start of Power Struggles in Romania`) vm_next() } @@ -5056,6 +5060,7 @@ function vm_social_democratic_platform_adopted() { function vm_solidarity_legalised() { game.playable_cards.push(C_WALESA) add_to_persistent_events(C_SOLIDARITY_LEGALIZED) + logi(`Allows play of C${C_WALESA}`) vm_next() } -- cgit v1.2.3 From 4e6c9fb098aadf7933d74caf8aca9c1e8df4c0b3 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:29:49 +0000 Subject: Add check held scoring card warning under Stasi --- rules.js | 61 +++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/rules.js b/rules.js index 38a003d..f88cca0 100644 --- a/rules.js +++ b/rules.js @@ -1047,6 +1047,7 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) + game.strategy_discard.push(C_ROUNDTABLE_TALKS) } if (game.persistent_events.includes(C_PEASANT_PARTIES_REVOLT)) { @@ -1061,7 +1062,6 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 1 game.com_pwr_hand_limit -= 1 permanently_remove(C_PEASANT_PARTIES_REVOLT) - game.persistent_events = game.persistent_events.filter(n => n !== C_PEASANT_PARTIES_REVOLT) } } @@ -1070,7 +1070,6 @@ states.draw_power_cards = { game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 permanently_remove(C_NATIONAL_SALVATION_FRONT) - game.persistent_events = game.persistent_events.filter(n => n !== C_NATIONAL_SALVATION_FRONT) } //Draw Power Cards @@ -1927,6 +1926,11 @@ states.stasi_end_round = { push_undo() log_gap(`Democrat selected C${card} as next card.`) game.stasi_card = card + if (!scoring_cards.includes(card) && count_scoring_cards() >= (7-game.round)){ + game.temp = card + game.state = 'stasi_confirm_scoring_card' + return + } game.state = 'stasi_finish' }, pass() { @@ -1936,6 +1940,18 @@ states.stasi_end_round = { }, } +states.stasi_confirm_scoring_card = { + inactive: 'choose a card.', + prompt() { + view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + gen_action('continue') + }, + continue() { + push_undo() + end_stasi_choose_card() + } +} + states.stasi_finish = { inactive: 'choose next card due to Stasi.', prompt() { @@ -1944,11 +1960,7 @@ states.stasi_finish = { }, done() { push_undo() - if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } + end_stasi_choose_card() } } @@ -2287,7 +2299,7 @@ function do_sc(space) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') } } - game.selected_space = 0 + delete game.selected_space } function valid_spaces_setup() { @@ -2860,7 +2872,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - log(`C${card} in effect:`) + if (card !== C_SYSTEMATIZATION) {log(`C${card}:`)} } function permanently_remove(card) { @@ -2912,16 +2924,20 @@ function reset_austria_hungary_border_reopened() { } function end_stasi_choose_card() { - game.round_player = COM - game.round ++ - log_h2(`Action Round ${game.round}`) - next_player() - game.valid_spaces = [] - if (game.persistent_events.includes(5)) { - log_h3('C5') - game.state = 'general_strike' + if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { + game.state = 'stasi_confirm' } else { - game.state = 'choose_card' + game.round_player = COM + game.round ++ + log_h2(`Action Round ${game.round}`) + next_player() + game.valid_spaces = [] + if (game.persistent_events.includes(5)) { + log_h3('C5') + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } } } @@ -3236,9 +3252,11 @@ function end_round() { } } else if (game.turn <=7) { if (card_check.length !== 81) { + console.log('cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (card_check.length !== 110) { + console.log('cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } @@ -4367,7 +4385,7 @@ function vm_remove_limited_opp_infl() { function vm_do_remove_limited_infl(space, max_infl) { push_undo() - log(`Removed SP from %${space}.`) + log(`Removed 1 SP from %${space}.`) game.vm_available_ops -- if (!game.vm_influence_added) { @@ -7131,7 +7149,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ + add_to_persistent_events(C_SYSTEMATIZATION) vm_next() }, } @@ -7457,7 +7475,7 @@ states.vm_workers_revolt_finish = { log('Workers Revolt successful') vm_replace_all_infl(game.temp) } else {log('Workers Revolt fails. Required 4 or more')} - game.selected_space = 0 + delete game.selected_space vm_next() }, } @@ -8278,7 +8296,6 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* - [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], [ vm_return ], -- cgit v1.2.3 From 309124946b0849fc3223c3874782a127b29d0e15 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:31:17 +0000 Subject: Replace numbers with card constants --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index 3517802..0858ece 100644 --- a/play.js +++ b/play.js @@ -748,8 +748,8 @@ function on_update() { action_button("petition", "Petition") action_button("bonus", "Calculate VP bonus") action_button("scoring", "Score country") - action_button("retain", "Retain Power") action_button("surrender", "Surrender Power") + action_button("retain", "Retain Power") action_button("take", "Take Power") action_button("concede", "Concede") action_button("struggle", "Begin power struggle") -- cgit v1.2.3 From 2304345d1092f47265e9a4bb22ecc915863f7413 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:31:40 +0000 Subject: Restore systematisation --- events.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/events.txt b/events.txt index b9b187a..54203f1 100644 --- a/events.txt +++ b/events.txt @@ -496,7 +496,6 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -permanently_remove valid_spaces_country 'Romania' systematization -- cgit v1.2.3 From a9520ca410a00f0bcbaba948fa34130ca7dd8c75 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:34:34 +0000 Subject: Gender neutral language --- rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index f88cca0..23db4f4 100644 --- a/rules.js +++ b/rules.js @@ -5063,7 +5063,7 @@ function vm_samizdat() { function vm_securitate() { add_to_persistent_events(C_SECURITATE) - logi(`The Democrat must reveal his Power Struggle cards at the start of Power Struggles in Romania`) + logi(`The Democrat must reveal their Power Struggle cards at the start of Power Struggles in Romania`) vm_next() } @@ -5091,7 +5091,7 @@ function vm_st_nicholas_church () { function vm_stasi() { add_to_persistent_events(C_STASI) - logi(`For the rest of this turn the Democrat must reveal the card he will play this Action Round before the Communist player plays his card`) + logi(`For the rest of this turn the Democrat must reveal the card they will play this Action Round before the Communist player plays a card`) vm_next() } @@ -5268,7 +5268,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) - logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if he wins the next Power Struggle`) + logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if they wins the next Power Struggle`) vm_next() } -- cgit v1.2.3 From 56d629eaa2823d7b2d4d498a5360606223f8b723 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:54:17 +0000 Subject: Fix Kiss of Death with Reformer Rehabilitated --- rules.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 23db4f4..a5efc95 100644 --- a/rules.js +++ b/rules.js @@ -6069,7 +6069,7 @@ states.vm_dash_for_the_west = { states.vm_play_event_from_discard = { get inactive() { - return `resolve ${clean_name(cards[game.played_card].name)}.` + return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt() { if (game.valid_cards.length === 0) { @@ -6085,6 +6085,7 @@ states.vm_play_event_from_discard = { }, card(card) { push_undo() + log(`C${this_card()}:`) log(`Chose C${card}`) game.vm_event = card game.vm_available_ops = cards[card].ops @@ -6512,9 +6513,14 @@ states.vm_kiss_of_death = { discard() { 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 !== C_COMMON_EUROPEAN_HOME) { - next_player() + //Change player before checking if event is playable. Common European Home is not playable here + change_player() + // Special check for the Reformer Rehabilitated + if (game.vm_event === C_REFORMER_REHABILITATED && game.dem_tst_position > game.com_tst_position) { + log_side() + game.state = 'vm_kiss_of_death_finish' + } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { + log_side() game.state = 'vm_kiss_of_death_finish' } else { log('Event does not occur') -- cgit v1.2.3 From 7b97d2c42bcb5b1be04b35400a10aeffb0023d4e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 13:36:51 +0000 Subject: Fix Power Struggle reset --- rules.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/rules.js b/rules.js index a5efc95..efb2771 100644 --- a/rules.js +++ b/rules.js @@ -2726,23 +2726,23 @@ function score_country(country) { if (presence.dem_control || presence.dem_domination) { log(`Democrat:`) if (presence.dem_control) { - log(`Control: +${value_control} VP`) + logi(`Control: +${value_control} VP`) dem_vp += value_control } else { - log(`Domination: +${value_domination} VP`) + logi(`Domination: +${value_domination} VP`) dem_vp += value_domination } - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds log(`Total: +${dem_vp} VP`) log_gap('Communist:') if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) + logi(`Presence: -${value_presence} VP`) com_vp -= value_presence if (presence.com_battlegrounds >0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } log(`Total: ${com_vp} VP`) @@ -2753,23 +2753,23 @@ function score_country(country) { else if (presence.com_control || presence.com_domination) { log('Communist:') if (presence.com_control) { - log(`Control: -${value_control} VP`) + logi(`Control: -${value_control} VP`) com_vp -= value_control } else { - log(`Domination: -${value_domination} VP`) + logi(`Domination: -${value_domination} VP`) com_vp -= value_domination } - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds log(`Total: ${com_vp} VP`) log_gap('Democrat:') if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) + logi(`Presence: +${value_presence} VP`) dem_vp += value_presence if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds } log (`Total: +${dem_vp} VP`) @@ -2848,20 +2848,20 @@ function get_aftermath_roll() { if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + logi(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) modified_roll ++ } if (modified_roll < 0) {modified_roll = 0} else if (modified_roll > 7) {modified_roll = 7} if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) + logi(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P1') + logi('+2 from winning on a P1') } if (petition_win !== 0) { - log('-2 from winning on a P31') + logi('-2 from winning on a P31') } if (modified_roll !== roll) { log(`Modified roll: ${modified_roll}`) @@ -2872,7 +2872,8 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - if (card !== C_SYSTEMATIZATION) {log(`C${card}:`)} + let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN] + if (!silent_cards.includes(card)) {log(`C${card}:`)} } function permanently_remove(card) { @@ -3628,15 +3629,14 @@ function reset_power() { delete game.tactics_fails game.view_opp_hand = false - let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU, C_SECURITATE] + let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU] for (let e of scoring_events ) { - if ( e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU && game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { - permanently_remove(e) - } else if (e === C_SECURITATE && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(e)){ - game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + if (e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU ) { + if (game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { + permanently_remove(e) + } } else if (game.persistent_events.includes(e)) { permanently_remove(e) - game.persistent_events = game.persistent_events.filter(n => n !== e) } } } @@ -5170,7 +5170,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - logi(`After the players draw cards for the next Power Struggle in Romania, the Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops equal to 3 times the number of Rally cards drawn. Allows play of C${C_THE_TYRANT_IS_GONE}`) + logi(`Power Struggle: Romania. Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops 3 times the number of Rallies. Allows play of C${C_THE_TYRANT_IS_GONE}`) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } -- cgit v1.2.3 From a0c219d8fd1e911d607de236c4c1e1634aef3d69 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 14:13:52 +0000 Subject: Fix Tank Man/Tank Column --- rules.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index efb2771..72c9689 100644 --- a/rules.js +++ b/rules.js @@ -3225,7 +3225,7 @@ function end_round() { } else { card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand]; } - + card_check = card_check.filter(card => card <= last_strategy_card) function check_duplicates(array) { return new Set(array).size !== array.length; } @@ -5138,9 +5138,10 @@ function vm_tank_column() { return } else if (game.com_tst_position === 4 && game.dem_tst_position < 4) { - game.vm_event = 204} + game.vm_event = 204 goto_vm(game.vm_event) return + } } vm_next() } -- cgit v1.2.3 From 68824b3a1e7fe53d2b1ce1d4826f6bb57fdad9ba Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 16:28:53 +0000 Subject: The Wall no longer playable after the Wall Must Go --- data.js | 2 +- rules.js | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/data.js b/data.js index 983cdab..adf7f61 100644 --- a/data.js +++ b/data.js @@ -1286,7 +1286,7 @@ const cards = [ {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false}, {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false}, {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false}, - {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: true, red: false}, + {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: false, red: false}, {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, playable: true, red: false}, {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false}, {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false}, diff --git a/rules.js b/rules.js index 72c9689..1a1896d 100644 --- a/rules.js +++ b/rules.js @@ -317,16 +317,13 @@ function start_game() { //Set starting placement ops game.starting_infl = [2, 3, 3, 4, 2] game.temp = 0 - game.starting_infl = [2, 3, 3, 4, 2] - game.temp = 0 // Set variable event cards where event is playable at start of game - game.playable_cards = [C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE] + game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE] draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) - valid_spaces_setup() valid_spaces_setup() game.available_ops = 2 log_h1("Place starting Support Points") @@ -518,8 +515,6 @@ states.place_starting_infl = { valid_spaces_setup() }, start() { - do_log_summary() - delete game.starting_infl do_log_summary() delete game.starting_infl new_turn() @@ -634,8 +629,6 @@ states.play_card ={ opp_event() { push_undo() log_gap(`Played C${game.played_card} for the event`) - //game.phase = 1 /*Do I still need this?*/ - //game.phase = 1 /*Do I still need this?*/ game.vm_infl_to_do = true game.return = game.active game.vm_event = game.played_card @@ -663,9 +656,6 @@ states.play_card ={ if (check_vp()) { return } - if (check_vp()) { - return - } } // Check if card is opponent card with event that needs to be resolved @@ -751,14 +741,12 @@ states.resolve_opponent_event = { game.austria_hungary_border_reopened_tracker = true } game.state = 'add_influence' - game.state = 'add_influence' valid_spaces_infl() }, support_check() { push_undo() game.available_ops = 2 game.state = 'support_check_prep' - game.state = 'support_check_prep' valid_spaces_sc() }, opp_event() { @@ -3159,6 +3147,7 @@ function get_tst_6_ops() { function finish_the_wall() { if (game.the_wall_must_go['dem_wins'] === 2) { game.persistent_events.push(C_THE_WALL_MUST_GO) + game.playable_cards = game.playable_cards.filter(card => card !== C_THE_WALL) log('+3 VP') game.vp += 3 if (check_vp()) { @@ -3180,7 +3169,7 @@ function finish_the_wall() { if (game.active === DEM) {next_player()} vm_next () } else { - permanently_remove(86) + permanently_remove(C_THE_WALL_MUST_GO) delete game.the_wall_must_go vm_return() } -- cgit v1.2.3 From af65168bd752f5d91feabb3bc6870c9af20aca4a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 16:32:57 +0000 Subject: Ignore data.xslx --- .gitignore | 1 + data.xlsx | Bin 340946 -> 0 bytes 2 files changed, 1 insertion(+) create mode 100644 .gitignore delete mode 100644 data.xlsx diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f59b65 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data.xlsx \ No newline at end of file diff --git a/data.xlsx b/data.xlsx deleted file mode 100644 index f04c786..0000000 Binary files a/data.xlsx and /dev/null differ -- cgit v1.2.3 From b3ea4b527ef8872675c39271fd5fbdff378d0c2e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 16:44:55 +0000 Subject: Change remove to true/false --- data.js | 220 ++++++++++++++++++++++++++++++++-------------------------------- play.js | 2 +- 2 files changed, 111 insertions(+), 111 deletions(-) diff --git a/data.js b/data.js index adf7f61..cf6ec1b 100644 --- a/data.js +++ b/data.js @@ -1278,116 +1278,116 @@ const spaces = [ const cards = [ null, - {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, - {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: 1, playable: true, red: true}, - {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: 1, playable: false, red: false}, - {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: 1, playable: true, red: false}, - {number: 5, period: 1, side: 'D', name: 'General Strike*', ops: 3, remove: 0, playable: true, red: false}, - {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: 0, playable: true, red: false}, - {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: 1, playable: true, red: false}, - {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: 0, playable: true, red: false}, - {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: 1, playable: false, red: false}, - {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: 1, playable: true, red: false}, - {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: 0, playable: true, red: false}, - {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: 1, playable: true, red: false}, - {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: 1, playable: true, red: false}, - {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: 0, playable: false, red: false}, - {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: 1, playable: true, red: false}, - {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: 1, playable: true, red: false}, - {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: 0, playable: true, red: false}, - {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: 1, playable: true, red: false}, - {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: 1, playable: true, red: false}, - {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: 1, playable: true, red: false}, - {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: 0, playable: true, red: false}, - {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: 0, playable: true, red: false}, - {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: 0, playable: true, red: false}, - {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: 1, playable: true, red: true}, - {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: 1, playable: true, red: false}, - {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: 1, playable: true, red: true}, - {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: 0, playable: true, red: false}, - {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: 0, playable: true, red: false}, - {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: 1, playable: true, red: false}, - {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: 1, playable: true, red: false}, - {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: 0, playable: true, red: false}, - {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: 1, playable: true, red: false}, - {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: 1, playable: true, red: true}, - {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: 1, playable: true, red: false}, - {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: 1, playable: true, red: false}, - {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: 1, playable: true, red: false}, - {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: 1, playable: true, red: false}, - {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: 1, playable: true, red: false}, - {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: 1, playable: true, red: false}, - {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: 1, playable: true, red: false}, - {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: 1, playable: true, red: false}, - {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: 0, playable: true, red: false}, - {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: 0, playable: true, red: false}, - {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: 1, playable: true, red: false}, - {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: 1, playable: true, red: false}, - {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: 1, playable: true, red: false}, - {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: 1, playable: true, red: false}, - {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: 1, playable: true, red: false}, - {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: 1, playable: true, red: false}, - {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: 1, playable: true, red: false}, - {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: 1, playable: true, red: false}, - {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: 1, playable: true, red: false}, - {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: 1, playable: true, red: false}, - {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: 1, playable: true, red: true}, - {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: 0, playable: true, red: false}, - {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: 1, playable: true, red: false}, - {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: 1, playable: true, red: false}, - {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: 1, playable: true, red: false}, - {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: 1, playable: true, red: false}, - {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: 1, playable: true, red: false}, - {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: 1, playable: false, red: false}, - {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: 1, playable: true, red: false}, - {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: 1, playable: true, red: false}, - {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: 1, playable: true, red: false}, - {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: 1, playable: true, red: false}, - {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: 1, playable: true, red: false}, - {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: 1, playable: false, red: false}, - {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: 1, playable: true, red: false}, - {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: 1, playable: true, red: false}, - {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: 1, playable: true, red: false}, - {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: 1, playable: true, red: false}, - {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: 1, playable: true, red: false}, - {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: 1, playable: true, red: true}, - {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: 1, playable: true, red: false}, - {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: 1, playable: true, red: false}, - {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: 1, playable: true, red: false}, - {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: 1, playable: true, red: false}, - {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: 0, playable: true, red: false}, - {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: 1, playable: true, red: false}, - {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: 1, playable: true, red: false}, - {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: 1, playable: false, red: true}, - {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: 1, playable: true, red: false}, - {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: 1, playable: true, red: false}, - {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: 1, playable: false, red: true}, - {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: 1, playable: true, red: false}, - {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: 1, playable: true, red: false}, - {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: 1, playable: true, red: false}, - {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: 1, playable: true, red: false}, - {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: 1, playable: true, red: false}, - {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: 1, playable: true, red: false}, - {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: 1, playable: true, red: false}, - {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: 1, playable: true, red: false}, - {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: 1, playable: true, red: false}, - {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: 1, playable: true, red: false}, - {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: 0, playable: true, red: false}, - {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: 1, playable: false, red: false}, - {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: 1, playable: false, red: false}, - {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: 1, playable: true, red: false}, - {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: 1, playable: true, red: false}, - {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: 1, playable: true, red: false}, - {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: 1, playable: true, red: false}, - {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: 1, playable: true, red: false}, - {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: 1, playable: true, red: false}, - {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: 1, playable: true, red: false}, - {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: 1, playable: true, red: false}, - {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: 1, playable: true, red: false}, - {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: 1, playable: false, red: false}, - {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: 1, playable: true, red: false}, - {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: 1, playable: false, red: false}, - {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: 1, playable: true, red: false}, + {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: true, playable: true, red: false}, + {number: 2, period: 1, side: 'D', name: 'Solidarity Legalized*', ops: 4, remove: true, playable: true, red: true}, + {number: 3, period: 1, side: 'D', name: 'Walesa*', ops: 3, remove: true, playable: false, red: false}, + {number: 4, period: 1, side: 'D', name: 'Michnik*', ops: 1, remove: true, playable: true, red: false}, + {number: 5, period: 1, side: 'D', name: 'General Strike*', ops: 3, remove: true, playable: true, red: false}, + {number: 6, period: 1, side: 'C', name: 'Brought in for Questioning', ops: 3, remove: false, playable: true, red: false}, + {number: 7, period: 1, side: 'C', name: 'State Run Media*', ops: 2, remove: true, playable: true, red: false}, + {number: 8, period: 1, side: 'N', name: 'Prudence', ops: 4, remove: false, playable: true, red: false}, + {number: 9, period: 1, side: 'C', name: 'The Wall*', ops: 1, remove: true, playable: false, red: false}, + {number: 10, period: 1, side: 'C', name: 'Cult of Personality*', ops: 3, remove: true, playable: true, red: false}, + {number: 11, period: 1, side: 'C', name: 'Dissident Arrested', ops: 2, remove: false, playable: true, red: false}, + {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: true, playable: true, red: false}, + {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: true, playable: true, red: false}, + {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: false, playable: false, red: false}, + {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: true, playable: true, red: false}, + {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: true, playable: true, red: false}, + {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: false, playable: true, red: false}, + {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: true, playable: true, red: false}, + {number: 19, period: 1, side: 'D', name: 'Papal Visit*', ops: 2, remove: true, playable: true, red: false}, + {number: 20, period: 1, side: 'C', name: 'Deutsche Marks*', ops: 4, remove: true, playable: true, red: false}, + {number: 21, period: 1, side: 'N', name: 'Common European Home', ops: 2, remove: false, playable: true, red: false}, + {number: 22, period: 1, side: 'N', name: 'Power Struggle - Poland', ops: 0, remove: false, playable: true, red: false}, + {number: 23, period: 1, side: 'N', name: 'Power Struggle - Hungary', ops: 0, remove: false, playable: true, red: false}, + {number: 24, period: 1, side: 'D', name: 'St. Nicholas Church*', ops: 1, remove: true, playable: true, red: true}, + {number: 25, period: 1, side: 'C', name: 'Perestroika*', ops: 3, remove: true, playable: true, red: false}, + {number: 26, period: 1, side: 'D', name: 'Helsinki Final Act*', ops: 1, remove: true, playable: true, red: true}, + {number: 27, period: 1, side: 'D', name: 'Consumerism', ops: 3, remove: false, playable: true, red: false}, + {number: 28, period: 1, side: 'C', name: 'Factory Party Cells', ops: 3, remove: false, playable: true, red: false}, + {number: 29, period: 1, side: 'D', name: 'Jan Palach Week*', ops: 1, remove: true, playable: true, red: false}, + {number: 30, period: 1, side: 'C', name: 'Tear Gas*', ops: 1, remove: true, playable: true, red: false}, + {number: 31, period: 1, side: 'D', name: 'Intelligentsia', ops: 2, remove: false, playable: true, red: false}, + {number: 32, period: 1, side: 'C', name: 'Peasant Parties*', ops: 2, remove: true, playable: true, red: false}, + {number: 33, period: 1, side: 'D', name: 'Sajudis*', ops: 2, remove: true, playable: true, red: true}, + {number: 34, period: 1, side: 'D', name: 'Fidesz*', ops: 2, remove: true, playable: true, red: false}, + {number: 35, period: 1, side: 'C', name: 'Heal Our Bleeding Wound*', ops: 3, remove: true, playable: true, red: false}, + {number: 36, period: 1, side: 'D', name: 'Dash for the West*', ops: 3, remove: true, playable: true, red: false}, + {number: 37, period: 1, side: 'C', name: 'Nagy Reburied*', ops: 3, remove: true, playable: true, red: false}, + {number: 38, period: 1, side: 'C', name: 'The July Concept*', ops: 3, remove: true, playable: true, red: false}, + {number: 39, period: 1, side: 'D', name: 'Eco-Glasnost*', ops: 2, remove: true, playable: true, red: false}, + {number: 40, period: 1, side: 'D', name: 'Hungarian Democratic Forum*', ops: 3, remove: true, playable: true, red: false}, + {number: 41, period: 2, side: 'C', name: 'Ceausescu*', ops: 3, remove: true, playable: true, red: false}, + {number: 42, period: 2, side: 'N', name: 'Power Struggle - East Germany', ops: 0, remove: false, playable: true, red: false}, + {number: 43, period: 2, side: 'N', name: 'Power Struggle - Bulgaria', ops: 0, remove: false, playable: true, red: false}, + {number: 44, period: 2, side: 'N', name: 'Inflationary Currency*', ops: 3, remove: true, playable: true, red: false}, + {number: 45, period: 2, side: 'D', name: 'Soviet Troop Withdrawals*', ops: 4, remove: true, playable: true, red: false}, + {number: 46, period: 2, side: 'D', name: 'Goodbye Lenin!*', ops: 3, remove: true, playable: true, red: false}, + {number: 47, period: 2, side: 'C', name: 'Bulgarian Turks Expelled*', ops: 3, remove: true, playable: true, red: false}, + {number: 48, period: 2, side: 'D', name: '\"We are the People!\"', ops: 3, remove: true, playable: true, red: false}, + {number: 49, period: 2, side: 'D', name: 'Foreign Currency Debt Burden', ops: 1, remove: true, playable: true, red: false}, + {number: 50, period: 2, side: 'D', name: 'The Sinatra Doctrine*', ops: 3, remove: true, playable: true, red: false}, + {number: 51, period: 2, side: 'C', name: '40th Anniversary Celebration*', ops: 2, remove: true, playable: true, red: false}, + {number: 52, period: 2, side: 'C', name: 'Normalization*', ops: 3, remove: true, playable: true, red: false}, + {number: 53, period: 2, side: 'C', name: 'Li Peng*', ops: 2, remove: true, playable: true, red: false}, + {number: 54, period: 2, side: 'D', name: 'The Crowd Turns Against Ceausescu*', ops: 3, remove: true, playable: true, red: true}, + {number: 55, period: 2, side: 'N', name: 'Power Struggle - Czechoslovakia', ops: 0, remove: false, playable: true, red: false}, + {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: true, playable: true, red: false}, + {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: true, playable: true, red: false}, + {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: true, playable: true, red: false}, + {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: true, playable: true, red: false}, + {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: true, playable: true, red: false}, + {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: true, playable: false, red: false}, + {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: true, playable: true, red: false}, + {number: 63, period: 2, side: 'D', name: 'Genscher*', ops: 2, remove: true, playable: true, red: false}, + {number: 64, period: 2, side: 'D', name: 'Legacy of 1968*', ops: 4, remove: true, playable: true, red: false}, + {number: 65, period: 2, side: 'D', name: 'Presidential Visit*', ops: 3, remove: true, playable: true, red: false}, + {number: 66, period: 2, side: 'D', name: 'New Forum*', ops: 1, remove: true, playable: true, red: false}, + {number: 67, period: 2, side: 'N', name: 'Reformer Rehabilitated*', ops: 2, remove: true, playable: false, red: false}, + {number: 68, period: 2, side: 'D', name: 'Klaus and Komarek*', ops: 3, remove: true, playable: true, red: false}, + {number: 69, period: 2, side: 'C', name: 'Systematization*', ops: 3, remove: true, playable: true, red: false}, + {number: 70, period: 2, side: 'C', name: 'Securitate*', ops: 2, remove: true, playable: true, red: false}, + {number: 71, period: 2, side: 'D', name: 'Kiss of Death*', ops: 3, remove: true, playable: true, red: false}, + {number: 72, period: 2, side: 'D', name: 'Peasant Parties Revolt*', ops: 3, remove: true, playable: true, red: false}, + {number: 73, period: 2, side: 'D', name: 'Laszlo Tokes*', ops: 2, remove: true, playable: true, red: true}, + {number: 74, period: 2, side: 'D', name: 'FRG Embassies*', ops: 3, remove: true, playable: true, red: false}, + {number: 75, period: 2, side: 'D', name: 'Exit Visas*', ops: 3, remove: true, playable: true, red: false}, + {number: 76, period: 2, side: 'C', name: 'Warsaw Pact Summit*', ops: 2, remove: true, playable: true, red: false}, + {number: 77, period: 2, side: 'D', name: 'Samizdat*', ops: 1, remove: true, playable: true, red: false}, + {number: 78, period: 2, side: 'N', name: 'Workers Revolt', ops: 2, remove: false, playable: true, red: false}, + {number: 79, period: 2, side: 'C', name: 'The Third Way*', ops: 2, remove: true, playable: true, red: false}, + {number: 80, period: 2, side: 'C', name: 'Nepotism*', ops: 3, remove: true, playable: true, red: false}, + {number: 81, period: 2, side: 'D', name: 'The Baltic Way*', ops: 3, remove: true, playable: false, red: true}, + {number: 82, period: 3, side: 'C', name: 'Spitzel*', ops: 1, remove: true, playable: true, red: false}, + {number: 83, period: 3, side: 'C', name: 'Modrow*', ops: 2, remove: true, playable: true, red: false}, + {number: 84, period: 3, side: 'D', name: 'Breakaway Baltic Republics*', ops: 4, remove: true, playable: false, red: true}, + {number: 85, period: 3, side: 'N', name: 'Tank Column/Tank Man*', ops: 2, remove: true, playable: true, red: false}, + {number: 86, period: 3, side: 'D', name: '\"The Wall Must Go!\"*', ops: 3, remove: true, playable: true, red: false}, + {number: 87, period: 3, side: 'D', name: 'Kohl Proposes Reunification*', ops: 3, remove: true, playable: true, red: false}, + {number: 88, period: 3, side: 'C', name: 'Adamec*', ops: 2, remove: true, playable: true, red: false}, + {number: 89, period: 3, side: 'D', name: 'Domino Theory*', ops: 3, remove: true, playable: true, red: false}, + {number: 90, period: 3, side: 'D', name: 'Civic Forum*', ops: 4, remove: true, playable: true, red: false}, + {number: 91, period: 3, side: 'D', name: 'My First Banana*', ops: 3, remove: true, playable: true, red: false}, + {number: 92, period: 3, side: 'C', name: 'Betrayal*', ops: 3, remove: true, playable: true, red: false}, + {number: 93, period: 3, side: 'D', name: 'Shock Therapy*', ops: 3, remove: true, playable: true, red: false}, + {number: 94, period: 3, side: 'D', name: 'Union of Democratic Forces*', ops: 4, remove: true, playable: true, red: false}, + {number: 95, period: 3, side: 'N', name: 'Power Struggle - Romania', ops: 0, remove: false, playable: true, red: false}, + {number: 96, period: 3, side: 'C', name: 'The Chinese Solution*', ops: 1, remove: true, playable: false, red: false}, + {number: 97, period: 3, side: 'D', name: 'The Tyrant is Gone*', ops: 2, remove: true, playable: false, red: false}, + {number: 98, period: 3, side: 'C', name: 'Politburo Intrigue*', ops: 2, remove: true, playable: true, red: false}, + {number: 99, period: 3, side: 'C', name: 'Ligachev*', ops: 3, remove: true, playable: true, red: false}, + {number: 100, period: 3, side: 'N', name: 'Stand Fast*', ops: 3, remove: true, playable: true, red: false}, + {number: 101, period: 3, side: 'C', name: 'Elena*', ops: 1, remove: true, playable: true, red: false}, + {number: 102, period: 3, side: 'C', name: 'National Salvation Front*', ops: 3, remove: true, playable: true, red: false}, + {number: 103, period: 3, side: 'D', name: 'Government Resigns*', ops: 1, remove: true, playable: true, red: false}, + {number: 104, period: 3, side: 'C', name: 'New Year\'s Eve Party*', ops: 2, remove: true, playable: true, red: false}, + {number: 105, period: 3, side: 'D', name: 'Public Against Violence*', ops: 3, remove: true, playable: true, red: false}, + {number: 106, period: 3, side: 'C', name: 'Social Democratic Platform Adopted*', ops: 3, remove: true, playable: true, red: false}, + {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: true, playable: false, red: false}, + {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: true, playable: true, red: false}, + {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: true, playable: false, red: false}, + {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: true, playable: true, red: false}, ] const power_cards = [ diff --git a/play.js b/play.js index 0858ece..e04b0a8 100644 --- a/play.js +++ b/play.js @@ -621,7 +621,7 @@ function on_update() { else ui.events[C_THE_WALL].style.display = "none" - if (view.persistent_events.includes(69)) { + if (view.persistent_events.includes(C_SYSTEMATIZATION)) { ui.events[C_SYSTEMATIZATION].style.display = "block" ui.events[C_SYSTEMATIZATION].style.left = ui.layout_xy[view.systematization][0] - 25 + "px" ui.events[C_SYSTEMATIZATION].style.top = ui.layout_xy[view.systematization][1] - 25 + "px" -- cgit v1.2.3 From 67c3ecadec2bcfe074014ad72a373457049ca8c1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 16:46:35 +0000 Subject: Fix The Wall --- rules.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 1a1896d..35494ec 100644 --- a/rules.js +++ b/rules.js @@ -2211,7 +2211,7 @@ function do_sc(space) { if (adj.com_adj > 0) { logi(`+${adj.com_adj} adjacency`) } - game.persistent_events = game.persistent_events.filter(n => n !== C_THE_WALL) + permanently_remove(C_THE_WALL) // Standard adjacency } else { @@ -4601,7 +4601,7 @@ function vm_common_european_home() { function vm_dash_for_the_west() { game.valid_cards = [] for (let c of game.strategy_discard) { - if (cards[c].side === 'D' && cards[c].remove === 1 && (cards[c].playable || game.playable_cards.includes(c))) { + if (cards[c].side === 'D' && cards[c].remove && (cards[c].playable || game.playable_cards.includes(c))) { game.valid_cards.push(c) } } @@ -5264,10 +5264,10 @@ function vm_yakovlev_counsels_gorbachev() { function vm_permanently_remove () { // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! - if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { + if (game.vm_event !== 0 && cards[game.vm_event].remove && !game.strategy_removed.includes(game.vm_event)) { permanently_remove(game.vm_event) } - if (cards[game.played_card].remove ===1 && !game.strategy_removed.includes(game.played_card)) { + if (cards[game.played_card].remove && !game.strategy_removed.includes(game.played_card)) { permanently_remove(game.played_card) } /*This means the card that called the event being played is also removed if relevant. Think this makes sense */ vm_next() -- cgit v1.2.3 From a326442a485a87f8a11f8b2b9a7451a7aa71b9ab Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 17:58:28 +0000 Subject: Move discard above persistent events --- play.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/play.html b/play.html index 8499da2..e21d2a3 100644 --- a/play.html +++ b/play.html @@ -103,7 +103,13 @@
    - + +
    +
    Discard
    +
    +
    + +
    Persistent Events on the Table
    @@ -115,12 +121,6 @@
    - -
    -
    Discard
    -
    -
    -
    -- cgit v1.2.3 From afebec38223f354e20bb6d6965661ceb420550aa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 14:21:40 +0000 Subject: Fix merge error --- rules.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rules.js b/rules.js index 35494ec..438f79c 100644 --- a/rules.js +++ b/rules.js @@ -508,11 +508,6 @@ states.place_starting_infl = { game.available_ops = game.starting_infl[game.temp] next_player() valid_spaces_setup() - do_log_summary() - game.temp ++ - game.available_ops = game.starting_infl[game.temp] - next_player() - valid_spaces_setup() }, start() { do_log_summary() -- cgit v1.2.3 From bd9bd632c5756ef5e6dfe0b5b6b580daed53e376 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 15:38:29 +0000 Subject: Fix Workers Revolt --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 438f79c..8b93ac5 100644 --- a/rules.js +++ b/rules.js @@ -7464,7 +7464,7 @@ states.vm_workers_revolt_finish = { log(`Modified roll: ${roll}`) if (roll >= 4) { log('Workers Revolt successful') - vm_replace_all_infl(game.temp) + vm_replace_all_infl(game.selected_space) } else {log('Workers Revolt fails. Required 4 or more')} delete game.selected_space vm_next() -- cgit v1.2.3 From 6b56c2472e7c234e16c05425a61bd02ca2729fb4 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 16:09:59 +0000 Subject: Fix Honecker being always playable --- data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data.js b/data.js index cf6ec1b..13ca104 100644 --- a/data.js +++ b/data.js @@ -1292,7 +1292,7 @@ const cards = [ {number: 12, period: 1, side: 'C', name: 'Apparatchiks*', ops: 2, remove: true, playable: true, red: false}, {number: 13, period: 1, side: 'C', name: 'Stasi*', ops: 1, remove: true, playable: true, red: false}, {number: 14, period: 1, side: 'N', name: 'Gorbachev Charms the West', ops: 4, remove: false, playable: false, red: false}, - {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: true, playable: true, red: false}, + {number: 15, period: 1, side: 'C', name: 'Honecker*', ops: 3, remove: true, playable: false, red: false}, {number: 16, period: 1, side: 'C', name: 'Nomenklatura*', ops: 2, remove: true, playable: true, red: false}, {number: 17, period: 1, side: 'D', name: 'Roundtable Talks', ops: 3, remove: false, playable: true, red: false}, {number: 18, period: 1, side: 'C', name: 'Poszgay Defends the Revolution*', ops: 2, remove: true, playable: true, red: false}, -- cgit v1.2.3 From 3d4c22c7b1d3ec35af06386808f3fe4e16aa7cb7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 17:01:19 +0000 Subject: Fix tactics fails and leaders --- rules.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 8b93ac5..0cdda62 100644 --- a/rules.js +++ b/rules.js @@ -489,7 +489,6 @@ states.place_starting_infl = { view.prompt = 'Place starting SPs: done.'; gen_action("done"); return; - } else if (game.temp > 2) { } else if (game.temp > 2) { view.prompt = `Place your last ${pluralize(game.available_ops,'starting SP')}.` } else { @@ -1299,6 +1298,8 @@ states.power_struggle = { } }, power_card(card) { + console.log('game.phase', game.phase, 'game.played_power_card', game.played_power_card) + if(game.proxy_power_card) {console.log('game.proxy_power_card', game.proxy_power_card)} push_undo() discard(card) if (game.phase === 0) { @@ -1312,7 +1313,11 @@ states.power_struggle = { game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} if (card === PC_TACTIC_FAILS) { - log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) + if (game.proxy_power_card) { + log_gap(`Played P${PC_TACTIC_FAILS}: ${game.proxy_power_card} no longer playable`) + } else { + log_gap(`Played P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable`) + } } else { if (game.phase === 0 && leader_cards.includes(card)) {} /* Log nothing. Probably a better way to do this */ else if (numberless_cards.includes(card)) { @@ -1346,7 +1351,11 @@ states.power_struggle = { } } else if (game.phase === 1) { if (card === PC_TACTIC_FAILS) { - game.tactics_fails = power_cards[game.played_power_card].name + if (game.proxy_power_card) { + game.tactics_fails = game.proxy_power_card + } else { + game.tactics_fails = power_cards[game.played_power_card].name + } game.phase = 0 next_player() do_valid_cards() @@ -1360,6 +1369,7 @@ states.power_struggle = { } }, roll () { + clear_undo() let roll = roll_d6() log(`Roll: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { @@ -2398,7 +2408,9 @@ function valid_spaces_infl() { function valid_cards(player_hand, presence) { const valid_cards_set = new Set() + console.log('game.phase', game.phase, 'game.tactics_fails', game.tactics_fails) if (game.phase === 0) { + for (let c of player_hand) { let card = power_cards[c] // Never add tactics fails -- cgit v1.2.3 From 6908f939418502b0f397356df8aa767cbe3fd9bb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 4 Nov 2024 18:09:41 +0000 Subject: Update Workers Revolt log --- rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.js b/rules.js index 0cdda62..915bbea 100644 --- a/rules.js +++ b/rules.js @@ -4446,9 +4446,11 @@ function vm_do_remove_all_infl(space) { function vm_replace_all_infl(space_id) { if (game.active === DEM) { game.demInfl[space_id] += game.comInfl[space_id] + log(`Replaced ${game.comInfl[space_id]} Communist SP in %${space_id} with Democratic SP`) game.comInfl[space_id] = 0 } else { game.comInfl[space_id] += game.demInfl[space_id] + log(`Replaced ${game.demInfl[space_id]} Democrat SP in %${space_id} with Communist SP`) game.demInfl[space_id] = 0 } check_tyrant() -- cgit v1.2.3 From 443b3e978d57d1fae0d8e11097ae6b346d8ea564 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 07:54:05 +0000 Subject: Update autoresolve events --- rules.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/rules.js b/rules.js index 915bbea..120c536 100644 --- a/rules.js +++ b/rules.js @@ -2998,9 +2998,11 @@ function select_card(card){ function is_auto_resolve(card) { let ceausecu_events = [10, 41, 101, 107] - - if (card === C_THE_TYRANT_IS_GONE) { - if (!game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { + if (auto_resolve_events.includes(card)) { + return true + } + else if (card === C_THE_TYRANT_IS_GONE) { + if (game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { return true } } @@ -3009,10 +3011,58 @@ function is_auto_resolve(card) { } else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true + } + if (card === C_BROUGHT_IN_FOR_QUESTIONING || card === C_DEUTSCHE_MARKS) { + if (game.democrat_hand.length === 0) { return true } + } + else if (card === C_DISSIDENT_ARRESTED) { + let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space] > 0).length + if (dem_intellectual_infl === 0) { + log('No influence to remove') + return true + } + } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { + if (!game.systematization === S_HARGHITA_COVASNA) { + if (dem_control(S_RAZGRAD) && dem_control(S_HARGHITA_COVASNA)) { + log('Both Minorities spaces already controlled') + return true + } + } else if (dem_control(S_RAZGRAD)) { + log('Both Minorities spaces already controlled') + return true + } + } else if (card === C_CEAUSESCU) { + let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space] > 0).length + if (dem_romania_infl === 0) { + log('No influence to remove') + return true + } + } + else if (card === C_WE_ARE_THE_PEOPLE) { + if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { + log('No influence to remove') + return true + } + } + else if (card === C_BETRAYAL) { + if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) { + if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) { + log('No influence to remove') + return true + } + } else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) { + log('No influence to remove') + return true + } + } + else if (card === C_GOVERNMENT_RESIGNS) { + let uncontrolled_elites = spaces.filter( s => game.comInfl[s] > 0 && !check_control(s)).length + if (uncontrolled_elites === 0) { + log('No uncontrolled Elite spaces') + return true + } } - else if (auto_resolve_events.includes(card)) { - return true - } else { + else { return false } } @@ -4670,6 +4720,7 @@ function vm_eliminate(space_id) { // Eliminate the democrat influence and move t } } + function get_adjusted_adjacency(space_id) { let adjacent_spaces = spaces[space_id].adjacent; if (adjacent_spaces.includes(game.systematization)) { -- cgit v1.2.3 From 7468fde6f6617572b43fb20e9b290dda64038e1e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 08:18:48 +0000 Subject: Fix functions skipping space 0 --- rules.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/rules.js b/rules.js index 120c536..6ca2c78 100644 --- a/rules.js +++ b/rules.js @@ -1096,7 +1096,7 @@ states.the_crowd_turns_against_ceausescu_prep = { game.temp = game.ceausescu_cards.filter(card => rallies.includes(card)).length log(`Drew ${pluralize(game.temp, 'Rally in the Square')}.`) game.vm_available_ops = game.temp * 3 - log(`Democrat takes a ${game.vm_available_ops} Action Round`) + log(`Democrat takes a ${game.vm_available_ops} Op Action Round`) game.state = 'vm_the_crowd_turns_against_ceausescu' } } @@ -1298,8 +1298,6 @@ states.power_struggle = { } }, power_card(card) { - console.log('game.phase', game.phase, 'game.played_power_card', game.played_power_card) - if(game.proxy_power_card) {console.log('game.proxy_power_card', game.proxy_power_card)} push_undo() discard(card) if (game.phase === 0) { @@ -2408,7 +2406,6 @@ function valid_spaces_infl() { function valid_cards(player_hand, presence) { const valid_cards_set = new Set() - console.log('game.phase', game.phase, 'game.tactics_fails', game.tactics_fails) if (game.phase === 0) { for (let c of player_hand) { @@ -4171,7 +4168,6 @@ function vm_valid_spaces_country_opp () { country = game.vm_active_country } for (let space of spaces) { - if (!space) continue if (game.active === DEM) { if (space.country === country && game.comInfl[space.space_id] >0) { game.valid_spaces.push(space.space_id); @@ -4199,7 +4195,6 @@ function vm_valid_spaces_country_sc () { function vm_valid_spaces_country_socio_2() { for (let space of spaces) { - if (!space) continue if (space.space_id === game.systematization) continue if ((space.country === vm_operand(1) && space.socio === vm_operand(2)) || (space.country === vm_operand(1) && space.socio === vm_operand(3))) { game.valid_spaces.push(space.space_id); @@ -4211,7 +4206,6 @@ function vm_valid_spaces_country_socio_2() { function vm_valid_spaces_region_socio() { let valid_spaces = [] for (let space of spaces) { - if (!space) continue if (space.space_id === game.systematization) continue if (space.region === vm_operand(1) && space.socio === vm_operand(2)) { valid_spaces.push(space.space_id); @@ -4224,7 +4218,6 @@ function vm_valid_spaces_region_socio() { function vm_valid_spaces_region_opp() { let valid_spaces = [] for (let space of spaces) { - if (!space) continue let s = space.space_id if ((game.active === DEM && space.region === vm_operand(1) && game.comInfl[s] > 0 ) || (game.active === COM && space.region === vm_operand(1) && game.demInfl[s] > 0 )) { valid_spaces.push(space.space_id); @@ -5298,7 +5291,6 @@ function vm_we_are_the_people() { function vm_workers_revolt() { if (game.active === DEM) { for (let space of spaces) { - if (!space) continue let country = space.country if (!game.revolutions[find_country_index(country)] && game.comInfl[space.space_id] > 0 && space.socio === 4) { game.valid_spaces.push(space.space_id); @@ -5306,7 +5298,6 @@ function vm_workers_revolt() { } } else { for (let space of spaces) { - if (!space) continue let country = space.country if (game.revolutions[find_country_index(country)] && game.demInfl[space.space_id] > 0 && space.socio === 4) { game.valid_spaces.push(space.space_id); @@ -5735,7 +5726,6 @@ states.vm_support_check_prep = { } else { view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}. ${pluralize(game.vm_available_ops, 'support check')} remaining.` for (let space_id of game.valid_spaces) { - if (!space_id) continue gen_action_space(space_id); } } @@ -5844,7 +5834,6 @@ states.vm_1_support_check_prep = { } else { view.prompt = `${clean_name(cards[this_card()].name)}: ${event_prompt()}.` for (let space_id of game.valid_spaces) { - if (!space_id) continue gen_action_space(space_id); } } @@ -6949,7 +6938,6 @@ states.vm_nomenklatura = { push_undo() game.valid_spaces = [] for (let space of spaces) { - if (!space) continue if (space.socio === 1) { game.valid_spaces.push(space.space_id) } -- cgit v1.2.3 From 8f56af6a8404c6e700fde0a5b910e3ecd79991e4 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 08:19:51 +0000 Subject: Remove console.logs --- play.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/play.js b/play.js index e04b0a8..1e7c327 100644 --- a/play.js +++ b/play.js @@ -765,8 +765,7 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - console.log('view.hand', view.hand) - console.log('ui.hand',ui.hand) + console.log('view.actions', view.actions) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From d74ad01205df4dc4f669e078fe0f5699f8d70db7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 18:13:28 +0000 Subject: Remove console.logs --- play.js | 1 - 1 file changed, 1 deletion(-) diff --git a/play.js b/play.js index 1e7c327..ded7d49 100644 --- a/play.js +++ b/play.js @@ -765,7 +765,6 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - console.log('view.actions', view.actions) } // =========================== LOG FUNCTIONS ============================================== -- cgit v1.2.3 From ebf691da7c8f992a2b1a20fc2b7cee7b84c3bee9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 20:03:45 +0000 Subject: Update autoresolve events --- events.txt | 42 ++++++++++++++++++--- rules.js | 125 ++++++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 128 insertions(+), 39 deletions(-) diff --git a/events.txt b/events.txt index 54203f1..01ba963 100644 --- a/events.txt +++ b/events.txt @@ -44,7 +44,9 @@ general_strike CARD 6 - Brought in for Questioning # The Democratic Player must randomly discard a card. If it is a Communist event it takes place immediately. +if !is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING) brought_in_for_questioning +endif CARD 7 - State Run Media* @@ -78,9 +80,11 @@ endif CARD 11 - Dissident arrested # Remove 2 Democratic SPs from any Intellectuals space. +if !is_auto_resolve(C_DISSIDENT_ARRESTED) valid_spaces_opponent_socio 5 prompt 'any Intellectuals space' remove_x_opp_infl 2 +endif CARD 12 - Apparatchicks @@ -140,7 +144,9 @@ add_x_infl 3 CARD 20 - Deutsche Marks* # Democratic Player gives the Communist Player his highest Ops value card. If a Communist event it takes place immediately, otherwise use the Ops value of the card without triggering the event. permanently_remove +if !is_auto_resolve(C_DEUTSCHE_MARKS) deutsche_marks +endif CARD 21 - Common European Home @@ -160,9 +166,11 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. +if !check_dem_control(S_LUTHERAN_CHURCH) valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 +endif st_nicholas_church @@ -225,10 +233,13 @@ add_limited_infl 4 2 CARD 33 - Sajudis* # +1 VP. Reduce USSR stability by 1. Place sufficient Democratic support in any Minorities space for control. Allows play of The Baltic Way. permanently_remove +sajudis +if !is_auto_resolve(C_SAJUDIS) sajudis_check prompt 'any Minorities space' take_control_prep 1 -sajudis +endif + CARD 34 - Fidesz* @@ -293,7 +304,10 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if !game.the_tyrant_is_gone +if game.the_tyrant_is_gone +tyrant_block +else +if !is_auto_resolve(C_CEAUSESCU) valid_spaces_country_opp 'Romania' prompt ' from Romania' remove_opp_infl 3 @@ -302,8 +316,6 @@ prompt 'make a support check in Romania' 1_support_check prompt ' from Bucharesti' ceausescu -else -tyrant_block endif @@ -350,13 +362,18 @@ CARD 47 - Bulgarian Turks Expelled* # -2 VP. Remove any Democratic SPs in Razgrad. permanently_remove bulgarian_turks_expelled +if !is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED) +valid_spaces 'Razgrad' prompt 'Razgrad' remove_all_infl 1 +endif CARD 48 - We are the People!* # The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig. +if !is_auto_resolve(C_WE_ARE_THE_PEOPLE) we_are_the_people +endif CARD 49 - Foreign Currency Debt Burden* @@ -383,9 +400,11 @@ add_infl_free CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove +if !is_auto_resolve(C_NORMALISATION) normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 +endif CARD 53 - Li Peng* @@ -508,7 +527,9 @@ securitate CARD 71 - Kiss of Death* # The Communist Player must randomly discard a card. If it is neutral or Democratic it takes place immediately. permanently_remove +if !is_auto_resolve(C_KISS_OF_DEATH) kiss_of_death +endif CARD 72 - Peasant Parties Revolt @@ -588,9 +609,12 @@ add_infl_free CARD 81 - The Baltic Way* # +2 VP. Reduce USSR stability by 1. Place sufficient Democratic SPs in any Minorities space for control. .Requires play of Sajudis. Allows play of Breakaway Baltic Republics. permanently_remove +the_baltic_way_prep +if !is_auto_resolve(C_THE_BALTIC_WAY) the_baltic_way prompt 'any Minorities space' take_control_prep 1 +endif CARD 82 - Spitzel* @@ -636,7 +660,10 @@ remove_infl 3 CARD 87 - Kohl Proposes Reunification* # +2 VP. The Democratic Player may place SPs or make Support Checks using the Ops value of this card if The Wall Must Go! has been played as an event successfully. permanently_remove +kohl_proposes_reunification_prep +if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification +endif @@ -683,8 +710,10 @@ support_check 2 CARD 92 - Betrayal # Choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs. permanently_remove +if !is_auto_resolve(C_BETRAYAL) prompt 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' betrayal +endif CARD 93 - Shock Therapy* @@ -774,10 +803,13 @@ national_salvation_front CARD 103 - Government Resigns* # Remove all Communist SPs from any uncontrolled Elite space. +permanently_remove +if !is_auto_resolve(C_GOVERNMENT_RESIGNS) government_resigns prompt 'any uncontrolled Elite space' remove_all_infl 1 -permanently_remove +endif + CARD 104 - New Year's Eve Party* diff --git a/rules.js b/rules.js index 6ca2c78..3c3eebd 100644 --- a/rules.js +++ b/rules.js @@ -3009,53 +3009,81 @@ function is_auto_resolve(card) { else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true } - if (card === C_BROUGHT_IN_FOR_QUESTIONING || card === C_DEUTSCHE_MARKS) { - if (game.democrat_hand.length === 0) { return true } + else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Democrat has no cards to discard') } + return true } + } + else if (card === C_DEUTSCHE_MARKS) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Democrat has no cards to give') } + return true } + } + else if (card === C_KISS_OF_DEATH ) { + if (game.communist_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Communist has no cards to discard') } + return true } } else if (card === C_DISSIDENT_ARRESTED) { - let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space] > 0).length + let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length + console.log('dem_intellectual_infl', dem_intellectual_infl) if (dem_intellectual_infl === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { if (!game.systematization === S_HARGHITA_COVASNA) { - if (dem_control(S_RAZGRAD) && dem_control(S_HARGHITA_COVASNA)) { - log('Both Minorities spaces already controlled') + if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) { + if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } return true } - } else if (dem_control(S_RAZGRAD)) { - log('Both Minorities spaces already controlled') + } else if (check_dem_control(S_RAZGRAD)) { + if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } return true } } else if (card === C_CEAUSESCU) { let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space] > 0).length if (dem_romania_infl === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_WE_ARE_THE_PEOPLE) { if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_BETRAYAL) { if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) { if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_GOVERNMENT_RESIGNS) { let uncontrolled_elites = spaces.filter( s => game.comInfl[s] > 0 && !check_control(s)).length if (uncontrolled_elites === 0) { - log('No uncontrolled Elite spaces') + if (!game.state.startsWith('vm')) { log('No uncontrolled Elite spaces') } + return true + } + } else if (card === C_ST_NICHOLAS_CHURCH) { + if (check_dem_control(S_LUTHERAN_CHURCH)) { + if (!game.state.startsWith('vm')) { log('Lutheran Church already controlled') } + return true + } + } else if (card === C_BULGARIAN_TURKS_EXPELLED) { + if (game.demInfl[S_RAZGRAD] === 0 ) { + if (!game.state.startsWith('vm')) { log('No influence to remove') } + return true + } + } else if (card === C_NORMALIZATION) { + if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) { + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } @@ -4595,7 +4623,6 @@ function vm_bulgarian_turks_expelled(){ if (check_vp()) { return } - if (game.demInfl[S_RAZGRAD] > 0) {game.valid_spaces = [S_RAZGRAD]} vm_next() } @@ -4878,20 +4905,16 @@ function vm_klaus_and_komarek() { vm_next() } -function vm_kohl_proposes_reunification() { +function vm_kohl_proposes_reunification_prep() { log('+2 VP') game.vp += 2 if (check_vp()) { return } - if (game.persistent_events.includes(C_THE_WALL_MUST_GO)) { - game.vm_event = C_KOHL_PROPOSES_REUNIFICATION - game.state = 'vm_common_european_home_play' - } else { - permanently_remove(C_KOHL_PROPOSES_REUNIFICATION) - vm_return() - } - +} +function vm_kohl_proposes_reunification() { + game.vm_event = C_KOHL_PROPOSES_REUNIFICATION + game.state = 'vm_common_european_home_play' } function vm_kremlin_coup() { @@ -5096,6 +5119,7 @@ function vm_sajudis() { if (check_vp()) { return } + log(`Allows play of C${C_THE_BALTIC_WAY} for the event`) vm_next() } @@ -5194,11 +5218,9 @@ function vm_tear_gas () { vm_next() } -function vm_the_baltic_way() { +function vm_the_baltic_way_prep() { game.playable_cards.push(C_BREAKAWAY_BALTIC_REPUBLICS) game.stability++ - 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()) { @@ -5207,6 +5229,12 @@ function vm_the_baltic_way() { vm_next() } +function vm_the_baltic_way() { + 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() +} + function vm_the_chinese_solution() { game.state = 'vm_the_chinese_solution' } @@ -7888,7 +7916,9 @@ CODE[5] = [ // General strike ] CODE[6] = [ // Brought in for Questioning + [ vm_if, ()=>!is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING) ], [ vm_brought_in_for_questioning ], + [ vm_endif ], [ vm_return ], ] @@ -7922,9 +7952,11 @@ CODE[10] = [ // Cult of Personality ] CODE[11] = [ // Dissident arrested + [ vm_if, ()=>!is_auto_resolve(C_DISSIDENT_ARRESTED) ], [ vm_valid_spaces_opponent_socio, 5 ], [ vm_prompt, 'any Intellectuals space' ], [ vm_remove_x_opp_infl, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -7984,7 +8016,9 @@ CODE[19] = [ // Papal vist CODE[20] = [ // Deutsche Marks* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_DEUTSCHE_MARKS) ], [ vm_deutsche_marks ], + [ vm_endif ], [ vm_return ], ] @@ -8004,9 +8038,11 @@ CODE[23] = [ // Power Struggle - Hungary ] CODE[24] = [ // St Nicolas Church + [ vm_if, ()=>!check_dem_control(S_LUTHERAN_CHURCH) ], [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], + [ vm_endif ], [ vm_st_nicholas_church ], [ vm_return ], ] @@ -8069,10 +8105,12 @@ CODE[32] = [ // Peasant Parties* CODE[33] = [ // Sajudis* [ vm_permanently_remove ], + [ vm_sajudis ], + [ vm_if, ()=>!is_auto_resolve(C_SAJUDIS) ], [ vm_sajudis_check ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], - [ vm_sajudis ], + [ vm_endif ], [ vm_return ], ] @@ -8137,7 +8175,10 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>game.the_tyrant_is_gone ], + [ vm_tyrant_block ], + [ vm_else ], + [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], [ vm_valid_spaces_country_opp, 'Romania' ], [ vm_prompt, ' from Romania' ], [ vm_remove_opp_infl, 3 ], @@ -8146,8 +8187,6 @@ CODE[41] = [ // Ceausescu* [ vm_1_support_check ], [ vm_prompt, ' from Bucharesti' ], [ vm_ceausescu ], - [ vm_else ], - [ vm_tyrant_block ], [ vm_endif ], [ vm_return ], ] @@ -8194,13 +8233,18 @@ CODE[46] = [ // Goodbye Lenin!* CODE[47] = [ // Bulgarian Turks Expelled* [ vm_permanently_remove ], [ vm_bulgarian_turks_expelled ], + [ vm_if, ()=>!is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED) ], + [ vm_valid_spaces, 'Razgrad' ], [ vm_prompt, 'Razgrad' ], [ vm_remove_all_infl, 1 ], + [ vm_endif ], [ vm_return ], ] CODE[48] = [ // We are the People!* + [ vm_if, ()=>!is_auto_resolve(C_WE_ARE_THE_PEOPLE) ], [ vm_we_are_the_people ], + [ vm_endif ], [ vm_return ], ] @@ -8227,9 +8271,11 @@ CODE[51] = [ // 40th Anniversary Celebration* CODE[52] = [ // Normalisation [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_NORMALISATION) ], [ vm_normalisation ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -8352,7 +8398,9 @@ CODE[70] = [ // Securitate* CODE[71] = [ // Kiss of Death* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_KISS_OF_DEATH) ], [ vm_kiss_of_death ], + [ vm_endif ], [ vm_return ], ] @@ -8432,9 +8480,12 @@ CODE[80] = [ // Nepotism* CODE[81] = [ // The Baltic Way* [ vm_permanently_remove ], + [ vm_the_baltic_way_prep ], + [ vm_if, ()=>!is_auto_resolve(C_THE_BALTIC_WAY) ], [ vm_the_baltic_way ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], + [ vm_endif ], [ vm_return ], ] @@ -8480,7 +8531,10 @@ CODE[86] = [ // The Wall Must Go!* CODE[87] = [ // Kohl Proposes Reunification* [ vm_permanently_remove ], + [ vm_kohl_proposes_reunification_prep ], + [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], + [ vm_endif ], [ vm_return ], ] @@ -8524,8 +8578,10 @@ CODE[91] = [ // My First Banana* CODE[92] = [ // Betrayal [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_BETRAYAL) ], [ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ], [ vm_betrayal ], + [ vm_endif ], [ vm_return ], ] @@ -8564,8 +8620,8 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces_com, 'Cluj-Napoca' ], + [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8615,10 +8671,12 @@ CODE[102] = [ // National Salvation Front* ] CODE[103] = [ // Government Resigns* + [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_GOVERNMENT_RESIGNS) ], [ vm_government_resigns ], [ vm_prompt, 'any uncontrolled Elite space' ], [ vm_remove_all_infl, 1 ], - [ vm_permanently_remove ], + [ vm_endif ], [ vm_return ], ] @@ -8725,4 +8783,3 @@ CODE[351] = [ // Scare Tactics [ vm_return ], ] // #endregion - -- cgit v1.2.3 From 94ea6010ea04167ed2764839bff9e8e511a0d9c1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 20:16:18 +0000 Subject: Fix Common European Home VP award for support checks --- rules.js | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/rules.js b/rules.js index 3c3eebd..241953f 100644 --- a/rules.js +++ b/rules.js @@ -637,27 +637,7 @@ states.play_card ={ influence() { push_undo() log_gap(`Played C${game.played_card} to place SPs`) - - // Check if Common European Home played for influence - if (game.played_card === C_COMMON_EUROPEAN_HOME) { - if (game.active === DEM) { - game.vp -- - log('-1 VP') - } else { - game.vp ++ - log('+1 VP') - } - if (check_vp()) { - return - } - } - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - game.vm_event_to_do = true - } - } + finish_play_card() // If ABHR - Set AHBR tracker to true if (game.persistent_events.includes(58)) { @@ -674,15 +654,7 @@ states.play_card ={ support_check() { push_undo() log_gap(`Played C${game.played_card} for support checks`) - - // Check if card is opponent card with event that needs to be resolved - - if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { - if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { - game.vm_event_to_do = true - } - } - + finish_play_card() game.available_ops = 2 game.state='support_check_prep' valid_spaces_sc() @@ -3226,6 +3198,29 @@ function get_tst_6_ops() { return ops } +function finish_play_card() { + // Check if Common European Home played for influence + if (game.played_card === C_COMMON_EUROPEAN_HOME) { + if (game.active === DEM) { + game.vp -- + log('-1 VP') + } else { + game.vp ++ + log('+1 VP') + } + if (check_vp()) { + return + } + } + // Check if card is opponent card with event that needs to be resolved + + if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { + if ((game.active === DEM && cards[game.played_card].side === "C" ) || (game.active === COM && cards[game.played_card].side === "D")) { + game.vm_event_to_do = true + } + } +} + function finish_the_wall() { if (game.the_wall_must_go['dem_wins'] === 2) { game.persistent_events.push(C_THE_WALL_MUST_GO) @@ -5226,6 +5221,7 @@ function vm_the_baltic_way_prep() { if (check_vp()) { return } + log(`Allows play of C${C_BREAKAWAY_BALTIC_REPUBLICS} for the event`) vm_next() } -- cgit v1.2.3 From 24ef860ef52551fba2970bde282d1e33762b6bc7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 20:26:19 +0000 Subject: Fix game_over state after Support Check --- rules.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/rules.js b/rules.js index 241953f..f580cc7 100644 --- a/rules.js +++ b/rules.js @@ -906,6 +906,7 @@ states.support_check_prep = { } } } + game.state = 'do_support_check' }, end_round() { @@ -940,8 +941,12 @@ states.do_support_check = { if (game.available_ops === 0) { game.valid_spaces = [] } + if (check_vp()) { + return + } else { game.state = 'support_check_prep' return + } } } @@ -2105,17 +2110,6 @@ function do_sc(space) { clear_undo() log_gap(`Support check: %${space}`) - //Check Helsinki Final Act - - if (game.active === COM && game.persistent_events.includes(26) && (spaces[space].socio === 5 || spaces[space].socio === 6) ) { - log('+1 VP from C26') - game.vp ++ - if (check_vp()) { - game.state = 'game.over' - return - } - } - // Continue with Support Check Logic let roll = roll_d6() @@ -2248,12 +2242,14 @@ function do_sc(space) { } else { log_msg_gap('Change influence: 0 SP') } + //Check VP awards + if (game.active === COM && game.persistent_events.includes(C_HELSINKI_FINAL_ACT) && (spaces[space].socio === 5 || spaces[space].socio === 6) ) { + log('+1 VP from C26') + game.vp ++ + } if (game.active === COM && game.persistent_events.includes(C_ECO_GLASNOST) && spaces[space].space_id === S_RUSE) { log_msg_gap('+1 VP from C39') game.vp++ - if (check_vp()) { - return - } } // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany @@ -5884,12 +5880,14 @@ states.vm_do_support_check = { clear_undo() do_sc(game.selected_space) game.vm_available_ops-- - if (game.vm_available_ops === 0) { + if (check_vp()) { + return + } else if (game.vm_available_ops === 0) { game.valid_spaces = [] vm_next() return } else { - game.state = 'vm_support_check_prep' + game.state = 'support_check_prep' return } } -- cgit v1.2.3 From 670f88f5c4298a0b2e55bcffc9c80e446d78f967 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 6 Nov 2024 08:29:17 +0000 Subject: Fix Common European Home for fuzzer --- rules.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/rules.js b/rules.js index f580cc7..084ff6b 100644 --- a/rules.js +++ b/rules.js @@ -2994,7 +2994,6 @@ function is_auto_resolve(card) { } else if (card === C_DISSIDENT_ARRESTED) { let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length - console.log('dem_intellectual_infl', dem_intellectual_infl) if (dem_intellectual_infl === 0) { if (!game.state.startsWith('vm')) { log('No influence to remove') } return true @@ -3107,27 +3106,27 @@ function event_is_playable(card) { function get_card_ops(card) { let ops = cards[card].ops if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'general_strike') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_common_european_home_play' || game.state === 'general_strike') { log(`+1 op from C${C_PERESTROIKA}`) } ops ++ } if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_common_european_home_play' || game.state === 'vm_laszlo_tokes') { log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) } ops ++ } if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_common_european_home_play') { log('+1 op from Tiananmen Square Track') } ops ++ } if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { - if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_laszlo_tokes') { + if(game.state === 'choose_card' || game.state === 'stasi_play_card' || game.state === 'vm_common_european_home_play' || game.state === 'vm_laszlo_tokes') { if (ops > 2) { log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { @@ -3144,7 +3143,7 @@ function get_card_ops(card) { } if (game.active === COM && game.prudence && game.prudence.COM < 0) { - if(game.state === 'choose_card' || game.state === 'general_strike') { + if(game.state === 'choose_card' || game.state === 'general_strike' || game.state === 'vm_common_european_home_play') { if (ops > 2) { log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else if (ops > 1) { @@ -3297,29 +3296,31 @@ function end_round() { return [...new Set(duplicates)]; } - console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + card_check = card_check.sort((a, b) => a - b) if (check_duplicates(card_check)) { - console.log('card check', card_check) + console.log('duplicate cards: card check', card_check) + console.log('view.actions', view.actions) const duplicates = find_duplicates(card_check) console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) } //console.log('cards in game', card_check.length) - card_check = card_check.sort((a, b) => a - b) + //console.log('cards in game', card_check) if (game.turn <= 3) { if (card_check.length !== 40) { - console.log('cards in game', card_check) + console.log('wrong number of cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (game.turn <=7) { if (card_check.length !== 81) { - console.log('cards in game', card_check) + console.log('wrong number of cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (card_check.length !== 110) { - console.log('cards in game', card_check) + console.log('wrong number of cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } @@ -4653,13 +4654,14 @@ function vm_civic_forum() { } function vm_common_european_home() { - let hands = [...game.democrat_hand, ...game.communist_hand] - for (let c of hands) { - if (game.active === DEM) { + if (game.active === DEM) { + for (let c of game.democrat_hand) { if (cards[c].side === 'C') { game.valid_cards.push(c) } - } else { + } + } else { + for (let c of game.communist_hand) { if (cards[c].side === 'D') { game.valid_cards.push(c) } -- cgit v1.2.3 From ef7c22e04584531784b841ab54b63e7e5247ffd4 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 11:41:37 +0000 Subject: Chinese solution playable from box 7 not 8 --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 084ff6b..9fd78cc 100644 --- a/rules.js +++ b/rules.js @@ -3085,7 +3085,7 @@ function event_is_playable(card) { return false } //Check for The Chinese Solution - else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { + else if (game.com_tst_position >= 7 && card === C_THE_CHINESE_SOLUTION) { return true } @@ -4654,6 +4654,7 @@ function vm_civic_forum() { } function vm_common_european_home() { + if (game.active === DEM) { for (let c of game.democrat_hand) { if (cards[c].side === 'C') { -- cgit v1.2.3 From 1fa3808840dba64f5344795d5e8f730cc2ebfeb0 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 11:54:50 +0000 Subject: Fix error from game_over change --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9fd78cc..4ff3c9b 100644 --- a/rules.js +++ b/rules.js @@ -5743,6 +5743,7 @@ states.vm_remove_all_infl = { states.vm_support_check_prep = { inactive: 'do support checks.', prompt () { + console.log('in vm_support_check_prep', game.valid_spaces) if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') @@ -5876,6 +5877,7 @@ states.vm_1_support_check_prep = { states.vm_do_support_check = { inactive: 'do support checks.', prompt () { + console.log('in vm_do_support_check') view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') }, @@ -5890,7 +5892,7 @@ states.vm_do_support_check = { vm_next() return } else { - game.state = 'support_check_prep' + game.state = 'vm_support_check_prep' return } } -- cgit v1.2.3 From 93789d5d423850b2123a8816f6ee32ccbbc67e6e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 12:11:03 +0000 Subject: Fix conditional auto_resolve --- rules.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rules.js b/rules.js index 4ff3c9b..c1a57d5 100644 --- a/rules.js +++ b/rules.js @@ -2999,17 +2999,17 @@ function is_auto_resolve(card) { return true } } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { - if (!game.systematization === S_HARGHITA_COVASNA) { - if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) { - if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } - return true - } - } else if (check_dem_control(S_RAZGRAD)) { - if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } + if (game.systematization && game.systematization === S_HARGHITA_COVASNA ) { + if (check_dem_control(S_RAZGRAD)) { + if (!game.state.startsWith('vm')) { log('Minorities spaces already controlled') } + return true + } + } else if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) { + if (!game.state.startsWith('vm')) { log('Minorities spaces already controlled') } return true } } else if (card === C_CEAUSESCU) { - let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space] > 0).length + let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space.space_id] > 0).length if (dem_romania_infl === 0) { if (!game.state.startsWith('vm')) { log('No influence to remove') } return true @@ -3033,7 +3033,7 @@ function is_auto_resolve(card) { } } else if (card === C_GOVERNMENT_RESIGNS) { - let uncontrolled_elites = spaces.filter( s => game.comInfl[s] > 0 && !check_control(s)).length + let uncontrolled_elites = spaces.filter( space => game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length if (uncontrolled_elites === 0) { if (!game.state.startsWith('vm')) { log('No uncontrolled Elite spaces') } return true -- cgit v1.2.3 From 0028e8d36b7cd8879a45ff367987124527d00f4d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 12:28:49 +0000 Subject: Smooth We Are the People transitions --- rules.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rules.js b/rules.js index c1a57d5..cb5a608 100644 --- a/rules.js +++ b/rules.js @@ -7461,6 +7461,10 @@ states.vm_we_are_the_people_remove = { }, space(space) { remove_infl(space, 'vm_available_ops') + if (game.vm_influence_added[S_LUTHERAN_CHURCH] === 4) { + game.valid_spaces = [...S_EAST_GERMANY] + game.state = 'vm_we_are_the_people_add' + } }, done() { do_log_summary() -- cgit v1.2.3 From 4601fee7c43032a46a5c581d427d7a50da7baba4 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 13:18:55 +0000 Subject: Tweak tst_6 logging --- rules.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index cb5a608..85b679a 100644 --- a/rules.js +++ b/rules.js @@ -3160,18 +3160,18 @@ function get_card_ops(card) { function get_tst_6_ops() { let ops = 0 if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { - log(`+1 op from C${C_PERESTROIKA}`) + logi(`+1 op from C${C_PERESTROIKA}`) ops ++ } if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) { - log(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) + logi(`+1 op from C${C_THE_SINATRA_DOCTRINE}`) ops ++ } if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) { if (ops > 0) { log(`${pluralize(game.prudence.DEM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C${C_PRUDENCE}`) + logi(`-1 op from C${C_PRUDENCE}`) } ops += game.prudence.DEM if (ops < -1) { @@ -3181,9 +3181,9 @@ function get_tst_6_ops() { if (game.active === COM && game.prudence && game.prudence.COM < 0) { if (ops > 0) { - log(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) + logi(`${pluralize(game.prudence.COM,'op')} from C${C_PRUDENCE}`) } else { - log(`-1 op from C${C_PRUDENCE}`) + logi(`-1 op from C${C_PRUDENCE}`) } ops += game.prudence.COM if (ops < -1) { -- cgit v1.2.3 From 811a771963943411489ed41decef7257bf0b07a7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 17:11:46 +0000 Subject: Fix pass with Exit Visas --- rules.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 85b679a..19fb453 100644 --- a/rules.js +++ b/rules.js @@ -3053,6 +3053,14 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } + } else if (card === C_DOMINO_THEORY) { + if (game.revolutions.filter(value => value === true).length < 2) { + if (!game.state.startsWith('vm')) { log('Democrat holds power in fewer than 2 countries') } + return true + } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { + if (!game.state.startsWith('vm')) { log('No scoring cards in discard') } + return true + } } else { return false @@ -5255,6 +5263,7 @@ function vm_the_sinatra_doctrine() { function vm_the_third_way() { log('-2VP') + game.vp -= 2 vm_next() } @@ -6297,6 +6306,9 @@ states.vm_exit_visas_finish = { if (game.temp > 0 ) { view.prompt = 'Exit Visas: draw replacement cards.' gen_action('draw') + } else { + view.prompt = 'Exit Visas: done.' + gen_action('done') } }, draw() { @@ -6305,6 +6317,9 @@ states.vm_exit_visas_finish = { game.temp = 0 vm_next() }, + done() { + vm_next() + } } states.vm_foreign_currency_debt_burden = { @@ -8551,9 +8566,11 @@ CODE[88] = [ // Adamec* ] CODE[89] = [ // Domino Theory* - [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_DOMINO_THEORY) ], + [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_domino_theory ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 7c1224ae2c45e6167a2d63fd2b175234e6e40c2c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 17:45:08 +0000 Subject: Update Exit Visas log --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 19fb453..6f46ee3 100644 --- a/rules.js +++ b/rules.js @@ -6289,7 +6289,8 @@ states.vm_exit_visas = { game.temp++ }, pass() { - push_undo() + push_undo() + log('Did not discard') game.state = 'vm_exit_visas_finish' }, done() { -- cgit v1.2.3 From b6fe2c6e0374dcdf81c9bc38615d74e9155e9c98 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 17:55:10 +0000 Subject: Fix autoresolve for Kohl Proposes Reunification --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index 6f46ee3..90afe63 100644 --- a/rules.js +++ b/rules.js @@ -4913,6 +4913,7 @@ function vm_kohl_proposes_reunification_prep() { if (check_vp()) { return } + vm_next() } function vm_kohl_proposes_reunification() { game.vm_event = C_KOHL_PROPOSES_REUNIFICATION -- cgit v1.2.3 From 5ff80ca6c2a69e8a4cc5d2ce0b2145712e628004 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 17:58:45 +0000 Subject: Fix Laszlo Tokes not going to removed after Massacra in Timisoara --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index 90afe63..9afa28f 100644 --- a/rules.js +++ b/rules.js @@ -4977,6 +4977,7 @@ function vm_malta_summit() { function vm_massacre_in_timisoara() { game.persistent_events = game.persistent_events.filter(n => n !== C_LASZLO_TOKES) + game.strategy_removed.push(C_LASZLO_TOKES) vm_next() } -- cgit v1.2.3 From c0afec77e15497b2e054ad492bad459a7beff7c1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 18:03:49 +0000 Subject: Update Union of Democratic Forces to final rules --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9afa28f..fb0af42 100644 --- a/rules.js +++ b/rules.js @@ -8621,7 +8621,7 @@ 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_remove_limited_opp_infl, 4, 2 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], [ vm_prompt, 'Make 2 Support Checks in Bulgaria' ], [ vm_support_check, 2 ], -- cgit v1.2.3 From d9ed8e9b667fa346adf7c388db95a499b8395d0c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 18:29:35 +0000 Subject: Properly remove Ligachev --- rules.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index fb0af42..a7fbf31 100644 --- a/rules.js +++ b/rules.js @@ -2951,12 +2951,13 @@ function select_card(card){ //Check Ligachev if (game.active === DEM && game.persistent_events.includes(99) && card !== C_GORBACHEV_CHARMS_THE_WEST) { - log('-3 VP from C99') + log(`-3 VP from C${C_LIGACHEV}`) game.vp -= 3 if (check_vp()) { return } game.persistent_events = game.persistent_events.filter(n => n !== 99) + game.strategy_removed.push(C_LIGACHEV) } game.state = 'play_card' } @@ -3061,6 +3062,12 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { log('No scoring cards in discard') } return true } + } else if (card === C_UNION_OF_DEMOCRATIC_FORCES) { + let bulgarian_presence = spaces.filter(space => space.country === 'Bulgaria' && game.comInfl[space.space_id] > 0).length + if (bulgarian_presence === 0) { + if (!game.state.startsWith('vm')) { log('No SPs to remove') } + return true + } } else { return false @@ -3328,7 +3335,7 @@ function end_round() { throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (card_check.length !== 110) { - console.log('wrong number of cards in game', card_check) + console.log('Entire array:', JSON.stringify(card_check)) throw new Error(`Wrong number of cards: ${card_check.length}`) } @@ -5283,6 +5290,7 @@ function vm_the_tyrant_is_gone() { function vm_the_tyrant_is_gone_prep() { add_to_persistent_events(C_THE_TYRANT_IS_GONE) + logi(`After C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU} occurs, remove 4 Commuist SPs from the Romanian Elite space. The Democrats choose where the Ceausescus flee to`) vm_next() } @@ -8619,12 +8627,14 @@ CODE[93] = [ // Shock Therapy* CODE[94] = [ // Union of Democratic Forces* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_UNION_OF_DEMOCRATIC_FORCES) ], [ vm_valid_spaces_country_opp, 'Bulgaria' ], [ vm_prompt, ' from Bulgaria' ], [ vm_remove_limited_opp_infl, 4, 2 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], [ vm_prompt, 'Make 2 Support Checks in Bulgaria' ], [ vm_support_check, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -8643,7 +8653,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], -- cgit v1.2.3 From 624b24699d52321b5257b89f16082e17a9a6a276 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 18:30:27 +0000 Subject: Fix Tyrant --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index ded7d49..8ea17a2 100644 --- a/play.js +++ b/play.js @@ -629,7 +629,7 @@ function on_update() { ui.events[C_SYSTEMATIZATION].style.display = "none" } - if (view.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { + if (view.the_tyrant_is_gone) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" -- cgit v1.2.3 From cad77dfadbdfb5d764a0e53ceb9a4b2bdc39077b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 18:41:45 +0000 Subject: Fix NYE Party --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index a7fbf31..ef25261 100644 --- a/rules.js +++ b/rules.js @@ -6953,7 +6953,6 @@ states.vm_new_years_eve_party = { if (check_vp()) { return } - permanently_remove(C_NEW_YEARS_EVE_PARTY) vm_next() }, continue() { -- cgit v1.2.3 From 1b364f8186a92b28b8d44226f8451fc60a6a751b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 19:03:59 +0000 Subject: Fix Tyrant --- play.js | 2 +- rules.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/play.js b/play.js index 8ea17a2..7c53d39 100644 --- a/play.js +++ b/play.js @@ -629,7 +629,7 @@ function on_update() { ui.events[C_SYSTEMATIZATION].style.display = "none" } - if (view.the_tyrant_is_gone) { + if (view.the_tyrant_is_gone && view.the_tyrant_is_gone <= last_space) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" diff --git a/rules.js b/rules.js index ef25261..dbd1beb 100644 --- a/rules.js +++ b/rules.js @@ -627,8 +627,10 @@ states.play_card ={ game.return = game.active game.vm_event = game.played_card if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { + console.log('resolved automatically') goto_vm(game.vm_event)} else { + console.log('resolved normally') next_player() log(`C${game.vm_event}`) goto_vm(game.vm_event) @@ -2972,7 +2974,7 @@ function is_auto_resolve(card) { return true } } - else if (ceausecu_events.includes(card) && game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { + else if (ceausecu_events.includes(card) && game.the_tyrant_is_gone > 0) { return true } else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { @@ -4064,6 +4066,7 @@ function vm_return() { delete game.vm_influence_added delete game.communist_hand_red + console.log('in vm_return, game.active', game.active) game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { reset_austria_hungary_border_reopened() -- cgit v1.2.3 From 35c85d97671d2c1e2fe703973755fb2866d43ca0 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 19:48:01 +0000 Subject: Pluralize nouns endning in y --- rules.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index dbd1beb..94f4c92 100644 --- a/rules.js +++ b/rules.js @@ -627,10 +627,8 @@ states.play_card ={ game.return = game.active game.vm_event = game.played_card if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { - console.log('resolved automatically') goto_vm(game.vm_event)} else { - console.log('resolved normally') next_player() log(`C${game.vm_event}`) goto_vm(game.vm_event) @@ -1656,9 +1654,10 @@ states.final_scoring_held = { gen_action('bonus') }, bonus() { + push_undo() const held_countries = game.revolutions.filter(value => value === false).length let vp_gain = 4*held_countries - log(`Communist holds ${held_countries} countries: -${vp_gain} VP`) + log(`Communist holds power in ${pluralize(held_countries, 'country', 's')}: -${vp_gain} VP`) game.vp -= 4*held_countries game.temp = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false} game.state = 'final_scoring' @@ -2111,7 +2110,6 @@ function remove_infl(space, ops) { function do_sc(space) { clear_undo() log_gap(`Support check: %${space}`) - // Continue with Support Check Logic let roll = roll_d6() @@ -3318,7 +3316,6 @@ function end_round() { if (check_duplicates(card_check)) { console.log('duplicate cards: card check', card_check) - console.log('view.actions', view.actions) const duplicates = find_duplicates(card_check) console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) @@ -3749,8 +3746,16 @@ function this_card() { return game.vm_event > 0 ? game.vm_event : game.played_card } -const pluralize = (count, noun, suffix = 's') => - `${count} ${noun}${Math.abs(count) !== 1 ? suffix : ''}` +const pluralize = (count, noun, suffix = 's') => { + if (Math.abs(count) === 1) { + return `${count} ${noun}` + } else { + if (noun.endsWith('y') && !/[aeiou]y$/.test(noun)) { + noun = noun.slice(0, -1) + 'ie' + } + return `${count} ${noun}${suffix}` + } +} function clean_name(str) { if (str && str.slice(-1) === '*') { @@ -4066,7 +4071,6 @@ function vm_return() { delete game.vm_influence_added delete game.communist_hand_red - console.log('in vm_return, game.active', game.active) game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { reset_austria_hungary_border_reopened() @@ -5765,7 +5769,6 @@ states.vm_remove_all_infl = { states.vm_support_check_prep = { inactive: 'do support checks.', prompt () { - console.log('in vm_support_check_prep', game.valid_spaces) if (game.valid_spaces.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid targets for support check.` gen_action('done') @@ -5899,7 +5902,6 @@ states.vm_1_support_check_prep = { states.vm_do_support_check = { inactive: 'do support checks.', prompt () { - console.log('in vm_do_support_check') view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') }, @@ -6947,10 +6949,10 @@ states.vm_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) { - log(`Communist holds power in ${power} countries. -3 VP`) + log(`Communist holds power in ${pluralize(power, 'country', 's')}. -3 VP`) game.vp -= 3 } else { - log(`Communist holds power in ${power} countries. +3 VP`) + log(`Communist holds power in ${pluralize(power, 'country', 's')}. +3 VP`) game.vp += 3 } if (check_vp()) { -- cgit v1.2.3 From e3d8b1c1639218973805c0fa64e33af8b66b33aa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 19:48:16 +0000 Subject: Update autoresolve events --- events.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/events.txt b/events.txt index 01ba963..52cd269 100644 --- a/events.txt +++ b/events.txt @@ -679,9 +679,11 @@ add_limited_infl 4 2 CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. -prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' permanently_remove +if !is_auto_resolve(C_DOMINO_THEORY) +prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' domino_theory +endif @@ -728,12 +730,14 @@ add_infl_free 3 CARD 94 - Union of Democratic Forces* # Remove 4 Communist SPs from Bulgaria. Democratic Player may make Support Checks in Bulgaria using the Ops value of this card if the Bulgarian writers space is Democratically controlled. permanently_remove +if !is_auto_resolve(C_UNION_OF_DEMOCRATIC_FORCES) valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' -remove_opp_infl 4 +remove_limited_opp_infl 4 2 valid_spaces_country_sc 'Bulgaria' prompt 'Make 2 Support Checks in Bulgaria' support_check 2 +endif CARD 95 - Power Struggle - Romania -- cgit v1.2.3 From 8b9f51b9a547531a8b045f0b60d9fec9e58da4fd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 11:40:04 +0000 Subject: Fix typo in Normalization --- events.txt | 2 +- rules.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/events.txt b/events.txt index 52cd269..45c48e2 100644 --- a/events.txt +++ b/events.txt @@ -400,7 +400,7 @@ add_infl_free CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove -if !is_auto_resolve(C_NORMALISATION) +if !is_auto_resolve(C_NORMALIZATION) normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 diff --git a/rules.js b/rules.js index 94f4c92..1ef5ec8 100644 --- a/rules.js +++ b/rules.js @@ -8304,7 +8304,7 @@ CODE[51] = [ // 40th Anniversary Celebration* CODE[52] = [ // Normalisation [ vm_permanently_remove ], - [ vm_if, ()=>!is_auto_resolve(C_NORMALISATION) ], + [ vm_if, ()=>!is_auto_resolve(C_NORMALIZATION) ], [ vm_normalisation ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], -- cgit v1.2.3 From 275e03c84e3a6b67cb2da82b040d45ebd4038f08 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 12:08:32 +0000 Subject: Fix Honecker under general strike --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 1ef5ec8..324e4f0 100644 --- a/rules.js +++ b/rules.js @@ -1790,7 +1790,12 @@ states.honecker ={ log_h2(`Action Round ${game.round}`) game.round_player = COM permanently_remove(C_HONECKER) - game.state = 'choose_card' + console.log('game.persistent_events', game.persistent_events) + if (game.persistent_events.includes(C_GENERAL_STRIKE)) { + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } }, pass() { push_undo() -- cgit v1.2.3 From a03c12cd980461301774eca04afc52dada9fdbf1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 12:09:03 +0000 Subject: Fix Honecker under general strike --- rules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/rules.js b/rules.js index 324e4f0..ce6d596 100644 --- a/rules.js +++ b/rules.js @@ -1790,7 +1790,6 @@ states.honecker ={ log_h2(`Action Round ${game.round}`) game.round_player = COM permanently_remove(C_HONECKER) - console.log('game.persistent_events', game.persistent_events) if (game.persistent_events.includes(C_GENERAL_STRIKE)) { game.state = 'general_strike' } else { -- cgit v1.2.3 From cc33f1abaef7b291cb43da27fa7b8b4e1120decc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 12:13:10 +0000 Subject: Consistent spelling of Normalization --- events.txt | 4 ++-- rules.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/events.txt b/events.txt index 45c48e2..88cd639 100644 --- a/events.txt +++ b/events.txt @@ -397,11 +397,11 @@ add_infl_free 40th_anniversary_celebration_vp -CARD 52 - Normalisation +CARD 52 - Normalization # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove if !is_auto_resolve(C_NORMALIZATION) -normalisation +normalization prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 endif diff --git a/rules.js b/rules.js index ce6d596..4f03953 100644 --- a/rules.js +++ b/rules.js @@ -5031,7 +5031,7 @@ function vm_nomenklatura() { game.state = 'vm_nomenklatura' } -function vm_normalisation() { +function vm_normalization() { 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 @@ -8306,10 +8306,10 @@ CODE[51] = [ // 40th Anniversary Celebration* [ vm_return ], ] -CODE[52] = [ // Normalisation +CODE[52] = [ // Normalization [ vm_permanently_remove ], [ vm_if, ()=>!is_auto_resolve(C_NORMALIZATION) ], - [ vm_normalisation ], + [ vm_normalization ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], [ vm_endif ], -- cgit v1.2.3 From caa9af38b1312e7574ae2f528b08dbc6a32ffa71 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 23:24:31 +0000 Subject: Support falters: discards go to power struggle discrd --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 4f03953..e6d59f9 100644 --- a/rules.js +++ b/rules.js @@ -3675,7 +3675,8 @@ function discard_card(hand) { log_gap(`Discarded: P${discarded_card}`) } else { log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) - } + } + game.power_struggle_discard.push(discard_card) } else { log(`Discarded C${discarded_card}`) game.strategy_discard.push(discarded_card) -- cgit v1.2.3 From 730adc321bbc4606d11773ede379df169fb5bbfc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 9 Nov 2024 09:03:47 +0000 Subject: Setup view_opp_power_hamd --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index e6d59f9..2d54167 100644 --- a/rules.js +++ b/rules.js @@ -359,7 +359,7 @@ exports.view = function(state, player) { strategy_deck: game.strategy_deck.length, strategy_removed: game.strategy_removed, discard: game.discard, - show_opp_hand: game.view_opp_hand, + show_opp_hand: game.view_opp_hand, /* Is this still needed?*/ democrat_hand: game.democrat_hand.length, communist_hand: game.communist_hand.length, @@ -405,6 +405,11 @@ exports.view = function(state, player) { view.opp_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) view.power_hand = [...game.com_pwr_hand].sort((a, b) => a - b) } + if (game.view_opp_power_hand) { + if (player === COM) { + view.view_opp_power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) + } + } if (player === DEM) { view.samizdat = game.samizdat_card -- cgit v1.2.3 From 10f953a8cb1f65dbf4e6c0e80170e01853aedf29 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 9 Nov 2024 16:03:19 +0000 Subject: Indent logs --- rules.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/rules.js b/rules.js index 2d54167..eb99f30 100644 --- a/rules.js +++ b/rules.js @@ -2989,92 +2989,92 @@ function is_auto_resolve(card) { } else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) { if (game.democrat_hand.length === 0) { - if (!game.state.startsWith('vm')) { log('Democrat has no cards to discard') } + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } return true } } else if (card === C_DEUTSCHE_MARKS) { if (game.democrat_hand.length === 0) { - if (!game.state.startsWith('vm')) { log('Democrat has no cards to give') } + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to give') } return true } } else if (card === C_KISS_OF_DEATH ) { if (game.communist_hand.length === 0) { - if (!game.state.startsWith('vm')) { log('Communist has no cards to discard') } + if (!game.state.startsWith('vm')) { logi('Communist has no cards to discard') } return true } } else if (card === C_DISSIDENT_ARRESTED) { let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length if (dem_intellectual_infl === 0) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { if (game.systematization && game.systematization === S_HARGHITA_COVASNA ) { if (check_dem_control(S_RAZGRAD)) { - if (!game.state.startsWith('vm')) { log('Minorities spaces already controlled') } + if (!game.state.startsWith('vm')) { logi('Minorities spaces already controlled') } return true } } else if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) { - if (!game.state.startsWith('vm')) { log('Minorities spaces already controlled') } + if (!game.state.startsWith('vm')) { logi('Minorities spaces already controlled') } return true } } else if (card === C_CEAUSESCU) { let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space.space_id] > 0).length if (dem_romania_infl === 0) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_WE_ARE_THE_PEOPLE) { if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_BETRAYAL) { if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) { if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_GOVERNMENT_RESIGNS) { let uncontrolled_elites = spaces.filter( space => game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length if (uncontrolled_elites === 0) { - if (!game.state.startsWith('vm')) { log('No uncontrolled Elite spaces') } + if (!game.state.startsWith('vm')) { logi('No uncontrolled Elite spaces') } return true } } else if (card === C_ST_NICHOLAS_CHURCH) { if (check_dem_control(S_LUTHERAN_CHURCH)) { - if (!game.state.startsWith('vm')) { log('Lutheran Church already controlled') } + if (!game.state.startsWith('vm')) { logi('Lutheran Church already controlled') } return true } } else if (card === C_BULGARIAN_TURKS_EXPELLED) { if (game.demInfl[S_RAZGRAD] === 0 ) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_NORMALIZATION) { if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) { - if (!game.state.startsWith('vm')) { log('No influence to remove') } + if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_DOMINO_THEORY) { if (game.revolutions.filter(value => value === true).length < 2) { - if (!game.state.startsWith('vm')) { log('Democrat holds power in fewer than 2 countries') } + if (!game.state.startsWith('vm')) { logi('Democrat holds power in fewer than 2 countries') } return true } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { - if (!game.state.startsWith('vm')) { log('No scoring cards in discard') } + if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') } return true } } else if (card === C_UNION_OF_DEMOCRATIC_FORCES) { let bulgarian_presence = spaces.filter(space => space.country === 'Bulgaria' && game.comInfl[space.space_id] > 0).length if (bulgarian_presence === 0) { - if (!game.state.startsWith('vm')) { log('No SPs to remove') } + if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } } @@ -3714,7 +3714,7 @@ function reset_power() { delete game.raised_stakes_discard delete game.played_power_card delete game.tactics_fails - game.view_opp_hand = false + delete game.view_opp_power_hand let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU] for (let e of scoring_events ) { @@ -5079,7 +5079,7 @@ function vm_power_struggle() { //Check for Securitate 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 + game.view_opp_power_hand = true } log_h2('Deal Cards') game.state = 'draw_power_cards' -- cgit v1.2.3 From 66a068a7191804a10647a91b56c57524f2f9ee3b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 9 Nov 2024 16:09:52 +0000 Subject: Malta Summit no longer playable after Kremlin Coup --- data.js | 2 +- rules.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data.js b/data.js index 13ca104..4912dde 100644 --- a/data.js +++ b/data.js @@ -1387,7 +1387,7 @@ const cards = [ {number: 107, period: 3, side: 'C', name: 'Massacre in Timisoara*', ops: 3, remove: true, playable: false, red: false}, {number: 108, period: 3, side: 'D', name: 'Army Backs Revolution*', ops: 3, remove: true, playable: true, red: false}, {number: 109, period: 3, side: 'C', name: 'Kremlin Coup!*', ops: 3, remove: true, playable: false, red: false}, - {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: true, playable: true, red: false}, + {number: 110, period: 3, side: 'D', name: 'Malta Summit*', ops: 3, remove: true, playable: false, red: false}, ] const power_cards = [ diff --git a/rules.js b/rules.js index eb99f30..a4a8751 100644 --- a/rules.js +++ b/rules.js @@ -320,7 +320,7 @@ function start_game() { // Set variable event cards where event is playable at start of game - game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE] + game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE, C_MALTA_SUMMIT] draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) @@ -4476,7 +4476,7 @@ function vm_remove_limited_opp_infl() { function vm_do_remove_limited_infl(space, max_infl) { push_undo() - log(`Removed 1 SP from %${space}.`) + log_summary(`Removed £ SP from %${space}.`) game.vm_available_ops -- if (!game.vm_influence_added) { @@ -4958,6 +4958,7 @@ function vm_kremlin_coup() { game.temp.push(country) } }) + game.playable_cards = game.playable_cards.filter(c => c !== C_MALTA_SUMMIT) game.state = 'vm_kremlin_coup_choose_country' } -- cgit v1.2.3 From ed2d5925862d2a37f90413eff8f9a25a71170079 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:35:15 +0000 Subject: CEH cannot be drawn by Reformer Rehabilitated --- rules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index a4a8751..ed79e5e 100644 --- a/rules.js +++ b/rules.js @@ -5117,6 +5117,7 @@ function vm_reformer_rehabilitated () { for (let card of game.strategy_discard) { if (!event_is_playable(card)) continue if (card === game.played_card) continue + if (card === C_COMMON_EUROPEAN_HOME) continue if (scoring_cards.includes(card)) continue game.valid_cards.push(card) @@ -5309,7 +5310,7 @@ function vm_the_tyrant_is_gone() { function vm_the_tyrant_is_gone_prep() { add_to_persistent_events(C_THE_TYRANT_IS_GONE) logi(`After C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU} occurs, remove 4 Commuist SPs from the Romanian Elite space. The Democrats choose where the Ceausescus flee to`) - vm_next() + vm_next() } function vm_tyrant_block() { -- cgit v1.2.3 From 4913146fdf49ff941e582970c6056d21444e6efa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:42:28 +0000 Subject: Update implementation of Tyrant --- events.txt | 12 ++++++++---- play.js | 2 +- rules.js | 21 ++++++++++++--------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/events.txt b/events.txt index 88cd639..532b892 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,8 +515,12 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces_country 'Romania' systematization +else +tyrant_block +endif CARD 70 - Securitate* @@ -790,7 +794,7 @@ stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -850,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/play.js b/play.js index 7c53d39..8ea17a2 100644 --- a/play.js +++ b/play.js @@ -629,7 +629,7 @@ function on_update() { ui.events[C_SYSTEMATIZATION].style.display = "none" } - if (view.the_tyrant_is_gone && view.the_tyrant_is_gone <= last_space) { + if (view.the_tyrant_is_gone) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" diff --git a/rules.js b/rules.js index ed79e5e..e61586c 100644 --- a/rules.js +++ b/rules.js @@ -2972,7 +2972,7 @@ function select_card(card){ } function is_auto_resolve(card) { - let ceausecu_events = [10, 41, 101, 107] + let ceausecu_events = [10, 41, 69, 101, 107] if (auto_resolve_events.includes(card)) { return true } @@ -3729,14 +3729,13 @@ function reset_power() { } function check_tyrant() { - if (game.the_tyrant_is_gone > 0 && game.the_tyrant_is_gone !== 111 && check_dem_control(game.the_tyrant_is_gone)) { + if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 if (check_vp()) { return } - game.persistent_events = game.persistent_events.filter(n => n !== C_THE_TYRANT_IS_GONE) - game.the_tyrant_is_gone = 111 + delete game.the_tyrant_is_gone } } @@ -7986,7 +7985,7 @@ CODE[9] = [ // The Wall* CODE[10] = [ // Cult of Personality [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_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 ], @@ -8220,7 +8219,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_tyrant_block ], [ vm_else ], [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], @@ -8431,8 +8430,12 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], + [ vm_else ], + [ vm_tyrant_block ], + [ vm_endif ], [ vm_return ], ] @@ -8669,7 +8672,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], + [ vm_if, ()=>game.persistent_events.includes(54) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], @@ -8703,7 +8706,7 @@ CODE[100] = [ // Stand Fast* ] CODE[101] = [ // Elena* - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], @@ -8762,7 +8765,7 @@ CODE[106] = [ // Social Democratic Platform Adopted* CODE[107] = [ // Massacre in Timisoara* [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], -- cgit v1.2.3 From d8ae7f550d9b1b5d9510598ff9df5703af2e0c92 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:48:59 +0000 Subject: VP penalty if CEH sent to TST --- rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.js b/rules.js index e61586c..d243fbf 100644 --- a/rules.js +++ b/rules.js @@ -654,6 +654,7 @@ states.play_card ={ tst() { push_undo() log_gap(`Played C${game.played_card} to the Tiananmen Square Track`) + finish_play_card() game.state='tiananmen_square_attempt' }, support_check() { @@ -791,6 +792,7 @@ states.tiananmen_square_attempt = { }, roll() { clear_undo() + game.vm_event_to_do = false do_tst_attempt () } } -- cgit v1.2.3 From f358679126f348d4bc32e89aea8754a22cf651c1 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:53:02 +0000 Subject: Remove unnecessary player change in Kiss of Death --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index d243fbf..7aca87c 100644 --- a/rules.js +++ b/rules.js @@ -6633,6 +6633,7 @@ states.vm_kiss_of_death = { log_side() game.state = 'vm_kiss_of_death_finish' } else { + change_player() log('Event does not occur') vm_next() } -- cgit v1.2.3 From 0cae02d8f597a863ea71c71ebb5d81d76ebe8ea5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:57:23 +0000 Subject: Add autoresolve to Kiss of Death --- rules.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index 7aca87c..f34b6bc 100644 --- a/rules.js +++ b/rules.js @@ -6630,8 +6630,12 @@ states.vm_kiss_of_death = { log_side() game.state = 'vm_kiss_of_death_finish' } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { - log_side() - game.state = 'vm_kiss_of_death_finish' + if (is_auto_resolve(game.vm_event)) { + game.state = 'vm_kiss_of_death_finish' + } else { + log_side() + game.state = 'vm_kiss_of_death_finish' + } } else { change_player() log('Event does not occur') @@ -6649,20 +6653,12 @@ states.vm_kiss_of_death_finish = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - 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.` - gen_action('event') - } else { - view.prompt = 'Event does not occur.' - gen_action('done') - } + view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for the event.` + gen_action('event') }, event() { goto_vm(game.vm_event) }, - done() { - vm_next() - } } states.vm_kremlin_coup_choose_country = { -- cgit v1.2.3 From 4bec5f108f946feb558a6151329aa5edde5ae916 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:58:30 +0000 Subject: Fix typo in log --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index f34b6bc..535fa2b 100644 --- a/rules.js +++ b/rules.js @@ -4602,7 +4602,7 @@ function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) - logi(`${C_SECURITATE} no longer has any effect`) + logi(`C${C_SECURITATE} no longer has any effect`) vm_next() } -- cgit v1.2.3 From a718121b64cbf7dde9fab9fe729df415c70a821d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:18:24 +0000 Subject: Update handling of Tyrant --- events.txt | 12 ++++++------ rules.js | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/events.txt b/events.txt index 532b892..a47d48b 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,7 +515,7 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country 'Romania' systematization else @@ -760,7 +760,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu -if game.persistent_events.includes(54) +if game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romanian Elite Space' remove_x_opp_infl 4 @@ -794,7 +794,7 @@ stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -854,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/rules.js b/rules.js index 535fa2b..18061df 100644 --- a/rules.js +++ b/rules.js @@ -226,6 +226,7 @@ const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 const THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED = 540 +const THE_TYRANT_IS_GONE_OCCURRED = 970 // COUNTRY CONSTANTS @@ -5297,6 +5298,7 @@ function vm_the_third_way() { } function vm_the_tyrant_is_gone() { + game.persistent_events.push(THE_TYRANT_IS_GONE_OCCURRED) game.valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] @@ -8671,7 +8673,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], -- cgit v1.2.3 From 0587858639d8b6db5f8a36eb43eb6355f6146999 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:21:24 +0000 Subject: Update handling of Tyrant --- rules.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rules.js b/rules.js index 18061df..c4a4a38 100644 --- a/rules.js +++ b/rules.js @@ -2984,7 +2984,7 @@ function is_auto_resolve(card) { return true } } - else if (ceausecu_events.includes(card) && game.the_tyrant_is_gone > 0) { + else if (ceausecu_events.includes(card) && game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED)) { return true } else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { @@ -7986,7 +7986,7 @@ CODE[9] = [ // The Wall* CODE[10] = [ // Cult of Personality [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], [ 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 ], @@ -8220,7 +8220,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], + [ vm_if, ()=>game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_tyrant_block ], [ vm_else ], [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], @@ -8431,7 +8431,7 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], [ vm_else ], @@ -8707,7 +8707,7 @@ CODE[100] = [ // Stand Fast* ] CODE[101] = [ // Elena* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], @@ -8766,7 +8766,7 @@ CODE[106] = [ // Social Democratic Platform Adopted* CODE[107] = [ // Massacre in Timisoara* [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], -- cgit v1.2.3 From bda4e3eb1a7cb72088334599a3eba1bec8752efe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:23:56 +0000 Subject: Fix typo --- events.txt | 10 +++++----- rules.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/events.txt b/events.txt index a47d48b..c25dfca 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,7 +515,7 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country 'Romania' systematization else @@ -794,7 +794,7 @@ stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -854,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/rules.js b/rules.js index c4a4a38..6755fe0 100644 --- a/rules.js +++ b/rules.js @@ -7986,7 +7986,7 @@ CODE[9] = [ // The Wall* CODE[10] = [ // Cult of Personality [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ 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 ], @@ -8220,7 +8220,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_tyrant_block ], [ vm_else ], [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], @@ -8431,7 +8431,7 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], [ vm_else ], @@ -8707,7 +8707,7 @@ CODE[100] = [ // Stand Fast* ] CODE[101] = [ // Elena* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], @@ -8766,7 +8766,7 @@ CODE[106] = [ // Social Democratic Platform Adopted* CODE[107] = [ // Massacre in Timisoara* [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], -- cgit v1.2.3 From 98f8263c6bfd5bae8e2e29e89fe4f65d5865a4b7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:27:03 +0000 Subject: Improve logging for CEH --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 6755fe0..e300a46 100644 --- a/rules.js +++ b/rules.js @@ -3225,10 +3225,10 @@ function finish_play_card() { if (game.played_card === C_COMMON_EUROPEAN_HOME) { if (game.active === DEM) { game.vp -- - log('-1 VP') + logi(`-1 VP for playing C${C_COMMON_EUROPEAN_HOME} for operations`) } else { game.vp ++ - log('+1 VP') + logi(`+1 VP for playing C${C_COMMON_EUROPEAN_HOME} for operations`) } if (check_vp()) { return -- cgit v1.2.3 From 227059494e83ebf659a7243c1c0fc883f2348bfd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:32:13 +0000 Subject: Update Tear Gas logging --- rules.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index e300a46..558d0ae 100644 --- a/rules.js +++ b/rules.js @@ -2121,6 +2121,7 @@ function remove_infl(space, ops) { function do_sc(space) { clear_undo() + let tear_gas_start = game.persistent_events.includes(C_TEAR_GAS) log_gap(`Support check: %${space}`) // Continue with Support Check Logic @@ -2260,10 +2261,16 @@ function do_sc(space) { game.vp ++ } if (game.active === COM && game.persistent_events.includes(C_ECO_GLASNOST) && spaces[space].space_id === S_RUSE) { - log_msg_gap('+1 VP from C39') + log('+1 VP from C39') game.vp++ } + //Check if Tear Gas used + let tear_gas_end = game.persistent_events.includes(C_TEAR_GAS) + if (tear_gas_start && !tear_gas_end) { + log(`C${C_TEAR_GAS} no longer in effect`) + } + // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)){ if (game.austria_hungary_border_reopened_tracker) { -- cgit v1.2.3 From 072d116d8f91513e09682b258b9a452f7f083c6b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:37:40 +0000 Subject: Fix unnecessary player changes in Kiss of Death --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index 558d0ae..a83982d 100644 --- a/rules.js +++ b/rules.js @@ -6640,6 +6640,7 @@ states.vm_kiss_of_death = { game.state = 'vm_kiss_of_death_finish' } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { if (is_auto_resolve(game.vm_event)) { + change_player() game.state = 'vm_kiss_of_death_finish' } else { log_side() -- cgit v1.2.3 From b77ad4a251f31a852435e65b1f851117d0e059bf Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:41:17 +0000 Subject: Remove unnecessary steps --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index a83982d..eb53cce 100644 --- a/rules.js +++ b/rules.js @@ -6641,7 +6641,7 @@ states.vm_kiss_of_death = { } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { if (is_auto_resolve(game.vm_event)) { change_player() - game.state = 'vm_kiss_of_death_finish' + goto_vm(game.vm_event) } else { log_side() game.state = 'vm_kiss_of_death_finish' -- cgit v1.2.3 From 3b2ab45561186d66ad9c1161c6947a0f76d75e47 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:42:38 +0000 Subject: Remove unnecessary steps --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index eb53cce..a5802f6 100644 --- a/rules.js +++ b/rules.js @@ -6641,7 +6641,7 @@ states.vm_kiss_of_death = { } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { if (is_auto_resolve(game.vm_event)) { change_player() - goto_vm(game.vm_event) + game.state = 'vm_kiss_of_death_finish' } else { log_side() game.state = 'vm_kiss_of_death_finish' -- cgit v1.2.3 From 7d4f6e7a27d32f487b850b8b85a7e2753c1471ac Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 17:49:19 +0000 Subject: Fixing adjacency not counting space 0 --- rules.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/rules.js b/rules.js index a5802f6..9b8cb6f 100644 --- a/rules.js +++ b/rules.js @@ -2447,17 +2447,15 @@ function count_adj(id) { let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - if (adj_space_id) { - const adj_piece = spaces.find(piece => piece && piece.space_id === adj_space_id); - if (adj_piece && adj_piece.space_id !== space.space_id) { - if (check_dem_control(adj_piece.space_id)) { - dem_adj++ - } - if (check_com_control(adj_piece.space_id)) { - com_adj++ - } - } - } + const adj_piece = spaces.find(piece => piece.space_id === adj_space_id); + if (adj_piece.space_id !== space.space_id) { + if (check_dem_control(adj_piece.space_id)) { + dem_adj++ + } + if (check_com_control(adj_piece.space_id)) { + com_adj++ + } + } } return {dem_adj, com_adj} } @@ -4775,14 +4773,10 @@ function vm_eliminate(space_id) { // Eliminate the democrat influence and move t } } - function get_adjusted_adjacency(space_id) { let adjacent_spaces = spaces[space_id].adjacent; if (adjacent_spaces.includes(game.systematization)) { - } - if (game.systematization !== 0) { let eliminated_space_id = game.systematization; - return adjacent_spaces.map(adj_space_id => { if (adj_space_id === eliminated_space_id) { return spaces[eliminated_space_id].adjacent; -- cgit v1.2.3 From 74258665410edbb7b6f4a0b56d80d16689fea6bb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 17:55:21 +0000 Subject: Fix Tyrant in end game scoring --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 9b8cb6f..dc6e0e5 100644 --- a/rules.js +++ b/rules.js @@ -1628,7 +1628,7 @@ states.end_turn_4_5_4 = { log_h1(`New Year's Eve Party`) game.vm_event = 104 //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { + if (game.the_tyrant_is_gone && game.the_tyrant_is_gone > 0) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } @@ -1643,7 +1643,7 @@ states.end_turn_4_5_4 = { log_h2('Final Scoring') //Check if the Communist receives VP from The Tyrant is Gone - if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE)) { + if (game.the_tyrant_is_gone && game.the_tyrant_is_gone > 0) { game.vp -= 2 log(`Communist receives 2 VP from C97`) } -- cgit v1.2.3 From 7d8c89a5c0773767f3fa7d82061b3615b69559e2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 18:32:17 +0000 Subject: fix typo --- play.js | 1 + rules.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index 8ea17a2..079f366 100644 --- a/play.js +++ b/play.js @@ -765,6 +765,7 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") + console.log('view.power_struggle_discard', view.power_struggle_discard) } // =========================== LOG FUNCTIONS ============================================== diff --git a/rules.js b/rules.js index dc6e0e5..0140e07 100644 --- a/rules.js +++ b/rules.js @@ -3689,7 +3689,7 @@ function discard_card(hand) { } else { log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) } - game.power_struggle_discard.push(discard_card) + game.power_struggle_discard.push(discarded_card) } else { log(`Discarded C${discarded_card}`) game.strategy_discard.push(discarded_card) -- cgit v1.2.3 From ae59792ee944ed0b55a8c0a5d7f42b387a12babd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 18:52:49 +0000 Subject: Improve Support Falters logging --- rules.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 0140e07..9916bfe 100644 --- a/rules.js +++ b/rules.js @@ -225,6 +225,7 @@ const switch_events = [6, 20, 71] const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 +const PC_SUPPORT_FALTERS = 49 const THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED = 540 const THE_TYRANT_IS_GONE_OCCURRED = 970 @@ -3685,9 +3686,9 @@ function discard_card(hand) { let discarded_card = hand.splice(card, 1)[0] if (game.is_pwr_struggle) { if (numberless_cards.includes(discarded_card)) { - log_gap(`Discarded: P${discarded_card}`) + logi(`Discarded: P${discarded_card}`) } else { - log_gap(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) + logi(`Discarded: P${discarded_card} V${power_cards[discarded_card].value}`) } game.power_struggle_discard.push(discarded_card) } else { @@ -5430,6 +5431,7 @@ function vm_support_surges() { function vm_support_falters() { game.vm_available_ops = 2 game.return === game.active + log(`C${PC_SUPPORT_FALTERS}:`) game.state = 'vm_support_falters' } -- cgit v1.2.3 From 8a420102f020d35d41b3b40023db9a5641e88ffe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 18:54:55 +0000 Subject: Fix typo --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9916bfe..0e5ce04 100644 --- a/rules.js +++ b/rules.js @@ -5431,7 +5431,7 @@ function vm_support_surges() { function vm_support_falters() { game.vm_available_ops = 2 game.return === game.active - log(`C${PC_SUPPORT_FALTERS}:`) + log(`P${PC_SUPPORT_FALTERS}:`) game.state = 'vm_support_falters' } -- cgit v1.2.3 From 05e3bce5f852bd18b470e9b1bdc9e10ee0e8ef89 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 12 Nov 2024 17:50:16 +0000 Subject: Simplifying code --- rules.js | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/rules.js b/rules.js index 0e5ce04..76627f0 100644 --- a/rules.js +++ b/rules.js @@ -2361,7 +2361,6 @@ function valid_spaces_infl() { let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; - // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); @@ -2440,24 +2439,20 @@ function do_valid_cards() { valid_cards(game.com_pwr_hand, presence.com_leaders)} } -function count_adj(id) { - const space = spaces[id] +function count_adj(space_id) { let dem_adj = 0 let com_adj = 0 - let adjacent_spaces = get_adjusted_adjacency(space.space_id) + let adjacent_spaces = get_adjusted_adjacency(space_id) for (let adj_space_id of adjacent_spaces) { - const adj_piece = spaces.find(piece => piece.space_id === adj_space_id); - if (adj_piece.space_id !== space.space_id) { - if (check_dem_control(adj_piece.space_id)) { - dem_adj++ - } - if (check_com_control(adj_piece.space_id)) { - com_adj++ - } - } - } + if (check_dem_control(adj_space_id)) { + dem_adj++ + } + if (check_com_control(adj_space_id)) { + com_adj++ + } + } return {dem_adj, com_adj} } @@ -4301,10 +4296,7 @@ function vm_valid_spaces_solidarity_legalised() { } function vm_active_country () { - game.valid_spaces = game.valid_spaces.filter(space_id => { - let space = spaces.find(s => s && s.space_id === space_id); - return space && space.country === game.vm_active_country; - }); + game.valid_spaces = game.valid_spaces.filter(space_id => spaces[space_id].country === game.vm_active_country) vm_next() } -- cgit v1.2.3 From 75a52996cc57e066f8fbf52eeff27a22de0da17b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 13 Nov 2024 20:58:43 +0000 Subject: Fix Malta Summit failure --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 76627f0..910e46f 100644 --- a/rules.js +++ b/rules.js @@ -6888,7 +6888,7 @@ states.vm_malta_summit = { } else { log('Summit failed. Required 4 or more') - vm_goto_step(vm_permanently_remove) + vm_return() } }, } -- cgit v1.2.3 From 327a597984be4c2276cdc43ffde098ec155fc7b9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:29:05 +0000 Subject: Simplify the wall must go --- events.txt | 1 - rules.js | 8 -------- 2 files changed, 9 deletions(-) diff --git a/events.txt b/events.txt index c25dfca..94738a7 100644 --- a/events.txt +++ b/events.txt @@ -656,7 +656,6 @@ tank_column CARD 86 - The Wall Must Go!* # Reduce USSR stability by 1. The Democratic Player attempts to tear down the Berlin Wall. Each player rolls a die and adds the number of spaces in Germany they control. Higher total wins. This is best 2 out of 3. If successful +3 VPs and the Communist must remove 3 SPs from Germany. -permanently_remove the_wall_must_go remove_infl 3 diff --git a/rules.js b/rules.js index 910e46f..c8c7de6 100644 --- a/rules.js +++ b/rules.js @@ -3259,13 +3259,6 @@ function finish_the_wall() { game.valid_spaces.push(space.space_id) } } - if (!game.vm_infl_to_do) { - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } if (game.active === DEM) {next_player()} vm_next () } else { @@ -8568,7 +8561,6 @@ CODE[85] = [ // Tank Column/Tank Man* ] CODE[86] = [ // The Wall Must Go!* - [ vm_permanently_remove ], [ vm_the_wall_must_go ], [ vm_remove_infl, 3 ], [ vm_return ], -- cgit v1.2.3 From 0c3b2ee5d5676c506dbb7a4bf256a42672a92f08 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:44:32 +0000 Subject: Improve logging --- rules.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index c8c7de6..e9eeda3 100644 --- a/rules.js +++ b/rules.js @@ -637,7 +637,7 @@ states.play_card ={ goto_vm(game.vm_event)} else { next_player() - log(`C${game.vm_event}`) + log(`C${game.vm_event}:`) goto_vm(game.vm_event) } }, @@ -738,7 +738,7 @@ states.resolve_opponent_event = { game.return = DEM } next_player() - log(`C${game.played_card}`) + log(`C${game.played_card}:`) goto_vm(game.vm_event) } }, @@ -6618,6 +6618,7 @@ states.vm_kiss_of_death = { // Special check for the Reformer Rehabilitated if (game.vm_event === C_REFORMER_REHABILITATED && game.dem_tst_position > game.com_tst_position) { log_side() + log(`C${game.vm_event}:`) game.state = 'vm_kiss_of_death_finish' } else if (cards[game.vm_event].side !== "C" && event_is_playable(game.vm_event) && game.vm_event !== C_COMMON_EUROPEAN_HOME) { if (is_auto_resolve(game.vm_event)) { @@ -6625,6 +6626,7 @@ states.vm_kiss_of_death = { game.state = 'vm_kiss_of_death_finish' } else { log_side() + log(`C${game.vm_event}:`) game.state = 'vm_kiss_of_death_finish' } } else { -- cgit v1.2.3 From bad1f25da090259aae3d17a6efac9b7035702d9b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:46:09 +0000 Subject: Improve logging --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index e9eeda3..487f7c1 100644 --- a/rules.js +++ b/rules.js @@ -727,9 +727,9 @@ states.resolve_opponent_event = { game.vm_event_to_do = false game.return_state = 'resolve_opponent_event' game.vm_event = game.played_card + log(`Played C${game.played_card} for the event`) if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) { game.return = game.active - log(`Played C${game.played_card} for the event`) goto_vm(game.vm_event)} else { if (game.active === DEM) { -- cgit v1.2.3 From 811996a28cd232f6041285e336a4cefbd2888a6f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:51:29 +0000 Subject: Improve log for Kohl proposes reunification --- events.txt | 2 ++ rules.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/events.txt b/events.txt index 94738a7..a461071 100644 --- a/events.txt +++ b/events.txt @@ -666,6 +666,8 @@ permanently_remove kohl_proposes_reunification_prep if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification +else +log `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif diff --git a/rules.js b/rules.js index 487f7c1..41c7c9f 100644 --- a/rules.js +++ b/rules.js @@ -8573,6 +8573,8 @@ CODE[87] = [ // Kohl Proposes Reunification* [ vm_kohl_proposes_reunification_prep ], [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], + [ vm_else ], + [ vm_log, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From f3afe374793ad953e2bba05dd0999b7070ed7950 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:54:33 +0000 Subject: Indent logging --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 41c7c9f..d6c11ec 100644 --- a/rules.js +++ b/rules.js @@ -8574,7 +8574,7 @@ CODE[87] = [ // Kohl Proposes Reunification* [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], [ vm_else ], - [ vm_log, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], + [ vm_logi, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 2cfaa6f7f223719b3a6e0be7352ccc7b1d712921 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:13:41 +0000 Subject: Indent log --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.txt b/events.txt index a461071..a216941 100644 --- a/events.txt +++ b/events.txt @@ -667,7 +667,7 @@ kohl_proposes_reunification_prep if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification else -log `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` +logi `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif -- cgit v1.2.3 From 82acca24c0159cd7df6515bf1059a6ddafe6b57e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:14:48 +0000 Subject: Updates to view.opp_power_hand --- play.js | 1 - rules.js | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/play.js b/play.js index 079f366..8ea17a2 100644 --- a/play.js +++ b/play.js @@ -765,7 +765,6 @@ function on_update() { action_button("done", "Done") action_button("end_round", "End Round") action_button("undo", "Undo") - console.log('view.power_struggle_discard', view.power_struggle_discard) } // =========================== LOG FUNCTIONS ============================================== diff --git a/rules.js b/rules.js index d6c11ec..8b30342 100644 --- a/rules.js +++ b/rules.js @@ -404,14 +404,9 @@ 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) + if (game.opp_power_hand) {view.opp_power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) } view.power_hand = [...game.com_pwr_hand].sort((a, b) => a - b) } - if (game.view_opp_power_hand) { - if (player === COM) { - view.view_opp_power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) - } - } if (player === DEM) { view.samizdat = game.samizdat_card @@ -5069,7 +5064,7 @@ function vm_power_struggle() { //Check for Securitate if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)) { log(`C${C_SECURITATE}: Democrat reveals Power Struggle cards`) - game.view_opp_power_hand = true + game.opp_power_hand = game.dem_pwr_hand } log_h2('Deal Cards') game.state = 'draw_power_cards' -- cgit v1.2.3 From 89fa00c090c2370cad110591ae5d4a422ceea4b7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:15:28 +0000 Subject: Updates to view.opp_power_hand --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 8b30342..82ce1fc 100644 --- a/rules.js +++ b/rules.js @@ -5064,7 +5064,7 @@ function vm_power_struggle() { //Check for Securitate if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)) { log(`C${C_SECURITATE}: Democrat reveals Power Struggle cards`) - game.opp_power_hand = game.dem_pwr_hand + game.opp_power_hand = true } log_h2('Deal Cards') game.state = 'draw_power_cards' -- cgit v1.2.3 From b9b474b9b29b3704ab6306c94ac93fd089b21941 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:20:26 +0000 Subject: Add Securitate panel --- play.html | 5 +++++ play.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/play.html b/play.html index e21d2a3..ff4c32d 100644 --- a/play.html +++ b/play.html @@ -81,6 +81,11 @@
    +
    +
    Securitate - Democrat Power Struggle Cards
    +
    +
    +
    Power Struggle Discard
    diff --git a/play.js b/play.js index 8ea17a2..53540d5 100644 --- a/play.js +++ b/play.js @@ -374,6 +374,7 @@ const ui = { power_hand: document.getElementById("power_hand"), power_discard: document.getElementById("power_discard"), opp_hand: document.getElementById("opp_hand"), + securitate: document.getElementById("securitate") discard: document.getElementById("discard"), removed: document.getElementById("removed"), persistent: document.getElementById("persistent"), @@ -682,9 +683,11 @@ function on_update() { if (view.opp_hand) for (let c of view.opp_hand) ui.opp_hand.appendChild(ui.cards[c]) + + ui.securitate.replaceChildren() if (view.opp_power_hand) for (let c of view.opp_power_hand) - ui.opp_hand.appendChild(ui.power_cards[c]) + ui.securitate.appendChild(ui.power_cards[c]) ui.ceausescu_hand.replaceChildren() if (view.ceausescu_cards) -- cgit v1.2.3 From e7b3e0d037edd27cf6f9fc72978553f202b6785c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:21:49 +0000 Subject: Add Securitate panel --- play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.js b/play.js index 53540d5..6838700 100644 --- a/play.js +++ b/play.js @@ -374,7 +374,7 @@ const ui = { power_hand: document.getElementById("power_hand"), power_discard: document.getElementById("power_discard"), opp_hand: document.getElementById("opp_hand"), - securitate: document.getElementById("securitate") + securitate: document.getElementById("securitate"), discard: document.getElementById("discard"), removed: document.getElementById("removed"), persistent: document.getElementById("persistent"), -- cgit v1.2.3 From 6911443514135896a8bda0a28ff3a03ddaca9f3b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:50:54 +0000 Subject: Fix VP marker going off screen --- play.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/play.js b/play.js index 6838700..c113f9b 100644 --- a/play.js +++ b/play.js @@ -534,6 +534,9 @@ function layout_tst_marker(e, v, top) { function layout_vp_marker() { let x, y + + if (view.vp > 21) { view.vp = 21 } + if (view.vp < -21) { view.vp = -21 } if (view.vp === 0) { y = 2425 + 25 x = 843 + 28 -- cgit v1.2.3 From 353d1e6265f6296905897024a7ae8a7f99ed4925 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 18:02:15 +0000 Subject: Fix autoresolve Government Resigns --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 82ce1fc..0f83bac 100644 --- a/rules.js +++ b/rules.js @@ -3042,7 +3042,7 @@ function is_auto_resolve(card) { } } else if (card === C_GOVERNMENT_RESIGNS) { - let uncontrolled_elites = spaces.filter( space => game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length + let uncontrolled_elites = spaces.filter( space => spaces[space.space_id].socio === 1 && game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length if (uncontrolled_elites === 0) { if (!game.state.startsWith('vm')) { logi('No uncontrolled Elite spaces') } return true @@ -7713,7 +7713,7 @@ states.vm_tst_8 = { }, event() { push_undo() - log('Event') + log(`C${game.played_card}:`) game.vm_event_to_do = false game.return_state = 'vm_tst_8' game.return = game.active -- cgit v1.2.3 From 4ea61251d418391a0974c8c7e7c80defe741714e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 18:02:51 +0000 Subject: Reposition marker off VP track --- play.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/play.js b/play.js index c113f9b..d4c1bbd 100644 --- a/play.js +++ b/play.js @@ -540,6 +540,12 @@ function layout_vp_marker() { if (view.vp === 0) { y = 2425 + 25 x = 843 + 28 + } else if (view.vp === -21) { + y = 2424 + 25 + x = 803 + 28 - 651 + } else if (view.vp === 21) { + y = 2424 + 25 + x = 883 + 28 + 651 } else if (view.vp < 0) { if (view.vp & 1) { y = 2456 + 25 -- cgit v1.2.3 From 04971bb43cc866cecbcca0ce07d63ea3a3ce3803 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 15 Nov 2024 13:05:18 +0000 Subject: Permanently remove securitate after army backs revolution --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 0f83bac..0c677d8 100644 --- a/rules.js +++ b/rules.js @@ -4586,7 +4586,9 @@ function vm_adamec() { } function vm_army_backs_revolution() { - game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + if (game.persistent_events.includes(C_SECURITATE)) { + permanently_remove(C_SECURITATE) + } game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) logi(`C${C_SECURITATE} no longer has any effect`) -- cgit v1.2.3 From 7f729722dec329486d8d205c593f3517487e3da9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 16 Nov 2024 09:06:59 +0000 Subject: Improve the wall must go logging --- rules.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rules.js b/rules.js index 0c677d8..c62604a 100644 --- a/rules.js +++ b/rules.js @@ -3255,10 +3255,16 @@ function finish_the_wall() { } } if (game.active === DEM) {next_player()} + game.return = COM vm_next () } else { permanently_remove(C_THE_WALL_MUST_GO) delete game.the_wall_must_go + if (game.vm_infl_to_do) { + game.return = COM + } else { + game.return = game.active + } vm_return() } } -- cgit v1.2.3 From 182b94d33fdf3d1af2e4d61b33f08104cdfe2e02 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 16 Nov 2024 09:12:26 +0000 Subject: Improve logging for Chinese Solution --- rules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.js b/rules.js index c62604a..305da27 100644 --- a/rules.js +++ b/rules.js @@ -7343,6 +7343,7 @@ states.vm_the_chinese_solution = { }, pass() { push_undo() + logi(`Chooses not to conduct support checks`) permanently_remove(C_THE_CHINESE_SOLUTION) vm_return() } -- cgit v1.2.3 From 2ca2cf9124bf734c28f438c84afadfa413f0891e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 16 Nov 2024 09:13:32 +0000 Subject: Improve logging for Chinese Solution --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 305da27..d6e3b7a 100644 --- a/rules.js +++ b/rules.js @@ -7343,7 +7343,7 @@ states.vm_the_chinese_solution = { }, pass() { push_undo() - logi(`Chooses not to conduct support checks`) + logi(`Chose not to conduct support checks`) permanently_remove(C_THE_CHINESE_SOLUTION) vm_return() } -- cgit v1.2.3 From 22b3f9cdf2a8f96e4de70775001093de3cd8debc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 16 Nov 2024 18:13:27 +0000 Subject: Limit Securitate to Romania --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index d6e3b7a..8dc33a0 100644 --- a/rules.js +++ b/rules.js @@ -404,7 +404,7 @@ exports.view = function(state, player) { } else if (player === COM) { view.hand = game.communist_hand - if (game.opp_power_hand) {view.opp_power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) } + if (game.opp_power_hand && game.pwr_struggle_in === 'Romania') {view.opp_power_hand = [...game.dem_pwr_hand].sort((a, b) => a - b) } view.power_hand = [...game.com_pwr_hand].sort((a, b) => a - b) } -- cgit v1.2.3 From c86eb75d757a0c30e54544e19aea3fc8260cb49d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 11:38:52 +0000 Subject: Add Dash for the West to conditional auto_resolve --- events.txt | 2 ++ rules.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/events.txt b/events.txt index a216941..879fcac 100644 --- a/events.txt +++ b/events.txt @@ -259,8 +259,10 @@ heal_our_bleeding_wounds CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove +if !is_auto_resolve(C_DASH_FOR_THE_WEST) prompt 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west +endif CARD 37 - Nagy Reburied* diff --git a/rules.js b/rules.js index 8dc33a0..d46a814 100644 --- a/rules.js +++ b/rules.js @@ -223,6 +223,7 @@ 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] const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] +const dem_asterisks = [2, 3, 4, 5, 19, 24, 26, 29, 33, 34, 36, 39, 40, 45, 46, 48, 49, 50, 54, 56, 58, 60, 61, 62, 63, 64, 65, 66, 68, 71, 72, 73, 74, 75, 77, 81, 84, 86, 87, 89, 90, 91, 93, 94, 97, 103, 105, 108, 110] const PC_TACTIC_FAILS = 52 const PC_SUPPORT_FALTERS = 49 @@ -3076,6 +3077,11 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } + } else if (card === C_DASH_FOR_THE_WEST) { + if (!game.strategy_discard.includes(dem_asterisks)) { + if (!game.state.startsWith('vm')) { logi('No Democratic Events with an asterisk in the discard') } + return true + } } else { return false @@ -8170,8 +8176,10 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_DASH_FOR_THE_WEST) ], [ vm_prompt, 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' ], [ vm_dash_for_the_west ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From cb1d0d639e9e62054b8b3f3b4b2f464fb71bbf19 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 11:49:07 +0000 Subject: Third set of influence markers for influence over 16 --- play.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/play.js b/play.js index d4c1bbd..4b1edc6 100644 --- a/play.js +++ b/play.js @@ -396,7 +396,7 @@ function create_country(id, name) { document.getElementById("markers").appendChild(e) } -const INF_DX = 35 +const INF_DX = 33 const INF_DY = 10 function create_ui() { @@ -406,6 +406,8 @@ function create_ui() { ui.com_inf = [] ui.dem_inf2 = [] ui.com_inf2 = [] + ui.dem_inf3 = [] + ui.com_inf3 = [] for (let s = 0; s <= last_space; ++s) { let info = spaces[s] @@ -440,6 +442,12 @@ function create_ui() { com_e2.style.top = yc + 12 - 25 + INF_DY + "px" ui.com_inf2[s] = com_e2 + let com_e3 = document.createElement("div") + com_e3.className = "marker comInfl hide" + com_e3.style.left = xc + 32 - 25 + 5 + INF_DX + "px" + com_e3.style.top = yc + 12 - 25 + 5 + INF_DY + "px" + ui.com_inf3[s] = com_e3 + let dem_e = document.createElement("div") dem_e.className = "marker demInfl hide" dem_e.style.left = xc - 32 - 25 + "px" @@ -452,11 +460,19 @@ function create_ui() { dem_e2.style.top = yc + 12 - 25 + INF_DY + "px" ui.dem_inf2[s] = dem_e2 + let dem_e3 = document.createElement("div") + dem_e3.className = "marker demInfl hide" + dem_e3.style.left = xc - 32 - 25 - 5 - INF_DX + "px" + dem_e3.style.top = yc + 12 - 25 + 5 + INF_DY + "px" + ui.dem_inf3[s] = dem_e3 + document.getElementById("spaces").append(space_e) document.getElementById("markers").appendChild(com_e) document.getElementById("markers").appendChild(com_e2) + document.getElementById("markers").appendChild(com_e3) document.getElementById("markers").appendChild(dem_e) document.getElementById("markers").appendChild(dem_e2) + document.getElementById("markers").appendChild(dem_e3) } ui.cards = [] @@ -579,18 +595,26 @@ function layout_country(id) { } } -function layout_inf_markers(cn, one, two, v, ctl) { +function layout_inf_markers(cn, one, two, three, v, ctl) { if (ctl) cn += " ctl" - if (v > 8) { + if (v > 16) { + one.className = cn + " v" + 8 + two.className = cn + " v" + 8 + three.className = cn + " v" + (v - 16) + } + else if (v > 8) { one.className = cn + " v" + 8 two.className = cn + " v" + (v - 8) + three.className = "hide" } else if (v > 0) { one.className = cn + " v" + v two.className = "hide" + three.className = "hide" } else { one.className = "hide" two.className = "hide" + three.className = "hide" } } @@ -659,8 +683,8 @@ function on_update() { for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] - layout_inf_markers("marker demInfl", ui.dem_inf[s], ui.dem_inf2[s], demInfl, demInfl - comInfl >= spaces[s].stability) - layout_inf_markers("marker comInfl", ui.com_inf[s], ui.com_inf2[s], comInfl, comInfl - demInfl >= spaces[s].stability) + layout_inf_markers("marker demInfl", ui.dem_inf[s], ui.dem_inf2[s], ui.dem_inf3[s], demInfl, demInfl - comInfl >= spaces[s].stability) + layout_inf_markers("marker comInfl", ui.com_inf[s], ui.com_inf2[s], ui.com_inf3[s], comInfl, comInfl - demInfl >= spaces[s].stability) } // UPDATE COUNTRY MARKERS -- cgit v1.2.3 From 925f5383084a6bd578d13b8115af4d700cc9dedd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 17:36:27 +0000 Subject: Fix autoresolve --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index d46a814..ba66355 100644 --- a/rules.js +++ b/rules.js @@ -3078,7 +3078,7 @@ function is_auto_resolve(card) { return true } } else if (card === C_DASH_FOR_THE_WEST) { - if (!game.strategy_discard.includes(dem_asterisks)) { + if (!dem_asterisks.some( c => game.strategy_discard.includes(c))) { if (!game.state.startsWith('vm')) { logi('No Democratic Events with an asterisk in the discard') } return true } @@ -8177,7 +8177,7 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], [ vm_if, ()=>!is_auto_resolve(C_DASH_FOR_THE_WEST) ], - [ vm_prompt, 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' ], + [ vm_prompt, 'Dash for the West: select any Democratic Event with an asterisk(*) from the discard pile. Event occurs immediately' ], [ vm_dash_for_the_west ], [ vm_endif ], [ vm_return ], -- cgit v1.2.3 From 11a1cc9522ac038e909b6e53cf913e63f7bd3472 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 17:37:09 +0000 Subject: Update Dash for The West text to have consistent capitalisation with the card --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.txt b/events.txt index 879fcac..b4016de 100644 --- a/events.txt +++ b/events.txt @@ -260,7 +260,7 @@ CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove if !is_auto_resolve(C_DASH_FOR_THE_WEST) -prompt 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' +prompt 'Dash for the West: select any Democratic Event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west endif -- cgit v1.2.3 From 86340132b07a9526f45e5a5a20d4725254b06df2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 11:30:09 +0000 Subject: Add VP check for The Third Way --- rules.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rules.js b/rules.js index ba66355..c11bd23 100644 --- a/rules.js +++ b/rules.js @@ -5290,6 +5290,9 @@ function vm_the_sinatra_doctrine() { function vm_the_third_way() { log('-2VP') game.vp -= 2 + if (check_vp()) { + return + } vm_next() } -- cgit v1.2.3 From bb2c17c3402fadc17646f04943ad6e8972cb4498 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 11:32:18 +0000 Subject: Remove Dash for the West from auto_resolve --- rules.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rules.js b/rules.js index c11bd23..0f6a747 100644 --- a/rules.js +++ b/rules.js @@ -3077,12 +3077,7 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } - } else if (card === C_DASH_FOR_THE_WEST) { - if (!dem_asterisks.some( c => game.strategy_discard.includes(c))) { - if (!game.state.startsWith('vm')) { logi('No Democratic Events with an asterisk in the discard') } - return true - } - } + } else { return false } @@ -8179,10 +8174,8 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], - [ vm_if, ()=>!is_auto_resolve(C_DASH_FOR_THE_WEST) ], [ vm_prompt, 'Dash for the West: select any Democratic Event with an asterisk(*) from the discard pile. Event occurs immediately' ], [ vm_dash_for_the_west ], - [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 4520aee01a5e79120d2e9bf07a4ca8ee794bfbfe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 11:33:10 +0000 Subject: Remove Dash for the West from auto_resolve --- events.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/events.txt b/events.txt index b4016de..7db1b63 100644 --- a/events.txt +++ b/events.txt @@ -259,10 +259,8 @@ heal_our_bleeding_wounds CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove -if !is_auto_resolve(C_DASH_FOR_THE_WEST) prompt 'Dash for the West: select any Democratic Event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west -endif CARD 37 - Nagy Reburied* -- cgit v1.2.3 From 6365dc092b06d4573c1c2687d6a652e203ffc32c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 13:34:30 +0000 Subject: Fix typo in log --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 0f6a747..4bf7a33 100644 --- a/rules.js +++ b/rules.js @@ -2081,7 +2081,7 @@ function add_infl(space, ops) { function remove_infl(space, ops) { push_undo() - log_summary(`Removed £ SP from %${space}.`) + log_summary(`Removed £ SP from %${space}`) if (game.remove_opponent_infl === true) { if (game.active === COM) { -- cgit v1.2.3 From 2c25d82a4e308d5e1d93606c28698934c22751c5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 15:32:55 +0000 Subject: Add autoresolve for Exit Visas --- events.txt | 2 ++ rules.js | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/events.txt b/events.txt index 7db1b63..09eb662 100644 --- a/events.txt +++ b/events.txt @@ -563,8 +563,10 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. +if !is_auto_resolve(C_EXIT_VISAS) permanently_remove exit_visas +endif CARD 76 - Warsaw Pact Summit diff --git a/rules.js b/rules.js index 4bf7a33..b991456 100644 --- a/rules.js +++ b/rules.js @@ -3077,7 +3077,12 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } - } + } else if (card === C_EXIT_VISAS) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } + return true + } + } else { return false } @@ -8478,8 +8483,10 @@ CODE[74] = [ // FRG Embassies ] CODE[75] = [ // Exit Visas* + [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_permanently_remove ], [ vm_exit_visas ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From a5cad5916776ff66e7c7d224f6b2d966db8d888f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 15:36:32 +0000 Subject: Add autoresolve for Samizdat --- events.txt | 4 +++- rules.js | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/events.txt b/events.txt index 09eb662..a62e810 100644 --- a/events.txt +++ b/events.txt @@ -563,8 +563,8 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. -if !is_auto_resolve(C_EXIT_VISAS) permanently_remove +if !is_auto_resolve(C_EXIT_VISAS) exit_visas endif @@ -586,7 +586,9 @@ endif CARD 77 - Samizdat # The Democratic Player can put a card in his hand aside for next turn and draw a replacement card from the deck. permanently_remove +if !is_auto_resolve(C_SAMIZDAT) samizdat +endif CARD 78 - Workers Revolt diff --git a/rules.js b/rules.js index b991456..ac40f5b 100644 --- a/rules.js +++ b/rules.js @@ -3082,6 +3082,11 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } return true } + } else if (card === C_SAMIZDAT) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') } + return true + } } else { return false @@ -8483,8 +8488,8 @@ CODE[74] = [ // FRG Embassies ] CODE[75] = [ // Exit Visas* - [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_exit_visas ], [ vm_endif ], [ vm_return ], @@ -8506,7 +8511,9 @@ CODE[76] = [ // Warsaw Pact Summit CODE[77] = [ // Samizdat [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_SAMIZDAT) ], [ vm_samizdat ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 828b47de96c9ce53fe94d47bf4d9ad59998c3e89 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 19:10:28 +0000 Subject: Add conditional autoresolves --- events.txt | 9 ++++++--- rules.js | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/events.txt b/events.txt index a62e810..a3ff2d2 100644 --- a/events.txt +++ b/events.txt @@ -628,9 +628,11 @@ endif CARD 82 - Spitzel* # Remove 2 Democratic SPs in Germany. permanently_remove +if !is_auto_resolve(C_SPITZEL) valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 +endif CARD 83 - Modrow* @@ -675,7 +677,6 @@ logi `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif - CARD 88 - Adamec* # Roll a die. On a 4-6 add 4 Communist SPs in Czechoslovakia, no more than 2 per space. -1 drm for every Worker or Farmer space in Czechoslovakia that is controlled by the Democratic Player. permanently_remove @@ -685,7 +686,6 @@ prompt 'Czechoslovakia' add_limited_infl 4 2 - CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. permanently_remove @@ -695,7 +695,6 @@ domino_theory endif - CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. valid_spaces_country 'Czechoslovakia' @@ -710,12 +709,14 @@ support_check 2 CARD 91 - My First Banana* # Remove 2 Communist SPs and make two Support Checks in Germany using the Ops value of this card. permanently_remove +if !is_auto_resolve(C_MY_FIRST_BANANA) valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 valid_spaces_country_sc 'East_Germany' prompt 'select a space in East Germany' support_check 2 +endif CARD 92 - Betrayal @@ -779,12 +780,14 @@ endif CARD 98 - Politburo Intrigue* # Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card. permanently_remove +if !is_auto_resolve(C_POLITBURO_INTRIGUE) valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_limited_opp_infl 3 2 valid_spaces_country_sc 'Bulgaria' prompt 'make a support check in Bulgaria' 1_support_check +endif CARD 99 - Ligachev* diff --git a/rules.js b/rules.js index ac40f5b..d3c4dd6 100644 --- a/rules.js +++ b/rules.js @@ -3087,6 +3087,18 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') } return true } + } else if (card === C_SPITZEL) { + let dem_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.demInfl[space.space_id] > 0).length + if (dem_germany_infl === 0) { + if (!game.state.startsWith('vm')) { logi('No influence to remove') } + return true + } + } else if (card === C_MY_FIRST_BANANA) { + let com_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.comInfl[space.space_id] > 0).length + if (com_germany_infl === 0) { + if (!game.state.startsWith('vm')) { logi('No influence to remove') } + return true + } } else { return false -- cgit v1.2.3 From 828df8b4745d0b4c56bc223f69dff79050781b00 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 19:12:09 +0000 Subject: Indent logging --- rules.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index d3c4dd6..85f22b2 100644 --- a/rules.js +++ b/rules.js @@ -3099,6 +3099,12 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } + } else if (card === C_POLITBURO_INTRIGUE) { + let dem_bulgaria_infl = spaces.filter(space => space.country === 'Bulgaria' && game.demInfl[space.space_id] > 0).length + if (dem_bulgaria_infl === 0) { + if (!game.state.startsWith('vm')) { logi('No influence to remove') } + return true + } } else { return false @@ -6660,7 +6666,7 @@ states.vm_kiss_of_death = { } } else { change_player() - log('Event does not occur') + logi('Event does not occur') vm_next() } }, @@ -8196,7 +8202,7 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], - [ vm_prompt, 'Dash for the West: select any Democratic Event with an asterisk(*) from the discard pile. Event occurs immediately' ], + [ vm_prompt, 'Dash for the West: select any Democratic Event with an asterix(*) from the discard pile. Event occurs immediately' ], [ vm_dash_for_the_west ], [ vm_return ], ] @@ -8565,9 +8571,11 @@ CODE[81] = [ // The Baltic Way* CODE[82] = [ // Spitzel* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_SPITZEL) ], [ vm_valid_spaces_country_opp, 'East_Germany' ], [ vm_prompt, ' from East Germany' ], [ vm_remove_opp_infl, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -8644,12 +8652,14 @@ CODE[90] = [ // Civic Forum* CODE[91] = [ // My First Banana* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_MY_FIRST_BANANA) ], [ 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_endif ], [ vm_return ], ] @@ -8713,12 +8723,14 @@ CODE[97] = [ // The Tyrant is Gone* CODE[98] = [ // Politburo Intrigue* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_POLITBURO_INTRIGUE) ], [ 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_endif ], [ vm_return ], ] -- cgit v1.2.3 From d1b45736edcffd586b7888aff4e5fe5ccf83e533 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:18:04 +0000 Subject: Update to logging --- rules.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/rules.js b/rules.js index 85f22b2..99b14a7 100644 --- a/rules.js +++ b/rules.js @@ -1768,7 +1768,7 @@ states.general_strike = { log(`Roll: D${roll}`) logi(`+${game.available_ops} ops`) let total = roll + game.available_ops - log(`Total: ${total}`) + log(`Modified roll: ${total}`) if (total > 5) { log('The strike is over.') @@ -1996,12 +1996,12 @@ states.stasi_play_card = { states.stasi_resolve_common_european_home = { inactive: 'play a card.', prompt () { - view.prompt = `Do you wish to play ${clean_name(cards[game.played_card].name)} with Common European Home?` + view.prompt = `Stasi: play ${clean_name(cards[game.played_card].name)} with Common European Home?` gen_action('yes') gen_action('no') }, yes() { - log(`Played with Common European Home`) + log(`Played C${game.played_card} with Common European Home`) silent_discard(C_COMMON_EUROPEAN_HOME) game.vm_infl_to_do = true game.vm_event_to_do = false @@ -2218,7 +2218,7 @@ function do_sc(space) { } // Support check calcs - log(`Modified total: ${roll}`) + log(`Modified roll: ${roll}`) const stability = spaces[space].stability logi(`-${stability*2} (stability * 2)`) const change_infl = Math.max(0, roll - stability*2) @@ -2517,7 +2517,7 @@ function do_tst_attempt() { roll ++ logi('+1 from C53') } - log(`Modified total: ${roll}`) + log(`Modified roll: ${roll}`) // TIANANMEN SQUARE ATTEMPT game.return = game.active @@ -4239,6 +4239,7 @@ function vm_valid_spaces_sc () { } function vm_valid_spaces_country_opp () { + console.log('in vm_valid_spaces_country_opp') let country = '' if (vm_operand(1)) { country = vm_operand(1) } @@ -4539,7 +4540,7 @@ function vm_remove_all_infl() { function vm_do_remove_all_infl(space) { push_undo() - log(`Removed all SP from %${space}.`) + log(`Removed all SP from %${space}`) if (game.remove_opponent_infl === true) { if (game.active === COM) { @@ -5678,6 +5679,7 @@ states.vm_remove_infl = { inactive: 'remove Support Points.', prompt () { // Keep this so that there is an undo option in, e.g., Scare Tactics + console.log('in vm_remove_infl') if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` gen_action('done') @@ -6031,7 +6033,7 @@ states.vm_brought_in_for_questioning = { } goto_vm(game.vm_event) } else { - log('Event does not occur') + logi('Event does not occur') game.return = DEM vm_return() } @@ -7608,10 +7610,10 @@ states.vm_workers_revolt_finish = { log(`Roll: D${roll}`) let adj = count_adj(game.selected_space) if (game.active === DEM) { - log(`-${adj.com_adj} from opponent controlled spaces`) + logi(`-${adj.com_adj} from opponent controlled spaces`) roll -= adj.com_adj } else { - log(`-${adj.dem_adj} from opponent controlled spaces`) + logi(`-${adj.dem_adj} from opponent controlled spaces`) roll -= adj.dem_adj } log(`Modified roll: ${roll}`) -- cgit v1.2.3 From e42824e31df8da35b77d8f3ec968acdbc68965f8 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:19:13 +0000 Subject: Update to auto_resolve Ceausescu --- rules.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 99b14a7..349e9d7 100644 --- a/rules.js +++ b/rules.js @@ -3018,7 +3018,7 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('Minorities spaces already controlled') } return true } - } else if (card === C_CEAUSESCU) { + } else if (card === C_CEAUSESCU && game.active === DEM) { let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space.space_id] > 0).length if (dem_romania_infl === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } @@ -4239,7 +4239,6 @@ function vm_valid_spaces_sc () { } function vm_valid_spaces_country_opp () { - console.log('in vm_valid_spaces_country_opp') let country = '' if (vm_operand(1)) { country = vm_operand(1) } @@ -5679,7 +5678,6 @@ states.vm_remove_infl = { inactive: 'remove Support Points.', prompt () { // Keep this so that there is an undo option in, e.g., Scare Tactics - console.log('in vm_remove_infl') if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no further SPs to remove.` gen_action('done') -- cgit v1.2.3 From d4f2ed435811c768d4a472175624991cc75e0900 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:24:41 +0000 Subject: Update to Samizdat panel title --- play.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.html b/play.html index ff4c32d..124acaf 100644 --- a/play.html +++ b/play.html @@ -104,7 +104,7 @@
    -
    Samizdat
    +
    Samizdat - Set Aside Card
    -- cgit v1.2.3 From 7fcb289c8aa2ac7f7aa43db58c1486496dce9226 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:36:24 +0000 Subject: Fix capitalisation of Grenztruppen --- data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data.js b/data.js index 4912dde..8ccb317 100644 --- a/data.js +++ b/data.js @@ -1336,7 +1336,7 @@ const cards = [ {number: 56, period: 2, side: 'D', name: 'Foreign Television*', ops: 2, remove: true, playable: true, red: false}, {number: 57, period: 2, side: 'C', name: 'Central Committee Reshuffle*', ops: 2, remove: true, playable: true, red: false}, {number: 58, period: 2, side: 'D', name: 'Austria-Hungary Border Reopened*', ops: 2, remove: true, playable: true, red: false}, - {number: 59, period: 2, side: 'C', name: 'GrenzTruppen*', ops: 2, remove: true, playable: true, red: false}, + {number: 59, period: 2, side: 'C', name: 'Grenztruppen*', ops: 2, remove: true, playable: true, red: false}, {number: 60, period: 2, side: 'D', name: 'Toxic Waste*', ops: 2, remove: true, playable: true, red: false}, {number: 61, period: 2, side: 'D', name: 'The Monday Demonstrations*', ops: 4, remove: true, playable: false, red: false}, {number: 62, period: 2, side: 'D', name: 'Yakovlev Counsels Gorbachev*', ops: 2, remove: true, playable: true, red: false}, -- cgit v1.2.3 From 2d407f9d901104590844038bc1bf2e8f3a31d50f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:37:21 +0000 Subject: Fix capitalisation of Grenztruppen --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.txt b/events.txt index a3ff2d2..01102f4 100644 --- a/events.txt +++ b/events.txt @@ -442,7 +442,7 @@ CARD 58 - Austria-Hungary Border Reopened* austria_hungary_border_reopened -CARD 59 - GrenzTruppen* +CARD 59 - Grenztruppen* # -1 modifier for Democratic Support Checks in East Germany the rest of this turn. grenztruppen -- cgit v1.2.3 From bd20b5a15165f5a06cdb829e231c642dbe312b74 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 22:39:48 +0000 Subject: Logging improvements --- rules.js | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/rules.js b/rules.js index 349e9d7..570a6fb 100644 --- a/rules.js +++ b/rules.js @@ -2119,11 +2119,17 @@ function remove_infl(space, ops) { function do_sc(space) { clear_undo() let tear_gas_start = game.persistent_events.includes(C_TEAR_GAS) + let the_wall_start = game.persistent_events.includes(C_THE_WALL) log_gap(`Support check: %${space}`) - // Continue with Support Check Logic - let roll = roll_d6() - log(`Roll: D${roll}`) + + // Check for The Wall + if (game.active === COM && game.persistent_events.includes(C_THE_WALL) && spaces[space].country === 'East_Germany') { + logi(`No adjacency for Democrats due to C${C_THE_WALL}`) + log_gap(`Roll: D${roll}`) + } + // Continue with Support Check Logic + else { log(`Roll: D${roll}`) } // Check for the Crowd Turns Against Ceausescu @@ -2184,8 +2190,6 @@ function do_sc(space) { const adj = count_adj(space) if (game.active === COM && game.persistent_events.includes(C_THE_WALL) && spaces[space].country === 'East_Germany') { - logi(`No adjacency for Democrats due to C${C_THE_WALL}`) - logi(`C${C_THE_WALL} no longer in effect`) roll += adj.com_adj if (adj.com_adj > 0) { logi(`+${adj.com_adj} adjacency`) @@ -2262,11 +2266,16 @@ function do_sc(space) { game.vp++ } - //Check if Tear Gas used + //Check if Tear Gas or The Wall used let tear_gas_end = game.persistent_events.includes(C_TEAR_GAS) + let the_wall_end = game.persistent_events.includes(C_THE_WALL) if (tear_gas_start && !tear_gas_end) { log(`C${C_TEAR_GAS} no longer in effect`) } + if (the_wall_start && !the_wall_end) { + log(`C${C_THE_WALL} no longer in effect`) + } + // If Austria-Hungary Border Reopened used, all future support checks must be in East Germany if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)){ @@ -2440,7 +2449,7 @@ function count_adj(space_id) { let com_adj = 0 let adjacent_spaces = get_adjusted_adjacency(space_id) - + console.log('adjacent spaces', adjacent_spaces) for (let adj_space_id of adjacent_spaces) { if (check_dem_control(adj_space_id)) { dem_adj++ @@ -4795,13 +4804,14 @@ function get_adjusted_adjacency(space_id) { let adjacent_spaces = spaces[space_id].adjacent; if (adjacent_spaces.includes(game.systematization)) { let eliminated_space_id = game.systematization; - return adjacent_spaces.map(adj_space_id => { + adjacent_spaces = adjacent_spaces.map(adj_space_id => { if (adj_space_id === eliminated_space_id) { return spaces[eliminated_space_id].adjacent; } return adj_space_id; }).flat(); // Flatten in case the eliminated space has multiple adjacencies } + adjacent_spaces = adjacent_spaces.filter(s => s !== space_id) return adjacent_spaces; } @@ -5988,12 +5998,12 @@ states.vm_adamec = { 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`) + logi(`-${worker_spaces} from Democrat controlled worker spaces`) roll -= worker_spaces } log(`Modified roll: ${roll}`) if (roll > 2) { - log('Adamec succeeds') + log_msg_gap('Adamec succeeds') vm_next() return } @@ -6029,6 +6039,7 @@ states.vm_brought_in_for_questioning = { if (!is_auto_resolve(game.vm_event) && !switch_events.includes(game.vm_event)) { next_player() } + log(`C${game.vm_event}:`) goto_vm(game.vm_event) } else { logi('Event does not occur') @@ -7196,7 +7207,7 @@ states.vm_shock_therapy = { } } log(`Roll: D${roll}`) - log(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) + logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) log(`Modified roll: ${roll - worker_farmer}`) if ((roll - worker_farmer) > 2) { log('C93 is successful. +3 VP') @@ -7428,7 +7439,7 @@ states.vm_the_wall_must_go = { 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) { - log(`+${controlled_spaces} from controlled spaces in East Germany`) + logi(`+${controlled_spaces} from controlled spaces in East Germany`) log(`Modified roll: ${roll + controlled_spaces}`) roll += controlled_spaces } @@ -7436,7 +7447,7 @@ states.vm_the_wall_must_go = { } else { let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_com_control(space.space_id)).length if (controlled_spaces > 0) { - log(`+${controlled_spaces} from controlled spaces in East Germany`) + logi(`+${controlled_spaces} from controlled spaces in East Germany`) log(`Modified roll: ${roll + controlled_spaces}`) roll += controlled_spaces } @@ -8386,7 +8397,7 @@ CODE[58] = [ // Austria-Hungary Border Reopened* [ vm_return ], ] -CODE[59] = [ // GrenzTruppen* +CODE[59] = [ // Grenztruppen* [ vm_grenztruppen ], [ vm_return ], ] -- cgit v1.2.3 From 9e0b8bc097d14cc46fb4334fb321734061dc7407 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 22:40:56 +0000 Subject: Change menu text to show/hide --- play.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play.html b/play.html index 124acaf..713bb8b 100644 --- a/play.html +++ b/play.html @@ -34,8 +34,8 @@
    -
  • Show removed events -
  • Show discard +
  • Show/hide removed events +
  • Show/hide discard
  • -- cgit v1.2.3 From 177fc1531455a29b5b5bec6062f2b75e7decbc9c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 20 Nov 2024 18:30:59 +0000 Subject: Update handling of conditional autoresolves when playing own card --- rules.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/rules.js b/rules.js index 570a6fb..95c8530 100644 --- a/rules.js +++ b/rules.js @@ -2996,28 +2996,28 @@ function is_auto_resolve(card) { else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true } - else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) { + else if (card === C_BROUGHT_IN_FOR_QUESTIONING && game.active === DEM) { if (game.democrat_hand.length === 0) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } return true } } - else if (card === C_DEUTSCHE_MARKS) { + else if (card === C_DEUTSCHE_MARKS && game.active === DEM) { if (game.democrat_hand.length === 0) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to give') } return true } } - else if (card === C_KISS_OF_DEATH ) { + else if (card === C_KISS_OF_DEATH && game.active === COM) { if (game.communist_hand.length === 0) { if (!game.state.startsWith('vm')) { logi('Communist has no cards to discard') } return true } } - else if (card === C_DISSIDENT_ARRESTED) { + else if (card === C_DISSIDENT_ARRESTED && game.active === DEM) { let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length if (dem_intellectual_infl === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } - } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { + } else if ((card === C_SAJUDIS || card === C_THE_BALTIC_WAY) && game.active === COM) { if (game.systematization && game.systematization === S_HARGHITA_COVASNA ) { if (check_dem_control(S_RAZGRAD)) { if (!game.state.startsWith('vm')) { logi('Minorities spaces already controlled') } @@ -3034,13 +3034,13 @@ function is_auto_resolve(card) { return true } } - else if (card === C_WE_ARE_THE_PEOPLE) { + else if (card === C_WE_ARE_THE_PEOPLE && game.active === COM) { if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } - else if (card === C_BETRAYAL) { + else if (card === C_BETRAYAL && game.active === DEM) { if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) { if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } @@ -3051,64 +3051,64 @@ function is_auto_resolve(card) { return true } } - else if (card === C_GOVERNMENT_RESIGNS) { + else if (card === C_GOVERNMENT_RESIGNS && game.active === COM) { let uncontrolled_elites = spaces.filter( space => spaces[space.space_id].socio === 1 && game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length if (uncontrolled_elites === 0) { if (!game.state.startsWith('vm')) { logi('No uncontrolled Elite spaces') } return true } - } else if (card === C_ST_NICHOLAS_CHURCH) { + } else if (card === C_ST_NICHOLAS_CHURCH && game.active === COM) { if (check_dem_control(S_LUTHERAN_CHURCH)) { if (!game.state.startsWith('vm')) { logi('Lutheran Church already controlled') } return true } - } else if (card === C_BULGARIAN_TURKS_EXPELLED) { + } else if (card === C_BULGARIAN_TURKS_EXPELLED && game.active === DEM) { if (game.demInfl[S_RAZGRAD] === 0 ) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } - } else if (card === C_NORMALIZATION) { + } else if (card === C_NORMALIZATION && game.active === DEM) { if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } } else if (card === C_DOMINO_THEORY) { if (game.revolutions.filter(value => value === true).length < 2) { - if (!game.state.startsWith('vm')) { logi('Democrat holds power in fewer than 2 countries') } + logi('Democrat holds power in fewer than 2 countries') return true } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') } return true } - } else if (card === C_UNION_OF_DEMOCRATIC_FORCES) { + } else if (card === C_UNION_OF_DEMOCRATIC_FORCES && game.active === COM) { let bulgarian_presence = spaces.filter(space => space.country === 'Bulgaria' && game.comInfl[space.space_id] > 0).length if (bulgarian_presence === 0) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } - } else if (card === C_EXIT_VISAS) { + } else if (card === C_EXIT_VISAS && game.active === COM) { if (game.democrat_hand.length === 0) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } return true } - } else if (card === C_SAMIZDAT) { + } else if (card === C_SAMIZDAT && game.active === COM) { if (game.democrat_hand.length === 0) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') } return true } - } else if (card === C_SPITZEL) { + } else if (card === C_SPITZEL && game.active === DEM) { let dem_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.demInfl[space.space_id] > 0).length if (dem_germany_infl === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } - } else if (card === C_MY_FIRST_BANANA) { + } else if (card === C_MY_FIRST_BANANA && game.active === COM) { let com_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.comInfl[space.space_id] > 0).length if (com_germany_infl === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } return true } - } else if (card === C_POLITBURO_INTRIGUE) { + } else if (card === C_POLITBURO_INTRIGUE && game.active === DEM) { let dem_bulgaria_infl = spaces.filter(space => space.country === 'Bulgaria' && game.demInfl[space.space_id] > 0).length if (dem_bulgaria_infl === 0) { if (!game.state.startsWith('vm')) { logi('No influence to remove') } -- cgit v1.2.3 From b6f3751c0916edd0fec4be767b833ac1656b30ae Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 06:08:55 +0000 Subject: Update handling of Securitate --- events.txt | 4 ++++ rules.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/events.txt b/events.txt index 01102f4..bbe4220 100644 --- a/events.txt +++ b/events.txt @@ -525,7 +525,11 @@ endif CARD 70 - Securitate* # The Democrat must reveal his battlecards at the start of the Power Struggles in Romania. This event remains in effect until cancelled by Army Backs the Revolution event. +if !game.persistent_events.includes(C_ARMY_BACKS_REVOLUTION) securitate +else +army_block +endif CARD 71 - Kiss of Death* diff --git a/rules.js b/rules.js index 95c8530..189abb3 100644 --- a/rules.js +++ b/rules.js @@ -323,7 +323,7 @@ function start_game() { // Set variable event cards where event is playable at start of game - game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE, C_MALTA_SUMMIT] + game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_MALTA_SUMMIT] draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) @@ -4633,12 +4633,17 @@ function vm_army_backs_revolution() { if (game.persistent_events.includes(C_SECURITATE)) { permanently_remove(C_SECURITATE) } - game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) logi(`C${C_SECURITATE} no longer has any effect`) vm_next() } +function vm_army_block() { + permanently_remove(C_SECURITATE) + logi(`Has no effect after C${C_ARMY_BACKS_REVOLUTION}`) + vm_next() +} + function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) @@ -8479,7 +8484,11 @@ CODE[69] = [ // Systematization* ] CODE[70] = [ // Securitate* + [ vm_if, ()=>!game.persistent_events.includes(C_ARMY_BACKS_REVOLUTION) ], [ vm_securitate ], + [ vm_else ], + [ vm_army_block ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From d4718cfbd613e6b906653270b1ac0e14e82b87d7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 06:17:21 +0000 Subject: Award Civic Forum VP before adding influence --- events.txt | 2 ++ rules.js | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/events.txt b/events.txt index bbe4220..39de8fc 100644 --- a/events.txt +++ b/events.txt @@ -701,6 +701,8 @@ endif CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. +permanently_remove +civic_forum_prep valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 diff --git a/rules.js b/rules.js index 189abb3..061d615 100644 --- a/rules.js +++ b/rules.js @@ -4710,22 +4710,24 @@ function vm_central_committee_reshuffle() { game.state = 'vm_central_committee_reshuffle' } -function vm_civic_forum() { +function vm_civic_forum_prep() { log('+1 VP') game.vp++ if (check_vp()) { return } + vm_next() +} + +function vm_civic_forum() { if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { - permanently_remove(C_CIVIC_FORUM) vm_return() } } function vm_common_european_home() { - if (game.active === DEM) { for (let c of game.democrat_hand) { if (cards[c].side === 'C') { @@ -8660,6 +8662,8 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* + [ vm_permanently_remove ], + [ vm_civic_forum_prep ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], -- cgit v1.2.3 From a6f72eae1a1a33937f2daf2695f995cf10490612 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 07:24:54 +0000 Subject: Tidy up Tyrant code --- rules.js | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/rules.js b/rules.js index 061d615..9234402 100644 --- a/rules.js +++ b/rules.js @@ -1496,19 +1496,7 @@ states.vp_roll = { push_undo() log_h2('Scoring') score_country(game.pwr_struggle_in) - - //Check if The Tyrant is Gone occurs - if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { - game.persistent_events = game.persistent_events.filter (c => c !== C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - game.persistent_events = game.persistent_events.filter (c => c !== THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) - game.return_state = 'finish_scoring' - if (game.active !== DEM) { - next_player() - } - game.state = 'the_tyrant_is_gone' - } else { - game.state = 'finish_scoring' - } + resolve_tyrant() }, } @@ -1538,17 +1526,7 @@ states.choose_power = { scoring () { push_undo() score_country(game.pwr_struggle_in) - - //Check if The Tyrant is Gone occurs - if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { - game.return_state = 'finish_scoring' - if (game.active !== DEM) { - next_player() - } - game.state = 'the_tyrant_is_gone' - } else { - game.state = 'finish_scoring' - } + resolve_tyrant() } } @@ -1569,6 +1547,7 @@ states.the_tyrant_is_gone ={ } log_h3(`C${C_THE_TYRANT_IS_GONE}`) game.vm_event = C_THE_TYRANT_IS_GONE + console.log('ceausescu occurred', game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) goto_vm(game.vm_event) } } @@ -3775,6 +3754,18 @@ function check_tyrant() { } } +function resolve_tyrant() { + if (game.persistent_events.includes(C_THE_TYRANT_IS_GONE) && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) { + game.return_state = 'finish_scoring' + if (game.active !== DEM) { + next_player() + } + game.state = 'the_tyrant_is_gone' + } else { + game.state = 'finish_scoring' + } +} + function check_systematization() { /* Check for Systematization - may not use this space */ if (game.systematization > 0) { game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization) @@ -5337,6 +5328,7 @@ function vm_the_third_way() { } function vm_the_tyrant_is_gone() { + permanently_remove(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) game.persistent_events.push(THE_TYRANT_IS_GONE_OCCURRED) game.valid_spaces = [] for (let i = 0; i < spaces.length; i++) { -- cgit v1.2.3 From 7888a296eb19b7943743168f76755b029c0e1da5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 07:25:11 +0000 Subject: Tidy up Tyrant code --- rules.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/rules.js b/rules.js index 9234402..f4e6bee 100644 --- a/rules.js +++ b/rules.js @@ -1547,7 +1547,6 @@ states.the_tyrant_is_gone ={ } log_h3(`C${C_THE_TYRANT_IS_GONE}`) game.vm_event = C_THE_TYRANT_IS_GONE - console.log('ceausescu occurred', game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)) goto_vm(game.vm_event) } } @@ -2428,7 +2427,6 @@ function count_adj(space_id) { let com_adj = 0 let adjacent_spaces = get_adjusted_adjacency(space_id) - console.log('adjacent spaces', adjacent_spaces) for (let adj_space_id of adjacent_spaces) { if (check_dem_control(adj_space_id)) { dem_adj++ -- cgit v1.2.3 From 9dad6c1ecefe27c11e8355aa397149c1647d0319 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 07:30:41 +0000 Subject: Tidy up Tyrant code --- rules.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rules.js b/rules.js index f4e6bee..323641b 100644 --- a/rules.js +++ b/rules.js @@ -1540,11 +1540,6 @@ states.the_tyrant_is_gone ={ if (game.active !== DEM) { next_player() } - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } log_h3(`C${C_THE_TYRANT_IS_GONE}`) game.vm_event = C_THE_TYRANT_IS_GONE goto_vm(game.vm_event) -- cgit v1.2.3 From ebc6f59d8b6ca20415a26461651a113887fb2ce9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 07:38:44 +0000 Subject: Improve logging for Kiss of Death and Brought in for Questioning --- rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.js b/rules.js index 323641b..c668599 100644 --- a/rules.js +++ b/rules.js @@ -6018,6 +6018,7 @@ states.vm_brought_in_for_questioning = { }, discard() { clear_undo() + log(`C${C_BROUGHT_IN_FOR_QUESTIONING}:`) game.vm_event = discard_card(game.democrat_hand) game.phase = 1 if (cards[game.vm_event].side === 'C' && (cards[game.vm_event].playable || game.playable_cards.includes(game.vm_event))) { @@ -6650,6 +6651,7 @@ states.vm_kiss_of_death = { }, discard() { clear_undo() + log(`C${C_KISS_OF_DEATH}:`) game.vm_event = discard_card(game.communist_hand) //Change player before checking if event is playable. Common European Home is not playable here change_player() -- cgit v1.2.3 From 18264b5b4d9c02be683d372fb72ddead70df3c6a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 11:35:02 +0000 Subject: Improve logging --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index c668599..bad7207 100644 --- a/rules.js +++ b/rules.js @@ -2822,7 +2822,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN] + let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN, C_SOLIDARITY_LEGALIZED] if (!silent_cards.includes(card)) {log(`C${card}:`)} } -- cgit v1.2.3 From 7f6752369cbe51c53fe165650888db0a5d10605d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 11:59:47 +0000 Subject: Fix Yakovlev applying to Com win --- rules.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/rules.js b/rules.js index bad7207..279d191 100644 --- a/rules.js +++ b/rules.js @@ -2797,9 +2797,18 @@ function get_aftermath_roll() { if (rallies.includes(game.played_power_card) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win - if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - logi(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) - modified_roll ++ + + // Special check for Yakovlev Counsels Gobachev. Applies only if Democrat wins, so only if Com is doing support loss and if Dem is doing VP roll + if (game.state === 'support_loss') { + if (game.active === COM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + logi(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + modified_roll ++ + } + } else { + if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { + logi(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + modified_roll ++ + } } if (modified_roll < 0) {modified_roll = 0} else if (modified_roll > 7) {modified_roll = 7} @@ -2822,8 +2831,8 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN, C_SOLIDARITY_LEGALIZED] - if (!silent_cards.includes(card)) {log(`C${card}:`)} + //let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN] + if (is_auto_resolve(card)) {log_gap(`C${card}:`)} } function permanently_remove(card) { -- cgit v1.2.3 From 7fca67b976e84313e894e0c685f49230891db0d4 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 13:04:03 +0000 Subject: Tweak Raise the Stakes prompts --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 279d191..4d5fb23 100644 --- a/rules.js +++ b/rules.js @@ -1139,7 +1139,7 @@ states.the_crowd_turns_against_ceausescu_infl = { states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + if ((game.active === DEM && game.dem_pwr_hand.length < 3) || (game.active === COM && game.com_pwr_hand.length < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') } @@ -1198,7 +1198,7 @@ states.raise_stakes_1 = { states.raise_stakes_2 = { inactive: 'raise the stakes.', prompt () { - if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { + if ((game.active === DEM && game.dem_pwr_hand.length < 3) || (game.active === COM && game.com_pwr_hand.length < 3)) { view.prompt = 'Raise the stakes: you must pass.' gen_action('pass') return -- cgit v1.2.3 From 94f9cbdf3256ddc92525769d4e418217631b7886 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 14:06:02 +0000 Subject: Updates to logging and prompts --- events.txt | 4 +++- rules.js | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/events.txt b/events.txt index 39de8fc..5823e7d 100644 --- a/events.txt +++ b/events.txt @@ -696,6 +696,8 @@ permanently_remove if !is_auto_resolve(C_DOMINO_THEORY) prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' domino_theory +else +domino_theory_pass endif @@ -773,7 +775,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu if game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) -valid_spaces 'Cluj-Napoca' +cluj_check prompt 'the Romanian Elite Space' remove_x_opp_infl 4 the_tyrant_is_gone diff --git a/rules.js b/rules.js index 4d5fb23..dec489d 100644 --- a/rules.js +++ b/rules.js @@ -564,7 +564,7 @@ states.confirm_card = { inactive: 'choose a card.', prompt() { let scoring_cards_count = count_scoring_cards() - view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -1894,7 +1894,7 @@ states.stasi_end_round = { states.stasi_confirm_scoring_card = { inactive: 'choose a card.', prompt() { - view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -3055,10 +3055,8 @@ function is_auto_resolve(card) { } } else if (card === C_DOMINO_THEORY) { if (game.revolutions.filter(value => value === true).length < 2) { - logi('Democrat holds power in fewer than 2 countries') return true } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { - if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') } return true } } else if (card === C_UNION_OF_DEMOCRATIC_FORCES && game.active === COM) { @@ -4541,20 +4539,23 @@ function vm_remove_all_infl() { function vm_do_remove_all_infl(space) { push_undo() - log(`Removed all SP from %${space}`) if (game.remove_opponent_infl === true) { if (game.active === COM) { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } else { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } check_tyrant() } else { if (game.active === COM) { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } else { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } check_tyrant() @@ -4720,6 +4721,13 @@ function vm_civic_forum() { } } +function vm_cluj_check(){ + if (game.comInfl[S_CLUJ_NAPOCA] > 0 ) { + game.valid_spaces.push(S_CLUJ_NAPOCA) + } + vm_next() +} + function vm_common_european_home() { if (game.active === DEM) { for (let c of game.democrat_hand) { @@ -4773,6 +4781,15 @@ function vm_domino_theory() { game.state = 'vm_play_event_from_discard' } +function vm_domino_theory_pass() { + if (game.revolutions.filter(value => value === true).length < 2) { + logi('Democrat holds power in fewer than 2 countries') + } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { + logi('No scoring cards in discard') + } + vm_next() +} + function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) @@ -5712,7 +5729,8 @@ states.vm_remove_infl = { space(space) { remove_infl(space, 'vm_available_ops') game.vm_active_country = spaces[space].country - if (game.vm_event !== C_INFLATIONARY_CURRENCY) { + let require_done = [C_INFLATIONARY_CURRENCY, C_THE_WALL_MUST_GO] + if (!require_done.includes(game.vm_event)) { if (game.vm_available_ops === 0 ) { do_log_summary() vm_next() @@ -6002,7 +6020,7 @@ states.vm_adamec = { logi(`-${worker_spaces} from Democrat controlled worker spaces`) roll -= worker_spaces } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll > 2) { log_msg_gap('Adamec succeeds') vm_next() @@ -7211,7 +7229,7 @@ states.vm_shock_therapy = { } log(`Roll: D${roll}`) logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) - log(`Modified roll: ${roll - worker_farmer}`) + log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { log('C93 is successful. +3 VP') vm_next() @@ -7628,7 +7646,7 @@ states.vm_workers_revolt_finish = { logi(`-${adj.dem_adj} from opponent controlled spaces`) roll -= adj.dem_adj } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll >= 4) { log('Workers Revolt successful') vm_replace_all_infl(game.selected_space) @@ -8653,6 +8671,8 @@ CODE[89] = [ // Domino Theory* [ vm_if, ()=>!is_auto_resolve(C_DOMINO_THEORY) ], [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_domino_theory ], + [ vm_else ], + [ vm_domino_theory_pass ], [ vm_endif ], [ vm_return ], ] @@ -8730,7 +8750,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_cluj_check ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], -- cgit v1.2.3 From ba66612d0d7e092a3b7b1dc91f1b39d00182029f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 22 Nov 2024 15:16:26 +0000 Subject: Fix Shock Therapy VPs --- rules.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rules.js b/rules.js index dec489d..757df1c 100644 --- a/rules.js +++ b/rules.js @@ -7232,6 +7232,10 @@ states.vm_shock_therapy = { log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { log('C93 is successful. +3 VP') + game.vp += 3 + if (check_vp()) { + return + } vm_next() } else { log('C93 is unsuccessful. Required 3 or more') -- cgit v1.2.3 From 11f2a1d73c2ca7d59ea12415e89ea6454cb4fb57 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 22 Nov 2024 15:40:29 +0000 Subject: Debug shock therapy --- rules.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 757df1c..c688246 100644 --- a/rules.js +++ b/rules.js @@ -4106,26 +4106,31 @@ function vm_return() { delete game.vm_max_infl delete game.vm_influence_added delete game.communist_hand_red - + console.log('in vm_return') game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { + console.log('debug 1') reset_austria_hungary_border_reopened() } //Check if end event state is needed if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { + console.log('debug 2') vm_end_event() } //Check if auto-resolve opponent event else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { + console.log('debug 3') vm_end_event() } else { + console.log('debug 4') game.state = 'vm_end_event' } } function vm_end_event() { + console.log('vm_end_event, game.return', game.return, 'game.return_state', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do) if (game.return !== game.active) { next_player()} if (game.return_state === 'power_struggle') { @@ -5500,6 +5505,7 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { + console.log('in state vm_end_event') view.prompt = `${clean_name(cards[this_card()].name)}: done.` if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { gen_action('done') @@ -5509,6 +5515,7 @@ states.vm_end_event = { }, done() { push_undo() + console.log('done called') vm_end_event() }, end_round() { @@ -7231,7 +7238,7 @@ states.vm_shock_therapy = { logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { - log('C93 is successful. +3 VP') + log(`C${C_SHOCK_THERAPY} is successful. +3 VP`) game.vp += 3 if (check_vp()) { return @@ -7239,7 +7246,7 @@ states.vm_shock_therapy = { vm_next() } else { log('C93 is unsuccessful. Required 3 or more') - permanently_remove(93) + permanently_remove(C_SHOCK_THERAPY) vm_return() } }, -- cgit v1.2.3 From 76ff5f0210b09b56e4754c608b0749c416b38204 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 22 Nov 2024 15:50:37 +0000 Subject: Add tied game if both players have held scoring cards --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index c688246..2bdbd6c 100644 --- a/rules.js +++ b/rules.js @@ -1584,7 +1584,7 @@ states.end_turn_4_5_4 = { if (dem_has_scoring_card && com_has_scoring_card) { log('Both players have held scoring cards') - game.state = 'game_end_tie' + goto_game_over('', `The game is tied due to held scoring cards!`) } else if (dem_has_scoring_card) { log('Democrat player has a held scoring card') -- cgit v1.2.3 From 9c4d86fd2c1d10e87233ecc64b5aee1d6de9d86e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 22 Nov 2024 15:54:09 +0000 Subject: fix events called after goddess --- rules.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.js b/rules.js index 2bdbd6c..260baac 100644 --- a/rules.js +++ b/rules.js @@ -2902,6 +2902,7 @@ function end_stasi_choose_card() { } function end_goddess() { + game.return_state = '' log_h2("Action Round " + game.round) if (game.active === DEM) { next_player() @@ -3482,6 +3483,7 @@ function new_turn() { game.round_player = COM game.dem_tst_attempted_this_turn = 0 game.com_tst_attempted_this_turn = 0 + game.return_state = '' if (game.tst_7) {game.tst_7 = false} if (game.tst_8) {game.tst_8 = false} delete game.selected_space -- cgit v1.2.3 From db464d9b4adb87cd4316f59058b6b70f61fbeaa3 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 23 Nov 2024 08:44:29 +0000 Subject: Remove debugging steps --- rules.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rules.js b/rules.js index 260baac..df304db 100644 --- a/rules.js +++ b/rules.js @@ -3336,7 +3336,6 @@ function end_round() { return [...new Set(duplicates)]; } - //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) card_check = card_check.sort((a, b) => a - b) if (check_duplicates(card_check)) { @@ -3345,9 +3344,7 @@ function end_round() { console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`) } - //console.log('cards in game', card_check.length) - //console.log('cards in game', card_check) if (game.turn <= 3) { if (card_check.length !== 40) { console.log('wrong number of cards in game', card_check) @@ -3483,7 +3480,6 @@ function new_turn() { game.round_player = COM game.dem_tst_attempted_this_turn = 0 game.com_tst_attempted_this_turn = 0 - game.return_state = '' if (game.tst_7) {game.tst_7 = false} if (game.tst_8) {game.tst_8 = false} delete game.selected_space @@ -4108,31 +4104,25 @@ function vm_return() { delete game.vm_max_infl delete game.vm_influence_added delete game.communist_hand_red - console.log('in vm_return') game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { - console.log('debug 1') reset_austria_hungary_border_reopened() } //Check if end event state is needed if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { - console.log('debug 2') vm_end_event() } //Check if auto-resolve opponent event else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { - console.log('debug 3') vm_end_event() } else { - console.log('debug 4') game.state = 'vm_end_event' } } function vm_end_event() { - console.log('vm_end_event, game.return', game.return, 'game.return_state', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do) if (game.return !== game.active) { next_player()} if (game.return_state === 'power_struggle') { @@ -5507,7 +5497,6 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { - console.log('in state vm_end_event') view.prompt = `${clean_name(cards[this_card()].name)}: done.` if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { gen_action('done') @@ -5517,7 +5506,6 @@ states.vm_end_event = { }, done() { push_undo() - console.log('done called') vm_end_event() }, end_round() { -- cgit v1.2.3