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:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user