diff --git a/site/bestiary-tables.js b/site/bestiary-tables.js index 64dd920..601a1e8 100644 --- a/site/bestiary-tables.js +++ b/site/bestiary-tables.js @@ -27,7 +27,7 @@ 8: { hp: 2.00, atp: 1.08, exp: 2.00 }, 9: { hp: 2.50, atp: 1.09, exp: 2.50 }, 10: { hp: 3.00, atp: 1.10, exp: 3.00 }, - 11: { hp: 4.00, atp: 1.10, exp: null }, + 11: { hp: 4.00, atp: 1.10, exp: 3.00 }, }; const COLUMN_GROUPS = { @@ -148,13 +148,25 @@ } function bpTier() { - const tier = Number(qs("#bestiary-bp-tier")?.value || 0); + const select = qs("#bestiary-tier"); + const raw = String(select?.value || ""); + const label = String(select?.selectedOptions?.[0]?.textContent || ""); + const match = raw.match(/(\d+)$/) || label.match(/(\d+)/); + const tier = match ? Number(match[1]) : 0; return BP_TIERS[tier] || BP_TIERS[0]; } + function xpBonusMultiplier() { + return Number(qs("#bestiary-xp-bonus")?.value || 1); + } + function displayValue(row, key) { const value = row[key]; + if (key === "exp" && row.difficulty !== "Ultimate") { + return Math.round(Number(value || 0) * xpBonusMultiplier()); + } + if (row.difficulty !== "Ultimate") { return value ?? ""; } @@ -170,16 +182,22 @@ } if (key === "exp" && tier.exp !== null) { - return Math.round(Number(value || 0) * tier.exp); + return Math.round(Number(value || 0) * tier.exp * xpBonusMultiplier()); } return value ?? ""; } + function hasAnyBestiaryValue(row) { + const keys = ["hp", "atp", "dfp", "mst", "ata", "evp", "lck", "esp", "exp", "efr", "eic", "eth", "elt", "edk"]; + return keys.some((key) => Number(row[key] || 0) !== 0); + } + function visibleRows() { const search = state.filters.search.trim().toLowerCase(); return state.rows.filter((row) => { + if (!hasAnyBestiaryValue(row)) return false; if (state.filters.mode && row.mode !== state.filters.mode) return false; if (state.filters.episode && row.episode !== state.filters.episode) return false; if (state.filters.difficulty && row.difficulty !== state.filters.difficulty) return false; @@ -332,11 +350,15 @@ renderTable(); }); - qs("#bestiary-bp-tier")?.addEventListener("change", () => { + qs("#bestiary-tier")?.addEventListener("change", () => { state.page = 1; renderTable(); }); + qs("#bestiary-xp-bonus")?.addEventListener("change", () => { + renderTable(); + }); + qs("#bestiary-placeholder")?.addEventListener("click", (event) => { const pageButton = event.target.closest("[data-bestiary-page]"); if (pageButton) { diff --git a/site/bestiary.html b/site/bestiary.html index 60ec441..df684e6 100644 --- a/site/bestiary.html +++ b/site/bestiary.html @@ -51,22 +51,13 @@ - - + + + -

Applies HP, ATP, and EXP modifiers to Ultimate rows only.

+

Applies EXP multiplier only.

- + + @@ -122,6 +114,6 @@ - +