10 Commits

Author SHA1 Message Date
b500873215 Fix taking wielded items with some ingredients + add mod.conf 2020-07-15 01:37:23 +02:00
0e277c51fb Tidy code and remove stack_max limit of Glass Bottle 2020-07-13 00:44:28 +02:00
36d76ca7fb Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-14 23:10:12 +02:00
efe57c3137 Merge pull request #9 from orbea/hunger_ng
Add hunger_ng support.
2020-05-04 07:50:46 +10:00
ee1eb7d8ce Add hunger_ng support.
Fixes https://github.com/D00Med/witchcraft/issues/6
2020-05-03 07:37:36 -07:00
32e3f8928b Ajoute message de chargement du mod dans le journal "action" 2019-01-19 20:25:08 +01:00
c515b58ca1 La dent s'obtient aléatoirement en ramassant du sable 2018-11-03 14:52:41 +01:00
8bf04f444e Correction du lancé de sorts pour les parchemins
Changement d'un ingrédient de potion : lilypad remplace waterlily
2018-11-02 21:36:54 +01:00
dd3a7d13c7 Corrige un crash avec la splash potion orange
Corrige la collision avec la gauge bar
2018-11-02 20:40:25 +01:00
fef074b9ed Change le craft de la dent avec le sable du desert. 2018-10-13 17:03:32 +02:00
4 changed files with 241 additions and 217 deletions

View File

@ -8,5 +8,6 @@ farming?
lightning?
pmobs?
hud_hunger?
hunger_ng?
moreplants?
horror?
horror?

438
init.lua
View File

@ -17,11 +17,6 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--changes so that bottles can't stack
minetest.override_item("vessels:glass_bottle", {
stack_max = 3,
})
local vessels_shelf_formspec =
"size[8,7;]"..
default.gui_bg..
@ -178,7 +173,7 @@ minetest.register_craft({
output = 'witchcraft:shelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:potion', 'group:potion', 'group:potion'},
{'group:potion2', 'group:potion2', 'group:potion2'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
@ -397,14 +392,26 @@ minetest.register_craft({
})
--teeth from sand, maybe fossilised?
minetest.register_craft({
output = 'witchcraft:tooth 1',
recipe = {
{'default:sand'},
},
minetest.override_item("default:sand", {
drop = {
max_items = 1,
items = {
{
items = {"witchcraft:tooth"},
rarity = 30,
},
{
items = {"default:sand"},
}
}
},
})
minetest.register_craft({
type = "shapeless",
output = "default:sand",
recipe = {"witchcraft:tooth"},
})
--splash potions crafting
@ -531,14 +538,16 @@ minetest.register_node("witchcraft:pot", {
{-0.375, 0.3125, -0.375, -0.3125, 0.375, 0.375}, -- NodeBox20
}
},
on_rightclick = function(pos, node, clicker, item, _)
local wield_item = clicker:get_wielded_item():get_name()
on_rightclick = function(pos, node, clicker, itemstack, _)
local wield_item = itemstack:get_name()
if wield_item == "bucket:bucket_water" or
wield_item == "bucket:bucket_river_water" then
wield_item == "bucket:bucket_river_water" then
minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2})
item:replace("bucket:bucket_empty")
elseif wield_item == "vessels:drinking_glass" then
item:replace("witchcraft:bottle_slime")
return ItemStack("bucket:bucket_empty")
elseif wield_item == "vessels:drinking_glass" then
itemstack:set_count(itemstack:get_count() - 1)
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:bottle_slime")
end
end,
groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1}
@ -552,7 +561,7 @@ witchcraft.pot = {
{"blue", "brown", "default:dirt", "blue2", "moreplants:bullrush", "red", "purple"},
{"blue2", "yellow", "default:steelblock", "yellow", "default:copperblock", "green2", "aqua"},
{"darkpurple", "cyan", "flowers:mushroom_red", "green", "moreplants:weed", "yellow", "redbrown"},
{"purple", "blue2", "flowers:waterlily", "gpurple", "default:mese_crystal", "magenta", "darkpurple"},
{"purple", "blue2", "nalc_flowers:lily_pad", "gpurple", "default:mese_crystal", "magenta", "darkpurple"},
{"magenta", "purple", "witchcraft:bottle_eyes", "darkpurple", "moreplants:mushroom", "purple", "darkpurple"},
{"red", "grey", "default:gravel", "yllwgrn", "default:flint", "blue", "purple"},
{"redbrown", "magenta", "flowers:mushroom_brown", "magenta", "default:stone", "grey", "brown"},
@ -574,7 +583,7 @@ witchcraft.pot = {
--new recipes
witchcraft.pot_new = {
{"blue", "blue2", "flowers:waterlily", "brown", "default:dirt", "red", "purple"},
{"blue", "blue2", "nalc_flowers:lily_pad", "brown", "default:dirt", "red", "purple"},
{"blue2", "green", "default:papyrus", "", "", "gred", "magenta"},
{"green", "green2", "default:sapling", "", "", "yellow", "yllwgrn"},
{"green2", "yellow", "default:mese_crystal_fragment", "", "", "blue", "cyan"},
@ -638,31 +647,37 @@ minetest.register_node("witchcraft:pot_"..color, {
{-0.4375, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox7
}
},
on_rightclick = function(pos, node, clicker, item, _)
local wield_item = clicker:get_wielded_item():get_name()
if wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() == 3 then
item:replace("witchcraft:potion_"..color)
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
on_rightclick = function(pos, node, clicker, itemstack, _)
local wield_item = itemstack:get_name()
if wield_item == "vessels:glass_bottle" then
local wield_items_count = itemstack:get_count()
local potions_count = (wield_items_count <= 3 and wield_items_count) or 3
local wield_items_left = (wield_items_count - potions_count)
itemstack:set_count((wield_items_left < 0 and 0) or wield_items_left)
for i = 1, potions_count do
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
end
minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2})
elseif wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() ~= 3 then
item:replace("witchcraft:potion_"..color)
minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2})
else
if wield_item == ingredient then
elseif wield_item == ingredient then
minetest.set_node(pos, {name="witchcraft:pot_"..newcolor, param2=node.param2})
item:take_item()
itemstack:take_item()
elseif wield_item == ingredient2 then
minetest.set_node(pos, {name="witchcraft:pot_"..newcolor2, param2=node.param2})
item:take_item()
elseif wield_item == "bucket:bucket_water" then
itemstack:take_item()
elseif wield_item == "bucket:bucket_water" or
wield_item == "bucket:bucket_river_water" then
minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2})
item:replace("bucket:bucket_empty")
return ItemStack("bucket:bucket_empty")
elseif wield_item == "witchcraft:potion_"..combine then
minetest.set_node(pos, {name="witchcraft:pot_"..cresult, param2=node.param2})
item:replace("vessels:glass_bottle")
itemstack:replace("vessels:glass_bottle")
end
end
return itemstack
end,
groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1}
})
@ -922,7 +937,7 @@ minetest.register_entity("witchcraft:tnt_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar"then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=3},
@ -938,7 +953,7 @@ minetest.register_entity("witchcraft:tnt_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then
if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" and n ~= "gauges:hp_bar" then
local pos = self.object:getpos()
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
@ -992,7 +1007,7 @@ minetest.register_entity("witchcraft:fire_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=1},
@ -1007,16 +1022,18 @@ minetest.register_entity("witchcraft:fire_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:fire_splash" and n ~= "air" then
if not ignore_protection and minetest.is_protected(npos, "") then
return
end
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
max_hear_distance = 20,
gain = 10.0,
})
if n ~= "witchcraft:fire_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
if not ignore_protection and minetest.is_protected(p, "") then
return
end
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.sound_play(
"default_break_glass.1",
{
pos = self.object:getpos(),
max_hear_distance = 20,
gain = 10.0,
})
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
self.object:remove()
@ -1060,7 +1077,7 @@ minetest.register_entity("witchcraft:death_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:death_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:death_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=50},
@ -1075,7 +1092,7 @@ minetest.register_entity("witchcraft:death_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:death_splash" and n ~= "air" then
if n ~= "witchcraft:death_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1107,7 +1124,7 @@ minetest.register_entity("witchcraft:heal_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:heal_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:heal_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=-20},
@ -1122,7 +1139,7 @@ minetest.register_entity("witchcraft:heal_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:heal_splash" and n ~= "air" then
if n ~= "witchcraft:heal_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1154,7 +1171,7 @@ minetest.register_entity("witchcraft:slow_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:slow_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:slow_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
local vel = obj:getvelocity()
obj:setvelocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5})
self.object:remove()
@ -1167,7 +1184,7 @@ minetest.register_entity("witchcraft:slow_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:slow_splash" and n ~= "air" then
if n ~= "witchcraft:slow_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1200,7 +1217,7 @@ minetest.register_entity("witchcraft:fast_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:fast_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:fast_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
local vel = obj:getvelocity()
obj:setvelocity({x=vel.x*4, y=vel.y*1, z=vel.z*4})
self.object:remove()
@ -1213,7 +1230,7 @@ minetest.register_entity("witchcraft:fast_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:fast_splash" and n ~= "air" then
if n ~= "witchcraft:fast_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1246,7 +1263,7 @@ minetest.register_entity("witchcraft:antigrav_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:antigrav_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:antigrav_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
local vel = obj:getvelocity()
obj:setvelocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1})
self.object:remove()
@ -1259,7 +1276,7 @@ minetest.register_entity("witchcraft:antigrav_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:antigrav_splash" and n ~= "air" then
if n ~= "witchcraft:antigrav_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1292,7 +1309,7 @@ minetest.register_entity("witchcraft:jump_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:jump_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:jump_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
local vel = obj:getvelocity()
obj:setvelocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1})
self.object:remove()
@ -1305,7 +1322,7 @@ minetest.register_entity("witchcraft:jump_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:jump_splash" and n ~= "air" then
if n ~= "witchcraft:jump_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1338,7 +1355,7 @@ minetest.register_entity("witchcraft:murky_splash", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:murky_splash" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:murky_splash" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=20},
@ -1353,7 +1370,7 @@ minetest.register_entity("witchcraft:murky_splash", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:murky_splash" and n ~= "air" then
if n ~= "witchcraft:murky_splash" and n ~= "air" and n ~= "gauges:hp_bar" then
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1653,7 +1670,7 @@ minetest.register_node("witchcraft:splash_orange", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_orange.png",
on_use = function(item, placer, pos)
@ -1682,7 +1699,7 @@ minetest.register_node("witchcraft:splash_purple", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_purple.png",
on_use = function(item, placer, pos)
@ -1711,7 +1728,7 @@ minetest.register_node("witchcraft:splash_red", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_red.png",
on_use = function(item, placer, pos)
@ -1740,7 +1757,7 @@ minetest.register_node("witchcraft:splash_green", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_green.png",
on_use = function(item, placer, pos)
@ -1769,7 +1786,7 @@ minetest.register_node("witchcraft:splash_cyan", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_cyan.png",
on_use = function(item, placer, pos)
@ -1798,7 +1815,7 @@ minetest.register_node("witchcraft:splash_redbrown", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_redbrown.png",
on_use = function(item, placer, pos)
@ -1827,7 +1844,7 @@ minetest.register_node("witchcraft:splash_magenta", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_magenta.png",
on_use = function(item, placer, pos)
@ -1856,7 +1873,7 @@ minetest.register_node("witchcraft:splash_brown", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_brown.png",
on_use = function(item, placer, pos)
@ -1885,7 +1902,7 @@ minetest.register_node("witchcraft:splash_grey", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_grey.png",
on_use = function(item, placer, pos)
@ -1916,7 +1933,7 @@ minetest.register_node("witchcraft:splash_ggreen", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_ggreen.png",
on_use = function(item, placer, pos)
@ -1945,7 +1962,7 @@ minetest.register_node("witchcraft:splash_yellwgrn", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_yellgrn.png",
on_use = function(item, placer, pos)
@ -1976,7 +1993,7 @@ minetest.register_node("witchcraft:potion_red", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_red.png",
on_use = function(itemstack, player)
@ -2000,7 +2017,7 @@ minetest.register_node("witchcraft:potion_red_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_red.png^[colorize:black:50",
on_use = function(itemstack, player)
@ -2022,7 +2039,7 @@ minetest.register_node("witchcraft:potion_darkpurple", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
stack_max = 1,
wield_image = "witchcraft_potion_darkpurple.png",
@ -2110,7 +2127,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
paramtype = "light",
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
stack_max = 1,
wield_image = "witchcraft_potion_darkpurple.png^[colorize:black:50",
@ -2198,7 +2215,7 @@ minetest.register_node("witchcraft:potion_brown", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_brown.png",
on_use = minetest.item_eat(-5, "vessels:glass_bottle"),
@ -2217,7 +2234,7 @@ minetest.register_node("witchcraft:potion_brown_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_brown.png^[colorize:black:50",
on_use = minetest.item_eat(-10, "vessels:glass_bottle"),
@ -2238,7 +2255,7 @@ minetest.register_node("witchcraft:potion_yllwgrn", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_yellgrn.png",
on_use = function(pos, placer, itemstack)
@ -2261,7 +2278,7 @@ minetest.register_node("witchcraft:potion_yllwgrn_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_yellgrn.png^[colorize:black:50",
on_use = function(pos, placer, itemstack)
@ -2364,7 +2381,7 @@ minetest.register_node("witchcraft:potion_orange", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_orange.png",
on_use = function(item, placer, pos)
@ -2408,7 +2425,7 @@ minetest.register_node("witchcraft:potion_orange_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_orange.png^[colorize:black:50",
on_use = function(item, placer, pos)
@ -2452,7 +2469,7 @@ minetest.register_node("witchcraft:splash_orange", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_orange.png",
on_use = function(item, placer, pos)
@ -2481,7 +2498,7 @@ minetest.register_node("witchcraft:splash_yellwgrn", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_splash_yellgrn.png",
on_use = function(item, placer, pos)
@ -2510,7 +2527,7 @@ minetest.register_node("witchcraft:potion_purple", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_purple.png",
on_use = function(item, placer, pos)
@ -2539,105 +2556,106 @@ minetest.register_node("witchcraft:potion_purple", {
end,
})
if minetest.get_modpath("hud_hunger") ~= nil then
local register_food = hunger.register_food
minetest.register_node("witchcraft:potion_gpurple", {
description = "Filling Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gpurple.png"},
wield_image = "witchcraft_potion_gpurple.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gpurple.png",
on_use = function(item, placer, pos)
item:replace("vessels:glass_bottle")
return item
end,
})
minetest.register_node("witchcraft:potion_gred", {
description = "Hunger Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gred.png"},
wield_image = "witchcraft_potion_gred.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gred.png",
on_use = function(item, placer, pos)
item:replace("vessels:glass_bottle")
return item
end,
})
register_food("witchcraft:potion_gpurple", 10)
register_food("witchcraft:potion_gred", -4)
else
local register_food = hunger.register_food
minetest.register_node("witchcraft:potion_gpurple", {
description = "Filling Potion (better with hunger mod)",
drawtype = "plantlike",
tiles = {"witchcraft_potion_purple.png"},
wield_image = "witchcraft_potion_purple.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_purple.png",
on_use = function(itemstack, player)
local health = player:get_hp();
player:set_hp(health+20)
itemstack:replace("vessels:glass_bottle")
return itemstack
end,
description = "Filling Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gpurple.png"},
wield_image = "witchcraft_potion_gpurple.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gpurple.png",
on_use = function(item, placer, pos)
item:replace("vessels:glass_bottle")
return item
end,
})
minetest.register_node("witchcraft:potion_gred", {
description = "Hunger Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gred.png"},
wield_image = "witchcraft_potion_gred.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gred.png",
on_use = function(item, placer, pos)
item:replace("vessels:glass_bottle")
return item
end,
})
register_food("witchcraft:potion_gpurple", 10)
register_food("witchcraft:potion_gred", -4)
else
minetest.register_node("witchcraft:potion_gpurple", {
description = "Filling Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gpurple.png"},
wield_image = "witchcraft_potion_gpurple.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_purple.png",
on_use = minetest.item_eat(20, "vessels:glass_bottle"),
})
minetest.register_node("witchcraft:potion_gred", {
description = "Hunger Potion (better with hunger mod)",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gred.png"},
wield_image = "witchcraft_potion_gred.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gred.png",
on_use = function(itemstack, player)
local health = player:get_hp();
player:set_hp(health+10)
itemstack:replace("vessels:glass_bottle")
return itemstack
end,
})
})
description = "Hunger Potion",
drawtype = "plantlike",
tiles = {"witchcraft_potion_gred.png"},
wield_image = "witchcraft_potion_gred.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gred.png",
on_use = minetest.item_eat(-10, "vessels:glass_bottle"),
})
if minetest.get_modpath("hunger_ng") ~= nil then
local register_food = hunger_ng.add_hunger_data
register_food('witchcraft:potion_gpurple', {
satiates = 10,
returns = 'vessels:glass_bottle'
})
register_food('witchcraft:potion_gred', {
satiates = -4,
returns = 'vessels:glass_bottle'
})
end
end
minetest.register_node("witchcraft:potion_purple_2", {
@ -2653,7 +2671,7 @@ minetest.register_node("witchcraft:potion_purple_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_purple.png^[colorize:black:20",
on_use = function(item, placer, pos)
@ -2695,7 +2713,7 @@ minetest.register_node("witchcraft:potion_grey", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_grey.png",
on_use = minetest.item_eat(-100, "vessels:glass_bottle"),
@ -2714,7 +2732,7 @@ minetest.register_node("witchcraft:potion_grey_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_grey.png^[colorize:black:50",
on_use = minetest.item_eat(-200, "vessels:glass_bottle"),
@ -2733,7 +2751,7 @@ minetest.register_node("witchcraft:potion_blue", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_blue.png",
on_use = function(item, user, pointed_thing)
@ -2765,7 +2783,7 @@ minetest.register_node("witchcraft:potion_silver", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_silver.png",
on_use = function(item, user, pointed_thing)
@ -2788,7 +2806,7 @@ minetest.register_node("witchcraft:potion_silver_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_silver.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -2812,7 +2830,7 @@ minetest.register_node("witchcraft:potion_green", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_green.png",
on_use = function(item, user, pointed_thing)
@ -2860,7 +2878,7 @@ minetest.register_node("witchcraft:potion_green", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_green.png",
on_use = function(item, user, pointed_thing)
@ -2909,7 +2927,7 @@ minetest.register_node("witchcraft:potion_gold", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gold.png",
on_use = function(item, user, pointed_thing)
@ -2957,7 +2975,7 @@ minetest.register_node("witchcraft:potion_gold_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gold.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3008,7 +3026,7 @@ minetest.register_node("witchcraft:potion_aqua", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_aqua.png",
on_use = function(item, placer, pos)
@ -3053,7 +3071,7 @@ minetest.register_node("witchcraft:potion_aqua", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_aqua.png",
on_use = function(item, placer, pos)
@ -3100,7 +3118,7 @@ minetest.register_node("witchcraft:potion_magenta", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_magenta.png",
on_use = function(item, user, pointed_thing)
@ -3143,7 +3161,7 @@ minetest.register_node("witchcraft:potion_magenta_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_magenta.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3186,7 +3204,7 @@ minetest.register_node("witchcraft:potion_cyan", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_cyan.png",
on_use = function(item, user, pointed_thing)
@ -3228,7 +3246,7 @@ minetest.register_node("witchcraft:potion_gcyan", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_gcyan.png",
on_use = function(item, user, pointed_thing)
@ -3269,7 +3287,7 @@ minetest.register_node("witchcraft:potion_cyan_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_cyan.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3311,7 +3329,7 @@ minetest.register_node("witchcraft:potion_green2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_green2.png",
on_use = function(item, user, pointed_thing)
@ -3353,7 +3371,7 @@ minetest.register_node("witchcraft:potion_ggreen", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_ggreen.png",
on_use = function(item, user, pointed_thing)
@ -3400,7 +3418,7 @@ minetest.register_node("witchcraft:potion_green2_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_green2.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3442,7 +3460,7 @@ minetest.register_node("witchcraft:potion_redbrown", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_redbrown.png",
on_use = function(item, user, pointed_thing)
@ -3484,7 +3502,7 @@ minetest.register_node("witchcraft:potion_redbrown_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_redbrown.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3526,7 +3544,7 @@ minetest.register_node("witchcraft:potion_blue2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
groups = {dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_blue2.png",
on_use = function(item, user, pointed_thing)
@ -3570,7 +3588,7 @@ minetest.register_node("witchcraft:potion_blue2_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_blue2.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3626,7 +3644,7 @@ minetest.register_node("witchcraft:potion_yellow", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_yellow.png",
on_use = function(item, user, pointed_thing)
@ -3667,7 +3685,7 @@ minetest.register_node("witchcraft:potion_yellow_2", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1},
groups = {dig_immediate=3,attached_node=1, potion2=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "witchcraft_potion_yellow.png^[colorize:black:50",
on_use = function(item, user, pointed_thing)
@ -3892,3 +3910,5 @@ minetest.register_node("witchcraft:candle", {
dofile(minetest.get_modpath("witchcraft").."/scrolls.lua")
dofile(minetest.get_modpath("witchcraft").."/brewing_stand.lua")
minetest.log("action", "[witchcraft] loaded.")

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = witchcraft
depends = default,vessels,tnt,fire,playereffects
optional_depends = player_monoids,farming,lightning,pmobs,hud_hunger,hunger_ng,moreplants,horror

View File

@ -225,7 +225,7 @@ minetest.register_entity("witchcraft:fireball", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:fireball" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:fireball" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=3},
@ -240,7 +240,7 @@ minetest.register_entity("witchcraft:fireball", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" and n ~= "gauges:hp_bar" then
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
minetest.env:set_node(t, {name="fire:basic_flame"})
self.object:remove()
@ -306,7 +306,7 @@ minetest.register_entity("witchcraft:tree", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:tree" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:tree" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:remove()
local treepos = self.object:getpos()
default.grow_new_jungle_tree(treepos)
@ -320,7 +320,7 @@ minetest.register_entity("witchcraft:tree", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.env:get_node(p).name
if n ~= "witchcraft:tree" and n ~="air" then
if n ~= "witchcraft:tree" and n ~="air" and n ~= "gauges:hp_bar" then
local treepos = self.object:getpos()
default.grow_new_jungle_tree(treepos)
self.object:remove()
@ -376,7 +376,7 @@ minetest.register_entity("witchcraft:ice", {
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:ice" and obj:get_luaentity().name ~= "__builtin:item" then
if obj:get_luaentity().name ~= "witchcraft:ice" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=1},
@ -394,7 +394,7 @@ minetest.register_entity("witchcraft:ice", {
local pos = self.object:getpos()
minetest.set_node(pos, {name="default:ice"})
self.object:remove()
elseif n ~= "air" then
elseif n ~= "air" and n ~= "gauges:hp_bar" then
local velo = self.object:getvelocity()
self.object:setvelocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1})
--self.object:remove()
@ -423,4 +423,4 @@ minetest.register_entity("witchcraft:ice", {
)
end
end
})
})