From 125ec8b6539dc55505833e5790901fbac9bc109e Mon Sep 17 00:00:00 2001 From: cale Date: Thu, 18 Aug 2016 18:36:41 +0200 Subject: [PATCH] added use for the skill miner --- mods/skills/init.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mods/skills/init.lua b/mods/skills/init.lua index a1132cc..4f1c35f 100644 --- a/mods/skills/init.lua +++ b/mods/skills/init.lua @@ -281,6 +281,37 @@ skills.register_tool("bow", { }) +minetest.override_item("default:stone_with_coal", { + on_dig = function(pos, node, player) + if skills.lvls[player:get_player_name()] then + xp.add_xp(player,xp.get_xp(xp.player_levels[player:get_player_name()], 50)*(skills.lvls[player:get_player_name()]["miner"]-1)) + end + minetest.node_dig(pos, node, player) + end, +}) + +minetest.override_item("default:stone_with_diamond", { + on_dig = function(pos, node, player) + if skills.lvls[player:get_player_name()] then + xp.add_xp(player,xp.get_xp(xp.player_levels[player:get_player_name()], 10)) + end + minetest.node_dig(pos, node, player) + end, +}) + +minetest.override_item("default:stone", { + on_dig = function(pos, node, player) + if skills.lvls[player:get_player_name()]["miner"] then + if skills.lvls[player:get_player_name()]["miner"] > 1 then + if math.random(0, 20) == 1 then + xp.add_xp(player,10) + end + end + end + minetest.node_dig(pos, node, player) + end, +}) + local modpath = minetest.get_modpath("skills") dofile(modpath.."/abilities.lua")