Flight ran on the debug-fly noclip, so it ignored aim entirely and needed Space/Ctrl for height. It now uses Character's native flying-creature movement with the camera's full look direction fed in each frame: - Aim steers, including climb and dive; W powers forward, releasing it holds level briefly and then settles into a glide instead of coasting along the aim vector (which let you climb forever without input). - The body actually turns now. m_flyTurnSpeed sat at Character's 12 deg/s default because the Player prefab was never set up to fly, so a quarter turn took over seven seconds and read as no rotation at all. - Touching down no longer slides you forward forever. Zeroing the fly speeds stops the character without fighting the AddForce UpdateFlying queues, which had caused frame-to-frame jitter and TAA ghosting. DurationMinutes was never wired to anything, so timed forms never expired and their cooldown, which only starts on reversion, was unreachable in practice. Timed forms now drop on their own, and both the remaining time and the cooldown show up beside the minimap as a Moder trophy icon. Attack capability was snapshotted when the form was entered, so reaching the Bonemass tier while already transformed left the drake unarmed until the player reverted and transformed again; it is re-read live now.
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
// Timed dragon forms. m_ttl is set when the form is entered, which is all Valheim needs to
|
|
// render the countdown: StatusEffect.GetIconText() prints the remaining time by itself.
|
|
public class SE_SkadiForm : StatusEffect
|
|
{
|
|
}
|
|
|
|
public class SE_SkadiStats : SE_Stats
|
|
{
|
|
public override void Setup(Character character)
|
|
{
|
|
base.Setup(character);
|
|
name = "SE_SkadiStats";
|
|
m_name = "Skadi's Aura";
|
|
m_tooltip = "Empowered by the frost.";
|
|
}
|
|
|
|
public void UpdateStats(SkadiProgression.FormRules rules)
|
|
{
|
|
m_mods = new List<HitData.DamageModPair>();
|
|
if (rules.FrostResistance >= 1f)
|
|
{
|
|
m_mods.Add(new HitData.DamageModPair() { m_type = HitData.DamageType.Frost, m_modifier = HitData.DamageModifier.Immune });
|
|
}
|
|
else if (rules.FrostResistance >= 0.5f)
|
|
{
|
|
m_mods.Add(new HitData.DamageModPair() { m_type = HitData.DamageType.Frost, m_modifier = HitData.DamageModifier.Resistant });
|
|
}
|
|
|
|
m_eitrRegenMultiplier = rules.EitrRegenMultiplier;
|
|
}
|
|
}
|
|
}
|