summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-23 17:44:13 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-23 17:44:13 +0100
commitcea185913177ab42dacdd050faa788f69d6acc10 (patch)
tree432e50ee07e66b24cd21534e3c320d969011483a /rules.js
parentb6b9bc384b3360f0c2afa943c393de71c7be642d (diff)
parentebfa35806351a4ef202bb7b8f11bea44a2adf017 (diff)
download1989-dawn-of-freedom-cea185913177ab42dacdd050faa788f69d6acc10.tar.gz
Merging in New View
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js55
1 files changed, 28 insertions, 27 deletions
diff --git a/rules.js b/rules.js
index f9a172e..fc1f037 100644
--- a/rules.js
+++ b/rules.js
@@ -83,7 +83,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_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},
+ 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, laszlo_tokes: 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,
@@ -994,8 +994,10 @@ states.draw_power_cards = {
},
draw() {
push_undo()
- console.log('called draw cards, game.active', game.active, 'game.view_opp_hand', game.view_opp_hand)
+ console.log('called draw cards, country', game.pwr_struggle_in, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand)
+ console.log('test3')
let presence = check_presence(game.pwr_struggle_in)
+ console.log('test2')
if (presence.dem_spaces > 0) {
game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1)
} else {
@@ -1007,8 +1009,7 @@ states.draw_power_cards = {
game.com_pwr_hand_limit = 0
}
// Events which affect cards drawn
-
- if (game.persistent_events['roundtable_talks'] && game.com_pwr_hand_limit > 2) {
+ if (game.persistent_events['roundtable_talks'] && game.com_pwr_hand_limit >= 2) {
log('Democrat receives 2 cards from Communist due to C17')
game.dem_pwr_hand_limit += 2
game.com_pwr_hand_limit -= 2
@@ -1016,23 +1017,15 @@ states.draw_power_cards = {
game.persistent_events['roundtable_talks'] = false
}
- if (game.persistent_events['peasant_parties_revolt'] && game.com_pwr_hand_limit > 1) {
- let farmer_check = false
- for (let space of spaces) {
- if (space && space.country === game.pwr_struggle_in && game.socio === 3 && space.demCtrl === 1) {
- farmer_check = true
- }
- }
- if (farmer_check) {
- log('Democrat receives 1 card from Communist due to C72')
- game.dem_pwr_hand_limit += 1
- game.com_pwr_hand_limit -= 1
- permanently_remove(72)
- game.persistent_events['peasant_parties_revolt'] = false
- }
+ if (game.persistent_events['peasant_parties_revolt'] && game.com_pwr_hand_limit >=1) {
+ log('Democrat receives 1 cards from Communist due to C72')
+ game.dem_pwr_hand_limit += 1
+ game.com_pwr_hand_limit -= 1
+ discard_from_table(72)
+ game.persistent_events['peasant_parties_revolt'] = false
}
- if (game.persistent_events['national_salvation_front'] && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria') && game.dem_pwr_hand_limit > 2) {
+ if (game.persistent_events['national_salvation_front'] && game.dem_pwr_hand_limit >=2 && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) {
log('Communist receives 2 cards from Democrat due to C102')
game.dem_pwr_hand_limit -= 2
game.com_pwr_hand_limit += 2
@@ -1042,6 +1035,7 @@ states.draw_power_cards = {
//Draw Power Cards
game.is_pwr_struggle = true
+ console.log('game.dem_pwr_hand_limit', game.dem_pwr_hand_limit, 'game.com_pwr_hand_limit', game.com_pwr_hand_limit)
draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit)
game.valid_cards = all_power_cards
@@ -1089,7 +1083,7 @@ states.the_crowd_turns_against_ceausescu = {
return `resolve ${cards[54].name}.`
},
prompt() {
- view.prompt = `You have ${game.vm_available_ops} influence points. Play for:`
+ view.prompt = `You have ${game.vm_available_ops} operations points. Play for:`
gen_action('influence')
gen_action('support_check')
},
@@ -3273,12 +3267,12 @@ function draw_deck(deck) {
}
function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) {
- //console.log('game.valid_cards at start of draw cards: ', game.valid_cards)
+ console.log('game.valid_cards at start of draw cards: ', game.valid_cards)
let turn = 'communist'; // Start with the communist player
- //console.log('game.strategy_deck', game.strategy_deck)
- //console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit)
+ console.log('game.strategy_deck', game.strategy_deck)
+ console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit)
while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) {
- //console.log('deck.length: ', deck.length)
+ console.log('deck.length: ', deck.length)
//console.log('discard.length', game.strategy_discard )
if (deck.length === 0) {
log_h3('--- Reshuffle ---')
@@ -3289,16 +3283,16 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han
else if (turn === 'communist' && communist_hand.length < com_hand_limit) {
communist_hand.push(draw_card(deck));
- //console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards));
+ console.log('game.valid_cards after communist draw: ', JSON.stringify(game.valid_cards));
turn = 'democrat';
} else if(turn === 'communist' && communist_hand.length === com_hand_limit) {
turn = 'democrat';
}
else if (turn === 'democrat' && democrat_hand.length < dem_hand_limit) {
democrat_hand.push(draw_card(deck));
- //console.log('democrat_hand: ', democrat_hand)
+ console.log('democrat_hand: ', democrat_hand)
- //console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards));
+ console.log('game.valid_cards after democrat draw: ', JSON.stringify(game.valid_cards));
turn = 'communist';
}
else if (turn === 'democrat' && democrat_hand.length === dem_hand_limit) {
@@ -4851,6 +4845,7 @@ function vm_kremlin_coup() {
}
function vm_laszlo_tokes() {
+ game.persistent_events['laszlo_tokes'] = true
game.playable_cards[107].playable = 1
game.state = 'vm_laszlo_tokes'
}
@@ -4884,6 +4879,11 @@ function vm_malta_summit() {
game.state = 'vm_malta_summit'
}
+function vm_massacre_in_timisoara() {
+ game.persistent_events['laszlo_tokes'] = false
+ vm_next()
+}
+
function vm_modrow() {
game.playable_cards[15].playable = 0
game.state = 'vm_modrow'
@@ -8346,6 +8346,7 @@ CODE[105] = [ // Public Against Violence*
CODE[106] = [ // Social Democratic Platform Adopted*
[ vm_social_democratic_platform_adopted ],
[ vm_valid_spaces_country ],
+ [ vm_prompt, ()=>`${country_name(game.vm_active_country)}`],
[ vm_add_infl_free, 2 ],
[ vm_valid_spaces_country_sc ],
[ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ],