summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-03-18 16:21:31 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-03-18 16:21:31 -0400
commite2b4cc4ffd06d39c007be923a3a88edfcabf23f6 (patch)
treeae6f12d4514f1d1a3ca27d91c4ffacab1816a504
parent50446af454b1c2f86174bdddf0a90cdccf0a0c7f (diff)
downloadvijayanagara-e2b4cc4ffd06d39c007be923a3a88edfcabf23f6.tar.gz
Obedient ending
-rw-r--r--rules.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index fac3f06..0c56a14 100644
--- a/rules.js
+++ b/rules.js
@@ -4567,6 +4567,7 @@ function goto_rebel_or_obedient(s) {
}
states.rebel_or_obedient = {
+ inactive: "Obedient or Rebelling units",
prompt() {
event_prompt(`Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`)
@@ -4575,20 +4576,24 @@ states.rebel_or_obedient = {
},
obedient() {
push_undo()
- vm_next()
+ end_rebel_or_obedient()
},
rebelling() {
push_undo()
let p = find_piece(game.decree.where, game.current, ELITE)
to_rebel(p)
log(`A ${piece_name(p)} in S${game.decree.where} to Rebel.`)
- if (game.vm)
- vm_next()
- else
- game.state = "conspire"
+ end_rebel_or_obedient()
}
}
+function end_rebel_or_obedient() {
+ if (game.vm && game.vm.ip)
+ vm_next()
+ else
+ game.state = "conspire"
+}
+
// VM: GAIN_CAVALRY
function vm_gain_cavalry() {