14 Commits

Author SHA1 Message Date
31250df93e Version 1.3.1 2019-03-22 16:27:42 +01:00
f1e6d37614 Remove word “subgame” 2019-03-22 16:27:25 +01:00
6d36fc9526 Version 1.3.0 2019-03-22 16:23:27 +01:00
d63422eef3 Add screenshot 2019-03-22 12:31:38 +01:00
3e7f533bee Use new 5.0.0 mod.conf file 2019-03-22 12:24:16 +01:00
ba42cf3e38 Change license to MIT 2019-03-22 12:23:10 +01:00
7efd3064bb Use new 5.0.0 translation system 2019-03-22 12:19:57 +01:00
f4a0c31301 Update for 0.4.16 settings syntax 2017-06-20 16:57:11 +02:00
838d1df687 Version 1.2.0 2016-11-12 20:33:16 +01:00
374d9742f8 Update outdated inttlib boilerplate 2016-11-09 01:58:50 +01:00
93477205a4 Fix CC-BY 3.0 link 2016-10-29 15:29:09 +02:00
3b8097e44a Use Markdown format for README file 2016-10-29 15:27:00 +02:00
fc0efd94fb Remove redundant version number from init.lua 2016-10-29 15:23:22 +02:00
7b0ef7204b Add intllib support 2016-08-05 17:43:55 +02:00
9 changed files with 36 additions and 32 deletions

4
API.md
View File

@ -1,5 +1,5 @@
API documentation for Mana 1.1.0 API documentation for Mana mod
================================ ==============================
## 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

View File

@ -1,22 +1,20 @@
Mana mod [mana] # Mana [mana]
===============
Version: 1.1.0
Note: This mod uses semantic versioning, as defined by version 2.0.0 of the SemVer standard.
See: <http://semver.org/>
Description * Version: 1.3.1
=========== * Note: This mod uses semantic versioning, as defined by version 2.0.0 of the SemVer standard. See: <http://semver.org/>
## Description
This mod adds basic support for mana to Minetest. This mod adds basic support for mana to Minetest.
Each player will have an additional attribute: Mana. To be precise: Each player will have an additional attribute: Mana. To be precise:
- Current mana reserves: How much mana the player currently has * Current mana reserves: How much mana the player currently has
- Maximum possible mana: How much mana the player can have at maximum * Maximum possible mana: How much mana the player can have at maximum
- Mana regeneration amont: How much mana will be generated each “mana tick” (default 0.2 seconds) * Mana regeneration amont: How much mana will be generated each “mana tick” (default 0.2 seconds)
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 subgame. so if you plan to integrate this mod into a game.
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.
@ -25,15 +23,13 @@ The mod provides a simple API to set, get, add and subtract the mana (and maximu
for setting the regeneration amount. Note that this mod itself does *not* change the gameplay in a meaningful for setting the regeneration amount. Note that this mod itself does *not* change the gameplay in a meaningful
way. You should install other mods which use the Mana mod as a dependency. 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.
Configuration ## Configuration
=============
This mod can be configured with minetest.conf! The following settings are accepted: This mod can be configured with minetest.conf! The following settings are accepted:
@ -43,10 +39,9 @@ This mod can be configured with minetest.conf! The following settings are accept
regen value per mana tick. Default: `0.2`. This value must be positive, also try to avoid very small values regen value per mana tick. Default: `0.2`. This value must be positive, also try to avoid very small values
as those could probably stress your machine a lot. as those could probably stress your machine a lot.
License information License information
=================== ===================
* textures/mana_icon.png: CC-BY 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, originally by Buch <http://opengameart.org/users/Buch>, modified by Wuzzy. * `textures/mana_bgicon.png`: CC BY 3.0, originally by Buch, modified by Wuzzy.
* textures/mana_bar.png: WTFPL by Wuzzy. * `textures/mana_bar.png`: [MIT License](https://opensource.org/licenses/MIT) by Wuzzy.
* Everything else: WTFPL. * Everything else: MIT License.

View File

@ -1 +0,0 @@
hudbars?

View File

@ -1 +0,0 @@
Adds a mana attribute to players, can be used as energy source for magical items, etc.

View File

@ -1,14 +1,16 @@
--[[ --[[
Mana 1.0.2 Mana
This mod adds mana to players, a special attribute This mod adds mana to players, a special attribute
License: WTFPL License: MIT License
]] ]]
--[===[ --[===[
Initialization Initialization
]===] ]===]
local S = minetest.get_translator("mana")
mana = {} mana = {}
mana.playerlist = {} mana.playerlist = {}
@ -18,17 +20,17 @@ mana.settings.default_regen = 1
mana.settings.regen_timer = 0.2 mana.settings.regen_timer = 0.2
do do
local default_max = tonumber(minetest.setting_get("mana_default_max")) local default_max = tonumber(minetest.settings:get("mana_default_max"))
if default_max ~= nil then if default_max ~= nil then
mana.settings.default_max = default_max mana.settings.default_max = default_max
end end
local default_regen = tonumber(minetest.setting_get("mana_default_regen")) local default_regen = tonumber(minetest.settings:get("mana_default_regen"))
if default_regen ~= nil then if default_regen ~= nil then
mana.settings.default_regen = default_regen mana.settings.default_regen = default_regen
end end
local regen_timer = tonumber(minetest.setting_get("mana_regen_timer")) local regen_timer = tonumber(minetest.settings:get("mana_regen_timer"))
if regen_timer ~= nil then if regen_timer ~= nil then
mana.settings.regen_timer = regen_timer mana.settings.regen_timer = regen_timer
end end
@ -269,7 +271,7 @@ end)
]===] ]===]
if minetest.get_modpath("hudbars") ~= nil then if minetest.get_modpath("hudbars") ~= nil then
hb.register_hudbar("mana", 0xFFFFFF, "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.png", icon = "mana_icon.png", bgicon = "mana_bgicon.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)
@ -283,7 +285,7 @@ if minetest.get_modpath("hudbars") ~= nil then
else else
function mana.manastring(playername) function mana.manastring(playername)
return string.format("Mana: %d/%d", mana.get(playername), mana.getmax(playername)) return S("Mana: @1/@2", mana.get(playername), mana.getmax(playername))
end end
function mana.hud_add(playername) function mana.hud_add(playername)

3
locale/mana.de.tr Normal file
View File

@ -0,0 +1,3 @@
# textdomain:mana
Mana=Mana
Mana: @1/@2=Mana: @1/@2

3
locale/template.txt Normal file
View File

@ -0,0 +1,3 @@
# textdomain:mana
Mana=
Mana: @1/@2=

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
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 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB