This commit is contained in:
33333-33333 2026-07-18 22:15:26 +09:00
commit d163ceb291
76 changed files with 1385 additions and 524 deletions

View file

@ -115,7 +115,13 @@ function updateNeeds(tarinai, world, dt = 0) {
? (world?.nearestOther?.(tarinai, 780, other => other && other !== tarinai && !other.dead && other.isTarinaiChampion && !world.areParentChild?.(tarinai, other) && !!tarinai.isZunchiSlave === !!other.isZunchiSlave && !other.sleepDisease && !other.fightDisease && (other.reproductionTimer || 0) <= 10) || null)
: null;
if (championMate) { socialParts.mate += 48; socialParts.championMate = 1; raw.social += 48; }
else if ((tarinai.reproductionTimer || 0) <= 8 && !tarinai.hasPaired) { socialParts.mate += 16 + ((tarinai.loveMochiTimer || 0) > 0.04 ? 42 : 0); raw.social += socialParts.mate; }
else if (!tarinai.juvenile && (tarinai.reproductionTimer || 0) <= 8 && !tarinai.hasPaired && (world?.canAddTarinai?.(1) ?? true)) {
// Mating is its own relationship sub-need. It must remain actionable even
// after ordinary loneliness has been relieved by a larger colony; otherwise
// only the initial lonely generation ever seeks a partner.
socialParts.mate += 28 + ((tarinai.loveMochiTimer || 0) > 0.04 ? 42 : 0);
raw.social += socialParts.mate;
}
const enemy = tarinai.strongestRelation?.("fear");
if (enemy?.score > 12) { socialParts.fearSocial += 10; raw.social += 10; }
const conflict = evaluateConflictUrge(tarinai, world, 112);
@ -334,9 +340,17 @@ function shouldStartActionBySubNeed(tarinai, action, needs) {
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, compatibleSocialTotal * 0.36);
const drugBoosted = (tarinai?.loveMochiTimer || 0) > 0.04 || (tarinai?.fightMochiTimer || 0) > 0.04;
if (subNeed === "mate") {
// A ready mating drive is not the same thing as loneliness. Requiring the
// aggregate social need to exceed 52 made reproduction disappear once a
// colony became socially dense, even though new unpaired adults were ready.
if (subValue >= threshold) return true;
if (isContinuingSameAction && subValue >= threshold * 0.55) return true;
return (tarinai?.loveMochiTimer || 0) > 0.04 && subValue > 0;
}
if (subNeed === "conflict") {
const relationDrive = Math.max(Number(parts.conflict || 0) || 0, compatibleSocialTotal * 0.36);
const drugBoosted = (tarinai?.fightMochiTimer || 0) > 0.04;
return compatibleSocialTotal >= needThreshold("social", "start") && (drugBoosted || relationDrive >= Math.min(socialSubNeedStartThreshold("mate"), socialSubNeedStartThreshold("conflict")) * 0.48);
}
if (subValue >= threshold) return true;