summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js38
1 files changed, 29 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index 23ef4d5..5e89b65 100644
--- a/rules.js
+++ b/rules.js
@@ -267,28 +267,30 @@ exports.setup = function (seed, scenario, _options) {
return save_game()
}
-function suffle_all_events() {
+function shuffle_cards(a, b) {
let deck = []
- for (let i = 1; i <= 36; ++i)
+ for (let i = a; i <= b; ++i)
deck.push(i)
shuffle(deck)
return deck
}
function setup_deck() {
- let cards = suffle_all_events()
+ let cards = shuffle_cards(1, 36)
+ let mi_cards = shuffle_cards(37, 44).slice(0, 6).concat([48, 49])
let deck = []
let pile
let i = 0
for (let p = 0; p < 4; ++p) {
pile = cards.slice(i, i + 6)
+ pile = pile.concat(mi_cards.slice(p*2, p*2 + 2))
i += 6
shuffle(pile)
deck = deck.concat(pile)
- deck = deck.concat([45+p])
+ if (p<3)
+ deck = deck.concat([45+p])
}
-
game.deck = deck
}
@@ -350,11 +352,9 @@ function goto_card() {
} else if (this_card() >= 41 && this_card() <= 44) {
log_h1("Mongol Invaders C" + this_card())
goto_mongol_invaders(VE)
- } else if (this_card() >= 45 && this_card() <= 47) {
+ } else if (this_card() >= 45 && this_card() <= 49) {
log_h1("C" + this_card())
succession()
- } else if (this_card() === 48 || this_card() === 49) {
- log_h1("C" + this_card()) // Timurid Empire
} else {
log_h1("C" + this_card())
adjust_eligibility(DS)
@@ -565,13 +565,33 @@ function goto_tax() {
function succession() {
game.current = DS
game.succ += 1
- goto_vm(game.succ * 2 + 72)
+
+ if (game.succ <= 3)
+ goto_vm(game.succ * 2 + 72)
+ else if (game.succ === 4) {
+ timurid_step1()
+ } else if (game.succ === 5) {
+
+ }
}
function is_succession() {
return (game.vm && game.vm.fp > 72)
}
+function timurid_step1() {
+ let n = Math.floor(count_pieces(AVAILABLE, MI, TROOPS) / 2)
+
+ loge("Succession Crisis in Delhi.")
+ push_summary()
+ for (let i = 0; i < n; ++i) {
+ let p = find_piece(AVAILABLE, MI, TROOPS)
+ log_summary_place(p)
+ place_piece(p, S_MOUNTAIN_PASSES)
+ }
+ pop_summary()
+}
+
/* STATES */
states.eligible = {