diff --git a/api.lua b/api.lua index d06e188..3a88d2d 100644 --- a/api.lua +++ b/api.lua @@ -67,7 +67,7 @@ M.register_experience=function(name,indata) M.experiences[name]=tid end -xpfw.player_reset_attributes(player) +xpfw.player_reset_attributes=function(player) for i,att_def in ipairs(xpfw.attributes) do local setval=att_def.min or 0 if att_def.default ~= nil then @@ -167,9 +167,14 @@ minetest.register_globalstep(function(dtime) -- calculation walk by actual velocity local tvel=player:get_player_velocity() if tvel ~= nil then + local act_node=minetest.get_node(act_pos) + local vel_action="walked" + if minetest.get_item_group(act_node.name,"water")>0 then + vel_action="swam" + end local tvelo=vector.distance(tvel,{x=0,y=0,z=0}) if tvelo>0 then - xpfw.player_add_attribute(player,"walked",tvelo*dtime) + xpfw.player_add_attribute(player,vel_action,tvelo*dtime) end end --calculating mean sun level diff --git a/chat_commands.lua b/chat_commands.lua index 4f492c8..1aa35c8 100644 --- a/chat_commands.lua +++ b/chat_commands.lua @@ -32,9 +32,6 @@ minetest.register_chatcommand("xpreset", { }) minetest.register_chatcommand("xpfw", { - privs = { - server = true - }, params = "", description = "Get the statistics for the given player or yourself", func = function(name, param) @@ -44,7 +41,7 @@ minetest.register_chatcommand("xpfw", { minetest.chat_send_player(name, param) local player = "" for att_def in pairs(xpfw.attributes) do - player=player.."; "..att_def..": "..xpfw.player_get_attribute(minetest.get_player_by_name(name),att_def) + player=player.."; "..att_def..": "..math.ceil(xpfw.player_get_attribute(minetest.get_player_by_name(name),att_def)) end minetest.chat_send_player(name, dump(player)) diff --git a/config.lua b/config.lua index 4805651..fa5a8ee 100644 --- a/config.lua +++ b/config.lua @@ -12,11 +12,11 @@ xpfw.prefix=minetest.settings:get("xpfw.prefix") or "xp" xpfw.mean_weight=minetest.settings:get("xpfw.mean_weight") or 500 xpfw.experience_max=minetest.settings:get("xpfw.experience_max") or 20 -for i,attr in ipairs({"walked","distance","login","dug","build","deaths","spoke","killed_mobs","killed_player", +for i,attr in ipairs({"walked","distance","swam","login","dug","build","deaths","spoke","killed_mobs","killed_player", "lastlogin","logon"}) do xpfw.register_attribute(attr,{min=0,max=math.huge,default=0}) end xpfw.register_attribute("meanlight",{min=0,max=default.LIGHT_MAX, - moving_average_factor=minetest.settings:get("xpfw.light_mean_weight") or 500 - default=math.min(default.LIGHT_MAX,minetest.settings:get("xpfw.default")) or 11 + moving_average_factor=minetest.settings:get("xpfw.light_mean_weight") or 500, + default=math.min(default.LIGHT_MAX,minetest.settings:get("xpfw.default") or 11), }) diff --git a/nohup.out b/nohup.out deleted file mode 100644 index e69de29..0000000 diff --git a/textures/src/Cause-Of-Death.svg b/textures/src/Cause-Of-Death.svg new file mode 100644 index 0000000..076c62d --- /dev/null +++ b/textures/src/Cause-Of-Death.svg @@ -0,0 +1,1914 @@ + +image/svg+xml \ No newline at end of file diff --git a/textures/src/WorkingTheLand.svg b/textures/src/WorkingTheLand.svg new file mode 100644 index 0000000..9951765 --- /dev/null +++ b/textures/src/WorkingTheLand.svg @@ -0,0 +1,58 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/textures/src/airchuck88-hiker.svg b/textures/src/airchuck88-hiker.svg new file mode 100644 index 0000000..15b5ea4 --- /dev/null +++ b/textures/src/airchuck88-hiker.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + hiker + 2007-09-21T17:33:21 + silouhette of hiker hiking up a mountain + https://openclipart.org/detail/5661/hiker-by-airchuck88 + + + airchuck88 + + + + + climber + hike + hiker + man + mountain + silhouette + + + + + + + + + + + diff --git a/textures/src/coal-mine.svg b/textures/src/coal-mine.svg new file mode 100644 index 0000000..938abcf --- /dev/null +++ b/textures/src/coal-mine.svg @@ -0,0 +1,161 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/textures/xpfw_death.png b/textures/xpfw_death.png new file mode 100644 index 0000000..a78979d Binary files /dev/null and b/textures/xpfw_death.png differ diff --git a/textures/xpfw_farming.png b/textures/xpfw_farming.png new file mode 100644 index 0000000..ca15eb7 Binary files /dev/null and b/textures/xpfw_farming.png differ diff --git a/textures/xpfw_hiking.png b/textures/xpfw_hiking.png new file mode 100644 index 0000000..eae31ea Binary files /dev/null and b/textures/xpfw_hiking.png differ diff --git a/textures/xpfw_miner.png b/textures/xpfw_miner.png new file mode 100644 index 0000000..e298c75 Binary files /dev/null and b/textures/xpfw_miner.png differ