RacesOfValheim/JotunnModStub/Skadi/SkadiIce.cs
Ferdinando 0294d6a71b feat(skadi): remove Skadis Nokkel and the hidden hollow
The staff opened a pair of client-side portals into a claimed troll cave,
and that whole mechanism broke in multiplayer. The two Harmony patches it
needed were the sharpest edge: SkadiNokkelCastPatch prefixed
Attack.OnAttackTrigger and SkadiNokkelFreeCastPatch postfixed the three
cost getters, so every attack by every character in the game went through
mod code before being filtered.

Nothing is put in its place, on purpose. The Crystal Golem is the Skadi's
station now and the balance was already settled around it, and the part of
the hollow that was actually worth having - Skadi and Trol building inside
any troll cave - lives in RaceCaveBuilding and is untouched.

Removed: SkadiNokkel.cs, SkadiHollow.cs, SkadiHollowPortal.cs, the
"Skadi - Hidden Hollow" config section, the HOLLOW_COOLDOWN_SE status
effect, the F8 dump, and the "Nothing takes root here" rule in
PieceDensityLimit, which existed only for the hollow.

Kept: SkadiIce, which the staff's file happened to host but the Frost
Heart and the golem both use - moved to its own file. Greater Frost Heart
stays on sale from the Fenring_Cultist at 1500 as it was.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 07:55:23 +02:00

55 lines
2.5 KiB
C#

using UnityEngine;
namespace RacesOfValheim
{
/// <summary>
/// The one ice palette the whole Skadi chain shares. Taken from the Fader recolour in
/// SkadiRace.ExecuteTransformation rather than picked fresh, so the reagent and the crystal golem
/// are the same ice as the Skeleton Dragon the race turns into at tier 8.
///
/// It lived in SkadiNokkel.cs until that staff was removed; it is its own file now because the
/// two things still using it have nothing else to do with each other.
/// </summary>
public static class SkadiIce
{
public static readonly Color Albedo = new Color(0.6f, 0.8f, 1f, 1f);
public static readonly Color Emission = new Color(0f, 0.5f, 1f, 1f);
/// <summary>
/// Multiplies the ice tint over whatever the base texture already carries instead of
/// overwriting it, so the model keeps its detail and reads as frozen bone rather than as a
/// flat blue silhouette. Same approach as AswidSpectralClaw.ApplySpectralVisual, and like
/// that one it copies each material first so the vanilla asset is never touched.
/// </summary>
public static void Apply(GameObject root)
{
if (root == null) return;
foreach (Renderer renderer in root.GetComponentsInChildren<Renderer>(true))
{
if (renderer == null || renderer is ParticleSystemRenderer) continue;
Material[] source = renderer.sharedMaterials;
Material[] tinted = new Material[source.Length];
for (int i = 0; i < source.Length; i++)
{
if (source[i] == null) continue;
Material material = new Material(source[i]);
if (material.HasProperty("_Color"))
{
Color baseColor = material.GetColor("_Color");
material.SetColor("_Color", new Color(baseColor.r * Albedo.r,
baseColor.g * Albedo.g,
baseColor.b * Albedo.b,
baseColor.a));
}
if (material.HasProperty("_EmissionColor")) material.SetColor("_EmissionColor", Emission);
tinted[i] = material;
}
renderer.sharedMaterials = tinted;
}
}
}
}