RacesOfValheim/JotunnModStub/Skeleton/SkeletonConfig.cs
kanym 9ed606a9aa feat(skeleton): per-player options to eat real food and spend stamina
Two options in "Skeleton - Mortal Habits", both off and not synced by
the server, since each only gives up an advantage.

Eats Mortal Food: the Skeleton eats like the living. The max health
override and the fake foods step aside, so meals decide health and
stamina and the tier's health bonus, which stood in for food, no longer
applies. The food HUD shows again.

Feels Fatigue: the Skeleton spends stamina. Without eating, its max
stamina is base plus the stamina of the tier's stand-in meals, because
the fake foods sit at m_time 0 and give none.

The compendium builds its diet line from four new keys (English,
Italian, Russian) when either option is on.
2026-11-02 23:31:58 +01:00

107 lines
8.6 KiB
C#

using BepInEx.Configuration;
using UnityEngine;
namespace RacesOfValheim
{
/// <summary>
/// Every tunable number behind the Skeleton's abilities, bound as BepInEx ConfigEntry so they
/// show up in Configuration Manager without touching code - see
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake(). One section per
/// topic (matches the other races' layout).
///
/// No keybinds section: every Skeleton ability is passive, triggered by tier and combat events
/// rather than a key press.
///
/// The per-tier progression table itself (SkeletonProgression.GetRules: max health bonus,
/// lifesteal percent per tier, max summons) is left as-is, same boundary drawn for every other
/// race's progression table - not exposed here. Only the flat ability numbers a tier's boolean
/// flag switches on are configurable.
///
/// One caveat: Enhanced Regen Health Multiplier is read into SE_SkeletonStats.RebuildForState,
/// which only re-reads it when the player's progression state changes (it short-circuits if
/// the state matches what it last built for). Retuning that one value mid-session at an
/// already-reached tier needs a relog (or reaching a new tier) to take effect. Everything else
/// here reads live on every use.
/// </summary>
public static class SkeletonConfig
{
// ─── Passive combat ──────────────────────────────────────────────────
public static ConfigEntry<float> AutoStunCooldown;
public static ConfigEntry<float> AutoStunStaggerMultiplier;
public static ConfigEntry<float> PoisonAttackBonus;
public static ConfigEntry<float> EnhancedRegenHealthMultiplier;
public static ConfigEntry<float> EnhancedRegenTickSpeedBonus;
// ─── Fire Aura (tier 5+) ───────────────────────────────────────────────
public static ConfigEntry<float> FireAuraRadius;
public static ConfigEntry<float> FireAuraDamagePerTick;
public static ConfigEntry<float> FireAuraTickInterval;
// ─── Resurrection (tier 6+) ────────────────────────────────────────────
public static ConfigEntry<float> ResurrectionCooldown;
// ─── Keybinds ──────────────────────────────────────────────────────────
public static ConfigEntry<KeyboardShortcut> SummonToggleKey;
// ─── Visuals ───────────────────────────────────────────────────────────
public static ConfigEntry<bool> HeadFireVFXEnabled;
public static ConfigEntry<bool> BodyModelEnabled;
public static ConfigEntry<bool> RaiseDeadIcon;
public static ConfigEntry<bool> ShowHelmet;
// ─── Mortal Habits (per player) ────────────────────────────────────────
public static ConfigEntry<bool> EatsMortalFood;
public static ConfigEntry<bool> FeelsFatigue;
public static void Bind(ConfigFile config)
{
const string combat = "Skeleton - Passive Combat";
AutoStunCooldown = config.Bind(combat, "Auto Stun Cooldown", 5f,
new ConfigDescription("Seconds between forced staggers on the enemy hit, tier 3+.", new AcceptableValueRange<float>(0f, 60f)));
AutoStunStaggerMultiplier = config.Bind(combat, "Auto Stun Stagger Multiplier", 100f,
new ConfigDescription("Stagger multiplier applied to force the stagger through.", new AcceptableValueRange<float>(1f, 500f)));
PoisonAttackBonus = config.Bind(combat, "Poison Attack Bonus", 20f,
new ConfigDescription("Flat poison damage added to every hit the player lands, tier 4+.", new AcceptableValueRange<float>(0f, 100f)));
EnhancedRegenHealthMultiplier = config.Bind(combat, "Enhanced Regen Health Multiplier", 1.5f,
new ConfigDescription("Health regeneration multiplier, tier 5+.", new AcceptableValueRange<float>(1f, 5f)));
EnhancedRegenTickSpeedBonus = config.Bind(combat, "Enhanced Regen Tick Speed Bonus", 0.25f,
new ConfigDescription("Extra speed at which the regen timer accumulates, tier 5+ (0.25 = 25% faster ticks).", new AcceptableValueRange<float>(0f, 2f)));
const string aura = "Skeleton - Fire Aura";
FireAuraRadius = config.Bind(aura, "Radius", 5f,
new ConfigDescription("Meters from the player that the tier 5+ aura damages.", new AcceptableValueRange<float>(1f, 20f)));
FireAuraDamagePerTick = config.Bind(aura, "Damage Per Tick", 30f,
new ConfigDescription("Fire damage dealt to every enemy in range, once per tick.", new AcceptableValueRange<float>(0f, 100f)));
FireAuraTickInterval = config.Bind(aura, "Tick Interval", 1f,
new ConfigDescription("Seconds between aura damage ticks.", new AcceptableValueRange<float>(0.1f, 5f)));
// G is the first ability key of every race that has one; the Skeleton had none.
const string keybinds = "Skeleton - Keybinds";
SummonToggleKey = config.Bind(keybinds, "Toggle Summon on Kill", new KeyboardShortcut(KeyCode.G),
"Turns raising a skeleton from each kill on and off (The Queen and later). The Raise the Dead icon shows while it is on.");
const string resurrection = "Skeleton - Resurrection";
ResurrectionCooldown = config.Bind(resurrection, "Cooldown", 300f,
new ConfigDescription("Seconds between auto-resurrections, tier 6+.", new AcceptableValueRange<float>(0f, 3600f)));
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."));
RaiseDeadIcon = config.Bind(visuals, "Raise the Dead Icon", true,
new ConfigDescription("Shows the Raise the Dead status icon while your Summon on Kill is on."));
ShowHelmet = config.Bind(visuals, "Show Helmet", false,
new ConfigDescription("Off: your helmet stays hidden over the skull. On: the helmet you wear shows. Helmets and hoods are moved and enlarged to fit the skull. Your own choice: other players see you the way you picked. A viking body (Body Model Enabled off) always shows its helmet."));
// For groups who want the Skeleton but miss Valheim's food or stamina. Both only take
// away an advantage (permanent best-tier food, infinite stamina), so each player picks
// for themselves and the server does not sync them.
const string habits = "Skeleton - Mortal Habits";
EatsMortalFood = config.Bind(habits, "Eats Mortal Food", false,
new ConfigDescription("Off: you never eat, and your Maximum Health comes from your standing (the bosses you have defeated). On: you eat like the living, your health and stamina come from your meals, and the standing's health bonus is gone. Your other Skeleton powers stay. Your own choice, not synced by the server."));
FeelsFatigue = config.Bind(habits, "Feels Fatigue", false,
new ConfigDescription("Off: you have no stamina and never tire. On: you spend stamina like the living. Without Eats Mortal Food your stamina grows with your standing, from the same meals your health is measured by. Your own choice, not synced by the server."));
}
}
}