summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js32
1 files changed, 29 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 1ba60fe..1a3647d 100644
--- a/rules.js
+++ b/rules.js
@@ -258,7 +258,7 @@ exports.setup = function (seed, scenario, _options) {
}
function setup_deck() {
- game.deck = [ 35, 29, 28, 24, 32, 23, 8, 7, 6, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
+ game.deck = [ 35, 29, 18, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
}
function setup_standard() {
@@ -2578,6 +2578,10 @@ function is_ds_unit(p) {
return (is_piece(p, DS, ELITE) || is_piece(p, DS, TROOPS))
}
+function is_amir(p) {
+ return piece_faction(p) === BK && piece_type(p) === ELITE
+}
+
function is_raja(p) {
return piece_faction(p) === VE && piece_type(p) === ELITE
}
@@ -2610,6 +2614,14 @@ function has_majority_goa() {
return c.filter(n => n === max).length > 1 ? 1 : c.indexOf(max)
}
+function n_province_with_both_rebels() {
+ let n = 0
+ for (let s = first_space; s <= last_province; ++s) {
+ if (has_piece_faction(s, VE) && has_piece_faction(s, BK))
+ n += 1
+ }
+ return n
+}
/* CAVALRY */
@@ -4334,13 +4346,27 @@ CODE[17 * 2 + 1] = [
// EVENT 18
CODE[18 * 2 + 0] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_if, ()=>n_province_with_both_rebels() > 0 ],
+ [ vm_repeat, ()=>(n_province_with_both_rebels()) ],
+ [ vm_add_influence, BK ],
+ [ vm_endrepeat ],
+ [ vm_else ],
+ [ vm_log, "No Province shared." ],
+ [ vm_endif ],
[ vm_return ],
]
// SHADED 18
CODE[18 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ 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) ],
+ [ vm_set_piece_space ],
+ [ vm_remove ],
+ [ vm_auto_place, false, 0, false, ()=>(game.current), ELITE ],
+ [ vm_set_space, -1 ],
+ [ vm_endpiece ],
+ [ vm_remove_influence, BK ],
[ vm_return ],
]