diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-10 10:20:19 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-10 10:20:19 -0400 |
commit | 2b1d488ddede1e27f11d055e30ef399e392bafe8 (patch) | |
tree | ccead59b16e423a79fe51cc5e2667f29fd2ae1a0 | |
parent | 0e0180cf6a0552088dead19de67b090f40b974a3 (diff) | |
download | vijayanagara-2b1d488ddede1e27f11d055e30ef399e392bafe8.tar.gz |
Better Govern Events
-rw-r--r-- | events.txt | 2 | ||||
-rw-r--r-- | play.js | 12 | ||||
-rw-r--r-- | rules.js | 10 |
3 files changed, 14 insertions, 10 deletions
@@ -94,6 +94,7 @@ SHADED 4 stay_eligible current DS prompt "Govern ignoring location requirements." + asm game.vm.ignore_loc_req = true govern EVENT 5 @@ -169,6 +170,7 @@ EVENT 8 SHADED 8 current DS prompt `In each Province adjacent to Devagiri and/or Gulbarga, Govern for free ignoring location requirements and place a Troop.` + asm game.vm.ignore_loc_req = true space_opt all (is_adjacent_to_city(C_DEVAGIRI, s) || is_adjacent_to_city(C_GULBARGA, s)) && can_govern_in_space(s) free_govern_in_space place_opt 1 DS TROOPS @@ -72,10 +72,10 @@ const LAYOUT = { "Tamilakam BK": [648, 1478], "Tamilakam VE": [657, 1543], "Tamilakam mongols": [752, 1394], - "Delhi DS": [718, 316], + "Delhi DS": [718, 326], "Delhi BK": [571, 422], "Delhi VE": [724, 414], - "Delhi mongols": [573, 324], + "Delhi mongols": [573, 334], "Mountain Passes DS": [263, 183], "Mountain Passes BK": [236, 110], "Mountain Passes VE": [318, 105], @@ -1134,19 +1134,19 @@ function on_update() { // layout cavalry items.length = 0 filter_calvary_tokens(items, DS) - layout_cavalry(items, 1125, 100, 14) + layout_cavalry(items, 1125, 100, 13) items.length = 0 filter_calvary_tokens(items, BK) - layout_cavalry(items, 265, 920, 14) + layout_cavalry(items, 265, 920, 13) items.length = 0 filter_calvary_tokens(items, VE) - layout_cavalry(items, 265, 1420, 14) + layout_cavalry(items, 265, 1420, 13) items.length = 0 filter_calvary_tokens(items, AVAILABLE) - layout_cavalry(items, 1186, 1080, 17) + layout_cavalry(items, 725, 73, 13) // layout pieces items.length = 0 @@ -1667,9 +1667,9 @@ function can_govern() { } function can_govern_in_space(s) { - let is_event_4 = (game.vm && game.vm.fp === 9) + let is_space_agnostic = (game.vm && "ignore_loc_req" in game.vm && game.vm.ignore_loc_req) let is_space = (is_tributary(s) || s === S_DELHI || s === S_MOUNTAIN_PASSES || s === S_PUNJAB || is_faction_control(s, DS)) - if (!is_event_4 && !is_space) + if (!is_space_agnostic && !is_space) return false if (has_piece(AVAILABLE, DS, ELITE)) @@ -1706,8 +1706,8 @@ function goto_govern_space() { states.govern = { inactive: "Govern", prompt() { - if (game.vm && game.vm.fp === 9) - view.prompt = "Govern: Ignore Locations requirements." + if (game.vm && "ignore_loc_req" in game.vm && game.vm.ignore_loc_req) + view.prompt = "Govern: Ignore locations requirements." else view.prompt = "Govern: Select a Tributary, Controlled, Mongol Invader region or Delhi." @@ -6032,6 +6032,7 @@ CODE[4 * 2 + 1] = [ [ vm_stay_eligible ], [ vm_current, DS ], [ vm_prompt, "Govern ignoring location requirements." ], + [ vm_asm, ()=>game.vm.ignore_loc_req = true ], [ vm_govern ], [ vm_return ], ] @@ -6131,6 +6132,7 @@ CODE[8 * 2 + 0] = [ CODE[8 * 2 + 1] = [ [ vm_current, DS ], [ vm_prompt, ()=>`In each Province adjacent to Devagiri and/or Gulbarga, Govern for free ignoring location requirements and place a Troop.` ], + [ vm_asm, ()=>game.vm.ignore_loc_req = true ], [ vm_space, true, 0, 999, (s)=>(is_adjacent_to_city(C_DEVAGIRI, s) || is_adjacent_to_city(C_GULBARGA, s)) && can_govern_in_space(s) ], [ vm_free_govern_in_space ], [ vm_place, false, 1, 1, DS, TROOPS ], |