summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt47
-rw-r--r--rules.js58
2 files changed, 105 insertions, 0 deletions
diff --git a/events.txt b/events.txt
index 921084c..bf830c9 100644
--- a/events.txt
+++ b/events.txt
@@ -1,6 +1,7 @@
# Events for Vijayanagara
EVENT 1
+ stay_eligible
current REBEL_FACTIONS
prompt "Move all Governors to Provinces adjacent to Delhi."
piece all (is_governor(p) && !set_has(SPACES[S_DELHI].adjacent, piece_space(p)))
@@ -10,6 +11,7 @@ EVENT 1
endpiece
SHADED 1
+ stay_eligible
current DS
prompt "Select a Space to move in Units and Attack for free."
space 1 s
@@ -23,6 +25,7 @@ SHADED 1
endspace
EVENT 2
+ stay_eligible
prompt "Remove up to 2 Delhi Sultanate Units in both Mountain Passes and Punjab."
space 2 ((s === S_MOUNTAIN_PASSES || s === S_PUNJAB) && has_ds_unit(s))
piece 2 is_ds_unit(p) && is_piece_in_event_space(p)
@@ -31,6 +34,7 @@ EVENT 2
endspace
SHADED 2
+ stay_eligible
current DS
prompt "Attack for free in Mountain Passes or Punjab"
space 1 ((s === S_MOUNTAIN_PASSES || s === S_PUNJAB) && has_ds_unit(s) && has_piece(s, MI, TROOPS))
@@ -69,6 +73,7 @@ SHADED 3
endspace
EVENT 4
+ stay_eligible
current REBEL_FACTIONS
prompt `Replace 1 Governor with an Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`
piece 1 is_governor(p)
@@ -79,11 +84,13 @@ EVENT 4
endpiece
SHADED 4
+ stay_eligible
current DS
prompt "Govern, without location requirements."
govern
EVENT 5
+ stay_eligible
current REBEL_FACTIONS
prompt `Replace up to 3 Delhi Sultanate Units with Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`
piece_undo_opt 3 (is_adjacent_to_city(C_CHITTOR, piece_space(p)) && can_place_piece(piece_space(p), game.current, ELITE) && is_ds_unit(p))
@@ -98,6 +105,7 @@ EVENT 5
endspace
SHADED 5
+ stay_eligible
current DS
prompt "Replace up to 3 opposing Units adjacent to Chittor."
piece_undo_opt 3 (is_adjacent_to_city(C_CHITTOR, piece_space(p)) && can_place_piece(piece_space(p), DS, TROOPS) && is_enemy_piece(p))
@@ -112,6 +120,7 @@ SHADED 5
endspace
EVENT 6
+ stay_eligible
current REBEL_FACTIONS
prompt "Select a Province adjacent to Warangal to remove a Tributary marker."
space_opt 1 (is_adjacent_to_city(C_WARANGAL, s))
@@ -121,12 +130,14 @@ EVENT 6
endspace
SHADED 6
+ stay_eligible
current DS
prompt "Select four contiguous spaces, finishing adjacent to Warangal"
shaded_6
shaded_6_2
EVENT 7
+ stay_eligible
current REBEL_FACTIONS
prompt `Place up to 2 ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}s in Tamilakam.`
space 1 (s === S_TAMILAKAM)
@@ -135,6 +146,7 @@ EVENT 7
cav_resources 3
SHADED 7
+ stay_eligible
current DS
prompt `Place up to 4 Troops and a Governor in Tamilakam.`
space 1 (s === S_TAMILAKAM)
@@ -184,6 +196,7 @@ SHADED 9
endspace
EVENT 10
+ stay_eligible
prompt "Move up to 4 Delhi Sultanate Units into adjacent Provinces."
piece_undo_opt 4 is_ds_unit(p)
prompt "Move Delhi Sultanate Unit into an adjacent space."
@@ -194,6 +207,7 @@ EVENT 10
resources DS -5
SHADED 10
+ stay_eligible
current DS
prompt "Move any Qasbah to Spaces containing Governors."
piece_opt all is_qasbah(p)
@@ -207,12 +221,14 @@ SHADED 10
endspace
EVENT 11
+ stay_eligible
prompt "Place up to two Mongol Invaders in each of Mtn Passes and Punjab."
space_opt 2 (s === S_PUNJAB || s === S_MOUNTAIN_PASSES)
place_opt 2 MI TROOPS
endspace
SHADED 11
+ stay_eligible
current DS
prompt "Remove 4 Mongol Invaders."
piece 4 is_mongol_invader(p)
@@ -303,6 +319,7 @@ SHADED 14
endspace
EVENT 15
+ stay_eligible
prompt "Replace Governors with Rebelling Amirs in Provinces adjacent to Devagiri."
piece_opt all is_adjacent_to_city(C_DEVAGIRI, piece_space(p)) && can_place_piece(piece_space(p), BK, ELITE) && is_governor(p)
set_piece_space
@@ -317,6 +334,7 @@ EVENT 15
endspace
SHADED 15
+ stay_eligible
prompt "Replace an Amir with a Governor and place a Tributary marker in a Province adjacent to Devagiri."
space 1 is_adjacent_to_city(C_DEVAGIRI, s) && can_place_piece(s, DS, ELITE) && !is_tributary(s)
asm game.vm.p = find_piece(game.vm.s, BK, ELITE)
@@ -326,6 +344,7 @@ SHADED 15
endspace
EVENT 16
+ stay_eligible
current BK
asm game.vm.count = 0
repeat 3
@@ -341,6 +360,7 @@ EVENT 16
endspace
SHADED 16
+ stay_eligible
current [DS VE]
if game.current === DS
prompt "Free March into a Province with a Fort, then remove the Fort."
@@ -381,6 +401,7 @@ SHADED 17
resources BK -2
EVENT 18
+ stay_eligible
if n_province_with_both_rebels() > 0
repeat (n_province_with_both_rebels())
add_influence BK
@@ -390,6 +411,7 @@ EVENT 18
endif
SHADED 18
+ stay_eligible
current [DS VE]
prompt `Replace an Amir with a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`
piece_opt 1 is_amir(p) && can_place_piece(s, game.current, ELITE) && is_piece_on_map(p)
@@ -446,11 +468,13 @@ SHADED 20
endspace
EVENT 21
+ stay_eligible
current REBEL_FACTIONS
prompt "Move any Troops from Gondwana and Madhyadesh to Delhi."
move_to S_DELHI (is_troop(p) && (piece_space(p) === S_GONDWANA || piece_space(p) === S_MADHYADESH))
SHADED 21
+ stay_eligible
current DS
campaign
prompt "Govern, Attack or Demande Obedience in selected Province."
@@ -459,6 +483,7 @@ SHADED 21
endspace
EVENT 22
+ stay_eligible
current REBEL_FACTIONS
prompt `Build in any province with a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`
space 1 can_build_in_space(s)
@@ -466,6 +491,7 @@ EVENT 22
endspace
SHADED 22
+ stay_eligible
current DS
prompt "Place 1 Troops in one space."
space_opt 1 can_place_piece(s, DS, TROOPS)
@@ -507,6 +533,7 @@ SHADED 23
steal (game.current) VE 2
EVENT 24
+ stay_eligible
current VE
prompt "Free Migrate in up to 2 Provinces."
space_opt 2 can_migrate_in_space(s)
@@ -524,6 +551,7 @@ EVENT 24
SHADED 24
+ stay_eligible
current [DS BK]
prompt "Place up to 2 Units in each Province with a Temple."
space_opt all has_temple(s)
@@ -531,10 +559,12 @@ SHADED 24
endspace
EVENT 25
+ stay_eligible
current REBEL_FACTIONS
event_25
SHADED 25
+ stay_eligible
current DS
prompt "Place up to 2 Troops in 3 Provinces adjance to Goa or Warangal."
space_opt 3 (is_adjacent_to_city(C_GOA, s) || is_adjacent_to_city(C_WARANGAL, s))
@@ -547,6 +577,7 @@ SHADED 25
endspace
EVENT 26
+ stay_eligible
log "NOT IMPLEMENTED"
EVENT 27
@@ -576,6 +607,7 @@ SHADED 27
endspace
EVENT 28
+ stay_eligible
add_influence BK
remove_influence VE
current BK
@@ -590,6 +622,7 @@ EVENT 28
endspace
SHADED 28
+ stay_eligible
current [DS VE]
if (game.current === DS)
prompt "In a space with Bahmani presence, you may add 2 Troops and free Attack without defenders."
@@ -606,6 +639,7 @@ SHADED 28
endspace
EVENT 29
+ stay_eligible
current BK
gain_cavalry 3
prompt "Execute a free Limited Attack."
@@ -614,6 +648,7 @@ EVENT 29
endspace
SHADED 29
+ stay_eligible
shaded_29
prompt "Execute a free Limited Attack."
space 1 (can_attack_in_space(s))
@@ -621,6 +656,7 @@ SHADED 29
endspace
EVENT 30
+ stay_eligible
current BK
prompt "Free Attack in each Province with a fort, without defenders."
space_opt 5 (has_fort(s) && can_attack_in_space(s))
@@ -628,6 +664,7 @@ EVENT 30
endspace
SHADED 30
+ stay_eligible
prompt "Free limited Attak, without defenders."
space 1 (can_attack_in_space(s))
free_attack
@@ -661,6 +698,7 @@ SHADED 31
remove_influence VE
EVENT 32
+ stay_eligible
current REBEL_FACTIONS
add_influence (game.current)
remove_influence (other_rebel_faction(game.current))
@@ -673,10 +711,12 @@ EVENT 32
endpiece
SHADED 32
+ stay_eligible
remove_influence BK
remove_influence VE
EVENT 33
+ stay_eligible
current (has_majority_goa())
prompt "Remove up to 3 Opposing Units adjacent to Goa."
piece_opt 3 (is_adjacent_to_city(C_GOA, piece_space(p)) && is_enemy_piece(p))
@@ -685,21 +725,25 @@ EVENT 33
resources (game.current) 2
SHADED 33
+ stay_eligible
current DS
prompt "Reduce Rebel Factions Resources by half."
resources_opt BK (-Math.floor(game.resources[BK]/2))
resources_opt VE (-Math.floor(game.resources[VE]/2))
EVENT 34
+ stay_eligible
current VE
steal VE BK 2
steal_cavalry VE BK 2
SHADED 34
+ stay_eligible
current BK
conspire_trade
EVENT 35
+ stay_eligible
current REBEL_FACTIONS
add_influence (game.current)
prompt `Place a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]} in up to 3 Provinces with ${PIECE_FACTION_TYPE_NAME[other_rebel_faction(game.current)][ELITE]}.`
@@ -708,10 +752,12 @@ EVENT 35
endspace
SHADED 35
+ stay_eligible
remove_influence BK
remove_influence VE
EVENT 36
+ stay_eligible
current VE
asm game.vm.count = 0
repeat 4
@@ -723,6 +769,7 @@ EVENT 36
endrepeat
SHADED 36
+ stay_eligible
remove_influence VE
prompt "Remove up to 3 Rajas from the map."
piece_opt 3 is_raja(p) && is_piece_on_map(p)
diff --git a/rules.js b/rules.js
index 8a230f5..286059e 100644
--- a/rules.js
+++ b/rules.js
@@ -217,6 +217,7 @@ exports.setup = function (seed, scenario, _options) {
current: 0,
state: null,
succ: 0,
+ marked: 0,
cylinder: [ ELIGIBLE, ELIGIBLE, ELIGIBLE ],
resources: [ 12, 6, 7 ],
vp: [ 18, 0, 0 ],
@@ -359,6 +360,7 @@ function goto_card() {
adjust_eligibility(DS)
adjust_eligibility(BK)
adjust_eligibility(VE)
+ game.marked = 0
resume_event_card()
}
}
@@ -425,6 +427,9 @@ function adjust_eligibility(faction) {
game.cylinder[faction] = ELIGIBLE
else if (game.cylinder[faction] !== ELIGIBLE)
game.cylinder[faction] = INELIGIBLE
+
+ if (game.marked & (16 << faction))
+ game.cylinder[faction] = ELIGIBLE
}
function goto_pass() {
@@ -4176,6 +4181,12 @@ function vm_set_space() {
vm_next()
}
+function vm_stay_eligible() {
+ log("Marked " + faction_name[game.current] + " Eligible.")
+ game.marked |= (16 << game.current)
+ vm_next()
+}
+
// VM: PIECE ITERATOR
function vm_piece() {
@@ -5060,6 +5071,7 @@ const CODE = []
// EVENT 1
CODE[1 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, "Move all Governors to Provinces adjacent to Delhi." ],
[ vm_piece, false, 999, 999, (p,s)=>(is_governor(p) && !set_has(SPACES[S_DELHI].adjacent, piece_space(p))) ],
@@ -5072,6 +5084,7 @@ CODE[1 * 2 + 0] = [
// SHADED 1
CODE[1 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Select a Space to move in Units and Attack for free." ],
[ vm_space, true, 1, 1, (s)=>s ],
@@ -5088,6 +5101,7 @@ CODE[1 * 2 + 1] = [
// EVENT 2
CODE[2 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ 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_piece, false, 2, 2, (p,s)=>is_ds_unit(p) && is_piece_in_event_space(p) ],
@@ -5099,6 +5113,7 @@ CODE[2 * 2 + 0] = [
// SHADED 2
CODE[2 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Attack for free in Mountain Passes or Punjab" ],
[ vm_space, true, 1, 1, (s)=>((s === S_MOUNTAIN_PASSES || s === S_PUNJAB) && has_ds_unit(s) && has_piece(s, MI, TROOPS)) ],
@@ -5146,6 +5161,7 @@ CODE[3 * 2 + 1] = [
// EVENT 4
CODE[4 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, ()=>`Replace 1 Governor with an Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ],
[ vm_piece, false, 1, 1, (p,s)=>is_governor(p) ],
@@ -5159,6 +5175,7 @@ CODE[4 * 2 + 0] = [
// SHADED 4
CODE[4 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Govern, without location requirements." ],
[ vm_govern ],
@@ -5167,6 +5184,7 @@ CODE[4 * 2 + 1] = [
// EVENT 5
CODE[5 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, ()=>`Replace up to 3 Delhi Sultanate Units with Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ],
[ vm_piece, true, 0, 3, (p,s)=>(is_adjacent_to_city(C_CHITTOR, piece_space(p)) && can_place_piece(piece_space(p), game.current, ELITE) && is_ds_unit(p)) ],
@@ -5184,6 +5202,7 @@ CODE[5 * 2 + 0] = [
// SHADED 5
CODE[5 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Replace up to 3 opposing Units adjacent to Chittor." ],
[ vm_piece, true, 0, 3, (p,s)=>(is_adjacent_to_city(C_CHITTOR, piece_space(p)) && can_place_piece(piece_space(p), DS, TROOPS) && is_enemy_piece(p)) ],
@@ -5201,6 +5220,7 @@ CODE[5 * 2 + 1] = [
// EVENT 6
CODE[6 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, "Select a Province adjacent to Warangal to remove a Tributary marker." ],
[ vm_space, true, 0, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s)) ],
@@ -5213,6 +5233,7 @@ CODE[6 * 2 + 0] = [
// SHADED 6
CODE[6 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Select four contiguous spaces, finishing adjacent to Warangal" ],
[ vm_shaded_6 ],
@@ -5222,6 +5243,7 @@ CODE[6 * 2 + 1] = [
// EVENT 7
CODE[7 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ 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) ],
@@ -5233,6 +5255,7 @@ CODE[7 * 2 + 0] = [
// SHADED 7
CODE[7 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, ()=>`Place up to 4 Troops and a Governor in Tamilakam.` ],
[ vm_space, true, 1, 1, (s)=>(s === S_TAMILAKAM) ],
@@ -5297,6 +5320,7 @@ CODE[9 * 2 + 1] = [
// EVENT 10
CODE[10 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_prompt, "Move up to 4 Delhi Sultanate Units into adjacent Provinces." ],
[ vm_piece, true, 0, 4, (p,s)=>is_ds_unit(p) ],
[ vm_prompt, "Move Delhi Sultanate Unit into an adjacent space." ],
@@ -5310,6 +5334,7 @@ CODE[10 * 2 + 0] = [
// SHADED 10
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) ],
@@ -5326,6 +5351,7 @@ CODE[10 * 2 + 1] = [
// EVENT 11
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 ],
@@ -5335,6 +5361,7 @@ CODE[11 * 2 + 0] = [
// SHADED 11
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) ],
@@ -5446,6 +5473,7 @@ CODE[14 * 2 + 1] = [
// EVENT 15
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_set_piece_space ],
@@ -5463,6 +5491,7 @@ CODE[15 * 2 + 0] = [
// SHADED 15
CODE[15 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_prompt, "Replace an Amir with a Governor and place a Tributary marker in a Province adjacent to Devagiri." ],
[ vm_space, true, 1, 1, (s)=>is_adjacent_to_city(C_DEVAGIRI, s) && can_place_piece(s, DS, ELITE) && !is_tributary(s) ],
[ vm_asm, ()=>game.vm.p = find_piece(game.vm.s, BK, ELITE) ],
@@ -5475,6 +5504,7 @@ CODE[15 * 2 + 1] = [
// EVENT 16
CODE[16 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, BK ],
[ vm_asm, ()=>game.vm.count = 0 ],
[ vm_repeat, 3 ],
@@ -5493,6 +5523,7 @@ CODE[16 * 2 + 0] = [
// SHADED 16
CODE[16 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, [DS, VE] ],
[ vm_if, ()=>game.current === DS ],
[ vm_prompt, "Free March into a Province with a Fort, then remove the Fort." ],
@@ -5542,6 +5573,7 @@ CODE[17 * 2 + 1] = [
// EVENT 18
CODE[18 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_if, ()=>n_province_with_both_rebels() > 0 ],
[ vm_repeat, ()=>(n_province_with_both_rebels()) ],
[ vm_add_influence, BK ],
@@ -5554,6 +5586,7 @@ CODE[18 * 2 + 0] = [
// SHADED 18
CODE[18 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, [DS, VE] ],
[ vm_prompt, ()=>`Replace an Amir with a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ],
[ vm_piece, false, 0, 1, (p,s)=>is_amir(p) && can_place_piece(s, game.current, ELITE) && is_piece_on_map(p) ],
@@ -5625,6 +5658,7 @@ CODE[20 * 2 + 1] = [
// EVENT 21
CODE[21 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, "Move any Troops from Gondwana and Madhyadesh to Delhi." ],
[ vm_move_to, S_DELHI, (p,s)=>(is_troop(p) && (piece_space(p) === S_GONDWANA || piece_space(p) === S_MADHYADESH)) ],
@@ -5633,6 +5667,7 @@ CODE[21 * 2 + 0] = [
// SHADED 21
CODE[21 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_campaign ],
[ vm_prompt, "Govern, Attack or Demande Obedience in selected Province." ],
@@ -5644,6 +5679,7 @@ CODE[21 * 2 + 1] = [
// EVENT 22
CODE[22 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_prompt, ()=>`Build in any province with a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ],
[ vm_space, true, 1, 1, (s)=>can_build_in_space(s) ],
@@ -5654,6 +5690,7 @@ CODE[22 * 2 + 0] = [
// SHADED 22
CODE[22 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Place 1 Troops in one space." ],
[ vm_space, true, 0, 1, (s)=>can_place_piece(s, DS, TROOPS) ],
@@ -5704,6 +5741,7 @@ CODE[23 * 2 + 1] = [
// EVENT 24
CODE[24 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, VE ],
[ vm_prompt, "Free Migrate in up to 2 Provinces." ],
[ vm_space, true, 0, 2, (s)=>can_migrate_in_space(s) ],
@@ -5723,6 +5761,7 @@ CODE[24 * 2 + 0] = [
// SHADED 24
CODE[24 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, [DS, BK] ],
[ vm_prompt, "Place up to 2 Units in each Province with a Temple." ],
[ vm_space, true, 0, 999, (s)=>has_temple(s) ],
@@ -5733,6 +5772,7 @@ CODE[24 * 2 + 1] = [
// EVENT 25
CODE[25 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_event_25 ],
[ vm_return ],
@@ -5740,6 +5780,7 @@ CODE[25 * 2 + 0] = [
// SHADED 25
CODE[25 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Place up to 2 Troops in 3 Provinces adjance to Goa or Warangal." ],
[ vm_space, true, 0, 3, (s)=>(is_adjacent_to_city(C_GOA, s) || is_adjacent_to_city(C_WARANGAL, s)) ],
@@ -5755,6 +5796,7 @@ CODE[25 * 2 + 1] = [
// EVENT 26
CODE[26 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_log, "NOT IMPLEMENTED" ],
[ vm_return ],
]
@@ -5793,6 +5835,7 @@ CODE[27 * 2 + 1] = [
// EVENT 28
CODE[28 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_add_influence, BK ],
[ vm_remove_influence, VE ],
[ vm_current, BK ],
@@ -5810,6 +5853,7 @@ CODE[28 * 2 + 0] = [
// SHADED 28
CODE[28 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, [DS, VE] ],
[ vm_if, ()=>(game.current === DS) ],
[ vm_prompt, "In a space with Bahmani presence, you may add 2 Troops and free Attack without defenders." ],
@@ -5829,6 +5873,7 @@ CODE[28 * 2 + 1] = [
// EVENT 29
CODE[29 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, BK ],
[ vm_gain_cavalry, ()=>3 ],
[ vm_prompt, "Execute a free Limited Attack." ],
@@ -5840,6 +5885,7 @@ CODE[29 * 2 + 0] = [
// SHADED 29
CODE[29 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_shaded_29 ],
[ vm_prompt, "Execute a free Limited Attack." ],
[ vm_space, true, 1, 1, (s)=>(can_attack_in_space(s)) ],
@@ -5850,6 +5896,7 @@ CODE[29 * 2 + 1] = [
// EVENT 30
CODE[30 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, BK ],
[ vm_prompt, "Free Attack in each Province with a fort, without defenders." ],
[ vm_space, true, 0, 5, (s)=>(has_fort(s) && can_attack_in_space(s)) ],
@@ -5860,6 +5907,7 @@ CODE[30 * 2 + 0] = [
// SHADED 30
CODE[30 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_prompt, "Free limited Attak, without defenders." ],
[ vm_space, true, 1, 1, (s)=>(can_attack_in_space(s)) ],
[ vm_free_attack ],
@@ -5902,6 +5950,7 @@ CODE[31 * 2 + 1] = [
// EVENT 32
CODE[32 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_add_influence, ()=>(game.current) ],
[ vm_remove_influence, ()=>(other_rebel_faction(game.current)) ],
@@ -5917,6 +5966,7 @@ CODE[32 * 2 + 0] = [
// SHADED 32
CODE[32 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_remove_influence, BK ],
[ vm_remove_influence, VE ],
[ vm_return ],
@@ -5924,6 +5974,7 @@ CODE[32 * 2 + 1] = [
// EVENT 33
CODE[33 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, ()=>(has_majority_goa()) ],
[ vm_prompt, "Remove up to 3 Opposing Units adjacent to Goa." ],
[ vm_piece, false, 0, 3, (p,s)=>(is_adjacent_to_city(C_GOA, piece_space(p)) && is_enemy_piece(p)) ],
@@ -5935,6 +5986,7 @@ CODE[33 * 2 + 0] = [
// SHADED 33
CODE[33 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, DS ],
[ vm_prompt, "Reduce Rebel Factions Resources by half." ],
[ vm_resources, true, BK, ()=>(-Math.floor(game.resources[BK]/2)) ],
@@ -5944,6 +5996,7 @@ CODE[33 * 2 + 1] = [
// EVENT 34
CODE[34 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, VE ],
[ vm_steal, VE, BK, 2 ],
[ vm_steal_cavalry, VE, BK, 2 ],
@@ -5952,6 +6005,7 @@ CODE[34 * 2 + 0] = [
// SHADED 34
CODE[34 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_current, BK ],
[ vm_conspire_trade ],
[ vm_return ],
@@ -5959,6 +6013,7 @@ CODE[34 * 2 + 1] = [
// EVENT 35
CODE[35 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, REBEL_FACTIONS ],
[ vm_add_influence, ()=>(game.current) ],
[ vm_prompt, ()=>`Place a ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]} in up to 3 Provinces with ${PIECE_FACTION_TYPE_NAME[other_rebel_faction(game.current)][ELITE]}.` ],
@@ -5970,6 +6025,7 @@ CODE[35 * 2 + 0] = [
// SHADED 35
CODE[35 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_remove_influence, BK ],
[ vm_remove_influence, VE ],
[ vm_return ],
@@ -5977,6 +6033,7 @@ CODE[35 * 2 + 1] = [
// EVENT 36
CODE[36 * 2 + 0] = [
+ [ vm_stay_eligible ],
[ vm_current, VE ],
[ vm_asm, ()=>game.vm.count = 0 ],
[ vm_repeat, 4 ],
@@ -5991,6 +6048,7 @@ CODE[36 * 2 + 0] = [
// SHADED 36
CODE[36 * 2 + 1] = [
+ [ vm_stay_eligible ],
[ vm_remove_influence, VE ],
[ vm_prompt, "Remove up to 3 Rajas from the map." ],
[ vm_piece, false, 0, 3, (p,s)=>is_raja(p) && is_piece_on_map(p) ],