Ergänze individuelle Charakterentwicklung und klare Hochzeitshinweise
Some checks failed
Deploy to production / deploy (push) Failing after 1m18s

This commit is contained in:
Torsten Schulz (local)
2026-11-04 14:16:11 +01:00
parent fddb97b385
commit 343bf64115
13 changed files with 350 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
// Ages are whole game years (one real calendar day per year).
export function hasReachedFertility(character, age) {
const threshold = character?.fertileFromAge;
return Number.isInteger(threshold) && threshold > 0
&& Number.isFinite(age) && age >= threshold;
}
export function getCharacterDevelopment(character, age) {
const pubertyStartAge = character?.pubertyStartAge ?? null;
return {
pubertyStartAge,
fertileFromAge: character?.fertileFromAge ?? null,
hasReachedPuberty: Number.isInteger(pubertyStartAge) && pubertyStartAge > 0
&& Number.isFinite(age) && age >= pubertyStartAge,
hasReachedFertility: hasReachedFertility(character, age),
};
}