The Drake and the Moder shared one set of flight numbers, so once the Moder lost its time limit at the Queen the Drake had no reason left. Now the Drake is the scout: quick to turn, fast, free to fly, but it will not take off while encumbered. The Moder is the freighter: slow to turn, 3 stamina a second to beat its wings, and it lifts a heavy pack at 25% extra cost. "Skadi - Directed Flight" becomes "Skadi - Dragon Forms", with every flight number per form plus the bat's Flight Stamina, While Encumbered, Encumbered Extra Stamina Cost, Max Duration, Duration Per State and Cooldown. Duration and cooldown default to -1, which keeps the boss-tier table. Each form also gets its own cooldown effect and icon, so a cooldown on one form no longer blocks another. Suggested by Dissolution.
260 lines
20 KiB
C#
260 lines
20 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;
|
|
|
|
// ─── Elemental Magic experience ─────────────────────────────────────────
|
|
// See SkadiMagicSkill for why a cast's budget is split across its projectiles and why the
|
|
// aura's share is a fraction of a cast's.
|
|
public static ConfigEntry<float> MagicSkillGainPerCast;
|
|
public static ConfigEntry<float> AuraSkillGainPerTick;
|
|
|
|
// ─── 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;
|
|
|
|
// ─── Dragon forms: flight and timing, one set per form ───────────────────
|
|
// One section for all three, as Dissolution asked for the bat's knobs on each form: the
|
|
// keys carry the form's name and an Order, so Configuration Manager lists Drake, then
|
|
// Moder, then Fader instead of mixing them alphabetically.
|
|
public class FormFlight
|
|
{
|
|
public ConfigEntry<float> TurnSpeed;
|
|
public ConfigEntry<float> GlideSpeed;
|
|
public ConfigEntry<float> BoostSpeed;
|
|
public ConfigEntry<float> SprintSpeed;
|
|
public ConfigEntry<float> ReverseSpeed;
|
|
public ConfigEntry<float> LiftoffSpeed;
|
|
public ConfigEntry<float> HoverSeconds;
|
|
public ConfigEntry<float> PoweredStaminaPerSecond;
|
|
public ConfigEntry<float> SprintStaminaPerSecond;
|
|
public ConfigEntry<AswidConfig.EncumberedMode> Encumbered;
|
|
public ConfigEntry<float> EncumberedExtraCost;
|
|
}
|
|
|
|
public class FormTiming
|
|
{
|
|
// -1 keeps the boss-tier table in SkadiProgression, so an untouched .cfg plays as before.
|
|
public ConfigEntry<float> MaxDuration;
|
|
public ConfigEntry<float> DurationPerState;
|
|
public ConfigEntry<float> Cooldown;
|
|
}
|
|
|
|
public static FormFlight DrakeFlight;
|
|
public static FormFlight ModerFlight;
|
|
public static FormTiming DrakeTiming;
|
|
public static FormTiming ModerTiming;
|
|
public static FormTiming FaderTiming;
|
|
|
|
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 2+ (Eikthyr).", 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 magicSkill = "Skadi - Elemental Magic Skill";
|
|
MagicSkillGainPerCast = config.Bind(magicSkill, "Gain Per Cast", 1f,
|
|
new ConfigDescription("Elemental Magic experience for one cast that connects - the Cold Spell and all three dragon breaths. Split across the projectiles a cast throws, so a ten-shard burst is worth the same as one shard. Nothing is earned by a shot that hits no one. 0 turns spell experience off.", new AcceptableValueRange<float>(0f, 5f)));
|
|
AuraSkillGainPerTick = config.Bind(magicSkill, "Aura Gain Per Tick", 0.1f,
|
|
new ConfigDescription("Elemental Magic experience for one Frost Aura tick that burned at least one enemy - once per tick, not once per enemy. Deliberately a fraction of a cast: the aura ticks every second on its own. 0 turns aura experience off.", new AcceptableValueRange<float>(0f, 1f)));
|
|
|
|
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)));
|
|
|
|
// Was "Skadi - Directed Flight", one set of numbers for both flying forms. The Drake is
|
|
// the scout: quick, nimble, free to fly, grounded by a heavy pack. The Moder is the
|
|
// freighter: slow to turn and paying for every beat, but it lifts what the Drake cannot.
|
|
const string forms = "Skadi - Dragon Forms";
|
|
int order = 1000;
|
|
DrakeFlight = BindFlight(config, forms, "Drake", ref order,
|
|
turn: 180f, glide: 6f, boost: 14f, sprint: 26f, reverse: 8f, liftoff: 9f, hover: 3f,
|
|
powered: 0f, sprintCost: 10f, encumbered: AswidConfig.EncumberedMode.Blocked, extraCost: 0.25f);
|
|
DrakeTiming = BindTiming(config, forms, "Drake", ref order);
|
|
ModerFlight = BindFlight(config, forms, "Moder", ref order,
|
|
turn: 80f, glide: 5f, boost: 10f, sprint: 18f, reverse: 6f, liftoff: 9f, hover: 8f,
|
|
powered: 3f, sprintCost: 15f, encumbered: AswidConfig.EncumberedMode.Allowed, extraCost: 0.25f);
|
|
ModerTiming = BindTiming(config, forms, "Moder", ref order);
|
|
FaderTiming = BindTiming(config, forms, "Fader", ref order);
|
|
}
|
|
|
|
private static FormFlight BindFlight(ConfigFile config, string section, string form, ref int order,
|
|
float turn, float glide, float boost, float sprint, float reverse, float liftoff, float hover,
|
|
float powered, float sprintCost, AswidConfig.EncumberedMode encumbered, float extraCost)
|
|
{
|
|
return new FormFlight
|
|
{
|
|
TurnSpeed = config.Bind(section, $"{form} Turn Speed", turn,
|
|
OrderedDesc($"Degrees per second the {form} turns towards where you aim.", new AcceptableValueRange<float>(10f, 360f), order--)),
|
|
GlideSpeed = config.Bind(section, $"{form} Glide Speed", glide,
|
|
OrderedDesc($"{form} speed while gliding with no key held, in m/s.", new AcceptableValueRange<float>(0f, 30f), order--)),
|
|
BoostSpeed = config.Bind(section, $"{form} Boost Speed", boost,
|
|
OrderedDesc($"{form} speed while holding W, in m/s. Costs the flight stamina below.", new AcceptableValueRange<float>(0f, 50f), order--)),
|
|
SprintSpeed = config.Bind(section, $"{form} Sprint Speed", sprint,
|
|
OrderedDesc($"{form} speed while holding W and Shift, in m/s. Costs the sprint stamina on top.", new AcceptableValueRange<float>(0f, 60f), order--)),
|
|
ReverseSpeed = config.Bind(section, $"{form} Reverse Speed", reverse,
|
|
OrderedDesc($"{form} speed while holding S, in m/s. Costs the flight stamina.", new AcceptableValueRange<float>(0f, 30f), order--)),
|
|
LiftoffSpeed = config.Bind(section, $"{form} Liftoff Speed", liftoff,
|
|
OrderedDesc($"{form} climb speed out of water, in m/s. Always free, so a form that touches the sea can still leave it.", new AcceptableValueRange<float>(0f, 30f), order--)),
|
|
HoverSeconds = config.Bind(section, $"{form} Hover Seconds", hover,
|
|
OrderedDesc($"How long the {form} holds its height after the last powered beat before it starts to sink.", new AcceptableValueRange<float>(0f, 30f), order--)),
|
|
PoweredStaminaPerSecond = config.Bind(section, $"{form} Flight Stamina Per Second", powered,
|
|
OrderedDesc($"Stamina per second while the {form} holds W or S. Out of stamina, it can only glide. 0 makes flight free.", new AcceptableValueRange<float>(0f, 60f), order--)),
|
|
SprintStaminaPerSecond = config.Bind(section, $"{form} Sprint Stamina Per Second", sprintCost,
|
|
OrderedDesc($"Extra stamina per second while the {form} sprints, on top of the flight cost.", new AcceptableValueRange<float>(0f, 60f), order--)),
|
|
Encumbered = config.Bind(section, $"{form} While Encumbered", encumbered,
|
|
OrderedDesc($"Allowed: the {form} flies while you carry too much, at the extra stamina cost below. Blocked: it cannot take off while you are encumbered, and one that becomes encumbered in the air can only glide down. It still walks.", null, order--)),
|
|
EncumberedExtraCost = config.Bind(section, $"{form} Encumbered Extra Stamina Cost", extraCost,
|
|
OrderedDesc($"With 'Allowed' above: how much more the {form}'s flight and sprint cost while encumbered. 0.25 = 25% more.", new AcceptableValueRange<float>(0f, 1f), order--)),
|
|
};
|
|
}
|
|
|
|
private static FormTiming BindTiming(ConfigFile config, string section, string form, ref int order)
|
|
{
|
|
return new FormTiming
|
|
{
|
|
MaxDuration = config.Bind(section, $"{form} Max Duration", -1f,
|
|
OrderedDesc($"Seconds the {form} form lasts before you turn back on your own. -1 follows the boss tiers (see the Compendium), 0 means no limit.", new AcceptableValueRange<float>(-1f, 3600f), order--)),
|
|
DurationPerState = config.Bind(section, $"{form} Duration Per State", 0f,
|
|
OrderedDesc($"Seconds added to the {form}'s max duration per progression state. Only counts when Max Duration is above 0.", new AcceptableValueRange<float>(0f, 600f), order--)),
|
|
Cooldown = config.Bind(section, $"{form} Cooldown", -1f,
|
|
OrderedDesc($"Seconds after leaving the {form} form before you can take it again. -1 follows the boss tiers, 0 means none.", new AcceptableValueRange<float>(-1f, 3600f), order--)),
|
|
};
|
|
}
|
|
|
|
private static ConfigDescription OrderedDesc(string description, AcceptableValueBase range, int order)
|
|
{
|
|
return new ConfigDescription(description, range, new ConfigurationManagerAttributes { Order = order });
|
|
}
|
|
|
|
private static ConfigDescription KeyDesc(string description, int order)
|
|
{
|
|
return new ConfigDescription(description, null, new ConfigurationManagerAttributes { Order = order });
|
|
}
|
|
}
|
|
}
|