summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-03-09 19:45:05 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-03-09 19:45:05 -0400
commitd8b3ff3d5a616615c947252741d00cb0964b9a7a (patch)
tree79699be531a9c8bd59374c3fbc1700721416ee8a
parent5145d0a79551acad5197bfd63581c5218665b46e (diff)
downloadvijayanagara-d8b3ff3d5a616615c947252741d00cb0964b9a7a.tar.gz
Shaded 21
-rw-r--r--events.txt7
-rw-r--r--rules.js45
2 files changed, 50 insertions, 2 deletions
diff --git a/events.txt b/events.txt
index 6594ce5..3fdb09e 100644
--- a/events.txt
+++ b/events.txt
@@ -451,7 +451,12 @@ EVENT 21
move_to S_DELHI (is_troop(p) && (piece_space(p) === S_GONDWANA || piece_space(p) === S_MADHYADESH))
SHADED 21
- log "NOT IMPLEMENTED"
+ current DS
+ campaign
+ prompt "Govern, Attack or Demande Obedience in selected Province."
+ space 1 ([S_MALWA, S_MADHYADESH, S_JAUNPUR, S_GONDWANA].includes(s))
+ govern_attack_demand
+ endspace
EVENT 22
current REBEL_FACTIONS
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 ],
]