RacesOfValheim/JotunnModStub/Furling/FurlingConfig.cs
kanym 4b382e7fad feat(furling): make ability numbers BepInEx-configurable
Adds FurlingConfig.cs, following the established per-race pattern: one
Configuration Manager section per tier ability (Passive Combat, Master of
Shadows, The Wickerman, Grave Robber, The King Is Dead, In the Mist). No
keybinds section - every Furling ability is passive, triggered by tier,
biome, or combat events rather than a key press. Defaults match the
previous hardcoded constants exactly.

"Dance of the Dead" (tier 4+) has no numeric knob and stays untouched: it
doubles craft yield by crafting a literal second copy rather than
multiplying a configurable amount.

Also fixes a latent truncation bug found while wiring the trophy drop
multiplier: it was applied as `amount *= 2` (int), which would have
truncated any non-integer multiplier a player configured (e.g. 1.5x
rounding down every time). Now computed as
Mathf.RoundToInt(amount * multiplier).

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi) in RacesOfValheim.Awake().
2026-08-06 14:25:23 +02:00

88 lines
6.4 KiB
C#

using BepInEx.Configuration;
namespace RacesOfValheim
{
/// <summary>
/// Every tunable number behind the Furling'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 Furling ability is passive, triggered automatically by tier,
/// biome, or combat events rather than a key press - unlike every other race so far.
///
/// Tier-gate thresholds (which progression state unlocks each ability) are left as-is, same
/// boundary drawn for every other race's progression table - not exposed here. "Dance of the
/// Dead" (tier 4+, doubles alchemy/ammo craft yield) has no numeric knob either: it works by
/// crafting a second copy of the output rather than multiplying a configurable amount, so
/// there is nothing here to bind.
/// </summary>
public static class FurlingConfig
{
// ─── Passive combat (always active, no tier gate) ────────────────────
public static ConfigEntry<float> RunSpeedBonus;
public static ConfigEntry<float> WeaponSkillXPMultiplier;
public static ConfigEntry<float> IgniteOnHitMinFireDamage;
// ─── Master of Shadows (tier 2+) ──────────────────────────────────────
public static ConfigEntry<float> StealthNoiseRangeThreshold;
// ─── The Wickerman (tier 3+) ───────────────────────────────────────────
public static ConfigEntry<float> WickermanFireResistMultiplier;
public static ConfigEntry<float> PoisonResistMultiplier;
public static ConfigEntry<float> FireArrowMinDamage;
// ─── Grave Robber (tier 5+) ────────────────────────────────────────────
public static ConfigEntry<float> TrophyDropMultiplier;
public static ConfigEntry<float> TrophyDoublingRadius;
public static ConfigEntry<int> CoinsPerStarMin;
public static ConfigEntry<int> CoinsPerStarMax;
// ─── The King is Dead (tier 6+) ───────────────────────────────────────
public static ConfigEntry<float> PlainsSkillXPMultiplier;
// ─── In the Mist (tier 7+) ─────────────────────────────────────────────
public static ConfigEntry<float> EitrFoodDigestionSlowdown;
public static void Bind(ConfigFile config)
{
const string combat = "Furling - Passive Combat";
RunSpeedBonus = config.Bind(combat, "Run Speed Bonus", 0.1f,
new ConfigDescription("Move speed multiplier bonus, always active.", new AcceptableValueRange<float>(0f, 1f)));
WeaponSkillXPMultiplier = config.Bind(combat, "Weapon Skill XP Multiplier", 2f,
new ConfigDescription("Multiplies XP gain for every weapon skill, always active.", new AcceptableValueRange<float>(0.5f, 5f)));
IgniteOnHitMinFireDamage = config.Bind(combat, "Ignite On Hit Min Fire Damage", 10f,
new ConfigDescription("Minimum fire damage added to a physical hit, tier 8+ (Through Fire and Flames).", new AcceptableValueRange<float>(0f, 100f)));
const string shadows = "Furling - Master of Shadows";
StealthNoiseRangeThreshold = config.Bind(shadows, "Noise Range Threshold", 15f,
new ConfigDescription("Noise events at or below this range are suppressed entirely, tier 2+.", new AcceptableValueRange<float>(0f, 50f)));
const string wickerman = "Furling - The Wickerman";
WickermanFireResistMultiplier = config.Bind(wickerman, "Fire Resist Multiplier", 0.5f,
new ConfigDescription("Multiplies incoming fire damage, tier 3+ (full immunity replaces this at tier 8+).", new AcceptableValueRange<float>(0f, 1f)));
PoisonResistMultiplier = config.Bind(wickerman, "Poison Resist Multiplier", 0.5f,
new ConfigDescription("Multiplies incoming poison damage, tier 3+ and tier 8+.", new AcceptableValueRange<float>(0f, 1f)));
FireArrowMinDamage = config.Bind(wickerman, "Fire Arrow Min Damage", 22f,
new ConfigDescription("Minimum fire damage added to bow attacks, tier 3+.", new AcceptableValueRange<float>(0f, 100f)));
const string graveRobber = "Furling - Grave Robber";
TrophyDropMultiplier = config.Bind(graveRobber, "Trophy Drop Multiplier", 2f,
new ConfigDescription("Multiplies trophy drop counts from non-boss kills within range, tier 5+.", new AcceptableValueRange<float>(1f, 5f)));
TrophyDoublingRadius = config.Bind(graveRobber, "Trophy Doubling Radius", 25f,
new ConfigDescription("Meters from the player a kill must be within for its trophy drops to be doubled.", new AcceptableValueRange<float>(1f, 100f)));
CoinsPerStarMin = config.Bind(graveRobber, "Coins Per Star Min", 1,
new ConfigDescription("Minimum bonus coins dropped, per star the kill had.", new AcceptableValueRange<int>(0, 50)));
CoinsPerStarMax = config.Bind(graveRobber, "Coins Per Star Max", 25,
new ConfigDescription("Maximum bonus coins dropped, per star the kill had.", new AcceptableValueRange<int>(0, 100)));
const string kingIsDead = "Furling - The King Is Dead";
PlainsSkillXPMultiplier = config.Bind(kingIsDead, "Plains Skill XP Multiplier", 2f,
new ConfigDescription("Multiplies XP gain for every skill while standing in the Plains biome, tier 6+.", new AcceptableValueRange<float>(0.5f, 5f)));
const string mist = "Furling - In the Mist";
EitrFoodDigestionSlowdown = config.Bind(mist, "Eitr Food Digestion Slowdown", 0.5f,
new ConfigDescription("Fraction of normal speed at which eitr (blue) food is consumed, tier 7+ (0.5 = lasts twice as long).", new AcceptableValueRange<float>(0.1f, 1f)));
}
}
}