summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-01-22 20:54:34 -0500
committerJoël Simoneau <simoneaujoel@gmail.com>2025-01-22 20:54:34 -0500
commita08c374cda70b94d0e8b5c48df862108180424c4 (patch)
tree4ed58cfa8e10e130802a50e2c7d204bc961ed13a /rules.js
parent435a5c4cc61da7470ad2e23e7db72d6a81d05c02 (diff)
downloadvijayanagara-a08c374cda70b94d0e8b5c48df862108180424c4.tar.gz
Event 19
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js37
1 files changed, 33 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index d3d2edc..fc55f62 100644
--- a/rules.js
+++ b/rules.js
@@ -258,7 +258,7 @@ exports.setup = function (seed, scenario, _options) {
}
function setup_deck() {
- game.deck = [ 9, 8, 7, 6, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
+ game.deck = [ 19, 8, 7, 6, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
}
function setup_standard() {
@@ -3845,6 +3845,19 @@ states.vm_steal = {
}
}
+// VM: CONTROL
+
+function vm_place_tributary() {
+ add_tributary(game.vm.s)
+ log("Placed Tributary marker in S" + game.vm.s)
+ vm_next()
+}
+
+function vm_remove_tributary() {
+ remove_tributary(game.vm.s)
+ log("Removed Tributary marker in S" + game.vm.s)
+ vm_next()
+}
// VM: BUILD
@@ -3983,7 +3996,7 @@ CODE[4 * 2 + 1] = [
// EVENT 5
CODE[5 * 2 + 0] = [
[ vm_current, REBEL_FACTIONS ],
- [ vm_prompt, ()=>`Replace up to three Delhi Sultanate Units with Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ],
+ [ 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)) ],
[ vm_set_piece_space ],
[ vm_remove ],
@@ -4224,13 +4237,29 @@ CODE[18 * 2 + 1] = [
// EVENT 19
CODE[19 * 2 + 0] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, REBEL_FACTIONS ],
+ [ vm_prompt, ()=>`Place up to 2 ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]} in Jaunpur and Bengal.` ],
+ [ vm_space, true, 0, 999, (s)=>(s === S_BENGAL || s === S_JAUNPUR) && can_place_piece(s, game.current, ELITE) ],
+ [ vm_place, false, 1, 2, ()=>(game.current), ELITE ],
+ [ vm_endspace ],
+ [ vm_prompt, "Remove a Tributary marker in Jaunpur or Bengal." ],
+ [ vm_space, true, 0, 1, (s)=>(s === S_BENGAL || s === S_JAUNPUR) && is_tributary(s) ],
+ [ vm_remove_tributary ],
+ [ vm_endspace ],
[ vm_return ],
]
// SHADED 19
CODE[19 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, DS ],
+ [ vm_prompt, ()=>`Place up to 4 ${PIECE_FACTION_TYPE_NAME[game.current][TROOPS]} in Jaunpur and Bengal.` ],
+ [ vm_space, true, 0, 999, (s)=>(s === S_BENGAL || s === S_JAUNPUR) && can_place_piece(s, game.current, TROOPS) ],
+ [ vm_place, false, 1, 4, ()=>(game.current), TROOPS ],
+ [ vm_endspace ],
+ [ vm_prompt, "Place a Tributary marker in Jaunpur or Bengal." ],
+ [ vm_space, true, 0, 1, (s)=>(s === S_BENGAL || s === S_JAUNPUR) && !is_tributary(s) ],
+ [ vm_place_tributary ],
+ [ vm_endspace ],
[ vm_return ],
]