2018-05-23 10:32:06 +02:00
|
|
|
-- internationalization boilerplate
|
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
|
|
local S, NS = dofile(MP.."/intllib.lua")
|
|
|
|
|
2018-12-31 19:46:27 +01:00
|
|
|
minetest.register_node("df_mapitems:cave_coral_3", {
|
2018-05-23 10:32:06 +02:00
|
|
|
description = S("Cave Coral"),
|
2018-12-31 19:46:27 +01:00
|
|
|
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
|
|
|
|
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
|
2018-05-23 10:32:06 +02:00
|
|
|
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
|
|
|
|
drop = "default:coral_skeleton",
|
|
|
|
light_source = 3,
|
2019-08-03 07:44:09 +02:00
|
|
|
paramtype2 = "facedir",
|
2018-05-23 10:32:06 +02:00
|
|
|
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
2018-12-31 19:46:27 +01:00
|
|
|
minetest.register_node("df_mapitems:cave_coral_2", {
|
2018-05-23 10:32:06 +02:00
|
|
|
description = S("Cave Coral"),
|
2018-12-31 19:46:27 +01:00
|
|
|
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
|
|
|
|
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
|
2018-05-23 10:32:06 +02:00
|
|
|
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
|
|
|
|
drop = "default:coral_skeleton",
|
|
|
|
light_source = 2,
|
2019-08-03 07:44:09 +02:00
|
|
|
paramtype2 = "facedir",
|
2018-05-23 10:32:06 +02:00
|
|
|
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
2018-12-31 19:46:27 +01:00
|
|
|
minetest.register_node("df_mapitems:cave_coral_1", {
|
2018-05-23 10:32:06 +02:00
|
|
|
description = S("Cave Coral"),
|
2018-12-31 19:46:27 +01:00
|
|
|
_doc_items_longdesc = df_mapitems.doc.cave_coral_desc,
|
|
|
|
_doc_items_usagehelp = df_mapitems.doc.cave_coral_usage,
|
2018-05-23 10:32:06 +02:00
|
|
|
tiles = {"dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral_end.png", "dfcaverns_cave_coral.png"},
|
|
|
|
drop = "default:coral_skeleton",
|
|
|
|
light_source = 1,
|
2019-08-03 07:44:09 +02:00
|
|
|
paramtype2 = "facedir",
|
2018-05-23 10:32:06 +02:00
|
|
|
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
2018-12-31 19:46:27 +01:00
|
|
|
local coral_names = {"df_mapitems:cave_coral_1", "df_mapitems:cave_coral_2", "df_mapitems:cave_coral_3"}
|
2018-05-23 10:32:06 +02:00
|
|
|
minetest.register_abm{
|
2018-12-31 19:46:27 +01:00
|
|
|
label = "df_mapitems:shifting_coral",
|
2018-05-23 10:32:06 +02:00
|
|
|
nodenames = {"group:dfcaverns_cave_coral"},
|
2019-08-02 07:07:15 +02:00
|
|
|
neighbors = {"default:water_source"},
|
2018-05-23 10:32:06 +02:00
|
|
|
interval = 2,
|
|
|
|
chance = 10,
|
|
|
|
action = function(pos)
|
2019-08-03 07:44:09 +02:00
|
|
|
local node = minetest.get_node(pos)
|
|
|
|
minetest.swap_node(pos, {name=coral_names[math.random(1,3)], param2=node.param2})
|
2018-05-23 10:32:06 +02:00
|
|
|
end,
|
|
|
|
}
|