diff --git a/brewing_stand.lua b/brewing_stand.lua index 0a882db..8e556b6 100644 --- a/brewing_stand.lua +++ b/brewing_stand.lua @@ -13,7 +13,7 @@ minetest.register_node("witchcraft:brewing_stand", { "witchcraft_brewing_stand_side.png" }, drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", drop = { items = { @@ -36,14 +36,14 @@ minetest.register_node("witchcraft:brewing_stand", { } }, on_rightclick = function(pos, node, clicker, item, _) - local wield_item = clicker:get_wielded_item():get_name() + local wield_item = item:get_name() local new_item = wield_item.."_2" if minetest.get_item_group(wield_item, "potion") ~= 0 then minetest.set_node(pos, {name="witchcraft:brewing_stand_active", param2=node.param2}) item:take_item() minetest.after(30, function() - minetest.set_node(pos, {name="witchcraft:brewing_stand_unready", param2=node.param2}) - minetest.add_item(pos, new_item) + minetest.set_node(pos, {name="witchcraft:brewing_stand_unready", param2=node.param2}) + minetest.add_item(pos, new_item) end) end end, @@ -59,7 +59,7 @@ minetest.register_node("witchcraft:brewing_stand_active", { "witchcraft_brewing_stand_side.png" }, drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", light_source = 1, drop = { @@ -96,7 +96,7 @@ minetest.register_node("witchcraft:brewing_stand_unready", { }, inventory_image = "witchcraft_brewing_stand_inv.png", drawtype = "nodebox", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", light_source = 1, drop = { @@ -120,7 +120,7 @@ minetest.register_node("witchcraft:brewing_stand_unready", { } }, on_rightclick = function(pos, node, clicker, item, _) - local wield_item = clicker:get_wielded_item():get_name() + local wield_item = item:get_name() if wield_item == "default:mese_crystal_fragment" then minetest.set_node(pos, {name="witchcraft:brewing_stand", param2=node.param2}) item:take_item() @@ -161,4 +161,4 @@ minetest.register_craft({ {'group:stick', 'default:diamond', 'group:stick'}, {'', 'default:obsidian_shard', ''}, } -}) \ No newline at end of file +}) diff --git a/init.lua b/init.lua index 487539e..ed580b6 100644 --- a/init.lua +++ b/init.lua @@ -53,8 +53,9 @@ minetest.register_node("witchcraft:shelf", { local inv = meta:get_inventory() local to_stack = inv:get_stack(listname, index) if listname == "vessels" then - if minetest.get_item_group(stack:get_name(), "potion") ~= 0 or minetest.get_item_group(stack:get_name(), "potion2") ~= 0 - and to_stack:is_empty() then + if minetest.get_item_group(stack:get_name(), "potion") ~= 0 + or minetest.get_item_group(stack:get_name(), "potion2") ~= 0 + and to_stack:is_empty() then return 1 else return 0 @@ -68,8 +69,9 @@ minetest.register_node("witchcraft:shelf", { local stack = inv:get_stack(from_list, from_index) local to_stack = inv:get_stack(to_list, to_index) if to_list == "vessels" then - if minetest.get_item_group(stack:get_name(), "potion") ~= 0 - and to_stack:is_empty() then + if minetest.get_item_group(stack:get_name(), "potion") ~= 0 + or minetest.get_item_group(stack:get_name(), "potion2") ~= 0 + and to_stack:is_empty() then return 1 else return 0 @@ -393,24 +395,24 @@ minetest.register_craft({ --teeth from sand, maybe fossilised? minetest.override_item("default:sand", { - drop = { - max_items = 1, - items = { - { - items = {"witchcraft:tooth"}, - rarity = 30, - }, - { - items = {"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"}, + type = "shapeless", + output = "default:sand", + recipe = {"witchcraft:tooth"}, }) --splash potions crafting @@ -540,14 +542,16 @@ minetest.register_node("witchcraft:pot", { }, 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 minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2}) return ItemStack("bucket:bucket_empty") + elseif wield_item == "witchcraft:potion_blue" then + minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2}) + return ItemStack("vessels:glass_bottle") 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") + minetest.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} @@ -597,7 +601,7 @@ witchcraft.pot_new = { {"aqua", "", "", "", "", "", ""}, {"brown", "redbrown", "flowers:mushroom_red", "", "", "red", "redbrown"}, {"redbrown", "gred", "default:apple", "", "", "", ""}, - {"gred", "red", "witchcraft:herbs", "", "", "blue2", "magenta"}, + {"gred", "red", "witchcraft:herb", "", "", "blue2", "magenta"}, {"red", "magenta", "witchcraft:tooth", "", "", "blue", "purple"}, {"magenta", "gpurple", "witchcraft:bottle_slime", "", "", "cyan", "darkpurple"}, {"gpurple", "purple", "witchcraft:bone_bottle", "", "", "yllwgrn", "green2"}, @@ -611,76 +615,74 @@ witchcraft.pot_new = { --potion pots for _, row in ipairs(witchcraft.pot_new) do --change 'pot_new' to 'pot' for the old recipes -local color = row[1] -local newcolor = row[2] -local newcolor2 = row[4] -local ingredient = row[3] -local ingredient2 = row[5] -local combine = row[6] -local cresult = row[7] -minetest.register_node("witchcraft:pot_"..color, { - tiles = { - { name = "witchcraft_pot_"..color..".png", - animation = {type="vertical_frames", length=3.0} }, - "witchcraft_pot_bottom.png", - "witchcraft_pot_side.png", - "witchcraft_pot_side.png", - "witchcraft_pot_side.png", - "witchcraft_pot_side.png" - }, - drawtype = "nodebox", - paramtype = "light", - drop = { - items = { - {items = {'witchcraft:pot'}, rarity = 1}, - } - }, - node_box = { - type = "fixed", - fixed = { - {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, 0.4375}, -- NodeBox1 - {-0.375, -0.4375, -0.375, 0.375, -0.375, 0.375}, -- NodeBox2 - {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox3 - {-0.375, -0.3125, -0.375, 0.375, 0.5, 0.375}, -- NodeBox4 - {-0.4375, -0.25, -0.4375, 0.4375, 0.3125, 0.4375}, -- NodeBox5 - {-0.5, -0.1875, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox6 - {-0.4375, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox7 - } - }, - on_rightclick = function(pos, node, clicker, itemstack, _) - local wield_item = itemstack:get_name() + local color = row[1] + local newcolor = row[2] + local newcolor2 = row[4] + local ingredient = row[3] + local ingredient2 = row[5] + local combine = row[6] + local cresult = row[7] + minetest.register_node("witchcraft:pot_"..color, { + tiles = { + { + name = "witchcraft_pot_"..color..".png", + animation = {type="vertical_frames", length=3.0 } + }, + "witchcraft_pot_bottom.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png" + }, + drawtype = "nodebox", + paramtype = "light", + drop = { + items = { + {items = {'witchcraft:pot'}, rarity = 1}, + } + }, + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, 0.4375}, -- NodeBox1 + {-0.375, -0.4375, -0.375, 0.375, -0.375, 0.375}, -- NodeBox2 + {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox3 + {-0.375, -0.3125, -0.375, 0.375, 0.5, 0.375}, -- NodeBox4 + {-0.4375, -0.25, -0.4375, 0.4375, 0.3125, 0.4375}, -- NodeBox5 + {-0.5, -0.1875, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox6 + {-0.4375, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox7 + } + }, + 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) + 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.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 == ingredient then + minetest.set_node(pos, {name="witchcraft:pot_"..newcolor, param2=node.param2}) + itemstack:take_item() + elseif wield_item == ingredient2 then + minetest.set_node(pos, {name="witchcraft:pot_"..newcolor2, param2=node.param2}) + 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}) + itemstack:replace("bucket:bucket_empty") + elseif wield_item == "witchcraft:potion_"..combine then + minetest.set_node(pos, {name="witchcraft:pot_"..cresult, param2=node.param2}) + itemstack:replace("vessels:glass_bottle") end - - minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) - elseif wield_item == ingredient then - minetest.set_node(pos, {name="witchcraft:pot_"..newcolor, param2=node.param2}) - itemstack:take_item() - elseif wield_item == ingredient2 then - minetest.set_node(pos, {name="witchcraft:pot_"..newcolor2, param2=node.param2}) - 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}) - return ItemStack("bucket:bucket_empty") - elseif wield_item == "witchcraft:potion_"..combine then - minetest.set_node(pos, {name="witchcraft:pot_"..cresult, param2=node.param2}) - itemstack:replace("vessels:glass_bottle") - end - - return itemstack - end, - groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1} -}) + return itemstack + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1} + }) end --pot effects @@ -913,10 +915,10 @@ minetest.register_node("witchcraft:bottle_medicine", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_medicine_bottle.png", on_use = function(itemstack, player) - local health = player:get_hp(); - player:set_hp(health+10) - itemstack:replace("witchcraft:small_bottle") - return itemstack + local health = player:get_hp() + player:set_hp(health+10) + itemstack:replace("witchcraft:small_bottle") + return itemstack end, }) @@ -931,69 +933,43 @@ minetest.register_entity("witchcraft:tnt_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "gauges:hp_bar"then - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=3}, - }, nil) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + minetest.sound_play("default_break_glass", { + pos = pos, + gain = 1.0, + max_hear_distance = 20, + }) tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) self.object:remove() - end - end - end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - local pos = self.object:getpos() - minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), - gaint = 1.0, - max_hear_distance = 20, - }) - tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) - self.object:remove() - return - end - end - end - end - hit_node = function(self, pos, node) - local pos = self.object:getpos() - for dx=-4,4 do - for dy=-4,4 do - for dz=-4,4 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local n = minetest.env:get_node(pos).name - if math.random(1, 50) <= 35 then - tnt.boom(n, {damage_radius=5,radius=3,ignore_protection=false}) - end - if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then - if not ignore_protection and minetest.is_protected(npos, "") then - return - end - minetest.env:set_node(t, {name="fire:basic_flame"}) - end + return end end end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:tnt_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + gain = 1.0, + max_hear_distance = 20, + }) + tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) + self.object:remove() end - end, }) - - minetest.register_entity("witchcraft:fire_splash", { textures = {"witchcraft_splash_orange.png"}, velocity = 0.1, @@ -1001,66 +977,56 @@ minetest.register_entity("witchcraft:fire_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { + for k, obj in pairs(objs) do + if obj:get_luaentity() 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}, - }, nil) + }, nil) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" 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() - return - end - end - end - end - hit_node = function(self, pos, node) - local pos = self.object:getpos() - for dx=-4,4 do - for dy=-4,4 do - for dz=-4,4 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local n = minetest.env:get_node(pos).name - if math.random(1, 50) <= 1 then - minetest.env:remove_node(p) - end - if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then - minetest.env:set_node(t, {name="fire:basic_flame"}) - end - end - end - end end + local is_used = false + for dx=0,1 do + for dy=0,1 do + for dz=0,1 do + local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz} + local t = {x=pos.x+dx, y=pos.y+1+dy, z=pos.z+dz} + local n = minetest.get_node(p).name + if n ~= "witchcraft:fire_splash" and n ~= "air" then + is_used = true + if minetest.is_protected(pos, "") then + return + end + minetest.set_node(t, {name="fire:basic_flame"}) + if minetest.registered_nodes[n].groups.flammable then + minetest.set_node(p, {name="fire:basic_flame"}) + end + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + end + end + end + end + if is_used then self.object:remove() end end, }) @@ -1071,43 +1037,38 @@ minetest.register_entity("witchcraft:death_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=50}, }, nil) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - 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() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:death_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1118,43 +1079,39 @@ minetest.register_entity("witchcraft:heal_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=-20}, }, nil) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - 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() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:heal_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + return + end end, }) @@ -1165,42 +1122,36 @@ minetest.register_entity("witchcraft:slow_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" 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}) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5}) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - - self.object:remove() - elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), - max_hear_distance = 20, - gain = 10.0, - }) - self.object:remove() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:slow_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1213,40 +1164,34 @@ minetest.register_entity("witchcraft:fast_splash", { local remove = minetest.after(2, function() self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" 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}) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*4, y=vel.y*1, z=vel.z*4}) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - - self.object:remove() - elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), - max_hear_distance = 20, - gain = 10.0, - }) - self.object:remove() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:fast_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1257,42 +1202,36 @@ minetest.register_entity("witchcraft:antigrav_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" 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}) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1}) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - - self.object:remove() - elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), - max_hear_distance = 20, - gain = 10.0, - }) - self.object:remove() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:antigrav_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1303,42 +1242,36 @@ minetest.register_entity("witchcraft:jump_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" 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}) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + local vel = obj:get_velocity() + obj:set_velocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1}) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - - self.object:remove() - elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - minetest.sound_play("default_break_glass.1", { - pos = self.object:getpos(), - max_hear_distance = 20, - gain = 10.0, - }) - self.object:remove() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:antigrav_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1349,43 +1282,38 @@ minetest.register_entity("witchcraft:murky_splash", { collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) local remove = minetest.after(2, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=20}, - }, nil) + 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" + and obj:get_luaentity().name ~= "gauges:hp_bar" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=20}, + }, nil) + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - 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() - return - end - end - end - end - - + end + local n = minetest.get_node(pos).name + if n ~= "witchcraft:murky_splash" and n ~= "air" then + minetest.sound_play("default_break_glass", { + pos = pos, + max_hear_distance = 20, + gain = 10.0, + }) + self.object:remove() + end end, }) @@ -1397,25 +1325,25 @@ minetest.register_entity("witchcraft:shadow_splash", { collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, on_step = function(self, obj, pos) local remove = minetest.after(5, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() - minetest.add_particlespawner( - 50, --amount - 1, --time - {x=pos.x-3, y=pos.y-3, z=pos.z-3}, --minpos - {x=pos.x+3, y=pos.y+3, z=pos.z+3}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.1,y=0.2,z=-0.1}, --minacc - {x=0.1,y=0.2,z=0.1}, --maxacc - 5, --minexptime - 10, --maxexptime - 10, --minsize - 20, --maxsize - false, --collisiondetection - "witchcraft_pot_bottom.png^[colorize:black:200" --texture - ) + local pos = self.object:get_pos() + minetest.add_particlespawner({ + amount = 50, + time = 1, + minpos = {x=pos.x-3, y=pos.y-3, z=pos.z-3}, + maxpos = {x=pos.x+3, y=pos.y+3, z=pos.z+3}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.1,y=0.2,z=-0.1}, + maxacc = {x=0.1,y=0.2,z=0.1}, + minexptime = 5, + maxexptime = 10, + minsize = 10, + maxsize = 20, + collisiondetection = false, + texture = "witchcraft_pot_bottom.png^[colorize:black:200" + }) end, }) @@ -1427,225 +1355,223 @@ minetest.register_entity("witchcraft:smoke_splash", { collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, on_step = function(self, obj, pos) local remove = minetest.after(10, function() - self.object:remove() + self.object:remove() end) - local pos = self.object:getpos() - local velo = self.object:getvelocity() - self.object:setvelocity({x=velo.x*0.9,y=velo.y,z=velo.z*0.9}) - minetest.add_particlespawner( - 10, --amount - 1, --time - {x=pos.x-1, y=pos.y-1, z=pos.z-1}, --minpos - {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos - {x=-1, y=-0, z=-1}, --minvel - {x=1, y=0, z=1}, --maxvel - {x=-0.5,y=2,z=-0.5}, --minacc - {x=0.5,y=3,z=0.5}, --maxacc - 2, --minexptime - 4, --maxexptime - 10, --minsize - 20, --maxsize - false, --collisiondetection - "witchcraft_smoke.png" --texture - ) - + local pos = self.object:get_pos() +-- local velo = self.object:get_velocity() +-- self.object:set_velocity({x=velo.x*0.9,y=velo.y,z=velo.z*0.9}) + minetest.add_particlespawner({ + amount = 10, + time = 1, + minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1}, + maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1}, + minvel = {x=-1, y=-0, z=-1}, + maxvel = {x=1, y=0, z=1}, + minacc = {x=-0.5,y=2,z=-0.5}, + maxacc = {x=0.5,y=3,z=0.5}, + minexptime = 2, + maxexptime = 4, + minsize = 10, + maxsize = 20, + collisiondetection = false, + texture = "witchcraft_smoke.png" + }) end, }) --player effects if minetest.get_modpath("player_monoids") then -local speed = player_monoids.speed -local jump = player_monoids.jump -local gravity = player_monoids.gravity + local speed = player_monoids.speed + local jump = player_monoids.jump + local gravity = player_monoids.gravity -playereffects.register_effect_type("witchcraft:potion_speed_lv1", "High Speed", nil, {"witchcraft:potion_speed_lv1"}, - function(player) - speed:add_change(player, 2, "witchcraft:potion_speed_lv1") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_speed_lv1") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_speed_lv1", "High Speed", nil, {"witchcraft:potion_speed_lv1"}, + function(player) + speed:add_change(player, 2, "witchcraft:potion_speed_lv1") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_speed_lv1") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_speed_lv2", "High Speed", nil, {"witchcraft:potion_speed_lv2"}, - function(player) - speed:add_change(player, 2.5, "witchcraft:potion_speed_lv2") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_speed_lv2") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_speed_lv2", "High Speed", nil, {"witchcraft:potion_speed_lv2"}, + function(player) + speed:add_change(player, 2.5, "witchcraft:potion_speed_lv2") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_speed_lv2") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_jump_lvx", "High Jump", nil, {"witchcraft:potion_jump_lvx"}, - function(player) - jump:add_change(player, 1.5, "witchcraft:potion_jump_lvx") - gravity:add_change(player, 0.8, "witchcraft:potion_jump_lvx") - end, - function(effect, player) - jump:del_change(player, "witchcraft:potion_jump_lvx") - gravity:del_change(player, "witchcraft:potion_jump_lvx") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_jump_lvx", "High Jump", nil, {"witchcraft:potion_jump_lvx"}, + function(player) + jump:add_change(player, 1.5, "witchcraft:potion_jump_lvx") + gravity:add_change(player, 0.8, "witchcraft:potion_jump_lvx") + end, + function(effect, player) + jump:del_change(player, "witchcraft:potion_jump_lvx") + gravity:del_change(player, "witchcraft:potion_jump_lvx") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_antigrav_lvx", "Light weight", nil, {"witchcraft:potion_antigrav_lvx"}, - function(player) - gravity:add_change(player, 0.1, "witchcraft:potion_antigrav_lvx") - end, - function(effect, player) - gravity:del_change(player, "witchcraft:potion_antigrav_lvx") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_antigrav_lvx", "Light weight", nil, {"witchcraft:potion_antigrav_lvx"}, + function(player) + gravity:add_change(player, 0.1, "witchcraft:potion_antigrav_lvx") + end, + function(effect, player) + gravity:del_change(player, "witchcraft:potion_antigrav_lvx") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_slow_lv1", "Low Speed", nil, {"witchcraft:potion_slow_lv1"}, - function(player) - speed:add_change(player, 0.5, "witchcraft:potion_slow_lv1") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_slow_lv1") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_slow_lv1", "Low Speed", nil, {"witchcraft:potion_slow_lv1"}, + function(player) + speed:add_change(player, 0.5, "witchcraft:potion_slow_lv1") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_slow_lv1") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_slow_lv2", "Low Speed", nil, {"witchcraft:potion_slow_lv2"}, - function(player) - speed:add_change(player, 0.4, "witchcraft:potion_slow_lv2") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_slow_lv2") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_slow_lv2", "Low Speed", nil, {"witchcraft:potion_slow_lv2"}, + function(player) + speed:add_change(player, 0.4, "witchcraft:potion_slow_lv2") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_slow_lv2") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_swim_lv1", "Fast Swim", nil, {"witchcraft:potion_swim_lv1"}, - function(player) - speed:add_change(player, 3, "witchcraft:potion_swim_lv1") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_swim_lv1") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_swim_lv1", "Fast Swim", nil, {"witchcraft:potion_swim_lv1"}, + function(player) + speed:add_change(player, 3, "witchcraft:potion_swim_lv1") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_swim_lv1") + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_swim_lv2", "Dive", nil, {"witchcraft:potion_swim_lv2"}, - function(player) - speed:add_change(player, 3, "witchcraft:potion_swim_lv2") - gravity:add_change(player, 4, "witchcraft:potion_swim_lv2") - end, - function(effect, player) - speed:del_change(player, "witchcraft:potion_swim_lv2") - gravity:del_change(player, "witchcraft:potion_swim_lv2") - end, - false -) + playereffects.register_effect_type("witchcraft:potion_swim_lv2", "Dive", nil, {"witchcraft:potion_swim_lv2"}, + function(player) + speed:add_change(player, 3, "witchcraft:potion_swim_lv2") + gravity:add_change(player, 4, "witchcraft:potion_swim_lv2") + end, + function(effect, player) + speed:del_change(player, "witchcraft:potion_swim_lv2") + gravity:del_change(player, "witchcraft:potion_swim_lv2") + end, + false + ) else + local function set_physics(player, speed, jump, gravity) + player:set_physics_override({ + speed = speed, + jump = jump, + gravity = gravity + }) + end + playereffects.register_effect_type("witchcraft:potion_speed_lv1", "High speed", nil, {"speed"}, + function(player) + set_physics(player, 2,nil,nil) + end, + function(effect, player) + set_physics(player, 1,nil,nil) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_speed_lv1", "High speed", nil, {"speed"}, - function(player) - player:set_physics_override(2,nil,nil) - end, - - function(effect, player) - player:set_physics_override(1,nil,nil) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_speed_lv2", "High speed", nil, {"speed"}, + function(player) + set_physics(player, 2.5,nil,nil) + end, + function(effect, player) + set_physics(player, 1,nil,nil) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_speed_lv2", "High speed", nil, {"speed"}, - function(player) - player:set_physics_override(2.5,nil,nil) - end, - - function(effect, player) - player:set_physics_override(1,nil,nil) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_jump_lvx", "High Jump", nil, {"jump"}, + function(player) + set_physics(player, nil,1.5,0.8) + end, + function(effect, player) + set_physics(player, nil,1,1) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_jump_lvx", "High Jump", nil, {"jump"}, - function(player) - player:set_physics_override(nil,1.5,0.8) - end, - - function(effect, player) - player:set_physics_override(nil,1,1) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_antigrav_lvx", "Light weight", nil, {"gravity"}, + function(player) + set_physics(player, nil,nil,0.1) + end, + function(effect, player) + set_physics(player, nil,nil,1) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_antigrav_lvx", "Light weight", nil, {"gravity"}, - function(player) - player:set_physics_override(nil,nil,0.1) - end, - - function(effect, player) - player:set_physics_override(nil,nil,1) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_slow_lv1", "Low speed", nil, {"speed"}, + function(player) + set_physics(player, 0.5,nil,nil) + end, + function(effect, player) + set_physics(player, 1,nil,nil) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_slow_lv1", "Low speed", nil, {"speed"}, - function(player) - player:set_physics_override(0.5,nil,nil) - end, - - function(effect, player) - player:set_physics_override(1,nil,nil) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_slow_lv2", "Low speed", nil, {"speed"}, + function(player) + set_physics(player, 0.4,nil,nil) + end, + function(effect, player) + set_physics(player, 1,nil,nil) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_slow_lv2", "Low speed", nil, {"speed"}, - function(player) - player:set_physics_override(0.4,nil,nil) - end, - - function(effect, player) - player:set_physics_override(1,nil,nil) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_swim_lv1", "Fast Swim", nil, {"swim"}, + function(player) + set_physics(player, 3,nil,nil) + end, + function(effect, player) + set_physics(player, 1,nil,nil) + end, + false + ) -playereffects.register_effect_type("witchcraft:potion_swim_lv1", "Fast Swim", nil, {"swim"}, - function(player) - player:set_physics_override(3,nil,nil) - end, - - function(effect, player) - player:set_physics_override(1,nil,nil) - end, - false -) - -playereffects.register_effect_type("witchcraft:potion_swim_lv2", "Dive", nil, {"swim"}, - function(player) - player:set_physics_override(3,nil,4) - end, - - function(effect, player) - player:set_physics_override(1,nil,1) - end, - false -) + playereffects.register_effect_type("witchcraft:potion_swim_lv2", "Dive", nil, {"swim"}, + function(player) + set_physics(player, 3,nil,4) + end, + function(effect, player) + set_physics(player, 1,nil,1) + end, + false + ) end playereffects.register_effect_type("potion_silver", "Fire resist", nil, {"fire_resist"}, function(player) - local pos = player:getpos() + local pos = player:get_pos() local node = minetest.get_node(pos).name - if node == "default:lava_source" or node == "default:lava_flowing" or node == "fire:basic_flame" then - local hp1 = player:get_hp() - minetest.after(0.8, function() - local hp2 = player:get_hp() - local change = hp1-hp2 - if change >= 0 then - player:set_hp(hp2+change) - end - end) + if node == "default:lava_source" or node == "default:lava_flowing" + or node == "fire:basic_flame" then + local hp1 = player:get_hp() + minetest.after(0.8, function() + local hp2 = player:get_hp() + local change = hp1-hp2 + if change >= 0 then + player:set_hp(hp2+change) + end + end) end end, nil, @@ -1654,9 +1580,27 @@ playereffects.register_effect_type("potion_silver", "Fire resist", nil, {"fire_r 0.3 ) - --splash potions +local splash = function(potion) + return function(itemstack, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*6, y=dir.y*3.5, z=dir.z*6} + local acc = {x=0, y=-9.8, z=0} + local obj = minetest.add_entity({ + x = playerpos.x+dir.x*1.5, + y = playerpos.y+2+dir.y, + z = playerpos.z+dir.z*1.5 + }, + potion) + obj:set_velocity(vec) + obj:set_acceleration(acc) + itemstack:take_item() + return itemstack + end +end + minetest.register_node("witchcraft:splash_orange", { description = "Dragon Splash Potion", drawtype = "plantlike", @@ -1673,17 +1617,7 @@ minetest.register_node("witchcraft:splash_orange", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:fire_splash"), }) minetest.register_node("witchcraft:splash_purple", { @@ -1702,17 +1636,7 @@ minetest.register_node("witchcraft:splash_purple", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z}, "witchcraft:smoke_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:smoke_splash"), }) minetest.register_node("witchcraft:splash_red", { @@ -1731,17 +1655,7 @@ minetest.register_node("witchcraft:splash_red", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:heal_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:heal_splash"), }) minetest.register_node("witchcraft:splash_green", { @@ -1760,17 +1674,7 @@ minetest.register_node("witchcraft:splash_green", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:jump_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:jump_splash"), }) minetest.register_node("witchcraft:splash_cyan", { @@ -1789,17 +1693,7 @@ minetest.register_node("witchcraft:splash_cyan", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:antigrav_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:antigrav_splash"), }) minetest.register_node("witchcraft:splash_redbrown", { @@ -1818,17 +1712,7 @@ minetest.register_node("witchcraft:splash_redbrown", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:slow_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:slow_splash"), }) minetest.register_node("witchcraft:splash_magenta", { @@ -1847,17 +1731,7 @@ minetest.register_node("witchcraft:splash_magenta", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*13,y=dir.y*2.5,z=dir.z*13} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:fast_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:fast_splash"), }) minetest.register_node("witchcraft:splash_brown", { @@ -1876,17 +1750,7 @@ minetest.register_node("witchcraft:splash_brown", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:murky_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:murky_splash"), }) minetest.register_node("witchcraft:splash_grey", { @@ -1905,21 +1769,9 @@ minetest.register_node("witchcraft:splash_grey", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9} - local acc = {x=0,y=-9,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:death_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:death_splash"), }) - - minetest.register_node("witchcraft:splash_ggreen", { description = "Darkness Splash Potion", drawtype = "plantlike", @@ -1936,17 +1788,7 @@ minetest.register_node("witchcraft:splash_ggreen", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:shadow_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:shadow_splash"), }) minetest.register_node("witchcraft:splash_yellwgrn", { @@ -1965,17 +1807,7 @@ minetest.register_node("witchcraft:splash_yellwgrn", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, + on_use = splash("witchcraft:tnt_splash"), }) --potions (level 1 and 2) @@ -1997,10 +1829,10 @@ minetest.register_node("witchcraft:potion_red", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_red.png", on_use = function(itemstack, player) - local health = player:get_hp(); - player:set_hp(health+20) - itemstack:replace("vessels:glass_bottle") - return itemstack + local health = player:get_hp() + player:set_hp(health+20) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2021,13 +1853,59 @@ minetest.register_node("witchcraft:potion_red_2", { sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_red.png^[colorize:black:50", on_use = function(itemstack, player) - local health = player:get_hp(); - player:set_hp(health+50) - itemstack:replace("vessels:glass_bottle") - return itemstack + local health = player:get_hp() + player:set_hp(health+50) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) +--invisibility potion by Tenplus1(DWTFYWT V2), see darkpurple potion for on_use effect + +invisibility = {} + +-- reset player invisibility if they go offline + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + if invisibility[name] then + invisibility[name] = nil + end +end) + +local invisible = function(player, toggle) + if not player then return false end + + local name = player:get_player_name() + invisibility[name] = toggle + + local prop + if toggle then + + -- hide player and name tag + prop = { + visual_size = {x = 0, y = 0}, +-- collisionbox = {0, 0, 0, 0, 0, 0} + } + + player:set_nametag_attributes({ + color = {a = 0, r = 255, g = 255, b = 255} + }) + else + -- show player and tag + prop = { + visual_size = {x = 1, y = 1}, +-- collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35} + } + + player:set_nametag_attributes({ + color = {a = 255, r = 255, g = 255, b = 255} + }) + end + + player:set_properties(prop) +end + minetest.register_node("witchcraft:potion_darkpurple", { description = "Shady Potion", drawtype = "plantlike", @@ -2047,7 +1925,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { on_use = function(itemstack, user) --invisibility effect from invisibility potion by Tenplus1 - local pos = user:getpos() + local pos = user:get_pos() -- make player invisible invisible(user, true) @@ -2061,9 +1939,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { -- display 10 second warning minetest.after(290, function() - - if user:getpos() then - + if pos then minetest.chat_send_player(user:get_player_name(), ">>> You have 10 seconds before invisibility wears off!") end @@ -2071,9 +1947,7 @@ minetest.register_node("witchcraft:potion_darkpurple", { -- make player visible 5 minutes later minetest.after(300, function() - - if user:getpos() then - + if pos then -- show aready hidden player invisible(user, nil) @@ -2086,36 +1960,33 @@ minetest.register_node("witchcraft:potion_darkpurple", { end end) - --effect - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - + --effect + local playerpos = pos + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + -- take item - if not minetest.setting_getbool("creative_mode") then - + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() - return {name = "vessels:glass_bottle"} end end, }) - minetest.register_node("witchcraft:potion_darkpurple_2", { description = "Shady Potion (lv2)", drawtype = "plantlike", @@ -2133,8 +2004,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { wield_image = "witchcraft_potion_darkpurple.png^[colorize:black:50", inventory_image = "witchcraft_potion_darkpurple.png^[colorize:black:50", on_use = function(itemstack, user) - - local pos = user:getpos() + local pos = user:get_pos() -- make player invisible invisible(user, true) @@ -2148,9 +2018,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { -- display 10 second warning minetest.after(340, function() - - if user:getpos() then - + if pos then minetest.chat_send_player(user:get_player_name(), ">>> You have 10 seconds before invisibility wears off!") end @@ -2158,8 +2026,7 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { -- make player visible 5 minutes later minetest.after(350, function() - - if user:getpos() then + if pos then -- show aready hidden player invisible(user, nil) @@ -2170,33 +2037,31 @@ minetest.register_node("witchcraft:potion_darkpurple_2", { gain = 1.0, max_hear_distance = 5 }) - end + end end) - --effect - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) + --effect + local playerpos = pos + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) -- take item - if not minetest.setting_getbool("creative_mode") then - + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() - return {name = "vessels:glass_bottle"} end end, @@ -2240,8 +2105,6 @@ minetest.register_node("witchcraft:potion_brown_2", { on_use = minetest.item_eat(-10, "vessels:glass_bottle"), }) - ---cannot get the potion to be removed from inventory on use? minetest.register_node("witchcraft:potion_yllwgrn", { description = "Dodgy Potion", drawtype = "plantlike", @@ -2258,10 +2121,10 @@ minetest.register_node("witchcraft:potion_yllwgrn", { 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) - local pos = placer:getpos(); - tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) - return itemstack + on_use = function(itemstack, placer, pointed_thing) + tnt.boom(placer:get_pos(), {damage_radius=5,radius=3,ignore_protection=false}) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2281,93 +2144,59 @@ minetest.register_node("witchcraft:potion_yllwgrn_2", { 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) - local pos = placer:getpos(); - tnt.boom(pos, {damage_radius=10,radius=4,ignore_protection=false}) - return itemstack + on_use = function(itemstack, placer, pointed_thing) + tnt.boom(placer:get_pos(), {damage_radius=10,radius=4,ignore_protection=false}) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) - - minetest.register_entity("witchcraft:fire", { textures = {"witchcraft_flame.png"}, velocity = 0.1, damage = 2, collisionbox = {0, 0, 0, 0, 0, 0}, on_step = function(self, obj, pos) - local remove = minetest.after(2, function() - self.object:remove() + minetest.after(2, function() + self.object:remove() end) - local pos = self.object:getpos() + local pos = self.object:get_pos() 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" and obj:get_luaentity().name ~= "__builtin:item" then - obj:punch(self.object, 1.0, { + for k, obj in pairs(objs) do + if obj:get_luaentity() ~= nil then + if obj:get_luaentity().name ~= "witchcraft:fire" + 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}, - }, nil) + }, nil) self.object:remove() - end + return end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "air" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then - minetest.env:set_node(t, {name="fire:basic_flame"}) - elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - self.object:remove() - return - end - end + end + local is_used = false + for dx=0,1 do + for dy=0,1 do + for dz=0,1 do + 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.get_node(p).name + if n ~= "witchcraft:fire" and n ~= "air" then + is_used = true + if minetest.registered_items[n].groups.flammable + and not minetest.is_protected(pos, "") then + minetest.set_node(t, {name="fire:basic_flame"}) end end - hit_node = function(self, pos, node) - local pos = self.object:getpos() - for dx=-4,4 do - for dy=-4,4 do - for dz=-4,4 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local n = minetest.env:get_node(pos).name - if math.random(1, 50) <= 35 then - minetest.env:remove_node(p) - end - if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then - minetest.env:set_node(t, {name="fire:basic_flame"}) - end end end end - end - - local apos = self.object:getpos() - local part = minetest.add_particlespawner( - 10, --amount - 0.3, --time - {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos - {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0.5,y=0.5,z=0.5}, --maxacc - 1, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_flame.png" --texture - ) - + if is_used then self.object:remove() end end, }) - minetest.register_node("witchcraft:potion_orange", { description = "Dragon Potion", drawtype = "plantlike", @@ -2384,31 +2213,35 @@ minetest.register_node("witchcraft:potion_orange", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire") - obj:setvelocity(vec) - local part = minetest.add_particlespawner( - 10, --amount - 0.3, --time - {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, --minpos - {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, --maxpos - {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --minvel - {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0.5,y=0.5,z=0.5}, --maxacc - 1, --minexptime - 2, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_flame.png" --texture - ) + on_use = function(itemstack, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} + local obj = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:fire") + obj:set_velocity(vec) + minetest.add_particlespawner({ + amount = 10, + time = 0.3, + minpos = {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, + maxpos = {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, + minvel = {x=dir.x*3,y=dir.y*3,z=dir.z*3}, + maxvel = {x=dir.x*3,y=dir.y*3,z=dir.z*3}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=0.5,y=0.5,z=0.5}, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_flame.png" + }) - item:replace("vessels:glass_bottle") - return item + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2428,89 +2261,35 @@ minetest.register_node("witchcraft:potion_orange_2", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*3,y=dir.y*3.5,z=dir.z*3} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire") - obj:setvelocity(vec) - local part = minetest.add_particlespawner( - 10, --amount - 0.3, --time - {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, --minpos - {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, --maxpos - {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --minvel - {x=dir.x*3,y=dir.y*3,z=dir.z*3}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0.5,y=0.5,z=0.5}, --maxacc - 1, --minexptime - 2, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_flame.png^[colorize:blue:200" --texture - ) - - item:replace("vessels:glass_bottle") - return item - end, -}) + on_use = function(itemstack, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*3,y=dir.y*3.5,z=dir.z*3} + local obj = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:fire") + obj:set_velocity(vec) + minetest.add_particlespawner({ + amount = 10, + time = 0.3, + minpos = {x=playerpos.x-0.3, y=playerpos.y+1.5, z=playerpos.z-0.3}, + maxpos = {x=playerpos.x+0.3, y=playerpos.y+1.5, z=playerpos.z+0.3}, + minvel = {x=dir.x*3,y=dir.y*3,z=dir.z*3}, + maxvel = {x=dir.x*3,y=dir.y*3,z=dir.z*3}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=0.5,y=0.5,z=0.5}, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_flame.png^[colorize:blue:200" + }) -minetest.register_node("witchcraft:splash_orange", { - description = "Dragon Splash Potion", - drawtype = "plantlike", - tiles = {"witchcraft_splash_orange.png"}, - wield_image = "witchcraft_splash_orange.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 = {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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item - end, -}) - -minetest.register_node("witchcraft:splash_yellwgrn", { - description = "Dodgy Splash Potion", - drawtype = "plantlike", - tiles = {"witchcraft_splash_yellgrn.png"}, - wield_image = "witchcraft_splash_yellgrn.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 = {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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7} - local acc = {x=0,y=-9.8,z=0} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash") - obj:setvelocity(vec) - obj:setacceleration(acc) - item:take_item() - return item + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2530,34 +2309,34 @@ minetest.register_node("witchcraft:potion_purple", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} - local part = minetest.add_particlespawner( - 20, --amount - 0.5, --time - {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, --maxpos - {x=0,y=0.5,z=0}, --minvel - {x=0,y=0.6,z=0}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0,y=0.5,z=0}, --maxacc - 1, --minexptime - 3, --maxexptime - 10, --minsize - 15, --maxsize - false, --collisiondetection - "witchcraft_smoke.png^[colorize:magenta:50" --texture - ) - - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} + minetest.add_particlespawner({ + amount = 20, + time = 0.5, + minpos = {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, + minvel = {x=0,y=0.5,z=0}, + maxvel = {x=0,y=0.6,z=0}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=0,y=0.5,z=0}, + minexptime = 1, + maxexptime = 3, + minsize = 10, + maxsize = 15, + collisiondetection = false, + texture = "witchcraft_smoke.png^[colorize:magenta:50" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack 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", @@ -2571,12 +2350,12 @@ if minetest.get_modpath("hud_hunger") ~= nil then 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_gpurple.png", - on_use = function(item, placer, pos) - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, placer, pointed_thing) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2593,12 +2372,12 @@ if minetest.get_modpath("hud_hunger") ~= nil then 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_gred.png", - on_use = function(item, placer, pos) - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, placer, pointed_thing) + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2618,12 +2397,12 @@ else 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 = minetest.item_eat(20, "vessels:glass_bottle"), }) - + minetest.register_node("witchcraft:potion_gred", { description = "Hunger Potion", drawtype = "plantlike", @@ -2637,13 +2416,13 @@ else 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_gred.png", on_use = minetest.item_eat(-10, "vessels:glass_bottle"), }) - if minetest.get_modpath("hunger_ng") ~= nil then + if minetest.get_modpath("hunger_ng") then local register_food = hunger_ng.add_hunger_data register_food('witchcraft:potion_gpurple', { @@ -2674,29 +2453,29 @@ minetest.register_node("witchcraft:potion_purple_2", { 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) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} - local part = minetest.add_particlespawner( - 20, --amount - 0.5, --time - {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, --maxpos - {x=0,y=0.2,z=0}, --minvel - {x=0,y=0.2,z=0}, --maxvel - {x=0,y=-0.1,z=0}, --minacc - {x=0,y=0.1,z=0}, --maxacc - 5, --minexptime - 10, --maxexptime - 10, --minsize - 15, --maxsize - false, --collisiondetection - "witchcraft_smoke.png^[colorize:magenta:50" --texture - ) - - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2} + minetest.add_particlespawner({ + amount = 20, + time = 0.5, + minpos = {x=playerpos.x-1, y=playerpos.y, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y, z=playerpos.z+1}, + minvel = {x=0,y=0.2,z=0}, + maxvel = {x=0,y=0.2,z=0}, + minacc = {x=0,y=-0.1,z=0}, + maxacc = {x=0,y=0.1,z=0}, + minexptime = 5, + maxexptime = 10, + minsize = 10, + maxsize = 15, + collisiondetection = false, + texture = "witchcraft_smoke.png^[colorize:magenta:50" + }) + + itemstack:replace("vessels:glass_bottle") + return itemstack end, }) @@ -2754,22 +2533,21 @@ minetest.register_node("witchcraft:potion_blue", { 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) + on_use = function(itemstack, user, pointed_thing) local player = user:get_player_name() if pointed_thing.type == "node" and - minetest.get_node(pointed_thing.above).name == "air" then + minetest.get_node(pointed_thing.above).name == "air" then if not minetest.is_protected(pointed_thing.above, player) then minetest.set_node(pointed_thing.above, {name="default:water_source"}) else minetest.chat_send_player(player, "This area is protected.") end end - item:replace("vessels:glass_bottle") - return item + itemstack:replace("vessels:glass_bottle") + return itemstack end }) - minetest.register_node("witchcraft:potion_silver", { description = "Cold potion", drawtype = "plantlike", @@ -2783,13 +2561,13 @@ minetest.register_node("witchcraft:potion_silver", { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} }, - groups = {dig_immediate=3,attached_node=1, potion2=1}, + groups = {dig_immediate=3,attached_node=1, potion=1}, sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_silver.png", - on_use = function(item, user, pointed_thing) - playereffects.apply_effect_type("potion_silver", 15, user) - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, user, pointed_thing) + playereffects.apply_effect_type("potion_silver", 15, user) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -2809,109 +2587,109 @@ minetest.register_node("witchcraft:potion_silver_2", { 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) - playereffects.apply_effect_type("potion_silver", 60, user) - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, user, pointed_thing) + playereffects.apply_effect_type("potion_silver", 60, user) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) -if minetest.get_modpath("farming_redo") then -minetest.register_node("witchcraft:potion_green", { - description = "Melon Potion", - drawtype = "plantlike", - tiles = {"witchcraft_potion_green.png"}, - wield_image = "witchcraft_potion_green.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 = {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) - local player = user:get_player_name() - if pointed_thing.type == "node" and - minetest.get_node(pointed_thing.above).name == "air" then - if not minetest.is_protected(pointed_thing.above, player) then - minetest.set_node(pointed_thing.above, {name="farming:melon_8"}) - else - minetest.chat_send_player(player, "This area is protected.") +if minetest.get_modpath("farming") and farming.mod == "redo" then + minetest.register_node("witchcraft:potion_green", { + description = "Melon Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_green.png"}, + wield_image = "witchcraft_potion_green.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 = {dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_green.png", + on_use = function(itemstack, user, pointed_thing) + local player = user:get_player_name() + if pointed_thing.type == "node" and + minetest.get_node(pointed_thing.above).name == "air" then + if not minetest.is_protected(pointed_thing.above, player) then + minetest.set_node(pointed_thing.above, {name="farming:melon_8"}) + else + minetest.chat_send_player(player, "This area is protected.") + end end + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item - end -}) + }) else -minetest.register_node("witchcraft:potion_green", { - description = "Plant Potion (destructive!)", - drawtype = "plantlike", - tiles = {"witchcraft_potion_green.png"}, - wield_image = "witchcraft_potion_green.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 = {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) - local player = user:get_player_name() - if pointed_thing.type == "node" and - minetest.get_node(pointed_thing.above).name == "air" then - if not minetest.is_protected(pointed_thing.above, player) then - default.grow_new_jungle_tree(pointed_thing.above) - else - minetest.chat_send_player(player, "This area is protected.") + minetest.register_node("witchcraft:potion_green", { + description = "Plant Potion (destructive!)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_green.png"}, + wield_image = "witchcraft_potion_green.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 = {dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_green.png", + on_use = function(itemstack, user, pointed_thing) + local player = user:get_player_name() + if pointed_thing.type == "node" and + minetest.get_node(pointed_thing.above).name == "air" then + if not minetest.is_protected(pointed_thing.above, player) then + default.grow_new_jungle_tree(pointed_thing.above) + else + minetest.chat_send_player(player, "This area is protected.") + end end + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item - end -}) + }) end minetest.register_node("witchcraft:potion_gold", { @@ -2930,35 +2708,35 @@ minetest.register_node("witchcraft:potion_gold", { 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) + on_use = function(itemstack, user, pointed_thing) local player = user:get_player_name() if pointed_thing.type == "node" and - minetest.get_node(pointed_thing.above).name == "air" then + minetest.get_node(pointed_thing.above).name == "air" then if not minetest.is_protected(pointed_thing.above, player) then minetest.set_node(pointed_thing.above, {name="default:goldblock"}) else minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -2978,131 +2756,130 @@ minetest.register_node("witchcraft:potion_gold_2", { 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) + on_use = function(itemstack, user, pointed_thing) local player = user:get_player_name() if pointed_thing.type == "node" and - minetest.get_node(pointed_thing.above).name == "air" then + minetest.get_node(pointed_thing.above).name == "air" then if not minetest.is_protected(pointed_thing.above, player) then minetest.set_node(pointed_thing.above, {name="default:diamondblock"}) else minetest.chat_send_player(player, "This area is protected.") end end - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) - - if minetest.get_modpath("experience") then -minetest.register_node("witchcraft:potion_aqua", { - description = "Complex Potion", - drawtype = "plantlike", - tiles = {"witchcraft_potion_aqua.png"}, - wield_image = "witchcraft_potion_aqua.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 = {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) - local pos = placer:getpos(); - minetest.add_particlespawner( - 6, --amount - 0.1, --time - {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, --minpos - {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=2,z=-0.5}, --minacc - {x=0.5,y=2,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "orb.png" --texture - ) - minetest.env:add_entity(pos, "experience:orb") - minetest.env:add_entity(pos, "experience:orb") - minetest.env:add_entity(pos, "experience:orb") - minetest.env:add_entity(pos, "experience:orb") - minetest.env:add_entity(pos, "experience:orb") - - item:replace("vessels:glass_bottle") - return item - end -}) + minetest.register_node("witchcraft:potion_aqua", { + description = "Complex Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_aqua.png"}, + wield_image = "witchcraft_potion_aqua.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 = {dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_aqua.png", + on_use = function(itemstack, placer, pointed_thing) + local pos = placer:get_pos() + minetest.add_particlespawner({ + amount = 6, + time = 0.1, + minpos = {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, + maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=2,z=-0.5}, + maxacc = {x=0.5,y=2,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "orb.png" + }) + minetest.add_entity(pos, "experience:orb") + minetest.add_entity(pos, "experience:orb") + minetest.add_entity(pos, "experience:orb") + minetest.add_entity(pos, "experience:orb") + minetest.add_entity(pos, "experience:orb") + + itemstack:replace("vessels:glass_bottle") + return itemstack + end + }) else -minetest.register_node("witchcraft:potion_aqua", { - description = "Complex Potion", - drawtype = "plantlike", - tiles = {"witchcraft_potion_aqua.png"}, - wield_image = "witchcraft_potion_aqua.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 = {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) - local pos = placer:getpos(); - minetest.add_particlespawner( - 6, --amount - 0.1, --time - {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, --minpos - {x=pos.x+1, y=pos.y+1, z=pos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=2,z=-0.5}, --minacc - {x=0.5,y=2,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - minetest.add_item(pos, "default:steel_ingot") - minetest.add_item(pos, "witchcraft:herb") - minetest.add_item(pos, "default:mese_crystal") - minetest.add_item(pos, "default:gold_lump") - minetest.add_item(pos, "farming:bread") - minetest.add_item(pos, "default:copper_ingot") - - item:replace("vessels:glass_bottle") - return item - end -}) + minetest.register_node("witchcraft:potion_aqua", { + description = "Complex Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_aqua.png"}, + wield_image = "witchcraft_potion_aqua.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 = {dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_aqua.png", + on_use = function(itemstack, placer, pointed_thing) + local pos = placer:get_pos() + minetest.add_particlespawner({ + amount = 6, + time = 0.1, + minpos = {x=pos.x-1, y=pos.y+0.5, z=pos.z-1}, + maxpos = {x=pos.x+1, y=pos.y+1, z=pos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=2,z=-0.5}, + maxacc = {x=0.5,y=2,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + minetest.add_item(pos, "default:steel_ingot") + minetest.add_item(pos, "witchcraft:herb") + minetest.add_item(pos, "default:mese_crystal") + minetest.add_item(pos, "default:gold_lump") + minetest.add_item(pos, "farming:bread") + minetest.add_item(pos, "default:copper_ingot") + + itemstack:replace("vessels:glass_bottle") + return itemstack + end + }) +>>>>>>> upstream/master end minetest.register_node("witchcraft:potion_magenta", { @@ -3121,30 +2898,29 @@ minetest.register_node("witchcraft:potion_magenta", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_speed_lv1", 10, user) + playereffects.apply_effect_type("witchcraft:potion_speed_lv1", 10, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3164,30 +2940,29 @@ minetest.register_node("witchcraft:potion_magenta_2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_speed_lv2", 10, user) + playereffects.apply_effect_type("witchcraft:potion_speed_lv2", 10, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3207,29 +2982,29 @@ minetest.register_node("witchcraft:potion_cyan", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 10, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 10, user) + + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3249,28 +3024,28 @@ minetest.register_node("witchcraft:potion_gcyan", { 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) + on_use = function(itemstack, user, pointed_thing) local player = user:get_player_name() local breath_change = user:set_breath(12) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3290,29 +3065,28 @@ minetest.register_node("witchcraft:potion_cyan_2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 20, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_antigrav_lvx", 20, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3332,29 +3106,28 @@ minetest.register_node("witchcraft:potion_green2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 6, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 6, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3374,34 +3147,33 @@ minetest.register_node("witchcraft:potion_ggreen", { 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) - local player = user:get_player_name() - local playerpos = user:getpos(); - minetest.add_particlespawner( - 2000, --amount - 1, --time - {x=playerpos.x-20, y=playerpos.y-3, z=playerpos.z-20}, --minpos - {x=playerpos.x+20, y=playerpos.y+3, z=playerpos.z+20}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.1,y=0,z=-0.1}, --minacc - {x=0.1,y=0,z=0.1}, --maxacc - 5, --minexptime - 10, --maxexptime - 10, --minsize - 20, --maxsize - false, --collisiondetection - "witchcraft_pot_bottom.png^[colorize:black:200" --texture - ) - local mtime = minetest.get_timeofday() - if mtime >= 0.25 and mtime <= 0.75 then - user:override_day_night_ratio(-mtime+0.5) - minetest.after(10, function() - user:override_day_night_ratio(nil) - end) - end - item:replace("vessels:glass_bottle") - return item + on_use = function(itemstack, user, pointed_thing) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 2000, + time = 1, + minpos = {x=playerpos.x-20, y=playerpos.y-3, z=playerpos.z-20}, + maxpos = {x=playerpos.x+20, y=playerpos.y+3, z=playerpos.z+20}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.1,y=0,z=-0.1}, + maxacc = {x=0.1,y=0,z=0.1}, + minexptime = 5, + maxexptime = 10, + minsize = 10, + maxsize = 20, + collisiondetection = false, + texture = "witchcraft_pot_bottom.png^[colorize:black:200" + }) + local mtime = minetest.get_timeofday() + if mtime >= 0.25 and mtime <= 0.75 then + user:override_day_night_ratio(-mtime+0.5) + minetest.after(10, function() + user:override_day_night_ratio(nil) + end) + end + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3421,29 +3193,28 @@ minetest.register_node("witchcraft:potion_green2_2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 10, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_jump_lvx", 10, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3463,29 +3234,28 @@ minetest.register_node("witchcraft:potion_redbrown", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_slow_lv1", 11, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_slow_lv1", 11, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3505,29 +3275,28 @@ minetest.register_node("witchcraft:potion_redbrown_2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath_change = user:set_breath(5) - playereffects.apply_effect_type("witchcraft:potion_slow_lv2", 15, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + playereffects.apply_effect_type("witchcraft:potion_slow_lv2", 15, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3547,31 +3316,30 @@ minetest.register_node("witchcraft:potion_blue2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath = user:get_breath() - if breath <= 10 then - playereffects.apply_effect_type("witchcraft:potion_swim_lv1", 15, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item - end + if breath <= 10 then + playereffects.apply_effect_type("witchcraft:potion_swim_lv1", 15, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack + end end }) @@ -3591,31 +3359,30 @@ minetest.register_node("witchcraft:potion_blue2_2", { 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) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) local breath = user:get_breath() - if breath <= 10 then - playereffects.apply_effect_type("witchcraft:potion_swim_lv2", 15, user) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item - end + if breath <= 10 then + playereffects.apply_effect_type("witchcraft:potion_swim_lv2", 15, user) + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack + end end }) @@ -3624,10 +3391,10 @@ minetest.register_node("witchcraft:potion_blue2_2", { function lightchange(person, duration) local mtime = minetest.get_timeofday() if mtime <= 0.25 or mtime >= 0.75 then - person:override_day_night_ratio(mtime+0.5) - minetest.after(duration, function() - person:override_day_night_ratio(nil) - end) + person:override_day_night_ratio(mtime+0.5) + minetest.after(duration, function() + person:override_day_night_ratio(nil) + end) end end @@ -3644,31 +3411,30 @@ minetest.register_node("witchcraft:potion_yellow", { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} }, - groups = {dig_immediate=3,attached_node=1, potion2=1}, + groups = {dig_immediate=3,attached_node=1, potion=1}, sounds = default.node_sound_glass_defaults(), inventory_image = "witchcraft_potion_yellow.png", - on_use = function(item, user, pointed_thing) - local player = user:get_player_name() + on_use = function(itemstack, user, pointed_thing) lightchange(user, 10) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) @@ -3688,84 +3454,30 @@ minetest.register_node("witchcraft:potion_yellow_2", { 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) + on_use = function(itemstack, user, pointed_thing) lightchange(user, 20) - local playerpos = user:getpos(); - minetest.add_particlespawner( - 5, --amount - 0.1, --time - {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, --minpos - {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=4,z=-0.5}, --minacc - {x=0.5,y=4,z=0.5}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png" --texture - ) - item:replace("vessels:glass_bottle") - return item + local playerpos = user:get_pos() + minetest.add_particlespawner({ + amount = 5, + time = 0.1, + minpos = {x=playerpos.x-1, y=playerpos.y+1, z=playerpos.z-1}, + maxpos = {x=playerpos.x+1, y=playerpos.y+1, z=playerpos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=4,z=-0.5}, + maxacc = {x=0.5,y=4,z=0.5}, + minexptime = 0.5, + maxexptime = 1, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png" + }) + itemstack:replace("vessels:glass_bottle") + return itemstack end }) - ---invisibility potion by Tenplus1(DWTFYWT V2), see darkpurple potion for on_use effect - - -invisibility = {} - --- reset player invisibility if they go offline - -minetest.register_on_leaveplayer(function(player) - - local name = player:get_player_name() - - if invisibility[name] then - invisibility[name] = nil - end -end) - -invisible = function(player, toggle) - - if not player then return false end - - local name = player:get_player_name() - - invisibility[name] = toggle - - local prop - - if toggle == true then - - -- hide player and name tag - prop = { - visual_size = {x = 0, y = 0}, - collisionbox = {0, 0, 0, 0, 0, 0} - } - - player:set_nametag_attributes({ - color = {a = 0, r = 255, g = 255, b = 255} - }) - else - -- show player and tag - prop = { - visual_size = {x = 1, y = 1}, - collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35} - } - - player:set_nametag_attributes({ - color = {a = 255, r = 255, g = 255, b = 255} - }) - end - - player:set_properties(prop) - -end - --decorative nodes minetest.register_node("witchcraft:mortar", { @@ -3811,7 +3523,7 @@ minetest.register_node("witchcraft:pentagram", { visual_scale = 3.0, tiles = {"witchcraft_pentagram.png"}, inventory_image = "witchcraft_pentagram.png", - use_texture_alpha = true, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = false, @@ -3823,26 +3535,26 @@ minetest.register_node("witchcraft:pentagram", { fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} }, on_rightclick = function(pos, node, _) - if minetest.get_modpath("mobs") then - minetest.after(0.5, function() - minetest.set_node(pos, {name="witchcraft:portal", param2=node.param2}) - minetest.add_particlespawner( - 25, --amount - 1, --time - {x=pos.x-1, y=pos.y, z=pos.z-1}, --minpos - {x=pos.x+1, y=pos.y, z=pos.z+1}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=-0.5,y=1,z=-0.5}, --minacc - {x=0.5,y=1,z=0.5}, --maxacc - 1, --minexptime - 1.5, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_effect.png^[colorize:green:400" --texture - ) - end) + if minetest.get_modpath("mobs") then + minetest.after(0.5, function() + minetest.set_node(pos, {name="witchcraft:portal", param2=node.param2}) + minetest.add_particlespawner({ + amount = 25, + time = 1, + minpos = {x=pos.x-1, y=pos.y, z=pos.z-1}, + maxpos = {x=pos.x+1, y=pos.y, z=pos.z+1}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=-0.5,y=1,z=-0.5}, + maxacc = {x=0.5,y=1,z=0.5}, + minexptime = 1, + maxexptime = 1.5, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_effect.png^[colorize:green:400" + }) + end) end end, groups = {cracky=3,dig_immediate=3}, @@ -3854,7 +3566,7 @@ minetest.register_node("witchcraft:portal", { visual_scale = 3.0, tiles = {"witchcraft_portal.png"}, inventory_image = "witchcraft_portal.png", - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = false, @@ -3867,18 +3579,24 @@ minetest.register_node("witchcraft:portal", { }, on_construct = function(pos, node, _) minetest.after(1, function() - if minetest.get_modpath("horror") then - minetest.env:add_entity(pos, "horror:werewolf") - elseif minetest.get_modpath("dmobs") then - minetest.env:add_entity(pos, "dmobs:owl") - elseif minetest.get_modpath("mobs_animal") then - minetest.env:add_entity(pos, "mobs_animal:kitten") - elseif minetest.get_modpath("mobs_monster") then - minetest.env:add_entity(pos, "mobs_monster:oerkki") - elseif minetest.get_modpath("pmobs") then - minetest.env:add_entity(pos, "pmobs:wolf") - end - minetest.remove_node(pos) + if minetest.get_modpath("mobs_animal") and minetest.get_modpath("mobs_monster") then + if math.random(2) > 1 then + minetest.add_entity(pos, "mobs_monster:oerkki") + else + minetest.add_entity(pos, "mobs_animal:kitten") + end + elseif minetest.get_modpath("horror") then + minetest.add_entity(pos, "horror:werewolf") + elseif minetest.get_modpath("dmobs") then + minetest.add_entity(pos, "dmobs:owl") + elseif minetest.get_modpath("mobs_animal") then + minetest.add_entity(pos, "mobs_animal:kitten") + elseif minetest.get_modpath("mobs_monster") then + minetest.add_entity(pos, "mobs_monster:oerkki") + elseif minetest.get_modpath("pmobs") then + minetest.add_entity(pos, "pmobs:wolf") + end + minetest.remove_node(pos) end) end, groups = {cracky=3,dig_immediate=3, not_in_creative_inventory=1}, diff --git a/scrolls.lua b/scrolls.lua index 7b6b2f0..c18137a 100644 --- a/scrolls.lua +++ b/scrolls.lua @@ -1,426 +1,412 @@ --scrolls - minetest.register_craftitem("witchcraft:scroll_day", { - description = "Scroll of day", - inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png", - stack_max = 1, - on_use = function(item) - minetest.set_timeofday(0.5) - item:take_item() - return item - end, + description = "Scroll of day", + inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png", + stack_max = 1, + on_use = function(item) + minetest.set_timeofday(0.5) + item:take_item() + return item + end, }) minetest.register_craftitem("witchcraft:scroll_night", { - description = "Scroll of night", - inventory_image = "witchcraft_scroll.png^witchcraft_moon_over.png", - stack_max = 1, - on_use = function(item) - minetest.set_timeofday(0) - item:take_item() - return item - end, + description = "Scroll of night", + inventory_image = "witchcraft_scroll.png^witchcraft_moon_over.png", + stack_max = 1, + on_use = function(item) + minetest.set_timeofday(0) + item:take_item() + return item + end, }) if minetest.get_modpath("pmobs")then -minetest.register_craftitem("witchcraft:scroll_wild", { - description = "Scroll of Wild", - inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png", - stack_max = 1, - on_use = function(item, placer) - local pos = placer:getpos(); - minetest.env:add_entity(pos, "pmobs:dog") - item:take_item() - return item - end, -}) + minetest.register_craftitem("witchcraft:scroll_wild", { + description = "Scroll of Wild", + inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png", + stack_max = 1, + on_use = function(item, placer) + local pos = placer:get_pos() + minetest.add_entity(pos, "pmobs:dog") + item:take_item() + return item + end, + }) end minetest.register_craftitem("witchcraft:scroll_fireball", { - description = "Scroll of fireball", - inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png", - stack_max = 1, - on_use = function(item, placer, pos) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - local obj3 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - local obj4 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball") - obj2:setvelocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5}) - obj3:setvelocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5}) - obj4:setvelocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7}) - obj:setvelocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7}) - item:take_item() - return item - end, + description = "Scroll of fireball", + inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png", + stack_max = 1, + on_use = function(item, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local entities = {} + for i=1,4 do + entities[i] = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:fireball") + end + entities[2]:set_velocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5}) + entities[3]:set_velocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5}) + entities[4]:set_velocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7}) + entities[1]:set_velocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7}) + item:take_item() + return item + end, }) if minetest.get_modpath("lightning") then -minetest.register_craftitem("witchcraft:scroll_lightning", { - description = "Scroll of lightning", - inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png", - stack_max = 1, - on_use = function(item, placer, pos) - local playerpos = placer:getpos(); - local dir = placer:get_look_dir(); - lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2}) - item:take_item() - return item - end, -}) + minetest.register_craftitem("witchcraft:scroll_lightning", { + description = "Scroll of lightning", + inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png", + stack_max = 1, + on_use = function(item, placer, pointed_thing) + local playerpos = placer:get_pos() + local dir = placer:get_look_dir() + lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2}) + item:take_item() + return item + end, + }) end minetest.register_craftitem("witchcraft:scroll_icicle", { - description = "Scroll of icicle", - inventory_image = "witchcraft_scroll.png^witchcraft_ice_over.png", - stack_max = 1, - on_use = function(item, placer, pos) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") - local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+1+dir.z}, "witchcraft:ice") - local obj3 = minetest.env:add_entity({x=playerpos.x+1+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice") - obj:setvelocity(vec) - obj2:setvelocity(vec) - obj3:setvelocity(vec) - - item:take_item() - return item - end, + description = "Scroll of icicle", + inventory_image = "witchcraft_scroll.png^witchcraft_ice_over.png", + stack_max = 1, + on_use = function(item, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} + local obj = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:ice") + local obj2 = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+1+dir.z + }, "witchcraft:ice") + local obj3 = minetest.add_entity({ + x=playerpos.x+1+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:ice") + obj:set_velocity(vec) + obj2:set_velocity(vec) + obj3:set_velocity(vec) + item:take_item() + return item + end, }) - minetest.register_craftitem("witchcraft:scroll_nature", { - description = "Scroll of nature", - inventory_image = "witchcraft_scroll.png^witchcraft_leaf_over.png", - stack_max = 1, - on_use = function(item, placer, pos) - local dir = placer:get_look_dir(); - local playerpos = placer:getpos(); - local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6} - local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree") - obj:setvelocity(vec) - - item:take_item() - return item - end, + description = "Scroll of nature", + inventory_image = "witchcraft_scroll.png^witchcraft_leaf_over.png", + stack_max = 1, + on_use = function(item, placer, pointed_thing) + local dir = placer:get_look_dir() + local playerpos = placer:get_pos() + local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6} + local obj = minetest.add_entity({ + x=playerpos.x+dir.x*1.5, + y=playerpos.y+1.5+dir.y, + z=playerpos.z+0+dir.z + }, "witchcraft:tree") + obj:set_velocity(vec) + item:take_item() + return item + end, }) minetest.register_craftitem("witchcraft:scroll", { - description = "Blank Scroll", - inventory_image = "witchcraft_scroll.png", + description = "Blank Scroll", + inventory_image = "witchcraft_scroll.png", }) minetest.register_craftitem("witchcraft:scroll_recipe", { - description = "Recipe Scroll", - inventory_image = "witchcraft_scroll.png^witchcraft_writing_over.png", - on_use = function(itemstack, user, pointed_thing) - - local formspec = "size[10,9]".. - "background[-0.6,-0.5;11.5,10.4;witchcraft_recipes.png]"; - - minetest.show_formspec(user:get_player_name(), "witchcraft:scroll", formspec); - - end, + description = "Recipe Scroll", + inventory_image = "witchcraft_scroll.png^witchcraft_writing_over.png", + on_use = function(itemstack, user, pointed_thing) + local formspec = "size[10,9]".. + "background[-0.6,-0.5;11.5,10.4;witchcraft_recipes.png]" + minetest.show_formspec(user:get_player_name(), "witchcraft:scroll", formspec) + end, }) if minetest.get_modpath("pmobs")then -minetest.register_craft({ - output = 'witchcraft:scroll_wild', - recipe = { - {'mobs:meat_raw'}, - {'witchcraft:scroll'}, - } -}) - + minetest.register_craft({ + output = 'witchcraft:scroll_wild', + recipe = { + {'mobs:meat_raw'}, + {'witchcraft:scroll'}, + } + }) end minetest.register_craft({ - output = 'witchcraft:scroll', - recipe = { - {'default:paper', 'default:paper', ''}, - {'default:paper', 'default:paper', ''}, - } + output = 'witchcraft:scroll', + recipe = { + {'default:paper', 'default:paper', ''}, + {'default:paper', 'default:paper', ''}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_recipe', - recipe = { - {'dye:black'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_recipe', + recipe = { + {'dye:black'}, + {'witchcraft:scroll'}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_icicle', - recipe = { - {'default:ice'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_icicle', + recipe = { + {'default:ice'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_fireball', - recipe = { - {'default:obsidian_shard'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_fireball', + recipe = { + {'default:obsidian_shard'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_nature', - recipe = { - {'default:leaves'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_nature', + recipe = { + {'default:leaves'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_day', - recipe = { - {'default:torch'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_day', + recipe = { + {'default:torch'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) minetest.register_craft({ - output = 'witchcraft:scroll_night', - recipe = { - {'default:coal_lump'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_night', + recipe = { + {'default:coal_lump'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) - minetest.register_craft({ - output = 'witchcraft:scroll_lightning', - recipe = { - {'default:steel_ingot'}, - {'default:diamond'}, - {'witchcraft:scroll'}, - } + output = 'witchcraft:scroll_lightning', + recipe = { + {'default:steel_ingot'}, + {'default:diamond'}, + {'witchcraft:scroll'}, + } }) - --scroll powers minetest.register_entity("witchcraft:fireball", { - textures = {"tnt_boom.png"}, - velocity = 0.1, - damage = 2, - collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() - self.object:remove() - end) - local pos = self.object:getpos() - 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=3}, - }, nil) + textures = {"tnt_boom.png"}, + velocity = 0.1, + damage = 2, + collisionbox = {0, 0, 0, 0, 0, 0}, + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() + end) + local pos = self.object:get_pos() + 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() 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}, + }, nil) + self.object:remove() + return end end end for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" 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() - return - end - end + for dy=0,1 do + for dz=0,1 do + 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.get_node(p).name + if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" then + if minetest.registered_nodes[n].groups.flammable then + minetest.set_node(t, {name="fire:basic_flame"}) + self.object:remove() + return end end end - hit_node = function(self, pos, node) --- local pos = self.object:getpos() - for dx=-4,4 do - for dy=-4,4 do - for dz=-4,4 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - local n = minetest.env:get_node(pos).name - if math.random(1, 50) <= 35 then - minetest.env:remove_node(p) - end - if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then - minetest.env:set_node(t, {name="fire:basic_flame"}) - end end end - end - end - local apos = self.object:getpos() - local vec = self.object:getvelocity() - local part = minetest.add_particlespawner( - 6, --amount - 0.3, --time - {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos - {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=-vec.x,y=-vec.y,z=-vec.z}, --maxacc - 0.1, --minexptime - 0.3, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_flame.png" --texture - ) - - end, + local vec = self.object:get_velocity() + minetest.add_particlespawner({ + amount = 6, + time = 0.3, + minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3}, + maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=-vec.x,y=-vec.y,z=-vec.z}, + minexptime = 0.1, + maxexptime = 0.3, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_flame.png" + }) + end, }) - - minetest.register_entity("witchcraft:tree", { - textures = {"witchcraft_skin.png"}, - velocity = 1, - damage = 2, - collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(2, function() - self.object:remove() - end) - local pos = self.object:getpos() - 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:remove() - local treepos = self.object:getpos() - default.grow_new_jungle_tree(treepos) + textures = {"witchcraft_skin.png"}, + velocity = 1, + damage = 2, + collisionbox = {0, 0, 0, 0, 0, 0}, + on_step = function(self, obj, pos) + local remove = minetest.after(2, function() self.object:remove() + end) + local pos = self.object:get_pos() + 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() 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() + default.grow_new_jungle_tree(pos) + self.object:remove() + return end end end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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" and n ~= "gauges:hp_bar" then - local treepos = self.object:getpos() - default.grow_new_jungle_tree(treepos) - self.object:remove() - elseif n == "default:wood" or n =="default:tree" or n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then - self.hit_node(self, pos, node) - self.object:remove() - return - end - end - end - end - hit_node = function(self, pos, node) - local treepos = self.object:getpos() - default.grow_new_jungle_tree(treepos) - end + + local n = minetest.get_node(pos).name + if n ~= "witchcraft:tree" and n ~="air" then + default.grow_new_jungle_tree(pos) + self.object:remove() + end - local apos = self.object:getpos() - local part = minetest.add_particlespawner( - 6, --amount - 0.3, --time - {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos - {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0.5,y=0.5,z=0.5}, --maxacc - 0.1, --minexptime - 0.3, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "witchcraft_leaf_over.png" --texture - ) - - end, + minetest.add_particlespawner({ + amount = 6, + time = 0.3, + minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3}, + maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=0.5,y=0.5,z=0.5}, + minexptime = 0.1, + maxexptime = 0.3, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_leaf_over.png" + }) + end, }) minetest.register_entity("witchcraft:ice", { - visual="sprite", - visual_size={x=1,y=1}, - physical=false, - textures={"witchcraft_ice.png"}, - velocity = 1, - rotate = 90, - auto_rotate = true, - damage = 2, - collisionbox = {0, 0, 0, 0, 0, 0}, - on_step = function(self, obj, pos) - local remove = minetest.after(10, function() - self.object:remove() - end) - local pos = self.object:getpos() - local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) + visual="sprite", + visual_size={x=1,y=1}, + physical=false, + textures={"witchcraft_ice.png"}, + velocity = 1, + rotate = 90, + auto_rotate = true, + damage = 2, + collisionbox = {0, 0, 0, 0, 0, 0}, + on_step = function(self, obj, pos) + local remove = minetest.after(10, function() + self.object:remove() + end) + local pos = self.object:get_pos() + 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" and obj:get_luaentity().name ~= "gauges:hp_bar" then - obj:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups={fleshy=1}, - }, nil) - self.object:remove() - end - end - for dx=0,1 do - for dy=0,1 do - for dz=0,1 do - 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 == "default:water_source" or n =="default:river_water_source" then - local pos = self.object:getpos() - minetest.set_node(pos, {name="default:ice"}) - self.object:remove() - 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() - return - end - end - end + 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}, + }, nil) + self.object:remove() + return end + end + end + + local velo = self.object:get_velocity() + local hit = { + { p = {x=pos.x+1, y=pos.y, z=pos.z}, + v = {x=math.abs(velo.x)*-1, y=velo.y, z=velo.z}}, -- x + { p = {x=pos.x-1, y=pos.y, z=pos.z}, + v = {x=math.abs(velo.x), y=velo.y, z=velo.z}}, + { p = {x=pos.x, y=pos.y+1, z=pos.z}, + v = {x=velo.x, y=math.abs(velo.y)*-1, z=velo.z}}, -- y + { p = {x=pos.x, y=pos.y-1, z=pos.z}, + v = {x=velo.x, y=math.abs(velo.y), z=velo.z}}, + { p = {x=pos.x, y=pos.y, z=pos.z+1}, + v = {x=velo.x, y=velo.y, z=math.abs(velo.z)*-1}}, -- z + { p = {x=pos.x, y=pos.y, z=pos.z-1}, + v = {x=velo.x, y=velo.y, z=math.abs(velo.z)}} + } - local apos = self.object:getpos() - local part = minetest.add_particlespawner( - 10, --amount - 0.3, --time - {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos - {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos - {x=-0, y=-0, z=-0}, --minvel - {x=0, y=0, z=0}, --maxvel - {x=0,y=-0.5,z=0}, --minacc - {x=0.5,y=0.5,z=0.5}, --maxacc - 0.1, --minexptime - 0.3, --maxexptime - 0.2, --minsize - 0.5, --maxsize - false, --collisiondetection - "witchcraft_light_over.png" --texture - ) - end - end + for _,h in pairs(hit) do + local n = minetest.get_node(h.p).name + if n ~= "air" and n~= "witchcraft:ice" then + if n == "default:water_source" or n =="default:river_water_source" then + minetest.set_node(h.p, {name="default:ice"}) + h.v.y = 0 + end + self.object:set_velocity(h.v) + break + end + end + + minetest.add_particlespawner({ + amount = 10, + time = 0.3, + minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3}, + maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, + minvel = {x=-0, y=-0, z=-0}, + maxvel = {x=0, y=0, z=0}, + minacc = {x=0,y=-0.5,z=0}, + maxacc = {x=0.5,y=0.5,z=0.5}, + minexptime = 0.1, + maxexptime = 0.3, + minsize = 0.2, + maxsize = 0.5, + collisiondetection = false, + texture = "witchcraft_light_over.png" + }) + end }) diff --git a/textures/vessels_shelf_overlay.png b/textures/vessels_shelf_overlay.png index 8cd17c7..0030d0a 100644 Binary files a/textures/vessels_shelf_overlay.png and b/textures/vessels_shelf_overlay.png differ diff --git a/textures/witchcraft_bone.png b/textures/witchcraft_bone.png index c7b9eef..3c1fb08 100644 Binary files a/textures/witchcraft_bone.png and b/textures/witchcraft_bone.png differ diff --git a/textures/witchcraft_bone_bottle.png b/textures/witchcraft_bone_bottle.png index d02e6cd..89ad962 100644 Binary files a/textures/witchcraft_bone_bottle.png and b/textures/witchcraft_bone_bottle.png differ diff --git a/textures/witchcraft_brewing_stand_inv.png b/textures/witchcraft_brewing_stand_inv.png index b7ab8e3..781e3b1 100644 Binary files a/textures/witchcraft_brewing_stand_inv.png and b/textures/witchcraft_brewing_stand_inv.png differ diff --git a/textures/witchcraft_brewing_stand_side.png b/textures/witchcraft_brewing_stand_side.png index f6b2889..b7d1c3d 100644 Binary files a/textures/witchcraft_brewing_stand_side.png and b/textures/witchcraft_brewing_stand_side.png differ diff --git a/textures/witchcraft_brewing_stand_top.png b/textures/witchcraft_brewing_stand_top.png index a6df854..dd0062e 100644 Binary files a/textures/witchcraft_brewing_stand_top.png and b/textures/witchcraft_brewing_stand_top.png differ diff --git a/textures/witchcraft_bubble.png b/textures/witchcraft_bubble.png index ec5d31e..8d35ee2 100644 Binary files a/textures/witchcraft_bubble.png and b/textures/witchcraft_bubble.png differ diff --git a/textures/witchcraft_bubbles.png b/textures/witchcraft_bubbles.png index aeb551c..183c30d 100644 Binary files a/textures/witchcraft_bubbles.png and b/textures/witchcraft_bubbles.png differ diff --git a/textures/witchcraft_bubbles_pink.png b/textures/witchcraft_bubbles_pink.png index 9d242dc..45c34ff 100644 Binary files a/textures/witchcraft_bubbles_pink.png and b/textures/witchcraft_bubbles_pink.png differ diff --git a/textures/witchcraft_candle_top.png b/textures/witchcraft_candle_top.png index 0a83643..5fa2950 100644 Binary files a/textures/witchcraft_candle_top.png and b/textures/witchcraft_candle_top.png differ diff --git a/textures/witchcraft_dark_over.png b/textures/witchcraft_dark_over.png index d050524..7250850 100644 Binary files a/textures/witchcraft_dark_over.png and b/textures/witchcraft_dark_over.png differ diff --git a/textures/witchcraft_herb_bottle.png b/textures/witchcraft_herb_bottle.png index fd7e287..79301ca 100644 Binary files a/textures/witchcraft_herb_bottle.png and b/textures/witchcraft_herb_bottle.png differ diff --git a/textures/witchcraft_herbs.png b/textures/witchcraft_herbs.png index 9672acd..693a609 100644 Binary files a/textures/witchcraft_herbs.png and b/textures/witchcraft_herbs.png differ diff --git a/textures/witchcraft_horn.png b/textures/witchcraft_horn.png index 8bfb9d3..7d5fa57 100644 Binary files a/textures/witchcraft_horn.png and b/textures/witchcraft_horn.png differ diff --git a/textures/witchcraft_ice.png b/textures/witchcraft_ice.png index 72e9a85..5d93268 100644 Binary files a/textures/witchcraft_ice.png and b/textures/witchcraft_ice.png differ diff --git a/textures/witchcraft_ice_over.png b/textures/witchcraft_ice_over.png index 46cdba7..0ca0bed 100644 Binary files a/textures/witchcraft_ice_over.png and b/textures/witchcraft_ice_over.png differ diff --git a/textures/witchcraft_jar_eyes.png b/textures/witchcraft_jar_eyes.png index 93995e1..08685bf 100644 Binary files a/textures/witchcraft_jar_eyes.png and b/textures/witchcraft_jar_eyes.png differ diff --git a/textures/witchcraft_jar_slime.png b/textures/witchcraft_jar_slime.png index b307bd5..382aa78 100644 Binary files a/textures/witchcraft_jar_slime.png and b/textures/witchcraft_jar_slime.png differ diff --git a/textures/witchcraft_launcher.png b/textures/witchcraft_launcher.png index 7209ec5..83f9160 100644 Binary files a/textures/witchcraft_launcher.png and b/textures/witchcraft_launcher.png differ diff --git a/textures/witchcraft_leaf_over.png b/textures/witchcraft_leaf_over.png index a8fccf5..0636749 100644 Binary files a/textures/witchcraft_leaf_over.png and b/textures/witchcraft_leaf_over.png differ diff --git a/textures/witchcraft_medicine_bottle.png b/textures/witchcraft_medicine_bottle.png index 5c3b7bd..c7d12c8 100644 Binary files a/textures/witchcraft_medicine_bottle.png and b/textures/witchcraft_medicine_bottle.png differ diff --git a/textures/witchcraft_mud_bottle.png b/textures/witchcraft_mud_bottle.png index 3ebaae5..2099e14 100644 Binary files a/textures/witchcraft_mud_bottle.png and b/textures/witchcraft_mud_bottle.png differ diff --git a/textures/witchcraft_penta.png b/textures/witchcraft_penta.png index bb87930..7e4a1f1 100644 Binary files a/textures/witchcraft_penta.png and b/textures/witchcraft_penta.png differ diff --git a/textures/witchcraft_pentablock.png b/textures/witchcraft_pentablock.png index 68c1826..7a60248 100644 Binary files a/textures/witchcraft_pentablock.png and b/textures/witchcraft_pentablock.png differ diff --git a/textures/witchcraft_pentagram.png b/textures/witchcraft_pentagram.png index 761e0b0..ee6a56d 100644 Binary files a/textures/witchcraft_pentagram.png and b/textures/witchcraft_pentagram.png differ diff --git a/textures/witchcraft_portal.png b/textures/witchcraft_portal.png index 9da6026..6cfe27e 100644 Binary files a/textures/witchcraft_portal.png and b/textures/witchcraft_portal.png differ diff --git a/textures/witchcraft_pot_aqua.png b/textures/witchcraft_pot_aqua.png index 31f0459..76e7cc2 100644 Binary files a/textures/witchcraft_pot_aqua.png and b/textures/witchcraft_pot_aqua.png differ diff --git a/textures/witchcraft_pot_blue.png b/textures/witchcraft_pot_blue.png index fc6eb8e..0e41f67 100644 Binary files a/textures/witchcraft_pot_blue.png and b/textures/witchcraft_pot_blue.png differ diff --git a/textures/witchcraft_pot_blue2.png b/textures/witchcraft_pot_blue2.png index 6b43a87..d879b3f 100644 Binary files a/textures/witchcraft_pot_blue2.png and b/textures/witchcraft_pot_blue2.png differ diff --git a/textures/witchcraft_pot_bottom.png b/textures/witchcraft_pot_bottom.png index e927dda..47ee0cb 100644 Binary files a/textures/witchcraft_pot_bottom.png and b/textures/witchcraft_pot_bottom.png differ diff --git a/textures/witchcraft_pot_brown.png b/textures/witchcraft_pot_brown.png index 0b0919d..e216b41 100644 Binary files a/textures/witchcraft_pot_brown.png and b/textures/witchcraft_pot_brown.png differ diff --git a/textures/witchcraft_pot_cyan.png b/textures/witchcraft_pot_cyan.png index 1f4d759..8db606c 100644 Binary files a/textures/witchcraft_pot_cyan.png and b/textures/witchcraft_pot_cyan.png differ diff --git a/textures/witchcraft_pot_darkpurple.png b/textures/witchcraft_pot_darkpurple.png index c2ceb4d..e005e47 100644 Binary files a/textures/witchcraft_pot_darkpurple.png and b/textures/witchcraft_pot_darkpurple.png differ diff --git a/textures/witchcraft_pot_gcyan.png b/textures/witchcraft_pot_gcyan.png index 5a900dc..5b200d3 100644 Binary files a/textures/witchcraft_pot_gcyan.png and b/textures/witchcraft_pot_gcyan.png differ diff --git a/textures/witchcraft_pot_ggreen.png b/textures/witchcraft_pot_ggreen.png index 3976c4c..12ac13c 100644 Binary files a/textures/witchcraft_pot_ggreen.png and b/textures/witchcraft_pot_ggreen.png differ diff --git a/textures/witchcraft_pot_gold.png b/textures/witchcraft_pot_gold.png index ce85062..42247e5 100644 Binary files a/textures/witchcraft_pot_gold.png and b/textures/witchcraft_pot_gold.png differ diff --git a/textures/witchcraft_pot_gpurple.png b/textures/witchcraft_pot_gpurple.png index a1c55d6..4078441 100644 Binary files a/textures/witchcraft_pot_gpurple.png and b/textures/witchcraft_pot_gpurple.png differ diff --git a/textures/witchcraft_pot_gred.png b/textures/witchcraft_pot_gred.png index 4b8fa71..95d3560 100644 Binary files a/textures/witchcraft_pot_gred.png and b/textures/witchcraft_pot_gred.png differ diff --git a/textures/witchcraft_pot_green.png b/textures/witchcraft_pot_green.png index 4551647..f0896e7 100644 Binary files a/textures/witchcraft_pot_green.png and b/textures/witchcraft_pot_green.png differ diff --git a/textures/witchcraft_pot_green2.png b/textures/witchcraft_pot_green2.png index 4e920d5..23712ba 100644 Binary files a/textures/witchcraft_pot_green2.png and b/textures/witchcraft_pot_green2.png differ diff --git a/textures/witchcraft_pot_grey.png b/textures/witchcraft_pot_grey.png index 5c82af5..b47db2d 100644 Binary files a/textures/witchcraft_pot_grey.png and b/textures/witchcraft_pot_grey.png differ diff --git a/textures/witchcraft_pot_magenta.png b/textures/witchcraft_pot_magenta.png index db9c160..36a6c4a 100644 Binary files a/textures/witchcraft_pot_magenta.png and b/textures/witchcraft_pot_magenta.png differ diff --git a/textures/witchcraft_pot_orange.png b/textures/witchcraft_pot_orange.png index 87f1ce6..1015927 100644 Binary files a/textures/witchcraft_pot_orange.png and b/textures/witchcraft_pot_orange.png differ diff --git a/textures/witchcraft_pot_purple.png b/textures/witchcraft_pot_purple.png index 83481ea..cdd6857 100644 Binary files a/textures/witchcraft_pot_purple.png and b/textures/witchcraft_pot_purple.png differ diff --git a/textures/witchcraft_pot_red.png b/textures/witchcraft_pot_red.png index 52b1336..d6103d0 100644 Binary files a/textures/witchcraft_pot_red.png and b/textures/witchcraft_pot_red.png differ diff --git a/textures/witchcraft_pot_redbrown.png b/textures/witchcraft_pot_redbrown.png index 935dfae..b000842 100644 Binary files a/textures/witchcraft_pot_redbrown.png and b/textures/witchcraft_pot_redbrown.png differ diff --git a/textures/witchcraft_pot_side.png b/textures/witchcraft_pot_side.png index 6bf3474..4f02576 100644 Binary files a/textures/witchcraft_pot_side.png and b/textures/witchcraft_pot_side.png differ diff --git a/textures/witchcraft_pot_silver.png b/textures/witchcraft_pot_silver.png index acfc636..fac5b33 100644 Binary files a/textures/witchcraft_pot_silver.png and b/textures/witchcraft_pot_silver.png differ diff --git a/textures/witchcraft_pot_top.png b/textures/witchcraft_pot_top.png index dc931ab..ab1cde3 100644 Binary files a/textures/witchcraft_pot_top.png and b/textures/witchcraft_pot_top.png differ diff --git a/textures/witchcraft_pot_yellow.png b/textures/witchcraft_pot_yellow.png index 6bc1e2d..bb127a1 100644 Binary files a/textures/witchcraft_pot_yellow.png and b/textures/witchcraft_pot_yellow.png differ diff --git a/textures/witchcraft_pot_yllwgrn.png b/textures/witchcraft_pot_yllwgrn.png index bf50356..a4216f7 100644 Binary files a/textures/witchcraft_pot_yllwgrn.png and b/textures/witchcraft_pot_yllwgrn.png differ diff --git a/textures/witchcraft_potion_aqua.png b/textures/witchcraft_potion_aqua.png index d996e8c..144b8fc 100644 Binary files a/textures/witchcraft_potion_aqua.png and b/textures/witchcraft_potion_aqua.png differ diff --git a/textures/witchcraft_potion_blue.png b/textures/witchcraft_potion_blue.png index 849bb30..6367354 100644 Binary files a/textures/witchcraft_potion_blue.png and b/textures/witchcraft_potion_blue.png differ diff --git a/textures/witchcraft_potion_blue2.png b/textures/witchcraft_potion_blue2.png index c898c21..701259c 100644 Binary files a/textures/witchcraft_potion_blue2.png and b/textures/witchcraft_potion_blue2.png differ diff --git a/textures/witchcraft_potion_brown.png b/textures/witchcraft_potion_brown.png index a75a32c..9a52994 100644 Binary files a/textures/witchcraft_potion_brown.png and b/textures/witchcraft_potion_brown.png differ diff --git a/textures/witchcraft_potion_cyan.png b/textures/witchcraft_potion_cyan.png index bd791ee..c0d4392 100644 Binary files a/textures/witchcraft_potion_cyan.png and b/textures/witchcraft_potion_cyan.png differ diff --git a/textures/witchcraft_potion_darkpurple.png b/textures/witchcraft_potion_darkpurple.png index e655706..ec3ce1d 100644 Binary files a/textures/witchcraft_potion_darkpurple.png and b/textures/witchcraft_potion_darkpurple.png differ diff --git a/textures/witchcraft_potion_gcyan.png b/textures/witchcraft_potion_gcyan.png index d9e00f8..921110f 100644 Binary files a/textures/witchcraft_potion_gcyan.png and b/textures/witchcraft_potion_gcyan.png differ diff --git a/textures/witchcraft_potion_ggreen.png b/textures/witchcraft_potion_ggreen.png index f3c7b80..122de75 100644 Binary files a/textures/witchcraft_potion_ggreen.png and b/textures/witchcraft_potion_ggreen.png differ diff --git a/textures/witchcraft_potion_gold.png b/textures/witchcraft_potion_gold.png index 3ca1cc9..4d4d84c 100644 Binary files a/textures/witchcraft_potion_gold.png and b/textures/witchcraft_potion_gold.png differ diff --git a/textures/witchcraft_potion_gpurple.png b/textures/witchcraft_potion_gpurple.png index 180bc3b..7720382 100644 Binary files a/textures/witchcraft_potion_gpurple.png and b/textures/witchcraft_potion_gpurple.png differ diff --git a/textures/witchcraft_potion_gred.png b/textures/witchcraft_potion_gred.png index 803a348..407d795 100644 Binary files a/textures/witchcraft_potion_gred.png and b/textures/witchcraft_potion_gred.png differ diff --git a/textures/witchcraft_potion_green.png b/textures/witchcraft_potion_green.png index f153d6d..24937ba 100644 Binary files a/textures/witchcraft_potion_green.png and b/textures/witchcraft_potion_green.png differ diff --git a/textures/witchcraft_potion_green2.png b/textures/witchcraft_potion_green2.png index 6a0b3a8..9d32907 100644 Binary files a/textures/witchcraft_potion_green2.png and b/textures/witchcraft_potion_green2.png differ diff --git a/textures/witchcraft_potion_grey.png b/textures/witchcraft_potion_grey.png index 0e2924d..43b55b2 100644 Binary files a/textures/witchcraft_potion_grey.png and b/textures/witchcraft_potion_grey.png differ diff --git a/textures/witchcraft_potion_magenta.png b/textures/witchcraft_potion_magenta.png index c69bab7..4dbefde 100644 Binary files a/textures/witchcraft_potion_magenta.png and b/textures/witchcraft_potion_magenta.png differ diff --git a/textures/witchcraft_potion_orange.png b/textures/witchcraft_potion_orange.png index 2f50d6d..3546b91 100644 Binary files a/textures/witchcraft_potion_orange.png and b/textures/witchcraft_potion_orange.png differ diff --git a/textures/witchcraft_potion_purple.png b/textures/witchcraft_potion_purple.png index 22ce8e8..1fdfc5f 100644 Binary files a/textures/witchcraft_potion_purple.png and b/textures/witchcraft_potion_purple.png differ diff --git a/textures/witchcraft_potion_red.png b/textures/witchcraft_potion_red.png index 5a7e586..54fa37a 100644 Binary files a/textures/witchcraft_potion_red.png and b/textures/witchcraft_potion_red.png differ diff --git a/textures/witchcraft_potion_redbrown.png b/textures/witchcraft_potion_redbrown.png index 3040647..5957456 100644 Binary files a/textures/witchcraft_potion_redbrown.png and b/textures/witchcraft_potion_redbrown.png differ diff --git a/textures/witchcraft_potion_silver.png b/textures/witchcraft_potion_silver.png index 063b1cb..ea280a5 100644 Binary files a/textures/witchcraft_potion_silver.png and b/textures/witchcraft_potion_silver.png differ diff --git a/textures/witchcraft_potion_yellgrn.png b/textures/witchcraft_potion_yellgrn.png index 9df3d0a..800bcf0 100644 Binary files a/textures/witchcraft_potion_yellgrn.png and b/textures/witchcraft_potion_yellgrn.png differ diff --git a/textures/witchcraft_potion_yellow.png b/textures/witchcraft_potion_yellow.png index dd182ae..752a36e 100644 Binary files a/textures/witchcraft_potion_yellow.png and b/textures/witchcraft_potion_yellow.png differ diff --git a/textures/witchcraft_recipes.png b/textures/witchcraft_recipes.png index aac31b3..686c122 100644 Binary files a/textures/witchcraft_recipes.png and b/textures/witchcraft_recipes.png differ diff --git a/textures/witchcraft_recipes_old.png b/textures/witchcraft_recipes_old.png index 22545b3..6394569 100644 Binary files a/textures/witchcraft_recipes_old.png and b/textures/witchcraft_recipes_old.png differ diff --git a/textures/witchcraft_scroll.png b/textures/witchcraft_scroll.png index e5de430..9767e76 100644 Binary files a/textures/witchcraft_scroll.png and b/textures/witchcraft_scroll.png differ diff --git a/textures/witchcraft_slime_bottle.png b/textures/witchcraft_slime_bottle.png index b0ee24e..503c5ac 100644 Binary files a/textures/witchcraft_slime_bottle.png and b/textures/witchcraft_slime_bottle.png differ diff --git a/textures/witchcraft_small_bottle.png b/textures/witchcraft_small_bottle.png index d0eb0c8..8a24b09 100644 Binary files a/textures/witchcraft_small_bottle.png and b/textures/witchcraft_small_bottle.png differ diff --git a/textures/witchcraft_smoke.png b/textures/witchcraft_smoke.png index 78b00d8..ebed8f7 100644 Binary files a/textures/witchcraft_smoke.png and b/textures/witchcraft_smoke.png differ diff --git a/textures/witchcraft_splash_blue2.png b/textures/witchcraft_splash_blue2.png index 5316294..0d29d10 100644 Binary files a/textures/witchcraft_splash_blue2.png and b/textures/witchcraft_splash_blue2.png differ diff --git a/textures/witchcraft_splash_brown.png b/textures/witchcraft_splash_brown.png index 42da159..71302cc 100644 Binary files a/textures/witchcraft_splash_brown.png and b/textures/witchcraft_splash_brown.png differ diff --git a/textures/witchcraft_splash_cyan.png b/textures/witchcraft_splash_cyan.png index 0c3e101..8ece2c7 100644 Binary files a/textures/witchcraft_splash_cyan.png and b/textures/witchcraft_splash_cyan.png differ diff --git a/textures/witchcraft_splash_darkpurple.png b/textures/witchcraft_splash_darkpurple.png index 4bff207..f7f61d8 100644 Binary files a/textures/witchcraft_splash_darkpurple.png and b/textures/witchcraft_splash_darkpurple.png differ diff --git a/textures/witchcraft_splash_ggreen.png b/textures/witchcraft_splash_ggreen.png index 0868262..6b244cf 100644 Binary files a/textures/witchcraft_splash_ggreen.png and b/textures/witchcraft_splash_ggreen.png differ diff --git a/textures/witchcraft_splash_green.png b/textures/witchcraft_splash_green.png index 9e5ee5d..dea7ef5 100644 Binary files a/textures/witchcraft_splash_green.png and b/textures/witchcraft_splash_green.png differ diff --git a/textures/witchcraft_splash_grey.png b/textures/witchcraft_splash_grey.png index 903c4be..2714c6d 100644 Binary files a/textures/witchcraft_splash_grey.png and b/textures/witchcraft_splash_grey.png differ diff --git a/textures/witchcraft_splash_magenta.png b/textures/witchcraft_splash_magenta.png index dbb1e9b..cd8de3a 100644 Binary files a/textures/witchcraft_splash_magenta.png and b/textures/witchcraft_splash_magenta.png differ diff --git a/textures/witchcraft_splash_orange.png b/textures/witchcraft_splash_orange.png index 47418a7..6d35cf7 100644 Binary files a/textures/witchcraft_splash_orange.png and b/textures/witchcraft_splash_orange.png differ diff --git a/textures/witchcraft_splash_purple.png b/textures/witchcraft_splash_purple.png index e432b9e..ca61536 100644 Binary files a/textures/witchcraft_splash_purple.png and b/textures/witchcraft_splash_purple.png differ diff --git a/textures/witchcraft_splash_red.png b/textures/witchcraft_splash_red.png index a22f864..ffb5cf5 100644 Binary files a/textures/witchcraft_splash_red.png and b/textures/witchcraft_splash_red.png differ diff --git a/textures/witchcraft_splash_redbrown.png b/textures/witchcraft_splash_redbrown.png index ef44dd3..6e0eeeb 100644 Binary files a/textures/witchcraft_splash_redbrown.png and b/textures/witchcraft_splash_redbrown.png differ diff --git a/textures/witchcraft_splash_yellgrn.png b/textures/witchcraft_splash_yellgrn.png index 54633df..902d600 100644 Binary files a/textures/witchcraft_splash_yellgrn.png and b/textures/witchcraft_splash_yellgrn.png differ diff --git a/textures/witchcraft_sun_over.png b/textures/witchcraft_sun_over.png index f486f0d..5f2eefd 100644 Binary files a/textures/witchcraft_sun_over.png and b/textures/witchcraft_sun_over.png differ diff --git a/textures/witchcraft_thunder_over.png b/textures/witchcraft_thunder_over.png index 634f001..5e7f8ac 100644 Binary files a/textures/witchcraft_thunder_over.png and b/textures/witchcraft_thunder_over.png differ diff --git a/textures/witchcraft_tooth.png b/textures/witchcraft_tooth.png index 50ac6b2..419976f 100644 Binary files a/textures/witchcraft_tooth.png and b/textures/witchcraft_tooth.png differ diff --git a/textures/witchcraft_water_bottle.png b/textures/witchcraft_water_bottle.png index 785ad7d..40038a9 100644 Binary files a/textures/witchcraft_water_bottle.png and b/textures/witchcraft_water_bottle.png differ diff --git a/textures/witchcraft_water_over.png b/textures/witchcraft_water_over.png index 40677aa..6d39c01 100644 Binary files a/textures/witchcraft_water_over.png and b/textures/witchcraft_water_over.png differ