summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-27 15:03:55 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit6ed843934853f5dd842468f7fdb63f57c9149877 (patch)
treecd5dc6c237e31e9b0f4a82d58b63d240d91ae39b /play.js
parent68d98bb82ba085ec7648d12676704333e530d30d (diff)
downloadnevsky-6ed843934853f5dd842468f7fdb63f57c9149877.tar.gz
Explicit deck.
Diffstat (limited to 'play.js')
-rw-r--r--play.js29
1 files changed, 1 insertions, 28 deletions
diff --git a/play.js b/play.js
index 9d72dba..4f68e80 100644
--- a/play.js
+++ b/play.js
@@ -345,22 +345,6 @@ function is_marshal(lord) {
if (lord === LORD_ANDREY) return !is_lord_on_map(LORD_ALEKSANDR)
}
-function is_card_in_use(c) {
- if (set_has(view.hand, c))
- return true
- if (set_has(view.events, c))
- return true
- if (set_has(view.capabilities, c))
- return true
- if (view.pieces.capabilities.includes(c))
- return true
- if (c === 18 || c === 19 || c === 20)
- return true
- if (c === 39 || c === 40 || c === 41)
- return true
- return false
-}
-
function has_global_capability(cap) {
for (let c of view.capabilities)
if (data.cards[c].capability === cap)
@@ -1253,26 +1237,15 @@ function update_cards() {
let elt = ui.cards[c]
elt.classList.toggle("selected", c === view.what)
elt.classList.toggle("action", is_card_action(c))
- elt.classList.toggle("disabled", false)
}
- if (Array.isArray(view.show_arts_of_war)) {
+ if (view.show_arts_of_war) {
ui.arts_of_war_dialog.classList.remove("hide")
ui.arts_of_war_list.replaceChildren()
for (let c of view.show_arts_of_war) {
let elt = ui.cards[c]
ui.arts_of_war_list.appendChild(ui.cards[c])
}
- } else if (view.show_arts_of_war === 1) {
- ui.arts_of_war_dialog.classList.remove("hide")
- ui.arts_of_war_list.replaceChildren()
- for_each_friendly_card(c => {
- if (!is_card_in_use(c)) {
- let elt = ui.cards[c]
- ui.arts_of_war_list.appendChild(elt)
- elt.classList.toggle("disabled", !is_card_action(c))
- }
- })
} else {
ui.arts_of_war_dialog.classList.add("hide")
}