This commit is contained in:
33333-33333 2026-07-05 18:01:36 +09:00
commit 8f9f5b5100
108 changed files with 2139 additions and 1500 deletions

View file

@ -130,6 +130,8 @@ const HEALTH = (() => {
}
if (direct === CAUSES.fire || recent === CAUSES.fire || t.lastMajorDamageCause === CAUSES.fire) return CAUSES.fire;
if (direct === CAUSES.heatstroke || recent === CAUSES.heatstroke || t.lastMajorDamageCause === CAUSES.heatstroke) return CAUSES.heatstroke;
if (direct === CAUSES.freeze || recent === CAUSES.freeze || t.lastMajorDamageCause === CAUSES.freeze) return CAUSES.freeze;
if (recentMajor && t.lastMajorDamageCause === CAUSES.collision && !(t.energy <= 20 || t.mood <= 16 || t.stress >= 124 || t.hunger >= 112)) return CAUSES.collision;
if (hasLingeringMajorDamage(t) && (!direct || direct === t.lastMajorDamageCause || t.energy <= 18 || t.mood <= 16 || t.stress >= 124 || t.hunger >= 112)) {
return weakenedDeathReasonFor(t.lastMajorDamageCause);
@ -295,8 +297,7 @@ const HEALTH = (() => {
let cause = "";
if (actualLoss > 0.01) {
cause = rememberDamage(t, actualLoss, reason);
t.world?.emit?.("tarinai:damaged", { tarinai: t, amount: actualLoss, cause, reason });
const plushie = (t.world?.itemsOfType?.("plushie") || t.world?.items || []).find(item => item && !item.dead && item.isStructure && item.type === "plushie" && item.ownerId === t.id && item.carriedById === t.id);
const plushie = (t.world?.ownedItemsFor?.(t.id) || t.world?.itemsOfType?.("plushie") || t.world?.items || []).find(item => item && !item.dead && item.isStructure && item.type === "plushie" && item.ownerId === t.id && item.carriedById === t.id);
if (plushie && actualLoss >= 1) plushie.damage(actualLoss, t.world, null);
if (cause === CAUSES.fight || /\u55a7\u5629|fight/.test(String(reason || ""))) t.recordBleedExposure();
const majorDamageReacted = maybeTriggerMajorDamageReaction(t, actualLoss, cause || reason);