RacesOfValheim/JotunnModStub/Skeleton/SkeletonProgression.cs
kanym 5ef7a102da 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.
2026-08-05 16:33:27 +02:00

123 lines
4.4 KiB
C#

using System;
namespace RacesOfValheim
{
public static class SkeletonProgression
{
public static float GetMaxHealthBonus(int state)
{
if (state == 0) return 0f;
if (state == 1) return 50f;
if (state == 2) return 80f;
if (state == 3) return 110f;
if (state == 4) return 140f;
if (state == 5) return 170f;
if (state == 6) return 200f;
if (state == 7) return 230f;
if (state >= 8) return 275f;
return 50f;
}
public struct SkeletonRules
{
public float LifestealPercent;
public bool EnhancedRegen;
public bool PoisonImmunity;
public bool PoisonAttacks;
public bool AutoResurrect;
public bool SummonOnKill;
public int MaxSummons;
public string SummonPrefab;
public bool AutoStunFirstHit;
public bool FireAura;
public string ModelPrefab;
public UnityEngine.Vector3 ScaleMultiplier;
}
public const string BaseModel = "Skeleton";
public const string PoisonModel = "Skeleton_Poison";
// The published progression calls for a fire skeleton from Moder on, and the charred
// twitcher is the only burnt skeleton the game ships. It used to arrive at Fader; if that
// is preferred, move the model and its scale back to the state >= 8 block - nothing else
// in this file depends on where they sit.
public const string FireModel = "Charred_Twitcher";
// The charred rig is broader and shorter than a plain skeleton, so it needs squeezing to
// read as a player. Tied to the model, not to a tier.
public static readonly UnityEngine.Vector3 FireModelScale = new UnityEngine.Vector3(0.85f, 1.20f, 0.85f);
public const string SummonPrefabName = "Skeleton_friendly";
/// <summary>
/// Every tier, exactly as the race's published progression describes it. The table had
/// drifted a long way from that description - poison immunity arrived two tiers late,
/// auto-stun four tiers late, and lifesteal jumped 20/30/40 instead of climbing in fives -
/// which is what players were reporting as "progression doesn't work".
///
/// The blocks are cumulative: each one only states what its boss adds or replaces.
/// </summary>
public static SkeletonRules GetRules(int state)
{
SkeletonRules rules = new SkeletonRules
{
LifestealPercent = 0f,
EnhancedRegen = false,
PoisonImmunity = false,
PoisonAttacks = false,
AutoResurrect = false,
SummonOnKill = false,
MaxSummons = 0,
SummonPrefab = "",
AutoStunFirstHit = false,
FireAura = false,
ModelPrefab = BaseModel,
ScaleMultiplier = UnityEngine.Vector3.one
};
if (state >= 2) // Eikthyr
{
rules.ModelPrefab = PoisonModel;
rules.PoisonImmunity = true;
rules.LifestealPercent = 0.05f;
}
if (state >= 3) // The Elder
{
rules.LifestealPercent = 0.10f;
rules.AutoStunFirstHit = true;
}
if (state >= 4) // Bonemass
{
rules.LifestealPercent = 0.15f;
rules.PoisonAttacks = true;
}
if (state >= 5) // Moder
{
rules.LifestealPercent = 0.20f;
rules.ModelPrefab = FireModel;
rules.ScaleMultiplier = FireModelScale;
rules.FireAura = true;
rules.EnhancedRegen = true;
}
if (state >= 6) // Yagluth
{
rules.LifestealPercent = 0.25f;
rules.AutoResurrect = true;
}
if (state >= 7) // The Queen
{
rules.LifestealPercent = 0.30f;
rules.SummonOnKill = true;
rules.MaxSummons = 3;
rules.SummonPrefab = SummonPrefabName;
}
if (state >= 8) // Fader
{
rules.LifestealPercent = 0.35f;
rules.MaxSummons = 5;
}
return rules;
}
}
}