diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-22 23:03:32 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | b83c7f35103b43a9fae4ba9b0d4b98bd95a745b1 (patch) | |
tree | 188fad680070a4c96b63051e6ecab673a40fb0cb /play.js | |
parent | fcfed0cab586ecf3e2e6803e27f7cb0b38cb0898 (diff) | |
download | time-of-crisis-b83c7f35103b43a9fae4ba9b0d4b98bd95a745b1.tar.gz |
Show barbarian dice in homeland region.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -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) |