1
0
mirror of git://repo.or.cz/minetest_mana.git synced 2025-06-30 14:10:21 +02:00

Add API for Mana regneration

This commit is contained in:
Wuzzy
2015-02-14 02:26:34 +01:00
parent 97f1079852
commit 47c4d35baa
2 changed files with 25 additions and 0 deletions

13
API.md
View File

@ -43,6 +43,12 @@ If the new maximum would become smaller than the current value,
the current value will automatically be set to
the new maximum.
### `mana.setregen(playername, value)`
Sets the mana regeneration per mana tick of the player to `value`.
Negative values are not permitted.
The length of one “mana tick” is specified as the server-wide setting
`mana_default_regen` in seconds.
### `mana.get(playername)`
Returns the current mana of the specified player as number.
@ -52,6 +58,13 @@ Returns the current mana of the specified player as number.
Returns the current maximum mana of the specified player as number.
### `mana.getregen(playername)`
Returns the current mana regneration per mana tick of the specified
player as number.
The length of one “mana tick” is specified as the server-wide setting
`mana_default_regen` in seconds.
### `mana.add(playername, value)`
Adds the specified non-negative amount of mana to the player, but only
if the sum would not be greater than the maximum,