1.4
This commit is contained in:
parent
ad2cc76429
commit
7455d630fc
82 changed files with 2179 additions and 900 deletions
|
|
@ -207,12 +207,12 @@ function createTemperatureComfortActionSpec() {
|
|||
need: "health",
|
||||
subNeed: "temperature",
|
||||
state: "seek_temperature",
|
||||
label: "快適な温度帯へ移動している",
|
||||
phrase: "快適な温度帯を探している",
|
||||
label: "\u5FEB\u9069\u306A\u6E29\u5EA6\u5E2F\u3078\u79FB\u52D5\u3057\u3066\u3044\u308B",
|
||||
phrase: "\u5FEB\u9069\u306A\u6E29\u5EA6\u5E2F\u3092\u63A2\u3057\u3066\u3044\u308B",
|
||||
text(t, world) {
|
||||
const felt = world?.feltTemperatureFor?.(t) ?? world?.temperatureAt?.(t?.x, t?.y, t) ?? t?.feltTemperature ?? t?.tempComfort ?? (CONFIG.standardTemperature ?? 15);
|
||||
const status = world?.temperatureStatusFor?.(felt, t) || t?.temperatureStatus || null;
|
||||
return status?.direction === "cold" ? "寒いので温まろうとしている。" : "暑いので涼もうとしている。";
|
||||
return status?.direction === "cold" ? "\u5BD2\u3044\u306E\u3067\u6E29\u307E\u308D\u3046\u3068\u3057\u3066\u3044\u308B\u3002" : "\u6691\u3044\u306E\u3067\u6DBC\u3082\u3046\u3068\u3057\u3066\u3044\u308B\u3002";
|
||||
},
|
||||
weight: 42,
|
||||
selectTarget(t, world, ctx = {}) {
|
||||
|
|
@ -226,7 +226,7 @@ function createTemperatureComfortActionSpec() {
|
|||
},
|
||||
start(t, world, ctx = {}) {
|
||||
const status = world?.temperatureStatusFor?.(world?.feltTemperatureFor?.(t) ?? world?.temperatureAt?.(t.x, t.y, t) ?? t?.feltTemperature ?? (CONFIG.standardTemperature ?? 15), t);
|
||||
const label = status?.direction === "cold" ? "あたたかい場所へ移動している" : (status?.direction === "hot" ? "涼しい場所へ移動している" : this.label);
|
||||
const label = status?.direction === "cold" ? "\u3042\u305F\u305F\u304B\u3044\u5834\u6240\u3078\u79FB\u52D5\u3057\u3066\u3044\u308B" : (status?.direction === "hot" ? "\u6DBC\u3057\u3044\u5834\u6240\u3078\u79FB\u52D5\u3057\u3066\u3044\u308B" : this.label);
|
||||
const target = ctx.target ?? this.selectTarget(t, world, ctx);
|
||||
return moveToOrUse(t, target, "seek_temperature", label);
|
||||
},
|
||||
|
|
@ -235,7 +235,7 @@ function createTemperatureComfortActionSpec() {
|
|||
const status = world?.temperatureStatusFor?.(felt, t);
|
||||
if (status?.comfortable || (status?.discomfort || 0) <= 1.5) {
|
||||
if (typeof applyNeedSatisfaction === "function") applyNeedSatisfaction(t, { health: 10, safety: 8 }, "temperature");
|
||||
t.goIdle?.("快適な温度になった");
|
||||
t.goIdle?.("\u5FEB\u9069\u306A\u6E29\u5EA6\u306B\u306A\u3063\u305F");
|
||||
return "finished";
|
||||
}
|
||||
const target = t.target && !t.target.dead ? t.target : (ctx.target ?? this.selectTarget(t, world, { force: true, requireComfort: true }));
|
||||
|
|
@ -426,13 +426,17 @@ function createIntimidateEnemyActionSpec() {
|
|||
timerBacked: true,
|
||||
selectTarget(t) { return t.recentFightRival?.(80, 180) || null; },
|
||||
canStart(t, world, ctx = {}) {
|
||||
// 威嚇は通常の欲求行動としては選ばず、喧嘩判定時の30%分岐で実行する。
|
||||
// \u5A01\u5687\u306F\u901A\u5E38\u306E\u6B32\u6C42\u884C\u52D5\u3068\u3057\u3066\u306F\u9078\u3070\u305A\u3001\u55A7\u5629\u5224\u5B9A\u6642\u306E30%\u5206\u5C90\u3067\u5B9F\u884C\u3059\u308B\u3002
|
||||
if (!isCurrentBehaviorForced(t)) return false;
|
||||
if ((t.intimidateTimer || 0) > 0.04 || (t.postConflictPeaceTimer || 0) > 0.04) return false;
|
||||
return basicCanStartWithTarget.call(this, t, world, ctx);
|
||||
if ((t.intimidateTimer || 0) > 0.04 || (t.intimidationCooldown || 0) > 0.04 || (t.postConflictPeaceTimer || 0) > 0.04) return false;
|
||||
const target = ctx.target ?? this.selectTarget(t, world, ctx);
|
||||
if (!isLiveTarinaiEntity(target) || target === t) return false;
|
||||
if (target?.isTarinaiChampion || (target?.intimidationCooldown || 0) > 0.04) return false;
|
||||
return basicCanStartWithTarget.call(this, t, world, { ...ctx, target });
|
||||
},
|
||||
start(t, world, ctx = {}) {
|
||||
const rival = ctx.target ?? this.selectTarget(t, world, ctx);
|
||||
if (!isLiveTarinaiEntity(rival) || rival === t || rival.isTarinaiChampion) return false;
|
||||
t.setActionState?.("intimidate", { target: rival, reason: this.label, sleeping: false });
|
||||
t.intimidateTimer = Math.max(t.intimidateTimer || 0, 0.85);
|
||||
return true;
|
||||
|
|
@ -440,8 +444,8 @@ function createIntimidateEnemyActionSpec() {
|
|||
tick(t, world) {
|
||||
if ((t.intimidateTimer || 0) > 0.04) return true;
|
||||
const rival = currentBehaviorTarget(t) || t.recentFightRival?.(80, 180);
|
||||
if (!rival) return false;
|
||||
return world?.startIntimidation?.(t, rival) || true;
|
||||
if (!isLiveTarinaiEntity(rival) || rival === t || rival.isTarinaiChampion) return "finished";
|
||||
return world?.startIntimidation?.(t, rival) ? "finished" : false;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue