chore(release): v1.5.3

Version bumped in manifest.json, the packaging manifest and PluginVersion.
Valheim 1.0's new creatures for the Aswid and the Draugh (seal, moose,
Elaking, Jotun, Barka, Deep North Goblin and every Dvergr), the Elaking
Hair Bundle in the blood refinery, and the Skeleton choosing its look at
the barber.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ferdinando 2026-10-01 08:19:36 +02:00
commit b9ac02fe50
15 changed files with 267 additions and 15 deletions

View file

@ -68,6 +68,7 @@ namespace RacesOfValheim
{ "AsksvinCarrionRibcage", 3 },
{ "AsksvinCarrionSkull", 3 },
{ "UndeadBjornRibcage", 3 }, // Deep North
{ "ElakingHairBundle", 20 }, // Deep North, dropped by the Elaking
};
// Vanilla grills. Anything they cook counts as raw flesh, which keeps modded meat working.

View file

@ -44,7 +44,32 @@ namespace RacesOfValheim
{ "Ulv", "TrophyUlv" },
{ "Fenring_Cultist", "TrophyCultist" }, // the prefab is Fenring_Cultist, not "Cultist"
{ "Asksvin", "TrophyAsksvin" },
{ "Volture", "TrophyVolture" }
{ "Volture", "TrophyVolture" },
// Valheim 1.0's seals. The baby is Seal_Pup in the prefab list - "baby" is only its
// display token ($enemy_seal_baby). Both wear the one TrophySeal icon.
// The frozen Greydwarfs have no trophy of their own; they borrow the regular one's icon.
{ "Greydwarf_Frozen", "TrophyGreydwarf" },
{ "Greydwarf_Shaman_Frozen", "TrophyGreydwarfShaman" },
{ "Elaking", "TrophyElaking" },
{ "ElakingLantern", "TrophyElaking" },
{ "Moose", "TrophyMoose" },
{ "Moose_calf", "TrophyMoose" },
{ "Barka", "TrophyBarka" },
{ "JotunWarrior", "TrophyJotunWarrior" },
{ "JotunWarriorDualWield", "TrophyJotunWarrior" },
{ "JotunWitch", "TrophyJotunWitch" },
{ "ElakingMole", "TrophyMole" },
{ "GoblinDeepNorth", "TrophyGoblin" },
{ "DvergerDeepNorth", "TrophyDvergr" },
// The Dvergr from before the Deep North, all of them: 90 HP for 25 minutes.
{ "Dverger", "TrophyDvergr" },
{ "DvergerMage", "TrophyDvergr" },
{ "DvergerMageFire", "TrophyDvergr" },
{ "DvergerMageIce", "TrophyDvergr" },
{ "DvergerMageSupport", "TrophyDvergr" },
{ "DvergerAshlands", "TrophyDvergr" },
{ "Seal", "TrophySeal" },
{ "Seal_Pup", "TrophySeal" }
};
private static Dictionary<string, string> mobToFoodMap = new Dictionary<string, string>
@ -65,7 +90,18 @@ namespace RacesOfValheim
{ "SeekerBrute", "CookedBugMeat" },
{ "SeekerBrood", "CookedBugMeat" },
{ "Surtling", "BloodPudding" },
{ "Bear", "CookedBearMeat" }
{ "Bear", "CookedBearMeat" },
// Same meal as the Draugh's raw Seal Blubber: vanilla's Seal Meat Soup, so a seal is
// worth exactly what the soup is, adult or pup.
{ "Greydwarf_Frozen", "SealSoup" },
{ "Greydwarf_Shaman_Frozen", "SealSoup" },
// The Cooked Asksvin Tail (prefab CookedAsksvinMeat), the same meal the Asksvin gives.
{ "Elaking", "CookedAsksvinMeat" },
{ "ElakingLantern", "CookedAsksvinMeat" },
{ "Moose", "CookedMooseMeat" },
{ "Moose_calf", "CookedMooseMeat" },
{ "Seal", "SealSoup" },
{ "Seal_Pup", "SealSoup" }
};
public static bool BypassAswidFoodCheck = false;
@ -155,7 +191,9 @@ namespace RacesOfValheim
if (c != null)
{
float foodHp = Mathf.Min(c.m_health / 2f, 150f);
float burnTime = c.m_health * 2f;
// Capped at 50 minutes: a tough creature like the Barka would otherwise
// feed for over an hour.
float burnTime = Mathf.Min(c.m_health * 2f, 3000f);
// StartsWith("Fenring") already covers Fenring_Cultist. "Fuling" was
// never a prefab prefix - the family is Goblin* - so that arm of the
// test matched nothing until now.
@ -163,6 +201,10 @@ namespace RacesOfValheim
{
burnTime = 1200f; // 20 minutes
}
else if (mobName == "JotunWitch") { foodHp = 120f; burnTime = 3600f; } // 60 minutes
else if (mobName == "ElakingMole") { foodHp = 100f; burnTime = 1800f; } // 30 minutes
else if (mobName.StartsWith("Dverger") && mobName != "DvergerDeepNorth") { foodHp = 90f; burnTime = 1500f; } // 25 minutes
else if (mobName == "DvergerDeepNorth") { foodHp = 100f; burnTime = 1800f; } // 30 minutes
else if (mobName == "Greyling") { foodHp = 20f; burnTime = 1200f; }
else if (mobName == "Greydwarf") { foodHp = 25f; burnTime = 1200f; }
else if (mobName == "Greydwarf_Shaman") { foodHp = 30f; burnTime = 1200f; }

View file

@ -27,7 +27,11 @@ namespace RacesOfValheim
{ "VoltureMeat", "RoastedVoltureMeat" },
{ "GreydwarfEye", "DeerStew" },
{ "Entrails", "Sausages" },
{ "Bloodbag", "BloodPudding" }
{ "Bloodbag", "BloodPudding" },
{ "MooseMeat", "CookedMooseMeat" },
// Raw blubber keeps its own name and icon (EdibleUncooked_ copies them from the raw
// item) and gives the stats of Seal Meat Soup.
{ "SealBlubber", "SealSoup" }
};
[HarmonyPatch(typeof(Humanoid), "UseItem")]

View file

@ -1,7 +1,7 @@
{
"name": "RacesOfValheim",
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
"version_number": "1.5.2",
"version_number": "1.5.3",
"website_url": "",
"dependencies": [
"denikson-BepInExPack_Valheim-5.4.2333",

View file

@ -15,7 +15,7 @@ namespace RacesOfValheim
{
public const string PluginGUID = "com.nandor.racesofvalheim";
public const string PluginName = "Races Of Valheim";
public const string PluginVersion = "1.5.2";
public const string PluginVersion = "1.5.3";
private readonly Harmony harmony = new Harmony(PluginGUID);

View file

@ -0,0 +1,124 @@
using HarmonyLib;
using UnityEngine;
namespace RacesOfValheim
{
/// <summary>
/// The barber's own window, put to work for the Skeleton. Hair and beard are hidden on this
/// race, so the two hair arrows would change nothing anyone can see; for a Skeleton they step
/// through the bodies this tier has unlocked instead (normal, green, flames), the label
/// between them names the one worn, Apply keeps it and Cancel puts the old one back.
///
/// The look is cosmetic - see SkeletonProgression.ResolveModel - and lives in m_customData,
/// which SkeletonRace copies to the ZDO so everyone else sees it too.
/// </summary>
public static class SkeletonBarber
{
// What was worn when the chair was sat in, for Cancel.
private static string lookOnOpen = "";
private static bool Active =>
Player.m_localPlayer != null && SkeletonRace.IsSkeleton();
private static void Step(int direction)
{
Player player = Player.m_localPlayer;
int state = BossProgressionManager.GetCurrentProgressionState();
var models = SkeletonProgression.UnlockedModels(state);
int at = models.IndexOf(SkeletonVisuals.GetModel(player, state));
int next = (at + direction + models.Count) % models.Count;
SetLook(player, models[next]);
}
private static void SetLook(Player player, string look)
{
player.m_customData[SkeletonVisuals.LookDataKey] = look;
// Rebuild the body now, so the mirror-less barber still shows the result.
VisEquipment vis = player.GetComponent<VisEquipment>();
if (vis != null) Traverse.Create(vis).Method("UpdateVisuals").GetValue();
}
private static string LabelFor(string model)
{
return ModText.Get(model == SkeletonProgression.FireModel ? "rov_msg_skeleton_look_flames"
: model == SkeletonProgression.PoisonModel ? "rov_msg_skeleton_look_green"
: "rov_msg_skeleton_look_normal");
}
[HarmonyPatch(typeof(PlayerCustomizaton), nameof(PlayerCustomizaton.ShowBarberGui))]
public static class ShowBarberGui_Patch
{
public static void Postfix()
{
if (!Active) return;
lookOnOpen = SkeletonVisuals.GetModel(Player.m_localPlayer, BossProgressionManager.GetCurrentProgressionState());
}
}
[HarmonyPatch(typeof(PlayerCustomizaton), "OnHairLeft")]
public static class OnHairLeft_Patch
{
public static bool Prefix()
{
if (!Active) return true;
Step(-1);
return false;
}
}
[HarmonyPatch(typeof(PlayerCustomizaton), "OnHairRight")]
public static class OnHairRight_Patch
{
public static bool Prefix()
{
if (!Active) return true;
Step(1);
return false;
}
}
// The beard arrows have nothing to do for a Skeleton.
[HarmonyPatch(typeof(PlayerCustomizaton), "OnBeardLeft")]
public static class OnBeardLeft_Patch
{
public static bool Prefix() => !Active;
}
[HarmonyPatch(typeof(PlayerCustomizaton), "OnBeardRight")]
public static class OnBeardRight_Patch
{
public static bool Prefix() => !Active;
}
[HarmonyPatch(typeof(PlayerCustomizaton), "OnCancel")]
public static class OnCancel_Patch
{
public static void Prefix()
{
if (!Active) return;
SetLook(Player.m_localPlayer, lookOnOpen);
}
}
// The window refreshes its labels every frame, so the name is written after it.
[HarmonyPatch(typeof(PlayerCustomizaton), "Update")]
public static class Update_Patch
{
public static void Postfix(PlayerCustomizaton __instance)
{
if (!Active || !PlayerCustomizaton.IsBarberGuiVisible()) return;
if (__instance.m_selectedHair != null)
{
__instance.m_selectedHair.text = LabelFor(
SkeletonVisuals.GetModel(Player.m_localPlayer, BossProgressionManager.GetCurrentProgressionState()));
}
if (__instance.m_beardPanel != null && __instance.m_beardPanel.gameObject.activeSelf)
{
__instance.m_beardPanel.gameObject.SetActive(false);
}
}
}
}
}

View file

@ -263,7 +263,10 @@ namespace RacesOfValheim
int state = SkeletonVisuals.GetProgressionState(p);
SkeletonProgression.SkeletonRules rules = SkeletonProgression.GetRules(state);
string targetBodyName = $"SkeletonBody_{rules.ModelPrefab}";
// The look chosen at the barber, when it is still unlocked; the tier's own
// body otherwise. Cosmetic: rules keeps driving every ability.
string modelPrefab = SkeletonVisuals.GetModel(p, state);
string targetBodyName = $"SkeletonBody_{modelPrefab}";
// Check if we already created the Skeleton body for this VisEquipment
Transform parentTransform = __instance.m_bodyModel.transform.parent;
@ -282,21 +285,21 @@ namespace RacesOfValheim
if (skeletonBodyTransform == null)
{
GameObject skelPrefab = PrefabManager.Cache.GetPrefab<GameObject>(rules.ModelPrefab);
GameObject skelPrefab = PrefabManager.Cache.GetPrefab<GameObject>(modelPrefab);
// The cache answers by name alone, and every magic mod named in the
// purple-smoke report carries an object of its own called "Skeleton" -
// which is this race's own tier-0 model name. So far the vanilla
// creature has always won; the log is here to say so, or to say which
// mod's object took its place. See SkeletonVisuals.EnsureFireAura.
SkeletonVisuals.LogResolvedPrefabOnce("model " + rules.ModelPrefab, skelPrefab);
SkeletonVisuals.LogResolvedPrefabOnce("model " + modelPrefab, skelPrefab);
if (skelPrefab == null)
{
// The human body was switched off two lines up, so an unresolved
// model leaves an invisible player rather than an obvious error.
// Say so once per tier instead of failing silently.
WarnMissingModelOnce(rules.ModelPrefab);
WarnMissingModelOnce(modelPrefab);
}
if (skelPrefab != null)
{
@ -312,7 +315,7 @@ namespace RacesOfValheim
// Map bones by name
Transform[] playerBones = __instance.m_bodyModel.bones;
LogBoneMapping(rules.ModelPrefab, newSmr, playerBones);
LogBoneMapping(modelPrefab, newSmr, playerBones);
Transform[] newBones = new Transform[newSmr.bones.Length];
for (int i = 0; i < newSmr.bones.Length; i++)
@ -360,7 +363,7 @@ namespace RacesOfValheim
// that each one arrives its own colour. Outside the build block above on
// purpose: they hang off the player's rig bones rather than off the body
// container, so they outlive it and have to be checked every refresh.
SkeletonEyeGlow.Apply(__instance, rules.ModelPrefab);
SkeletonEyeGlow.Apply(__instance, modelPrefab);
}
}
else

View file

@ -67,6 +67,28 @@ namespace RacesOfValheim
///
/// The blocks are cumulative: each one only states what its boss adds or replaces.
/// </summary>
/// <summary>
/// The bodies this tier has earned, plainest first. These are the same thresholds
/// GetRules switches the model at, so a look can never be worn before its boss is down.
/// </summary>
public static System.Collections.Generic.List<string> UnlockedModels(int state)
{
var models = new System.Collections.Generic.List<string> { BaseModel };
if (state >= 2) models.Add(PoisonModel); // Eikthyr
if (state >= 5) models.Add(FireModel); // Moder
return models;
}
/// <summary>
/// The body to build: the one chosen at the barber when it is still unlocked, otherwise
/// the tier's own. Cosmetic only - every rule in GetRules keeps following the tier.
/// </summary>
public static string ResolveModel(int state, string look)
{
if (!string.IsNullOrEmpty(look) && UnlockedModels(state).Contains(look)) return look;
return GetRules(state).ModelPrefab;
}
public static SkeletonRules GetRules(int state)
{
SkeletonRules rules = new SkeletonRules

View file

@ -374,6 +374,14 @@ namespace RacesOfValheim
if (nview != null && nview.IsValid())
{
nview.GetZDO().Set("RacesOfValheim_SkeletonState", state);
// The saved look goes on the ZDO so everyone else sees the same body.
Player.m_localPlayer.m_customData.TryGetValue(SkeletonVisuals.LookDataKey, out string savedLook);
savedLook = savedLook ?? "";
if (nview.GetZDO().GetString(SkeletonVisuals.LookZdoKey, "") != savedLook)
{
nview.GetZDO().Set(SkeletonVisuals.LookZdoKey, savedLook);
}
}
// Manage Fake Foods
@ -442,7 +450,7 @@ namespace RacesOfValheim
}
// Flames on the skull, worn with the fire-tier model and nothing else.
headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && rules.ModelPrefab == SkeletonProgression.FireModel);
headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonVisuals.GetModel(Player.m_localPlayer, state) == SkeletonProgression.FireModel);
if (rules.FireAura)
{

View file

@ -97,6 +97,37 @@ namespace RacesOfValheim
return BossProgressionManager.GetCurrentProgressionState();
}
public const string LookZdoKey = "RacesOfValheim_SkeletonLook";
public const string LookDataKey = "SkeletonLook";
/// <summary>
/// The body this player chose at the barber, "" if they never did. Read the same way as
/// the race: the ZDO for anyone on the network, m_customData for the menu preview.
/// </summary>
public static string GetLook(Player player)
{
if (player == null) return "";
ZNetView nview = player.GetComponent<ZNetView>();
if (nview != null && nview.IsValid())
{
return nview.GetZDO().GetString(LookZdoKey, "");
}
if (player.m_customData != null && player.m_customData.TryGetValue(LookDataKey, out string look))
{
return look;
}
return "";
}
/// <summary>The model prefab to wear for this player at this tier, look applied.</summary>
public static string GetModel(Player player, int state)
{
return SkeletonProgression.ResolveModel(state, GetLook(player));
}
/// <summary>
/// Fire sources in preference order. BUILDING PIECES ONLY, and that is the bug fix.
///

View file

@ -122,6 +122,9 @@
"rov_msg_skadi_there_are_already_these_within": "There are already $1 of these within a day's walk. The stone is spent.",
"rov_msg_skeleton_has_already_had_one": "It has already had one.",
"rov_msg_skeleton_have_been_resurrected_by_dark": "You have been resurrected by dark magic!",
"rov_msg_skeleton_look_normal": "Look: normal bones",
"rov_msg_skeleton_look_green": "Look: green bones",
"rov_msg_skeleton_look_flames": "Look: burning bones",
"rov_msg_skeleton_mortal_food_disgusts": "Mortal food disgusts you.",
"rov_msg_skeleton_nothing_standing_yet_wants_bone": "Nothing is standing yet. It wants bone.",
"rov_msg_skeleton_pile_broken_fall_where_they": "The pile is broken. $1 fall where they stand.",

View file

@ -122,6 +122,9 @@
"rov_msg_skadi_there_are_already_these_within": "Ce ne sono già $1 a una giornata di cammino. La pietra è esaurita.",
"rov_msg_skeleton_has_already_had_one": "Ne ha già avuto uno.",
"rov_msg_skeleton_have_been_resurrected_by_dark": "Sei stato resuscitato dalla magia oscura!",
"rov_msg_skeleton_look_normal": "Aspetto: ossa normali",
"rov_msg_skeleton_look_green": "Aspetto: ossa verdi",
"rov_msg_skeleton_look_flames": "Aspetto: ossa in fiamme",
"rov_msg_skeleton_mortal_food_disgusts": "Il cibo dei mortali ti disgusta.",
"rov_msg_skeleton_nothing_standing_yet_wants_bone": "Non c'è ancora niente in piedi. Vuole ossa.",
"rov_msg_skeleton_pile_broken_fall_where_they": "Il mucchio è distrutto. $1 cadono dove si trovano.",

View file

@ -164,7 +164,7 @@ namespace RacesOfValheim
// The burning skull, grown locally for whoever we are looking at. The tier is on the
// ZDO, so this client can work out for itself whether they should be alight.
m_skeletonHeadFlame.Apply(m_player, SkeletonConfig.HeadFireVFXEnabled.Value && rules.ModelPrefab == SkeletonProgression.FireModel);
m_skeletonHeadFlame.Apply(m_player, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonVisuals.GetModel(m_player, state) == SkeletonProgression.FireModel);
// Apply Scale
Vector3 targetScale = rules.ScaleMultiplier;