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

@ -107,7 +107,7 @@ function updateNeeds(tarinai, world, dt = 0) {
}
}
if ((tarinai.fearTimer || 0) > 0.12 || (tarinai.lastDamageAt || -999) + 5 > (world?.time || 0)) raw.safety += 34;
const socialParts = { bond: 0, family: 0, mate: 0, conflict: 0, fearSocial: 0 };
const socialParts = { bond: 0, family: 0, mate: 0, conflict: 0, fearSocial: 0, crowd: 0 };
socialParts.bond = (tarinai.loneliness || 0) * (0.88 + Math.max(0, sociability) * 0.16);
raw.social = socialParts.bond;
if (tarinai.parentToFollow?.()) { socialParts.family += 18; raw.social += 18; }
@ -264,6 +264,7 @@ function actionSelectionBonus(action, need, tarinai, options = {}) {
else if (action.subNeed === "conflict") bonus += Number(p.conflict || 0) * 1.10 + Math.max(0, aggression) * 14;
else if (action.subNeed === "family") bonus += Number(p.family || 0) * 1.6 + Math.max(0, sociability) * 10;
else if (action.subNeed === "bond") bonus += Number(p.bond || 0) * 1.15 + Math.max(0, sociability) * 24;
else if (action.subNeed === "crowd") bonus += Number(p.crowd || 0) * 0.72;
} else if (need === "fulfill") {
const p = tarinai?.fulfillReasonParts || {};
if (action.id === "build_grass_bed") bonus += Number(p.bed || 0) * 1.6 + Number(p.material || 0);
@ -302,7 +303,7 @@ function socialFightMateActionWeights(tarinai) {
// regression guard baseline: return ({ conflict: 34, mate: 24, family: 12, bond: 14
// regression guard baseline: subValue >= threshold && subValue >= socialPull * 0.82
function socialSubNeedStartThreshold(subNeed = "") {
return ({ conflict: 18, mate: 24, family: 12, bond: 14, fearSocial: 18 })[subNeed] ?? 16;
return ({ conflict: 18, mate: 24, family: 12, bond: 14, fearSocial: 18, crowd: 18 })[subNeed] ?? 16;
}
function shouldStartActionBySubNeed(tarinai, action, needs) {
@ -319,6 +320,8 @@ function shouldStartActionBySubNeed(tarinai, action, needs) {
const subNeed = action.subNeed;
const subValue = Number(parts[subNeed] || 0) || 0;
const total = Number(needs?.social || 0) || 0;
const crowdValue = Math.max(0, Number(parts.crowd || 0) || 0);
const compatibleSocialTotal = subNeed === "crowd" ? crowdValue : Math.max(0, total - crowdValue);
const prof = tarinai?.personalityProfile?.() || {};
const cur = tarinai?.currentPersonality || {};
const modifier = subNeed === "conflict" ? Math.max(0, Number(cur.aggression ?? prof.fight ?? 0) || 0) * 8
@ -327,14 +330,18 @@ function shouldStartActionBySubNeed(tarinai, action, needs) {
: 0;
const threshold = Math.max(6, socialSubNeedStartThreshold(subNeed) - modifier);
const isContinuingSameAction = (getTarinaiBehaviorId(tarinai)) === action.id;
if (subNeed === "crowd") {
if (subValue >= threshold) return true;
return isContinuingSameAction && subValue >= threshold * 0.55;
}
if (subNeed === "mate" || subNeed === "conflict") {
const relationDrive = Math.max(Number(parts.mate || 0) || 0, Number(parts.conflict || 0) || 0, total * 0.36);
const relationDrive = Math.max(Number(parts.mate || 0) || 0, Number(parts.conflict || 0) || 0, compatibleSocialTotal * 0.36);
const drugBoosted = (tarinai?.loveMochiTimer || 0) > 0.04 || (tarinai?.fightMochiTimer || 0) > 0.04;
return total >= needThreshold("social", "start") && (drugBoosted || relationDrive >= Math.min(socialSubNeedStartThreshold("mate"), socialSubNeedStartThreshold("conflict")) * 0.48);
return compatibleSocialTotal >= needThreshold("social", "start") && (drugBoosted || relationDrive >= Math.min(socialSubNeedStartThreshold("mate"), socialSubNeedStartThreshold("conflict")) * 0.48);
}
if (subValue >= threshold) return true;
if (isContinuingSameAction && subValue >= threshold * 0.55) return true;
return total >= needThreshold("social", "start") && subValue >= threshold * 0.36;
return compatibleSocialTotal >= needThreshold("social", "start") && subValue >= threshold * 0.36;
}
function conflictNeedsForChoice(selectedAction, candidates, needs) {
@ -864,6 +871,7 @@ function resolveNeedsCore(dt) {
applyZunchiSlavePersonality(this, { birth: !!options.birth });
this.visibleSpriteId = this.zunchiSlaveSpriteId();
this.spriteLockUntil = 0;
this.world?.syncTarinaiCountEntry?.(this);
this.recordChangeCause?.("\u305a\u3093\u3061\u3069\u308c\u3044\u5316", "\u72b6\u614b");
return true;
},