summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js45
1 files changed, 44 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 869fd36..3b59486 100644
--- a/rules.js
+++ b/rules.js
@@ -692,6 +692,7 @@ function demand_obedience_in_space(s) {
add_tributary(s)
to_obedient_space(s)
log_space(s, "Demand Obedience")
+ logi_resources(DS, SPACES[s].pop)
}
states.march = {
@@ -4427,6 +4428,12 @@ function vm_to_rebel() {
vm_next()
}
+// VM: CAMPAIGN
+
+function vm_campaign() {
+ goto_campaign()
+}
+
// VM: CONTROL
function vm_place_tributary() {
@@ -4461,6 +4468,9 @@ function vm_free_attack() {
game.cmd.attacker = game.current
game.cmd.support_space = null
+ if (game.vm.fp === 43)
+ game.cmd.free = 0
+
if (typeof vm_inst(1) !== "undefined") {
game.cmd.target = vm_inst(1)
goto_attack_space()
@@ -4499,6 +4509,12 @@ function vm_free_govern() {
goto_govern_space()
}
+function vm_govern_in_space() {
+ init_free_command("Govern", game.vm.s)
+ game.cmd.free = 0
+ goto_govern_space()
+}
+
function vm_govern() {
game.cmd = {
limited: 0,
@@ -4547,6 +4563,7 @@ function vm_free_rally() {
// VM: MIX
function vm_conspire_trade() { game.state = "vm_conspire_trade" }
+function vm_govern_attack_demand() { game.state = "vm_govern_attack_demand"}
states.vm_conspire_trade = {
prompt() {
@@ -4564,6 +4581,27 @@ states.vm_conspire_trade = {
}
}
+states.vm_govern_attack_demand = {
+ prompt() {
+ event_prompt("Govern, Attack or Demande Obedience in selected Province.")
+ view.actions.govern = can_govern() ? 1 : 0
+ view.actions.attack = can_attack() ? 1 : 0
+ view.actions.demand = can_demand() ? 1 : 0
+ },
+ govern() {
+ push_undo()
+ vm_govern_in_space()
+ },
+ attack() {
+ push_undo()
+ vm_free_attack()
+ },
+ demand() {
+ push_undo()
+ vm_demand_obedience()
+ }
+}
+
// VM: EVENT_4
@@ -5302,7 +5340,12 @@ CODE[21 * 2 + 0] = [
// SHADED 21
CODE[21 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, DS ],
+ [ vm_campaign ],
+ [ vm_prompt, "Govern, Attack or Demande Obedience in selected Province." ],
+ [ vm_space, true, 1, 1, (s)=>([S_MALWA, S_MADHYADESH, S_JAUNPUR, S_GONDWANA].includes(s)) ],
+ [ vm_govern_attack_demand ],
+ [ vm_endspace ],
[ vm_return ],
]