Compare commits

...

5 Commits

Author SHA1 Message Date
ademant 3090d2e9ee mod.conf 2019-02-22 14:52:13 +01:00
ademant 1e04f0e4c2 explained mod name 2019-02-21 14:49:08 +01:00
ademant 861d2810be error in substraction function 2019-02-21 14:33:50 +01:00
ademant 72cbbbadf9 error in substraction function 2019-02-21 14:13:03 +01:00
A. Demant 85baaf5d07 works only with minetest 5 2019-02-18 06:16:01 +01:00
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,5 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# Minetest Game mod: XPFW
# Minetest Game mod: XPFW (eXPerience FrameWork)
See license.txt for license information.
@ -13,6 +13,10 @@ https://gitlab.com/ademant/minetest_xpfw.git
https://github.com/ademant/minetest_xpfw.git
Works only with Minetest >= 5.0
Minetest <= 0.4.17 does not support the mechanism for handling player related meta data.
## Short description
XPFW provide an API for storing values relevant for experience mechanism into player metadata (Identified with prefix "XPFW_"). It also stores several statistic values during playtime:
- Walked distances calculated out of velocity (important: teleporting does not influence this value)

View File

@ -60,6 +60,7 @@ xpfw.player_add_attribute=function(player,attrib,val)
-- if <val> = nil then set to max value
local nval=val
local att_def=xpfw.attributes[attrib]
if att_def == nil then return end
if val==nil then
nval=att_def.max or 20
end
@ -77,7 +78,8 @@ xpfw.player_sub_attribute=function(player,attrib,val)
-- if <val> = nil then set to max value
local nval=val
local playername=player:get_player_name()
local att_def=M.player[playername].attributes[attrib]
local att_def=xpfw.attributes[attrib]
if att_def == nil then return end
if val==nil then
nval=att_def.max or 20
end

View File

@ -1,7 +1,7 @@
name = xpfw
title = xpfw
author = ademant
description = Experience mod for Minetest
description = eXPerience FrameWork for Minetest
depends = default,basic_functions
optional_depends = cmi
license = MIT