summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css2
-rw-r--r--play.js25
-rw-r--r--rules.js3
-rw-r--r--tools/boxes.svg59
4 files changed, 80 insertions, 9 deletions
diff --git a/play.css b/play.css
index fd8c0d6..f1f400a 100644
--- a/play.css
+++ b/play.css
@@ -140,7 +140,7 @@ body.military svg .sea.action {
background-repeat: no-repeat;
}
-.dice.d0 { display: none; }
+.dice.d0 { background-position: -100% 0 }
.dice.d1 { background-position: 0% 0; }
.dice.d2 { background-position: 20% 0; }
.dice.d3 { background-position: 40% 0; }
diff --git a/play.js b/play.js
index 1aefd9b..baf4137 100644
--- a/play.js
+++ b/play.js
@@ -253,6 +253,11 @@ const BOXES = {
"Goths XY": [ 2020, 360, 60, 60 ],
"Alamanni XY": [ 1540, 280, 60, 60 ],
"Franks XY": [ 1160, 300, 60, 60 ],
+ "Franks Dice": [785,160,100,50],
+ "Alamanni Dice": [1265,160,100,50],
+ "Goths Dice": [1730,195,100,50],
+ "Sassanids Dice": [2380,895,100,50],
+ "Nomads Dice": [570,1520,100,50],
}
const LAYOUT_XY = [
@@ -294,6 +299,14 @@ const LAYOUT_SUPPORT = [
BOXES["Syria Support"],
]
+const LAYOUT_DICE = [
+ BOXES["Alamanni Dice"],
+ BOXES["Franks Dice"],
+ BOXES["Goths Dice"],
+ BOXES["Nomads Dice"],
+ BOXES["Sassanids Dice"],
+]
+
const LAYOUT_QUAESTOR = [
[ 971, 829 ],
[ 1622, 994 ],
@@ -855,7 +868,7 @@ function layout_governor_unavailable(e, color, ix) {
function layout_mob(region, i, e, visible, x2) {
if (visible) {
- let [ x, y, w ,h ] = LAYOUT_SUPPORT[region]
+ let [ x, y, w, h ] = LAYOUT_SUPPORT[region]
e.className = x2 ? "mob_x2" : "mob"
e.style.top = (y - 36) + "px"
e.style.left = (x + 26 + 26 * i) + "px"
@@ -864,6 +877,14 @@ function layout_mob(region, i, e, visible, x2) {
}
}
+function layout_barbarian_dice(black, white, tribe) {
+ let [ x, y, w, h ] = LAYOUT_DICE[tribe]
+ black.style.top = (y + 4) + "px"
+ white.style.top = (y + 4) + "px"
+ black.style.left = (x + 0) + "px"
+ white.style.left = (x + 50) + "px"
+}
+
function on_update() {
let player_count = view.legacy.length
@@ -1153,8 +1174,10 @@ function on_update() {
ui.dice[0].className = "dice black d" + view.dice[0]
ui.dice[1].className = "dice white d" + view.dice[1]
+
ui.dice[2].className = "dice black d" + view.dice[2]
ui.dice[3].className = "dice white d" + view.dice[3]
+ layout_barbarian_dice(ui.dice[2], ui.dice[3], view.crisis)
if (view.events) {
for (let c of view.events)
diff --git a/rules.js b/rules.js
index 8c7b846..d407d32 100644
--- a/rules.js
+++ b/rules.js
@@ -1088,6 +1088,8 @@ function goto_upkeep() {
function goto_crisis() {
game.dice[0] = roll_die()
game.dice[1] = roll_die()
+ game.dice[2] = 0
+ game.dice[3] = 0
log(`Crisis B${game.dice[0]} W${game.dice[1]}`)
@@ -3292,6 +3294,7 @@ exports.view = function (state, player_name) {
current: game.current,
prompt: null,
+ crisis: game.crisis,
support: game.support,
mobs: game.mobs,
militia: game.militia,
diff --git a/tools/boxes.svg b/tools/boxes.svg
index 6d7a190..8f81dcb 100644
--- a/tools/boxes.svg
+++ b/tools/boxes.svg
@@ -40,9 +40,9 @@
inkscape:window-height="480"
id="namedview6"
showgrid="true"
- inkscape:zoom="0.56786857"
- inkscape:cx="1692.2778"
- inkscape:cy="1133.1474"
+ inkscape:zoom="1.4142136"
+ inkscape:cx="859.33219"
+ inkscape:cy="1408.35"
inkscape:current-layer="svg4"
inkscape:document-rotation="0">
<inkscape:grid
@@ -52,11 +52,11 @@
<image
sodipodi:absref="/home/tor/src/rally/public/time-of-crisis/map75.png"
xlink:href="../map75.png"
- sodipodi:insensitive="true"
- id="image2"
- height="1650"
+ style="display:inline;image-rendering:pixelated"
width="2550"
- style="display:inline;image-rendering:pixelated" />
+ height="1650"
+ id="image2"
+ sodipodi:insensitive="true" />
<rect
style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
id="rect873"
@@ -381,4 +381,49 @@
y="189"
ry="0.610479"
inkscape:label="CRISIS TABLE" />
+ <rect
+ style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:3.14269;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
+ id="rect908-3"
+ width="100"
+ height="50"
+ x="785"
+ y="160"
+ ry="2.0349298"
+ inkscape:label="Franks Dice" />
+ <rect
+ style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:3.14269;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
+ id="rect908-3-6"
+ width="100"
+ height="50"
+ x="1265"
+ y="160"
+ ry="2.0349298"
+ inkscape:label="Alamanni Dice" />
+ <rect
+ style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:3.14269;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
+ id="rect908-3-6-7"
+ width="100"
+ height="50"
+ x="1730"
+ y="195"
+ ry="2.0349298"
+ inkscape:label="Goths Dice" />
+ <rect
+ style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:3.14269;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
+ id="rect908-3-6-7-5"
+ width="100"
+ height="50"
+ x="2380"
+ y="895"
+ ry="2.0349298"
+ inkscape:label="Sassanids Dice" />
+ <rect
+ style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:3.14269;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301"
+ id="rect908-3-6-7-5-3"
+ width="100"
+ height="50"
+ x="570"
+ y="1520"
+ ry="2.0349298"
+ inkscape:label="Nomads Dice" />
</svg>