Re: [SSGM 4.0 Plugin] Refill Costs Money [message #471422 is a reply to message #471418] |
Thu, 12 July 2012 07:25 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to previous message](/theme/Renegade_Forums/images/down.png) |
iRANian
Messages: 4300 Registered: April 2011
Karma:
|
General (4 Stars) |
|
|
It calculates the percentage of the HP you lost as fraction of your max HP, where HP is health + shield strength. Which is then multiplied with the preset cost and the base power multiplier. Then it's multiplied with the fraction of that cost you want to make the refill cost.
Your right, it would, but internally that part of the calculation gets converted to integer (so everything below 1 is rounded to 0) before I use it as floating point, so the issue doesn't occur (otherwise I can test for MaxHP == CurrentHP).
Your formula does the same thing as mine but accounts for that.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
[Updated on: Thu, 12 July 2012 07:35] Report message to a moderator
|
|
|