summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-24 01:17:17 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-24 01:19:42 +0200
commit3820856482017e0f206b0481856a86a2b4fc589c (patch)
treeff57b98648670583d0796d6ee0cbe500f7502f75 /rules.js
parent1c90c9ab2b7a97078d6a853c9d37d19e8a437ec8 (diff)
downloadvijayanagara-3820856482017e0f206b0481856a86a2b4fc589c.tar.gz
Start client.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js75
1 files changed, 72 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 9c795a7..4cb186c 100644
--- a/rules.js
+++ b/rules.js
@@ -6,13 +6,71 @@ let view = null
/* DATA */
-const data = require("./data.js")
+// const data = require("./data.js")
+
+const space_name = [
+ "Andhra",
+ "Bengal",
+ "Gondwana",
+ "Gujarat",
+ "Jaunpur",
+ "Karnataka",
+ "Madhyadesh",
+ "Maharashtra",
+ "Malwa",
+ "Orissa",
+ "Rajput Kingdoms",
+ "Sindh",
+ "Tamilakam",
+ "Delhi",
+ "Mountain Passes",
+ "Punjab",
+ "Mongol Invaders",
+ "DS Available",
+ "BK Available",
+ "VE Available",
+]
+
+const S_ANDHRA = 0
+const S_BENGAL = 1
+const S_GONDWANA = 2
+const S_GUJARAT = 3
+const S_JAUNPUR = 4
+const S_KARNATAKA = 5
+const S_MADHYADESH = 6
+const S_MAHARASHTRA = 7
+const S_MALWA = 8
+const S_ORISSA = 9
+const S_RAJPUT_KINGDOMS = 10
+const S_SINDH = 11
+const S_TAMILAKAM = 12
+const S_DELHI = 13
+const S_MOUNTAIN_PASSES = 14
+const S_PUNJAB = 15
+const S_MONGOL_INVADERS = 16
+const S_DS_AVAILABLE = 17
+const S_BK_AVAILABLE = 18
+const S_VE_AVAILABLE = 19
+const S_BK_INF_2 = 20
+const S_BK_INF_4 = 21
+const S_VE_INF_1 = 22
+const S_VE_INF_2 = 23
+const S_VE_INF_3 = 24
+const S_VE_INF_4 = 25
// Factions
const DS = 0
const BK = 1
const VE = 2
+// Sequence of Play options
+const ELIGIBLE = 0
+const SOP_LIMITED_COMMAND = 1
+const SOP_COMMAND_DECREE = 2
+const SOP_EVENT_OR_COMMAND = 3
+const SOP_PASS = 4
+const INELIGIBLE = 5
+
const faction_name = [ "Delhi Sultanate", "Bahmani Kingdom", "Vijayanagara Empire" ]
// Role names
@@ -66,7 +124,11 @@ exports.view = function (state, role) {
actions: null,
log: game.log,
current: game.current,
- deck: [ this_card, deck_size ],
+ vp: [ 18, 0, 0 ],
+ resources: [ 12, 6, 7 ],
+ bk_inf: 0,
+ ve_inf: 0,
+ deck: [ this_card, deck_size, game.of_gods_and_kings ],
}
if (game.result) {
@@ -149,7 +211,14 @@ exports.setup = function (seed, scenario, _options) {
current: 0,
state: null,
- // TODO: control, pieces, and tracks
+ cylinder: [ ELIGIBLE, ELIGIBLE, ELIGIBLE ],
+ resources: [ 12, 6, 7 ],
+ bk_inf: 0,
+ ve_inf: 0,
+ tributary: 8191, // all 13 provinces
+ rebel: 0, // amir/raja rebel status
+ pieces: [], // piece locations
+
deck: [],
}