Fix bestiary XP bonus and BP tier controls
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user