From 7e03f86b84b0c7b214fc616bae1de8b7ba611f69 Mon Sep 17 00:00:00 2001 From: epCode <64379263+epCode@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:46:47 -0700 Subject: [PATCH] Give the arrows a far less laggy look with an attached particle spawner with critical shot. --- mods/ITEMS/mcl_bows/arrow.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index ad4a3f30e..2181d7b98 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -171,27 +171,23 @@ function ARROW_ENTITY.on_step(self, dtime) if self._damage >= 9 and self._in_player == false then minetest.add_particlespawner({ - amount = 1, - time = .001, - minpos = pos, - maxpos = pos, + amount = 20, + time = .2, + minpos = vector.new(0,0,0), + maxpos = vector.new(0,0,0), minvel = vector.new(-0.1,-0.1,-0.1), maxvel = vector.new(0.1,0.1,0.1), minexptime = 0.5, maxexptime = 0.5, minsize = 2, maxsize = 2, + attached = self.object, collisiondetection = false, vertical = false, texture = "mobs_mc_arrow_particle.png", glow = 1, }) end - -- We just check for any hurtable objects nearby. - -- The radius of 3 is fairly liberal, but anything lower than than will cause - -- arrow to hilariously go through mobs often. - -- TODO: Implement an ACTUAL collision detection (engine support needed). - local closest_object local closest_distance