feat(dvergar): rename from Dvergur, and give it a lightning affinity

Rename covers the folder, all seven filenames and every identifier, status
effect name and display string. Valheim's own Dverger/dvergr prefab references
are untouched - the names never collided.

The race id is what sits in m_customData and the ZDO, so renaming it alone would
have handed every existing character the selection menu again. DvergarRace
migrates the old id on spawn, before anything else reads it.

Runic Spark is modelled on Skadi's Ice Affinity and deliberately shares its
shape: live from the base tier and growing a flat step per progression state, so
+2 at Base through +16 after Fader. Lightning rather than frost, and like
Skadi's it rides every blow rather than melee only. AddFlat gained the elemental
channels while it was there - lightning would otherwise have landed in generic
damage.

The Trol remote-sync trace fired on a two-second timer for as long as a remote
player existed, which in the main menu is forever: Player.m_localPlayer is null
there, so the character preview counts as remote and it never stopped. Keyed on
the state it reports instead, so it still catches a remote player being sized
wrongly without narrating an idle menu.
This commit is contained in:
kanym 2026-08-04 00:22:58 +02:00
commit 5febc588ea
12 changed files with 287 additions and 219 deletions

View file

@ -16,7 +16,7 @@ namespace RacesOfValheim
"Furling Secrets",
"Trol Secrets",
"Draugh Secrets",
"Dvergur Secrets"
"Dvergar Secrets"
};
public static void UpdateCompendiumText(Player player)
@ -68,9 +68,9 @@ namespace RacesOfValheim
{
GenerateDraughText(knownTexts, state, player);
}
else if (currentRace == DvergurConfig.RaceId)
else if (currentRace == DvergarConfig.RaceId)
{
GenerateDvergurText(knownTexts, state);
GenerateDvergarText(knownTexts, state);
}
}
@ -78,17 +78,19 @@ namespace RacesOfValheim
/// Reads its figures straight out of the live rules rather than restating them, so the
/// entry cannot drift from the code the way a hand-written percentage would.
/// </summary>
private static void GenerateDvergurText(Dictionary<string, string> knownTexts, int state)
private static void GenerateDvergarText(Dictionary<string, string> knownTexts, int state)
{
DvergurProgression.DvergurRules rules = DvergurProgression.GetRules(state);
DvergarProgression.DvergarRules rules = DvergarProgression.GetRules(state);
StringBuilder sb = new StringBuilder();
sb.AppendLine("The Dvergur's Craft\n");
sb.AppendLine("The Dvergar's Craft\n");
sb.AppendLine($"[Base Passive] Small and Stubborn: You stand a third shorter than a human and carry {rules.HealthMalus:0.#} less health for it. The dvergr hood never leaves your head - wear whatever helm you please and keep every point of its protection, but the runes will always show you as one of the deep folk.\n");
sb.AppendLine($"[Base Passive] Runic Spark: The runes in your blood earth themselves through whatever you strike. Every blow you land carries +{rules.ElementalDamage:0.#} Lightning damage - a bonus that grows as each boss falls.\n");
List<string> weapons = new List<string>();
foreach (DvergurConfig.WeaponAffinity affinity in rules.Affinities)
foreach (DvergarConfig.WeaponAffinity affinity in rules.Affinities)
{
weapons.Add(affinity.DisplayName);
}
@ -107,12 +109,12 @@ namespace RacesOfValheim
sb.AppendLine($"[Bonemass Unlock] Kin of the Traders (Passive): Haldor and Hildir know their own. Their prices drop by {rules.TraderBuyDiscount * 100f:0}% for you, and what they pay for your trophies and hunting rewards rises by {rules.TraderSellBonus * 100f:0}%.\n");
if (rules.RunicPing)
sb.AppendLine($"[Yagluth Unlock] Runic Ping ('{DvergurConfig.RunicPingKey}' Key): Spend {DvergurConfig.RunicPingEitrCost:0} eitr to send a pulse through the stone. For {DvergurConfig.RunicPingDuration:0} seconds every ore vein and every hidden enemy within {DvergurConfig.RunicPingRadius:0} meters is lit for you alone.\n");
sb.AppendLine($"[Yagluth Unlock] Runic Ping ('{DvergarConfig.RunicPingKey}' Key): Spend {DvergarConfig.RunicPingEitrCost:0} eitr to send a pulse through the stone. For {DvergarConfig.RunicPingDuration:0} seconds every ore vein and every hidden enemy within {DvergarConfig.RunicPingRadius:0} meters is lit for you alone.\n");
if (rules.RunicOvercharge)
sb.AppendLine($"[Fader Unlock] Runic Overcharge ('{DvergurConfig.RunicOverchargeKey}' Key): Spend {DvergurConfig.RunicOverchargeEitrCost:0} eitr to load the runes. Your next blow with a favoured weapon lands with {DvergurConfig.RunicOverchargeMultiplier:0}x its weight. Hold the charge no longer than {DvergurConfig.RunicOverchargeWindow:0} seconds or it bleeds away.\n");
sb.AppendLine($"[Fader Unlock] Runic Overcharge ('{DvergarConfig.RunicOverchargeKey}' Key): Spend {DvergarConfig.RunicOverchargeEitrCost:0} eitr to load the runes. Your next blow with a favoured weapon lands with {DvergarConfig.RunicOverchargeMultiplier:0}x its weight. Hold the charge no longer than {DvergarConfig.RunicOverchargeWindow:0} seconds or it bleeds away.\n");
knownTexts["Dvergur Secrets"] = sb.ToString();
knownTexts["Dvergar Secrets"] = sb.ToString();
}
private static void GenerateDraughText(Dictionary<string, string> knownTexts, int state, Player player)