diff --git a/init.lua b/init.lua index be05310..2aa8140 100644 --- a/init.lua +++ b/init.lua @@ -17,6 +17,7 @@ dofile(modpath.."/plants/pig_tail.lua") dofile(modpath.."/plants/plump_helmet.lua") dofile(modpath.."/plants/quarry_bush.lua") dofile(modpath.."/plants/sweet_pod.lua") +dofile(modpath.."/plants/cooking.lua") -- Trees dofile(modpath.."/trees/blood_thorn.lua") diff --git a/plants.lua b/plants.lua index 5f24cc7..64951b8 100644 --- a/plants.lua +++ b/plants.lua @@ -110,7 +110,7 @@ dfcaverns.register_seed = function(name, description, image, stage_one) wield_image = image, drawtype = "signlike", paramtype2 = "wallmounted", - groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2, dfcaverns_cookable = 1}, _dfcaverns_next_stage = stage_one, paramtype = "light", walkable = false, diff --git a/plants/cave_wheat.lua b/plants/cave_wheat.lua index 0678a44..b6b10ab 100644 --- a/plants/cave_wheat.lua +++ b/plants/cave_wheat.lua @@ -67,7 +67,7 @@ minetest.register_craft({ minetest.register_craftitem("dfcaverns:cave_flour", { description = S("Cave Wheat Flour"), inventory_image = "dfcaverns_flour.png", - groups = {flammable = 1}, + groups = {flammable = 1, dfcaverns_cookable = 1}, }) minetest.register_craftitem("dfcaverns:cave_bread", { diff --git a/plants/cooking.lua b/plants/cooking.lua new file mode 100644 index 0000000..329d389 --- /dev/null +++ b/plants/cooking.lua @@ -0,0 +1,52 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +local register_cooking_recipes = function(prefix, item, name, returns) + minetest.register_craftitem("dfcaverns:"..item.."_biscuit", { + description = S("@1 Biscuit", name), + inventory_image = "dfcaverns_biscuit.png", + on_use = minetest.item_eat(4), + }) + minetest.register_craftitem("dfcaverns:"..item.."_stew", { + description = S("@1 Stew", name), + inventory_image = "dfcaverns_stew.png", + on_use = minetest.item_eat(6), + }) + minetest.register_craftitem("dfcaverns:"..item.."_roast", { + description = S("@1 Roast", name), + inventory_image = "dfcaverns_roast.png", + on_use = minetest.item_eat(8), + }) + + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_biscuit", + recipe = {"group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_stew", + recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) + minetest.register_craft({ + type = "shapeless", + output = "dfcaverns:"..item.."_roast", + recipe = {"group:dfcaverns_cookable", "group:dfcaverns_cookable", "group:dfcaverns_cookable", prefix..":"..item}, + replacements = returns + }) +end + +register_cooking_recipes("dfcaverns", "cave_flour", S("Cave Wheat Flour")) +register_cooking_recipes("dfcaverns", "cave_wheat_seed", S("Cave Wheat Seed")) +register_cooking_recipes("dfcaverns", "sweet_pod_seed", S("Sweet Pod Spore")) +register_cooking_recipes("dfcaverns", "sugar", S("Sweet Pod Sugar")) +register_cooking_recipes("group", "plump_helmet", S("Plump Helmet")) +register_cooking_recipes("dfcaverns", "plump_helmet_seed", S("Plump Helmet Spawn")) +register_cooking_recipes("dfcaverns", "quarry_bush_leaves", S("Quarry Bush Leaf")) +register_cooking_recipes("dfcaverns", "quarry_bush_seed", S("Rock Nut")) +register_cooking_recipes("dfcaverns", "dimple_cup_seed", S("Dimple Cup Spore")) +register_cooking_recipes("dfcaverns", "pig_tail_seed", S("Pig Tail Spore")) +register_cooking_recipes("dfcaverns", "dwarven_syrup_bucket", S("Dwarven Syrup"), {{"dfcaverns:dwarven_syrup_bucket", "bucket:bucket_empty"}}) diff --git a/plants/plump_helmet.lua b/plants/plump_helmet.lua index 333ba07..068325b 100644 --- a/plants/plump_helmet.lua +++ b/plants/plump_helmet.lua @@ -59,7 +59,7 @@ minetest.register_node("dfcaverns:plump_helmet_spawn", { tiles = { "dfcaverns_plump_helmet_cap.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_1", drawtype = "nodebox", paramtype = "light", @@ -83,7 +83,7 @@ minetest.register_node("dfcaverns:plump_helmet_1", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:5:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_2", drawtype = "nodebox", paramtype = "light", @@ -112,7 +112,7 @@ minetest.register_node("dfcaverns:plump_helmet_2", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:15:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_3", drawtype = "nodebox", paramtype = "light", @@ -153,7 +153,7 @@ minetest.register_node("dfcaverns:plump_helmet_3", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:35:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1}, _dfcaverns_next_stage = "dfcaverns:plump_helmet_4", drawtype = "nodebox", paramtype = "light", @@ -193,7 +193,7 @@ minetest.register_node("dfcaverns:plump_helmet_4", { "dfcaverns_plump_helmet_cap.png", "dfcaverns_plump_helmet_cap.png^[lowpart:40:dfcaverns_plump_helmet_stem.png", }, - groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, + groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11, dfcaverns_cookable = 1, plump_helmet = 1}, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/plants/quarry_bush.lua b/plants/quarry_bush.lua index 54667ae..a12771a 100644 --- a/plants/quarry_bush.lua +++ b/plants/quarry_bush.lua @@ -57,6 +57,7 @@ dfcaverns.register_grow_abm(quarry_names, dfcaverns.config.plant_growth_timer * minetest.register_craftitem("dfcaverns:quarry_bush_leaves", { description = S("Quarry Bush Leaves"), inventory_image = "dfcaverns_quarry_bush_leaves.png", + groups = {dfcaverns_cookable = 1}, stack_max = 99, }) minetest.register_craft({ diff --git a/plants/sweet_pod.lua b/plants/sweet_pod.lua index 6bf5da2..e576c2e 100644 --- a/plants/sweet_pod.lua +++ b/plants/sweet_pod.lua @@ -69,6 +69,7 @@ minetest.register_craft({ minetest.register_craftitem("dfcaverns:sugar", { description = S("Sweet Pod Sugar"), inventory_image = "dfcaverns_sugar.png", + groups = {dfcaverns_cookable = 1}, }) if minetest.get_modpath("cottages") then diff --git a/textures/dfcaverns_biscuit.png b/textures/dfcaverns_biscuit.png new file mode 100644 index 0000000..734d254 Binary files /dev/null and b/textures/dfcaverns_biscuit.png differ diff --git a/textures/dfcaverns_roast.png b/textures/dfcaverns_roast.png new file mode 100644 index 0000000..381231d Binary files /dev/null and b/textures/dfcaverns_roast.png differ diff --git a/textures/dfcaverns_stew.png b/textures/dfcaverns_stew.png new file mode 100644 index 0000000..8d9ee93 Binary files /dev/null and b/textures/dfcaverns_stew.png differ