feat(dvergur): add the Dvergur race scaffold
An eighth race built on the existing per-race pattern: a MonoBehaviour driver registered from Awake, a progression table keyed on the boss state, an SE_Stats carrier, and Harmony patches for the individual perks. The helmet slot stays free. Whatever the player equips keeps every one of its stats and only its mesh is swapped for the dvergr hood, which is the Skeleton's helmet handling turned into a replacement rather than a plain hide. Every percentage the spec left open lives in DvergurConfig as a named value and is marked TODO there, so tuning the race never means touching the logic. The knobs are static readonly rather than const so that switching a perk off with a zero does not fold its guard into dead code.
This commit is contained in:
parent
4cd452d187
commit
3ec51aeb45
10 changed files with 1365 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ namespace RacesOfValheim
|
|||
"Skeleton Secrets",
|
||||
"Furling Secrets",
|
||||
"Trol Secrets",
|
||||
"Draugh Secrets"
|
||||
"Draugh Secrets",
|
||||
"Dvergur Secrets"
|
||||
};
|
||||
|
||||
public static void UpdateCompendiumText(Player player)
|
||||
|
|
@ -67,6 +68,51 @@ namespace RacesOfValheim
|
|||
{
|
||||
GenerateDraughText(knownTexts, state, player);
|
||||
}
|
||||
else if (currentRace == DvergurConfig.RaceId)
|
||||
{
|
||||
GenerateDvergurText(knownTexts, state);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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)
|
||||
{
|
||||
DvergurProgression.DvergurRules rules = DvergurProgression.GetRules(state);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("The Dvergur'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");
|
||||
|
||||
List<string> weapons = new List<string>();
|
||||
foreach (DvergurConfig.WeaponAffinity affinity in rules.Affinities)
|
||||
{
|
||||
weapons.Add(affinity.DisplayName);
|
||||
}
|
||||
if (weapons.Count > 0)
|
||||
{
|
||||
sb.AppendLine($"Weapon Affinity (Passive): {string.Join(", ", weapons.ToArray())}. Blows struck with these land harder and cost less stamina. The saving never grows - a tier only ever hands you another weapon to feel at home with - and your skill rises no faster than anyone else's.\n");
|
||||
}
|
||||
|
||||
if (rules.MiningAffinity)
|
||||
sb.AppendLine("[Eikthyr Unlock] Mining Affinity (Passive): The pickaxe answers to you. Veins break faster, cost you less stamina to work, and sometimes give up more than they should.\n");
|
||||
|
||||
if (rules.SmithingDiscount > 0f)
|
||||
sb.AppendLine($"[Bonemass Unlock] Smithing and Jewelry (Passive): You waste nothing at the anvil. Metal and gems cost you {rules.SmithingDiscount * 100f:0}% less when crafting and upgrading.\n");
|
||||
|
||||
if (rules.TraderBuyDiscount > 0f || rules.TraderSellBonus > 0f)
|
||||
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");
|
||||
|
||||
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");
|
||||
|
||||
knownTexts["Dvergur Secrets"] = sb.ToString();
|
||||
}
|
||||
|
||||
private static void GenerateDraughText(Dictionary<string, string> knownTexts, int state, Player player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue