summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-24 11:28:55 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-24 11:28:55 +0200
commit98478071c29c919828dec77a04246df1e94c7f37 (patch)
tree9050bcabeebfc53f2fe97604f19d73165aed9fc2 /play.js
parent5e3e209e27fe5d844f0f44e902e469b3ef83d2a6 (diff)
downloadmaria-98478071c29c919828dec77a04246df1e94c7f37.tar.gz
second hand for subsidy/returned cards
Diffstat (limited to 'play.js')
-rw-r--r--play.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/play.js b/play.js
index efd3935..b514a2a 100644
--- a/play.js
+++ b/play.js
@@ -620,7 +620,7 @@ function on_init() {
}
ui.elector = [ [], [], [], [], [], [] ]
- for (let i = 0; i < 30; ++i) {
+ for (let i = 0; i < 50; ++i) {
ui.elector[P_FRANCE].push(create_conquest("marker elector_marker_france"))
ui.elector[P_PRUSSIA].push(create_conquest("marker elector_marker_prussia"))
ui.elector[P_PRAGMATIC].push(create_conquest("marker elector_marker_austria_pragmatic"))
@@ -663,8 +663,10 @@ function on_init() {
ui.combat.id = "combat"
ui.combat.style.zIndex = 2000
- ui.tcbreak = document.createElement("div")
- ui.tcbreak.className = "draw-break"
+ ui.tcbreak1 = document.createElement("div")
+ ui.tcbreak1.className = "draw-break"
+ ui.tcbreak2 = document.createElement("div")
+ ui.tcbreak2.className = "draw-break"
ui.turn = document.createElement("div")
ui.turn.className = "marker turn_marker"
@@ -1153,22 +1155,19 @@ function on_update() {
*/
ui.hand[pow].replaceChildren()
- if (typeof view.hand[pow] === "number") {
- for (let i = 0; i < view.hand[pow]; ++i)
- ui.hand[pow].appendChild(ui.tc_hand[pow][i])
- } else {
- view.hand[pow].sort(cmp_tc)
- for (let c of view.hand[pow]) {
+ for (let c of view.hand1[pow].slice().sort(cmp_tc))
+ ui.hand[pow].appendChild(show_tc(c))
+ if (view.hand2[pow].length > 0) {
+ ui.hand[pow].appendChild(ui.tcbreak1)
+ for (let c of view.hand2[pow].slice().sort(cmp_tc))
ui.hand[pow].appendChild(show_tc(c))
- }
}
}
if (view.draw) {
- view.draw.sort(cmp_tc)
- if (view.hand[view.power].length > 0)
- ui.hand[view.power].appendChild(ui.tcbreak)
- for (let c of view.draw)
+ if (view.hand1[view.power].length + view.hand2[view.power].length > 0)
+ ui.hand[view.power].appendChild(ui.tcbreak2)
+ for (let c of view.draw.slice().sort(cmp_tc))
ui.hand[view.power].appendChild(ui.tc[c])
}