summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js64
1 files changed, 48 insertions, 16 deletions
diff --git a/rules.js b/rules.js
index 85238d1..312885a 100644
--- a/rules.js
+++ b/rules.js
@@ -2258,17 +2258,24 @@ states.final_crisis_events = {
else {
log_h3(game.active + " - Event")
logi("C" + c)
- goto_play_event(c)
+ if (can_play_event(c))
+ goto_play_event(c)
+ else
+ log("Could not play.")
}
},
}
+// TODO: - is this necessary?
states.final_crisis_opponent_event = {
inactive: "play an event",
prompt() {
view.prompt = card_names[game.what] + ": Play or ignore event."
view.selected_card = game.what
- view.actions.event = 1
+ if (can_play_event(game.what))
+ view.actions.event = 1
+ else
+ view.actions.event = 0
view.actions.pass = 1
},
event() {
@@ -2286,32 +2293,46 @@ states.final_crisis_opponent_event = {
function goto_final_victory() {
update_presence_and_control()
+ log_h2("Final Victory")
+
if (game.red_momentum === 3) {
- log("Revolutionary Momentum:")
+ log_h3("Revolutionary Momentum")
add_political_vp(COMMUNE, 1)
}
if (game.blue_momentum === 3) {
- log("Prussian Collaboration:")
+ log_h3("Prussian Collaboration")
add_military_vp(VERSAILLES, 1)
}
+ log_br()
+
if (versailles_military_vp() > commune_military_vp())
- return goto_game_over(VERSAILLES, "Versailles won!")
+ return goto_game_over(VERSAILLES, "Versailles won with Military VP!")
if (commune_political_vp() > versailles_political_vp())
- return goto_game_over(COMMUNE, "Commune won!")
+ return goto_game_over(COMMUNE, "Commune won with Political VP!")
let v = 0
let c = 0
- if (versailles_military_vp() + versailles_political_vp() > commune_military_vp() + commune_political_vp())
+ log_h3("Tiebreaker")
+
+ if (versailles_military_vp() + versailles_political_vp() > commune_military_vp() + commune_political_vp()) {
+ log("Combined VP: Versailles.")
++v
- if (commune_military_vp() + commune_political_vp() > versailles_military_vp() + versailles_political_vp())
+ }
+ if (commune_military_vp() + commune_political_vp() > versailles_military_vp() + versailles_political_vp()) {
+ log("Combined VP: Commune.")
++c
- if (game.blue_fulfilled > game.red_fulfilled)
+ }
+ if (game.blue_fulfilled > game.red_fulfilled) {
+ log("Objectives fulfilled: Versailles.")
++v
- if (game.red_fulfilled > game.blue_fulfilled)
+ }
+ if (game.red_fulfilled > game.blue_fulfilled) {
+ log("Objectives fulfilled: Commune.")
++c
+ }
let nv = 0
let nc = 0
@@ -2321,20 +2342,31 @@ function goto_final_victory() {
if (is_versailles_control(s))
nv++
}
- if (nv > nc)
+ if (nv > nc) {
+ log("Pivotal Spaces: Versailles.")
v++
- if (nc > nv)
+ }
+ if (nc > nv) {
+ log("Pivotal Spaces: Commune.")
c++
+ }
- if (game.initiative === VERSAILLES)
+ if (game.initiative === VERSAILLES) {
+ log("Final Initiative: Versailles.")
v++
- else
+ } else {
+ log("Final Initiative: Commune.")
c++
+ }
+
+ log_br()
if (v > c)
- return goto_game_over(VERSAILLES, "Versailles won!")
+ return goto_game_over(VERSAILLES, "Versailles won with " + v + " vs " + c + " conditions!")
+ if (c > v)
+ return goto_game_over(COMMUNE, "Commune won with " + c + " vs " + v + " conditions!")
- return goto_game_over(COMMUNE, "Commune won!")
+ return goto_game_over(COMMUNE, "Commune won final tie breaker!")
}
// === EVENTS ===