1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Respect object property hp_max field for players (#6287)

* Respect object property hp_max field for players
This allows modders to configure the maximal HP per player

* Statbars: Downscale bar to full 20 HP when exceeding this value
Add default max HP for players and breath constants to builtin
Document the constants

* Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
This commit is contained in:
SmallJoker 2017-08-23 22:32:10 +02:00 committed by Loïc Blot
parent d01b65abeb
commit f7d50a8078
9 changed files with 51 additions and 27 deletions

View file

@ -3276,6 +3276,7 @@ This is basically a reference to a C++ `ServerActiveObject`
* `0`: player is drowning,
* `1`-`10`: remaining number of bubbles
* `11`: bubbles bar is not shown
* See constant: `minetest.PLAYER_MAX_BREATH`
* `set_attribute(attribute, value)`:
* Sets an extra attribute with value on player.
* `value` must be a string.
@ -3980,6 +3981,7 @@ Definition tables
{
hp_max = 1,
-- ^ For players, the maximal HP defaults to `minetest.PLAYER_MAX_HP_DEFAULT`
physical = true,
collide_with_objects = true, -- collide with other objects if physical = true
weight = 5,