removed unused processesseessess
This commit is contained in:
parent
348f355eb2
commit
4fdc567e08
158 changed files with 1317 additions and 3351 deletions
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
const reason = String(opts.reason ?? this.thought ?? "");
|
||||
if (nextState === "idle") {
|
||||
if (typeof clearBehavior === "function") clearBehavior(this, reason || "\u5f85\u3063\u3066\u3044\u308b");
|
||||
else if (typeof clearTarinaiBehavior === "function") clearTarinaiBehavior(this, { clearTarget: !!opts.clearTarget });
|
||||
clearBehavior(this, reason || "\u5f85\u3063\u3066\u3044\u308b");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -52,8 +51,7 @@
|
|||
const actionId = String(opts.actionId || opts.behaviorId || stateActionIds[nextState] || nextState);
|
||||
const target = opts.clearTarget ? null : ("target" in opts ? opts.target : this.target);
|
||||
const phase = opts.phase || (nextState === "sleep" || nextState === "eat" || nextState === "fight" || nextState === "intimidate" || nextState === "birth_ritual" || nextState === "sunbath" ? "acting" : "approaching");
|
||||
if (typeof setBehaviorText === "function") {
|
||||
setBehaviorText(this, {
|
||||
setBehaviorText(this, {
|
||||
need: opts.need || null,
|
||||
subNeed: opts.subNeed || "",
|
||||
actionId,
|
||||
|
|
@ -67,19 +65,6 @@
|
|||
sourceReasonText: opts.sourceReasonText || opts.forcedReasonText || "",
|
||||
causeText: opts.causeText || "",
|
||||
});
|
||||
} else if (typeof patchTarinaiBehavior === "function") {
|
||||
patchTarinaiBehavior(this, {
|
||||
actionId,
|
||||
phase,
|
||||
target,
|
||||
source: opts.source || "state",
|
||||
reason,
|
||||
label: opts.actionLabel || reason || nextState,
|
||||
text: reason || opts.actionLabel || nextState,
|
||||
need: opts.need || "fulfill",
|
||||
subNeed: opts.subNeed || "",
|
||||
});
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
|
|
@ -90,17 +75,17 @@
|
|||
reason: text,
|
||||
sleeping: false,
|
||||
});
|
||||
if (typeof setBehaviorText === "function") setBehaviorText(this, { need: "food", actionId: "eat_food", actionLabel: "\u98df\u3079\u3066\u3044\u308b", reasonText: text, target: item || null, phase: "perform", source: "behavior" });
|
||||
setBehaviorText(this, { need: "food", actionId: "eat_food", actionLabel: "\u98df\u3079\u3066\u3044\u308b", reasonText: text, target: item || null, phase: "perform", source: "behavior" });
|
||||
return ok;
|
||||
},
|
||||
|
||||
currentLodgedPin() {
|
||||
return typeof lodgedPinFor === "function" ? lodgedPinFor(this, this.world) : null;
|
||||
return lodgedPinFor(this, this.world);
|
||||
},
|
||||
|
||||
currentLodgedPinBehavior() {
|
||||
const pin = this.currentLodgedPin ? this.currentLodgedPin() : null;
|
||||
return typeof pinBehaviorFor === "function" ? pinBehaviorFor(pin?.type) : null;
|
||||
return pinBehaviorFor(pin?.type);
|
||||
},
|
||||
|
||||
hasLodgedPinEffect(effectKey = "") {
|
||||
|
|
@ -133,7 +118,7 @@
|
|||
target.singleUseWakeReason = "sleep";
|
||||
}
|
||||
const text = reason || (target?.type === "nest_box" ? "\u5de3\u7bb1\u306e\u4e2d\u3067\u7720\u3063\u3066\u3044\u308b" : "\u7720\u3063\u3066\u3044\u308b");
|
||||
if (typeof setBehaviorText === "function") setBehaviorText(this, { need: "sleep", actionId: target ? "sleep_in_bed" : "sleep_anywhere", actionLabel: "\u7720\u3063\u3066\u3044\u308b", reasonText: text, target, phase: "perform", source: "behavior" });
|
||||
setBehaviorText(this, { need: "sleep", actionId: target ? "sleep_in_bed" : "sleep_anywhere", actionLabel: "\u7720\u3063\u3066\u3044\u308b", reasonText: text, target, phase: "perform", source: "behavior" });
|
||||
return this.setActionState("sleep", { target, reason: text, sleeping: true });
|
||||
},
|
||||
|
||||
|
|
@ -165,7 +150,7 @@
|
|||
return false;
|
||||
}
|
||||
this.pendingGrassBedWakeId = "";
|
||||
return window.TarinaiStructureLifecycle?.consumeGrassBedOnWake?.(worldRef, bed, this, reason) || false;
|
||||
return window.TarinaiStructureLifecycle.consumeGrassBedOnWake(worldRef, bed, this, reason) || false;
|
||||
},
|
||||
|
||||
seekTarget(state, target = null, reason = "") {
|
||||
|
|
@ -173,13 +158,11 @@
|
|||
},
|
||||
|
||||
forceBehavior(actionId = "", opts = {}) {
|
||||
if (typeof queueForcedTarinaiBehavior !== "function") return false;
|
||||
return queueForcedTarinaiBehavior(this, actionId, opts);
|
||||
},
|
||||
|
||||
currentBehaviorText() {
|
||||
if (typeof behaviorText === "function") return behaviorText(this);
|
||||
return String((typeof getTarinaiBehaviorText === "function" ? getTarinaiBehaviorText(this) : "") || this.thought || "").trim();
|
||||
return behaviorText(this);
|
||||
},
|
||||
|
||||
enterPanic(opts = {}) {
|
||||
|
|
@ -210,10 +193,8 @@
|
|||
wake: opts.wake !== false,
|
||||
sleeping: false,
|
||||
});
|
||||
if (typeof setBehaviorText === "function") {
|
||||
const causeText = this.lastPanicDetail || (String(panicReason).includes("\u3001") ? String(panicReason).split("\u3001")[0].replace(/\u3066$/, "\u305f") : "\u6016\u3044");
|
||||
setBehaviorText(this, { need: "safety", actionId: "panic_escape", actionLabel: "\u30d1\u30cb\u30c3\u30af\u306b\u306a\u3063\u3066\u3044\u308b", reasonText: panicReason, causeText, target, phase: "perform", source: "behavior" });
|
||||
}
|
||||
const causeText = this.lastPanicDetail || (String(panicReason).includes("\u3001") ? String(panicReason).split("\u3001")[0].replace(/\u3066$/, "\u305f") : "\u6016\u3044");
|
||||
setBehaviorText(this, { need: "safety", actionId: "panic_escape", actionLabel: "\u30d1\u30cb\u30c3\u30af\u306b\u306a\u3063\u3066\u3044\u308b", reasonText: panicReason, causeText, target, phase: "perform", source: "behavior" });
|
||||
this.fearTimer = Math.max(this.fearTimer || 0, 2.4);
|
||||
}
|
||||
if (Number.isFinite(opts.surpriseTimer)) this.surpriseTimer = Math.max(this.surpriseTimer || 0, opts.surpriseTimer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue