mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-02 15:53:46 +01:00
commit
aaee3b6de7
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem1.png
Normal file
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 B |
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem2.png
Normal file
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 154 B |
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem3.png
Normal file
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 155 B |
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem4.png
Normal file
BIN
mods/CORE/mcl_particles/textures/mcl_particles_totem4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 B |
@ -4,6 +4,8 @@ minetest.register_on_leaveplayer(function(player)
|
|||||||
hud_totem[player] = nil
|
hud_totem[player] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local particle_colors = {"98BF22", "C49E09", "337D0B", "B0B021", "1E9200"} -- TODO: real MC colors
|
||||||
|
|
||||||
-- Save the player from death when holding totem of undying in hand
|
-- Save the player from death when holding totem of undying in hand
|
||||||
mcl_damage.register_modifier(function(obj, damage, reason)
|
mcl_damage.register_modifier(function(obj, damage, reason)
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
@ -32,6 +34,31 @@ mcl_damage.register_modifier(function(obj, damage, reason)
|
|||||||
-- Effects
|
-- Effects
|
||||||
minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true)
|
minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true)
|
||||||
|
|
||||||
|
for i = 1, 4 do
|
||||||
|
for c = 1, #particle_colors do
|
||||||
|
minetest.add_particlespawner({
|
||||||
|
amount = math.floor(100 / (4 * #particle_colors)),
|
||||||
|
time = 1,
|
||||||
|
minpos = vector.offset(ppos, 0, -1, 0),
|
||||||
|
maxpos = vector.offset(ppos, 0, 1, 0),
|
||||||
|
minvel = vector.new(-1.5, 0, -1.5),
|
||||||
|
maxvel = vector.new(1.5, 1.5, 1.5),
|
||||||
|
minacc = vector.new(0, -0.1, 0),
|
||||||
|
maxacc = vector.new(0, -1, 0),
|
||||||
|
minexptime = 1,
|
||||||
|
maxexptime = 3,
|
||||||
|
minsize = 1,
|
||||||
|
maxsize = 2,
|
||||||
|
collisiondetection = true,
|
||||||
|
collision_removal = true,
|
||||||
|
object_collision = false,
|
||||||
|
vertical = false,
|
||||||
|
texture = "mcl_particles_totem" .. i .. ".png^[colorize:#" .. particle_colors[c],
|
||||||
|
glow = 10,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Big totem overlay
|
-- Big totem overlay
|
||||||
if not hud_totem[obj] then
|
if not hud_totem[obj] then
|
||||||
hud_totem[obj] = obj:hud_add({
|
hud_totem[obj] = obj:hud_add({
|
||||||
|
Loading…
Reference in New Issue
Block a user