summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-23 18:02:24 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commita479d98378de71855f9cd38e2da8204aef0158b8 (patch)
tree033ed28ef6ad3feb9194c57a35650f2a80e7a5f4 /play.js
parenta13ebf1939ca4418b7c830ee353083cf7b1b3d94 (diff)
downloadtime-of-crisis-a479d98378de71855f9cd38e2da8204aef0158b8.tar.gz
No solo. Fix region and barbarian order for player counts...
Diffstat (limited to 'play.js')
-rw-r--r--play.js179
1 files changed, 87 insertions, 92 deletions
diff --git a/play.js b/play.js
index da4efe3..972754a 100644
--- a/play.js
+++ b/play.js
@@ -72,25 +72,25 @@ const MACEDONIA = 3
const PANNONIA = 4
const THRACIA = 5
-const AEGYPTUS = 6
-const AFRICA = 7
-const HISPANIA = 8
+const BRITANNIA = 6
+const GALATIA = 7
+const SYRIA = 8
-const BRITANNIA = 9
-const GALATIA = 10
-const SYRIA = 11
+const AEGYPTUS = 9
+const AFRICA = 10
+const HISPANIA = 11
const ALAMANNI = 0
const FRANKS = 1
const GOTHS = 2
-const NOMADS = 3
-const SASSANIDS = 4
+const SASSANIDS = 3
+const NOMADS = 4
const ALAMANNI_HOMELAND = 12
const FRANKS_HOMELAND = 13
const GOTHS_HOMELAND = 14
-const NOMADS_HOMELAND = 15
-const SASSANIDS_HOMELAND = 16
+const SASSANIDS_HOMELAND = 15
+const NOMADS_HOMELAND = 16
const MARE_OCCIDENTALE = 17
const MARE_ORIENTALE = 18
@@ -102,8 +102,8 @@ const UNAVAILABLE = 22
const ARMY = 23
-const first_barbarian = [ 0, 10, 20, 31, 41 ]
-const last_barbarian = [ 9, 19, 30, 40, 52 ]
+const first_barbarian = [ 0, 10, 20, 31, 43 ]
+const last_barbarian = [ 9, 19, 30, 42, 52 ]
const first_governor = [ 0, 6, 12, 18 ]
const first_general = [ 0, 6, 12, 18 ]
@@ -118,17 +118,17 @@ const REGION_NAME = [
"Macedonia",
"Pannonia",
"Thracia",
- "Aegyptus",
- "Africa",
- "Hispania",
"Britannia",
"Galatia",
"Syria",
+ "Aegyptus",
+ "Africa",
+ "Hispania",
"Alamanni Homeland",
"Franks Homeland",
"Goths Homeland",
- "Nomads Homeland",
"Sassanids Homeland",
+ "Nomads Homeland",
"Mare Occidentale",
"Mare Orientale",
"Oceanus Atlanticus",
@@ -230,7 +230,7 @@ function set_has(set, item) {
}
const PLAYER_CLASS = [ "red", "blue", "yellow", "green" ]
-const BARBARIAN_CLASS = [ "alamanni", "franks", "goths", "nomads", "sassanids" ]
+const BARBARIAN_CLASS = [ "alamanni", "franks", "goths", "sassanids", "nomads" ]
const BOXES = {
"Thracia Support": [ 1502, 720, 258, 52 ],
@@ -281,17 +281,17 @@ const LAYOUT_XY = [
BOXES["Macedonia Capital"],
BOXES["Pannonia Capital"],
BOXES["Thracia Capital"],
- BOXES["Aegyptus Capital"],
- BOXES["Africa Capital"],
- BOXES["Hispania Capital"],
BOXES["Britannia Capital"],
BOXES["Galatia Capital"],
BOXES["Syria Capital"],
+ BOXES["Aegyptus Capital"],
+ BOXES["Africa Capital"],
+ BOXES["Hispania Capital"],
BOXES["Alamanni XY"],
BOXES["Franks XY"],
BOXES["Goths XY"],
- BOXES["Nomads XY"],
BOXES["Sassanids XY"],
+ BOXES["Nomads XY"],
BOXES["Mare Occidentale XY"],
BOXES["Mare Orientale XY"],
BOXES["Oceanus Atlanticus XY"],
@@ -305,20 +305,20 @@ const LAYOUT_SUPPORT = [
BOXES["Macedonia Support"],
BOXES["Pannonia Support"],
BOXES["Thracia Support"],
- BOXES["Aegyptus Support"],
- BOXES["Africa Support"],
- BOXES["Hispania Support"],
BOXES["Britannia Support"],
BOXES["Galatia Support"],
BOXES["Syria Support"],
+ BOXES["Aegyptus Support"],
+ BOXES["Africa Support"],
+ BOXES["Hispania Support"],
]
const LAYOUT_DICE = [
BOXES["Alamanni Dice"],
BOXES["Franks Dice"],
BOXES["Goths Dice"],
- BOXES["Nomads Dice"],
BOXES["Sassanids Dice"],
+ BOXES["Nomads Dice"],
]
const LAYOUT_QUAESTOR = [
@@ -357,6 +357,19 @@ const LAYOUT_ALAMANNI = [
[ -2, -1 ],
]
+const LAYOUT_NOMADS = [
+ [ 0, 0 ],
+ [ 1, 0 ],
+ [ 4, 0 ],
+ [ 5, 0 ],
+ [ -1, -1 ],
+ [ 2, 0 ],
+ [ 3, 0 ],
+ [ -2, -1 ],
+ [ -3, -1 ],
+ [ 0, 1 ],
+]
+
const LAYOUT_SASSANIDS = [
[ 0, 0 ],
[ -1, 0 ],
@@ -372,19 +385,6 @@ const LAYOUT_SASSANIDS = [
[ 0, 2 ],
]
-const LAYOUT_NOMADS = [
- [ 0, 0 ],
- [ 1, 0 ],
- [ 4, 0 ],
- [ 5, 0 ],
- [ -1, -1 ],
- [ 2, 0 ],
- [ 3, 0 ],
- [ -2, -1 ],
- [ -3, -1 ],
- [ 0, 1 ],
-]
-
const LAYOUT_ITALIA = [
//[ 0, -2 ],
[ -1, -2 ],
@@ -458,6 +458,46 @@ const LAYOUT_THRACIA = [
[ -1, -2 ],
]
+const LAYOUT_BRITANNIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 2, 0 ],
+ [ -2, 0 ],
+ [ -3, 0 ],
+ [ -3, 1 ],
+ [ -3, 2 ],
+ [ -2, 1 ],
+ [ -2, 2 ],
+ [ -3, 3 ],
+]
+
+const LAYOUT_GALATIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 1, -1 ],
+ [ 0, -1 ],
+ [ -1, -1 ],
+ [ 1, -2 ],
+ [ 0, -2 ],
+ [ -1, -2 ],
+ [ -1, -3 ],
+]
+
+const LAYOUT_SYRIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 1, -1 ],
+ [ 0, -1 ],
+ [ -1, -1 ],
+ [ -2, 0 ],
+ [ 2, 0 ],
+ [ -2, -1 ],
+ [ 2, -1 ],
+ [ 0, -2 ],
+ [ -1, -2 ],
+ [ 1, -2 ],
+]
+
const LAYOUT_AEGYPTUS = [
[ -1, 0 ],
[ -2, 0 ],
@@ -506,46 +546,6 @@ const LAYOUT_HISPANIA = [
[ -1, 3 ],
]
-const LAYOUT_BRITANNIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 2, 0 ],
- [ -2, 0 ],
- [ -3, 0 ],
- [ -3, 1 ],
- [ -3, 2 ],
- [ -2, 1 ],
- [ -2, 2 ],
- [ -3, 3 ],
-]
-
-const LAYOUT_GALATIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 1, -1 ],
- [ 0, -1 ],
- [ -1, -1 ],
- [ 1, -2 ],
- [ 0, -2 ],
- [ -1, -2 ],
- [ -1, -3 ],
-]
-
-const LAYOUT_SYRIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 1, -1 ],
- [ 0, -1 ],
- [ -1, -1 ],
- [ -2, 0 ],
- [ 2, 0 ],
- [ -2, -1 ],
- [ 2, -1 ],
- [ 0, -2 ],
- [ -1, -2 ],
- [ 1, -2 ],
-]
-
const LAYOUT_PATTERN = [
LAYOUT_ITALIA,
LAYOUT_ASIA,
@@ -554,19 +554,19 @@ const LAYOUT_PATTERN = [
LAYOUT_PANNONIA,
LAYOUT_THRACIA,
- LAYOUT_AEGYPTUS,
- LAYOUT_AFRICA,
- LAYOUT_HISPANIA,
-
LAYOUT_BRITANNIA,
LAYOUT_GALATIA,
LAYOUT_SYRIA,
+ LAYOUT_AEGYPTUS,
+ LAYOUT_AFRICA,
+ LAYOUT_HISPANIA,
+
LAYOUT_ALAMANNI,
LAYOUT_HOMELAND,
LAYOUT_HOMELAND,
- LAYOUT_NOMADS,
LAYOUT_SASSANIDS,
+ LAYOUT_NOMADS,
LAYOUT_SEA,
LAYOUT_SEA,
@@ -607,14 +607,14 @@ let ui = {
document.getElementById("mapsvg").getElementById("region_pannonia"),
document.getElementById("mapsvg").getElementById("region_thracia"),
- document.getElementById("mapsvg").getElementById("region_aegyptus"),
- document.getElementById("mapsvg").getElementById("region_africa"),
- document.getElementById("mapsvg").getElementById("region_hispania"),
-
document.getElementById("mapsvg").getElementById("region_britannia"),
document.getElementById("mapsvg").getElementById("region_galatia"),
document.getElementById("mapsvg").getElementById("region_syria"),
+ document.getElementById("mapsvg").getElementById("region_aegyptus"),
+ document.getElementById("mapsvg").getElementById("region_africa"),
+ document.getElementById("mapsvg").getElementById("region_hispania"),
+
document.getElementById("mapsvg").getElementById("region_alamanni"),
document.getElementById("mapsvg").getElementById("region_franks"),
document.getElementById("mapsvg").getElementById("region_goths"),
@@ -919,11 +919,6 @@ function on_update() {
ui.body.classList.toggle("p3", player_count === 3)
ui.body.classList.toggle("p4", player_count === 4)
- ui.header.classList.toggle("player_red", view.current === 0)
- ui.header.classList.toggle("player_blue", view.current === 1)
- ui.header.classList.toggle("player_yellow", view.current === 2)
- ui.header.classList.toggle("player_green", view.current === 3)
-
if (player_count < 4)
hide(document.getElementById("role_Green"))
else