Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
45eb047016 | |||
b152b04601 |
4
API.md
@ -1,5 +1,5 @@
|
|||||||
API documentation for Mana mod
|
API documentation for Mana 1.2.0
|
||||||
==============================
|
================================
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
The API of the Mana mod allows you to set and receive
|
The API of the Mana mod allows you to set and receive
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Mana [mana]
|
# Mana [mana]
|
||||||
|
|
||||||
* Version: 1.3.1
|
* Version: 1.2.0
|
||||||
* Note: This mod uses semantic versioning, as defined by version 2.0.0 of the SemVer standard. See: <http://semver.org/>
|
* Note: This mod uses semantic versioning, as defined by version 2.0.0 of the SemVer standard. See: <http://semver.org/>
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
@ -14,7 +14,7 @@ Each player will have an additional attribute: Mana. To be precise:
|
|||||||
|
|
||||||
By default, each player spawns with 0/200 mana, and regenerates 1 mana per fifth of a second. All
|
By default, each player spawns with 0/200 mana, and regenerates 1 mana per fifth of a second. All
|
||||||
these values can be configured with the server settings (`minetest.conf`) and it is highly advised to do
|
these values can be configured with the server settings (`minetest.conf`) and it is highly advised to do
|
||||||
so if you plan to integrate this mod into a game.
|
so if you plan to integrate this mod into a subgame.
|
||||||
|
|
||||||
The mana regeneration rate (the “mana tick”) is a global setting and is *not* configured on a
|
The mana regeneration rate (the “mana tick”) is a global setting and is *not* configured on a
|
||||||
per-player basis.
|
per-player basis.
|
||||||
@ -26,6 +26,7 @@ way. You should install other mods which use the Mana mod as a dependency.
|
|||||||
The API documentation is in the file `API.md`.
|
The API documentation is in the file `API.md`.
|
||||||
|
|
||||||
If the mod “HUD bars” [`hudbars`] is installed, a blue bar will be added to the HUD showing the player's mana reserves.
|
If the mod “HUD bars” [`hudbars`] is installed, a blue bar will be added to the HUD showing the player's mana reserves.
|
||||||
|
It currently only works with version 0.3.0 of this mod.
|
||||||
|
|
||||||
Otherwise, the mana is just shown as text.
|
Otherwise, the mana is just shown as text.
|
||||||
|
|
||||||
@ -43,5 +44,5 @@ License information
|
|||||||
===================
|
===================
|
||||||
* `textures/mana_icon.png`: [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) by [Buch](http://opengameart.org/users/Buch).
|
* `textures/mana_icon.png`: [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) by [Buch](http://opengameart.org/users/Buch).
|
||||||
* `textures/mana_bgicon.png`: CC BY 3.0, originally by Buch, modified by Wuzzy.
|
* `textures/mana_bgicon.png`: CC BY 3.0, originally by Buch, modified by Wuzzy.
|
||||||
* `textures/mana_bar.png`: [MIT License](https://opensource.org/licenses/MIT) by Wuzzy.
|
* `textures/mana_bar.png`: [WTFPL](http://www.wtfpl.net/txt/copying/) by Wuzzy.
|
||||||
* Everything else: MIT License.
|
* Everything else: WTFPL.
|
||||||
|
2
depends.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
hudbars?
|
||||||
|
intllib?
|
1
description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Adds a mana attribute to players, can be used as energy source for magical items, etc.
|
13
init.lua
@ -2,14 +2,19 @@
|
|||||||
Mana
|
Mana
|
||||||
This mod adds mana to players, a special attribute
|
This mod adds mana to players, a special attribute
|
||||||
|
|
||||||
License: MIT License
|
License: WTFPL
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--[===[
|
--[===[
|
||||||
Initialization
|
Initialization
|
||||||
]===]
|
]===]
|
||||||
|
|
||||||
local S = minetest.get_translator("mana")
|
local S
|
||||||
|
if (minetest.get_modpath("intllib")) then
|
||||||
|
S = intllib.Getter()
|
||||||
|
else
|
||||||
|
S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
|
||||||
|
end
|
||||||
|
|
||||||
mana = {}
|
mana = {}
|
||||||
mana.playerlist = {}
|
mana.playerlist = {}
|
||||||
@ -271,7 +276,7 @@ end)
|
|||||||
]===]
|
]===]
|
||||||
|
|
||||||
if minetest.get_modpath("hudbars") ~= nil then
|
if minetest.get_modpath("hudbars") ~= nil then
|
||||||
hb.register_hudbar("mana", 0xFFFFFF, S("Mana"), { bar = "mana_bar.png", icon = "mana_icon.png", bgicon = "mana_bgicon.png" }, 0, mana.settings.default_max, false)
|
hb.register_hudbar("mana", 0xFFFFFF, S("Mana"), { bar = "mana_bar_purple.png", icon = "mana_icon_purple.png", bgicon = "mana_icon_bg_empty.png" }, 0, mana.settings.default_max, false)
|
||||||
|
|
||||||
function mana.hud_update(playername)
|
function mana.hud_update(playername)
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
@ -321,3 +326,5 @@ end
|
|||||||
mana.round = function(x)
|
mana.round = function(x)
|
||||||
return math.ceil(math.floor(x+0.5))
|
return math.ceil(math.floor(x+0.5))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.log("action", "[mana] loaded.")
|
||||||
|
2
locale/de.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Mana = Mana
|
||||||
|
Mana: @1/@2 = Mana: @1/@2
|
@ -1,3 +0,0 @@
|
|||||||
# textdomain:mana
|
|
||||||
Mana=Mana
|
|
||||||
Mana: @1/@2=Mana: @1/@2
|
|
@ -1,3 +1,2 @@
|
|||||||
# textdomain:mana
|
Mana =
|
||||||
Mana=
|
Mana: @1/@2 =
|
||||||
Mana: @1/@2=
|
|
||||||
|
3
mod.conf
@ -1,3 +0,0 @@
|
|||||||
name = mana
|
|
||||||
description = Adds a mana attribute to players, can be used as energy source for magical items, etc.
|
|
||||||
optional_depends = hudbars
|
|
BIN
screenshot.png
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 80 B |
BIN
textures/mana_bar_purple.png
Executable file
After Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
BIN
textures/mana_icon_bg_empty.png
Executable file
After Width: | Height: | Size: 635 B |
BIN
textures/mana_icon_purple.png
Executable file
After Width: | Height: | Size: 600 B |