duu
This commit is contained in:
parent
88f618cadf
commit
8f9f5b5100
108 changed files with 2139 additions and 1500 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue