Black Flash is (basically) finished!
Implementing PvP compatibility proved challenging as it used completely different methods and objects to obtain data from the game that I was completely unaware of. I encountered many problems along the way, most notably the health bar actually aligning to the damage being dealt by an attacking player. The number claiming the damage dealt didn’t actually change the health of the player. I later fixed this by manually changing the player’s health after a hit using other methods. Unfortunately, this wasn’t the only problems I encountered in the making of this project.
Upon testing, I figured out that black flash attacks were incapable of being lethal to a player. The modified damage was no longer dealt as soon as the player reached a health amount that would kill them via a black flash.
Each black flash hit dealt with a Copper Shortsword usually dealt about 60 damage. Continuously attacking a player with a black flash would, as it was supposed to, deal ~60 damage to the player. However, as soon as the player you were attacking reached a health below ~60, in which a black flash attack would kill them, the plugin stopped working altogether. The blue damage number being dealt would appear, but no ACTUAL changes would occur to the player’s health, at least not on the player’s end. I thought it was really annoying at first but it actually turned out to be a simple fix. I just needed a new if statement to handle killing the player when their health lowered towards a point in which it would die. Internally, the server viewed the player’s health as a negative. Since negative HP doesn’t exist in Terraria, I assume it defaulted to its original damage if an amount of damage dealt an amount that would make the player’s health negative. To fix this, I simply stated that if a player’s health fell below 0, the server itself would kill them automatically rather than the game itself killing them.
There are still some aspects of the plugin I would like to polish or add, but for now, its state is satisfactory. In the future, I would like to completely eliminate the firework being visible to create the explosion effect but I’ll be honest, this may not be within tShock’s capabilities (I’m probably wrong). I’d also like to completely replace the death message sent when a player dies to a black flash rather than sending a duplicate accompanying the regular death message. These things take longer than I thought they would. I’ll likely continue this as I seek to create fun, PvP plugins that can be used in servers such as this one.
Below is also a demonstration of said plugin in action! Like I said, there’s still plenty of things I’d like to improve on, so it’s likely not completely finished.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.