feat(skadi): make abilities and special attacks BepInEx-configurable

Binds every tunable number behind Skadi's Cold Spell, frost aura, bonus
frost damage, dragon-form scale/melee/ranged attacks, and directed flight
as BepInEx ConfigEntry values (SkadiConfig.cs), following
CONFIGURATION-MANAGER-HOWTO.md. Defaults match the previous hardcoded
constants exactly, so this is config-only, no gameplay change.

BepInEx writes these to BepInEx/config/com.nandor.racesofvalheim.cfg on
first run regardless of whether Configuration Manager is installed - a
plain, commented, hand-editable text file - so players without the plugin
can still retune values by hand.
This commit is contained in:
kanym 2026-08-06 12:45:53 +02:00
commit c088eb74f4
5 changed files with 172 additions and 30 deletions

View file

@ -229,7 +229,7 @@ namespace RacesOfValheim
var rules = SkadiProgression.GetRules(BossProgressionManager.GetCurrentProgressionState());
if (rules.BonusFrostDamage)
{
hit.m_damage.m_frost += 2f * BossProgressionManager.GetCurrentProgressionState();
hit.m_damage.m_frost += SkadiConfig.BonusFrostDamagePerState.Value * BossProgressionManager.GetCurrentProgressionState();
}
}
}
@ -250,17 +250,19 @@ namespace RacesOfValheim
[HarmonyPatch(typeof(Character), "UpdateFlying")]
public static class SkadiDirectedFlightPatch
{
private const float TURN_SPEED = 120f;
private const float GLIDE_SPEED = 5f;
private const float BOOST_SPEED = 12f;
private const float SPRINT_SPEED = 22f;
private const float REVERSE_SPEED = 7f;
// Read from SkadiConfig (BepInEx Config) rather than fixed constants, so flight can be
// retuned from Configuration Manager - see CONFIGURATION-MANAGER-HOWTO.md.
private static float TURN_SPEED => SkadiConfig.FlightTurnSpeed.Value;
private static float GLIDE_SPEED => SkadiConfig.FlightGlideSpeed.Value;
private static float BOOST_SPEED => SkadiConfig.FlightBoostSpeed.Value;
private static float SPRINT_SPEED => SkadiConfig.FlightSprintSpeed.Value;
private static float REVERSE_SPEED => SkadiConfig.FlightReverseSpeed.Value;
// Climbing out of water is deliberately slower than a powered climb in open air - the
// wings are dragging themselves free, not racing.
private const float LIFTOFF_SPEED = 9f;
private const float HOVER_SECONDS = 5f;
private static float LIFTOFF_SPEED => SkadiConfig.FlightLiftoffSpeed.Value;
private static float HOVER_SECONDS => SkadiConfig.FlightHoverSeconds.Value;
// Per second, drained only while the sprint is actually being granted.
private const float SPRINT_STAMINA_PER_SECOND = 15f;
private static float SPRINT_STAMINA_PER_SECOND => SkadiConfig.FlightSprintStaminaPerSecond.Value;
// Tangent of the unpowered descent angle: 0.4 sinks at roughly 22 degrees below level.
private const float DESCENT_SLOPE = 0.4f;
// How much of the aim heading survives the climb out of water. Mostly up, with enough