summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2025-01-04 21:15:21 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2025-01-04 21:15:21 +0000
commitb82e734d58bf7673d33258e7c0804077e9398fd6 (patch)
tree7d7bc2d68efa59d23e3b72e8afbfe751032a8bd0 /rules.js
parentab3f02b4d0706ebdcde8ba6ba630469fe4d6c99e (diff)
download1989-dawn-of-freedom-b82e734d58bf7673d33258e7c0804077e9398fd6.tar.gz
Fix Domino Theory
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js36
1 files changed, 23 insertions, 13 deletions
diff --git a/rules.js b/rules.js
index c05bcd6..5b3f2de 100644
--- a/rules.js
+++ b/rules.js
@@ -1738,6 +1738,7 @@ states.finish_scoring = {
gen_action('done')
},
done() {
+ push_undo()
if (game.persistent_events.includes(MAGIC_NEW_YEARS_EVE_PARTY)) {
game.state = 'new_years_eve_party'
return
@@ -1746,7 +1747,18 @@ states.finish_scoring = {
return
}
reset_power()
- vm_return()
+ //Special check for Domino Theory
+ if (game.vm_infl_to_do) {
+ if (game.active !== game.round_player)
+ change_player()
+ if (game.played_card !== C_DOMINO_THEORY)
+ game.vm_event = C_DOMINO_THEORY
+ else
+ delete game.vm_event
+ game.available_ops = get_card_ops(C_DOMINO_THEORY)
+ game.state = 'resolve_opponent_event'
+ } else
+ vm_return()
},
}
@@ -3757,6 +3769,7 @@ function finish_we_are_the_people() {
// =========== MOVING THROUGH TURNS ============
function end_round() {
+ console.log('end round , game.persistent_events', game.persistent_events)
// Check if the game is over!
if (game.state === 'game_over') {
return
@@ -4181,6 +4194,7 @@ function reset_power() {
game.power_struggle_discard = []
game.dem_pwr_hand = []
game.com_pwr_hand = []
+ game.is_pwr_struggle = false
delete game.return_state
delete game.phase
delete game.raised_stakes_round
@@ -6092,6 +6106,8 @@ function vm_the_third_way() {
function vm_the_tyrant_is_gone() {
permanently_remove(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)
+ if (!game.persistent_events.includes(C_THE_TYRANT_IS_GONE))
+ add_to_persistent_events(C_THE_TYRANT_IS_GONE)
add_to_persistent_events(THE_TYRANT_IS_GONE_OCCURRED)
game.valid_spaces = []
for (let i = 0; i < spaces.length; i++) {
@@ -8071,16 +8087,11 @@ states.vm_the_chinese_solution = {
states.vm_the_tyrant_is_gone = {
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_space(space_id)
- }
- } else {
- view.prompt = 'The Tyrant is Gone: Done.'
- gen_action('done')
+ 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_space(space_id)
}
},
space(space) {
@@ -8088,8 +8099,6 @@ states.vm_the_tyrant_is_gone = {
log(`The Ceausescus flee to %${space}.`)
game.the_tyrant_is_gone = space
game.valid_spaces = []
- },
- done() {
vm_next()
},
}
@@ -9468,6 +9477,7 @@ CODE[97] = [ // The Tyrant is Gone*
[ 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 ],