From 9c6017f378483e041e2468d4323e9349bb71458a Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Fri, 14 Mar 2025 11:51:11 -0400 Subject: Update opt events --- rules.js | 70 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index f8afca9..c8aeb4e 100644 --- a/rules.js +++ b/rules.js @@ -4268,6 +4268,7 @@ function vm_set_space() { function vm_stay_eligible() { log(faction_acronyms[game.current] + " stays Eligible.") + log_br() game.marked |= (16 << game.current) vm_next() } @@ -4321,6 +4322,7 @@ states.vm_piece = { if (vm_inst(1)) push_undo() game.vm.opt = 1 + game.vm.pp = [] vm_goto(vm_endpiece, vm_piece, 1, 1) }, } @@ -4564,7 +4566,7 @@ states.vm_steal = { let n = Math.min(vm_operand(3), game.resources[f]) add_resources(game.current, n) add_resources(f, -n) - log(`${faction_name[game.current]} steals ${n} Resources from ${faction_name[f]}.`) + log(`${faction_acronyms[game.current]} steals ${n} Resources from ${faction_acronyms[f]}.`) vm_next() }, skip() { @@ -5216,7 +5218,7 @@ CODE[2 * 2 + 0] = [ [ vm_prompt, "Remove up to 2 Delhi Sultanate Units in both Mountain Passes and Punjab." ], [ vm_space, true, 2, 2, (s)=>((s === S_MOUNTAIN_PASSES || s === S_PUNJAB) && has_ds_unit(s)) ], [ vm_prompt, "Remove up to 2 Delhi Sultanate Units." ], - [ vm_piece, false, 2, 2, (p,s)=>is_ds_unit(p) && is_piece_in_event_space(p) ], + [ vm_piece, true, 0, 2, (p,s)=>is_ds_unit(p) && is_piece_in_event_space(p) ], [ vm_remove ], [ vm_endpiece ], [ vm_endspace ], @@ -5338,7 +5340,7 @@ CODE[6 * 2 + 0] = [ [ vm_space, true, 0, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s)) ], [ vm_remove_tributary ], [ vm_prompt, ()=>`Place up to 2 ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ], - [ vm_place, false, 1, 2, ()=>(game.current), ELITE ], + [ vm_place, true, 1, 2, ()=>(game.current), ELITE ], [ vm_endspace ], [ vm_return ], ] @@ -5359,7 +5361,7 @@ CODE[7 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], [ vm_prompt, ()=>`Place up to 2 ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}s in Tamilakam.` ], [ vm_space, true, 1, 1, (s)=>(s === S_TAMILAKAM) ], - [ vm_place, false, 0, 2, ()=>(game.current), ELITE ], + [ vm_place, true, 1, 2, ()=>(game.current), ELITE ], [ vm_endspace ], [ vm_cav_resources, 3 ], [ vm_return ], @@ -5371,8 +5373,8 @@ CODE[7 * 2 + 1] = [ [ vm_current, DS ], [ vm_prompt, ()=>`Place up to 4 Troops and a Governor in Tamilakam.` ], [ vm_space, true, 1, 1, (s)=>(s === S_TAMILAKAM) ], - [ vm_place, false, 0, 4, DS, TROOPS ], - [ vm_place, false, 0, 1, DS, ELITE ], + [ vm_place, true, 1, 4, DS, TROOPS ], + [ vm_place, true, 1, 1, DS, ELITE ], [ vm_endspace ], [ vm_cav_resources, 3 ], [ vm_return ], @@ -5424,8 +5426,8 @@ CODE[9 * 2 + 1] = [ [ vm_resources, false, ()=>(game.current), 3 ], [ vm_prompt, "Add up to 4 Troops and 1 Governor in one Province adjacent to Warangal." ], [ vm_space, true, 1, 1, (s)=>is_adjacent_to_city(C_WARANGAL, s) ], - [ vm_place, false, 1, 4, DS, TROOPS ], - [ vm_place, false, 1, 1, DS, ELITE ], + [ vm_place, true, 1, 4, DS, TROOPS ], + [ vm_place, true, 1, 1, DS, ELITE ], [ vm_endspace ], [ vm_return ], ] @@ -5449,14 +5451,14 @@ CODE[10 * 2 + 1] = [ [ vm_stay_eligible ], [ vm_current, DS ], [ vm_prompt, "Move any Qasbah to Spaces containing Governors." ], - [ vm_piece, false, 0, 999, (p,s)=>is_qasbah(p) ], + [ vm_piece, true, 0, 999, (p,s)=>is_qasbah(p) ], [ vm_space, true, 1, 1, (s)=>has_governor(s) && !has_qasbah(s) ], [ vm_move ], [ vm_endspace ], [ vm_endpiece ], [ vm_prompt, "Add up to 2 Troops in each Space with a Qasbah." ], [ vm_space, true, 0, 999, (s)=>has_qasbah(s) ], - [ vm_place, false, 1, 2, DS, TROOPS ], + [ vm_place, true, 1, 2, DS, TROOPS ], [ vm_endspace ], [ vm_return ], ] @@ -5466,7 +5468,7 @@ CODE[11 * 2 + 0] = [ [ vm_stay_eligible ], [ vm_prompt, "Place up to two Mongol Invaders in each of Mtn Passes and Punjab." ], [ vm_space, true, 0, 2, (s)=>(s === S_PUNJAB || s === S_MOUNTAIN_PASSES) ], - [ vm_place, false, 1, 2, MI, TROOPS ], + [ vm_place, true, 1, 2, MI, TROOPS ], [ vm_endspace ], [ vm_return ], ] @@ -5476,7 +5478,7 @@ CODE[11 * 2 + 1] = [ [ vm_stay_eligible ], [ vm_current, DS ], [ vm_prompt, "Remove 4 Mongol Invaders." ], - [ vm_piece, false, 4, 4, (p,s)=>is_mongol_invader(p) ], + [ vm_piece, true, 0, 4, (p,s)=>is_mongol_invader(p) ], [ vm_remove ], [ vm_endpiece ], [ vm_return ], @@ -5487,7 +5489,7 @@ CODE[12 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], [ vm_gain_cavalry, ()=>2 ], [ vm_prompt, "Remove 4 Delhi Sultantes pieces from Provinces adjacent to Warangal." ], - [ vm_piece, false, 4, 4, (p,s)=>(is_adjacent_to_city(C_WARANGAL, piece_space(p)) && piece_faction(p) === DS) ], + [ vm_piece, true, 0, 4, (p,s)=>(is_adjacent_to_city(C_WARANGAL, piece_space(p)) && piece_faction(p) === DS) ], [ vm_remove ], [ vm_endpiece ], [ vm_return ], @@ -5555,6 +5557,10 @@ CODE[13 * 2 + 1] = [ CODE[14 * 2 + 0] = [ [ vm_current, VE ], [ vm_gain_cavalry, ()=>2 ], + [ vm_prompt, "Remove a Tributary marker in a Province adjacent to Vijayanagara." ], + [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_VIJAYANAGARA, s) && is_tributary(s) ], + [ vm_remove_tributary ], + [ vm_endspace ], [ vm_asm, ()=>game.vm.count = 0 ], [ vm_repeat, 2 ], [ vm_prompt, ()=>`Place up to ${2-game.vm.count} Rajas adjacent to Vijayanagara.` ], @@ -5563,10 +5569,6 @@ CODE[14 * 2 + 0] = [ [ vm_asm, ()=>(game.vm.count += 1) ], [ vm_endspace ], [ vm_endrepeat ], - [ vm_prompt, "Remove a Tributary marker in a Province adjacent to Vijayanagara." ], - [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_VIJAYANAGARA, s) && is_tributary(s) ], - [ vm_remove_tributary ], - [ vm_endspace ], [ vm_return ], ] @@ -5576,8 +5578,8 @@ CODE[14 * 2 + 1] = [ [ vm_gain_cavalry, ()=>3 ], [ vm_prompt, "Place up to 4 Troops and a Governor in a province adjacent to Vijayanagara and Demand Obedience there." ], [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_VIJAYANAGARA, s) ], - [ vm_place, false, 1, 4, DS, TROOPS ], - [ vm_place, false, 1, 1, DS, ELITE ], + [ vm_place, true, 1, 4, DS, TROOPS ], + [ vm_place, true, 1, 1, DS, ELITE ], [ vm_demand_obedience ], [ vm_endspace ], [ vm_return ], @@ -5587,7 +5589,7 @@ CODE[14 * 2 + 1] = [ CODE[15 * 2 + 0] = [ [ vm_stay_eligible ], [ vm_prompt, "Replace Governors with Rebelling Amirs in Provinces adjacent to Devagiri." ], - [ vm_piece, false, 0, 999, (p,s)=>is_adjacent_to_city(C_DEVAGIRI, piece_space(p)) && can_place_piece(piece_space(p), BK, ELITE) && is_governor(p) ], + [ vm_piece, true, 0, 999, (p,s)=>is_adjacent_to_city(C_DEVAGIRI, piece_space(p)) && can_place_piece(piece_space(p), BK, ELITE) && is_governor(p) ], [ vm_set_piece_space ], [ vm_mark_space ], [ vm_remove ], @@ -5627,7 +5629,7 @@ CODE[16 * 2 + 0] = [ [ vm_endspace ], [ vm_endrepeat ], [ vm_prompt, "Place a Fort adjacent to Gulbarga." ], - [ vm_space, true, 1, 1, (s)=>is_adjacent_to_city(C_GULBARGA, s) && can_place_piece(s, BK, DISC) ], + [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_GULBARGA, s) && can_place_piece(s, BK, DISC) ], [ vm_auto_place, false, 0, false, BK, DISC ], [ vm_endspace ], [ vm_return ], @@ -5660,7 +5662,7 @@ CODE[17 * 2 + 0] = [ [ vm_current, BK ], [ vm_add_influence, BK ], [ vm_prompt, "Remove up to 5 Delhi Sultanate Units from Provinces with you presence." ], - [ vm_piece, false, 0, 5, (p,s)=>is_ds_unit(p) && has_piece_faction(piece_space(p), BK) ], + [ vm_piece, true, 0, 5, (p,s)=>is_ds_unit(p) && has_piece_faction(piece_space(p), BK) ], [ vm_remove ], [ vm_endpiece ], [ vm_return ], @@ -5671,11 +5673,11 @@ CODE[17 * 2 + 1] = [ [ vm_prompt, "Remove a Fort and up to 2 Amirs from one Province." ], [ vm_space, true, 0, 1, (s)=>has_piece_faction(s, BK) ], [ vm_prompt, "Remove 1 Fort from selected Province." ], - [ vm_piece, false, 0, 1, (p,s)=>is_piece_in_event_space(p) && is_fort(p) ], + [ vm_piece, true, 0, 1, (p,s)=>is_piece_in_event_space(p) && is_fort(p) ], [ vm_remove ], [ vm_endpiece ], [ vm_prompt, "Remove up to 2 Amirs from selected Province." ], - [ vm_piece, false, 0, 2, (p,s)=>is_piece_in_event_space(p) && is_amir(p) ], + [ vm_piece, true, 0, 2, (p,s)=>is_piece_in_event_space(p) && is_amir(p) ], [ vm_remove ], [ vm_endpiece ], [ vm_endspace ], @@ -5744,7 +5746,7 @@ CODE[20 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], [ vm_add_influence, ()=>(game.current) ], [ vm_prompt, "In Orissa or an adjacent Province, you may Migrate, Rally and then Build." ], - [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) || s === S_BENGAL) ], + [ vm_space, true, 0, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) || s === S_BENGAL) ], [ vm_free_migrate ], [ vm_free_rally ], [ vm_free_build ], @@ -5760,9 +5762,9 @@ CODE[20 * 2 + 1] = [ [ vm_piece, false, 0, 1, (p,s)=>((is_temple(p) || is_fort(p)) && is_piece_in_event_space(p)) ], [ vm_remove ], [ vm_endpiece ], - [ vm_place, false, 0, 1, DS, ELITE ], - [ vm_place, false, 0, 1, DS, DISC ], - [ vm_place, false, 0, 2, DS, TROOPS ], + [ vm_place, false, 1, 1, DS, ELITE ], + [ vm_place, false, 1, 1, DS, DISC ], + [ vm_place, false, 1, 2, DS, TROOPS ], [ vm_place_tributary ], [ vm_endspace ], [ vm_return ], @@ -5824,12 +5826,12 @@ CODE[23 * 2 + 0] = [ [ vm_current, VE ], [ vm_prompt, "Build and then replace a Unit with a Raja in each Province with a Temple." ], [ vm_add_influence, VE ], - [ vm_space, true, 1, 1, (s)=>can_build_in_space(s) ], + [ vm_space, true, 0, 1, (s)=>can_build_in_space(s) ], [ vm_free_build ], [ vm_endspace ], [ vm_prompt, "In each Province with a Temple, replace a Unit with a Raja." ], - [ vm_space, true, 999, 999, (s)=>has_temple(s) && has_units_enemy_faction(s) ], - [ vm_piece, false, 1, 1, (p,s)=>is_enemy_unit(p) && is_piece_in_event_space(p) ], + [ vm_space, true, 0, 999, (s)=>has_temple(s) && has_units_enemy_faction(s) ], + [ vm_piece, false, 0, 1, (p,s)=>is_enemy_unit(p) && is_piece_in_event_space(p) ], [ vm_remove ], [ vm_auto_place, false, 0, false, VE, ELITE ], [ vm_endpiece ], @@ -6031,7 +6033,7 @@ CODE[30 * 2 + 1] = [ CODE[31 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], [ vm_prompt, "Free Migrate in a Province adjacent to Vijayanagara." ], - [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_VIJAYANAGARA, s)) ], + [ vm_space, true, 0, 1, (s)=>(is_adjacent_to_city(C_VIJAYANAGARA, s)) ], [ vm_mark_space ], [ vm_free_migrate ], [ vm_clean_p ], @@ -6048,11 +6050,11 @@ CODE[31 * 2 + 0] = [ CODE[31 * 2 + 1] = [ [ vm_current, DS ], [ vm_prompt, "Remove a Fort adjacent to Vijayanagara" ], - [ vm_piece, false, 1, 1, (p,s)=>(is_fort(p) && is_adjacent_to_city(C_VIJAYANAGARA, piece_space(p))) ], + [ vm_piece, false, 0, 1, (p,s)=>(is_fort(p) && is_adjacent_to_city(C_VIJAYANAGARA, piece_space(p))) ], [ vm_remove ], [ vm_endpiece ], [ vm_prompt, "Remove a Temple adjacent to Vijayanagara" ], - [ vm_piece, false, 1, 1, (p,s)=>(is_temple(p) && is_adjacent_to_city(C_VIJAYANAGARA, piece_space(p))) ], + [ vm_piece, false, 0, 1, (p,s)=>(is_temple(p) && is_adjacent_to_city(C_VIJAYANAGARA, piece_space(p))) ], [ vm_remove ], [ vm_endpiece ], [ vm_remove_influence, BK ], -- cgit v1.2.3