diff --git a/.gitmodules b/.gitmodules index 468ff03a..0d480186 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,9 +64,6 @@ [submodule "mods/playereffects"] path = mods/playereffects url = git://repo.or.cz/minetest_playereffects.git -[submodule "mods/witchcraft"] - path = mods/witchcraft - url = https://github.com/D00Med/witchcraft.git [submodule "mods/morefarming"] path = mods/morefarming url = https://github.com/sys4-fr/morefarming.git diff --git a/mods/witchcraft b/mods/witchcraft deleted file mode 160000 index 0baf0cb5..00000000 --- a/mods/witchcraft +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0baf0cb53b89e34809e372abf4d8540242f0c450 diff --git a/mods/witchcraft/brewing_stand.lua b/mods/witchcraft/brewing_stand.lua new file mode 100644 index 00000000..0a882db6 --- /dev/null +++ b/mods/witchcraft/brewing_stand.lua @@ -0,0 +1,164 @@ +--brewing stand and level 2 potions + +-- GENERATED CODE +-- Node Box Editor, version 0.8.1 - Glass + +minetest.register_node("witchcraft:brewing_stand", { + tiles = { + "witchcraft_brewing_stand_top.png", + "witchcraft_brewing_stand_top.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png" + }, + drawtype = "nodebox", + use_texture_alpha = true, + paramtype = "light", + drop = { + items = { + {items = {'witchcraft:brewing_stand_unready'}, rarity = 1}, + } + }, + groups = {cracky=1, oddly_breakable_by_hand=1}, + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1 + {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2 + {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3 + {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4 + {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5 + {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6 + {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7 + {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8 + {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9 + } + }, + on_rightclick = function(pos, node, clicker, item, _) + local wield_item = clicker:get_wielded_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) + end) + end + end, +}) + +minetest.register_node("witchcraft:brewing_stand_active", { + tiles = { + "witchcraft_brewing_stand_top.png", + "witchcraft_brewing_stand_top.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png", + "witchcraft_brewing_stand_side.png" + }, + drawtype = "nodebox", + use_texture_alpha = true, + paramtype = "light", + light_source = 1, + drop = { + items = { + {items = {'witchcraft:brewing_stand_unready'}, rarity = 1}, + } + }, + groups = {cracky=1, oddly_breakable_by_hand=1}, + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1 + {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2 + {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3 + {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4 + {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5 + {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6 + {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7 + {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8 + {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9 + } + } +}) + +minetest.register_node("witchcraft:brewing_stand_unready", { + description = "brewing stand", + tiles = { + "witchcraft_brewing_stand_top.png^[colorize:black:100", + "witchcraft_brewing_stand_top.png^[colorize:black:100", + "witchcraft_brewing_stand_side.png^[colorize:black:100", + "witchcraft_brewing_stand_side.png^[colorize:black:100", + "witchcraft_brewing_stand_side.png^[colorize:black:100", + "witchcraft_brewing_stand_side.png^[colorize:black:100" + }, + inventory_image = "witchcraft_brewing_stand_inv.png", + drawtype = "nodebox", + use_texture_alpha = true, + paramtype = "light", + light_source = 1, + drop = { + items = { + {items = {'witchcraft:brewing_stand_unready'}, rarity = 1}, + } + }, + groups = {cracky=1, oddly_breakable_by_hand=1}, + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1 + {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2 + {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3 + {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4 + {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5 + {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6 + {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7 + {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8 + {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9 + } + }, + on_rightclick = function(pos, node, clicker, item, _) + local wield_item = clicker:get_wielded_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() + end + end, +}) + +--end of GENERATED CODE + +minetest.register_abm({ + nodenames = {"witchcraft:brewing_stand_active"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 0.5, + maxsize = 1, + collisiondetection = false, + texture = "witchcraft_smoke.png" + }) + end +}) + +minetest.register_craft({ + output = 'witchcraft:brewing_stand_unready', + recipe = { + {'', '', ''}, + {'group:stick', 'default:diamond', 'group:stick'}, + {'', 'default:obsidian_shard', ''}, + } +}) \ No newline at end of file diff --git a/mods/witchcraft/depends.txt b/mods/witchcraft/depends.txt new file mode 100644 index 00000000..30daf56f --- /dev/null +++ b/mods/witchcraft/depends.txt @@ -0,0 +1,11 @@ +default +vessels +tnt +fire +playereffects +farming? +lightning? +pmobs? +hud_hunger? +moreplants? +horror? \ No newline at end of file diff --git a/mods/witchcraft/init.lua b/mods/witchcraft/init.lua new file mode 100644 index 00000000..94d5d989 --- /dev/null +++ b/mods/witchcraft/init.lua @@ -0,0 +1,3803 @@ +--Stuff from vessels + +-- - +-- Copyright (C) 2012 Vanessa Ezekowitz +-- Copyright (C) 2012 celeron55, Perttu Ahola + +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- at your option) any later version. + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. + +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +--changes so that bottles can't stack +minetest.override_item("vessels:glass_bottle", { + stack_max = 3, +}) + +local vessels_shelf_formspec = + "size[8,7;]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;vessels;0,0.3;8,2;]".. + "list[current_player;main;0,2.85;8,1;]".. + "list[current_player;main;0,4.08;8,3;8]".. + "listring[context;vessels]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0,2.85) + +minetest.register_node("witchcraft:shelf", { + description = "Potion shelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png^vessels_shelf_overlay.png"}, + is_ground_content = false, + groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", vessels_shelf_formspec) + local inv = meta:get_inventory() + inv:set_size("vessels", 8*2) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("vessels") + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + 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 + return 1 + else + return 0 + end + end + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + 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 + return 1 + else + return 0 + end + end + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from vessels shelf at "..minetest.pos_to_string(pos)) + end, +}) + +--my stuff + +-- Copyright (C) 2016 DOOmed + +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published by +-- the Free Software Foundation; either version 2.1 of the License, or +-- (at your option) any later version. + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. + +-- You should have received a copy of the GNU Lesser General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +--ingredients + +minetest.register_node("witchcraft:bottle_eyes", { + description = "Jar of eyes", + drawtype = "plantlike", + tiles = {"witchcraft_jar_eyes.png"}, + inventory_image = "witchcraft_jar_eyes.png", + wield_image = "witchcraft_jar_eyes.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + stack_max = 1, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_node("witchcraft:bottle_slime", { + description = "Jar of Slime", + drawtype = "plantlike", + tiles = {"witchcraft_jar_slime.png"}, + inventory_image = "witchcraft_jar_slime.png", + wield_image = "witchcraft_jar_slime.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + stack_max = 1, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craftitem("witchcraft:herb", { + description = "herb", + inventory_image = "witchcraft_herbs.png" +}) + +minetest.register_craftitem("witchcraft:tooth", { + description = "tooth", + inventory_image = "witchcraft_tooth.png" +}) + +minetest.register_craftitem("witchcraft:horn", { + description = "horn", + inventory_image = "witchcraft_horn.png" +}) + +minetest.register_craftitem("witchcraft:bone", { + description = "bone", + inventory_image = "witchcraft_bone.png" +}) + +--crafting + +minetest.register_craft({ + output = 'witchcraft:shelf', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:potion', 'group:potion', 'group:potion'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +if minetest.get_modpath("moreplants") then +minetest.register_craft({ + output = 'witchcraft:bottle_eyes', + recipe = { + {'moreplants:eye'}, + {'moreplants:eye'}, + {'vessels:drinking_glass'}, + } +}) + + +minetest.register_craft({ + output = "moreplants:eye 2", + type = "shapeless", + recipe = {"witchcraft:bottle_eyes"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:bush"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:weed"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:groundfung"} +}) +else +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"default:grass_5"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"default:grass_4"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"default:grass_3"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"default:grass_2"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"default:grass_1"} +}) + +minetest.register_craft({ + output = 'witchcraft:bottle_eyes', + recipe = { + {'default:bucket_water'}, + {'vessels:drinking_glass'}, + } +}) +end + +minetest.register_craft({ + output = 'witchcraft:pot', + recipe = { + {'default:copper_lump', '', 'default:copper_lump'}, + {'default:copper_lump', '', 'default:copper_lump'}, + {'', 'default:copper_lump', ''}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:mortar', + recipe = { + {'default:stone', '', 'default:stone'}, + {'default:stone', '', 'default:stone'}, + {'', 'default:stone', ''}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:pentagram', + recipe = { + {'default:torch', 'default:clay', 'default:torch'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:small_bottle', + recipe = { + {'vessels:glass_fragments', 'vessels:glass_fragments', 'vessels:glass_fragments'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:bottle_medicine 2', + recipe = { + {'witchcraft:small_bottle', 'witchcraft:potion_red', 'witchcraft:small_bottle'}, + }, + replacements = { + {"witchcraft:potion_red", "vessels:glass_bottle"} + } +}) + +minetest.register_craft({ + output = 'witchcraft:mud_bottle', + recipe = { + {'default:dirt'}, + {'witchcraft:small_bottle'}, + }, +}) + +minetest.register_craft({ + output = 'witchcraft:bone_bottle', + recipe = { + {'bones:bones'}, + {'witchcraft:small_bottle'}, + }, +}) + +minetest.register_craft({ + output = 'witchcraft:herb_bottle', + recipe = { + {'witchcraft:herb'}, + {'witchcraft:small_bottle'}, + }, +}) + +minetest.register_craft({ + output = 'witchcraft:slime_bottle', + recipe = { + {'witchcraft:bottle_slime'}, + {'witchcraft:small_bottle'}, + }, + replacements = { + {"witchcraft:bottle_slime", "vessels:drinking_glass"} + } +}) + +minetest.register_craft({ + output = 'witchcraft:herb', + recipe = { + {'witchcraft:herb_bottle'}, + }, + replacements = { + {"witchcraft:herb_bottle", "witchcraft:small_bottle"} + } +}) + +minetest.register_craft({ + output = 'bones:bones', + recipe = { + {'witchcraft:bone_bottle'}, + }, + replacements = { + {"witchcraft:bone_bottle", "witchcraft:small_bottle"} + } +}) + +minetest.register_craft({ + output = 'default:dirt', + recipe = { + {'witchcraft:mud_bottle'}, + }, + replacements = { + {"witchcraft:mud_bottle", "witchcraft:small_bottle"} + } +}) + +minetest.register_craft({ + output = 'witchcraft:bottle_slime', + recipe = { + {'witchcraft:slime_bottle'}, + }, + replacements = { + {"witchcraft:slime_bottle", "witchcraft:small_bottle"} + } +}) + +minetest.register_craft({ + output = 'witchcraft:slime_bottle', + recipe = { + {'witchcraft:bottle_slime'}, + {'witchcraft:small_bottle'}, + }, +}) + +minetest.register_craft({ + output = 'vessels:glass_fragments 3', + recipe = { + {'default:glass'}, + }, +}) + +minetest.register_craft({ + output = 'witchcraft:bone 4', + recipe = { + {'bones:bones', 'bones:bones'}, + }, +}) + +--teeth from sand, maybe fossilised? +minetest.register_craft({ + output = 'witchcraft:tooth 1', + recipe = { + {'default:sand'}, + }, +}) + + + +--splash potions crafting + +minetest.register_craft({ + output = 'witchcraft:splash_yellwgrn', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_yllwgrn'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:splash_orange', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_orange'}, + } +}) + + +minetest.register_craft({ + output = 'witchcraft:splash_purple', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_purple'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_magenta', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_magenta'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_cyan', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_cyan'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_red', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_red'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_green', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_green'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_grey', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_grey'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_brown', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_brown'}, + } +}) +minetest.register_craft({ + output = 'witchcraft:splash_redbrown', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_redbrown'}, + } +}) + + +minetest.register_craft({ + output = 'witchcraft:splash_ggreen', + recipe = { + {'vessels:glass_fragments'}, + {'witchcraft:potion_ggreen'}, + } +}) + + + +--empty cooking pot + +minetest.register_node("witchcraft:pot", { + description = "magic cooking pot", + tiles = { + "witchcraft_pot_top.png", + "witchcraft_pot_bottom.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png" + }, + drawtype = "nodebox", + paramtype = "light", + 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.25, 0.375}, -- NodeBox4 + {-0.4375, -0.25, -0.4375, 0.4375, -0.1875, 0.4375}, -- NodeBox5 + {-0.5, -0.1875, -0.5, 0.5, -0.125, 0.5}, -- NodeBox7 + {-0.5, -0.125, -0.5, 0.5, 0.3125, -0.3125}, -- NodeBox8 + {-0.5, -0.125, 0.3125, 0.5, 0.3125, 0.5}, -- NodeBox9 + {0.3125, -0.1875, -0.5, 0.5, 0.3125, 0.5}, -- NodeBox10 + {-0.5, -0.125, -0.5, -0.3125, 0.3125, 0.5}, -- NodeBox11 + {-0.4375, 0.375, 0.3125, 0.4375, 0.5, 0.4375}, -- NodeBox12 + {-0.4375, 0.375, -0.4375, 0.4375, 0.5, -0.3125}, -- NodeBox13 + {-0.4375, 0.375, -0.4375, 0.4375, 0.5, -0.3125}, -- NodeBox14 + {0.3125, 0.375, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox15 + {-0.4375, 0.375, -0.4375, -0.3125, 0.5, 0.4375}, -- NodeBox16 + {-0.375, 0.3125, -0.375, 0.375, 0.375, -0.3125}, -- NodeBox17 + {-0.375, 0.3125, 0.3125, 0.375, 0.375, 0.375}, -- NodeBox18 + {0.3125, 0.3125, -0.375, 0.375, 0.375, 0.375}, -- NodeBox19 + {-0.375, 0.3125, -0.375, -0.3125, 0.375, 0.375}, -- NodeBox20 + } + }, + on_rightclick = function(pos, node, clicker, item, _) + local wield_item = clicker:get_wielded_item():get_name() + 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}) + item:replace("bucket:bucket_empty") + elseif wield_item == "vessels:drinking_glass" then + item:replace("witchcraft:bottle_slime") + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1} +}) + +--level 1 potions from cooking pot + +local witchcraft = {} +--the old recipes +witchcraft.pot = { + {"blue", "brown", "default:dirt", "blue2", "moreplants:bullrush", "red", "purple"}, + {"blue2", "yellow", "default:steelblock", "yellow", "default:copperblock", "green2", "aqua"}, + {"darkpurple", "cyan", "flowers:mushroom_red", "green", "moreplants:weed", "yellow", "redbrown"}, + {"purple", "blue2", "flowers:waterlily", "gpurple", "default:mese_crystal", "magenta", "darkpurple"}, + {"magenta", "purple", "witchcraft:bottle_eyes", "darkpurple", "moreplants:mushroom", "purple", "darkpurple"}, + {"red", "grey", "default:gravel", "yllwgrn", "default:flint", "blue", "purple"}, + {"redbrown", "magenta", "flowers:mushroom_brown", "magenta", "default:stone", "grey", "brown"}, + {"brown", "gred", "witchcraft:herb", "grey", "moreplants:bush", "red", "redbrown"}, + {"orange", "redbrown", "witchcraft:bottle_slime", "yellow", "default:steelblock", "green", "yllwgrn"}, + {"gold", "yllwgrn", "tnt:tnt", "", "", "green", "yllwgrn"}, + {"yellow", "yllwgrn", "tnt:tnt", "yllwgrn", "default:coal_lump", "darkpurple", "redbrown"}, + {"yllwgrn", "green", "default:gold_lump", "orange", "mobs:lava_orb", "grey", "magenta"}, + {"green2", "darkpurple", "default:glass", "red", "witchcraft:herb", "blue2", "aqua"}, + {"green", "green2", "default:apple", "ggreen", "default:mese_crystal", "orange", "yllwgrn"}, + {"aqua", "", "", "", "", "blue", "cyan"}, + {"cyan", "aqua", "default:diamond", "gcyan", "default:mese_crystal", "green", "yellow"}, + {"grey", "orange", "default:torch", "brown", "default:apple", "yllwgrn", "magenta"}, + {"ggreen", "", "", "", "", "", ""}, + {"gpurple", "", "", "", "", "", ""}, + {"gred", "red", "default:apple", "grey", "default:gravel", "", ""}, + {"gcyan", "", "", "", "", "", ""}, +} +--new recipes + +witchcraft.pot_new = { + {"blue", "blue2", "flowers:waterlily", "brown", "default:dirt", "red", "purple"}, + {"blue2", "green", "default:papyrus", "", "", "gred", "magenta"}, + {"green", "green2", "default:sapling", "", "", "yellow", "yllwgrn"}, + {"green2", "yellow", "default:mese_crystal_fragment", "", "", "blue", "cyan"}, + {"yellow", "ggreen", "flowers:mushroom_brown", "", "", "green", "yllwgrn"}, + {"ggreen", "cyan", "witchcraft:slime_bottle", "", "", "gcyan", "aqua"}, + {"cyan", "gcyan", "witchcraft:bottle_medicine", "", "", "blue", "blue2"}, + {"gcyan", "orange", "default:torch", "", "", "ggreen", "aqua"}, + {"orange", "yllwgrn", "tnt:gunpowder", "", "", "red", "redbrown"}, + {"yllwgrn", "gold", "default:steel_ingot", "", "", "green", "green2"}, + {"gold", "aqua", "default:diamond", "", "", "", ""}, + {"aqua", "", "", "", "", "", ""}, + {"brown", "redbrown", "flowers:mushroom_red", "", "", "red", "redbrown"}, + {"redbrown", "gred", "default:apple", "", "", "", ""}, + {"gred", "red", "witchcraft:herbs", "", "", "blue2", "magenta"}, + {"red", "magenta", "witchcraft:tooth", "", "", "blue", "purple"}, + {"magenta", "gpurple", "witchcraft:bottle_slime", "", "", "cyan", "darkpurple"}, + {"gpurple", "purple", "witchcraft:bone_bottle", "", "", "yllwgrn", "green2"}, + {"purple", "darkpurple", "default:glass", "", "", "yellow", "green"}, + {"darkpurple", "silver", "default:steel_ingot", "", "", "", ""}, + {"silver", "grey", "witchcraft:bone", "", "", "", ""}, + {"grey", "aqua", "default:diamond", "", "", "", ""}, +} + + +--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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() == 3 then + item:replace("witchcraft:potion_"..color) + minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color) + minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color) + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() ~= 3 then + item:replace("witchcraft:potion_"..color) + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + else + if wield_item == ingredient then + minetest.set_node(pos, {name="witchcraft:pot_"..newcolor, param2=node.param2}) + item:take_item() + elseif wield_item == ingredient2 then + minetest.set_node(pos, {name="witchcraft:pot_"..newcolor2, param2=node.param2}) + item:take_item() + elseif wield_item == "bucket:bucket_water" then + minetest.set_node(pos, {name="witchcraft:pot_blue", param2=node.param2}) + item:replace("bucket:bucket_empty") + elseif wield_item == "witchcraft:potion_"..combine then + minetest.set_node(pos, {name="witchcraft:pot_"..cresult, param2=node.param2}) + item:replace("vessels:glass_bottle") + end + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1} +}) +end + +--pot effects +minetest.register_abm({ + nodenames = {"witchcraft:pot_water", "witchcraft:pot_gold", "witchcraft:pot_redbrown", "witchcraft:pot_blue2", "witchcraft:pot_cyan", "witchcraft:pot_green", "witchcraft:pot_green2", "witchcraft:pot_aqua", "witchcraft:pot_yellow", "witchcraft:pot_yllwgrn", "witchcraft:pot_red", "witchcraft:pot_magenta", "witchcraft:pot_brown"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_bubbles.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_ggreen", "witchcraft:pot_gred", "witchcraft:pot_gpurple", "witchcraft:pot_gcyan"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = "witchcraft_light_over.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_purple"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 5, + maxsize = 8, + collisiondetection = false, + texture = "witchcraft_smoke.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_darkpurple"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_symbol.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_orange"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_flame.png" + }) + end +}) + +--small bottle and contents + +minetest.register_node("witchcraft:small_bottle", { + description = "Small bottle", + drawtype = "plantlike", + tiles = {"witchcraft_small_bottle.png"}, + wield_image = "witchcraft_small_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_small_bottle.png", +}) + +minetest.register_node("witchcraft:bone_bottle", { + description = "Small bottle of bone dust", + drawtype = "plantlike", + tiles = {"witchcraft_bone_bottle.png"}, + wield_image = "witchcraft_bone_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_bone_bottle.png", +}) + +minetest.register_node("witchcraft:slime_bottle", { + description = "Small bottle of slime", + drawtype = "plantlike", + tiles = {"witchcraft_slime_bottle.png"}, + wield_image = "witchcraft_slime_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_slime_bottle.png", +}) + +minetest.register_node("witchcraft:herb_bottle", { + description = "Small bottle of herbs", + drawtype = "plantlike", + tiles = {"witchcraft_herb_bottle.png"}, + wield_image = "witchcraft_herb_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_herb_bottle.png", +}) + +minetest.register_node("witchcraft:mud_bottle", { + description = "Small bottle of mud", + drawtype = "plantlike", + tiles = {"witchcraft_mud_bottle.png"}, + wield_image = "witchcraft_mud_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_mud_bottle.png", +}) + +minetest.register_node("witchcraft:bottle_medicine", { + description = "Small bottle of Medicine", + drawtype = "plantlike", + tiles = {"witchcraft_medicine_bottle.png"}, + wield_image = "witchcraft_medicine_bottle.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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 + end, +}) + + + +--splash effects + +minetest.register_entity("witchcraft:tnt_splash", { + textures = {"witchcraft_splash_yellgrn.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:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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" 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 + end + end + end + end + + end, +}) + + + +minetest.register_entity("witchcraft:fire_splash", { + textures = {"witchcraft_splash_orange.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:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=1}, + }, nil) + 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:fire_splash" and n ~= "air" then + if not ignore_protection and minetest.is_protected(npos, "") then + return + end + minetest.env:set_node(t, {name="fire:basic_flame"}) + minetest.sound_play("default_break_glass.1", { + pos = self.object:getpos(), + max_hear_distance = 20, + gain = 10.0, + }) + 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 + + end, +}) + +minetest.register_entity("witchcraft:death_splash", { + textures = {"witchcraft_splash_grey.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:death_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=50}, + }, nil) + 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:death_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:heal_splash", { + textures = {"witchcraft_splash_red.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:heal_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=-20}, + }, nil) + 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:heal_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:slow_splash", { + textures = {"witchcraft_splash_redbrown.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:slow_splash" and obj:get_luaentity().name ~= "__builtin:item" then + local vel = obj:getvelocity() + obj:setvelocity({x=vel.x*0.5, y=vel.y*0.5, z=vel.z*0.5}) + self.object:remove() + 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:slow_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:fast_splash", { + textures = {"witchcraft_splash_magenta.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:fast_splash" and obj:get_luaentity().name ~= "__builtin:item" then + local vel = obj:getvelocity() + obj:setvelocity({x=vel.x*4, y=vel.y*1, z=vel.z*4}) + 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:fast_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:antigrav_splash", { + textures = {"witchcraft_splash_green.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:antigrav_splash" and obj:get_luaentity().name ~= "__builtin:item" then + local vel = obj:getvelocity() + obj:setvelocity({x=vel.x*1, y=vel.y*0.1, z=vel.z*1}) + 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:antigrav_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:jump_splash", { + textures = {"witchcraft_splash_cyan.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:jump_splash" and obj:get_luaentity().name ~= "__builtin:item" then + local vel = obj:getvelocity() + obj:setvelocity({x=vel.x*1, y=(vel.y+2)*3, z=vel.z*1}) + 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:jump_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:murky_splash", { + textures = {"witchcraft_splash_brown.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:murky_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=20}, + }, nil) + 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:murky_splash" and n ~= "air" 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, +}) + +minetest.register_entity("witchcraft:shadow_splash", { + textures = {"witchcraft_splash_ggreen.png"}, + velocity = 0.1, + damage = 2, + physical = true, + 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() + 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 + ) + end, +}) + +minetest.register_entity("witchcraft:smoke_splash", { + textures = {"witchcraft_splash_purple.png"}, + velocity = 0.1, + damage = 2, + physical = true, + 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() + 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 + ) + + end, +}) + +--player effects + +playereffects.register_effect_type("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("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("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("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("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("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("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("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("potion_silver", "Fire resist", nil, {"fire_resist"}, + function(player) + local pos = player:getpos() + 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) + end + end, + nil, + nil, + nil, + 0.3 +) + + +--splash potions + +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 = {vessel=1,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_purple", { + description = "Smokey Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_purple.png"}, + wield_image = "witchcraft_splash_purple.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, 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, +}) + +minetest.register_node("witchcraft:splash_red", { + description = "Healthy Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_red.png"}, + wield_image = "witchcraft_splash_red.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +minetest.register_node("witchcraft:splash_green", { + description = "Volatile Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_green.png"}, + wield_image = "witchcraft_splash_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 = {vessel=1,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, +}) + +minetest.register_node("witchcraft:splash_cyan", { + description = "Light Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_cyan.png"}, + wield_image = "witchcraft_splash_cyan.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +minetest.register_node("witchcraft:splash_redbrown", { + description = "Thick Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_redbrown.png"}, + wield_image = "witchcraft_splash_redbrown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +minetest.register_node("witchcraft:splash_magenta", { + description = "Fast Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_magenta.png"}, + wield_image = "witchcraft_splash_magenta.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +minetest.register_node("witchcraft:splash_brown", { + description = "Murky Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_brown.png"}, + wield_image = "witchcraft_splash_brown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +minetest.register_node("witchcraft:splash_grey", { + description = "Death Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_grey.png"}, + wield_image = "witchcraft_splash_grey.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + + + +minetest.register_node("witchcraft:splash_ggreen", { + description = "Darkness Splash Potion", + drawtype = "plantlike", + tiles = {"witchcraft_splash_ggreen.png"}, + wield_image = "witchcraft_splash_ggreen.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_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, +}) + +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 = {vessel=1,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, +}) + +--potions (level 1 and 2) + +minetest.register_node("witchcraft:potion_red", { + description = "Tasty Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_red.png"}, + wield_image = "witchcraft_potion_red.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_red.png", + on_use = function(itemstack, player) + local health = player:get_hp(); + player:set_hp(health+20) + itemstack:replace("vessels:glass_bottle") + return itemstack + end, +}) + +minetest.register_node("witchcraft:potion_red_2", { + description = "Tasty Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_red.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_red.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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 + end, +}) + +minetest.register_node("witchcraft:potion_darkpurple", { + description = "Shady Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_darkpurple.png"}, + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + stack_max = 1, + wield_image = "witchcraft_potion_darkpurple.png", + inventory_image = "witchcraft_potion_darkpurple.png", + on_use = function(itemstack, user) + --invisibility effect from invisibility potion by Tenplus1 + + local pos = user:getpos() + + -- make player invisible + invisible(user, true) + + -- play sound + minetest.sound_play("pop", { + pos = pos, + gain = 1.0, + max_hear_distance = 5 + }) + + -- display 10 second warning + minetest.after(290, function() + + if user:getpos() then + + minetest.chat_send_player(user:get_player_name(), + ">>> You have 10 seconds before invisibility wears off!") + end + end) + + -- make player visible 5 minutes later + minetest.after(300, function() + + if user:getpos() then + + -- show aready hidden player + invisible(user, nil) + + -- play sound + minetest.sound_play("pop", { + pos = pos, + gain = 1.0, + max_hear_distance = 5 + }) + 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 + ) + + -- take item + if not minetest.setting_getbool("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", + tiles = {"witchcraft_potion_darkpurple.png^[colorize:black:50"}, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + paramtype = "light", + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + stack_max = 1, + 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() + + -- make player invisible + invisible(user, true) + + -- play sound + minetest.sound_play("pop", { + pos = pos, + gain = 1.0, + max_hear_distance = 5 + }) + + -- display 10 second warning + minetest.after(340, function() + + if user:getpos() then + + minetest.chat_send_player(user:get_player_name(), + ">>> You have 10 seconds before invisibility wears off!") + end + end) + + -- make player visible 5 minutes later + minetest.after(350, function() + + if user:getpos() then + + -- show aready hidden player + invisible(user, nil) + + -- play sound + minetest.sound_play("pop", { + pos = pos, + gain = 1.0, + max_hear_distance = 5 + }) + 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 + ) + + -- take item + if not minetest.setting_getbool("creative_mode") then + + itemstack:take_item() + + return {name = "vessels:glass_bottle"} + end + end, +}) + +minetest.register_node("witchcraft:potion_brown", { + description = "Murky Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_brown.png"}, + wield_image = "witchcraft_potion_brown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_brown.png", + on_use = minetest.item_eat(-5, "vessels:glass_bottle"), +}) + +minetest.register_node("witchcraft:potion_brown_2", { + description = "Murky Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_brown.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_brown.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_brown.png^[colorize:black:50", + 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", + tiles = {"witchcraft_potion_yellgrn.png"}, + wield_image = "witchcraft_potion_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 = {vessel=1,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 + end, +}) + +minetest.register_node("witchcraft:potion_yllwgrn_2", { + description = "Dodgy Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_yellgrn.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_yellgrn.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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 + 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() + 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:fire" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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: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 + 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 + ) + + end, +}) + + +minetest.register_node("witchcraft:potion_orange", { + description = "Dragon Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_orange.png"}, + wield_image = "witchcraft_potion_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 = {vessel=1,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 + ) + + item:replace("vessels:glass_bottle") + return item + end, +}) + +minetest.register_node("witchcraft:potion_orange_2", { + description = "Dragon Potion (v2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_orange.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_orange.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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, +}) + +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 = {vessel=1,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 = {vessel=1,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, +}) + +minetest.register_node("witchcraft:potion_purple", { + description = "Smokey Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_purple.png"}, + wield_image = "witchcraft_potion_purple.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_purple.png", + on_use = function(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 + end, +}) + + + +if minetest.get_modpath("hud_hunger") ~= nil then +local register_food = hunger.register_food +minetest.register_node("witchcraft:potion_gpurple", { + description = "Filling Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_gpurple.png"}, + wield_image = "witchcraft_potion_gpurple.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gpurple.png", + on_use = function(item, placer, pos) + item:replace("vessels:glass_bottle") + return item + end, +}) + +minetest.register_node("witchcraft:potion_gred", { + description = "Hunger Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_gred.png"}, + wield_image = "witchcraft_potion_gred.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gred.png", + on_use = function(item, placer, pos) + item:replace("vessels:glass_bottle") + return item + end, +}) + +register_food("witchcraft:potion_gpurple", 10) +register_food("witchcraft:potion_gred", -4) +else + + minetest.register_node("witchcraft:potion_gpurple", { + description = "Filling Potion (better with hunger mod)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_purple.png"}, + wield_image = "witchcraft_potion_purple.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_purple.png", + on_use = function(itemstack, player) + local health = player:get_hp(); + player:set_hp(health+20) + itemstack:replace("vessels:glass_bottle") + return itemstack + end, + + minetest.register_node("witchcraft:potion_gred", { + description = "Hunger Potion (better with hunger mod)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_gred.png"}, + wield_image = "witchcraft_potion_gred.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gred.png", + on_use = function(itemstack, player) + local health = player:get_hp(); + player:set_hp(health+10) + itemstack:replace("vessels:glass_bottle") + return itemstack + end, +}) +}) +end + +minetest.register_node("witchcraft:potion_purple_2", { + description = "Smokey Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_purple.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_purple.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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 + end, +}) + +minetest.register_node("witchcraft:potion_grey", { + description = "Evil Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_grey.png"}, + wield_image = "witchcraft_potion_grey.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_grey.png", + on_use = minetest.item_eat(-100, "vessels:glass_bottle"), +}) + +minetest.register_node("witchcraft:potion_grey_2", { + description = "Evil Potion (lv2)", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_grey.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_grey.png^[colorize:black:50", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_grey.png^[colorize:black:50", + on_use = minetest.item_eat(-200, "vessels:glass_bottle"), +}) + +minetest.register_node("witchcraft:potion_blue", { + description = "Bottle of Water", + drawtype = "plantlike", + tiles = {"witchcraft_potion_blue.png"}, + wield_image = "witchcraft_potion_blue.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_blue.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="default:water_source"}) + else + minetest.chat_send_player(player, "This area is protected.") + end + end + item:replace("vessels:glass_bottle") + return item + end +}) + + +minetest.register_node("witchcraft:potion_silver", { + description = "Cold potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_silver.png"}, + wield_image = "witchcraft_potion_silver.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_silver.png", + on_use = function(item, user, pointed_thing) + playereffects.apply_effect_type("potion_silver", 15, user) + item:replace("vessels:glass_bottle") + return item + end +}) + +minetest.register_node("witchcraft:potion_silver_2", { + description = "Cold potion lv2", + drawtype = "plantlike", + tiles = {"witchcraft_potion_silver.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_silver.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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 + 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 = {vessel=1,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.") + 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 + 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 = {vessel=1,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.") + 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 + end +}) +end + +minetest.register_node("witchcraft:potion_gold", { + description = "Alchemy Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_gold.png"}, + wield_image = "witchcraft_potion_gold.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gold.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="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 + end +}) + +minetest.register_node("witchcraft:potion_gold_2", { + description = "Alchemy Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_gold.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_gold.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gold.png^[colorize:black:50", + 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="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 + 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 = {vessel=1,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 +}) +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 = {vessel=1,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 +}) +end + +minetest.register_node("witchcraft:potion_magenta", { + description = "Fast Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_magenta.png"}, + wield_image = "witchcraft_potion_magenta.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_magenta.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_magenta_2", { + description = "Fast Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_magenta.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_magenta.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_magenta.png^[colorize:black:50", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_cyan", { + description = "Light Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_cyan.png"}, + wield_image = "witchcraft_potion_cyan.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_cyan.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_gcyan", { + description = "Air Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_gcyan.png"}, + wield_image = "witchcraft_potion_gcyan.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_gcyan.png", + on_use = function(item, 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 + end +}) + +minetest.register_node("witchcraft:potion_cyan_2", { + description = "Light Potion (lv2)", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_cyan.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_cyan.png^[colorize:black:50", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_cyan.png^[colorize:black:50", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_green2", { + description = "Volatile Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_green2.png"}, + wield_image = "witchcraft_potion_green2.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_green2.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_ggreen", { + description = "Darkness Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_ggreen.png"}, + wield_image = "witchcraft_potion_ggreen.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_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 + end +}) + +minetest.register_node("witchcraft:potion_green2_2", { + description = "Volatile Potion (lv2)", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_green2.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_green2.png^[colorize:black:50", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_green2.png^[colorize:black:50", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_redbrown", { + description = "Thick Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_redbrown.png"}, + wield_image = "witchcraft_potion_redbrown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_redbrown.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_redbrown_2", { + description = "Thick Potion (lv2)", + drawtype = "plantlike", + tiles = {"witchcraft_potion_redbrown.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_redbrown.png^[colorize:black:50", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_redbrown.png^[colorize:black:50", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_blue2", { + description = "Watery Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_blue2.png"}, + wield_image = "witchcraft_potion_blue2.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_blue2.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath = user:get_breath() + if breath <= 10 then + playereffects.apply_effect_type("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 + end +}) + +minetest.register_node("witchcraft:potion_blue2_2", { + description = "Watery Potion (lv2)", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_blue2.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_blue2.png^[colorize:black:50", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_blue2.png^[colorize:black:50", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath = user:get_breath() + if breath <= 10 then + playereffects.apply_effect_type("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 + end +}) + +--light potion + +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) + end +end + +minetest.register_node("witchcraft:potion_yellow", { + description = "Shiny Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_yellow.png"}, + wield_image = "witchcraft_potion_yellow.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_yellow.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + 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 + end +}) + +minetest.register_node("witchcraft:potion_yellow_2", { + description = "Shiny Potion (lv2)", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_yellow.png^[colorize:black:50"}, + wield_image = "witchcraft_potion_yellow.png^[colorize:black:50", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion2=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_yellow.png^[colorize:black:50", + on_use = function(item, 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 + 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", { + description = "mortar and pestle", + tiles = { + "default_stone.png", + "default_stone.png", + "default_stone.png", + "default_stone.png", + "default_stone.png", + "default_stone.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1 + {-0.1875, -0.4375, -0.1875, 0.1875, -0.375, 0.1875}, -- NodeBox2 + {-0.3125, -0.375, -0.3125, -0.1875, 0.125, 0.3125}, -- NodeBox3 + {0.1875, -0.375, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox4 + {-0.3125, -0.375, -0.3125, 0.3125, 0.125, -0.1875}, -- NodeBox5 + {-0.3125, -0.375, 0.1875, 0.3125, 0.125, 0.3125}, -- NodeBox6 + {-0.1875, -0.375, -0.1875, 0.25, -0.0625, 0.1875}, -- NodeBox7 + {-0.3125, -0.5, -0.5, 0.3125, -0.375, -0.375}, -- NodeBox8 + } + }, + groups = {cracky=1, oddly_breakable_by_hand=1} +}) + +minetest.register_node("witchcraft:pentablock", { + description = "Pentagram block", + tiles = { + "witchcraft_pentablock.png", + }, + groups = {cracky=1, oddly_breakable_by_hand=1} +}) + +minetest.register_node("witchcraft:pentagram", { + description = "pentagram", + drawtype = "signlike", + visual_scale = 3.0, + tiles = {"witchcraft_pentagram.png"}, + inventory_image = "witchcraft_pentagram.png", + use_texture_alpha = true, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = false, + light_source = 50, + walkable = false, + is_ground_content = true, + selection_box = { + type = "wallmounted", + 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) + end + end, + groups = {cracky=3,dig_immediate=3}, +}) + +minetest.register_node("witchcraft:portal", { + description = "portal", + drawtype = "signlike", + visual_scale = 3.0, + tiles = {"witchcraft_portal.png"}, + inventory_image = "witchcraft_portal.png", + use_texture_alpha = true, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = false, + light_source = 50, + walkable = false, + is_ground_content = true, + selection_box = { + type = "wallmounted", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + }, + 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) + end) + end, + groups = {cracky=3,dig_immediate=3, not_in_creative_inventory=1}, +}) + +minetest.register_node("witchcraft:candle", { + description = "red candle", + tiles = { + "witchcraft_candle_top.png", + "witchcraft_candle_top.png", + "witchcraft_candle.png", + "witchcraft_candle.png", + "witchcraft_candle.png", + "witchcraft_candle.png" + }, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, -0.1875, 0.1875, -0.0625, 0.1875}, -- NodeBox1 + {-0.03125, -0.5, -0.03125, 0.03125, 0.0625, 0.03125}, -- NodeBox2 + } + }, + groups = {fleshy=1, oddly_breakable_by_hand=1, dig_immediate=3}, +}) + +--other stuff + +dofile(minetest.get_modpath("witchcraft").."/scrolls.lua") +dofile(minetest.get_modpath("witchcraft").."/brewing_stand.lua") diff --git a/mods/witchcraft/init_old.lua b/mods/witchcraft/init_old.lua new file mode 100644 index 00000000..5fa9d3b4 --- /dev/null +++ b/mods/witchcraft/init_old.lua @@ -0,0 +1,2467 @@ +--Stuff from vessels + +-- - +-- Copyright (C) 2012 Vanessa Ezekowitz +-- Copyright (C) 2012 celeron55, Perttu Ahola + +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- at your option) any later version. + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. + +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +--changes so that bottles can't stack +minetest.override_item("vessels:glass_bottle", { + description = "Small Bottle (empty)", + drawtype = "plantlike", + tiles = {"vessels_glass_bottle.png"}, + inventory_image = "vessels_glass_bottle_inv.png", + wield_image = "vessels_glass_bottle.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + stack_max = 1, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1}, + sounds = default.node_sound_glass_defaults(), +}) + +local vessels_shelf_formspec = + "size[8,7;]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;vessels;0,0.3;8,2;]".. + "list[current_player;main;0,2.85;8,1;]".. + "list[current_player;main;0,4.08;8,3;8]".. + "listring[context;vessels]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0,2.85) + +minetest.register_node("witchcraft:shelf", { + description = "Potion shelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png^vessels_shelf_overlay.png"}, + is_ground_content = false, + groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", vessels_shelf_formspec) + local inv = meta:get_inventory() + inv:set_size("vessels", 8*2) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("vessels") + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + 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 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + 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 + return 1 + else + return 0 + end + end + end, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to vessels shelf at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from vessels shelf at "..minetest.pos_to_string(pos)) + end, +}) + +--my stuff + +-- Copyright (C) 2016 DOOmed + +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published by +-- the Free Software Foundation; either version 2.1 of the License, or +-- (at your option) any later version. + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. + +-- You should have received a copy of the GNU Lesser General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +minetest.register_craft({ + output = 'witchcraft:shelf', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:potion', 'group:potion', 'group:potion'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_node("witchcraft:bottle_eyes", { + description = "Jar of eyes", + drawtype = "plantlike", + tiles = {"witchcraft_jar_eyes.png"}, + inventory_image = "witchcraft_jar_eyes.png", + wield_image = "witchcraft_jar_eyes.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + stack_max = 1, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_node("witchcraft:bottle_slime", { + description = "Jar of Slime", + drawtype = "plantlike", + tiles = {"witchcraft_jar_slime.png"}, + inventory_image = "witchcraft_jar_slime.png", + wield_image = "witchcraft_jar_slime.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + stack_max = 1, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft({ + output = 'witchcraft:bottle_eyes', + recipe = { + {'moreplants:eye'}, + {'moreplants:eye'}, + {'vessels:drinking_glass'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:splash_orange', + recipe = { + {'group:stick'}, + {'witchcraft:potion_orange'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:splash_yellwgrn', + recipe = { + {'group:stick'}, + {'witchcraft:potion_yellgrn'}, + } +}) + +minetest.register_craft({ + output = "moreplants:eye 2", + type = "shapeless", + recipe = {"witchcraft:bottle_eyes"} +}) + +minetest.register_craftitem("witchcraft:herb", { + description = "herb", + inventory_image = "witchcraft_herbs.png" +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:bush"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:weed"} +}) + +minetest.register_craft({ + output = "witchcraft:herb 4", + type = "shapeless", + recipe = {"moreplants:groundfung"} +}) + +-- GENERATED CODE +-- Node Box Editor, version 0.8.1 - Glass +-- Namespace: test + +minetest.register_node("witchcraft:pot", { + description = "magic cooking pot", + tiles = { + "witchcraft_pot_top.png", + "witchcraft_pot_bottom.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png", + "witchcraft_pot_side.png" + }, + drawtype = "nodebox", + paramtype = "light", + 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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "bucket:bucket_water" or + wield_item == "bucket:bucket_river_water" then + minetest.set_node(pos, {name="witchcraft:pot_water", param2=node.param2}) + item:replace("bucket:bucket_empty") + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_craft({ + output = 'witchcraft:pot', + recipe = { + {'default:copper_lump', '', 'default:copper_lump'}, + {'default:copper_lump', '', 'default:copper_lump'}, + {'', 'default:copper_lump', ''}, + } +}) + +minetest.register_node("witchcraft:pot_water", { + tiles = { + { name = "witchcraft_pot_blue.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" + }, + drop = { + items = { + {items = {'witchcraft:pot'}, rarity = 1}, + } + }, + drawtype = "nodebox", + paramtype = "light", + 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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_blue") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + else + if wield_item == "flowers:waterlily" or + wield_item == "moreplants:bullrush" then + minetest.set_node(pos, {name="witchcraft:pot_blue2", param2=node.param2}) + item:take_item() + end + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_blue2", { + tiles = { + { name = "witchcraft_pot_blue2.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_blue2") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:dirt" or + wield_item == "default:sand" then + minetest.set_node(pos, {name="witchcraft:pot_brown", param2=node.param2}) + item:take_item() + elseif wield_item == "witchcraft:herb" then + minetest.set_node(pos, {name="witchcraft:pot_red", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_aqua", { + tiles = { + { name = "witchcraft_pot_aqua.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_aqua") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "bucket:bucket_water" or + wield_item == "bucket:bucket_river_water" then + minetest.set_node(pos, {name="witchcraft:pot_water", param2=node.param2}) + item:replace("bucket:bucket_empty") + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_brown", { + tiles = { + { name = "witchcraft_pot_brown.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_brown") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "witchcraft:bottle_eyes" then + minetest.set_node(pos, {name="witchcraft:pot_redbrown", param2=node.param2}) + item:take_item() + elseif wield_item == "vessels:drinking_glass" then + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + item:replace("witchcraft:bottle_slime") + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_redbrown", { + tiles = { + { name = "witchcraft_pot_brown.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_redbrown") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "bones:bones" then + minetest.set_node(pos, {name="witchcraft:pot_grey", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_grey", { + tiles = { + { name = "witchcraft_pot_grey.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_grey") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:copperblock" or + wield_item == "default:steelblock" then + minetest.set_node(pos, {name="witchcraft:pot_yellow", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_cyan", { + tiles = { + { name = "witchcraft_pot_cyan.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_cyan") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:obsidian_shard" or + wield_item == "default:mese_crystal_fragment" then + minetest.set_node(pos, {name="witchcraft:pot_aqua", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_darkpurple", { + tiles = { + { name = "witchcraft_pot_darkpurple.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_darkpurple") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "witchcraft:bottle_slime" or + wield_item == "moreplants:curlyfruit" then + minetest.set_node(pos, {name="witchcraft:pot_cyan", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_purple", { + tiles = { + { name = "witchcraft_pot_purple.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_purple") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:diamond" or + wield_item == "default:gold_lump" then + minetest.set_node(pos, {name="witchcraft:pot_magenta", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_green", { + tiles = { + { name = "witchcraft_pot_green.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_green") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "flowers:mushroom_red" or + wield_item == "moreplants:mushroom" then + minetest.set_node(pos, {name="witchcraft:pot_purple", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_green2", { + tiles = { + { name = "witchcraft_pot_green2.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_green2") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "moreplants:umbrella" or + wield_item == "default:grass_5" then + minetest.set_node(pos, {name="witchcraft:pot_green", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_magenta", { + tiles = { + { name = "witchcraft_pot_magenta.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_magenta") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:glass" or + wield_item == "vessels:glass_fragments" then + minetest.set_node(pos, {name="witchcraft:pot_darkpurple", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_orange", { + tiles = { + { name = "witchcraft_pot_orange.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_orange") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "tnt:tnt" then + minetest.set_node(pos, {name="witchcraft:pot_yllwgrn", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_red", { + tiles = { + { name = "witchcraft_pot_red.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_red") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:gravel" or + wield_item == "default:flint" then + minetest.set_node(pos, {name="witchcraft:pot_orange", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_yellow", { + tiles = { + { name = "witchcraft_pot_yellow.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_yellow") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "moreplants:eye" then + minetest.set_node(pos, {name="witchcraft:pot_yllwgrn", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_node("witchcraft:pot_yllwgrn", { + tiles = { + { name = "witchcraft_pot_yllwgrn.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, item, _) + local wield_item = clicker:get_wielded_item():get_name() + if wield_item == "vessels:glass_bottle" then + item:replace("witchcraft:potion_yellgrn") + minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2}) + elseif wield_item == "default:apple" then + minetest.set_node(pos, {name="witchcraft:pot_green2", param2=node.param2}) + item:take_item() + end + end, + groups = {cracky=1, falling_node=1, oddly_breakable_by_hand=1, potion=1} +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_water", "witchcraft:pot_blue2", "witchcraft:pot_cyan", "witchcraft:pot_green", "witchcraft:pot_green2", "witchcraft:pot_aqua", "witchcraft:pot_yellow", "witchcraft:pot_yllwgrn", "witchcraft:pot_red", "witchcraft:pot_magenta", "witchcraft:pot_brown"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_bubbles.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_purple"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 5, + maxsize = 8, + collisiondetection = false, + texture = "witchcraft_smoke.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_darkpurple"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_symbol.png" + }) + end +}) + +minetest.register_abm({ + nodenames = {"witchcraft:pot_orange"}, + interval = 0.5, + chance = 1, + action = function(pos, node) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1}, + maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1}, + minvel = {x=0, y=0.5, z=0}, + maxvel = {x=0, y=0.6, z=0}, + minacc = {x=0, y=0.2, z=0}, + maxacc = {x=0, y=0.3, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 3, + collisiondetection = false, + texture = "witchcraft_flame.png" + }) + end +}) + +minetest.register_node("witchcraft:potion_red", { + description = "Tasty Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_red.png"}, + wield_image = "witchcraft_potion_red.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_red.png", + on_use = minetest.item_eat(100, "vessels:glass_bottle"), +}) + +minetest.register_tool("witchcraft:potion_darkpurple", { + description = "Shady Potion", + wield_image = "witchcraft_potion_darkpurple.png", + inventory_image = "witchcraft_potion_darkpurple.png", + on_use = function(item, user) + default.player_set_skin(user, "witchcraft_skin.png") + minetest.after(30, function() + default.player_set_skin(user, "character.png") + 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:add_wear(30000) + return item + end, +}) + +minetest.register_node("witchcraft:potion_brown", { + description = "Murky Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_brown.png"}, + wield_image = "witchcraft_potion_brown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_brown.png", + on_use = minetest.item_eat(-5, "vessels:glass_bottle"), +}) + +--this one isn't removed but the player will die after using it so it hasn't been fixed +minetest.register_node("witchcraft:potion_yellgrn", { + description = "Dodgy Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_yellgrn.png"}, + wield_image = "witchcraft_potion_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 = {vessel=1,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) + local pos = placer:getpos(); + tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false}) + 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() + 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:fire" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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: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 + 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 + ) + + end, +}) + +minetest.register_entity("witchcraft:tnt_splash", { + textures = {"witchcraft_splash_yellgrn.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:tnt_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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" then + local pos = self.object:getpos() + minetest.sound_play("default_break_glass.1.ogg", { + 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 + minetest.env:set_node(t, {name="fire:basic_flame"}) + end + end + end + end + end + + end, +}) + + +minetest.register_entity("witchcraft:fire_splash", { + textures = {"witchcraft_splash_orange.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:fire_splash" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=1}, + }, nil) + 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:fire_splash" and n ~= "air" then + 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 + + end, +}) + +minetest.register_node("witchcraft:potion_orange", { + description = "Dragon Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_orange.png"}, + wield_image = "witchcraft_potion_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 = {vessel=1,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 + ) + + item:replace("vessels:glass_bottle") + return item + end, +}) + +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 = {vessel=1,dig_immediate=3,attached_node=1, potion=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 = {vessel=1,dig_immediate=3,attached_node=1, potion=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, +}) + +minetest.register_node("witchcraft:potion_purple", { + description = "Smokey Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_purple.png"}, + wield_image = "witchcraft_potion_purple.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_purple.png", + on_use = function(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 + end, +}) + +minetest.register_node("witchcraft:potion_grey", { + description = "Evil Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_grey.png"}, + wield_image = "witchcraft_potion_grey.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_grey.png", + on_use = minetest.item_eat(-100, "vessels:glass_bottle"), +}) + +minetest.register_node("witchcraft:potion_blue", { + description = "Bottle of Water", + drawtype = "plantlike", + tiles = {"witchcraft_potion_blue.png"}, + wield_image = "witchcraft_potion_blue.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_blue.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="default:water_source"}) + else + minetest.chat_send_player(player, "This area is protected.") + end + end + item:replace("vessels:glass_bottle") + return item + end +}) + +if minetest.get_modpath("farming") 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 = {vessel=1,dig_immediate=3,attached_node=1, potion=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.") + 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 + end +}) +end + +minetest.register_node("witchcraft:potion_yellow", { + description = "Alchemy Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_yellow.png"}, + wield_image = "witchcraft_potion_yellow.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_yellow.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="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 + 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 = {vessel=1,dig_immediate=3,attached_node=1, potion=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 +}) +end + +minetest.register_node("witchcraft:potion_magenta", { + description = "Strong Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_magenta.png"}, + wield_image = "witchcraft_potion_magenta.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_magenta.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + local effect = user:set_physics_override({ + + speed = 2.0, -- multiplier to default value + jump = 1, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + local reset = minetest.after(10, function() + user:set_breath(11) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + 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 +}) + +minetest.register_node("witchcraft:potion_cyan", { + description = "Light Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_cyan.png"}, + wield_image = "witchcraft_potion_cyan.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_cyan.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1, -- multiplier to default value + gravity = 0.1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + local reset = minetest.after(10, function() + user:set_breath(11) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + 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 +}) + +minetest.register_node("witchcraft:potion_green2", { + description = "Volatile Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_green2.png"}, + wield_image = "witchcraft_potion_green2.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_green2.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.5, -- multiplier to default value + gravity = 0.8, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + local reset = minetest.after(6, function() + user:set_breath(11) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + 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 +}) + +minetest.register_node("witchcraft:potion_redbrown", { + description = "Thick Potion", + drawtype = "plantlike", + tiles = {"witchcraft_potion_redbrown.png"}, + wield_image = "witchcraft_potion_redbrown.png", + paramtype = "light", + stack_max = 1, + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_redbrown.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath_change = user:set_breath(5) + local effect = user:set_physics_override({ + + speed = 0.5, -- multiplier to default value + jump = 1, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + local reset = minetest.after(10, function() + user:set_breath(11) + local effect = user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + 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 +}) + +minetest.register_node("witchcraft:potion_blue2", { + description = "Watery Potion", + drawtype = "plantlike", + stack_max = 1, + tiles = {"witchcraft_potion_blue2.png"}, + wield_image = "witchcraft_potion_blue2.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1}, + sounds = default.node_sound_glass_defaults(), + inventory_image = "witchcraft_potion_blue2.png", + on_use = function(item, user, pointed_thing) + local player = user:get_player_name() + local breath = user:get_breath() + if breath <= 10 then + local spd = user:set_physics_override({ + + speed = 3, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1.0, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + end + local reset = minetest.after(20, function() + user:set_physics_override({ + + speed = 1.0, -- multiplier to default value + jump = 1.0, -- multiplier to default value + gravity = 1.0, -- multiplier to default value + sneak = true, -- whether player can sneak + sneak_glitch = false, -- whether player can use the sneak glitch + + }) + 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 +}) + +--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, +}) + +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, +}) + +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, +}) +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 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:fireball") + obj:setvelocity(vec) + + 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, +}) +else +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 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:lightning") + obj:setvelocity(vec) + + 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, +}) + + +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, +}) + +minetest.register_craftitem("witchcraft:scroll", { + description = "Blank Scroll", + inventory_image = "witchcraft_scroll.png", +}) + +if minetest.get_modpath("pmobs")then +minetest.register_craft({ + output = 'witchcraft:scroll_wild', + recipe = { + {'mobs:meat_raw'}, + {'witchcraft:scroll'}, + } +}) + +end + +minetest.register_craft({ + output = 'witchcraft:scroll', + recipe = { + {'default:paper', 'default:diamond', 'default:paper'}, + {'default:paper', 'default:paper', 'default:paper'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_icicle', + recipe = { + {'default:ice'}, + {'witchcraft:scroll'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_fireball', + recipe = { + {'default:obsidian_shard'}, + {'witchcraft:scroll'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_nature', + recipe = { + {'default:leaves'}, + {'witchcraft:scroll'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_day', + recipe = { + {'default:torch'}, + {'witchcraft:scroll'}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_night', + recipe = { + {'default:coal_lump'}, + {'witchcraft:scroll'}, + } +}) + + +minetest.register_craft({ + output = 'witchcraft:scroll_lightning', + recipe = { + {'default:steel_ingot'}, + {'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" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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:fireball" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" 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 + 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 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_flame.png" --texture + ) + + end, +}) + +minetest.register_entity("witchcraft:lightning", { + textures = {"witchcraft_light_over.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:lightning" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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:lightning" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then + if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then + minetest.env:set_node(t, {name="fire:basic_flame"}) + end + elseif n == "default:wood" or n =="default:tree" or n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then + self.object:remove() + return + end + end + end + 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 + 1, --minexptime + 2, --maxexptime + 1, --minsize + 2, --maxsize + false, --collisiondetection + "witchcraft_zap.png" --texture + ) + + 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" then + obj:remove() + local treepos = self.object:getpos() + default.grow_new_jungle_tree(treepos) + 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:tree" and n ~="air" 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 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.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(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:ice" and obj:get_luaentity().name ~= "__builtin:item" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=1}, + }, nil) + self.object:remove() + 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 + 0.1, --minexptime + 0.3, --maxexptime + 0.2, --minsize + 0.5, --maxsize + false, --collisiondetection + "witchcraft_light_over.png" --texture + ) + end + end +}) \ No newline at end of file diff --git a/mods/witchcraft/license.txt b/mods/witchcraft/license.txt new file mode 100644 index 00000000..e084112f --- /dev/null +++ b/mods/witchcraft/license.txt @@ -0,0 +1,29 @@ + +License for Code +---------------- + +Copyright (C) 2016 D00Med + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +License for Textures, Models and Sounds +--------------------------------------- + +CC-BY-SA 3.0 UNPORTED. Created by D00Med + +All potion bottles derived from +vessels_glass_bottle.png (by Authors) + +kilbith (WTFPL) diff --git a/mods/witchcraft/models/3quarters.obj b/mods/witchcraft/models/3quarters.obj new file mode 100644 index 00000000..5296c75d --- /dev/null +++ b/mods/witchcraft/models/3quarters.obj @@ -0,0 +1,19 @@ +mtllib 3 4ths.mtl +o converted_out +v 0.375 -0.25 -0.375 +v 0.375 -0.25 0.375 +v 0.375 0.1875 0.375 +v 0.375 0.1875 -0.375 +v -0.375 -0.25 -0.375 +v -0.375 -0.25 0.375 +v -0.375 0.1875 0.375 +v -0.375 0.1875 -0.375 +usemtl none +s off +g nodebox21 +f 1 2 3 4 +f 5 6 7 8 +f 1 4 8 5 +f 2 3 7 6 +f 1 2 6 5 +f 4 3 7 8 diff --git a/mods/witchcraft/models/4th.obj b/mods/witchcraft/models/4th.obj new file mode 100644 index 00000000..a403a915 --- /dev/null +++ b/mods/witchcraft/models/4th.obj @@ -0,0 +1,19 @@ +mtllib 1 4th.mtl +o converted_out +v 0.375 -0.25 -0.375 +v 0.375 -0.25 0.375 +v 0.375 -0.0625 0.375 +v 0.375 -0.0625 -0.375 +v -0.375 -0.25 -0.375 +v -0.375 -0.25 0.375 +v -0.375 -0.0625 0.375 +v -0.375 -0.0625 -0.375 +usemtl none +s off +g nodebox21 +f 1 2 3 4 +f 5 6 7 8 +f 1 4 8 5 +f 2 3 7 6 +f 1 2 6 5 +f 4 3 7 8 diff --git a/mods/witchcraft/models/full.obj b/mods/witchcraft/models/full.obj new file mode 100644 index 00000000..6291a6da --- /dev/null +++ b/mods/witchcraft/models/full.obj @@ -0,0 +1,19 @@ +mtllib full.mtl +o converted_out +v 0.375 -0.25 -0.375 +v 0.375 -0.25 0.375 +v 0.375 0.375 0.375 +v 0.375 0.375 -0.375 +v -0.375 -0.25 -0.375 +v -0.375 -0.25 0.375 +v -0.375 0.375 0.375 +v -0.375 0.375 -0.375 +usemtl none +s off +g nodebox21 +f 1 2 3 4 +f 5 6 7 8 +f 1 4 8 5 +f 2 3 7 6 +f 1 2 6 5 +f 4 3 7 8 diff --git a/mods/witchcraft/models/half.obj b/mods/witchcraft/models/half.obj new file mode 100644 index 00000000..ecb9cf17 --- /dev/null +++ b/mods/witchcraft/models/half.obj @@ -0,0 +1,19 @@ +mtllib half.mtl +o converted_out +v 0.375 -0.25 -0.375 +v 0.375 -0.25 0.375 +v 0.375 0.0625 0.375 +v 0.375 0.0625 -0.375 +v -0.375 -0.25 -0.375 +v -0.375 -0.25 0.375 +v -0.375 0.0625 0.375 +v -0.375 0.0625 -0.375 +usemtl none +s off +g nodebox21 +f 1 2 3 4 +f 5 6 7 8 +f 1 4 8 5 +f 2 3 7 6 +f 1 2 6 5 +f 4 3 7 8 diff --git a/mods/witchcraft/readme.txt b/mods/witchcraft/readme.txt new file mode 100644 index 00000000..f9e4d6e7 --- /dev/null +++ b/mods/witchcraft/readme.txt @@ -0,0 +1,80 @@ +Witchcraft by D00Med +Some notes: +>farming_redo is required for the mod even though this is not shown in depends.txt +>mobs_redo is optionally required for the mod, but since pmobs requires it, it is assumed that if you have pmobs then you have mobs. +>Some potions are dangerous! + +Some crafting recipes: + +herbs(shapeless): +weed or groundfungus or bush + +jar of eyes: +eye, X, X +eye, X. X +drinking glass, X, X + +eyes(shapeless): +jar of eyes + +magic cooking pot: +copper lump, X, copper lump +copper lump, X, copper lump +X, copper lump, X + +the magic cooking pot cooks its contents without fire, so there is no need to light a fire underneath. + +potion shelf: +wood, wood, wood +potion, potion, potion +wood, wood, wood + +empty scroll: +paper, diamond, paper +paper, paper, paper + +Need some slime? try scraping it out of an empty cauldron with a drinking glass. + +Potion ingredients(may be slightly inaccurate): +>herbs +>jar of eyes +>diamond +>apple +>gold lumps +>mese crystal fragment +>obsidian shard +>jar of slime +>curlyfruit +>mushroom(moreplants) +>red mushroom(flowers) +>grass +>umbrella plant +>glass +>glass fragments +>flint +>tnt +>copper block +>steel block +>steel ingot +>lilypad +>dirt +>sand +>gravel +>bucket of water +>bullrush +>bones + +About the recipes: + +init.lua contains the pot recipes. For each pot there is a line similar to the one below, in the 'witchraft.pot' table. + +{"blue", "brown", "default:dirt", "blue2", "moreplants:bullrush", "red", "purple"}, +{"potion name", "result1", "ingredient1", "result2", "ingredient2", "combine potion", "combine result"} + +The first column of the table("blue"), is the color of the current potion pot. In the example, it is the blue pot, so the ingredients and results in the other columns +will apply to the blue pot, ie: the blue pot must be rightclicked. It is important that the name of the pot is in the name of it's texture, eg: a blue pot has the texture "witchraft_pot_blue.png" + +The second and fourth columns are the two possible results after adding new ingredients. The last column is the result after combining the current potion with another. + +The third and fifth columns are the ingredients required. The ingredient req. to make the potion in column 2 must be in column 3, and the ingredient req. to make the potion in columns 4 must be in columns 5. +The 6th column is the potion that can be combined with the current potion to make a new potion. \ No newline at end of file diff --git a/mods/witchcraft/recipes.gfie b/mods/witchcraft/recipes.gfie new file mode 100644 index 00000000..f3fe2659 Binary files /dev/null and b/mods/witchcraft/recipes.gfie differ diff --git a/mods/witchcraft/screenshot.png b/mods/witchcraft/screenshot.png new file mode 100644 index 00000000..87c736ee Binary files /dev/null and b/mods/witchcraft/screenshot.png differ diff --git a/mods/witchcraft/scrolls.lua b/mods/witchcraft/scrolls.lua new file mode 100644 index 00000000..91025992 --- /dev/null +++ b/mods/witchcraft/scrolls.lua @@ -0,0 +1,426 @@ +--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, +}) + +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, +}) + +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, +}) +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, +}) + +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, +}) +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, +}) + + +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, +}) + +minetest.register_craftitem("witchcraft:scroll", { + 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, +}) + +if minetest.get_modpath("pmobs")then +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', ''}, + } +}) + +minetest.register_craft({ + output = 'witchcraft:scroll_recipe', + recipe = { + {'dye:black'}, + {'witchcraft:scroll'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + +minetest.register_craft({ + 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'}, + } +}) + + +--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" then + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=3}, + }, nil) + 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:fireball" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" 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 + 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, +}) + + + +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" then + obj:remove() + local treepos = self.object:getpos() + default.grow_new_jungle_tree(treepos) + 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:tree" and n ~="air" 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 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.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) + for k, obj in pairs(objs) do + if obj:get_luaentity() ~= nil then + if obj:get_luaentity().name ~= "witchcraft:ice" and obj:get_luaentity().name ~= "__builtin:item" then + 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" 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 + 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 + 0.1, --minexptime + 0.3, --maxexptime + 0.2, --minsize + 0.5, --maxsize + false, --collisiondetection + "witchcraft_light_over.png" --texture + ) + end + end +}) \ No newline at end of file diff --git a/mods/witchcraft/sounds/license.txt b/mods/witchcraft/sounds/license.txt new file mode 100644 index 00000000..3cf28820 --- /dev/null +++ b/mods/witchcraft/sounds/license.txt @@ -0,0 +1,2 @@ + +Pop sound from www.freesfx.co.uk diff --git a/mods/witchcraft/sounds/pop.ogg b/mods/witchcraft/sounds/pop.ogg new file mode 100644 index 00000000..7bbad923 Binary files /dev/null and b/mods/witchcraft/sounds/pop.ogg differ diff --git a/mods/witchcraft/textures/vessels_shelf_overlay.png b/mods/witchcraft/textures/vessels_shelf_overlay.png new file mode 100644 index 00000000..8cd17c7c Binary files /dev/null and b/mods/witchcraft/textures/vessels_shelf_overlay.png differ diff --git a/mods/witchcraft/textures/witchcraft_bone.png b/mods/witchcraft/textures/witchcraft_bone.png new file mode 100644 index 00000000..c7b9eef7 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_bone.png differ diff --git a/mods/witchcraft/textures/witchcraft_bone_bottle.png b/mods/witchcraft/textures/witchcraft_bone_bottle.png new file mode 100644 index 00000000..d02e6cd6 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_bone_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_brewing_stand_inv.png b/mods/witchcraft/textures/witchcraft_brewing_stand_inv.png new file mode 100644 index 00000000..b7ab8e3a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_brewing_stand_inv.png differ diff --git a/mods/witchcraft/textures/witchcraft_brewing_stand_side.png b/mods/witchcraft/textures/witchcraft_brewing_stand_side.png new file mode 100644 index 00000000..f6b28894 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_brewing_stand_side.png differ diff --git a/mods/witchcraft/textures/witchcraft_brewing_stand_top.png b/mods/witchcraft/textures/witchcraft_brewing_stand_top.png new file mode 100644 index 00000000..a6df8543 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_brewing_stand_top.png differ diff --git a/mods/witchcraft/textures/witchcraft_bubble.png b/mods/witchcraft/textures/witchcraft_bubble.png new file mode 100644 index 00000000..ec5d31e2 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_bubble.png differ diff --git a/mods/witchcraft/textures/witchcraft_bubbles.png b/mods/witchcraft/textures/witchcraft_bubbles.png new file mode 100644 index 00000000..aeb551c8 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_bubbles.png differ diff --git a/mods/witchcraft/textures/witchcraft_bubbles_pink.png b/mods/witchcraft/textures/witchcraft_bubbles_pink.png new file mode 100644 index 00000000..9d242dc5 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_bubbles_pink.png differ diff --git a/mods/witchcraft/textures/witchcraft_candle.png b/mods/witchcraft/textures/witchcraft_candle.png new file mode 100644 index 00000000..616bfa54 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_candle.png differ diff --git a/mods/witchcraft/textures/witchcraft_candle_top.png b/mods/witchcraft/textures/witchcraft_candle_top.png new file mode 100644 index 00000000..0a836431 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_candle_top.png differ diff --git a/mods/witchcraft/textures/witchcraft_dagger.png b/mods/witchcraft/textures/witchcraft_dagger.png new file mode 100644 index 00000000..efd1b608 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_dagger.png differ diff --git a/mods/witchcraft/textures/witchcraft_dark_over.png b/mods/witchcraft/textures/witchcraft_dark_over.png new file mode 100644 index 00000000..d0505242 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_dark_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_effect.png b/mods/witchcraft/textures/witchcraft_effect.png new file mode 100644 index 00000000..fb48a589 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_effect.png differ diff --git a/mods/witchcraft/textures/witchcraft_fire_over.png b/mods/witchcraft/textures/witchcraft_fire_over.png new file mode 100644 index 00000000..f3d5edee Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_fire_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_flame.png b/mods/witchcraft/textures/witchcraft_flame.png new file mode 100644 index 00000000..ebe772f5 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_flame.png differ diff --git a/mods/witchcraft/textures/witchcraft_herb_bottle.png b/mods/witchcraft/textures/witchcraft_herb_bottle.png new file mode 100644 index 00000000..fd7e2878 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_herb_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_herbs.png b/mods/witchcraft/textures/witchcraft_herbs.png new file mode 100644 index 00000000..9672acd6 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_herbs.png differ diff --git a/mods/witchcraft/textures/witchcraft_horn.png b/mods/witchcraft/textures/witchcraft_horn.png new file mode 100644 index 00000000..8bfb9d37 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_horn.png differ diff --git a/mods/witchcraft/textures/witchcraft_ice.png b/mods/witchcraft/textures/witchcraft_ice.png new file mode 100644 index 00000000..72e9a857 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_ice.png differ diff --git a/mods/witchcraft/textures/witchcraft_ice_over.png b/mods/witchcraft/textures/witchcraft_ice_over.png new file mode 100644 index 00000000..46cdba7b Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_ice_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_jar_eyes.png b/mods/witchcraft/textures/witchcraft_jar_eyes.png new file mode 100644 index 00000000..93995e16 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_jar_eyes.png differ diff --git a/mods/witchcraft/textures/witchcraft_jar_slime.png b/mods/witchcraft/textures/witchcraft_jar_slime.png new file mode 100644 index 00000000..b307bd5d Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_jar_slime.png differ diff --git a/mods/witchcraft/textures/witchcraft_launcher.png b/mods/witchcraft/textures/witchcraft_launcher.png new file mode 100644 index 00000000..7209ec50 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_launcher.png differ diff --git a/mods/witchcraft/textures/witchcraft_launcher_potion.png b/mods/witchcraft/textures/witchcraft_launcher_potion.png new file mode 100644 index 00000000..d996b768 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_launcher_potion.png differ diff --git a/mods/witchcraft/textures/witchcraft_leaf_over.png b/mods/witchcraft/textures/witchcraft_leaf_over.png new file mode 100644 index 00000000..a8fccf57 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_leaf_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_light_over.png b/mods/witchcraft/textures/witchcraft_light_over.png new file mode 100644 index 00000000..f053109c Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_light_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_medicine_bottle.png b/mods/witchcraft/textures/witchcraft_medicine_bottle.png new file mode 100644 index 00000000..5c3b7bd3 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_medicine_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_moon_over.png b/mods/witchcraft/textures/witchcraft_moon_over.png new file mode 100644 index 00000000..5cae0907 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_moon_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_mud_bottle.png b/mods/witchcraft/textures/witchcraft_mud_bottle.png new file mode 100644 index 00000000..3ebaae57 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_mud_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_penta.png b/mods/witchcraft/textures/witchcraft_penta.png new file mode 100644 index 00000000..bb879300 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_penta.png differ diff --git a/mods/witchcraft/textures/witchcraft_pentablock.png b/mods/witchcraft/textures/witchcraft_pentablock.png new file mode 100644 index 00000000..68c18266 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pentablock.png differ diff --git a/mods/witchcraft/textures/witchcraft_pentagram.png b/mods/witchcraft/textures/witchcraft_pentagram.png new file mode 100644 index 00000000..761e0b0a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pentagram.png differ diff --git a/mods/witchcraft/textures/witchcraft_portal.png b/mods/witchcraft/textures/witchcraft_portal.png new file mode 100644 index 00000000..9da60260 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_portal.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_aqua.png b/mods/witchcraft/textures/witchcraft_pot_aqua.png new file mode 100644 index 00000000..31f0459e Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_aqua.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_blue.png b/mods/witchcraft/textures/witchcraft_pot_blue.png new file mode 100644 index 00000000..fc6eb8e0 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_blue.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_blue2.png b/mods/witchcraft/textures/witchcraft_pot_blue2.png new file mode 100644 index 00000000..6b43a87f Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_blue2.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_bottom.png b/mods/witchcraft/textures/witchcraft_pot_bottom.png new file mode 100644 index 00000000..e927ddad Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_bottom.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_brown.png b/mods/witchcraft/textures/witchcraft_pot_brown.png new file mode 100644 index 00000000..0b0919db Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_brown.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_cyan.png b/mods/witchcraft/textures/witchcraft_pot_cyan.png new file mode 100644 index 00000000..1f4d759c Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_cyan.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_darkpurple.png b/mods/witchcraft/textures/witchcraft_pot_darkpurple.png new file mode 100644 index 00000000..c2ceb4da Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_darkpurple.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_gcyan.png b/mods/witchcraft/textures/witchcraft_pot_gcyan.png new file mode 100644 index 00000000..5a900dc0 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_gcyan.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_ggreen.png b/mods/witchcraft/textures/witchcraft_pot_ggreen.png new file mode 100644 index 00000000..3976c4c4 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_ggreen.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_gold.png b/mods/witchcraft/textures/witchcraft_pot_gold.png new file mode 100644 index 00000000..ce85062a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_gold.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_gpurple.png b/mods/witchcraft/textures/witchcraft_pot_gpurple.png new file mode 100644 index 00000000..a1c55d64 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_gpurple.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_gred.png b/mods/witchcraft/textures/witchcraft_pot_gred.png new file mode 100644 index 00000000..4b8fa71a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_gred.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_green.png b/mods/witchcraft/textures/witchcraft_pot_green.png new file mode 100644 index 00000000..4551647f Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_green.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_green2.png b/mods/witchcraft/textures/witchcraft_pot_green2.png new file mode 100644 index 00000000..4e920d5f Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_green2.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_grey.png b/mods/witchcraft/textures/witchcraft_pot_grey.png new file mode 100644 index 00000000..5c82af5b Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_grey.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_inv.png b/mods/witchcraft/textures/witchcraft_pot_inv.png new file mode 100644 index 00000000..a27128f6 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_inv.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_magenta.png b/mods/witchcraft/textures/witchcraft_pot_magenta.png new file mode 100644 index 00000000..db9c1609 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_magenta.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_orange.png b/mods/witchcraft/textures/witchcraft_pot_orange.png new file mode 100644 index 00000000..87f1ce64 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_orange.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_purple.png b/mods/witchcraft/textures/witchcraft_pot_purple.png new file mode 100644 index 00000000..83481eaf Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_purple.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_red.png b/mods/witchcraft/textures/witchcraft_pot_red.png new file mode 100644 index 00000000..52b1336e Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_red.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_redbrown.png b/mods/witchcraft/textures/witchcraft_pot_redbrown.png new file mode 100644 index 00000000..935dfaec Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_redbrown.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_side.png b/mods/witchcraft/textures/witchcraft_pot_side.png new file mode 100644 index 00000000..6bf34744 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_side.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_silver.png b/mods/witchcraft/textures/witchcraft_pot_silver.png new file mode 100644 index 00000000..acfc636e Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_silver.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_top.png b/mods/witchcraft/textures/witchcraft_pot_top.png new file mode 100644 index 00000000..dc931abd Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_top.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_yellow.png b/mods/witchcraft/textures/witchcraft_pot_yellow.png new file mode 100644 index 00000000..6bc1e2dc Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_yellow.png differ diff --git a/mods/witchcraft/textures/witchcraft_pot_yllwgrn.png b/mods/witchcraft/textures/witchcraft_pot_yllwgrn.png new file mode 100644 index 00000000..bf503560 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_pot_yllwgrn.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_aqua.png b/mods/witchcraft/textures/witchcraft_potion_aqua.png new file mode 100644 index 00000000..7641434e Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_aqua.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_blue.png b/mods/witchcraft/textures/witchcraft_potion_blue.png new file mode 100644 index 00000000..f9e20b0b Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_blue.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_blue2.png b/mods/witchcraft/textures/witchcraft_potion_blue2.png new file mode 100644 index 00000000..5df135c2 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_blue2.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_brown.png b/mods/witchcraft/textures/witchcraft_potion_brown.png new file mode 100644 index 00000000..a8aa56dc Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_brown.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_cyan.png b/mods/witchcraft/textures/witchcraft_potion_cyan.png new file mode 100644 index 00000000..ef921ce8 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_cyan.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_darkpurple.png b/mods/witchcraft/textures/witchcraft_potion_darkpurple.png new file mode 100644 index 00000000..10691f60 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_darkpurple.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_gcyan.png b/mods/witchcraft/textures/witchcraft_potion_gcyan.png new file mode 100644 index 00000000..c8ce29a5 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_gcyan.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_ggreen.png b/mods/witchcraft/textures/witchcraft_potion_ggreen.png new file mode 100644 index 00000000..ff6ca3be Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_ggreen.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_gold.png b/mods/witchcraft/textures/witchcraft_potion_gold.png new file mode 100644 index 00000000..f4b71c88 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_gold.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_gpurple.png b/mods/witchcraft/textures/witchcraft_potion_gpurple.png new file mode 100644 index 00000000..46c938ef Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_gpurple.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_gred.png b/mods/witchcraft/textures/witchcraft_potion_gred.png new file mode 100644 index 00000000..2c777dac Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_gred.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_green.png b/mods/witchcraft/textures/witchcraft_potion_green.png new file mode 100644 index 00000000..bab51aea Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_green.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_green2.png b/mods/witchcraft/textures/witchcraft_potion_green2.png new file mode 100644 index 00000000..eef8a566 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_green2.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_grey.png b/mods/witchcraft/textures/witchcraft_potion_grey.png new file mode 100644 index 00000000..b2bf2d39 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_grey.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_magenta.png b/mods/witchcraft/textures/witchcraft_potion_magenta.png new file mode 100644 index 00000000..aa7bd229 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_magenta.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_orange.png b/mods/witchcraft/textures/witchcraft_potion_orange.png new file mode 100644 index 00000000..8cb73264 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_orange.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_purple.png b/mods/witchcraft/textures/witchcraft_potion_purple.png new file mode 100644 index 00000000..8baedebf Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_purple.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_red.png b/mods/witchcraft/textures/witchcraft_potion_red.png new file mode 100644 index 00000000..2eb7630f Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_red.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_redbrown.png b/mods/witchcraft/textures/witchcraft_potion_redbrown.png new file mode 100644 index 00000000..aaa75b9d Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_redbrown.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_silver.png b/mods/witchcraft/textures/witchcraft_potion_silver.png new file mode 100644 index 00000000..a9609b6c Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_silver.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_yellgrn.png b/mods/witchcraft/textures/witchcraft_potion_yellgrn.png new file mode 100644 index 00000000..b8072d34 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_yellgrn.png differ diff --git a/mods/witchcraft/textures/witchcraft_potion_yellow.png b/mods/witchcraft/textures/witchcraft_potion_yellow.png new file mode 100644 index 00000000..363043e2 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_potion_yellow.png differ diff --git a/mods/witchcraft/textures/witchcraft_recipes.png b/mods/witchcraft/textures/witchcraft_recipes.png new file mode 100644 index 00000000..aac31b31 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_recipes.png differ diff --git a/mods/witchcraft/textures/witchcraft_recipes_old.png b/mods/witchcraft/textures/witchcraft_recipes_old.png new file mode 100644 index 00000000..22545b39 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_recipes_old.png differ diff --git a/mods/witchcraft/textures/witchcraft_scroll.png b/mods/witchcraft/textures/witchcraft_scroll.png new file mode 100644 index 00000000..e5de430a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_scroll.png differ diff --git a/mods/witchcraft/textures/witchcraft_skin.png b/mods/witchcraft/textures/witchcraft_skin.png new file mode 100644 index 00000000..4d7beb80 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_skin.png differ diff --git a/mods/witchcraft/textures/witchcraft_slime_bottle.png b/mods/witchcraft/textures/witchcraft_slime_bottle.png new file mode 100644 index 00000000..b0ee24e2 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_slime_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_small_bottle.png b/mods/witchcraft/textures/witchcraft_small_bottle.png new file mode 100644 index 00000000..d0eb0c8c Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_small_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_smoke.png b/mods/witchcraft/textures/witchcraft_smoke.png new file mode 100644 index 00000000..78b00d84 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_smoke.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_blue2.png b/mods/witchcraft/textures/witchcraft_splash_blue2.png new file mode 100644 index 00000000..53162943 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_blue2.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_brown.png b/mods/witchcraft/textures/witchcraft_splash_brown.png new file mode 100644 index 00000000..42da159d Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_brown.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_cyan.png b/mods/witchcraft/textures/witchcraft_splash_cyan.png new file mode 100644 index 00000000..0c3e1011 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_cyan.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_darkpurple.png b/mods/witchcraft/textures/witchcraft_splash_darkpurple.png new file mode 100644 index 00000000..4bff207a Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_darkpurple.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_ggreen.png b/mods/witchcraft/textures/witchcraft_splash_ggreen.png new file mode 100644 index 00000000..0868262d Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_ggreen.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_green.png b/mods/witchcraft/textures/witchcraft_splash_green.png new file mode 100644 index 00000000..9e5ee5dc Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_green.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_grey.png b/mods/witchcraft/textures/witchcraft_splash_grey.png new file mode 100644 index 00000000..903c4bef Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_grey.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_magenta.png b/mods/witchcraft/textures/witchcraft_splash_magenta.png new file mode 100644 index 00000000..dbb1e9b2 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_magenta.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_orange.png b/mods/witchcraft/textures/witchcraft_splash_orange.png new file mode 100644 index 00000000..47418a78 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_orange.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_purple.png b/mods/witchcraft/textures/witchcraft_splash_purple.png new file mode 100644 index 00000000..e432b9ec Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_purple.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_red.png b/mods/witchcraft/textures/witchcraft_splash_red.png new file mode 100644 index 00000000..a22f8649 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_red.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_redbrown.png b/mods/witchcraft/textures/witchcraft_splash_redbrown.png new file mode 100644 index 00000000..ef44dd33 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_redbrown.png differ diff --git a/mods/witchcraft/textures/witchcraft_splash_yellgrn.png b/mods/witchcraft/textures/witchcraft_splash_yellgrn.png new file mode 100644 index 00000000..54633dfa Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_splash_yellgrn.png differ diff --git a/mods/witchcraft/textures/witchcraft_sun_over.png b/mods/witchcraft/textures/witchcraft_sun_over.png new file mode 100644 index 00000000..f486f0d8 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_sun_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_symbol.png b/mods/witchcraft/textures/witchcraft_symbol.png new file mode 100644 index 00000000..548f3fb9 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_symbol.png differ diff --git a/mods/witchcraft/textures/witchcraft_thunder_over.png b/mods/witchcraft/textures/witchcraft_thunder_over.png new file mode 100644 index 00000000..634f0016 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_thunder_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_tooth.png b/mods/witchcraft/textures/witchcraft_tooth.png new file mode 100644 index 00000000..50ac6b21 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_tooth.png differ diff --git a/mods/witchcraft/textures/witchcraft_water_bottle.png b/mods/witchcraft/textures/witchcraft_water_bottle.png new file mode 100644 index 00000000..785ad7d3 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_water_bottle.png differ diff --git a/mods/witchcraft/textures/witchcraft_water_over.png b/mods/witchcraft/textures/witchcraft_water_over.png new file mode 100644 index 00000000..40677aa6 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_water_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_writing_over.png b/mods/witchcraft/textures/witchcraft_writing_over.png new file mode 100644 index 00000000..a69e1a65 Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_writing_over.png differ diff --git a/mods/witchcraft/textures/witchcraft_zap.png b/mods/witchcraft/textures/witchcraft_zap.png new file mode 100644 index 00000000..8bc9f58e Binary files /dev/null and b/mods/witchcraft/textures/witchcraft_zap.png differ