diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-07 19:12:12 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-07 19:12:12 +0100 |
commit | 709c5f22e4e3c2e71f7385edbee0ce9922b25863 (patch) | |
tree | fa0ae7136621da44e6766da015bda89f5e1e6fb2 | |
parent | f0d938b50aa2a06e4223df1c2297e7310b0c9221 (diff) | |
download | 1989-dawn-of-freedom-709c5f22e4e3c2e71f7385edbee0ce9922b25863.tar.gz |
Final tweaks to view
-rw-r--r-- | play.html | 8 | ||||
-rw-r--r-- | play.js | 11 | ||||
-rw-r--r-- | rules.js | 35 |
3 files changed, 35 insertions, 19 deletions
@@ -51,10 +51,14 @@ <li data-action="card_tst"><span>🛢</span> Tiananmen Square Track
</menu>
-<menu id="popup_select_card" class="popup">
+<menu id="popup_tst_8" class="popup">
<li class="title">TITLE
<li class="separator">
- <li data-action="card_select"><span>🎴</span> Select Card
+ <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>🛢</span> Tiananmen Square Track
</menu>
<header>
@@ -225,6 +225,7 @@ 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_8").style.display = "none"
}
@@ -268,8 +269,14 @@ function on_click_card(evt) { if (send_action('card', card)) {
evt.stopPropagation();
}
- //Check for Common European Home
- } else if (is_card_action('card_ceh', card)) {
+ }
+ //First check for TST special power
+ 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')
@@ -275,7 +275,7 @@ function gen_action(action, argument) { }
view.actions[action].push(argument)
}
- console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action])
+ //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action])
}
function gen_action_infl(space){
@@ -437,6 +437,7 @@ states.choose_card = { //Check for Tiananmen Square Track awards special abilities
+ 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)
}
@@ -467,18 +468,17 @@ states.choose_card = { if (card !== 67 && game.playable_cards.includes(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)
+ }
+
+ //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)
+ }
}
}
},
@@ -2603,6 +2603,7 @@ function remove_infl(space) { }
function do_sc(space) {
+ clear_undo()
log_gap(`Support check: ${space}`)
let clicked_space = find_space_index(space)
@@ -2612,10 +2613,12 @@ function do_sc(space) { log('+1 VP from C26')
game.vp ++
if (check_vp()) {
+ game.state = 'game.over'
+ console.log('after check_vp, game.state', game.state)
return
}
}
-
+ console.log('continue support check, game.state', game.state)
// Continue with Support Check Logic
let roll = Math.floor(Math.random() * 6) + 1
@@ -2811,7 +2814,7 @@ function do_sc(space) { }
}
game.selected_space = 0
- clear_undo()
+
}
@@ -3475,6 +3478,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)
return true
} else if(game.vp <= -20) {
goto_game_over(COM, `${COM} won an Automatic Victory!`)
@@ -3496,6 +3500,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)
return
}
|