feat(skadi): each dragon form flies and cools down on its own terms

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.
This commit is contained in:
kanym 2026-11-02 15:58:17 +01:00
commit 0f5b5e4868
13 changed files with 200 additions and 57 deletions

View file

@ -69,15 +69,38 @@ namespace RacesOfValheim
public static ConfigEntry<float> FaderSpinDamage;
public static ConfigEntry<float> FaderSpinRadius;
// ─── 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;
// ─── 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)
{
@ -164,23 +187,69 @@ namespace RacesOfValheim
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 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)));
// 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)