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 /rules.js | |
parent | f0d938b50aa2a06e4223df1c2297e7310b0c9221 (diff) | |
download | 1989-dawn-of-freedom-709c5f22e4e3c2e71f7385edbee0ce9922b25863.tar.gz |
Final tweaks to view
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 35 |
1 files changed, 20 insertions, 15 deletions
@@ -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
}
|