Fix bestiary XP bonus and BP tier controls

This commit is contained in:
Your Name
2026-06-13 20:08:38 -04:00
parent 1e822a410e
commit 4a9b9dd40b
2 changed files with 13 additions and 18 deletions
+7 -3
View File
@@ -148,10 +148,14 @@
}
function bpTier() {
const tier = Number(qs("#bestiary-bp-tier")?.value || 0);
const tier = Number(qs("#bestiary-tier")?.value || 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];
@@ -170,7 +174,7 @@
}
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 ?? "";
@@ -332,7 +336,7 @@
renderTable();
});
qs("#bestiary-bp-tier")?.addEventListener("change", () => {
qs("#bestiary-tier")?.addEventListener("change", () => {
state.page = 1;
renderTable();
});