diff --git a/mods/shooter/grenade.lua b/mods/shooter/grenade.lua index 5dac7f8..0313ce8 100644 --- a/mods/shooter/grenade.lua +++ b/mods/shooter/grenade.lua @@ -22,10 +22,10 @@ minetest.register_entity("shooter:grenade_entity", { self.timer = self.timer + dtime if self.timer > 0.2 then local pos = self.object:getpos() - local below = {x=pos.x, y=pos.y - 1, z=pos.z} - if minetest.get_node(below).name ~= "air" then + local above = {x=pos.x, y=pos.y + 1, z=pos.z} + if minetest.get_node(pos).name ~= "air" then self.object:remove() - shooter:blast(pos, 1, 25, 5, self.player) + shooter:blast(above, 2, 25, 5, self.player) end self.timer = 0 end diff --git a/mods/shooter/rocket.lua b/mods/shooter/rocket.lua index 165282d..ac9f6ed 100644 --- a/mods/shooter/rocket.lua +++ b/mods/shooter/rocket.lua @@ -28,9 +28,10 @@ minetest.register_entity("shooter:rocket_entity", { self.timer = self.timer + dtime if self.timer > 0.2 then local pos = self.object:getpos() + local above = {x=pos.x, y=pos.y + 1, z=pos.z} if minetest.get_node(pos).name ~= "air" then self.object:remove() - shooter:blast(pos, 2, 50, 7, self.player) + shooter:blast(above, 4, 50, 8, self.player) end self.timer = 0 end diff --git a/mods/shooter/shooter.lua b/mods/shooter/shooter.lua index dc1df21..812ec04 100644 --- a/mods/shooter/shooter.lua +++ b/mods/shooter/shooter.lua @@ -4,7 +4,7 @@ shooter = { rounds = {}, shots = {}, update_time = 0, - reload_time = 0 + reload_time = 0, } SHOOTER_ADMIN_WEAPONS = false @@ -71,30 +71,18 @@ local function get_particle_pos(p, v, d) end function shooter:spawn_particles(pos, texture) - if not SHOOTER_ENABLE_PARTICLE_FX then - return + if SHOOTER_ENABLE_PARTICLE_FX == true then + if type(texture) ~= "string" then + texture = SHOOTER_EXPLOSION_TEXTURE + end + local spread = {x=0.1, y=0.1, z=0.1} + minetest.add_particlespawner(15, 0.3, + vector.subtract(pos, spread), vector.add(pos, spread), + {x=-1, y=1, z=-1}, {x=1, y=2, z=1}, + {x=-2, y=-2, z=-2}, {x=2, y=-2, z=2}, + 0.1, 0.75, 1, 2, false, texture + ) end - - if type(texture) ~= "string" then - texture = SHOOTER_EXPLOSION_TEXTURE - end - local spread = {x=0.1, y=0.1, z=0.1} - minetest.add_particlespawner({ - amount = 15, - time = 0.3, - minpos = vector.subtract(pos, spread), - maxpos = vector.add(pos, spread), - minvel = {x=-1, y=1, z=-1}, - maxvel = {x=1, y=2, z=1}, - minacc = {x=-2, y=-2, z=-2}, - maxacc = {x=2, y=-2, z=2}, - minexptime = 0.1, - maxexptime = 0.75, - minsize = 1, - maxsize = 2, - collisiondetection = false, - texture = texture - }) end function shooter:play_node_sound(node, pos) diff --git a/mods/shooter/sounds/shooter_click.ogg b/mods/shooter/sounds/shooter_click.ogg index 8e60db8..a5d1243 100644 Binary files a/mods/shooter/sounds/shooter_click.ogg and b/mods/shooter/sounds/shooter_click.ogg differ diff --git a/mods/shooter/textures/shooter_hit.png b/mods/shooter/textures/shooter_hit.png index 9d04179..46d95b2 100644 Binary files a/mods/shooter/textures/shooter_hit.png and b/mods/shooter/textures/shooter_hit.png differ