Page 1 of 1

[DONE] Use negative values in damage_per_second for healing

PostPosted: Sat Oct 04, 2014 03:18
by Wuzzy
Hi!
I am talking about the Lua API and am suggesting a small change.

A node definition can contain the field “damage_per_second”. If specified, the node will damage any player in this node by this number. However, this number can only be non-negative.
If I specify a negative value, I just instantly die. I guess this is because of a “wrap-around” and I get the maximum possible damage.

This is rather useless, since already a value of 20 is a quick kill, so the highest values will probably not be used.

Therefore, I suggest to actually allow negative numbers and use them for healing. So a value of -5 means you get healed by 5 HP per second. It also makes more sense, a damage of -5 equals a healing of +5. In practice, I don’t think this change would break any existing mods, because using a value larger than 20 is already overkill.

This small change would be actually pretty useful for many mods, I guess.

Re: Use negative values in damage_per_second for healing

PostPosted: Sat Oct 04, 2014 08:42
by Krock
Wuzzy wrote:However, this number can only be non-negative.

Or non-non-positive.

Actually, it might be the same thing as with
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
/giveme default:cobble -1

..where -1 equals ~ 65500 (Because signed numbers turn into unsigned)

Implemented!

PostPosted: Fri Mar 06, 2015 09:58
by Wuzzy