removed unused processesseessess

This commit is contained in:
33333-33333 2026-06-29 16:21:58 +09:00
commit 4fdc567e08
158 changed files with 1317 additions and 3351 deletions

View file

@ -4,16 +4,18 @@
const Tarinai = global.Tarinai;
if (!Tarinai) throw new Error("Tarinai is not available for mixin: tarinai_item_effects.js");
const EFFECT_REGISTRY = global.TarinaiItemRegistry?.effect || null;
const ITEM_EFFECT_LABELS = Object.freeze(EFFECT_REGISTRY?.labels?.() || {});
const ITEM_EFFECT_COLORS = Object.freeze(EFFECT_REGISTRY?.colors?.() || {});
const EFFECT_REGISTRY = global.TarinaiItemRegistry.effect || null;
const RANDOM_EFFECT_POOL = Object.freeze(EFFECT_REGISTRY?.randomPool?.() || [
"love_mochi", "fight_mochi", "sleep_drug", "laxative", "ammo", "protein", "niteropu", "mercury", "giant_drug", "dwarf_drug",
"disease_zunchi", "disease_sleep", "disease_explosion", "disease_fight",
]);
function effectLabel(id = "") {
return EFFECT_REGISTRY?.label?.(id) || ITEM_EFFECT_LABELS[id] || id || "\u4e0d\u660e";
return EFFECT_REGISTRY?.label?.(id) || id || "\u4e0d\u660e";
}
function effectColor(id = "", fallback = "rgba(255,242,160,0.85)") {
return EFFECT_REGISTRY?.color?.(id) || fallback;
}
function sizeDurationScale(item = null) {
@ -184,7 +186,7 @@
const picks = pickRandomEffects(2);
for (const effect of picks) this.applyRandomizedBehaviorEffect(effect, item);
this.mysteryDrugHistory = [...(this.mysteryDrugHistory || []), `${picks.map(effectLabel).join(" + ")}`].slice(-8);
this.bubble("???", 1.2, ITEM_EFFECT_COLORS.mystery_drug);
this.bubble("???", 1.2, effectColor("mystery_drug"));
this.spawnPowerItemEffect("mystery_drug", 1.0);
applied = picks;
} else if (EFFECT_REGISTRY?.apply?.(type, this, { item, scale, source: options.source || "item", nutrition: options.nutrition })) {
@ -237,11 +239,10 @@
const raw = Math.max(0, Number(amount) || 0);
const actual = this.hasItemEffect("laxative") ? raw * (EFFECT_REGISTRY?.modifier?.("laxative", "hungerReliefMultiplier", 0) ?? 0) : raw;
const now = this.world?.time || 0;
if (actual > 0.2) this.lastAteAt = now;
if (actual >= 3.5) {
const day = Number(this.world?.config?.dayLength || CONFIG?.dayLength || 120) || 120;
const base = day / 3.65;
const jitter = typeof stableUnit === "function" ? (0.82 + stableUnit(this.familyKey || this.id, "meal-cooldown") * 0.36) : 1;
const jitter = 0.82 + stableUnit(this.familyKey || this.id, "meal-cooldown") * 0.36;
this.mealCooldownUntil = Math.max(this.mealCooldownUntil || 0, now + base * jitter);
this.needSatisfaction = this.needSatisfaction || (typeof createDefaultNeeds === "function" ? createDefaultNeeds() : {});
this.needSatisfaction.food = Math.max(this.needSatisfaction.food || 0, Math.min(88, actual * 1.85));
@ -249,7 +250,7 @@
this.actionCooldowns.food = Math.max(this.actionCooldowns.food || 0, 5.2);
}
this.hunger -= actual;
if (actual >= 3.5 && this.hunger < 68 && (typeof getTarinaiBehaviorNeed === "function" ? getTarinaiBehaviorNeed(this) : this.behavior?.need) === "food" && !(typeof isTarinaiBehaviorForced === "function" ? isTarinaiBehaviorForced(this) : Boolean(this.behavior?.source === "forced" || this.behavior?.forcedId || this.behavior?.forcedRequest))) {
if (actual >= 3.5 && this.hunger < 68 && (getTarinaiBehaviorNeed(this)) === "food" && !(typeof isTarinaiBehaviorForced === "function" ? isTarinaiBehaviorForced(this) : Boolean(this.behavior?.source === "forced" || this.behavior?.forcedId || this.behavior?.forcedRequest))) {
this.behaviorLockTimer = Math.min(this.behaviorLockTimer || 0, 0.25);
}
return actual;
@ -304,7 +305,7 @@
this.digest = Math.max(0, (this.digest || 0) - 3.0);
const now = this.world?.time || 0;
this.nextPoopBubbleAt = now + 2.2;
this.bubble("\u3076\u308a\u3085\u3063", 1.2, ITEM_EFFECT_COLORS.laxative, { force: true });
this.bubble("\u3076\u308a\u3085\u3063", 1.2, effectColor("laxative"), { force: true });
if ((this.world.time || 0) > (this.nextLaxativeLogAt || -999)) {
this.nextLaxativeLogAt = (this.world.time || 0) + 9;
this.world.log?.(`${this.name}\u306f\u4e0b\u5264\u306e\u52b9\u679c\u3067\u305a\u3093\u3061\u3092\u653e\u51fa\u3057\u305f\u3002`, "accident", { participants: [this] });
@ -315,7 +316,7 @@
if (!this.world?.effects) return;
const color = kind === "protein"
? "rgba(224,54,40,0.88)"
: (kind === "niteropu" ? "rgba(116,80,190,0.84)" : (ITEM_EFFECT_COLORS[kind] || "rgba(255,242,160,0.85)"));
: (kind === "niteropu" ? "rgba(116,80,190,0.84)" : effectColor(kind));
const n = Math.max(1, Math.round((kind === "protein" || kind === "niteropu" ? 3 : 2) * intensity));
for (let i = 0; i < n; i++) {
const angle = rand(0, Math.PI * 2);
@ -381,11 +382,9 @@
activeItemEffectSummary() {
this.ensureItemEffectState();
if (EFFECT_REGISTRY?.activeSummary) return EFFECT_REGISTRY.activeSummary(this);
if (EFFECT_REGISTRY.activeSummary) return EFFECT_REGISTRY.activeSummary(this);
return [];
},
}));
global.TARINAI_ITEM_EFFECT_LABELS = ITEM_EFFECT_LABELS;
global.TARINAI_ITEM_EFFECT_COLORS = ITEM_EFFECT_COLORS;
})(typeof window !== "undefined" ? window : globalThis);