This commit is contained in:
33333-33333 2026-06-26 12:46:32 +09:00
commit 86226ccc94
97 changed files with 5790 additions and 2307 deletions

View file

@ -85,11 +85,29 @@
},
refreshEffectiveSize() {
const oldMax = Number.isFinite(this.maxEnergy) ? Math.max(1, this.maxEnergy) : 100;
const oldEnergy = Number.isFinite(this.energy) ? this.energy : oldMax;
const mult = this.itemSizeMultiplier ? this.itemSizeMultiplier() : 1;
this.radius = 56 * (this.scale || 0.28) * mult;
const nextMax = typeof tarinaiMaxEnergy === "function" ? tarinaiMaxEnergy(this) : 100;
this.maxEnergy = nextMax;
const ratio = clamp(oldEnergy / oldMax, 0, 1.35);
this.energy = clamp(ratio * nextMax, 0, nextMax);
return this.radius;
},
effectiveMaxEnergy() {
return typeof tarinaiMaxEnergy === "function" ? tarinaiMaxEnergy(this) : (Number(this.maxEnergy) || 100);
},
energyRatio() {
return typeof tarinaiEnergyRatio === "function" ? tarinaiEnergyRatio(this) : clamp((this.energy || 0) / Math.max(1, this.maxEnergy || 100), 0, 1);
},
metabolicHungerMultiplier() {
return typeof tarinaiMetabolicHungerScale === "function" ? tarinaiMetabolicHungerScale(this) : 1;
},
setPowerItemMode(mode = "") {
this.ensureItemEffectState();
if (mode !== "protein" && mode !== "niteropu") return false;