desire
This commit is contained in:
parent
54aff02658
commit
8bd4405fe8
33 changed files with 2478 additions and 610 deletions
|
|
@ -216,9 +216,17 @@
|
|||
},
|
||||
|
||||
applyFoodHungerRelief(amount = 0) {
|
||||
if (this.hasItemEffect("laxative")) return (Number(amount) || 0) * (EFFECT_REGISTRY?.modifier?.("laxative", "hungerReliefMultiplier", 0) ?? 0);
|
||||
this.hunger -= Number(amount) || 0;
|
||||
return amount;
|
||||
const raw = Math.max(0, Number(amount) || 0);
|
||||
const actual = this.hasItemEffect("laxative") ? raw * (EFFECT_REGISTRY?.modifier?.("laxative", "hungerReliefMultiplier", 0) ?? 0) : raw;
|
||||
if (actual > 0.2) this.lastAteAt = this.world?.time || 0;
|
||||
if (actual >= 6) {
|
||||
const day = Number(this.world?.config?.dayLength || CONFIG?.dayLength || 120) || 120;
|
||||
const base = day / 4;
|
||||
const jitter = typeof stableUnit === "function" ? (0.82 + stableUnit(this.familyKey || this.id, "meal-cooldown") * 0.36) : 1;
|
||||
this.mealCooldownUntil = Math.max(this.mealCooldownUntil || 0, (this.world?.time || 0) + base * jitter);
|
||||
}
|
||||
this.hunger -= actual;
|
||||
return actual;
|
||||
},
|
||||
|
||||
updateItemEffects(dt = 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue