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.
64 lines
2.7 KiB
C#
64 lines
2.7 KiB
C#
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
public class SE_SkeletonStats : SE_Stats
|
|
{
|
|
// The tier the current m_mods were built for. -1 means "never built".
|
|
private int m_appliedState = -1;
|
|
|
|
public override void Setup(Character character)
|
|
{
|
|
base.Setup(character);
|
|
RebuildDamageMods();
|
|
}
|
|
|
|
public override void UpdateStatusEffect(float dt)
|
|
{
|
|
base.UpdateStatusEffect(dt);
|
|
|
|
// Setup runs once, when the effect is first applied - so the damage modifiers were
|
|
// frozen at whatever tier the player happened to be on then, usually tier 1 because the
|
|
// effect goes on at spawn before a boss is ever killed. Poison immunity therefore never
|
|
// arrived: killing the boss changed the rules, and nothing ever asked them again.
|
|
// Everything else the race does re-reads GetRules per hit, which is why only the
|
|
// modifiers looked broken. Re-check here instead; the state comparison makes it free.
|
|
RebuildDamageMods();
|
|
}
|
|
|
|
private void RebuildDamageMods()
|
|
{
|
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
|
if (state == m_appliedState) return;
|
|
m_appliedState = state;
|
|
|
|
SkeletonProgression.SkeletonRules rules = SkeletonProgression.GetRules(state);
|
|
|
|
m_mods = new List<HitData.DamageModPair>
|
|
{
|
|
new HitData.DamageModPair { m_type = HitData.DamageType.Pierce, m_modifier = HitData.DamageModifier.Resistant },
|
|
new HitData.DamageModPair { m_type = HitData.DamageType.Slash, m_modifier = HitData.DamageModifier.Resistant },
|
|
new HitData.DamageModPair { m_type = HitData.DamageType.Blunt, m_modifier = HitData.DamageModifier.Weak }
|
|
};
|
|
|
|
if (rules.PoisonImmunity)
|
|
{
|
|
m_mods.Add(new HitData.DamageModPair { m_type = HitData.DamageType.Poison, m_modifier = HitData.DamageModifier.Immune });
|
|
}
|
|
}
|
|
}
|
|
|
|
public class SE_SkeletonResurrectCooldown : StatusEffect
|
|
{
|
|
public override void Setup(Character character)
|
|
{
|
|
base.Setup(character);
|
|
m_name = "Resurrection Cooldown";
|
|
m_tooltip = "Your skeletal body is too weak to resurrect again right now.";
|
|
m_icon = Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeletonPoison")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon()
|
|
?? Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>("TrophySkeleton")?.GetComponent<ItemDrop>()?.m_itemData.GetIcon();
|
|
m_ttl = 300f; // 5 minutes
|
|
}
|
|
}
|
|
}
|