RacesOfValheim/JotunnModStub/Fenrir/FenrirStatusEffects.cs
kanym d1f328a496 feat(fenrir): eyes glow at night, bright when a form is ready
A community suggestion: an indicator on the character instead of the
"<form> is Ready!" text. FenrirVisuals borrows the Skeleton's eye_l and
eye_r the way AswidVisuals does, with the Aswid's playtested placement,
and tints them with the Fenring's own emission colour (2.0, 0.372, 0),
read from bundle c4210710.

Dark by day and in a beast form. At night they glow faintly, and
brightly while one of the three keys would transform. That uses the
same gates as TryTransformWithRules: tier, night, sun sickness,
cooldown. The owner writes it to the ZDO only on a change, so remote
players see the same.

New local section "Fenrir - Appearance": Ready Message (on by
default), Eye Glow, and the night and ready strengths.
2026-10-23 19:33:00 +02:00

48 lines
1.5 KiB
C#

using System.Collections;
using BepInEx;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using UnityEngine;
using UnityEngine.UI; // Added for UI
namespace RacesOfValheim
{
public class SE_FormCooldown : StatusEffect
{
public override void Stop()
{
base.Stop();
if (Player.m_localPlayer != null && FenrirConfig.ReadyMessage.Value)
{
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_ready", m_name));
}
}
}
public class SE_FenrirCurse : SE_Stats
{
public override void Setup(Character character)
{
base.Setup(character);
if (character == Player.m_localPlayer)
{
Player.m_localPlayer.m_customData["FenrirCurse_Active"] = "true";
}
}
public override void UpdateStatusEffect(float dt)
{
base.UpdateStatusEffect(dt);
int state = BossProgressionManager.GetCurrentProgressionState();
m_fallDamageModifier = FenrirProgression.GetFallDamageModifier(state);
// SE_Stats.ModifySpeed adds baseSpeed * m_speedModifier, so this is the bonus alone:
// 0 is vanilla speed, 0.03 is +3%. A leading 1.0f here was a flat +100%.
m_speedModifier = FenrirProgression.GetSpeedModifier(state);
m_jumpModifier = new Vector3(0, FenrirProgression.GetJumpModifier(state), 0);
}
}
}