diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-11 08:21:08 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-11 08:21:08 +0100 |
commit | a93ef46743251516b3ad4075fdd518ed45d0776d (patch) | |
tree | 58fdb3f1f6dd4a99c7a15e0803a2042d702b7ee2 | |
parent | 7396312cd495803df67a2e8ca17cf7b01927cfdb (diff) | |
download | 1989-dawn-of-freedom-a93ef46743251516b3ad4075fdd518ed45d0776d.tar.gz |
Revert to old view
-rw-r--r-- | play.html | 59 | ||||
-rw-r--r-- | play.js | 103 | ||||
-rw-r--r-- | rules.js | 402 |
3 files changed, 32 insertions, 532 deletions
@@ -21,65 +21,6 @@ <body>
<div id="tooltip" class="card hide"></div>
-<menu id="popup" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_event"><span>🎴</span> Event
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span><img id = "tank" src="images/tank2.png" style="width:20px; height: 30px; vertical-align: middle;"></span> Tiananmen Square Track
-</menu>
-
-<menu id="popup_opp_event" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
-</menu>
-
-<menu id="popup_ceh_check" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_ceh"><span>🎴</span> Play with Common European Home
- <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span>🛤</span> Tiananmen Square Track
-</menu>
-
-<menu id="popup_tst_7" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_tst_7"><span>🎴</span> Cancel Opponent Event
- <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
-</menu>
-
-<menu id="popup_tst_8" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_tst_8"><span>🎴</span> Event and Operations
- <li data-action="card_event"><span>🎴</span> Event
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
-</menu>
-
-<menu id="popup_tst_7_8" class="popup">
- <li class="title">TITLE
- <li class="separator">
- <li data-action="card_tst_7"><span>🎴</span> Cancel Opponent Event
- <li data-action="card_opp_event"><span>🎴</span> Resolve Opponent Event
- <li data-action="card_tst_8"><span>🎴</span> Event and Operations
- <li data-action="card_influence"><span>⭐</span> Place SPs
- <li data-action="card_support_check"><span>💪</span> Support Check
- <li data-action="card_tst"><span><img src="images/tank1.png" style="width:16px; height: 16px; vertical-align: middle;"></span> Tiananmen Square Track
-</menu>
-
<header>
<div id="toolbar">
<details>
@@ -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) {
@@ -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')
}
}
|