[DONE] Use negative values in damage_per_second for healing

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

[DONE] Use negative values in damage_per_second for healing

by Wuzzy » Sat Oct 04, 2014 03:18

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.
Last edited by Wuzzy on Fri Mar 06, 2015 09:59, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Use negative values in damage_per_second for healing

by Krock » Sat Oct 04, 2014 08:42

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)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Implemented!

by Wuzzy » Fri Mar 06, 2015 09:58

 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 16 guests

cron