RacesOfValheim/JotunnModStub/Alfar/AlfarConfig.cs
kanym 026def2fde fix(eyes): female face placement, smaller Dvergar/Aswid eyes, grey Alfar eyes
The female body maps the painted eyes about 6 mm lower and a quarter closer
together than the male one (read from bodymale/bodyfem and the skin UVs), so
every race's male-tuned eyes sat on the female brow. PlayerFace moves them for
the Dvergar, Aswid, Sverm and Alfar.

Dvergar eyes shrink to an 18 mm radius. The Aswid's borrowed sockets are
halved before the config multiplier and the smoke is off by default.

Alfar eyes become slanted, wrapped black almonds with a wet sheen. They are
placed in fixed head-local units: the live lossyScale under the non-uniform
Alfar body drifted as the head turned, and the 0.5 s cosmetic pass made the
eyes trail the face.
2026-10-27 15:01:44 +01:00

168 lines
8.5 KiB
C#

using BepInEx.Configuration;
using UnityEngine;
namespace RacesOfValheim
{
/// <summary>
/// Every number the Alfar use. Nothing numeric lives in the logic files (guide 3.4), and every
/// value here is a STARTING value: Alfar_Progettazione.txt sec. 19 says they will all be
/// corrected in play.
///
/// Only the look is bound so far. The shield, the powers and the base add their own sections as
/// they are written.
/// </summary>
public static class AlfarConfig
{
/// <summary>
/// Written into m_customData["Race"] and the ZDO. Chosen once and never changed: renaming it
/// later leaves every saved Alfar character unrecognised and back to human (the Brandr
/// lesson, design doc sec. 2).
/// </summary>
public const string RaceId = "Alfar";
// ─── Look ────────────────────────────────────────────────────────────
/// <summary>The tint written into _SkinColor. Ash grey: low saturation, a hair cool.</summary>
public static ConfigEntry<Color> SkinColor;
/// <summary>
/// Height against a normal Viking: +5%, design doc sec. 7.1. Applied to the Visual child's Y,
/// never the root (RaceEyeHeight explains why).
/// </summary>
public static ConfigEntry<float> HeightScale;
/// <summary>
/// Width and depth: "barely visibly thinner", about -8%. Together with HeightScale this is a
/// NON-UNIFORM scale, which is where held weapons and the first-person camera tend to look
/// squashed - doc sec. 7.2. If it does, raise this toward 1 before touching anything else.
/// </summary>
public static ConfigEntry<float> WidthScale;
/// <summary>
/// Scales the almond eyes (EyeExtent). The default 0.8 is the tuned grey look; raise it for
/// bigger eyes.
/// </summary>
public static ConfigEntry<float> EyeSizeMultiplier;
// A grey's eyes, on the Sverm's eye spot: offsets are metres in the head bone's OWN frame
// at human scale, so they land on the same part of the face at any body scale.
// Pushed apart and forward of the Sverm's, because an almond this wide would otherwise
// meet its twin over the nose and sink into the cheek.
public const float EyeSeparation = 0.037f;
public const float EyeForward = 0.086f;
public const float EyeHeight = 0.183f;
// Full width, height and depth of one eye in metres at Eye Size Multiplier 1. The saved
// default of 0.8 makes that 50 x 28 x 18 mm.
public static readonly Vector3 EyeExtent = new Vector3(0.0625f, 0.035f, 0.0225f);
// Degrees. Slant raises the outer corner; wrap turns each eye out toward its temple.
public const float EyeSlant = 22f;
public const float EyeWrap = 20f;
// ─── Eitr: diet, shield, soft fall ───────────────────────────────────
/// <summary>
/// What each food adds to the maximum eitr besides its own: min(hp, stamina) times this.
/// 1 is the design (sec. 3): native eitr plus the lower of hp and stamina.
/// </summary>
public static ConfigEntry<float> DietMultiplier;
/// <summary>
/// Eitr spent per point of damage. 1:1, FIXED, for ever (sec. 4.1): progression comes from
/// the food raising the pool, not from a better rate.
/// </summary>
public static ConfigEntry<float> ShieldRate;
/// <summary>Lightning and spirit cost this many times the rate (sec. 5.1: the double cost).</summary>
public static ConfigEntry<float> ConductiveMultiplier;
/// <summary>
/// Falls cost nothing while there is any eitr (sec. 4.5: soft fall). Off, a fall is shielded
/// like any other blow.
/// </summary>
public static ConfigEntry<bool> SoftFall;
/// <summary>
/// The fastest an Alfr falls while there is eitr, in metres per second. The vanilla Feather
/// Cape caps at 5; a little under that reads as floating.
/// </summary>
public static ConfigEntry<float> FeatherFallSpeed;
// ─── Heimkall: the death that costs a wait ───────────────────────────
/// <summary>Minutes before a second Heimkall is possible, before Yagluth (sec. 6).</summary>
public static ConfigEntry<float> HeimkallMinutes;
/// <summary>The same, once Yagluth is down.</summary>
public static ConfigEntry<float> HeimkallMinutesAfterYagluth;
/// <summary>The same, once Fader is down.</summary>
public static ConfigEntry<float> HeimkallMinutesAfterFader;
/// <summary>
/// Seconds of invulnerability on arrival, so a lethal blow does not simply repeat at the
/// bed. Without it a burning or drowning death would loop.
/// </summary>
public static ConfigEntry<float> HeimkallInvulnerableSeconds;
public static void Bind(ConfigFile config)
{
const string heimkall = "Alfar - Heimkall";
HeimkallMinutes = config.Bind(heimkall, "Cooldown Minutes", 20f,
new ConfigDescription("Minutes between two Heimkalls (the lethal-blow teleport to the bed). Inside this wait, a lethal blow kills normally.",
new AcceptableValueRange<float>(0f, 120f)));
HeimkallMinutesAfterYagluth = config.Bind(heimkall, "Cooldown Minutes After Yagluth", 15f,
new ConfigDescription("The cooldown once Yagluth is defeated.",
new AcceptableValueRange<float>(0f, 120f)));
HeimkallMinutesAfterFader = config.Bind(heimkall, "Cooldown Minutes After Fader", 10f,
new ConfigDescription("The cooldown once Fader is defeated.",
new AcceptableValueRange<float>(0f, 120f)));
HeimkallInvulnerableSeconds = config.Bind(heimkall, "Invulnerable Seconds", 5f,
new ConfigDescription("Seconds nothing can hurt the Alfr after arriving.",
new AcceptableValueRange<float>(0f, 30f)));
const string eitr = "Alfar - Eitr";
DietMultiplier = config.Bind(eitr, "Diet Multiplier", 1f,
new ConfigDescription("Each food adds its native eitr plus min(hp, stamina) times this to the maximum eitr.",
new AcceptableValueRange<float>(0f, 3f)));
ShieldRate = config.Bind(eitr, "Shield Rate", 1f,
new ConfigDescription("Eitr spent per point of damage absorbed (1 = 1:1).",
new AcceptableValueRange<float>(0.1f, 5f)));
ConductiveMultiplier = config.Bind(eitr, "Lightning And Spirit Multiplier", 2f,
new ConfigDescription("Lightning and spirit damage cost this many times the shield rate.",
new AcceptableValueRange<float>(1f, 5f)));
SoftFall = config.Bind(eitr, "Soft Fall", true,
new ConfigDescription("Falling does no damage, and is slowed, while the Alfr has any eitr."));
FeatherFallSpeed = config.Bind(eitr, "Feather Fall Speed", 4f,
new ConfigDescription("Maximum falling speed (m/s) while the Alfr has eitr. Lower floats more.",
new AcceptableValueRange<float>(1f, 20f)));
const string look = "Alfar - Look";
SkinColor = config.Bind(look, "Skin Color", new Color(0.86f, 0.88f, 0.88f, 1f),
new ConfigDescription("How light the ash-grey skin is. The skin texture itself is made grey; this only sets its brightness."));
HeightScale = config.Bind(look, "Height Scale", 1.05f,
new ConfigDescription("Body height against a normal Viking (1.05 = +5%).",
new AcceptableValueRange<float>(0.8f, 1.3f)));
WidthScale = config.Bind(look, "Width Scale", 0.92f,
new ConfigDescription("Body width and depth against a normal Viking (0.92 = 8% thinner).",
new AcceptableValueRange<float>(0.7f, 1.2f)));
EyeSizeMultiplier = config.Bind(look, "Eye Size Multiplier", 0.8f,
new ConfigDescription("Scales the black almond eyes. 0.8 is the default look; raise it for bigger eyes.",
new AcceptableValueRange<float>(0.5f, 3f)));
}
}
}