diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-11-18 22:40:55 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-11-18 22:40:55 +0100 |
commit | 93190e95eeaacde335dec41518d34bd5376697fb (patch) | |
tree | 2f3633ef204fdd2b796315664cfad3a06702902a | |
parent | e0c938e73c2ca84cac28af531be737bdc8484e82 (diff) | |
parent | 5aff11f8f74c20a38ab0684d4724407d579424ba (diff) | |
download | freezer-93190e95eeaacde335dec41518d34bd5376697fb.tar.gz freezer-93190e95eeaacde335dec41518d34bd5376697fb.tar.bz2 freezer-93190e95eeaacde335dec41518d34bd5376697fb.zip |
Merge branch 'juices' of https://github.com/h-v-smacker/freezer
45 files changed, 189 insertions, 3 deletions
@@ -22,8 +22,18 @@ Buckets of said liquids can be turned into eskimo icecream (an icecream on a woo a canonic kind of icecream in the USSR) and a cactus popsicle respectively. Since a whole bucket is used, the yield is 3 items. + The buckets are returned empty after use. The popsicles leave a fancy stick behind after being eaten. +## Juices and popsicles + +Fruits, berries, and some vegetables can be squeezed into a glass (from vessels mod) using +a shapeless recipe. The resulting product can be consumed as it is, or can be frozen into +colorful popsicles (1 glass yields 1 popsicle). + +The buckets and glasses are returned empty after use (or consumption of beverages). +The popsicles leave a fancy stick behind after being eaten. + ## Pipeworks The freezer is pipeworks compatible. All incoming items are places into the source @@ -33,4 +43,4 @@ The direction of pipe connections is irrelevant. ## The founder The mod was founded by gpcf, and can be seen at git://gpcf.eu/freezer.git. -This is a fork thereof.
\ No newline at end of file +This is a fork thereof. diff --git a/depends.txt b/depends.txt index e2c3e12..62c1b68 100644 --- a/depends.txt +++ b/depends.txt @@ -2,4 +2,5 @@ default pipeworks? ethereal? mobs? -farming?
\ No newline at end of file +farming? +vessels?
\ No newline at end of file @@ -4,6 +4,13 @@ -- surprise for the player. -- +-- enable extra popsicle types provided there are both vessels and fruits/veggies available +-- fruit + glass -> juice; juice @ freezer -> popsicle + empty glass + +if minetest.get_modpath("vessels") then + dofile(minetest.get_modpath("freezer") .. "/juices.lua") +end + -- -- Formspecs -- @@ -161,6 +168,26 @@ local function freezer_node_timer(pos, elapsed) end end end + + -- juices -> popsicles + -- since we're dealing with 1 glass and not 1 bucket, the output is 1 item + if minetest.get_modpath("vessels") then + local input_stack = inv:get_stack("src", 1); + local input_name = input_stack:get_name(); + if minetest.get_item_group(input_name, "juice") then + local output_name = input_name .. "_popsicle" + while inv:room_for_item("dst", output_name) do + local removed = inv:remove_item("src", input_name) + if removed:get_count() > 0 then + inv:add_item("dst", output_name) + inv:add_item("dst", "vessels:drinking_glass") + else + break + end + end + end + end + -- Check if we have cookable content return @@ -255,7 +282,7 @@ end if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then minetest.register_craftitem("freezer:milk_popsicle", { - description = "Ice Cream Popsicle", + description = "Eskimo icecream", inventory_image = "milk_popsicle.png", wield_image = "milk_popsicle.png", stack_max = 99, @@ -282,3 +309,9 @@ minetest.register_craft({ "default:ice" } }) + +-- -- enable extra popsicle types provided there are both vessels and fruits/veggies available +-- -- fruit + glass -> juice; juice @ freezer -> popsicle + empty glass +-- if minetest.get_modpath("vessels") and minetest.get_modpath("farming") then +-- dofile("juices.lua") +-- end
\ No newline at end of file diff --git a/juices.lua b/juices.lua new file mode 100644 index 0000000..63e34a3 --- /dev/null +++ b/juices.lua @@ -0,0 +1,129 @@ +-- Definition for juices, an intermediate stage for making popsicles +-- however, they can be consumed raw as well, but the benefit would be less + +--[[ + Definition scheme + internal_name_of_the_juice = { + proper_name = Human-readable name, + found_in = mod name where the source object is introduced + obj_name = name of source object (internal, without "modname:") + orig_nutritional_value = self-explanatory + } + -- image files for items must follow the scheme: + -- internal_name_of_the_juice.png and + -- internal_name_of_the_juice_inv.png (for inventory) + -- internal_name_of_the_juice_popsicle.png for the popsicle form +]] + +local juice_table = { + orange_juice = { + proper_name = "Orange juice", + found_in = "ethereal", + obj_name = "orange", + orig_nutritional_value = 2 + }, + banana_juice = { + proper_name = "Banana juice", + found_in = "ethereal", + obj_name = "banana", + orig_nutritional_value = 1 + }, + strawberry_juice = { + proper_name = "Strawberry juice", + found_in = "ethereal", + obj_name = "strawberry", + orig_nutritional_value = 1 + }, + coconut_milk = { + proper_name = "Coconut milk", + found_in = "ethereal", + obj_name = "coconut_slice", + orig_nutritional_value = 1 + }, + blueberry_juice = { + proper_name = "Blueberry juice", + found_in = "farming", + obj_name = "blueberries", + orig_nutritional_value = 1 + }, + raspberry_juice = { + proper_name = "Raspberry juice", + found_in = "farming", + obj_name = "raspberries", + orig_nutritional_value = 1 + }, + carrot_juice = { + proper_name = "Carrot juice", + found_in = "farming", + obj_name = "carrot", + orig_nutritional_value = 4 + }, + cucumber_juice = { + proper_name = "Cucumber juice", + found_in = "farming", + obj_name = "cucumber", + orig_nutritional_value = 4 + }, + grape_juice = { + proper_name = "Grape juice", + found_in = "farming", + obj_name = "grapes", + orig_nutritional_value = 2 + }, + melon_juice = { + proper_name = "Melon juice", + found_in = "farming", + obj_name = "melon_slice", + orig_nutritional_value = 2 + }, + pumpkin_juice = { + proper_name = "Pumpkin juice", + found_in = "farming", + obj_name = "pumpkin_slice", + orig_nutritional_value = 2 + }, + tomato_juice = { + proper_name = "Tomato juice", + found_in = "farming", + obj_name = "tomato", + orig_nutritional_value = 4 + }, + +} + + +-- all juices are created accoriding to a single universal scheme +for juice_name, def in pairs(juice_table) do + if minetest.get_modpath(def.found_in) then + + -- introducing a new item, a bit more nutricious than the source material + -- that's because one needs a glass, so effort should be rewarded + minetest.register_craftitem("freezer:" .. juice_name, { + description = def.proper_name, + inventory_image = juice_name .. "_inv.png", + wield_image = juice_name .. ".png", + groups = { juice = 1 }, + on_use = minetest.item_eat(def.orig_nutritional_value+1, "vessels:drinking_glass"), + }) + + -- register corresponding popsicles + -- lower nutritional value is compensated by leaving a fancy stick behind + minetest.register_craftitem("freezer:" .. juice_name .. "_popsicle", { + description = def.proper_name .. " popsicle", + inventory_image = juice_name .. "_popsicle.png", + wield_image = juice_name .. "_popsicle.png", + groups = { popsicle = 1, not_in_creative_inventory = 1 } + on_use = minetest.item_eat(def.orig_nutritional_value, "default:stick"), + }) + + minetest.register_craft({ + type = "shapeless", + output = "freezer:" .. juice_name, + recipe = {"vessels:drinking_glass", def.found_in .. ":" .. def.obj_name}, + }) + + end +end + +-- The Moor has done his duty, the Moor can go +juice_table = nil diff --git a/textures/#drinking_glass.png b/textures/#drinking_glass.png Binary files differnew file mode 100644 index 0000000..1cf5383 --- /dev/null +++ b/textures/#drinking_glass.png diff --git a/textures/#drinking_glass_inv.png b/textures/#drinking_glass_inv.png Binary files differnew file mode 100644 index 0000000..c47908b --- /dev/null +++ b/textures/#drinking_glass_inv.png diff --git a/textures/#popsicle.png b/textures/#popsicle.png Binary files differnew file mode 100644 index 0000000..4930f83 --- /dev/null +++ b/textures/#popsicle.png diff --git a/textures/add_img.sh b/textures/add_img.sh new file mode 100755 index 0000000..192b387 --- /dev/null +++ b/textures/add_img.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# copy the source images as proper filenames +# then color them with GIMP + +if [ -z "$1" ]; then + echo "(!) usage: ./add_img.sh new_juice_name" +else + echo "(i) adding new juice type ${1}..." + cp "#drinking_glass.png" "${1}.png" + cp "#drinking_glass_inv.png" "${1}_inv.png" + cp "#popsicle.png" "${1}_popsicle.png" +fi
\ No newline at end of file diff --git a/textures/banana_juice.png b/textures/banana_juice.png Binary files differnew file mode 100644 index 0000000..ccdb644 --- /dev/null +++ b/textures/banana_juice.png diff --git a/textures/banana_juice_inv.png b/textures/banana_juice_inv.png Binary files differnew file mode 100644 index 0000000..dda4281 --- /dev/null +++ b/textures/banana_juice_inv.png diff --git a/textures/banana_juice_popsicle.png b/textures/banana_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..9ac321a --- /dev/null +++ b/textures/banana_juice_popsicle.png diff --git a/textures/blueberry_juice.png b/textures/blueberry_juice.png Binary files differnew file mode 100644 index 0000000..bcf0c13 --- /dev/null +++ b/textures/blueberry_juice.png diff --git a/textures/blueberry_juice_inv.png b/textures/blueberry_juice_inv.png Binary files differnew file mode 100644 index 0000000..580f921 --- /dev/null +++ b/textures/blueberry_juice_inv.png diff --git a/textures/blueberry_juice_popsicle.png b/textures/blueberry_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..230e17c --- /dev/null +++ b/textures/blueberry_juice_popsicle.png diff --git a/textures/cactus_popsicle.png b/textures/cactus_popsicle.png Binary files differindex 6243f8c..08e7c02 100644 --- a/textures/cactus_popsicle.png +++ b/textures/cactus_popsicle.png diff --git a/textures/carrot_juice.png b/textures/carrot_juice.png Binary files differnew file mode 100644 index 0000000..3d2618c --- /dev/null +++ b/textures/carrot_juice.png diff --git a/textures/carrot_juice_inv.png b/textures/carrot_juice_inv.png Binary files differnew file mode 100644 index 0000000..db64a28 --- /dev/null +++ b/textures/carrot_juice_inv.png diff --git a/textures/carrot_juice_popsicle.png b/textures/carrot_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..8ad756e --- /dev/null +++ b/textures/carrot_juice_popsicle.png diff --git a/textures/coconut_milk.png b/textures/coconut_milk.png Binary files differnew file mode 100644 index 0000000..9007004 --- /dev/null +++ b/textures/coconut_milk.png diff --git a/textures/coconut_milk_inv.png b/textures/coconut_milk_inv.png Binary files differnew file mode 100644 index 0000000..84e0df6 --- /dev/null +++ b/textures/coconut_milk_inv.png diff --git a/textures/coconut_milk_popsicle.png b/textures/coconut_milk_popsicle.png Binary files differnew file mode 100644 index 0000000..0be3eba --- /dev/null +++ b/textures/coconut_milk_popsicle.png diff --git a/textures/cucumber_juice.png b/textures/cucumber_juice.png Binary files differnew file mode 100644 index 0000000..387e579 --- /dev/null +++ b/textures/cucumber_juice.png diff --git a/textures/cucumber_juice_inv.png b/textures/cucumber_juice_inv.png Binary files differnew file mode 100644 index 0000000..8d0080a --- /dev/null +++ b/textures/cucumber_juice_inv.png diff --git a/textures/cucumber_juice_popsicle.png b/textures/cucumber_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..14ba4f1 --- /dev/null +++ b/textures/cucumber_juice_popsicle.png diff --git a/textures/grape_juice.png b/textures/grape_juice.png Binary files differnew file mode 100644 index 0000000..a100957 --- /dev/null +++ b/textures/grape_juice.png diff --git a/textures/grape_juice_inv.png b/textures/grape_juice_inv.png Binary files differnew file mode 100644 index 0000000..7cbd28e --- /dev/null +++ b/textures/grape_juice_inv.png diff --git a/textures/grape_juice_popsicle.png b/textures/grape_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..230ad1e --- /dev/null +++ b/textures/grape_juice_popsicle.png diff --git a/textures/melon_juice.png b/textures/melon_juice.png Binary files differnew file mode 100644 index 0000000..50ad3ae --- /dev/null +++ b/textures/melon_juice.png diff --git a/textures/melon_juice_inv.png b/textures/melon_juice_inv.png Binary files differnew file mode 100644 index 0000000..fd37846 --- /dev/null +++ b/textures/melon_juice_inv.png diff --git a/textures/melon_juice_popsicle.png b/textures/melon_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..d08b554 --- /dev/null +++ b/textures/melon_juice_popsicle.png diff --git a/textures/orange_juice.png b/textures/orange_juice.png Binary files differnew file mode 100644 index 0000000..07202ad --- /dev/null +++ b/textures/orange_juice.png diff --git a/textures/orange_juice_inv.png b/textures/orange_juice_inv.png Binary files differnew file mode 100644 index 0000000..ce1c8b1 --- /dev/null +++ b/textures/orange_juice_inv.png diff --git a/textures/orange_juice_popsicle.png b/textures/orange_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..11c0c49 --- /dev/null +++ b/textures/orange_juice_popsicle.png diff --git a/textures/pumpkin_juice.png b/textures/pumpkin_juice.png Binary files differnew file mode 100644 index 0000000..9a1a9c3 --- /dev/null +++ b/textures/pumpkin_juice.png diff --git a/textures/pumpkin_juice_inv.png b/textures/pumpkin_juice_inv.png Binary files differnew file mode 100644 index 0000000..f2ae36b --- /dev/null +++ b/textures/pumpkin_juice_inv.png diff --git a/textures/pumpkin_juice_popsicle.png b/textures/pumpkin_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..4e20dab --- /dev/null +++ b/textures/pumpkin_juice_popsicle.png diff --git a/textures/raspberry_juice.png b/textures/raspberry_juice.png Binary files differnew file mode 100644 index 0000000..68649a4 --- /dev/null +++ b/textures/raspberry_juice.png diff --git a/textures/raspberry_juice_inv.png b/textures/raspberry_juice_inv.png Binary files differnew file mode 100644 index 0000000..a8d45f3 --- /dev/null +++ b/textures/raspberry_juice_inv.png diff --git a/textures/raspberry_juice_popsicle.png b/textures/raspberry_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..1cdb6ac --- /dev/null +++ b/textures/raspberry_juice_popsicle.png diff --git a/textures/strawberry_juice.png b/textures/strawberry_juice.png Binary files differnew file mode 100644 index 0000000..887baa0 --- /dev/null +++ b/textures/strawberry_juice.png diff --git a/textures/strawberry_juice_inv.png b/textures/strawberry_juice_inv.png Binary files differnew file mode 100644 index 0000000..165a4aa --- /dev/null +++ b/textures/strawberry_juice_inv.png diff --git a/textures/strawberry_juice_popsicle.png b/textures/strawberry_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..41e9301 --- /dev/null +++ b/textures/strawberry_juice_popsicle.png diff --git a/textures/tomato_juice.png b/textures/tomato_juice.png Binary files differnew file mode 100644 index 0000000..5a8ae1b --- /dev/null +++ b/textures/tomato_juice.png diff --git a/textures/tomato_juice_inv.png b/textures/tomato_juice_inv.png Binary files differnew file mode 100644 index 0000000..317e939 --- /dev/null +++ b/textures/tomato_juice_inv.png diff --git a/textures/tomato_juice_popsicle.png b/textures/tomato_juice_popsicle.png Binary files differnew file mode 100644 index 0000000..f0a2627 --- /dev/null +++ b/textures/tomato_juice_popsicle.png |