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.
This commit is contained in:
parent
f1f8ed245c
commit
d1f328a496
5 changed files with 304 additions and 1 deletions
|
|
@ -150,6 +150,8 @@ namespace RacesOfValheim {
|
|||
}
|
||||
wasNight = isNight;
|
||||
|
||||
FenrirVisuals.SetReady(Player.m_localPlayer, CanTakeAnyForm());
|
||||
|
||||
if (isTransformed)
|
||||
{
|
||||
bool hasAnyForm = Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_FenrirForm".GetStableHashCode()) ||
|
||||
|
|
@ -171,6 +173,33 @@ namespace RacesOfValheim {
|
|||
if (FenrirConfig.CultistFormKey.Value.IsDownIgnoringHeldKeys()) { TryTransformWithRules(FenrirProgression.GetJKeyRules(state)); return; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether one of the three keys would transform right now. The same gates as
|
||||
/// TryTransformWithRules below, without its messages: this feeds the eye glow.
|
||||
/// </summary>
|
||||
private bool CanTakeAnyForm()
|
||||
{
|
||||
if (isTransformed) return false;
|
||||
|
||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||
return CanTake(FenrirProgression.GetGKeyRules(state))
|
||||
|| CanTake(FenrirProgression.GetHKeyRules(state))
|
||||
|| CanTake(FenrirProgression.GetJKeyRules(state));
|
||||
}
|
||||
|
||||
private bool CanTake(FenrirProgression.FormRules rules)
|
||||
{
|
||||
if (rules == null || rules.Form == FenrirProgression.FormType.None) return false;
|
||||
if (rules.NeedsNight && (sunSicknessTimer > 0f || !EnvMan.IsNight())) return false;
|
||||
|
||||
if (rules.CooldownMinutes > 0)
|
||||
{
|
||||
string cdName = rules.Form == FenrirProgression.FormType.Cultist ? "SE_CultistCooldown" : "SE_FenrirCooldown";
|
||||
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect(cdName.GetStableHashCode())) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void TryTransformWithRules(FenrirProgression.FormRules rules)
|
||||
{
|
||||
if (rules == null || rules.Form == FenrirProgression.FormType.None) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue