mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-03-28 15:50:23 +01:00
import caverealms glow worms
This commit is contained in:
parent
8f603835a8
commit
a152a8dd43
@ -30,6 +30,10 @@ local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fun
|
|||||||
-- Coal Dust
|
-- Coal Dust
|
||||||
|
|
||||||
local test_biome_floor = function(area, data, ai, vi, bi, param2_data)
|
local test_biome_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
|
if data[bi] ~= c_stone then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if math.random() < 0.25 then
|
if math.random() < 0.25 then
|
||||||
data[bi] = c_dirt
|
data[bi] = c_dirt
|
||||||
else
|
else
|
||||||
@ -48,6 +52,8 @@ end
|
|||||||
local test_biome_ceiling = function(area, data, ai, vi, bi)
|
local test_biome_ceiling = function(area, data, ai, vi, bi)
|
||||||
if subterrane:vertically_consistent_random(vi, area) < 0.002 then
|
if subterrane:vertically_consistent_random(vi, area) < 0.002 then
|
||||||
subterrane:stalactite(vi, area, data, 6, 20, c_stone, c_stone, c_stone)
|
subterrane:stalactite(vi, area, data, 6, 20, c_stone, c_stone, c_stone)
|
||||||
|
elseif math.random() < 0.03 then
|
||||||
|
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
47
glow_worms.lua
Normal file
47
glow_worms.lua
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
-- internationalization boilerplate
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||||
|
local S, NS = dofile(MP.."/intllib.lua")
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:glow_worm", {
|
||||||
|
description = S("Glow Worms"),
|
||||||
|
tiles = {"dfcaverns_glow_worm.png"},
|
||||||
|
inventory_image = "dfcaverns_glow_worm.png",
|
||||||
|
wield_image = "dfcaverns_glow_worm.png",
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {oddly_breakable_by_hand=3},
|
||||||
|
light_source = 9,
|
||||||
|
paramtype = "light",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
walkable = false,
|
||||||
|
buildable_to = true,
|
||||||
|
visual_scale = 1.0,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local c_air = minetest.get_content_id("air")
|
||||||
|
local c_worm = minetest.get_content_id("dfcaverns:glow_worm")
|
||||||
|
|
||||||
|
dfcaverns.glow_worm_ceiling = function(area, data, ai, vi, bi)
|
||||||
|
if data[vi] == c_air and data[bi] == c_air then
|
||||||
|
data[vi] = c_worm
|
||||||
|
data[bi] = c_worm
|
||||||
|
if math.random(2) == 1 then
|
||||||
|
local pos = area:position(vi)
|
||||||
|
pos.y = pos.y-2
|
||||||
|
local bbi = area:indexp(pos)
|
||||||
|
if data[bbi] == c_air then
|
||||||
|
data[bbi] = c_worm
|
||||||
|
if math.random(2) == 1 then
|
||||||
|
pos.y = pos.y-1
|
||||||
|
local bbbi = area:indexp(pos)
|
||||||
|
if data[bbbi] == c_air then
|
||||||
|
data[bbbi] = c_worm
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
1
init.lua
1
init.lua
@ -11,6 +11,7 @@ local modpath = minetest.get_modpath(minetest.get_current_modname())
|
|||||||
dofile(modpath.."/config.lua")
|
dofile(modpath.."/config.lua")
|
||||||
|
|
||||||
dofile(modpath.."/ground_cover.lua")
|
dofile(modpath.."/ground_cover.lua")
|
||||||
|
dofile(modpath.."/glow_worms.lua")
|
||||||
|
|
||||||
-- Plants
|
-- Plants
|
||||||
dofile(modpath.."/plants.lua") -- general functions
|
dofile(modpath.."/plants.lua") -- general functions
|
||||||
|
BIN
textures/dfcaverns_glow_worm.png
Normal file
BIN
textures/dfcaverns_glow_worm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 B |
@ -8,4 +8,5 @@ dftrees_tower_cap - derived from default dead coral
|
|||||||
dftrees_tower_cap_gills - from caverealms mushroom gills
|
dftrees_tower_cap_gills - from caverealms mushroom gills
|
||||||
dftrees_cave_wheat - derived from farming wheat
|
dftrees_cave_wheat - derived from farming wheat
|
||||||
dftrees_tunnel_tube - derived from moretrees palm tree bark
|
dftrees_tunnel_tube - derived from moretrees palm tree bark
|
||||||
dfcaverns_fungi - copied from caverealms
|
dfcaverns_fungi - copied from caverealms
|
||||||
|
dfcaverns_glow_worm - copied from caverealms
|
Loading…
x
Reference in New Issue
Block a user