Multiple changes

There are now five bushes in this mod: strawberry, blackberry,
blueberry, raspberry, and gooseberry.

Instead of giving you the fruit, digging a bush now directly gives you
that bush, with a 1/5 chance of getting two.

Craft one bush by itself to turn it into four of the corresponding
fruit.  Craft six of that fruit to get the bush back (this is how it was
before, I opted to keep it that way).

Craft:

- - -
S J S
f f f

That is, two sugar, one jungle grass, and three fruit as before, to get
one raw pie of that fruit.  Cook it as usual.  Heals 2 hearts.

Craft one whole pie by itself to get four slices, each of which heals
1/2 heart.

Craft:

S J S
f f f
f f f

That is, two sugar, one jungle grass, and mix-and-match six fruits to
get two mixed fruit pies.  Cook as usual, craft one to get four slices.

Baskets of pies can be crafted the same as before (craft a basket from
four sticks in a "T" shape, then craft one of those plus three pies of
the desired type).

In addition: some moderate rewriting and re-arranging of the code to
facilitating adding the new objects.

Made the bushes lower-resolution (they were 64px, which made them not
fit in so well into the usual 16px landscape - reduced them to 32px.
Ditto for the basket textures.  Pies are all 16px.

New textures for the pies.
This commit is contained in:
Vanessa Ezekowitz 2013-10-23 21:51:28 -04:00
parent 54a507fad0
commit 6958d538d9
44 changed files with 180 additions and 104 deletions

View File

@ -1,23 +1,15 @@
-- Basket -- Basket
minetest.register_node(":bushes:basket_empty", {
description = "Basket",
tiles = {
"bushes_basket_empty_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
groups = { dig_immediate = 3 },
})
minetest.register_craft({ minetest.register_craft({
output = ':bushes:basket_empty', output = ":bushes:basket_empty",
recipe = { recipe = {
{ 'default:stick', 'default:stick', 'default:stick' }, { "default:stick", "default:stick", "default:stick" },
{ '', 'default:stick', '' }, { "", "default:stick", "" },
}, },
}) })
-- Sugar -- Sugar
minetest.register_craftitem(":bushes:sugar", { minetest.register_craftitem(":bushes:sugar", {
description = "Sugar", description = "Sugar",
inventory_image = "bushes_sugar.png", inventory_image = "bushes_sugar.png",
@ -25,65 +17,92 @@ minetest.register_craftitem(":bushes:sugar", {
}) })
minetest.register_craft({ minetest.register_craft({
output = 'bushes:sugar 1', output = "bushes:sugar 1",
recipe = { recipe = {
{ 'default:papyrus', 'default:papyrus' }, { "default:papyrus", "default:papyrus" },
}, },
}) })
-- Raw pie for i, berry in ipairs(bushes_classic.bushes) do
minetest.register_craftitem(":bushes:berry_pie_raw", { local desc = bushes_classic.bushes_descriptions[i]
description = "Raw berry pie",
inventory_image = "bushes_berry_pie_raw.png", minetest.register_craftitem(":bushes:"..berry.."_pie_raw", {
on_use = minetest.item_eat(3), description = "Raw "..desc.." pie",
inventory_image = "bushes_"..berry.."_pie_raw.png",
on_use = minetest.item_eat(3),
})
if berry ~= "mixed_berry" then
minetest.register_craftitem(":bushes:"..berry, {
description = "Raw "..desc.." pie",
inventory_image = "bushes_"..berry..".png",
groups = {berry = 1},
on_use = minetest.item_eat(3),
})
minetest.register_craft({
output = "bushes:"..berry.."_pie_raw 1",
recipe = {
{ "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ "bushes:"..berry, "bushes:"..berry, "bushes:"..berry },
},
})
end
-- Cooked pie
minetest.register_craftitem(":bushes:"..berry.."_pie_cooked", {
description = "Cooked "..desc.." pie",
inventory_image = "bushes_"..berry.."_pie_cooked.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = "cooking",
output = "bushes:"..berry.."_pie_cooked",
recipe = "bushes:"..berry.."_pie_raw",
cooktime = 30,
})
-- slice of pie
minetest.register_craftitem(":bushes:"..berry.."_pie_slice", {
description = "Slice of "..desc.." pie",
inventory_image = "bushes_"..berry.."_pie_slice.png",
on_use = minetest.item_eat(1),
})
minetest.register_craft({
output = "bushes:"..berry.."_pie_slice 4",
recipe = {
{ "bushes:"..berry.."_pie_cooked" },
},
})
-- Basket with pies
minetest.register_craft({
output = "bushes:basket_"..berry.." 1",
recipe = {
{ "bushes:berry_pie_cooked", "bushes:berry_pie_cooked", "bushes:berry_pie_cooked" },
{ "", "bushes:basket_empty", "" },
},
})
end
minetest.register_craft({
output = "bushes:strawberry_pie_raw 1",
recipe = {
{ "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ "farming_plus:strawberry_item", "farming_plus:strawberry_item", "farming_plus:strawberry_item" },
},
}) })
minetest.register_craft({ minetest.register_craft({
output = 'bushes:berry_pie_raw 1', output = "bushes:mixed_berry_pie_raw 2",
recipe = { recipe = {
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' }, { "bushes:sugar", "default:junglegrass", "bushes:sugar" },
{ 'bushes:strawberry', 'bushes:strawberry', 'bushes:strawberry' }, { "group:berry", "group:berry", "group:berry" },
}, { "group:berry", "group:berry", "group:berry" },
}) },
minetest.register_craft({
output = 'bushes:berry_pie_raw 1',
recipe = {
{ 'bushes:sugar', 'default:junglegrass', 'bushes:sugar' },
{ 'farming_plus:strawberry_item', 'farming_plus:strawberry_item', 'farming_plus:strawberry_item' },
},
})
-- Cooked pie
minetest.register_craftitem(":bushes:berry_pie_cooked", {
description = "Cooked berry pie",
inventory_image = "bushes_berry_pie_cooked.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = 'cooking',
output = 'bushes:berry_pie_cooked',
recipe = 'bushes:berry_pie_raw',
cooktime = 30,
})
-- Basket with pies
minetest.register_node(":bushes:basket_pies", {
description = "Basket with pies",
tiles = {
"bushes_basket_full_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
on_use = minetest.item_eat(15),
groups = { dig_immediate = 3 },
})
minetest.register_craft({
output = 'bushes:basket_pies 1',
recipe = {
{ 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked', 'bushes:berry_pie_cooked' },
{ '', 'bushes:basket_empty', '' },
},
}) })

View File

@ -0,0 +1,5 @@
strawberry: http://www.clker.com/clipart-4060.html
blueberry: http://www.clker.com/clipart-cerezafiro12.html
blackberry: http://www.clker.com/clipart-blackberry-2.html
raspberry: http://www.clker.com/clipart-simple-raspberry.html
gooseberry: http://www.clker.com/clipart-26281.html

View File

@ -1,49 +1,36 @@
local BUSHES = { -- Bushes classic mod originally by unknown
-- now maintained by VanessaE
--
-- License: WTFPL
bushes_classic = {}
bushes_classic.bushes = {
"strawberry", "strawberry",
"blackberry",
"blueberry",
"raspberry",
"gooseberry",
"mixed_berry"
} }
local BUSHES_DESCRIPTIONS = { bushes_classic.bushes_descriptions = {
"Strawberry", "Strawberry",
"Blackberry",
"Blueberry",
"Raspberry",
"Gooseberry",
"Mixed Berry"
} }
local spawn_list = {} bushes_classic.spawn_list = {}
for i, bush_name in ipairs(BUSHES) do dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua')
minetest.register_node(":bushes:" .. bush_name .. "_bush", { dofile(minetest.get_modpath('bushes_classic') .. '/nodes.lua')
description = BUSHES_DESCRIPTIONS[i] .. " bush",
drawtype = "plantlike",
visual_scale = 1.3,
tiles = { "bushes_" .. bush_name .. "_bush.png" },
inventory_image = "bushes_" .. bush_name .. "_bush.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
drop = 'bushes:' .. bush_name .. ' 4',
groups = { snappy = 3, bush = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craftitem(":bushes:" .. bush_name, {
description = BUSHES_DESCRIPTIONS[i],
inventory_image = "bushes_" .. bush_name .. ".png",
stack_max = 99,
on_use = minetest.item_eat(1),
})
minetest.register_craft({
output = 'bushes:' .. bush_name .. '_bush',
recipe = {
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
{ 'bushes:' .. bush_name, 'bushes:' .. bush_name, 'bushes:' .. bush_name },
}
})
table.insert(spawn_list, "bushes:"..bush_name.."_bush")
end
plantslib:spawn_on_surfaces({ plantslib:spawn_on_surfaces({
spawn_delay = 3600, spawn_delay = 3600,
spawn_plants = spawn_list, spawn_plants = bushes_classic.spawn_list,
avoid_radius = 10, avoid_radius = 10,
spawn_chance = 100, spawn_chance = 100,
spawn_surfaces = { spawn_surfaces = {
@ -53,7 +40,7 @@ plantslib:spawn_on_surfaces({
"woodsoils:grass_with_leaves_2" "woodsoils:grass_with_leaves_2"
}, },
avoid_nodes = {"group:bush"}, avoid_nodes = {"group:bush"},
seed_diff = 545342534, -- guaranteed to be random :P seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
plantlife_limit = -0.1, plantlife_limit = -0.1,
light_min = 10, light_min = 10,
temp_min = 0.15, -- approx 20C temp_min = 0.15, -- approx 20C
@ -62,6 +49,6 @@ plantslib:spawn_on_surfaces({
humidity_max = -1, -- 100% RH humidity_max = -1, -- 100% RH
}) })
dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua') minetest.register_alias("bushes:basket_pies", "bushes:basket_strawberry")
print("[Bushes] Loaded.") print("[Bushes] Loaded.")

65
bushes_classic/nodes.lua Normal file
View File

@ -0,0 +1,65 @@
for i, bush_name in ipairs(bushes_classic.bushes) do
local desc = bushes_classic.bushes_descriptions[i]
if bush_name ~= "mixed_berry" then
minetest.register_node(":bushes:" .. bush_name .. "_bush", {
description = desc.." Bush",
drawtype = "plantlike",
visual_scale = 1.3,
tiles = { "bushes_" .. bush_name .. "_bush.png" },
inventory_image = "bushes_" .. bush_name .. "_bush.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = { snappy = 3, bush = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
drop = {
max_items = 2,
items = {
{items = {"bushes:" .. bush_name .. "_bush"}, rarity = 1 }, -- always get at least one on dig
{items = {"bushes:" .. bush_name .. "_bush"}, rarity = 5 }, -- 1/5 chance of getting a second one.
}
},
})
minetest.register_craft({
output = "bushes:"..bush_name.." 4",
recipe = {
{ "bushes:"..bush_name.."_bush", },
}
})
minetest.register_craft({
output = "bushes:" .. bush_name .. "_bush",
recipe = {
{ "bushes:" .. bush_name, "bushes:" .. bush_name, "bushes:" .. bush_name },
{ "bushes:" .. bush_name, "bushes:" .. bush_name, "bushes:" .. bush_name },
}
})
end
minetest.register_node(":bushes:basket_"..bush_name, {
description = "Basket with "..desc.." Pies",
tiles = {
"bushes_basket_"..bush_name.."_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
on_use = minetest.item_eat(15),
groups = { dig_immediate = 3 },
})
table.insert(bushes_classic.spawn_list, "bushes:"..bush_name.."_bush")
end
minetest.register_node(":bushes:basket_empty", {
description = "Basket",
tiles = {
"bushes_basket_empty_top.png",
"bushes_basket_bottom.png",
"bushes_basket_side.png"
},
groups = { dig_immediate = 3 },
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 824 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B