better calculation of speeds

master
A. Demant 2019-01-12 16:23:35 +01:00
parent cb97aa2e8f
commit d96d13483d
2 changed files with 12 additions and 8 deletions

View File

@ -169,7 +169,7 @@ minetest.register_globalstep(function(dtime)
end
end
if playerdata.gtimer1 > 0.5 then
if playerdata.gtimer1 > 0.75 then
playerdata.gtimer1=0
if playerdata.hidx ~= nil then
local act_logon=os.clock()-xpfw.player_get_attribute(player,"lastlogin")
@ -184,12 +184,16 @@ minetest.register_globalstep(function(dtime)
if playerdata.dtime>xpfw.rtime then
playerdata.dtime=0
local flags=playerdata.flags
local attrib=xpfw.attributes
for i,attn in ipairs(xpfw.attrib_recreates) do
local att=xpfw.attributes[attn]
if xpfw.player_get_attribute(player,attn) > att.min and playerdata.flags[attn] == nil then
xpfw.player_sub_attribute(player,attn)
local att=attrib[attn]
if flags[attn] == nil then
if xpfw.player_get_attribute(player,attn) > att.min then
xpfw.player_sub_attribute(player,attn)
end
end
playerdata.flags[attn]=nil
flags[attn]=nil
end
end
end

View File

@ -1,11 +1,11 @@
xpfw.prefix (Prefix for variable name) string "xp"
xpfw.recreation_time (Global time step to reduce mean values) float 1.25
xpfw.recreation_time (Global time step to reduce mean values) float 0.5
xpfw.light_mean_weight (Weight factor for light value) int 50 1 10000
xpfw.light_mean_default (Weight factor for light value) int 11 0 14
xpfw.mean_weight (Weight factor for calculating mean value) int 5000 1 10000
xpfw.experience_max (Normal max value for experiences) int 20 10 100
xpfw.swam_mean_weight (Weight factor for mean swimming experience) int 75 1 10000
xpfw.swam_recreation (Weight factor for mean swimming experience) int 15 1 10000
xpfw.swam_mean_weight (Weight factor for mean swimming experience) int 15 1 10000
xpfw.swam_recreation (Weight factor for mean swimming experience) int 5 1 10000
xpfw.walked_mean_weight (Weight factor for mean walking experience) int 15 1 10000
xpfw.walked_recreation (Weight factor for mean walking experience) int 5 1 10000
xpfw.dig_mean_weight (Weight factor for mean digging experience) int 10 1 10000