Hello everyone, currently working on a custom hero arena type map with boss unit spawns.
I was just wondering if there was a more efficient way to calculate and rank each players damage dealt to the boss so I can distribute Vespene proportionately to the percent damage they dealt. For clarification, I have a Damage Dealt global variable and a player damage rank variable with an array of 6 (6 player map) tallying the total damage dealt to the boss. Afterwards, I was able to get a rank system working by individually comparing all the Damage dealt variables and assign a rank to them. IE:
IF player 1 dealt > damage then player 2 to 6
Then Set variable: Player Damage rank = 1
IF player 1 dealt > damage than players 2 to 6 but not player at least one of them...
Then Set Variable: Player Damage Rank  = 2
Just seems like i'm doing this the long way... any suggestions to optimize the code, haven't found anything anywhere.
Saw something about loops but i've never worked with them.
Any suggestion is appreciated. Thank you