mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Add special particles for throwable water bottles
This commit is contained in:
parent
20455a259f
commit
9c304105e9
@ -27,7 +27,12 @@ minetest.register_globalstep(function(dtime)
|
||||
|
||||
vals.timer = vals.timer - lingering_timer
|
||||
local d = 4 * (vals.timer / 30.0)
|
||||
|
||||
local texture
|
||||
if vals.is_water then
|
||||
texture = "mcl_potions_droplet.png"
|
||||
else
|
||||
texture = "mcl_potions_sprite.png"
|
||||
end
|
||||
minetest.add_particlespawner({
|
||||
amount = 10 * d^2,
|
||||
time = 1,
|
||||
@ -43,10 +48,10 @@ minetest.register_globalstep(function(dtime)
|
||||
maxsize = 4,
|
||||
collisiondetection = true,
|
||||
vertical = false,
|
||||
texture = "mcl_potions_sprite.png^[colorize:"..vals.color..":127",
|
||||
texture = texture.."^[colorize:"..vals.color..":127",
|
||||
})
|
||||
|
||||
-- Extingish fire if water bottle
|
||||
-- Extinguish fire if water bottle
|
||||
if vals.is_water then
|
||||
if mcl_potions._extinguish_nearby_fire(pos) then
|
||||
vals.timer = vals.timer / 2
|
||||
@ -129,6 +134,16 @@ function mcl_potions.register_lingering(name, descr, color, def)
|
||||
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then
|
||||
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})
|
||||
add_lingering_effect(pos, color, def, name == "water")
|
||||
local texture, minacc, maxacc
|
||||
if name == "water" then
|
||||
texture = "mcl_potions_droplet.png"
|
||||
minacc = {x=-0.2, y=-0.05, z=-0.2}
|
||||
maxacc = {x=0.2, y=0.05, z=0.2}
|
||||
else
|
||||
texture = "mcl_potions_sprite.png"
|
||||
minacc = {x=-0.2, y=0, z=-0.2}
|
||||
maxacc = {x=0.2, y=.05, z=0.2}
|
||||
end
|
||||
minetest.add_particlespawner({
|
||||
amount = 40,
|
||||
time = 1,
|
||||
@ -136,15 +151,15 @@ function mcl_potions.register_lingering(name, descr, color, def)
|
||||
maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d},
|
||||
minvel = {x=-0.5, y=0, z=-0.5},
|
||||
maxvel = {x=0.5, y=0.5, z=0.5},
|
||||
minacc = {x=-0.2, y=0, z=-0.2},
|
||||
maxacc = {x=0.2, y=.05, z=0.2},
|
||||
minacc = minacc,
|
||||
maxacc = maxacc,
|
||||
minexptime = 1,
|
||||
maxexptime = 2,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = true,
|
||||
vertical = false,
|
||||
texture = "mcl_potions_sprite.png^[colorize:"..color..":127",
|
||||
texture = texture.."^[colorize:"..color..":127",
|
||||
})
|
||||
if name == "water" then
|
||||
mcl_potions._extinguish_nearby_fire(pos)
|
||||
|
@ -1,4 +1,5 @@
|
||||
local S = minetest.get_translator("mcl_potions")
|
||||
local GRAVITY = tonumber(minetest.settings:get("movement_gravity"))
|
||||
|
||||
local splash_image = function(colorstring, opacity)
|
||||
if not opacity then
|
||||
@ -63,6 +64,14 @@ function mcl_potions.register_splash(name, descr, color, def)
|
||||
local redux_map = {7/8,0.5,0.25}
|
||||
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then
|
||||
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})
|
||||
local texture, acc
|
||||
if name == "water" then
|
||||
texture = "mcl_potions_droplet.png"
|
||||
acc = {x=0, y=-GRAVITY, z=0}
|
||||
else
|
||||
texture = "mcl_potions_sprite.png"
|
||||
acc = {x=0, y=0, z=0}
|
||||
end
|
||||
minetest.add_particlespawner({
|
||||
amount = 50,
|
||||
time = 0.1,
|
||||
@ -70,15 +79,15 @@ function mcl_potions.register_splash(name, descr, color, def)
|
||||
maxpos = {x=pos.x+d, y=pos.y+0.5+d, z=pos.z+d},
|
||||
minvel = {x=-2, y=0, z=-2},
|
||||
maxvel = {x=2, y=2, z=2},
|
||||
minacc = {x=0, y=0, z=0},
|
||||
maxacc = {x=0, y=0, z=0},
|
||||
minacc = acc,
|
||||
maxacc = acc,
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1.25,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = true,
|
||||
vertical = false,
|
||||
texture = "mcl_potions_sprite.png^[colorize:"..color..":127",
|
||||
texture = texture.."^[colorize:"..color..":127"
|
||||
})
|
||||
|
||||
if name == "water" then
|
||||
|
BIN
mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png
Normal file
BIN
mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 85 B |
Loading…
Reference in New Issue
Block a user