diff --git a/JotunnModStub/Package/manifest.json b/JotunnModStub/Package/manifest.json index 8b25e6f..47424f1 100644 --- a/JotunnModStub/Package/manifest.json +++ b/JotunnModStub/Package/manifest.json @@ -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.9", + "version_number": "1.5.10", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", diff --git a/JotunnModStub/RacesOfValheim.cs b/JotunnModStub/RacesOfValheim.cs index fe1cebb..6e826c6 100644 --- a/JotunnModStub/RacesOfValheim.cs +++ b/JotunnModStub/RacesOfValheim.cs @@ -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.9"; + public const string PluginVersion = "1.5.10"; private readonly Harmony harmony = new Harmony(PluginGUID); diff --git a/JotunnModStub/Skeleton/SkeletonConfig.cs b/JotunnModStub/Skeleton/SkeletonConfig.cs index a31f1a9..c6b8ba6 100644 --- a/JotunnModStub/Skeleton/SkeletonConfig.cs +++ b/JotunnModStub/Skeleton/SkeletonConfig.cs @@ -41,6 +41,7 @@ namespace RacesOfValheim // ─── Visuals ─────────────────────────────────────────────────────────── public static ConfigEntry HeadFireVFXEnabled; + public static ConfigEntry BodyModelEnabled; public static void Bind(ConfigFile config) { @@ -71,6 +72,8 @@ namespace RacesOfValheim const string visuals = "Skeleton - Visuals"; HeadFireVFXEnabled = config.Bind(visuals, "Head Fire VFX Enabled", true, new ConfigDescription("Whether the burning-skull effect (worn from tier 5+) renders at all. A client-side preference: disabling it stops you from seeing it on yourself and on every other skeleton you look at, but does not change what other players see.")); + BodyModelEnabled = config.Bind(visuals, "Body Model Enabled", true, + new ConfigDescription("Whether Skeleton players wear the skeleton body. Turn it off if you use a player model mod (EnhancedValheimVRM and the like): Skeletons then keep the vanilla viking body, so the replacement model shows without bones clipping through it. Abilities are unchanged. Client-side, like the option above: it applies to every Skeleton you see, yourself included, and changes nothing for other players.")); } } } diff --git a/JotunnModStub/Skeleton/SkeletonJawFix.cs b/JotunnModStub/Skeleton/SkeletonJawFix.cs index 8f9860d..d96c8c5 100644 --- a/JotunnModStub/Skeleton/SkeletonJawFix.cs +++ b/JotunnModStub/Skeleton/SkeletonJawFix.cs @@ -62,10 +62,11 @@ namespace RacesOfValheim Transform jaw = ResolveJaw(); if (jaw == null || jaw.parent == null) return; - if (!SkeletonVisuals.IsSkeletonPlayer(m_player)) + if (!SkeletonVisuals.ShowsSkeletonBody(m_player)) { // Nothing rewrites this bone on its own, so a player who stops being a Skeleton - // would otherwise keep wearing the correction on their human face. + // (or switches the skeleton body off) would otherwise keep wearing the correction + // on their human face. if (m_applied) { jaw.localPosition = m_baseLocalPosition; diff --git a/JotunnModStub/Skeleton/SkeletonPatches.cs b/JotunnModStub/Skeleton/SkeletonPatches.cs index 0937e37..461fa75 100644 --- a/JotunnModStub/Skeleton/SkeletonPatches.cs +++ b/JotunnModStub/Skeleton/SkeletonPatches.cs @@ -254,7 +254,9 @@ namespace RacesOfValheim // before it could find out it was looking at a Skeleton. string race = SkeletonVisuals.GetPlayerRace(p); - if (race == SkeletonVisuals.RaceId) + // With "Body Model Enabled" off a Skeleton takes the human branch below, the same + // as any other race, so the toggle also works live: the next refresh swaps back. + if (race == SkeletonVisuals.RaceId && SkeletonConfig.BodyModelEnabled.Value) { if (__instance.m_bodyModel != null) { diff --git a/JotunnModStub/Skeleton/SkeletonRace.cs b/JotunnModStub/Skeleton/SkeletonRace.cs index 78aebe6..1895ed5 100644 --- a/JotunnModStub/Skeleton/SkeletonRace.cs +++ b/JotunnModStub/Skeleton/SkeletonRace.cs @@ -323,9 +323,13 @@ namespace RacesOfValheim VisEquipment currentVis = Player.m_localPlayer.GetComponent(); if (currentVis != null) { - // Hide Helmets (Valheim uses singular GameObject for helmet) - var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field("m_helmetItemInstance").Value; - SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true); + // Hide Helmets (Valheim uses singular GameObject for helmet). Only over a skull: + // a viking body wears its helmet, and the VisEquipment postfix puts it back. + if (SkeletonConfig.BodyModelEnabled.Value) + { + var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field("m_helmetItemInstance").Value; + SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true); + } // Scale Body Armor (Chest, Legs, Shoulder) by 5% string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" }; @@ -440,7 +444,7 @@ namespace RacesOfValheim } // Flames on the skull, worn with the fire-tier model and nothing else. - headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonVisuals.GetModel(Player.m_localPlayer, state) == SkeletonProgression.FireModel); + headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonConfig.BodyModelEnabled.Value && SkeletonVisuals.GetModel(Player.m_localPlayer, state) == SkeletonProgression.FireModel); if (rules.FireAura) { diff --git a/JotunnModStub/Skeleton/SkeletonVisuals.cs b/JotunnModStub/Skeleton/SkeletonVisuals.cs index 18ada8b..e91963c 100644 --- a/JotunnModStub/Skeleton/SkeletonVisuals.cs +++ b/JotunnModStub/Skeleton/SkeletonVisuals.cs @@ -49,6 +49,16 @@ namespace RacesOfValheim public static bool IsSkeletonPlayer(Player player) => GetPlayerRace(player) == RaceId; + /// + /// Whether this client draws the skeleton's bones on this player. False for every + /// non-Skeleton, and for every Skeleton when "Body Model Enabled" is off: model-replacement + /// mods (EnhancedValheimVRM and the like) hide the vanilla body and draw their own, so the + /// borrowed bones ended up floating around the replacement model. With the option off the + /// Skeleton keeps every ability and only looks like a plain viking. + /// + public static bool ShowsSkeletonBody(Player player) => + SkeletonConfig.BodyModelEnabled.Value && IsSkeletonPlayer(player); + /// /// Fully hides (or restores) one equipped item instance - a helmet, typically. /// diff --git a/JotunnModStub/ZdoVisualSync.cs b/JotunnModStub/ZdoVisualSync.cs index 0df6988..4f1326f 100644 --- a/JotunnModStub/ZdoVisualSync.cs +++ b/JotunnModStub/ZdoVisualSync.cs @@ -128,8 +128,11 @@ namespace RacesOfValheim vis.SetBeardItem(0); // Hide Helmet - var helmetObj = HarmonyLib.Traverse.Create(vis).Field("m_helmetItemInstance").Value; - SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true); + if (SkeletonConfig.BodyModelEnabled.Value) + { + var helmetObj = HarmonyLib.Traverse.Create(vis).Field("m_helmetItemInstance").Value; + SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true); + } // Scale Body Armor string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" }; @@ -165,7 +168,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 && SkeletonVisuals.GetModel(m_player, state) == SkeletonProgression.FireModel); + m_skeletonHeadFlame.Apply(m_player, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonConfig.BodyModelEnabled.Value && SkeletonVisuals.GetModel(m_player, state) == SkeletonProgression.FireModel); // Apply Scale Vector3 targetScale = rules.ScaleMultiplier; diff --git a/README.md b/README.md index 39865d8..741c132 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT --- -## New in v1.5.9 +## New in v1.5.10 -Skeletons can laugh: type /evillaugh. The Furling's fire bonus now covers crossbow bolts, and a crossbow in hand no longer fires on every attack while you are transformed. Full details in the [changelog](#v159). +Using a player model mod such as EnhancedValheimVRM? Turn off `Skeleton - Visuals` → `Body Model Enabled` and Skeletons keep the vanilla body, so no bones clip through your model. Full details in the [changelog](#v1510). --- @@ -30,6 +30,7 @@ Skeletons can laugh: type /evillaugh. The Furling's fire bonus now covers crossb - **Stamina-less Combat:** Skeletons use no stamina and do not have a stamina bar. - **Undead Diet:** Cannot eat normal food. Max health increases automatically as you defeat bosses to make up for lack of food buffs. - **Lit Sockets:** Your skull carries the eye lights of the creature your tier is built from, in that creature's own colour — so they change as the body does. +- **Body Model switch:** with a player model mod (EnhancedValheimVRM and the like), set `Skeleton - Visuals` → `Body Model Enabled` to off and Skeletons keep the vanilla body. Abilities stay the same. ### 2. Skadi ![Skadi1](https://wiki.aledanidev.ovh/assets/images/skadi1.gif) @@ -447,6 +448,10 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact ## Changelog +### v1.5.10 +- **New - Skeleton body switch for player model mods:** with EnhancedValheimVRM or another model replacer, the skeleton's bones stayed on screen and floated around the new model. Set `Skeleton - Visuals` → `Body Model Enabled` to off and Skeletons keep the vanilla body: no bones, eye lights or skull flames, and the helmet shows. Abilities don't change. The setting is client-side, so it applies to every Skeleton you see and changes nothing for other players. The race strips hair and beard, so the vanilla body is bald, and the auto-resurrection still shows the skeleton for the few seconds it climbs out of the ground. Thanks to the players who reported it and tested the fix. +- **Fix - Russian translation:** corrections to several Russian texts, by Axibed. + ### v1.5.9 - **New - /evillaugh (Skeleton):** the Skeleton throws its head back, clacks its jaw, shakes its shoulders and punches both fists into the air for four seconds. Everyone nearby sees it. - **Change - Furling fire bolts:** the Wickerman's fire damage now also applies to crossbow bolts, not only to arrows. diff --git a/manifest.json b/manifest.json index 8b25e6f..47424f1 100644 --- a/manifest.json +++ b/manifest.json @@ -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.9", + "version_number": "1.5.10", "website_url": "", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333",