Merge pull request #12 from vlapsley/flowers_plants

Add array for flowers & plants and two new river plants.
This commit is contained in:
demon_boy 2015-09-24 10:53:31 +10:00
commit 2ea8a8867e
4 changed files with 58 additions and 61 deletions

View File

@ -204,7 +204,9 @@ function vmg.generate(minp, maxp, seed)
local c_huge_mushroom_cap = minetest.get_content_id("valleys_mapgen:huge_mushroom_cap")
local c_giant_mushroom_cap = minetest.get_content_id("valleys_mapgen:giant_mushroom_cap")
local c_giant_mushroom_stem = minetest.get_content_id("valleys_mapgen:giant_mushroom_stem")
local c_arrow_arum = minetest.get_content_id("valleys_mapgen:arrow_arum")
local c_bird_of_paradise = minetest.get_content_id("valleys_mapgen:bird_of_paradise")
local c_calla_lily = minetest.get_content_id("valleys_mapgen:calla_lily")
local c_hibiscus = minetest.get_content_id("valleys_mapgen:hibiscus")
local c_orchid = minetest.get_content_id("valleys_mapgen:orchid")
@ -441,8 +443,12 @@ function vmg.generate(minp, maxp, seed)
for i = 1, 4 do
data[ivm+i*ystride] = c_papyrus
end
elseif temp > 1 and temp < 1.6 and v2 >= 0 and v2 < 0.1 and math.random(100) <= 2 and y < 60 then -- hibiscus along rivers
elseif humidity > 1 and v2 < 0.01 and v13 > 0.1 and v15 < 0.25 and y > 3 then -- arrow arum on river banks
data[ivm2] = c_arrow_arum
elseif temp > 1 and temp < 1.6 and v2 < 0.05 and math.random(100) <= 2 and y > 3 and y < 60 then -- hibiscus along rivers
data[ivm2] = c_hibiscus
elseif temp > 1.2 and v2 < 0.02 and v13 < 1 and v14 < 0.1 and v15 < 0.75 and math.random(100) <= 20 and y > 3 then -- calla lily on river banks
data[ivm2] = c_calla_lily
elseif v15 < 0.65 and temp >= 0.65 and temp < 1.5 and humidity < 2.6 and v16 < 1.5 and v13 < 0.8 and math.random() < 0.7 then -- Grass
data[ivm2] = c_grass[math.random(1, 5)]
elseif v15 > -0.6 and temp >= 1.8 and humidity > 2.2 and v16 > 1.8 then -- jungle plants

111
nodes.lua
View File

@ -269,70 +269,61 @@ end
-- Flowers / Plants --
----------------------
minetest.register_node("valleys_mapgen:bird_of_paradise", {
description = "Bird of Paradise",
drawtype = "plantlike",
tiles = {"vmg_bird_of_paradise.png"},
inventory_image = "vmg_bird_of_paradise.png",
paramtype = "light",
walkable = false,
visual_scale = 1.2,
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5},
},
})
-- Credits / Notes
-- Arrow Arum: texture by demon_boy
-- Bird of Paradise: texture by demon_boy
-- Calla Lily: texture by demon_boy
-- Gerbera: texture by demon_boy
-- Hibiscus: texture by demon_boy
-- Orchid: texture by demon_boy
minetest.register_node("valleys_mapgen:gerbera", {
description = "Gerbera",
drawtype = "plantlike",
tiles = {"vmg_gerbera.png"},
inventory_image = "vmg_gerbera.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_pink=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15},
},
})
vmg.plantlist = {
-- plantname plantdesc plantwave plantlight plantgroup selbox
{"arrow_arum", "Arrow Arum", 1, "false", "plantnodye", {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}},
{"bird_of_paradise", "Bird of Paradise", 0, "true", "flowernodye", {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}},
{"calla_lily", "Calla Lily", 1, "true", "flowerwhitedye", {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}},
{"gerbera", "Gerbera", 0, "true", "flowerpinkdye", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}},
{"hibiscus", "Hibiscus", 1, "false", "flowerwhitedye", {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}},
{"orchid", "Orchid", 1, "true", "flowerwhitedye", {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}},
}
minetest.register_node("valleys_mapgen:hibiscus", {
description = "White Hibiscus",
drawtype = "plantlike",
tiles = {"vmg_hibiscus.png"},
inventory_image = "vmg_hibiscus.png",
paramtype = "light",
walkable = false,
waving = 1,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5},
},
})
for i in ipairs(vmg.plantlist) do
local plantname = vmg.plantlist[i][1]
local plantdesc = vmg.plantlist[i][2]
local plantwave = vmg.plantlist[i][3]
local plantlight = vmg.plantlist[i][4]
local plantgroup = vmg.plantlist[i][5]
local selbox = vmg.plantlist[i][6]
minetest.register_node("valleys_mapgen:orchid", {
description = "Orchid",
drawtype = "plantlike",
tiles = {"vmg_orchid.png"},
inventory_image = "vmg_orchid.png",
paramtype = "light",
walkable = false,
waving = 1,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5},
},
})
--group definitions
if vmg.plantlist[i][5] == "plantnodye" then
plantgroups = {snappy=3,flammable=2,flora=1,attached_node=1}
elseif vmg.plantlist[i][5] == "flowernodye" then
plantgroups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1}
elseif vmg.plantlist[i][5] == "flowerpinkdye" then
plantgroups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_pink=1}
elseif vmg.plantlist[i][5] == "flowerwhitedye" then
plantgroups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1}
end
minetest.register_node("valleys_mapgen:"..plantname.."", {
description = plantdesc,
drawtype = "plantlike",
tiles = {"vmg_"..plantname..".png"},
inventory_image = "vmg_"..plantname..".png",
waving = plantwave,
sunlight_propagates = plantlight,
paramtype = "light",
walkable = false,
groups = plantgroups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = selbox,
},
})
end
minetest.register_node("valleys_mapgen:huge_mushroom_cap", {

BIN
textures/vmg_arrow_arum.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
textures/vmg_calla_lily.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B