summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-09 20:14:41 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-09 20:16:41 +0200
commit49226230915adaa273f85070071f7866143d7851 (patch)
treef546993f5b7c9f6ed88bcd2f059fe09b07242dfe /rules.js
parent8772993aa7b3a9dacbe8102e649af3f7a159b6cf (diff)
downloadtime-of-crisis-49226230915adaa273f85070071f7866143d7851.tar.gz
Log and prompt improvements.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js33
1 files changed, 22 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index dfc28bf..d979e74 100644
--- a/rules.js
+++ b/rules.js
@@ -1446,11 +1446,10 @@ states.barbarian_invasion = {
get inactive() { return "Barbarian Crisis \u2013 " + BARBARIAN_NAME[game.crisis[0]] },
prompt() {
let tribe = game.crisis[0]
- let count = game.crisis[3]
- if (count === 1)
+ if (game.count === 1)
prompt("Barbarian Crisis: Invade with 1 " + BARBARIAN_ONE[tribe] + ".")
else
- prompt("Barbarian Crisis: Invade with " + count + " " + BARBARIAN_NAME[tribe] + ".")
+ prompt("Barbarian Crisis: Invade with " + game.count + " " + BARBARIAN_NAME[tribe] + ".")
gen_action_barbarian(find_active_barbarian_at_home(tribe))
},
barbarian(id) {
@@ -2279,7 +2278,7 @@ function remove_emperor_token(where) {
}
function remove_governor(where) {
- log("Remove governor from %" + where + ".")
+ log("Removed governor from %" + where + ".")
eliminate_militia(where)
set_mobs(where, 0)
@@ -2874,6 +2873,7 @@ function enter_capital() {
game.state = "occupy_seat_of_power_1"
return
} else {
+ log_br()
game.state = "occupy_breakaway"
return
}
@@ -2920,7 +2920,7 @@ states.occupy_seat_of_power_2 = {
},
region(where) {
push_undo()
- log("Remove Breakaway in %" + where + ".")
+ log("Removed breakaway in %" + where + ".")
remove_breakaway(where)
resume_occupy_seat_of_power()
},
@@ -2935,7 +2935,7 @@ states.occupy_breakaway = {
},
region(where) {
push_undo()
- log("Remove Breakaway in %" + where + ".")
+ log("Removed breakaway in %" + where + ".")
remove_breakaway(where)
remove_governor(where)
goto_replace_pretender()
@@ -2946,7 +2946,7 @@ function goto_replace_pretender() {
if (has_available_governor())
game.state = "replace_pretender_governor"
else
- resume_take_actions()
+ end_occupation_of_pretender_capital()
}
states.replace_pretender_governor = {
@@ -2964,17 +2964,22 @@ states.replace_pretender_governor = {
},
governor(id) {
push_undo()
- log("Replace Governor in %" + game.where + ".")
+ log("Placed governor in %" + game.where + ".")
set_governor_location(id, game.where)
update_neutral_italia()
- resume_take_actions()
+ end_occupation_of_pretender_capital()
},
pass() {
push_undo()
- resume_take_actions()
+ end_occupation_of_pretender_capital()
},
}
+function end_occupation_of_pretender_capital() {
+ log_br()
+ resume_take_actions()
+}
+
// CARD: CASTRA
function can_play_castra() {
@@ -3245,7 +3250,7 @@ function auto_remove_pretender_empire(seat) {
remove_seat_of_power(seat)
for (let where = 1; where < 12; ++where) {
if (is_breakaway(where) && (get_province_governor(where) / 6 | 0) === pretender) {
- log("Remove Breakaway in %" + where + ".")
+ log("Removed breakaway in %" + where + ".")
remove_breakaway(where)
}
}
@@ -3753,6 +3758,12 @@ function can_militia_battle_with_army(where, attacker, is_force_march) {
function goto_battle(type, where, attacker, target, is_force_march) {
log_h2("Battle in %" + where)
+
+ if (game.active_event === EVENT_GOOD_AUGURIES || game.active_event === EVENT_BAD_AUGURIES) {
+ log("E" + game.active_event + ".")
+ log_br()
+ }
+
spend_military(1)
game.where = where
game.combat = {