This commit is contained in:
33333-33333 2026-07-18 13:06:02 +09:00
commit f657b6a4a4
94 changed files with 3970 additions and 1241 deletions

View file

@ -334,6 +334,7 @@ function createPanicEscapeActionSpec() {
},
start(t, world, ctx = {}) {
const threat = ctx.target ?? this.selectTarget(t, world, ctx);
if (threat && threat !== t) t.lastPanicThreat = threat;
t.setActionState?.("panic", { target: t.panicDestination?.(threat, true), reason: this.label, wake: true, sleeping: false });
t.fearTimer = Math.max(t.fearTimer || 0, 1.6);
return true;
@ -343,6 +344,43 @@ function createPanicEscapeActionSpec() {
}
function createCrowdEscapeActionSpec() {
return {
id: "crowd_escape",
need: "social",
subNeed: "crowd",
state: "wander",
label: "\u6df7\u96d1\u304b\u3089\u5c11\u3057\u96e2\u308c\u3088\u3046\u3068\u3057\u3066\u3044\u308b",
phrase: "\u6df7\u96d1\u304b\u3089\u5c11\u3057\u96e2\u308c\u305f",
weight: 5,
selectTarget(t, world) { return t.target?.crowdEscape ? t.target : findSocialCrowdEscapeTarget(t, world); },
canStart(t, world) {
const sample = t?.socialCrowdSample || null;
const now = Number(world?.time || 0) || 0;
const age = sample ? now - (Number(sample.at || 0) || 0) : Infinity;
const crowd = Number(t?.socialReasonParts?.crowd || 0) || 0;
return age <= 3.5 && crowd >= 18 && Number(sample?.count || 0) >= Number(sample?.upper || Infinity);
},
start(t, world, ctx = {}) {
const target = ctx.target ?? this.selectTarget(t, world, ctx);
if (!target) return false;
t.setActionState?.("wander", {
target,
reason: SOCIAL_CROWD_ESCAPE_REASON,
wake: true,
sleeping: false,
actionId: "crowd_escape",
actionLabel: this.label,
need: "social",
subNeed: "crowd",
});
return true;
},
tick: updateCrowdEscapeBehavior,
};
}
function createApproachFriendActionSpec() {
return {
id: "approach_friend",