summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-18 13:10:01 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-18 13:10:01 +0100
commit8375df4b77eb7b64663be9a572d8b94283e190ef (patch)
tree5220e4f499685d1f1b66c6fa9c2e6768720422f8 /rules.js
parent2ebc3dbec73650c26db8c9b49b98887f19a99ec2 (diff)
download1989-dawn-of-freedom-8375df4b77eb7b64663be9a572d8b94283e190ef.tar.gz
Updates to The Tyrant is Gone
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js57
1 files changed, 43 insertions, 14 deletions
diff --git a/rules.js b/rules.js
index f7aee78..47ecd29 100644
--- a/rules.js
+++ b/rules.js
@@ -85,7 +85,7 @@ exports.setup = function (seed, scenario, options) {
discard: false,
view_opp_hand: false,
strategy_removed: [],
- persistent_events: {austria_hungary_border_reopened: false, civic_forum: false, eco_glasnost: false, elena: false, foreign_currency_debt_burden: '', frg_embassies: false, general_strike: false, genscher: false, grenztruppen: false, helsinki_final_act: false, honecker: false, li_peng: false, ligachev: false, national_salvation_front: false, perestroika: false, presidential_visit: false, prudence: '', roundtable_talks: false, securitate: false, sinatra_doctrine: false, solidarity_legalised: false, stand_fast: '', stasi: false, st_nicholas_church: false, systematization: 0, tear_gas: false, the_tyrant_is_gone: 0, the_wall: false, the_wall_must_go: false, we_are_the_people: false, yakovlev: false},
+ persistent_events: {austria_hungary_border_reopened: false, civic_forum: false, eco_glasnost: false, elena: false, foreign_currency_debt_burden: '', frg_embassies: false, general_strike: false, genscher: false, grenztruppen: false, helsinki_final_act: false, honecker: false, li_peng: false, ligachev: false, national_salvation_front: false, perestroika: false, presidential_visit: false, prudence: '', roundtable_talks: false, securitate: false, sinatra_doctrine: false, solidarity_legalised: false, stand_fast: '', stasi: false, st_nicholas_church: false, systematization: 0, tear_gas: false, the_crowd_turns_against_ceausescu: false, the_tyrant_is_gone: 0, the_wall: false, the_wall_must_go: false, we_are_the_people: false, yakovlev: false},
power_struggle_deck: [],
power_struggle_discard: [],
dem_hand_limit: 8,
@@ -989,13 +989,14 @@ states.draw_power_cards = {
log(`Democrat: ${game.dem_pwr_hand.length} cards`)
//Check if The Crowd Turns Against Ceausescu occurs
- if (game.persistent_events['the_crowd_turns_against_ceausescu'] && game.pwr_struggle_in === 'Romania') {
+ 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('The Crowd Turns Against Ceausescu')
+ game.persistent_events['the_crowd_turns_against_ceausescu'] = true
game.state = 'the_crowd_turns_against_ceausescu_prep'
} else {
log_h2('Raise the Stakes')
@@ -1451,13 +1452,13 @@ states.vp_roll = {
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}
- roll = roll + game.raised_stakes + rally_win - petition_win
+ let modified_roll = roll + game.raised_stakes + rally_win - petition_win
if (game.active === DEM && game.persistent_events['yakovlev']) {
log('+1 from Yakovlev Counsels Gorbachev')
- roll ++
+ modified_roll ++
}
- if (roll < 0) {roll = 0}
- else if (roll > 7) {roll = 7}
+ 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`)
@@ -1468,8 +1469,10 @@ states.vp_roll = {
if (petition_win !== 0) {
log('-2 from winning on a P31')
}
- log(`Modified roll: ${roll}`)
- let vp_change = vp_roll[roll]
+ 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 {
@@ -1478,7 +1481,7 @@ states.vp_roll = {
if (roll >= 4)
if (game.active === DEM) {game.vp += vp_change}
else {game.vp -= vp_change}
- if (game.active === DEM && roll >= 4) {
+ if (game.active === DEM && modified_roll >= 4) {
game.phase = 1
} else {
game.phase = 0
@@ -1525,10 +1528,14 @@ states.choose_power = {
},
scoring () {
push_undo()
-
score_country(game.pwr_struggle_in)
- game.state = 'finish_scoring'
- //game.state = 'score_country'
+
+ //Check if The Tyrant is Gone occurs
+ if (game.table_cards.includes(97) && game.pwr_struggle_in === 'Romania' && game.persistent_events['the_crowd_turns_against_ceausescu']) {
+ game.state = 'the_tyrant_is_gone'
+ } else {
+ game.state = 'finish_scoring'
+ }
}
}
/*
@@ -1547,6 +1554,21 @@ states.score_country = {
}
*/
+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()
+ }
+ log_h3(`C97`)
+ goto_vm(97)
+ }
+}
+
states.finish_scoring ={
inactive: 'finish scoring.',
prompt() {
@@ -2702,7 +2724,7 @@ function score_country(country) {
com_vp += presence.com_battlegrounds
let change_vp = dem_vp - com_vp
game.vp += change_vp
- log(`Final VP: ${change_vp} VP`)
+ log_gap(`Final VP: ${change_vp} VP`)
}
function get_value(country) {
@@ -4862,7 +4884,7 @@ function vm_the_chinese_solution() {
}
function vm_the_crowd_turns_against_ceausescu() {
- game.persistent_events['the_crowd_turns_against_ceausescu'] = true
+ //game.persistent_events['the_crowd_turns_against_ceausescu'] = true
game.table_cards.push(54)
game.playable_cards[97] = 1
vm_next()
@@ -4893,6 +4915,9 @@ function vm_the_tyrant_is_gone() {
game.valid_spaces.push(space.space_id)
}
}
+ game.playable_cards[10] = 0
+ game.playable_cards[41] = 0
+ game.playable_cards[101] = 0
game.playable_cards[107] = 0
game.state = 'vm_the_tyrant_is_gone'
}
@@ -7948,10 +7973,14 @@ CODE[96] = [ // The Chinese Solution*
]
CODE[97] = [ // The Tyrant is Gone*
+ [ vm_if, ()=>game.persistent_events['the_crowd_turns_against_ceausescu'] ],
[ vm_valid_spaces, 51 ],
[ vm_prompt, 'the Romanian Elite Space' ],
[ vm_remove_x_opp_infl, 4 ],
[ vm_the_tyrant_is_gone ],
+ [ vm_else ],
+ [ vm_the_tyrant_is_gone_prep ],
+ [ vm_endif ],
[ vm_permanently_remove ],
[ vm_return ],
]