summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js16
-rw-r--r--rules.js7
2 files changed, 14 insertions, 9 deletions
diff --git a/play.js b/play.js
index 86047ff..7ff6987 100644
--- a/play.js
+++ b/play.js
@@ -586,37 +586,37 @@ function on_update() { // eslint-disable-line no-unused-vars
action_button("reset", "Reset")
}
-function on_focus_area_tip(x) {
+function on_focus_area_tip(x) { // eslint-disable-line no-unused-vars
ui.areas[x].classList.add("tip")
}
-function on_blur_area_tip(x) {
+function on_blur_area_tip(x) { // eslint-disable-line no-unused-vars
ui.areas[x].classList.remove("tip")
}
-function on_click_area_tip(x) {
+function on_click_area_tip(x) { // eslint-disable-line no-unused-vars
ui.areas[x].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" })
}
-function sub_area_name(match, p1, offset, string) {
+function sub_area_name(_match, p1, _offset, _string) {
let x = p1 | 0
let n = data.areas[x].name
return `<span class="tip" onmouseenter="on_focus_area_tip(${x})" onmouseleave="on_blur_area_tip(${x})" onclick="on_click_area_tip(${x})">${n}</span>`
}
-function on_focus_unit_tip(x) {
+function on_focus_unit_tip(x) { // eslint-disable-line no-unused-vars
ui.units[x].classList.add("tip")
}
-function on_blur_unit_tip(x) {
+function on_blur_unit_tip(x) { // eslint-disable-line no-unused-vars
ui.units[x].classList.remove("tip")
}
-function on_click_unit_tip(x) {
+function on_click_unit_tip(x) { // eslint-disable-line no-unused-vars
ui.units[x].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" })
}
-function sub_unit_name(match, p1, offset, string) {
+function sub_unit_name(_match, p1, _offset, _string) {
let x = p1 | 0
let n = data.units[x].name
return `<span class="tip" onmouseenter="on_focus_unit_tip(${x})" onmouseleave="on_blur_unit_tip(${x})" onclick="on_click_unit_tip(${x})">${n}</span>`
diff --git a/rules.js b/rules.js
index e79c76c..5ac85a6 100644
--- a/rules.js
+++ b/rules.js
@@ -608,7 +608,6 @@ function is_flush_unit(u) {
}
function is_react_unit(u) {
- let loc = unit_loc(u)
// TODO airmobile && division
return is_mobile_unit(u) && is_unit_not_neutralized(u)
}
@@ -1916,6 +1915,9 @@ function build_fln_unit(type, where) {
let cost = build_cost(type, where)
game.fln_ap -= cost
log(`>Paid ${cost} AP`)
+ if (game.fln_ap < 0) {
+ throw new Error("ASSERT game.fln_ap < 0")
+ }
}
function convert_fln_unit(u, type) {
@@ -1928,6 +1930,9 @@ function convert_fln_unit(u, type) {
let cost = convert_cost(type)
game.fln_ap -= cost
log(`>Paid ${cost} AP`)
+ if (game.fln_ap < 0) {
+ throw new Error("ASSERT game.fln_ap < 0")
+ }
}
states.fln_reinforcement = {