Can you recommend any code cleanup or enhancement for this plugin?
I'm in the process of cleaning up Halloween plugins in preparation for Scream Fortress. This plugin works just fine as-is. However, if you have any tips for code cleanup or improvement I'd love to hear them. I'm eager to learn.
Current plugin functionality:
Target player becomes Merasmus the Wizard. Changes to gray team and can attack players on RED and BLU team. Changes to sniper class with Merasmus player model. Removes all weapons and is given a melee weapon. Can cast 500 fireball spells. Can cast unlimited lightning spells. Can launch nearby players very high into air. Can release bombs that damage nearby players. Has extremely enhanced attributes with damage resistances. Melee attacks have increased range and instantly kill and turns victim to gold. Ambient sounds are played while Merasmus is alive.
You might be able to put the braced initializer directly into TeleportEntity without a tag mismatch; I keep forgetting if that's been fixed in SM 1.11 and don't feel like setting up an environment to test.
The strings that are part of a set could be moved to an array:
Rename variables for consistency, but the globals in particular should all have a prefix to make it obvious what scope they have and to minimize the risk of variable shadowing, even though the compiler does warn you about that.
ParticleIndex should use an entity reference EntIndexToEntRef. You can use the value in most places that accept entity indices. You may also want to use a client-sized array to store that state and ensure that calls to BuildParticle clean up previous particles.