summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-01-23 13:44:15 -0500
committerJoël Simoneau <simoneaujoel@gmail.com>2025-01-23 13:44:15 -0500
commitdabd9cc37332434e4004f5f448ada4c32d74fc2d (patch)
tree3d599d9369cd25339337d1492536d186fd07a434
parent4942907e4c771c8fe81a9693efec42e15d540bf8 (diff)
downloadvijayanagara-dabd9cc37332434e4004f5f448ada4c32d74fc2d.tar.gz
Event 36.
-rw-r--r--events.txt16
-rw-r--r--rules.js29
2 files changed, 39 insertions, 6 deletions
diff --git a/events.txt b/events.txt
index 40101a3..88afc7c 100644
--- a/events.txt
+++ b/events.txt
@@ -370,7 +370,19 @@ SHADED 35
log "NOT IMPLEMENTED"
EVENT 36
- log "NOT IMPLEMENTED"
+ current VE
+ 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)
+ auto_place VE ELITE
+ asm (game.vm.count += 1)
+ endspace
+ endrepeat
SHADED 36
- log "NOT IMPLEMENTED"
+ remove_influence VE
+ prompt "Remove up to 3 Rajas from the map."
+ piece_opt 3 is_raja(p) && is_piece_on_map(p)
+ remove
+ endpiece
diff --git a/rules.js b/rules.js
index d7d97d6..1a209cb 100644
--- a/rules.js
+++ b/rules.js
@@ -258,7 +258,7 @@ exports.setup = function (seed, scenario, _options) {
}
function setup_deck() {
- game.deck = [ 30, 29, 28, 27, 32, 23, 8, 7, 6, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
+ game.deck = [ 36, 29, 28, 27, 32, 23, 8, 7, 6, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
}
function setup_standard() {
@@ -2562,8 +2562,12 @@ function is_ds_unit(p) {
return (is_piece(p, DS, ELITE) || is_piece(p, DS, TROOPS))
}
+function is_raja(p) {
+ return piece_faction(p) === VE && piece_type(p) === ELITE
+}
+
function is_qasbah(p) {
- return piece_name(p) === "Qasbah"
+ return piece_faction(p) === DS && piece_type(p) === DISC
}
function is_temple(p) {
@@ -3414,6 +3418,11 @@ function goto_vm(proc) {
vm_exec()
}
+function vm_asm() {
+ vm_operand(1)
+ vm_next()
+}
+
function vm_current() {
if (vm_operand(1) !== game.current)
game.state = "vm_current"
@@ -4577,12 +4586,24 @@ CODE[35 * 2 + 1] = [
// EVENT 36
CODE[36 * 2 + 0] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, VE ],
+ [ 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_auto_place, false, 0, false, VE, ELITE ],
+ [ vm_asm, ()=>(game.vm.count += 1) ],
+ [ vm_endspace ],
+ [ vm_endrepeat ],
[ vm_return ],
]
// SHADED 36
CODE[36 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ 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) ],
+ [ vm_remove ],
+ [ vm_endpiece ],
[ vm_return ],
]