summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js99
1 files changed, 72 insertions, 27 deletions
diff --git a/rules.js b/rules.js
index b5e8ede..a69bae8 100644
--- a/rules.js
+++ b/rules.js
@@ -450,7 +450,7 @@ states.choose_card = {
log('+1 op from C50')
game.available_ops ++
}
-
+
if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) {
log('+1 op from Tiananmen Square Track')
game.available_ops ++
@@ -1990,30 +1990,29 @@ states.stasi_end_round = {
pass() {
log('Stasi: Democrat has no remaining cards')
game.stasi_card = 0
- game.round_player = COM
- game.round ++
- log_h2(`Action Round ${game.round}`)
- next_player()
- game.valid_spaces = []
- if (game.persistent_events['general_strike']) {
- log_h3('C5')
- game.state = 'general_strike'
- } else {
- game.state = 'choose_card'
- }
+ end_stasi_choose_card()
},
done() {
- game.round_player = COM
- game.round ++
- log_h2(`Action Round ${game.round}`)
- next_player()
- game.valid_spaces = []
- if (game.persistent_events['general_strike']) {
- log_h3('C5')
- game.state = 'general_strike'
+ push_undo()
+ if (game.stasi_card === 21) {
+ game.state = 'stasi_confirm'
} else {
- game.state = 'choose_card'
+ end_stasi_choose_card()
+ }
+ }
+}
+
+states.stasi_confirm = {
+ inactive: 'choose next card due to Stasi.',
+ prompt() {
+ if (game.stasi_card === 21 ) {
+ view.prompt = `If Common European Home selected, it must be played for Operations. Otherwise select the opponent's card instead.`
+ gen_action('done')
}
+ },
+ done() {
+ game.playable_cards[21].playable = 0
+ end_stasi_choose_card()
}
}
@@ -2038,12 +2037,23 @@ states.stasi_play_card = {
},
card(card) {
push_undo()
- log_msg_gap(`Stasi: played C${cards[card].number}`)
+ log_msg_gap(`Stasi: played C${card}`)
game.played_card = card
let find_card
find_card = game.democrat_hand.indexOf(card);
const [playedCard] = game.democrat_hand.splice(find_card, 1);
- game.available_ops = cards[card].ops
+ game.available_ops = cards[card].ops
+
+ //Check for events which influence ops
+ if (game.persistent_events['sinatra_doctrine'] && game.active === DEM) {
+ log('+1 op from C50')
+ game.available_ops ++
+ }
+
+ if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) {
+ log('+1 op from Tiananmen Square Track')
+ game.available_ops ++
+ }
if (game.available_ops > 1 && game.persistent_events['prudence'].DEM !== 0) {
log(`${pluralize(game.persistent_events['prudence'].DEM, ' op')} from C8}`)
game.available_ops += game.persistent_events['prudence'].DEM
@@ -2051,19 +2061,40 @@ states.stasi_play_card = {
game.available_ops = 1
}
}
+
},
pass () {
log('No cards remaining. Passed')
end_round()
},
done () {
- game.state = 'play_card'
- game.stasi_card = 0
+ if (democrat_hand.includes(21)) {
+ game.state = 'stasi_resolve_common_european_home'
+ } else {
+ game.state = 'play_card'
+ game.stasi_card = 0
+ }
}
}
-states.stasi_common_european_home = {
-
+states.stasi_resolve_common_european_home = {
+ inactive: 'play a card.',
+ prompt () {
+ view.prompt = `Do you wish to play ${clean_name(cards[game.played_card].name)} with Common European Home?`
+ gen_action('yes')
+ gen_action('no')
+ },
+ yes() {
+ log(`${clean_name(cards[game.played_card].name)}} played with Common European Home`)
+ silent_discard(21)
+ game.vm_infl_to_do = true
+ game.vm_event_to_do = false
+ game.state = 'resolve_opponent_event'
+ },
+ no() {
+ game.state = 'play_card'
+ game.stasi_card = 0
+ }
}
@@ -2992,6 +3023,20 @@ function reset_austria_hungary_border_reopened() {
game.austria_hungary_border_reopened_tracker = false
}
+function end_stasi_choose_card() {
+ game.round_player = COM
+ game.round ++
+ log_h2(`Action Round ${game.round}`)
+ next_player()
+ game.valid_spaces = []
+ if (game.persistent_events['general_strike']) {
+ log_h3('C5')
+ game.state = 'general_strike'
+ } else {
+ game.state = 'choose_card'
+ }
+}
+
// =========== MOVING THROUGH TURNS ============
function end_round() {