Sum warmth insulation from worn items and refresh goldens for the new trait pool.

HeatLoving and ColdLoving shift later trait rolls; worn clothes now feed PersonInsulation instead of reflection.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 04:00:53 +03:00
co-authored by Cursor
parent 34acec16c2
commit 53c4ae0f92
7 changed files with 389 additions and 289 deletions
@@ -45,6 +45,22 @@ public class WarmthTests
Assert.True(coated > naked, $"jacket {coated} should beat naked {naked}");
}
[Fact]
public void FromPerson_SumsWornInsulation_AndIgnoresHome()
{
using var school = Open(JanuaryMorning);
var catalog = school.Catalog!;
var person = school.Roster!.People.First(row =>
row.Items.Any(item => item.Location.Equals(ItemLocations.Worn, StringComparison.Ordinal)));
Assert.True(PersonInsulation.FromPerson(person, catalog).Value > 0);
var atHome = person with
{
Items = [.. person.Items.Select(item => item with { Location = ItemLocations.Home })],
};
Assert.Equal(0, PersonInsulation.FromPerson(atHome, catalog).Value);
}
private static void PutFirstPerson(School school, string? nodeId, PersonInsulation insulation, float warmth)
{
var query = new QueryDescription().WithAll<PersonNeeds, PersonInsulation, Presence>();