Skip to content

Commit

Permalink
Fix flickering spell effect metadata
Browse files Browse the repository at this point in the history
Adjusted flickering frame values to not have off-by-one error
  • Loading branch information
ethanmoffat committed Nov 19, 2023
1 parent d8708f8 commit 721567b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion EndlessClient/EndlessClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<PropertyGroup />
<ItemGroup>
<PackageReference Include="Amadevus.RecordGenerator" Version="0.6.0" />
<PackageReference Include="EndlessClient.Binaries" Version="1.3.1.2" />
<PackageReference Include="EndlessClient.Binaries" Version="1.3.3.2" />
<PackageReference Include="managed-midi" Version="1.9.14" />
<PackageReference Include="Monogame.Content.Builder.Task" Version="3.8.1.303" />
<PackageReference Include="MonoGame.Extended.Content.Pipeline" Version="3.8.0" />
Expand Down
4 changes: 3 additions & 1 deletion EndlessClient/Rendering/Effects/EffectSpriteInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
Expand Down
6 changes: 3 additions & 3 deletions EndlessClient/Rendering/Metadata/EffectMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 721567b

Please sign in to comment.