diff --git a/JotunnModStub/Furling/FurlingConfig.cs b/JotunnModStub/Furling/FurlingConfig.cs new file mode 100644 index 0000000..f6ebb4e --- /dev/null +++ b/JotunnModStub/Furling/FurlingConfig.cs @@ -0,0 +1,88 @@ +using BepInEx.Configuration; + +namespace RacesOfValheim +{ + /// + /// 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. + /// + public static class FurlingConfig + { + // ─── Passive combat (always active, no tier gate) ──────────────────── + public static ConfigEntry RunSpeedBonus; + public static ConfigEntry WeaponSkillXPMultiplier; + public static ConfigEntry IgniteOnHitMinFireDamage; + + // ─── Master of Shadows (tier 2+) ────────────────────────────────────── + public static ConfigEntry StealthNoiseRangeThreshold; + + // ─── The Wickerman (tier 3+) ─────────────────────────────────────────── + public static ConfigEntry WickermanFireResistMultiplier; + public static ConfigEntry PoisonResistMultiplier; + public static ConfigEntry FireArrowMinDamage; + + // ─── Grave Robber (tier 5+) ──────────────────────────────────────────── + public static ConfigEntry TrophyDropMultiplier; + public static ConfigEntry TrophyDoublingRadius; + public static ConfigEntry CoinsPerStarMin; + public static ConfigEntry CoinsPerStarMax; + + // ─── The King is Dead (tier 6+) ─────────────────────────────────────── + public static ConfigEntry PlainsSkillXPMultiplier; + + // ─── In the Mist (tier 7+) ───────────────────────────────────────────── + public static ConfigEntry 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(0f, 1f))); + WeaponSkillXPMultiplier = config.Bind(combat, "Weapon Skill XP Multiplier", 2f, + new ConfigDescription("Multiplies XP gain for every weapon skill, always active.", new AcceptableValueRange(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(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(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(0f, 1f))); + PoisonResistMultiplier = config.Bind(wickerman, "Poison Resist Multiplier", 0.5f, + new ConfigDescription("Multiplies incoming poison damage, tier 3+ and tier 8+.", new AcceptableValueRange(0f, 1f))); + FireArrowMinDamage = config.Bind(wickerman, "Fire Arrow Min Damage", 22f, + new ConfigDescription("Minimum fire damage added to bow attacks, tier 3+.", new AcceptableValueRange(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(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(1f, 100f))); + CoinsPerStarMin = config.Bind(graveRobber, "Coins Per Star Min", 1, + new ConfigDescription("Minimum bonus coins dropped, per star the kill had.", new AcceptableValueRange(0, 50))); + CoinsPerStarMax = config.Bind(graveRobber, "Coins Per Star Max", 25, + new ConfigDescription("Maximum bonus coins dropped, per star the kill had.", new AcceptableValueRange(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(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(0.1f, 1f))); + } + } +} diff --git a/JotunnModStub/Furling/FurlingFireAbility.cs b/JotunnModStub/Furling/FurlingFireAbility.cs index baf1920..9d55afe 100644 --- a/JotunnModStub/Furling/FurlingFireAbility.cs +++ b/JotunnModStub/Furling/FurlingFireAbility.cs @@ -136,7 +136,7 @@ namespace RacesOfValheim hit.m_damage.m_pierce > 0 || hit.m_damage.m_chop > 0 || hit.m_damage.m_pickaxe > 0) { - hit.m_damage.m_fire = Mathf.Max(hit.m_damage.m_fire, 10f); + hit.m_damage.m_fire = Mathf.Max(hit.m_damage.m_fire, FurlingConfig.IgniteOnHitMinFireDamage.Value); } } diff --git a/JotunnModStub/Furling/FurlingPatches.cs b/JotunnModStub/Furling/FurlingPatches.cs index c4c0ed8..8e0167c 100644 --- a/JotunnModStub/Furling/FurlingPatches.cs +++ b/JotunnModStub/Furling/FurlingPatches.cs @@ -42,7 +42,7 @@ namespace RacesOfValheim { if (__instance == null || __instance != Player.m_localPlayer) return; if (!FurlingRace.IsFurling()) return; - __result *= 1.1f; + __result *= 1f + FurlingConfig.RunSpeedBonus.Value; } } @@ -323,14 +323,14 @@ namespace RacesOfValheim if (isWeaponSkill) { - factor *= 2f; + factor *= FurlingConfig.WeaponSkillXPMultiplier.Value; } else if (BossProgressionManager.GetCurrentProgressionState() >= 6) { - // The King is Dead: in Plains, ALL other skills (including magic) get 2x XP + // The King is Dead: in Plains, ALL other skills (including magic) get bonus XP if (EnvMan.instance != null && EnvMan.instance.GetCurrentBiome() == Heightmap.Biome.Plains) { - factor *= 2f; + factor *= FurlingConfig.PlainsSkillXPMultiplier.Value; } } } @@ -347,7 +347,7 @@ namespace RacesOfValheim // Check if it's nighttime or inside a dungeon if (BossProgressionManager.GetCurrentProgressionState() >= 2) // Master of Shadows (Eikthyr) { - if (range <= 15f) + if (range <= FurlingConfig.StealthNoiseRangeThreshold.Value) { return false; } @@ -368,12 +368,12 @@ namespace RacesOfValheim if (state >= 8) // Through Fire and Flames (Fader): full fire immunity { hit.m_damage.m_fire = 0f; - if (hit.m_damage.m_poison > 0) hit.m_damage.m_poison *= 0.5f; + if (hit.m_damage.m_poison > 0) hit.m_damage.m_poison *= FurlingConfig.PoisonResistMultiplier.Value; } - else if (state >= 3) // The Wickerman: -50% fire and poison + else if (state >= 3) // The Wickerman: reduced fire and poison { - if (hit.m_damage.m_fire > 0) hit.m_damage.m_fire *= 0.5f; - if (hit.m_damage.m_poison > 0) hit.m_damage.m_poison *= 0.5f; + if (hit.m_damage.m_fire > 0) hit.m_damage.m_fire *= FurlingConfig.WickermanFireResistMultiplier.Value; + if (hit.m_damage.m_poison > 0) hit.m_damage.m_poison *= FurlingConfig.PoisonResistMultiplier.Value; } } } @@ -393,10 +393,11 @@ namespace RacesOfValheim (ammo != null && ammo.m_shared.m_skillType == Skills.SkillType.Bows)) { // If the arrow doesn't already have significant fire damage, add it - if (hitData != null && hitData.m_damage.m_fire < 22f) + float minFireDamage = FurlingConfig.FireArrowMinDamage.Value; + if (hitData != null && hitData.m_damage.m_fire < minFireDamage) { // Adds fire damage equivalent to a standard fire arrow - hitData.m_damage.m_fire = Mathf.Max(hitData.m_damage.m_fire, 22f); + hitData.m_damage.m_fire = Mathf.Max(hitData.m_damage.m_fire, minFireDamage); } } } @@ -494,7 +495,7 @@ namespace RacesOfValheim if (character != null && (character.IsBoss() || character.gameObject.name.ToLower().Contains("boss"))) return; float distance = Vector3.Distance(Player.m_localPlayer.transform.position, __instance.transform.position); - if (distance > 25f) return; + if (distance > FurlingConfig.TrophyDoublingRadius.Value) return; var newList = new System.Collections.Generic.List>(); foreach (var drop in __result) @@ -506,7 +507,7 @@ namespace RacesOfValheim var itemDrop = go.GetComponent(); if (itemDrop != null && itemDrop.m_itemData.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Trophy) { - amount *= 2; + amount = Mathf.RoundToInt(amount * FurlingConfig.TrophyDropMultiplier.Value); } } newList.Add(new System.Collections.Generic.KeyValuePair(go, amount)); @@ -519,7 +520,7 @@ namespace RacesOfValheim GameObject coinsPrefab = Jotunn.Managers.PrefabManager.Cache.GetPrefab("Coins"); if (coinsPrefab != null) { - int extraCoins = stars * UnityEngine.Random.Range(1, 26); + int extraCoins = stars * UnityEngine.Random.Range(FurlingConfig.CoinsPerStarMin.Value, FurlingConfig.CoinsPerStarMax.Value + 1); newList.Add(new System.Collections.Generic.KeyValuePair(coinsPrefab, extraCoins)); } } @@ -635,8 +636,8 @@ namespace RacesOfValheim // Blue food = eitr > 0 if (food.m_item.m_shared.m_foodEitr > 0f) { - // Give back half of dt that vanilla subtracted - food.m_time += dt * 0.5f; + // Give back the slowed-down fraction of dt that vanilla subtracted + food.m_time += dt * (1f - FurlingConfig.EitrFoodDigestionSlowdown.Value); // Clamp to max burn time so we don't exceed the original duration float maxTime = food.m_item.m_shared.m_foodBurnTime; if (food.m_time > maxTime) food.m_time = maxTime; diff --git a/JotunnModStub/RacesOfValheim.cs b/JotunnModStub/RacesOfValheim.cs index dca76b4..6434ba1 100644 --- a/JotunnModStub/RacesOfValheim.cs +++ b/JotunnModStub/RacesOfValheim.cs @@ -31,6 +31,7 @@ namespace RacesOfValheim DraughConfig.Bind(Config); DvergarConfigManagement.Bind(Config); FenrirConfig.Bind(Config); + FurlingConfig.Bind(Config); SkadiConfig.Bind(Config); harmony.PatchAll(); gameObject.AddComponent();