Scale lesson gain by warmth the same way hunger already did.

The bar was live and drove dressing; a frozen pupil in class still learned as if it were May.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 09:06:50 +03:00
co-authored by Cursor
parent aaf539cacc
commit 274814aecd
10 changed files with 117 additions and 24 deletions
@@ -67,6 +67,36 @@ public class LessonLearningTests
Assert.NotEqual(skills.Values.First(), average);
}
[Fact]
public void ColdLearnsLessThanWarm()
{
var warm = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 1f, 0, 100, warmth: 1f);
var cold = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 1f, 0, 100, warmth: 0.1f);
Assert.True(cold > 50);
Assert.True(warm - 50 > cold - 50);
}
[Fact]
public void HungerStillCutsWhenWarm()
{
var full = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, hunger: 1f, traitOffset: 0, teacherSkill: 100, warmth: 1f);
var hungry = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, hunger: 0.1f, traitOffset: 0, teacherSkill: 100, warmth: 1f);
Assert.True(full - 50 > hungry - 50);
Assert.Equal(
LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 0.1f, 0, 100),
hungry);
}
[Fact]
public void MissingWarmthArgument_DefaultsToFull()
{
var implied = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 0.1f, 0, 100);
var explicitWarm = LessonLearning.Gain(50, Math, 1, 0.05f, 1f, 0.1f, 0, 100, warmth: 1f);
Assert.Equal(explicitWarm, implied);
}
[Fact]
public void MissingTeacherSkill_UsesRangeMin_AndStillGains()
{