fix(skeleton): make the progression real, and say so in the compendium

Four separate faults were behind one player report.

The tier table had drifted a long way from the published progression. Poison
immunity arrived at Bonemass instead of Eikthyr, auto-stun at The Queen instead
of The Elder, and lifesteal jumped 20/30/40 where the description promises a
climb in fives from 5% to 35%. Rewritten to match the description tier for tier,
which is the copy players actually read.

Poison immunity never worked even at the tier that granted it. SE_SkeletonStats
built its damage modifiers in Setup, which runs once when the effect is applied -
at spawn, before any boss has fallen - and nothing ever asked again, so the
modifiers stayed frozen at tier 1 for the whole session. Everything else the race
does re-reads the rules per hit, which is why only the modifiers looked broken.
They are now rebuilt when the tier actually changes.

Max health was whatever three scaled sausages happened to add up to. A Skeleton
cannot eat, so the race fakes three permanent foods to carry the tier bonus -
sound enough for regeneration, which Valheim drives off the food list, but the
number the game reads is Food.m_health, recomputed every second from the burn
curve, and anything that leaves those foods partly burnt or one short quietly
costs health. A Bonemass Skeleton had 95 where the table promises 165. The foods
stay for regeneration; the total is now overwritten at Player.GetTotalFoodValue,
which has exactly one caller and decides the number outright.

Skeleton Secrets was a one-line placeholder returning the same sentence at every
tier - never written rather than broken. It now unfolds tier by tier, and opens
by naming the standing the race believes it is on, so the next player who kills a
boss and sees nothing change can tell a tier that failed to advance from an
unlock that failed to fire.

The charred model moves from Fader to Moder, where the description asks for a
fire skeleton, and summons stay skeletons at both tiers rather than turning
charred at Fader. Both are one-line reverts if the old look is preferred.
This commit is contained in:
kanym 2026-08-05 16:33:27 +02:00
commit 5ef7a102da
4 changed files with 177 additions and 37 deletions

View file

@ -10,6 +10,35 @@ namespace RacesOfValheim
private static Mesh skeletonMesh = null;
private static Material[] skeletonMaterials = null;
/// <summary>
/// Makes the Skeleton's max health exactly what its progression promises.
///
/// A Skeleton cannot eat, so SkeletonRace fakes three permanent foods whose values are
/// scaled to add up to the tier's bonus. That is a good way to keep food-based health
/// regeneration working - Valheim regenerates from the food list, so a Skeleton with no
/// food would never heal - but a bad way to land an exact number: the value the game reads
/// is Food.m_health, which UpdateFood recomputes every second as
/// Pow(remaining/burnTime, 0.3) * m_food, and anything that leaves those three foods
/// partly burnt, partly rebuilt or one short quietly costs health. A Bonemass-tier
/// Skeleton reported 95 max health where the table promises 25 + 140.
///
/// So the foods stay, for regeneration, and the total they feed into is overwritten here.
/// GetTotalFoodValue has exactly one caller, Player.UpdateFood, which passes the result
/// straight to SetMaxHealth - so this is the single point where the number is decided, and
/// it now comes from the progression table rather than from three scaled sausages.
/// </summary>
[HarmonyPatch(typeof(Player), "GetTotalFoodValue")]
public static class Player_GetTotalFoodValue_SkeletonHealth_Patch
{
public static void Postfix(Player __instance, ref float hp)
{
if (__instance != Player.m_localPlayer || !SkeletonRace.IsSkeleton()) return;
int state = BossProgressionManager.GetCurrentProgressionState();
hp = __instance.m_baseHP + SkeletonProgression.GetMaxHealthBonus(state);
}
}
[HarmonyPatch(typeof(Player), "UseStamina")]
public static class Player_UseStamina_Patch
{