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

@ -60,24 +60,26 @@ namespace RacesOfValheim
return live != null && live.Form == formRules.Form && live.CanAttackInForm;
}
private const float ATTACK_COOLDOWN = 3f;
// Read from SkadiConfig (BepInEx Config) rather than fixed constants, so dragon-form
// attacks can be retuned from Configuration Manager - see CONFIGURATION-MANAGER-HOWTO.md.
private static float ATTACK_COOLDOWN => SkadiConfig.FormAttackCooldown.Value;
// Ranged volleys charge per projectile rather than a flat fee, so the 20- and 60-shard
// breaths cost what they are worth instead of the same as a three-shard drake spit.
// Stamina rather than eitr, for the same reason the Cold Spell uses it: eitr food only
// exists from the Mistlands on, while the drake form arrives at the Elder, so an eitr
// cost left the earliest dragon tiers with no attack they could actually pay for.
private const float STAMINA_PER_PROJECTILE = 1.5f;
private static float STAMINA_PER_PROJECTILE => SkadiConfig.StaminaPerProjectile.Value;
// Ceiling so the widest breath stays castable: 60 shards would otherwise ask 90 stamina.
private const float MAX_VOLLEY_STAMINA = 85f;
private static float MAX_VOLLEY_STAMINA => SkadiConfig.MaxVolleyStamina.Value;
// Melee costs nothing at all - it is the baseline attack that has to work at every tier,
// including the long stretch where the player has no eitr whatsoever.
private const float MELEE_RADIUS = 3f;
private const float MODER_MELEE_DAMAGE = 90f;
private const float FADER_MELEE_DAMAGE = 120f;
private const float FADER_SPIN_DAMAGE = 100f;
private const float FADER_SPIN_RADIUS = 5f;
private static float MELEE_RADIUS => SkadiConfig.MeleeRadius.Value;
private static float MODER_MELEE_DAMAGE => SkadiConfig.ModerMeleeDamage.Value;
private static float FADER_MELEE_DAMAGE => SkadiConfig.FaderMeleeDamage.Value;
private static float FADER_SPIN_DAMAGE => SkadiConfig.FaderSpinDamage.Value;
private static float FADER_SPIN_RADIUS => SkadiConfig.FaderSpinRadius.Value;
private void Start()
{