From bb10976243a03cce500581ff4b09c4bf97ed184d Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Sun, 18 Feb 2018 19:43:19 +0530 Subject: [PATCH] Increase grenade blast radius and damage adds realism to grenades, which can now be relied upon... --- mods/shooter/grenade.lua | 5 +++-- mods/shooter/shooter.lua | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/shooter/grenade.lua b/mods/shooter/grenade.lua index 075d056..3445089 100644 --- a/mods/shooter/grenade.lua +++ b/mods/shooter/grenade.lua @@ -43,10 +43,11 @@ minetest.register_tool("shooter:grenade", { if not minetest.setting_getbool("creative_mode") then itemstack = "" end + -- clarification for future readers: grenade can be used only if player points at nothing (line 47) if pointed_thing.type ~= "nothing" then local pointed = minetest.get_pointed_thing_position(pointed_thing) - if vector.distance(user:getpos(), pointed) < 8 then - shooter:blast(pointed, 1, 25, 5) + if vector.distance(user:getpos(), pointed) < 10 then + shooter:blast(pointed, 2, 25, 5) return end end diff --git a/mods/shooter/shooter.lua b/mods/shooter/shooter.lua index 51dacf5..264396e 100644 --- a/mods/shooter/shooter.lua +++ b/mods/shooter/shooter.lua @@ -388,7 +388,7 @@ function shooter:blast(pos, radius, fleshy, distance, user) obj:get_luaentity().name ~= "__builtin:item") then local obj_pos = obj:getpos() local dist = vector.distance(obj_pos, pos) - local damage = (fleshy * 0.5 ^ dist) * 2 + local damage = (fleshy * 0.5 ^ dist) * 3 if dist ~= 0 then obj_pos.y = obj_pos.y + 1.7 blast_pos = {x=pos.x, y=pos.y + 4, z=pos.z}