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:
parent
b16d1775d8
commit
0f5b5e4868
13 changed files with 200 additions and 57 deletions
|
|
@ -45,21 +45,37 @@ namespace RacesOfValheim
|
|||
// level for a short window past this before letting it start sinking.
|
||||
public float LastPoweredTime { get; set; }
|
||||
|
||||
// The drake's numbers for DirectedFlightPatch. Base flight stays free on purpose - the
|
||||
// drake arrives at the Elder, long before the player has the stamina pool to pay for
|
||||
// simply staying airborne - so only the sprint costs anything.
|
||||
public float TurnSpeed => SkadiConfig.FlightTurnSpeed.Value;
|
||||
public float GlideSpeed => SkadiConfig.FlightGlideSpeed.Value;
|
||||
public float BoostSpeed => SkadiConfig.FlightBoostSpeed.Value;
|
||||
public float SprintSpeed => SkadiConfig.FlightSprintSpeed.Value;
|
||||
public float ReverseSpeed => SkadiConfig.FlightReverseSpeed.Value;
|
||||
// This form's numbers for DirectedFlightPatch. The Drake's base flight defaults to free on
|
||||
// purpose - it arrives at the Elder, long before the player has the stamina pool to pay
|
||||
// for simply staying airborne - so only its sprint costs anything. The Moder pays for
|
||||
// every beat. The Fader never flies, so it falls back on the Drake's set unread.
|
||||
private SkadiConfig.FormFlight Flight =>
|
||||
formRules != null && formRules.Form == SkadiProgression.FormType.Moder ? SkadiConfig.ModerFlight : SkadiConfig.DrakeFlight;
|
||||
|
||||
public float TurnSpeed => Flight.TurnSpeed.Value;
|
||||
public float GlideSpeed => Flight.GlideSpeed.Value;
|
||||
public float BoostSpeed => Flight.BoostSpeed.Value;
|
||||
public float SprintSpeed => Flight.SprintSpeed.Value;
|
||||
public float ReverseSpeed => Flight.ReverseSpeed.Value;
|
||||
// Climbing out of water is deliberately slower than a powered climb in open air - the
|
||||
// wings are dragging themselves free, not racing.
|
||||
public float LiftoffSpeed => SkadiConfig.FlightLiftoffSpeed.Value;
|
||||
public float HoverSeconds => SkadiConfig.FlightHoverSeconds.Value;
|
||||
public float PoweredStaminaPerSecond => 0f;
|
||||
public float SprintStaminaPerSecond => SkadiConfig.FlightSprintStaminaPerSecond.Value;
|
||||
public bool CanPower => true;
|
||||
public float LiftoffSpeed => Flight.LiftoffSpeed.Value;
|
||||
public float HoverSeconds => Flight.HoverSeconds.Value;
|
||||
public float PoweredStaminaPerSecond => Flight.PoweredStaminaPerSecond.Value * EncumberedCostFactor();
|
||||
public float SprintStaminaPerSecond => Flight.SprintStaminaPerSecond.Value * EncumberedCostFactor();
|
||||
public bool CanPower => !(IsEncumbered() && TooHeavyToFly);
|
||||
|
||||
private bool TooHeavyToFly => Flight.Encumbered.Value == AswidConfig.EncumberedMode.Blocked;
|
||||
|
||||
private static bool IsEncumbered()
|
||||
{
|
||||
return Player.m_localPlayer != null && Player.m_localPlayer.IsEncumbered();
|
||||
}
|
||||
|
||||
private float EncumberedCostFactor()
|
||||
{
|
||||
return IsEncumbered() ? 1f + Flight.EncumberedExtraCost.Value : 1f;
|
||||
}
|
||||
|
||||
private SkadiProgression.FormRules formRules;
|
||||
|
||||
|
|
@ -171,7 +187,11 @@ namespace RacesOfValheim
|
|||
(SkadiConfig.FlightToggleKey.Value.IsDownIgnoringHeldKeys() || RaceInput.PadAttackDown(1)) &&
|
||||
formRules != null && formRules.Form != SkadiProgression.FormType.SkeletonDragon)
|
||||
{
|
||||
if (!isFlying && !isLanding)
|
||||
if (!isFlying && !isLanding && IsEncumbered() && TooHeavyToFly)
|
||||
{
|
||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skadi_too_heavy_to_fly"));
|
||||
}
|
||||
else if (!isFlying && !isLanding)
|
||||
{
|
||||
isFlying = true;
|
||||
LastPoweredTime = Time.time;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue