From 88263e357aadff09ed8cf947c7d88d65ea162368 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 24 Jul 2017 21:08:21 +0200 Subject: [PATCH] Increase damage caused by TNT --- mods/ITEMS/mcl_tnt/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index b1eec4f4..2f9294dc 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -24,11 +24,13 @@ local function do_tnt_physics(tnt_np,tntr) if v ~= nil then obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z}) else + local dist = math.max(1, vector.distance(tnt_np, p)) + local damage = (4 / dist) * tntr if obj:is_player() == true then mcl_death_messages.player_damage(obj, string.format("%s was caught in an explosion.", obj:get_player_name())) - obj:set_hp(obj:get_hp() - 1) mcl_hunger.exhaust(obj:get_player_name(), mcl_hunger.EXHAUST_DAMAGE) end + obj:set_hp(obj:get_hp() - damage) end end end @@ -75,8 +77,6 @@ local TNT = { "default_tnt_side.png", "default_tnt_side.png"}, -- Initial value for our timer timer = 0, - -- Number of punches required to defuse - health = 1, blinktimer = 0, blinkstatus = true,}