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.
155 lines
5.1 KiB
C#
155 lines
5.1 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
public static class SkadiProgression
|
|
{
|
|
public class FormRules
|
|
{
|
|
public bool ImmuneToCold = false;
|
|
public bool ImmuneToFreezing = false;
|
|
public bool FreezingToCold = false;
|
|
public bool BonusFrostDamage = false;
|
|
public bool FrostAura = false;
|
|
public float FrostResistance = 0f;
|
|
public float EitrRegenMultiplier = 1f;
|
|
public bool ColdSpell = false;
|
|
public bool ImprovedColdSpell = false;
|
|
|
|
public FormType Form = FormType.None;
|
|
public float DurationMinutes = 0f;
|
|
public float CooldownMinutes = 0f;
|
|
public bool CanAttackInForm = false;
|
|
}
|
|
|
|
public enum FormType
|
|
{
|
|
None,
|
|
Drake,
|
|
Moder,
|
|
SkeletonDragon
|
|
}
|
|
|
|
public static FormRules GetRules(int state)
|
|
{
|
|
FormRules rules = new FormRules();
|
|
|
|
if (state >= 1)
|
|
{
|
|
rules.ImmuneToCold = true;
|
|
rules.BonusFrostDamage = true;
|
|
rules.FrostResistance = 0.5f; // 50% resistance? Valheim uses DamageModifiers.
|
|
// Wait, FrostResistance isn't a percentage, it's a category.
|
|
// We'll map this to DamageModifier.Resistant (which is 50% reduction).
|
|
}
|
|
|
|
if (state >= 2)
|
|
{
|
|
rules.ColdSpell = true;
|
|
}
|
|
|
|
if (state >= 4)
|
|
{
|
|
rules.FreezingToCold = true;
|
|
}
|
|
|
|
if (state >= 6)
|
|
{
|
|
rules.EitrRegenMultiplier = 1.50f;
|
|
rules.ImmuneToFreezing = true;
|
|
rules.FreezingToCold = false; // Immunity overrides conversion
|
|
rules.ImprovedColdSpell = true;
|
|
}
|
|
|
|
if (state >= 7)
|
|
{
|
|
// Immunity to frost damage => DamageModifier.Immune
|
|
rules.FrostResistance = 1f; // 1 means Immune in our logic
|
|
rules.FrostAura = true;
|
|
}
|
|
|
|
return rules;
|
|
}
|
|
|
|
public static FormRules GetGKeyRules(int state)
|
|
{
|
|
FormRules rules = new FormRules();
|
|
if (state >= 4) // Bonemass
|
|
{
|
|
rules.Form = FormType.Drake;
|
|
rules.CanAttackInForm = true;
|
|
}
|
|
else if (state >= 3) // Elder
|
|
{
|
|
rules.Form = FormType.Drake;
|
|
rules.CanAttackInForm = false;
|
|
}
|
|
if (rules.Form == FormType.None) return null;
|
|
ApplyTiming(rules, SkadiConfig.DrakeTiming, state);
|
|
return rules;
|
|
}
|
|
|
|
public static FormRules GetHKeyRules(int state)
|
|
{
|
|
FormRules rules = new FormRules();
|
|
if (state >= 7) // Queen
|
|
{
|
|
rules.Form = FormType.Moder;
|
|
rules.DurationMinutes = 0f;
|
|
rules.CooldownMinutes = 0f;
|
|
rules.CanAttackInForm = true;
|
|
}
|
|
else if (state >= 6) // Yagluth
|
|
{
|
|
rules.Form = FormType.Moder;
|
|
rules.DurationMinutes = 1f;
|
|
rules.CooldownMinutes = 5f;
|
|
rules.CanAttackInForm = true;
|
|
}
|
|
else if (state >= 5) // Moder
|
|
{
|
|
rules.Form = FormType.Moder;
|
|
rules.DurationMinutes = 1f;
|
|
rules.CooldownMinutes = 10f;
|
|
rules.CanAttackInForm = true;
|
|
}
|
|
if (rules.Form == FormType.None) return null;
|
|
ApplyTiming(rules, SkadiConfig.ModerTiming, state);
|
|
return rules;
|
|
}
|
|
|
|
public static FormRules GetJKeyRules(int state)
|
|
{
|
|
FormRules rules = new FormRules();
|
|
if (state >= 8) // Fader
|
|
{
|
|
rules.Form = FormType.SkeletonDragon;
|
|
rules.DurationMinutes = 0f; // Assuming unlimited
|
|
rules.CooldownMinutes = 0f;
|
|
rules.CanAttackInForm = true;
|
|
}
|
|
if (rules.Form == FormType.None) return null;
|
|
ApplyTiming(rules, SkadiConfig.FaderTiming, state);
|
|
return rules;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The config's timing on top of the tier table above: -1 leaves the table's value, 0 or
|
|
/// more replaces it. Per-state seconds only stretch a limit that exists, as on the bat.
|
|
/// </summary>
|
|
private static void ApplyTiming(FormRules rules, SkadiConfig.FormTiming timing, int state)
|
|
{
|
|
if (timing == null) return;
|
|
|
|
float max = timing.MaxDuration.Value;
|
|
if (max >= 0f)
|
|
rules.DurationMinutes = max > 0f ? (max + timing.DurationPerState.Value * state) / 60f : 0f;
|
|
else if (rules.DurationMinutes > 0f)
|
|
rules.DurationMinutes += timing.DurationPerState.Value * state / 60f;
|
|
|
|
float cooldown = timing.Cooldown.Value;
|
|
if (cooldown >= 0f) rules.CooldownMinutes = cooldown / 60f;
|
|
}
|
|
}
|
|
}
|