diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 19:45:05 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 19:45:05 -0400 |
commit | d8b3ff3d5a616615c947252741d00cb0964b9a7a (patch) | |
tree | 79699be531a9c8bd59374c3fbc1700721416ee8a | |
parent | 5145d0a79551acad5197bfd63581c5218665b46e (diff) | |
download | vijayanagara-d8b3ff3d5a616615c947252741d00cb0964b9a7a.tar.gz |
Shaded 21
-rw-r--r-- | events.txt | 7 | ||||
-rw-r--r-- | rules.js | 45 |
2 files changed, 50 insertions, 2 deletions
@@ -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 @@ -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 ], ] |