The rate at which the health text transitions can be adjusted by the _transitionRate variable in GrubWorldPanel.razor. The health text transitions the same way when increasing (say, healing), however, this can be easily removed if unwanted.
I also set the NameTag health to always MathF.Ceiling(), whereas previously it would always floor due to int typecasting. While this is out of scope, I ran into a -5 damage number putting a Grub's NameTag health from 100 -> 94 (Grub.Health was at 94.988) while I was testing, and since I believe this to be unintentional and it was a one-line fix in the same file I figured what the heck.
#166
The rate at which the health text transitions can be adjusted by the _transitionRate variable in GrubWorldPanel.razor. The health text transitions the same way when increasing (say, healing), however, this can be easily removed if unwanted.
I also set the NameTag health to always MathF.Ceiling(), whereas previously it would always floor due to int typecasting. While this is out of scope, I ran into a -5 damage number putting a Grub's NameTag health from 100 -> 94 (Grub.Health was at 94.988) while I was testing, and since I believe this to be unintentional and it was a one-line fix in the same file I figured what the heck.
https://github.com/apetavern/sbox-grubs/assets/43252311/42a7d632-aab9-4f1c-b8e3-08152bdd3fbd