diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-14 11:18:52 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | eabedf314dfedd2ee5f641bf2e10564304d9d3f0 (patch) | |
tree | ea72a8ff938e6b367ab4c34a5b0c314ced912304 /play.js | |
parent | da0130446329b1419d54904e1ab43aebefbfd3de (diff) | |
download | table-battles-eabedf314dfedd2ee5f641bf2e10564304d9d3f0.tar.gz |
fizzle -> null.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -76,10 +76,10 @@ function animate_position(e) { let action_registry = [] -function register_action(e, action, id, fizzle=null) { +function register_action(e, action, id, null_action=null) { e.my_id = id e.my_action = action - e.my_fizzle = fizzle + e.my_null_action = null_action e.onclick = on_click_action action_registry.push(e) return e @@ -89,8 +89,8 @@ function on_click_action(evt) { if (evt.button === 0) { if (send_action(evt.target.my_action, evt.target.my_id)) evt.stopPropagation() - if (evt.target.my_fizzle) - if (send_action(evt.target.my_fizzle, evt.target.my_id)) + if (evt.target.my_null_action) + if (send_action(evt.target.my_null_action, evt.target.my_id)) evt.stopPropagation() } } @@ -190,7 +190,7 @@ function create_formation_card(id) { et = append_div(ee, "action_type reaction", a.type) else et = append_div(ee, "action_type", a.type) - register_action(et, "a" + ix, id, "f" + ix) + register_action(et, "a" + ix, id, "n" + ix) append_div(ee, "action_requirement", a.requirement) if (Array.isArray(a.target)) append_div(ee, "action_target", a.target.map(t=>data.cards[t].name).join(", ")) @@ -362,9 +362,9 @@ function on_update() { } for (let e of action_registry) { - if (e.my_fizzle) { - e.classList.toggle("action", is_action(e.my_action, e.my_id) || is_action(e.my_fizzle, e.my_id)) - e.classList.toggle("fizzle", is_action(e.my_fizzle, e.my_id)) + if (e.my_null_action) { + e.classList.toggle("action", is_action(e.my_action, e.my_id) || is_action(e.my_null_action, e.my_id)) + e.classList.toggle("null", is_action(e.my_null_action, e.my_id)) } else { e.classList.toggle("action", is_action(e.my_action, e.my_id)) } |