1
0
Fork 0

Add persistent particle spawner.

This commit is contained in:
Brandon 2020-06-20 09:00:53 -04:00
parent a5e3b259fa
commit d929ca19a8
4 changed files with 114 additions and 67 deletions

View File

@ -39,8 +39,9 @@ function mcl_potions.poison(player, toggle)
end end
function mcl_potions._use_potion(item, pos, color) function mcl_potions._use_potion(item, obj, color)
local d = 0.1 local d = 0.1
local pos = obj:get_pos()
item:replace("mcl_potions:glass_bottle") item:replace("mcl_potions:glass_bottle")
minetest.sound_play("mcl_potions_drinking") minetest.sound_play("mcl_potions_drinking")
minetest.add_particlespawner({ minetest.add_particlespawner({
@ -55,13 +56,37 @@ function mcl_potions._use_potion(item, pos, color)
minexptime = 1, minexptime = 1,
maxexptime = 5, maxexptime = 5,
minsize = 0.5, minsize = 0.5,
maxsize = 2, maxsize = 1,
collisiondetection = true, collisiondetection = true,
vertical = false, vertical = false,
texture = "mcl_potions_sprite.png^[colorize:"..color..":127", texture = "mcl_potions_sprite.png^[colorize:"..color..":127",
}) })
end end
function mcl_potions._add_spawner(obj, color)
local d = 0.2
local pos = obj:get_pos()
minetest.add_particlespawner({
amount = 5,
time = 1,
minpos = {x=pos.x-d, y=pos.y+1, z=pos.z-d},
maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d},
minvel = {x=-0.1, y=0, z=-0.1},
maxvel = {x=0.1, y=0.1, z=0.1},
minacc = {x=-0.1, y=0, z=-0.1},
maxacc = {x=0.1, y=.1, z=0.1},
minexptime = 0.5,
maxexptime = 1,
minsize = 0.5,
maxsize = 1,
collisiondetection = false,
vertical = false,
texture = "mcl_potions_sprite.png^[colorize:"..color..":127",
})
end
local is_zombie = {} local is_zombie = {}
for i, zombie in ipairs({"husk","zombie","pigman"}) do for i, zombie in ipairs({"husk","zombie","pigman"}) do
@ -85,18 +110,27 @@ function mcl_potions.swiftness_func(player, factor, duration)
if not player:get_meta() then return false end if not player:get_meta() then return false end
playerphysics.add_physics_factor(player, "speed", "swiftness", factor) playerphysics.add_physics_factor(player, "speed", "swiftness", factor)
minetest.after(duration, function() playerphysics.remove_physics_factor(player, "speed", "swiftness") end ) minetest.after(duration, function() playerphysics.remove_physics_factor(player, "speed", "swiftness") end )
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#009999") end)
end
end end
function mcl_potions.leaping_func(player, factor, duration) function mcl_potions.leaping_func(player, factor, duration)
if player:get_meta() then return false end if player:get_meta() then return false end
playerphysics.add_physics_factor(player, "jump", "leaping", factor) playerphysics.add_physics_factor(player, "jump", "leaping", factor)
minetest.after(duration, function() playerphysics.remove_physics_factor(player, "jump", "leaping") end ) minetest.after(duration, function() playerphysics.remove_physics_factor(player, "jump", "leaping") end )
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#00CC33") end)
end
end end
function mcl_potions.weakness_func(player, factor, duration) function mcl_potions.weakness_func(player, factor, duration)
player:set_attribute("weakness", tostring(factor)) player:set_attribute("weakness", tostring(factor))
-- print(player:get_player_name().." ".."weakness = "..player:get_attribute("weakness")) -- print(player:get_player_name().." ".."weakness = "..player:get_attribute("weakness"))
minetest.after(duration, function() player:set_attribute("weakness", tostring(0)) end ) minetest.after(duration, function() player:set_attribute("weakness", tostring(0)) end )
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#6600AA") end)
end
end end
function mcl_potions.poison_func(player, factor, duration) function mcl_potions.poison_func(player, factor, duration)
@ -110,6 +144,9 @@ function mcl_potions.poison_func(player, factor, duration)
end end
end) end)
end end
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#225533") end)
end
minetest.after(duration, function() mcl_potions.poison(player, false) end) minetest.after(duration, function() mcl_potions.poison(player, false) end)
end end
end end
@ -122,12 +159,20 @@ function mcl_potions.regeneration_func(player, factor, duration)
end end
end ) end )
end end
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#A52BB2") end)
end
end end
function mcl_potions.invisiblility_func(player, duration) function mcl_potions.invisiblility_func(player, duration)
mcl_potions.invisible(player, true) mcl_potions.invisible(player, true)
minetest.after(duration, function() mcl_potions.invisible(player, false) end ) minetest.after(duration, function() mcl_potions.invisible(player, false) end )
for i=1,math.floor(duration) do
minetest.after(i, function() mcl_potions._add_spawner(player, "#B0B0B0") end)
end
end end
function mcl_potions.water_breathing_func(player, duration) function mcl_potions.water_breathing_func(player, duration)
@ -138,8 +183,10 @@ function mcl_potions.water_breathing_func(player, duration)
if player:get_breath() < 10 then if player:get_breath() < 10 then
player:set_breath(10) player:set_breath(10)
end end
mcl_potions._add_spawner(player, "#0000AA")
end ) end )
end end
end end
end end

View File

@ -50,7 +50,7 @@ local function register_lingering(name, descr, color, def)
minacc = {x=-0.2, y=0, z=-0.2}, minacc = {x=-0.2, y=0, z=-0.2},
maxacc = {x=0.2, y=.05, z=0.2}, maxacc = {x=0.2, y=.05, z=0.2},
minexptime = 1, minexptime = 1,
maxexptime = 5, maxexptime = 2,
minsize = 2, minsize = 2,
maxsize = 4, maxsize = 4,
collisiondetection = true, collisiondetection = true,

View File

@ -73,13 +73,13 @@ minetest.register_craftitem("mcl_potions:healing", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, 4) mcl_potions.healing_func(user, 4)
mcl_potions._use_potion(itemstack, user:get_pos(), "#CC0000") mcl_potions._use_potion(itemstack, user, "#CC0000")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, 4) mcl_potions.healing_func(user, 4)
mcl_potions._use_potion(itemstack, user:get_pos(), "#CC0000") mcl_potions._use_potion(itemstack, user, "#CC0000")
return itemstack return itemstack
end, end,
}) })
@ -94,13 +94,13 @@ minetest.register_craftitem("mcl_potions:healing_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, 8) mcl_potions.healing_func(user, 8)
mcl_potions._use_potion(itemstack, user:get_pos(), "#DD0000") mcl_potions._use_potion(itemstack, user, "#DD0000")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, 8) mcl_potions.healing_func(user, 8)
mcl_potions._use_potion(itemstack, user:get_pos(), "#DD0000") mcl_potions._use_potion(itemstack, user, "#DD0000")
return itemstack return itemstack
end, end,
@ -116,13 +116,13 @@ minetest.register_craftitem("mcl_potions:harming", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, -6) mcl_potions.healing_func(user, -6)
mcl_potions._use_potion(itemstack, user:get_pos(), "#660099") mcl_potions._use_potion(itemstack, user, "#660099")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, -6) mcl_potions.healing_func(user, -6)
mcl_potions._use_potion(itemstack, user:get_pos(), "#660099") mcl_potions._use_potion(itemstack, user, "#660099")
return itemstack return itemstack
end, end,
}) })
@ -137,13 +137,13 @@ minetest.register_craftitem("mcl_potions:harming_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, -12) mcl_potions.healing_func(user, -12)
mcl_potions._use_potion(itemstack, user:get_pos(), "#330066") mcl_potions._use_potion(itemstack, user, "#330066")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.healing_func(user, -12) mcl_potions.healing_func(user, -12)
mcl_potions._use_potion(itemstack, user:get_pos(), "#330066") mcl_potions._use_potion(itemstack, user, "#330066")
return itemstack return itemstack
end, end,
}) })
@ -169,13 +169,13 @@ minetest.register_craftitem("mcl_potions:swiftness", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.2, 180) mcl_potions.swiftness_func(user, 1.2, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#009999") mcl_potions._use_potion(itemstack, user, "#009999")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.2, 180) mcl_potions.swiftness_func(user, 1.2, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#009999") mcl_potions._use_potion(itemstack, user, "#009999")
return itemstack return itemstack
end, end,
}) })
@ -190,13 +190,13 @@ minetest.register_craftitem("mcl_potions:swiftness_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.4, 90) mcl_potions.swiftness_func(user, 1.4, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00BBBB") mcl_potions._use_potion(itemstack, user, "#00BBBB")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.4, 90) mcl_potions.swiftness_func(user, 1.4, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00BBBB") mcl_potions._use_potion(itemstack, user, "#00BBBB")
return itemstack return itemstack
end, end,
}) })
@ -211,13 +211,13 @@ minetest.register_craftitem("mcl_potions:swiftness_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.2, 480) mcl_potions.swiftness_func(user, 1.2, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00AAAA") mcl_potions._use_potion(itemstack, user, "#00AAAA")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 1.2, 480) mcl_potions.swiftness_func(user, 1.2, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00AAAA") mcl_potions._use_potion(itemstack, user, "#00AAAA")
return itemstack return itemstack
end, end,
}) })
@ -232,13 +232,13 @@ minetest.register_craftitem("mcl_potions:slowness", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 0.85, 90) mcl_potions.swiftness_func(user, 0.85, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#000080") mcl_potions._use_potion(itemstack, user, "#000080")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 0.85, 90) mcl_potions.swiftness_func(user, 0.85, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#000080") mcl_potions._use_potion(itemstack, user, "#000080")
return itemstack return itemstack
end, end,
}) })
@ -253,13 +253,13 @@ minetest.register_craftitem("mcl_potions:slowness_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 0.85, 240) mcl_potions.swiftness_func(user, 0.85, 240)
mcl_potions._use_potion(itemstack, user:get_pos(), "#000066") mcl_potions._use_potion(itemstack, user, "#000066")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.swiftness_func(user, 0.85, 240) mcl_potions.swiftness_func(user, 0.85, 240)
mcl_potions._use_potion(itemstack, user:get_pos(), "#000066") mcl_potions._use_potion(itemstack, user, "#000066")
return itemstack return itemstack
end, end,
}) })
@ -275,13 +275,13 @@ minetest.register_craftitem("mcl_potions:leaping", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.2, 180) mcl_potions.leaping_func(user, 1.2, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00CC33") mcl_potions._use_potion(itemstack, user, "#00CC33")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.2, 180) mcl_potions.leaping_func(user, 1.2, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00CC33") mcl_potions._use_potion(itemstack, user, "#00CC33")
return itemstack return itemstack
end, end,
}) })
@ -296,13 +296,13 @@ minetest.register_craftitem("mcl_potions:leaping_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.4, 90) mcl_potions.leaping_func(user, 1.4, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00EE33") mcl_potions._use_potion(itemstack, user, "#00EE33")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.4, 90) mcl_potions.leaping_func(user, 1.4, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00EE33") mcl_potions._use_potion(itemstack, user, "#00EE33")
return itemstack return itemstack
end, end,
}) })
@ -317,13 +317,13 @@ minetest.register_craftitem("mcl_potions:leaping_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.2, 480) mcl_potions.leaping_func(user, 1.2, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00DD33") mcl_potions._use_potion(itemstack, user, "#00DD33")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.leaping_func(user, 1.2, 480) mcl_potions.leaping_func(user, 1.2, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#00DD33") mcl_potions._use_potion(itemstack, user, "#00DD33")
return itemstack return itemstack
end, end,
}) })
@ -339,13 +339,13 @@ minetest.register_craftitem("mcl_potions:weakness", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.weakness_func(user, 1.2, 90) mcl_potions.weakness_func(user, 1.2, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#6600AA") mcl_potions._use_potion(itemstack, user, "#6600AA")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.weakness_func(user, 1.2, 90) mcl_potions.weakness_func(user, 1.2, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#6600AA") mcl_potions._use_potion(itemstack, user, "#6600AA")
return itemstack return itemstack
end end
}) })
@ -360,13 +360,13 @@ minetest.register_craftitem("mcl_potions:weakness_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.weakness_func(user, 1.4, 240) mcl_potions.weakness_func(user, 1.4, 240)
mcl_potions._use_potion(itemstack, user:get_pos(), "#7700BB") mcl_potions._use_potion(itemstack, user, "#7700BB")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.weakness_func(user, 1.4, 240) mcl_potions.weakness_func(user, 1.4, 240)
mcl_potions._use_potion(itemstack, user:get_pos(), "#7700BB") mcl_potions._use_potion(itemstack, user, "#7700BB")
return itemstack return itemstack
end end
}) })
@ -382,13 +382,13 @@ minetest.register_craftitem("mcl_potions:poison", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 2.5, 45) mcl_potions.poison_func(user, 2.5, 45)
mcl_potions._use_potion(itemstack, user:get_pos(), "#225533") mcl_potions._use_potion(itemstack, user, "#225533")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 2.5, 45) mcl_potions.poison_func(user, 2.5, 45)
mcl_potions._use_potion(itemstack, user:get_pos(), "#225533") mcl_potions._use_potion(itemstack, user, "#225533")
return itemstack return itemstack
end end
}) })
@ -403,13 +403,13 @@ minetest.register_craftitem("mcl_potions:poison_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 1.2, 21) mcl_potions.poison_func(user, 1.2, 21)
mcl_potions._use_potion(itemstack, user:get_pos(), "#447755") mcl_potions._use_potion(itemstack, user, "#447755")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 1.2, 21) mcl_potions.poison_func(user, 1.2, 21)
mcl_potions._use_potion(itemstack, user:get_pos(), "#447755") mcl_potions._use_potion(itemstack, user, "#447755")
return itemstack return itemstack
end end
}) })
@ -424,13 +424,13 @@ minetest.register_craftitem("mcl_potions:poison_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 2.5, 90) mcl_potions.poison_func(user, 2.5, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#336644") mcl_potions._use_potion(itemstack, user, "#336644")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.poison_func(user, 2.5, 90) mcl_potions.poison_func(user, 2.5, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#336644") mcl_potions._use_potion(itemstack, user, "#336644")
return itemstack return itemstack
end end
}) })
@ -446,13 +446,13 @@ minetest.register_craftitem("mcl_potions:regeneration", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 2.5, 45) mcl_potions.regeneration_func(user, 2.5, 45)
mcl_potions._use_potion(itemstack, user:get_pos(), "#A52BB2") mcl_potions._use_potion(itemstack, user, "#A52BB2")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 2.5, 45) mcl_potions.regeneration_func(user, 2.5, 45)
mcl_potions._use_potion(itemstack, user:get_pos(), "#A52BB2") mcl_potions._use_potion(itemstack, user, "#A52BB2")
return itemstack return itemstack
end end
}) })
@ -467,13 +467,13 @@ minetest.register_craftitem("mcl_potions:regeneration_2", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 1.2, 22) mcl_potions.regeneration_func(user, 1.2, 22)
mcl_potions._use_potion(itemstack, user:get_pos(), "#B52CC2") mcl_potions._use_potion(itemstack, user, "#B52CC2")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 1.2, 22) mcl_potions.regeneration_func(user, 1.2, 22)
mcl_potions._use_potion(itemstack, user:get_pos(), "#B52CC2") mcl_potions._use_potion(itemstack, user, "#B52CC2")
return itemstack return itemstack
end end
}) })
@ -488,13 +488,13 @@ minetest.register_craftitem("mcl_potions:regeneration_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 2.5, 90) mcl_potions.regeneration_func(user, 2.5, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#C53DD3") mcl_potions._use_potion(itemstack, user, "#C53DD3")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.regeneration_func(user, 2.5, 90) mcl_potions.regeneration_func(user, 2.5, 90)
mcl_potions._use_potion(itemstack, user:get_pos(), "#C53DD3") mcl_potions._use_potion(itemstack, user, "#C53DD3")
return itemstack return itemstack
end end
}) })
@ -510,13 +510,13 @@ minetest.register_craftitem("mcl_potions:invisibility", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.invisiblility_func(user, 180) mcl_potions.invisiblility_func(user, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#B0B0B0") mcl_potions._use_potion(itemstack, user, "#B0B0B0")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.invisiblility_func(user, 180) mcl_potions.invisiblility_func(user, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#B0B0B0") mcl_potions._use_potion(itemstack, user, "#B0B0B0")
return itemstack return itemstack
end end
}) })
@ -531,13 +531,13 @@ minetest.register_craftitem("mcl_potions:invisibility_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.invisiblility_func(user, 480) mcl_potions.invisiblility_func(user, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#A0A0A0") mcl_potions._use_potion(itemstack, user, "#A0A0A0")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.invisiblility_func(user, 480) mcl_potions.invisiblility_func(user, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#A0A0A0") mcl_potions._use_potion(itemstack, user, "#A0A0A0")
return itemstack return itemstack
end end
}) })
@ -560,13 +560,13 @@ minetest.register_craftitem("mcl_potions:water_breathing", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.water_breathing_func(user, 180) mcl_potions.water_breathing_func(user, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#0000AA") mcl_potions._use_potion(itemstack, user, "#0000AA")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.water_breathing_func(user, 180) mcl_potions.water_breathing_func(user, 180)
mcl_potions._use_potion(itemstack, user:get_pos(), "#0000AA") mcl_potions._use_potion(itemstack, user, "#0000AA")
return itemstack return itemstack
end end
}) })
@ -581,13 +581,13 @@ minetest.register_craftitem("mcl_potions:water_breathing_plus", {
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
mcl_potions.water_breathing_func(user, 480) mcl_potions.water_breathing_func(user, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#0000CC") mcl_potions._use_potion(itemstack, user, "#0000CC")
return itemstack return itemstack
end, end,
on_secondary_use = function(itemstack, user, pointed_thing) on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.water_breathing_func(user, 480) mcl_potions.water_breathing_func(user, 480)
mcl_potions._use_potion(itemstack, user:get_pos(), "#0000CC") mcl_potions._use_potion(itemstack, user, "#0000CC")
return itemstack return itemstack
end end
}) })

View File

@ -49,7 +49,7 @@ local function register_splash(name, descr, color, def)
minacc = {x=-0.5, y=0, z=-0.5}, minacc = {x=-0.5, y=0, z=-0.5},
maxacc = {x=0.5, y=.2, z=0.5}, maxacc = {x=0.5, y=.2, z=0.5},
minexptime = 1, minexptime = 1,
maxexptime = 5, maxexptime = 3,
minsize = 2, minsize = 2,
maxsize = 4, maxsize = 4,
collisiondetection = true, collisiondetection = true,