Enhance family and roster management in school simulation by implementing support for incomplete families, ensuring proper handling of absent parents while maintaining surname consistency. Update family creation logic to account for single-parent households and revise child identification to prevent ID conflicts. Introduce seat shuffling to prevent siblings from being placed in the same class, improving the realism of student distribution. Update related tests to validate these new functionalities and ensure robustness in family and roster handling.
This commit is contained in:
@@ -57,6 +57,7 @@ internal static class PersonSampler
|
||||
values[skill.DefName] = rolled;
|
||||
}
|
||||
|
||||
var touched = new HashSet<string>(StringComparer.Ordinal);
|
||||
foreach (var traitName in traits)
|
||||
{
|
||||
if (!catalog.Traits.TryGetValue(traitName, out var trait))
|
||||
@@ -73,9 +74,19 @@ internal static class PersonSampler
|
||||
}
|
||||
|
||||
values[modifier.Skill] = Clamp(current + modifier.Offset, skill.Range);
|
||||
touched.Add(modifier.Skill);
|
||||
}
|
||||
}
|
||||
|
||||
// The body has the last word. Without this pass a trait modifier reopened what the body
|
||||
// closed: a skinny Bully rolled Strength 45, the trait added 8, and the "Skinny caps
|
||||
// Strength at 45" limit was silently gone.
|
||||
foreach (var skillName in touched)
|
||||
{
|
||||
var skill = catalog.Skills[skillName];
|
||||
values[skillName] = Clamp(ApplyBodyLimits(values[skillName], skill, choices), skill.Range);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user