From 423367083f3cdd9ed1404f8bf5366de8d57d9a71 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 1 Mar 2017 16:36:26 +0100 Subject: [PATCH] Add water bottle and base potions --- mods/ITEMS/mcl_potions/init.lua | 53 +++++++++++++++++- .../mcl_potions_potion_bottle_drinkable.png | Bin 0 -> 423 bytes .../mcl_potions_potion_bottle_empty.png | Bin 0 -> 423 bytes .../textures/mcl_potions_potion_overlay.png | Bin 0 -> 235 bytes .../textures/vessels_glass_bottle_inv.png | Bin 230 -> 0 bytes 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png create mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_empty.png create mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png delete mode 100644 mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index a89da659..66d09ee6 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -14,8 +14,8 @@ minetest.register_craft({ minetest.register_craftitem("mcl_potions:glass_bottle", { description = "Glass Bottle", - inventory_image = "vessels_glass_bottle_inv.png", - wield_image = "vessels_glass_bottle_inv.png", + inventory_image = "mcl_potions_potion_bottle_empty.png", + wield_image = "mcl_potions_potion_bottle_empty.png", groups = {brewitem=1}, }) @@ -27,6 +27,55 @@ minetest.register_craft( { } }) +-- Tempalte function for creating images of filled potions +-- - colorstring must be a ColorString of form “#RRGGBB”, e.g. “#0000FF” for blue. +-- - opacity is optional opacity from 0-255 (default: 127) +local potion_image = function(colorstring, opacity) + if not opacity then + opacity = 127 + end + return "mcl_potions_potion_bottle_drinkable.png^(mcl_potions_potion_overlay.png^[colorize:"..colorstring..":"..tostring(opacity)..")" +end + +-- Itemstring of potions is “mcl_potions:potion_” + +minetest.register_craftitem("mcl_potions:potion_water", { + description = "Water Bottle", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_awkward", { + description = "Awkward Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_mundane", { + description = "Mundane Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_thick", { + description = "Thick Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) + minetest.register_craftitem("mcl_potions:speckled_melon", { description = "Glistering Melon", stack_max = 64, diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png new file mode 100644 index 0000000000000000000000000000000000000000..3d216ef68dac9adef38c4972bade7ddc9c29c440 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvmUKs7M+SzC{oH>NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgVG!UG;`;yp|0}tkClYP< zgc@%0(_ZPW`sB%zGwYWgjIrDrpu5UdaeNSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgVG!UG;`;yp|0}tkClYP< zgc@%0(_ZPW`sB%zGwYWgjIrDrpu5UdaeAF14AnVgWLm`qfs>E=BH$)RpQnl TGdKG=Py>UftDnm{r-UW|c7=tb literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png new file mode 100644 index 0000000000000000000000000000000000000000..856685e28c7f8569835ddf38cedb3cdc36118176 GIT binary patch literal 235 zcmV4 l{snsY@MY8Z-_QY9vjNs5Fz%e-RWtwq002ovPDHLkV1n|RVuSzy literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png b/mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png deleted file mode 100644 index d069155ad783cf9685daa762122477293d579a87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv-2k5u*Z=?jPd67^U?;uOU3HbK z;wC@stpU2bcJ0~|YIrcl@oW#x<~l~X5?%fS#}pXk zJ2V^u8&