diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-01-29 22:12:35 -0500 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-01-29 22:12:35 -0500 |
commit | 36e49ee394e1df50e5434051f33d1d5a3eef0d5d (patch) | |
tree | 1a63472b3740471c7d66f1b049e37b7f327ca82f | |
parent | b04313ff35213450d4c467017bd42aa19dc13e8c (diff) | |
download | vijayanagara-36e49ee394e1df50e5434051f33d1d5a3eef0d5d.tar.gz |
Event 16.
-rw-r--r-- | events.txt | 33 | ||||
-rw-r--r-- | rules.js | 41 |
2 files changed, 68 insertions, 6 deletions
@@ -196,10 +196,37 @@ SHADED 15 endspace EVENT 16 - log "NOT IMPLEMENTED" + current BK + asm game.vm.count = 0 + repeat 3 + prompt `Place up to ${3-game.vm.count} Amirs adjacent to Gulbarga.` + space_opt 1 is_adjacent_to_city(C_GULBARGA, s) && can_place_piece(s, BK, ELITE) + auto_place BK ELITE + asm (game.vm.count += 1) + endspace + endrepeat + prompt "Place a Fort adjacent to Gulbarga." + space 1 is_adjacent_to_city(C_GULBARGA, s) && can_place_piece(s, BK, DISC) + auto_place BK DISC + endspace SHADED 16 - log "NOT IMPLEMENTED" + current [DS VE] + if game.current === DS + prompt "Free March into a Province with a Fort, then remove the Fort." + space_opt 1 has_piece(s, BK, DISC) && can_march_in_space(s) + free_march + asm game.vm.p = find_piece(game.vm.s, BK, DISC) + remove + endspace + else + prompt "Free Migrate into a Province with a Fort, then remove the Fort." + space_opt 1 has_piece(s, BK, DISC) && can_migrate_in_space(s) + free_migrate + asm game.vm.p = find_piece(game.vm.s, BK, DISC) + remove + endspace + endif EVENT 17 log "NOT IMPLEMENTED" @@ -429,7 +456,7 @@ EVENT 36 asm game.vm.count = 0 repeat 4 prompt `Place up to ${4-game.vm.count} Rajas adjacent to Chittor.` - space_opt 1 is_adjacent_to_city(C_CHITTOR, s) + space_opt 1 is_adjacent_to_city(C_CHITTOR, s) && can_place_piece(s, VE, ELITE) auto_place VE ELITE asm (game.vm.count += 1) endspace @@ -3994,6 +3994,14 @@ function vm_free_govern() { goto_govern_space() } +// VM: MARCH + +function vm_free_march() { + init_free_command("March", game.vm.s) + game.cmd.pieces = [] + goto_march_space() +} + // VM: MIGRATE function vm_free_migrate() { @@ -4343,13 +4351,40 @@ CODE[15 * 2 + 1] = [ // EVENT 16 CODE[16 * 2 + 0] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_current, BK ], + [ vm_asm, ()=>game.vm.count = 0 ], + [ vm_repeat, 3 ], + [ vm_prompt, ()=>`Place up to ${3-game.vm.count} Amirs adjacent to Gulbarga.` ], + [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_GULBARGA, s) && can_place_piece(s, BK, ELITE) ], + [ vm_auto_place, false, 0, false, BK, ELITE ], + [ vm_asm, ()=>(game.vm.count += 1) ], + [ 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_auto_place, false, 0, false, BK, DISC ], + [ vm_endspace ], [ vm_return ], ] // SHADED 16 CODE[16 * 2 + 1] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_current, [DS, VE] ], + [ vm_if, ()=>game.current === DS ], + [ vm_prompt, "Free March into a Province with a Fort, then remove the Fort." ], + [ vm_space, true, 0, 1, (s)=>has_piece(s, BK, DISC) && can_march_in_space(s) ], + [ vm_free_march ], + [ vm_asm, ()=>game.vm.p = find_piece(game.vm.s, BK, DISC) ], + [ vm_remove ], + [ vm_endspace ], + [ vm_else ], + [ vm_prompt, "Free Migrate into a Province with a Fort, then remove the Fort." ], + [ vm_space, true, 0, 1, (s)=>has_piece(s, BK, DISC) && can_migrate_in_space(s) ], + [ vm_free_migrate ], + [ vm_asm, ()=>game.vm.p = find_piece(game.vm.s, BK, DISC) ], + [ vm_remove ], + [ vm_endspace ], + [ vm_endif ], [ vm_return ], ] @@ -4692,7 +4727,7 @@ CODE[36 * 2 + 0] = [ [ vm_asm, ()=>game.vm.count = 0 ], [ vm_repeat, 4 ], [ vm_prompt, ()=>`Place up to ${4-game.vm.count} Rajas adjacent to Chittor.` ], - [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_CHITTOR, s) ], + [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_CHITTOR, s) && can_place_piece(s, VE, ELITE) ], [ vm_auto_place, false, 0, false, VE, ELITE ], [ vm_asm, ()=>(game.vm.count += 1) ], [ vm_endspace ], |