From 721567b3e2b12f0d5b7e9dd3d3bde6dc5936da4d Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Sat, 18 Nov 2023 23:28:02 -0800 Subject: [PATCH] Fix flickering spell effect metadata Adjusted flickering frame values to not have off-by-one error --- EndlessClient/EndlessClient.csproj | 2 +- EndlessClient/Rendering/Effects/EffectSpriteInfo.cs | 4 +++- EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/EndlessClient/EndlessClient.csproj b/EndlessClient/EndlessClient.csproj index 581a5d7a4..77fd6bf35 100644 --- a/EndlessClient/EndlessClient.csproj +++ b/EndlessClient/EndlessClient.csproj @@ -83,7 +83,7 @@ - + diff --git a/EndlessClient/Rendering/Effects/EffectSpriteInfo.cs b/EndlessClient/Rendering/Effects/EffectSpriteInfo.cs index 8e57a48ea..267d00d95 100644 --- a/EndlessClient/Rendering/Effects/EffectSpriteInfo.cs +++ b/EndlessClient/Rendering/Effects/EffectSpriteInfo.cs @@ -99,7 +99,9 @@ private int GetDisplayFrame() return _metadata.AnimationType switch { EffectAnimationType.Flickering => - _random.Next(_metadata.RandomFlickeringMetadata?.FirstFrame ?? 0, (_metadata.RandomFlickeringMetadata?.LastFrame ?? 0) + 1) - 1, + _random.Next( + _metadata.RandomFlickeringMetadata?.FirstFrame ?? 0, + 1 + (_metadata.RandomFlickeringMetadata?.LastFrame ?? _metadata.RandomFlickeringMetadata?.FirstFrame ?? 0)), _ => _displayFrame + 1 }; } diff --git a/EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs b/EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs index 1982c7967..577bc805c 100644 --- a/EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs +++ b/EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs @@ -39,11 +39,11 @@ public EffectMetadataProvider(IGFXMetadataLoader metadataLoader) { 17, new EffectMetadata(false, true, true, SoundEffectID.IceBlastSpell1, 7, 1, 0, 0, EffectAnimationType.Static, null, null, null) }, // ice blast { 18, new EffectMetadata(false, false, true, SoundEffectID.EnergyBallSpell, 7, 1, 0, 0, EffectAnimationType.VerticalSliding, new VerticalSlidingEffectMetadata(-10), null, null) }, // energy ball { 19, new EffectMetadata(true, true, true, SoundEffectID.WhirlSpell, 4, 2, 0, -10, EffectAnimationType.Position, null, new PositionOffsetEffectMetadata(new[] { -20, 0, 20, 0 }, new[] { 0, 14, 0, -14 }), null) }, // whirl / tornado - { 20, new EffectMetadata(false, true, false, SoundEffectID.AuraSpell, 5, 3, 0, -12, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(4, 5)) }, // aura + { 20, new EffectMetadata(false, true, false, SoundEffectID.AuraSpell, 5, 3, 0, -12, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(3, 4)) }, // aura { 21, new EffectMetadata(false, false, true, SoundEffectID.BouldersSpell, 7, 1, 0, -160, EffectAnimationType.VerticalSliding, new VerticalSlidingEffectMetadata(30), null, null) }, // boulders - { 22, new EffectMetadata(true, true, false, SoundEffectID.HeavenSpell, 5, 4, 0, -114, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(4, 5)) }, // heaven + { 22, new EffectMetadata(true, true, false, SoundEffectID.HeavenSpell, 5, 4, 0, -114, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(3, 4)) }, // heaven { 23, new EffectMetadata(true, true, false, SoundEffectID.IceBlastSpell2, 6, 1, 0, -160, EffectAnimationType.VerticalSliding, new VerticalSlidingEffectMetadata(30), null, null) }, // blue flame - { 24, new EffectMetadata(true, true, false, SoundEffectID.HeavenSpell, 5, 4, 0, -114, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(4, 5)) }, // dark beam + { 24, new EffectMetadata(true, true, false, SoundEffectID.HeavenSpell, 5, 4, 0, -114, EffectAnimationType.Flickering, null, null, new RandomFlickeringEffectMetadata(3, 4)) }, // dark beam { 25, new EffectMetadata(false, false, true, SoundEffectID.AdminHide, 4, 2, 0, 0, EffectAnimationType.Static, null, null, null) }, // admin hide { 26, new EffectMetadata(true, true, false, SoundEffectID.DarkHandSpell, 5, 2, 0, 0, EffectAnimationType.Static, null, null, null) }, // dark hand { 27, new EffectMetadata(true, true, false, SoundEffectID.DarkHandSpell, 5, 2, 0, 0, EffectAnimationType.Static, null, null, null) }, // dark skull