ethanmoffat / EndlessClient

An open source client for Endless Online written in C#
MIT License
33 stars 16 forks source link

Show admin hide effect when player hides/unhides #357

Open sorokya opened 1 month ago

sorokya commented 1 month ago

Closes #351

@ethanmoffat is there a better way to reference the effect ID here besides a magic number?

ethanmoffat commented 1 month ago

Closes #351

@ethanmoffat is there a better way to reference the effect ID here besides a magic number?

There's HardCodedEffect that I have for things like the potion effects. Also includes WarpLeave and WarpArrive. https://github.com/ethanmoffat/EndlessClient/blob/d5f218181ebfa1a97a9afa7c2df801d9155f7573/EndlessClient/Rendering/Effects/HardCodedEffect.cs#L3

That's in rendering code though (not library code). I'd suggest changing the approach you've taken to add a method call ShowAdminHideEffect(int playerId) to the IEffectNotifier interface. This is implemented in CharacterAnimationActions so you could basically copy/paste the WarpEnter or WarpLeave implementation for ShowAdminHideEffect, just use a different HardCodedEffect. NotifyPotionEffect is currently really only used for potions, even though it could be used for any effect I'd prefer to keep it limited to just playing a potion effect.

sorokya commented 3 weeks ago

@ethanmoffat lol I didn't even realize I was using NotifyPotionEffect at the time. Updated code to use new effect notifier and hard coded effect id.