This commit is contained in:
33333-33333 2026-07-10 16:40:06 +09:00
commit 2636d580a8
75 changed files with 3890 additions and 1084 deletions

View file

@ -1,6 +1,40 @@
"use strict";
function inheritedChampionPersonality(seed = "", parents = [], opts = {}) {
const axes = ["aggression", "openness", "sociability"];
const profileFor = (birthSeed, profileOpts = {}) => globalThis.TarinaiSeedFactory?.birthProfile?.(birthSeed || "", profileOpts)?.birthPersonality || {};
const childBase = normalizePersonality(profileFor(seed, opts));
let inheritedAny = false;
for (const key of axes) {
let totalLegacy = 0;
let parentCount = 0;
for (const parent of parents || []) {
if (!parent) continue;
const parentBase = normalizePersonality(profileFor(parent.birthSeed || parent.familyKey || ""));
const born = normalizePersonality(parent.birthPersonality || parentBase);
// A champion's three boosted axes become a heritable lineage delta. A
// descendant that inherited that delta can pass a damped form onward.
const inheritedDelta = Math.max(0, (Number(born[key]) || 0) - (Number(parentBase[key]) || 0));
let championDelta = 0;
if (parent.isTarinaiChampion) {
const baseValue = Number(parentBase[key]) || 0;
const championTarget = clampPersonalityValue(Math.max(baseValue + 0.48, 0.86));
championDelta = Math.max(0, championTarget - baseValue);
}
const legacy = Math.max(inheritedDelta, championDelta);
if (legacy <= 0) continue;
totalLegacy += legacy;
parentCount += 1;
}
if (parentCount > 0 && totalLegacy > 0) {
childBase[key] = clampPersonalityValue((Number(childBase[key]) || 0) + (totalLegacy / parentCount) * 0.70);
inheritedAny = true;
}
}
return inheritedAny ? childBase : null;
}
(function (global) {
function socialPersonalityProfile(tarinai) {
@ -500,6 +534,13 @@
if (!opts.genetics && seedParents.length >= 2 && typeof inheritedGenetics === "function") {
opts.genetics = inheritedGenetics(seedParents[0], seedParents[1], opts.birthSeed || opts.familyKey || "");
}
if (!opts.birthPersonality && seedParents.length >= 2) {
const inheritedPersonality = inheritedChampionPersonality(opts.birthSeed || opts.familyKey || "", seedParents, opts);
if (inheritedPersonality) {
opts.birthPersonality = inheritedPersonality;
if (!opts.currentPersonality) opts.currentPersonality = { ...inheritedPersonality };
}
}
if (opts.genetics) {
if (!Number.isFinite(opts.adultScale) && typeof adultScaleFromGenetics === "function") opts.adultScale = adultScaleFromGenetics(opts.birthSeed || opts.familyKey || "", opts.genetics);
if (!Number.isFinite(opts.lifeSpan)) {
@ -821,6 +862,7 @@
lifeItemMode: "",
});
if (!child) return null;
this.birthEventCount = Math.max(0, Number(this.birthEventCount || 0) || 0) + 1;
if (zunchiSlaveChild) child.becomeZunchiSlave?.({ birth: true });
this.maxGeneration = Math.max(this.maxGeneration, child.generation);
a.hasPaired = true;