This commit is contained in:
33333-33333 2026-07-16 22:12:03 +09:00
commit 2cc2f003df
71 changed files with 3359 additions and 1027 deletions

View file

@ -268,7 +268,7 @@ function actionSelectionBonus(action, need, tarinai, options = {}) {
const p = tarinai?.fulfillReasonParts || {};
if (action.id === "build_grass_bed") bonus += Number(p.bed || 0) * 1.6 + Number(p.material || 0);
else if (action.id === "build_plushie") bonus += Number(p.plushie || 0) * 1.8 + Number(p.material || 0);
else if (action.id === "play" || action.id === "wander_lightly") bonus += Number(p.boredom || 0) * 1.2;
else if (action.id === "play" || action.id === "play_seesaw" || action.id === "wander_lightly") bonus += Number(p.boredom || 0) * 1.2;
else if (options.includeComfortActions && (action.id === "return_owned_structure" || action.id === "use_plushie")) {
bonus += Math.max(0, -Number(p.bedComfort || 0) - Number(p.plushieComfort || 0)) * 0.5;
}
@ -311,6 +311,9 @@ function shouldStartActionBySubNeed(tarinai, action, needs) {
const status = tarinai?.temperatureStatus || tarinai?.world?.temperatureStatusFor?.(tarinai?.feltTemperature ?? tarinai?.tempComfort ?? (CONFIG.standardTemperature ?? 15), tarinai);
return Boolean(status && (status.discomfort || 0) >= 2.5);
}
if (action?.id === "play_seesaw") {
return Boolean(globalThis.TarinaiSeesawSystem?.shouldSeek?.(tarinai?.world, tarinai, needs));
}
if (need !== "social" || !action?.subNeed) return shouldStartNeedAction(tarinai, need, needs);
const parts = tarinai?.socialReasonParts || {};
const subNeed = action.subNeed;
@ -376,6 +379,9 @@ function choosePriorityNeedAction(needs, tarinai, world) {
const status = tarinai?.world?.temperatureStatusFor?.(felt, tarinai) || tarinai?.temperatureStatus || null;
priority = (status?.harmful || (status?.harmExcess || 0) > 0) ? 92 : 53;
}
if (action.id === "play_seesaw") {
priority = Math.max(priority, Number(globalThis.TarinaiSeesawSystem?.actionPriority?.(world, tarinai)) || 0);
}
if (action.id === "eat_food") {
const hunger = Number(tarinai?.hunger || 0) || 0;
if (hunger >= 98 || needValue >= 88) priority = Math.max(priority, 120);
@ -495,6 +501,7 @@ function continueCurrentBehavior(tarinai, world, needs, dt) {
|| (action.id === "panic_escape" && (tarinai.fearTimer || 0) > 0.04 && tarinai.state === "panic")
|| (action.id === "intimidate_enemy" && (tarinai.intimidateTimer || 0) > 0.04)
|| (action.id === "sunbath" && (tarinai.sunbathTimer || 0) > 0.04)
|| (action.id === "play_seesaw" && Boolean(globalThis.TarinaiSeesawSystem?.validReservation?.(tarinai, world)))
|| ((action.id === "eat_food" || action.id === "drink_water" || action.id === "use_medicine") && (tarinai.eatTimer || 0) > 0.04 && elapsed < 1.15);
const foodSuppressed = need === "food" && !isCurrentBehaviorForced(tarinai) && (tarinai.mealCooldownUntil || 0) > now && (tarinai.hunger || 0) < 82 && value < 78 && elapsed >= Math.min(minDuration, 1.15);
if (!foodSuppressed && (elapsed < minDuration || value >= needThreshold(need, "continue") || mustContinueByTimer || isCurrentBehaviorForced(tarinai))) {