summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt27
-rw-r--r--rules.js39
2 files changed, 61 insertions, 5 deletions
diff --git a/events.txt b/events.txt
index 7d1415b..3a27b50 100644
--- a/events.txt
+++ b/events.txt
@@ -248,10 +248,33 @@ SHADED 12
endspace
EVENT 13
- log "NOT IMPLEMENTED"
+ current VE
+ asm game.vm.count = (Math.min((4 - game.inf[VE]), 2) * 2)
+ add_influence VE
+ add_influence VE
+ asm game.vm.placed = 0
+ repeat (game.vm.count)
+ prompt `Place up to ${game.vm.count-game.vm.placed} Rajas adjacent to Vijayanagara.`
+ space_opt 1 is_adjacent_to_city(C_VIJAYANAGARA, s) && can_place_piece(s, VE, ELITE)
+ auto_place VE ELITE
+ asm (game.vm.placed += 1)
+ endspace
+ endrepeat
SHADED 13
- log "NOT IMPLEMENTED"
+ prompt "Select a Province with Rajas adjacent to a Province with a Bahmani piece."
+ space 1 (has_piece(s, VE, ELITE) && SPACES[s].adjacent.some(ss => has_piece_faction(ss, BK)))
+ mark_space
+ endspace
+ prompt "Select a destination Province for the Rajas."
+ space 1 (is_adjacent(s, game.vm.m) && has_piece_faction(s, BK))
+ prompt "Move any Rajas to the adjacent Province."
+ piece all (is_raja(p) && (piece_space(p) === game.vm.m[0]))
+ move
+ endpiece
+ prompt "Make a free Attack against the Vijayanagara Empire there."
+ free_attack VE
+ endspace
EVENT 14
current VE
diff --git a/rules.js b/rules.js
index cf363f5..8de4676 100644
--- a/rules.js
+++ b/rules.js
@@ -4383,7 +4383,14 @@ function vm_free_attack() {
init_free_command("Attack", game.vm.s)
game.cmd.attacker = game.current
game.cmd.support_space = null
- goto_attack_select()
+
+ if (typeof vm_inst(1) !== "undefined") {
+ game.cmd.selected = []
+ game.cmd.target = vm_inst(1)
+ goto_attack_space()
+ } else {
+ goto_attack_select()
+ }
}
// VM: BUILD
@@ -4907,13 +4914,39 @@ CODE[12 * 2 + 1] = [
// EVENT 13
CODE[13 * 2 + 0] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_add_influence, VE ],
+ [ vm_add_influence, VE ],
+ [ vm_add_influence, VE ],
+ [ vm_current, VE ],
+ [ vm_asm, ()=>game.vm.count = (Math.min((4 - game.inf[VE]), 2) * 2) ],
+ [ vm_add_influence, VE ],
+ [ vm_add_influence, VE ],
+ [ vm_asm, ()=>game.vm.placed = 0 ],
+ [ vm_repeat, ()=>(game.vm.count) ],
+ [ vm_prompt, ()=>`Place up to ${game.vm.count-game.vm.placed} Rajas adjacent to Vijayanagara.` ],
+ [ vm_space, true, 0, 1, (s)=>is_adjacent_to_city(C_VIJAYANAGARA, s) && can_place_piece(s, VE, ELITE) ],
+ [ vm_auto_place, false, 0, false, VE, ELITE ],
+ [ vm_asm, ()=>(game.vm.placed += 1) ],
+ [ vm_endspace ],
+ [ vm_endrepeat ],
[ vm_return ],
]
// SHADED 13
CODE[13 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_prompt, "Select a Province with Rajas adjacent to a Province with a Bahmani piece." ],
+ [ vm_space, true, 1, 1, (s)=>(has_piece(s, VE, ELITE) && SPACES[s].adjacent.some(ss => has_piece_faction(ss, BK))) ],
+ [ vm_mark_space ],
+ [ vm_endspace ],
+ [ vm_prompt, "Select a destination Province for the Rajas." ],
+ [ vm_space, true, 1, 1, (s)=>(is_adjacent(s, game.vm.m) && has_piece_faction(s, BK)) ],
+ [ vm_prompt, "Move any Rajas to the adjacent Province." ],
+ [ vm_piece, false, 999, 999, (p,s)=>(is_raja(p) && (piece_space(p) === game.vm.m[0])) ],
+ [ vm_move ],
+ [ vm_endpiece ],
+ [ vm_prompt, "Make a free Attack against the Vijayanagara Empire there." ],
+ [ vm_free_attack, VE ],
+ [ vm_endspace ],
[ vm_return ],
]