From 4acf953334cbe4c1e0704d60d5ff388fc63cee40 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 14:45:37 +0200 Subject: [PATCH] Add critical hit particles for bow --- .../textures/mcl_particles_crit.png | Bin 0 -> 128 bytes mods/ITEMS/mcl_bows/arrow.lua | 28 ++++++++++++++++++ mods/ITEMS/mcl_bows/bow.lua | 11 ++++--- mods/ITEMS/mcl_bows/depends.txt | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_crit.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_crit.png b/mods/CORE/mcl_particles/textures/mcl_particles_crit.png new file mode 100644 index 0000000000000000000000000000000000000000..5b7fd3f6ef29a02c38e25dfd323c8a905b59abd2 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0y~yVBi2@4kiW$2Jc+WI}8jAY$ZW{!38)N=s%QhMNw88n16`Ocvmqz_MxKD}_Jn= BOW_CHARGE_TIME_FULL then speed = BOW_MAX_SPEED local r = math.random(1,5) if r == 1 then -- 20% chance for critical hit damage = 10 + is_critical = true else damage = 9 end @@ -207,7 +210,7 @@ controls.register_on_release(function(player, key, time) damage = math.max(1, math.floor(9 * charge_ratio)) end - has_shot = player_shoot_arrow(wielditem, player, speed, damage) + has_shot = player_shoot_arrow(wielditem, player, speed, damage, is_critical) wielditem:set_name("mcl_bows:bow") if has_shot and not minetest.is_creative_enabled(player:get_player_name()) then diff --git a/mods/ITEMS/mcl_bows/depends.txt b/mods/ITEMS/mcl_bows/depends.txt index 08132ddbf..130c4acea 100644 --- a/mods/ITEMS/mcl_bows/depends.txt +++ b/mods/ITEMS/mcl_bows/depends.txt @@ -7,3 +7,4 @@ playerphysics? doc? doc_identifier? mesecons_button? +mcl_particles