RacesOfValheim/JotunnModStub/Alfar/AlfarConfig.cs
Ferdinando 3f8cf1ee27 feat(alfar): v1.6.0 - the Alfar, an eleventh race
Grey, tall and thin, with black eyes. Eitr is armour and fuel (shield,
diet, soft fall, levitation), Heimkall sends a lethal blow home at one
health every 20 minutes. Caster powers from Skrid to the archon
Sameining, with on-screen cooldowns. Automated base around the
Ljoskjarne: drones, three constructs, crystals, Ljosgard, Prismavard.
Compendium page in EN/IT/RU.

README: New in block, race section, progression, station line, changelog.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 17:38:28 +01:00

159 lines
8 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>
/// 1 is the Sverm's size, which is what the design asked to try first ("se non va li
/// allarghiamo"). Raise it to enlarge the eyes: 1.6 is roughly a grey from the films.
/// </summary>
public static ConfigEntry<float> EyeSizeMultiplier;
// The eye geometry is the Sverm's, unchanged (SvermVisuals): offsets are metres in the head
// bone's OWN frame, so they land on the same part of the face at any body scale.
public const float EyeSeparation = 0.032f;
public const float EyeForward = 0.081f;
public const float EyeHeight = 0.181f;
public const float EyeSize = 0.062f;
// ─── 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("1 = the Sverm's eye size; 0.8 is slightly smaller. Raise to enlarge the black eyes.",
new AcceptableValueRange<float>(0.5f, 3f)));
}
}
}