From 78e187537f9b4116f9a36a8fd5a9fcc9ab870e9c Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 30 Jun 2022 01:25:55 +0200 Subject: [PATCH] Add crying obsidian particle effect --- mods/ITEMS/mcl_core/functions.lua | 41 ++++++++++++++++++ .../mcl_core_crying_obsidian_tear.png | Bin 0 -> 91 bytes .../mcl_core_crying_obsidian_tear2.png | Bin 0 -> 86 bytes .../mcl_core_crying_obsidian_tear3.png | Bin 0 -> 83 bytes 4 files changed, 41 insertions(+) create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index fc08a0957..48719d96e 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -1698,3 +1698,44 @@ function mcl_core.after_snow_destruct(pos) local node = minetest.get_node(npos) mcl_core.clear_snow_dirt(npos, node) end + + +-- Obsidian crying + +local crying_obsidian_tears = { + "mcl_core_crying_obsidian_tear.png", + "mcl_core_crying_obsidian_tear2.png", + "mcl_core_crying_obsidian_tear3.png" +} + +local psdef = { + amount = 10, + time = 0.9, --everything longer than 1 is a coord exploit + minvel = vector.new(0,-0.15,0), + maxvel = vector.new(0,-0.001,0), + minacc = vector.new(0,-0.1,0), + maxacc = vector.new(0,-0.001,0), + minexptime = 1, + maxexptime = 6, + minsize = 0.1, + maxsize = 0.25, + collisiondetection = true, + collision_removal = true, + object_collision = true, + vertical = true, +} + +minetest.register_abm({ + label = "Obsidian cries", + nodenames = {"mcl_core:crying_obsidian"}, + interval = 60, + chance = 10, + action = function(pos, node) + psdef.minpos = vector.offset(pos,-0.6,-0.51,-0.6) + psdef.maxpos = vector.offset(pos,0.6,-0.51,0.6) + for _,t in pairs(crying_obsidian_tears) do + psdef.texture = t + minetest.add_particlespawner(psdef) + end + end +}) diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear.png new file mode 100644 index 0000000000000000000000000000000000000000..94d9bd21a144595e901bb17602460e27daee5a3d GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y-!3HF~bz9kil#-{5V+hCfWRHaC+8K;oGp5Yc mNz7q8me!|UAZY;-lwg>r&Stai=HZ7x)eN4lelF{r5}E))v=+($ literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear2.png new file mode 100644 index 0000000000000000000000000000000000000000..07d1978ba23a617431a2da41091d30c61f416f11 GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-c!3HFEzPi^4q+~r^978y+Cno@bM?!RM+s2uX iPfD^$^fxv(GBN~tv3@`LcGW7NLIzJ)KbLh*2~7ZTpBTyj literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png b/mods/ITEMS/mcl_core/textures/mcl_core_crying_obsidian_tear3.png new file mode 100644 index 0000000000000000000000000000000000000000..ea0f58393c9f01294b071249ff0fc4d6dab73d65 GIT binary patch literal 83 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nRDNh&25RU7~2|(bH5M4Xhurc>* dX{wqx8-rphi$O@~f>%IQ44$rjF6*2UngF9R6UYDn literal 0 HcmV?d00001