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
+5 -4
View File
@@ -3,9 +3,8 @@ using HSchool.Content;
namespace HSchool.Ai;
/// <summary>
/// How much a lesson adds to one skill this step. Hungry learns worse; trait offsets and the
/// teacher's subject skill scale the rate. The world stores the running total — this is just
/// the number.
/// How much a lesson adds to one skill this step. Hungry or cold learns worse; trait offsets and
/// the teacher's subject skill scale the rate. Missing warmth is treated as 1.
/// </summary>
public static class LessonLearning
{
@@ -54,13 +53,15 @@ public static class LessonLearning
float hours,
float hunger,
int traitOffset,
float teacherSkill)
float teacherSkill,
float warmth = 1f)
{
ArgumentNullException.ThrowIfNull(skill);
var delta = share
* lessonSkillPerHour
* hours
* NeedFactor(hunger)
* NeedFactor(warmth)
* TraitFactor(traitOffset)
* TeacherFactor(teacherSkill);
return Math.Clamp(current + delta, skill.Range.Min, skill.Range.Max);