RacesOfValheim/JotunnModStub/Skadi/SkadiConfig.cs
kanym c320fa5b2b feat(skadi): add Rime Feather hover trinket (Mountain faction feature)
Utility-slot item cloned from Megingjord: holding Space while airborne climbs
at a steady rate (stamina-gated), letting go caps the fall speed into a free
Drake-glide-inspired float instead of a hard drop, and feather fall is always
on while equipped via the item's own m_fallDamageModifier equip effect.
Independent of DrakeFormBehavior/Character.m_flying on purpose.

Crafts at a plain Forge for now (FreezeGland x5 + Silver x5) - the Factions
merchant-gate item and a race lock on the fall-damage effect are still open,
see MOUNTAIN-FACTION-BRAINSTORM.md.
2026-08-06 18:35:09 +02:00

198 lines
16 KiB
C#

using UnityEngine;
using BepInEx.Configuration;
namespace RacesOfValheim
{
/// <summary>
/// Every tunable number and keybind behind Skadi's abilities and special attacks, 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 sub-group (rather than everything under one "Skadi" section) so each shows
/// up as its own entry in Configuration Manager's category list - collapsing them into a
/// single section made that list disappear. Keybinds is bound first, before its section
/// otherwise sorts alphabetically among the rest, since it is the group most worth reaching
/// quickly; within it every entry carries an explicit Order (Configuration Manager otherwise
/// sorts a section's own entries alphabetically) so it reads attack -> cast -> breath -> spin
/// -> flight -> the three transform keys, the order abilities actually chain in a fight,
/// rather than alphabetically.
/// </summary>
public static class SkadiConfig
{
// ─── Keybinds ──────────────────────────────────────────────────────────
// Defaults match today's fixed inputs exactly, so nobody's controls change until they
// open Configuration Manager (or the .cfg) and rebind one on purpose.
public static ConfigEntry<KeyboardShortcut> PrimaryAttackKey;
public static ConfigEntry<KeyboardShortcut> ColdSpellKey;
public static ConfigEntry<KeyboardShortcut> BreathAttackKey;
public static ConfigEntry<KeyboardShortcut> SpinAttackKey;
public static ConfigEntry<KeyboardShortcut> FlightToggleKey;
public static ConfigEntry<KeyboardShortcut> DrakeFormKey;
public static ConfigEntry<KeyboardShortcut> ModerFormKey;
public static ConfigEntry<KeyboardShortcut> FaderFormKey;
// ─── Cold Spell (human form) ─────────────────────────────────────────
public static ConfigEntry<float> SpellStaminaCost;
public static ConfigEntry<float> SpellCooldown;
public static ConfigEntry<float> ImprovedSpellCooldown;
public static ConfigEntry<float> SpellBaseDamage;
public static ConfigEntry<float> SpellDamagePerState;
public static ConfigEntry<int> ImprovedSpellShards;
public static ConfigEntry<float> ImprovedSpellDamageBudget;
// ─── Frost Aura (tier 7+ passive) ───────────────────────────────────────
public static ConfigEntry<float> AuraRadius;
public static ConfigEntry<float> AuraDamagePerTick;
public static ConfigEntry<float> AuraTickInterval;
// ─── Passive combat ──────────────────────────────────────────────────
public static ConfigEntry<float> BonusFrostDamagePerState;
// ─── Dragon forms: scale ─────────────────────────────────────────────
public static ConfigEntry<float> DrakeScale;
public static ConfigEntry<float> ModerScale;
public static ConfigEntry<float> FaderScale;
// ─── Dragon forms: attacks ────────────────────────────────────────────
public static ConfigEntry<float> FormAttackCooldown;
public static ConfigEntry<float> StaminaPerProjectile;
public static ConfigEntry<float> MaxVolleyStamina;
public static ConfigEntry<float> MeleeRadius;
public static ConfigEntry<float> ModerMeleeDamage;
public static ConfigEntry<float> FaderMeleeDamage;
public static ConfigEntry<float> FaderSpinDamage;
public static ConfigEntry<float> FaderSpinRadius;
// ─── Hover Trinket (Rime Feather) ───────────────────────────────────
// Deliberately separate from the Directed Flight block below: this is the always-available
// base-form trinket (hold Space while airborne to climb), not the Elder-onward Drake/Moder
// form transformation. See SkadiHoverTrinket.cs.
public static ConfigEntry<float> TrinketAscendSpeed;
public static ConfigEntry<float> TrinketStaminaPerSecond;
public static ConfigEntry<float> TrinketGlideFallSpeed;
public static ConfigEntry<float> TrinketFallDamageReduction;
// ─── Directed flight (Drake/Moder) ────────────────────────────────────
public static ConfigEntry<float> FlightTurnSpeed;
public static ConfigEntry<float> FlightGlideSpeed;
public static ConfigEntry<float> FlightBoostSpeed;
public static ConfigEntry<float> FlightSprintSpeed;
public static ConfigEntry<float> FlightReverseSpeed;
public static ConfigEntry<float> FlightLiftoffSpeed;
public static ConfigEntry<float> FlightHoverSeconds;
public static ConfigEntry<float> FlightSprintStaminaPerSecond;
public static void Bind(ConfigFile config)
{
// Bound first, and ahead of everything else in the file, in case Configuration
// Manager's category list preserves bind order rather than sorting sections
// alphabetically - either way, the keybinds themselves still land in the requested
// order via the explicit Order below, which is guaranteed.
const string keybinds = "Skadi - Keybinds";
int keyOrder = 8;
PrimaryAttackKey = config.Bind(keybinds, "Dragon Primary Attack", new KeyboardShortcut(KeyCode.Mouse0),
KeyDesc("Bite/claw attack in any dragon form.", keyOrder--));
ColdSpellKey = config.Bind(keybinds, "Cold Spell Cast", new KeyboardShortcut(KeyCode.Mouse2),
KeyDesc("Casts the Cold Spell in human form, tier 1+.", keyOrder--));
BreathAttackKey = config.Bind(keybinds, "Dragon Breath Attack", new KeyboardShortcut(KeyCode.Mouse2),
KeyDesc("Ranged breath/barrage attack in Moder and Skeleton Dragon form.", keyOrder--));
SpinAttackKey = config.Bind(keybinds, "Fader Spin Attack", new KeyboardShortcut(KeyCode.Mouse1),
KeyDesc("360-degree spin attack, Skeleton Dragon form only.", keyOrder--));
FlightToggleKey = config.Bind(keybinds, "Flight Toggle", new KeyboardShortcut(KeyCode.Mouse1),
KeyDesc("Takes off or lands while in Drake or Moder form.", keyOrder--));
DrakeFormKey = config.Bind(keybinds, "Drake Form", new KeyboardShortcut(KeyCode.G),
KeyDesc("Transform into (or revert from) the Drake, tier 3+.", keyOrder--));
ModerFormKey = config.Bind(keybinds, "Moder Form", new KeyboardShortcut(KeyCode.H),
KeyDesc("Transform into (or revert from) Moder, tier 5+.", keyOrder--));
FaderFormKey = config.Bind(keybinds, "Fader Form", new KeyboardShortcut(KeyCode.J),
KeyDesc("Transform into (or revert from) the Skeleton Dragon, tier 8.", keyOrder--));
const string combat = "Skadi - Passive Combat";
BonusFrostDamagePerState = config.Bind(combat, "Bonus Frost Damage Per State", 2f,
new ConfigDescription("Flat frost damage added to every hit the player lands, multiplied by the current progression state.", new AcceptableValueRange<float>(0f, 10f)));
const string spell = "Skadi - Cold Spell";
SpellStaminaCost = config.Bind(spell, "Stamina Cost", 20f,
new ConfigDescription("Stamina spent per cast.", new AcceptableValueRange<float>(0f, 100f)));
SpellCooldown = config.Bind(spell, "Cooldown", 1.5f,
new ConfigDescription("Seconds between casts before the improved (tier 6+) cast unlocks.", new AcceptableValueRange<float>(0.1f, 10f)));
ImprovedSpellCooldown = config.Bind(spell, "Improved Cooldown", 4f,
new ConfigDescription("Seconds between casts once the improved cast unlocks (tier 6+) - a burst rather than rapid-fire.", new AcceptableValueRange<float>(0.1f, 15f)));
SpellBaseDamage = config.Bind(spell, "Base Damage", 15f,
new ConfigDescription("Frost damage at progression state 0, before the per-state bonus.", new AcceptableValueRange<float>(0f, 200f)));
SpellDamagePerState = config.Bind(spell, "Damage Per Progression State", 8f,
new ConfigDescription("Extra frost damage added per boss progression state (0-8).", new AcceptableValueRange<float>(0f, 50f)));
ImprovedSpellShards = config.Bind(spell, "Improved Shard Count", 10,
new ConfigDescription("Number of shards the improved (tier 6+) cast splits into.", new AcceptableValueRange<int>(1, 30)));
ImprovedSpellDamageBudget = config.Bind(spell, "Improved Damage Budget", 1.6f,
new ConfigDescription("Total damage of an improved cast, as a multiple of one normal cast, before it is split across shards.", new AcceptableValueRange<float>(0.5f, 5f)));
const string aura = "Skadi - Frost Aura";
AuraRadius = config.Bind(aura, "Radius", 3f,
new ConfigDescription("Meters from the player that the tier 7+ aura damages.", new AcceptableValueRange<float>(1f, 15f)));
AuraDamagePerTick = config.Bind(aura, "Damage Per Tick", 10f,
new ConfigDescription("Frost damage dealt to every enemy in range, once per tick.", new AcceptableValueRange<float>(0f, 50f)));
AuraTickInterval = config.Bind(aura, "Tick Interval", 1f,
new ConfigDescription("Seconds between aura damage ticks.", new AcceptableValueRange<float>(0.1f, 5f)));
const string scale = "Skadi - Dragon Form Scale";
DrakeScale = config.Bind(scale, "Drake Scale", 0.9f,
new ConfigDescription("Model scale while transformed into the Drake (tier 3-4).", new AcceptableValueRange<float>(0.1f, 2f)));
ModerScale = config.Bind(scale, "Moder Scale", 0.5f,
new ConfigDescription("Model scale while transformed into Moder (tier 5-7).", new AcceptableValueRange<float>(0.1f, 2f)));
FaderScale = config.Bind(scale, "Fader Scale", 0.55f,
new ConfigDescription("Model scale while transformed into the Skeleton Dragon (tier 8).", new AcceptableValueRange<float>(0.1f, 2f)));
const string attacks = "Skadi - Dragon Form Attacks";
FormAttackCooldown = config.Bind(attacks, "Attack Cooldown", 3f,
new ConfigDescription("Seconds between attacks in any dragon form.", new AcceptableValueRange<float>(0.5f, 15f)));
StaminaPerProjectile = config.Bind(attacks, "Stamina Per Projectile", 1.5f,
new ConfigDescription("Stamina charged per shard/projectile in a ranged volley.", new AcceptableValueRange<float>(0f, 10f)));
MaxVolleyStamina = config.Bind(attacks, "Max Volley Stamina", 85f,
new ConfigDescription("Stamina ceiling for a single volley, so the widest breath (60 shards) stays castable.", new AcceptableValueRange<float>(0f, 300f)));
MeleeRadius = config.Bind(attacks, "Melee Radius", 3f,
new ConfigDescription("Hit-sweep radius for bite/claw attacks (Moder and Fader).", new AcceptableValueRange<float>(1f, 15f)));
ModerMeleeDamage = config.Bind(attacks, "Moder Melee Damage", 90f,
new ConfigDescription("Base damage of Moder's bite/claw attacks, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
FaderMeleeDamage = config.Bind(attacks, "Fader Melee Damage", 120f,
new ConfigDescription("Base damage of the Skeleton Dragon's bite/claw attacks, before the Unarmed skill bonus.", new AcceptableValueRange<float>(0f, 500f)));
FaderSpinDamage = config.Bind(attacks, "Fader Spin Damage", 100f,
new ConfigDescription("Base damage of the Skeleton Dragon's 360-degree spin attack.", new AcceptableValueRange<float>(0f, 500f)));
FaderSpinRadius = config.Bind(attacks, "Fader Spin Radius", 5f,
new ConfigDescription("Hit-sweep radius for the Skeleton Dragon's spin attack.", new AcceptableValueRange<float>(1f, 15f)));
const string trinket = "Skadi - Hover Trinket";
TrinketAscendSpeed = config.Bind(trinket, "Ascend Speed", 4f,
new ConfigDescription("Climb speed (m/s) while airborne and holding Space with the Rime Feather equipped.", new AcceptableValueRange<float>(0.5f, 15f)));
TrinketStaminaPerSecond = config.Bind(trinket, "Stamina Per Second", 8f,
new ConfigDescription("Stamina drained per second while climbing. Running out hands the frame back to normal gravity.", new AcceptableValueRange<float>(0f, 60f)));
TrinketGlideFallSpeed = config.Bind(trinket, "Glide Fall Speed", 5.4f,
new ConfigDescription("Maximum fall speed (m/s) while airborne without holding Space - a free parachute-style glide, Drake-flight-inspired, rather than a normal hard drop. Only caps actual falling, so it never robs a jump of its rise.", new AcceptableValueRange<float>(1f, 20f)));
TrinketFallDamageReduction = config.Bind(trinket, "Fall Damage Reduction", 1f,
new ConfigDescription("Fall damage reduction while the Rime Feather is equipped (1 = fully immune), applied via the item's own equip status effect regardless of the Space climb.", new AcceptableValueRange<float>(0f, 1f)));
const string flight = "Skadi - Directed Flight";
FlightTurnSpeed = config.Bind(flight, "Turn Speed", 120f,
new ConfigDescription("Degrees per second the dragon form turns to face its heading.", new AcceptableValueRange<float>(10f, 360f)));
FlightGlideSpeed = config.Bind(flight, "Glide Speed", 5f,
new ConfigDescription("Speed while gliding unpowered (no W/S held).", new AcceptableValueRange<float>(0f, 30f)));
FlightBoostSpeed = config.Bind(flight, "Boost Speed", 12f,
new ConfigDescription("Speed while holding W without sprinting.", new AcceptableValueRange<float>(0f, 50f)));
FlightSprintSpeed = config.Bind(flight, "Sprint Speed", 22f,
new ConfigDescription("Speed while holding W and Shift, stamina permitting.", new AcceptableValueRange<float>(0f, 60f)));
FlightReverseSpeed = config.Bind(flight, "Reverse Speed", 7f,
new ConfigDescription("Speed while beating backwards (S).", new AcceptableValueRange<float>(0f, 30f)));
FlightLiftoffSpeed = config.Bind(flight, "Liftoff Speed", 9f,
new ConfigDescription("Climb speed while clawing out of water.", new AcceptableValueRange<float>(0f, 30f)));
FlightHoverSeconds = config.Bind(flight, "Hover Seconds", 5f,
new ConfigDescription("How long level flight holds altitude after the last powered input before it starts to sink.", new AcceptableValueRange<float>(0f, 30f)));
FlightSprintStaminaPerSecond = config.Bind(flight, "Sprint Stamina Per Second", 15f,
new ConfigDescription("Stamina drained per second while the sprint speed is actually granted.", new AcceptableValueRange<float>(0f, 60f)));
}
private static ConfigDescription KeyDesc(string description, int order)
{
return new ConfigDescription(description, null, new ConfigurationManagerAttributes { Order = order });
}
}
}