12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034 |
- if not minetest.global_exists("cavestuff") then cavestuff = {} end
- cavestuff.modpath = minetest.get_modpath("cavestuff")
- -- Localize for performance.
- local math_random = math.random
- -- Functions.
- dofile(cavestuff.modpath .. "/functions.lua")
- minetest.register_node("cavestuff:cobble_with_moss", {
- description = "Cave Stone With Moss",
- tiles = {
- "default_cobble.png^caverealms_moss.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_moss_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- _is_bulk_mapgen_stone = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_lichen", {
- description = "Cave Stone With Lichen",
- tiles = {
- "default_cobble.png^caverealms_lichen.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_lichen_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- _is_bulk_mapgen_stone = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_algae", {
- description = "Cave Stone With Algae",
- tiles = {
- "default_cobble.png^caverealms_algae.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_algae_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- _is_bulk_mapgen_stone = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_salt", {
- description = "Cave Stone With Salt",
- tiles = {
- "default_cobble.png^caverealms_salty.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_salty_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults(),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- _is_bulk_mapgen_stone = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_rockmelt", {
- description = "Rockmelt Cobble",
- tiles = {"caverealms_hot_cobble.png"},
- groups = utility.dig_groups("softcobble", {hot=1, falling_node=1, melt_around=3, cobble_type=1, rockmelt=1}),
- damage_per_second = 1*500,
- _damage_per_second_type = "heat",
- _death_message = "<player> succumbed to melted rock.",
- light_source = 5,
- sounds = default.node_sound_stone_defaults(),
- drop = "default:cobble",
- _is_bulk_mapgen_stone = true,
- movement_speed_multiplier = default.SLOW_SPEED,
- on_construct = function(pos)
- torchmelt.start_melting(pos)
- end,
- after_place_node = function(...)
- return cavestuff.hotcobble.after_place_node(...)
- end,
- after_dig_node = function(...)
- return cavestuff.hotcobble.after_dig_node(...)
- end,
- on_player_walk_over = function(...)
- return cavestuff.hotcobble.on_player_walk_over(...)
- end,
- on_finish_collapse = function(...)
- return cavestuff.hotcobble.on_finish_collapse(...)
- end,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:glow_sapphire", {
- description = "Glowing Sapphire",
- tiles = {"caverealms_glow_crystal.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 13,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_sapphire",
- "cavestuff:glow_sapphire",
- utility.dig_groups("crystal"),
- {"caverealms_glow_crystal.png"},
- "Glowing Sapphire",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_sapphire", {
- sunlight_propagates = true,
- light_source = 13,
- })
- minetest.override_item("stairs:stair_glow_sapphire", {
- sunlight_propagates = true,
- light_source = 13,
- })
- minetest.register_node("cavestuff:glow_emerald", {
- description = "Glowing Emerald",
- tiles = {"caverealms_glow_emerald.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 10,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_emerald",
- "cavestuff:glow_emerald",
- utility.dig_groups("crystal"),
- {"caverealms_glow_emerald.png"},
- "Glowing Emerald",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_emerald", {
- sunlight_propagates = true,
- light_source = 10,
- })
- minetest.override_item("stairs:stair_glow_emerald", {
- sunlight_propagates = true,
- light_source = 10,
- })
- minetest.register_node("cavestuff:glow_mese", {
- description = "Glowing Mese",
- tiles = {"caverealms_glow_mese.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 14,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_mese",
- "cavestuff:glow_mese",
- utility.dig_groups("crystal"),
- {"caverealms_glow_mese.png"},
- "Glowing Mese",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_mese", {
- sunlight_propagates = true,
- light_source = 14,
- })
- minetest.override_item("stairs:stair_glow_mese", {
- sunlight_propagates = true,
- light_source = 14,
- })
- minetest.register_node("cavestuff:glow_ruby", {
- description = "Glowing Ruby",
- tiles = {"caverealms_glow_ruby.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 8,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_ruby",
- "cavestuff:glow_ruby",
- utility.dig_groups("crystal"),
- {"caverealms_glow_ruby.png"},
- "Glowing Ruby",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_ruby", {
- sunlight_propagates = true,
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_ruby", {
- sunlight_propagates = true,
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_amethyst", {
- description = "Glowing Amethyst",
- tiles = {"caverealms_glow_amethyst.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 7,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_amethyst",
- "cavestuff:glow_amethyst",
- utility.dig_groups("crystal"),
- {"caverealms_glow_amethyst.png"},
- "Glowing Amethyst",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_amethyst", {
- sunlight_propagates = true,
- light_source = 7,
- })
- minetest.override_item("stairs:stair_glow_amethyst", {
- sunlight_propagates = true,
- light_source = 7,
- })
- minetest.register_node("cavestuff:glow_sapphire_ore", {
- description = "Embedded Glowing Sapphire",
- tiles = {"caverealms_glow_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_sapphire_ore",
- "cavestuff:glow_sapphire_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_ore.png"},
- "Embedded Glowing Sapphire",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_sapphire_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_sapphire_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_emerald_ore", {
- description = "Embedded Glowing Emerald",
- tiles = {"caverealms_glow_emerald_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_emerald_ore",
- "cavestuff:glow_emerald_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_emerald_ore.png"},
- "Embedded Glowing Emerald",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_emerald_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_emerald_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_ruby_ore", {
- description = "Embedded Glowing Ruby",
- tiles = {"caverealms_glow_ruby_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_ruby_ore",
- "cavestuff:glow_ruby_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_ruby_ore.png"},
- "Embedded Glowing Ruby",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_ruby_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_ruby_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_amethyst_ore", {
- description = "Embedded Glowing Amethyst",
- tiles = {"caverealms_glow_amethyst_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_amethyst_ore",
- "cavestuff:glow_amethyst_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_amethyst_ore.png"},
- "Embedded Glowing Amethyst",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_amethyst_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_amethyst_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_worm", {
- description = "Glow Worms",
- tiles = {"caverealms_glow_worm.png"},
- inventory_image = "caverealms_glow_worm.png",
- wield_image = "caverealms_glow_worm.png",
- groups = utility.dig_groups("plant", {
- hanging_node = 1, flammable = 3,
- }),
- light_source = 5,
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- climbable = true,
- drop = "",
- shears_drop = true,
- -- Selection box interferes with hanging node group?
- -- Making the selection box smaller seems to prevent the
- -- hanging node group from working properly.
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
- },
- })
- minetest.register_node("cavestuff:glow_fungus", {
- description = "Glow Fungus",
- tiles = {"caverealms_glow_fungus.png"},
- inventory_image = "caverealms_glow_fungus.png",
- wield_image = "caverealms_glow_fungus.png",
- groups = utility.dig_groups("plant", {
- attached_node = 1, flammable = 3,
- }),
- light_source = 5,
- paramtype = "light",
- drawtype = "firelike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- buildable_to = true,
- drop = "",
- shears_drop = true,
- -- Selection box interferes with hanging node group?
- -- Making the selection box smaller seems to prevent the
- -- hanging node group from working properly.
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- })
- minetest.register_node("cavestuff:glow_obsidian", {
- description = "Luminescent Obsidian",
- tiles = {"caverealms_glow_obsidian.png"},
- groups = utility.dig_groups("obsidian", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- node_dig_prediction = "",
- after_destruct = function(pos)
- minetest.after(0, ambiance.recheck_nearby_sound_beacons, {x=pos.x, y=pos.y, z=pos.z}, 16)
- end,
- on_destruct = function(pos)
- obsidian_gateway.on_damage_gate(pos)
- end,
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian",
- type = "shapeless",
- recipe = {"default:obsidian", "glowstone:glowing_dust"},
- })
- stairs.register_stair_and_slab("glow_obsidian", "cavestuff:glow_obsidian",
- utility.dig_groups("obsidian"),
- {"caverealms_glow_obsidian.png"},
- "Luminescent Obsidian",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:glow_obsidian_brick", {
- description = "Luminescent Obsidian Brick",
- tiles = {"caverealms_glow_obsidian_brick.png"},
- groups = utility.dig_groups("brick", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- node_dig_prediction = "",
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian_brick 4",
- recipe = {
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- },
- })
- stairs.register_stair_and_slab(
- "glow_obsidian_brick",
- "cavestuff:glow_obsidian_brick",
- utility.dig_groups("brick"),
- {"caverealms_glow_obsidian_brick.png"},
- "Luminescent Obsidian Brick",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:glow_obsidian_block", {
- description = "Luminescent Obsidian Block",
- tiles = {"caverealms_glow_obsidian_block.png"},
- groups = utility.dig_groups("block", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- node_dig_prediction = "",
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian_block 9",
- recipe = {
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- },
- })
- stairs.register_stair_and_slab(
- "glow_obsidian_block",
- "cavestuff:glow_obsidian_block",
- utility.dig_groups("block"),
- {"caverealms_glow_obsidian_block.png"},
- "Luminescent Obsidian Block",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian", {
- description = "Dead Obsidian",
- tiles = {"technic_obsidian.png"},
- groups = utility.dig_groups("obsidian", {
- immovable = 1,
- }),
- sounds = default.node_sound_stone_defaults(),
- movement_speed_multiplier = default.ROAD_SPEED_CAVERN,
- node_dig_prediction = "",
- -- Note: adamant TNT mining depends on this.
- on_blast = function(...) end, -- Blast resistant.
- after_destruct = function(pos)
- minetest.after(0, ambiance.recheck_nearby_sound_beacons, {x=pos.x, y=pos.y, z=pos.z}, 16)
- end,
- on_destruct = function(pos)
- obsidian_gateway.on_damage_gate(pos)
- end,
- crushing_damage = 5000,
- })
- stairs.register_stair_and_slab(
- "dark_obsidian",
- "cavestuff:dark_obsidian",
- utility.dig_groups("obsidian"),
- {"technic_obsidian.png"},
- "Dead Obsidian",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian_brick", {
- description = "Dead Obsidian Brick",
- tiles = {"technic_obsidian_brick.png"},
- groups = utility.dig_groups("obsidian"),
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- crushing_damage = 5000,
- node_dig_prediction = "",
- })
- stairs.register_stair_and_slab(
- "dark_obsidian_brick",
- "cavestuff:dark_obsidian_brick",
- utility.dig_groups("obsidian"),
- {"technic_obsidian_brick.png"},
- "Dead Obsidian Brick",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian_block", {
- description = "Dead Obsidian Block",
- tiles = {"technic_obsidian_block.png"},
- groups = utility.dig_groups("obsidian"),
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- crushing_damage = 5000,
- node_dig_prediction = "",
- })
- stairs.register_stair_and_slab(
- "dark_obsidian_block",
- "cavestuff:dark_obsidian_block",
- utility.dig_groups("obsidian"),
- {"technic_obsidian_block.png"},
- "Dead Obsidian Block",
- default.node_sound_stone_defaults())
- minetest.register_craft({
- output = "cavestuff:dark_obsidian_brick 4",
- recipe = {
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- }
- })
- minetest.register_craft({
- output = "cavestuff:dark_obsidian_block 9",
- recipe = {
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- }
- })
- minetest.register_node("cavestuff:coal_dust", {
- description = "Coal Dust Block",
- tiles = {"caverealms_coal_dust.png"},
- groups = utility.dig_groups("sand", {falling_node = 1}),
- sounds = default.node_sound_gravel_defaults(),
- --drop = "dusts:coal 9",
- movement_speed_multiplier = default.SLOW_SPEED,
- })
- minetest.register_craft({
- output = "cavestuff:coal_dust",
- recipe = {
- {"dusts:coal", "dusts:coal", "dusts:coal"},
- {"dusts:coal", "default:sand", "dusts:coal"},
- {"dusts:coal", "dusts:coal", "dusts:coal"},
- },
- })
- minetest.register_node("cavestuff:salt_crystal", {
- description = "Salt Crystal",
- tiles = {"caverealms_salt_crystal.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_gravel_defaults(),
- light_source = 1,
- paramtype = "light",
- use_texture_alpha = "blend",
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- local eat_mushroom = minetest.item_eat(1)
- local function mushroom_poison(pname, step)
- local msg = "# Server: <" .. rename.gpn(pname) .. "> ate a mushroom. Desperate!"
- hb4.delayed_harm({name=pname, step=step, min=1*500, max=3*500, msg=msg, poison=true})
- end
- minetest.register_node("cavestuff:mycena", {
- description = "Mycena Mushroom",
- tiles = {"caverealms_mycena.png"},
- inventory_image = "caverealms_mycena.png",
- wield_image = "caverealms_mycena.png",
- groups = utility.dig_groups("plant", {attached_node = 1, flammable = 3}),
- light_source = 3,
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- buildable_to = true,
- visual_scale = 0.6,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- sounds = default.node_sound_leaves_defaults(),
- drop = "",
- shears_drop = true,
- flowerpot_drop = "cavestuff:mycena",
- on_use = function(itemstack, user, pointed_thing)
- if not user or not user:is_player() then return end
- minetest.after(1, mushroom_poison, user:get_player_name(), 3)
- return eat_mushroom(itemstack, user, pointed_thing)
- end,
- on_construct = function(...)
- return flowers.on_mushroom_construct(...)
- end,
- on_destruct = function(...)
- return flowers.on_mushroom_destruct(...)
- end,
- on_timer = function(...)
- return flowers.on_mushroom_timer(...)
- end,
- on_punch = function(...)
- return flowers.on_mushroom_punch(...)
- end,
- })
- minetest.register_node("cavestuff:fungus", {
- description = "Glowing Fungus",
- tiles = {"caverealms_fungi.png"},
- inventory_image = "caverealms_fungi.png",
- wield_image = "caverealms_fungi.png",
- groups = utility.dig_groups("plant", {attached_node = 1, flammable = 3}),
- light_source = 3,
- paramtype = "light",
- drawtype = "firelike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- buildable_to = true,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- sounds = default.node_sound_leaves_defaults(),
- drop = "",
- shears_drop = true,
- flowerpot_drop = "cavestuff:fungus",
- on_use = function(itemstack, user, pointed_thing)
- if not user or not user:is_player() then return end
- -- Fewer steps than the mycena, to simulate being less poisonous.
- minetest.after(1, mushroom_poison, user:get_player_name(), 2)
- return eat_mushroom(itemstack, user, pointed_thing)
- end,
- on_construct = function(...)
- return flowers.on_mushroom_construct(...)
- end,
- on_destruct = function(...)
- return flowers.on_mushroom_destruct(...)
- end,
- on_timer = function(...)
- return flowers.on_mushroom_timer(...)
- end,
- on_punch = function(...)
- return flowers.on_mushroom_punch(...)
- end,
- })
- minetest.register_node("cavestuff:icicle_up", {
- description = "Icicle",
- tiles = {"caverealms_icicle_up.png"},
- inventory_image = "caverealms_icicle_up.png",
- wield_image = "caverealms_icicle_up.png",
- groups = utility.dig_groups("bigitem", {
- attached_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_up_glowing", {
- description = "Icicle With Glowing Minerals",
- tiles = {"caverealms_icicle_up.png"},
- inventory_image = "caverealms_icicle_up.png",
- wield_image = "caverealms_icicle_up.png",
- groups = utility.dig_groups("bigitem", {
- attached_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- light_source = 7,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_down", {
- description = "Icicle",
- tiles = {"caverealms_icicle_down.png"},
- inventory_image = "caverealms_icicle_down.png",
- wield_image = "caverealms_icicle_down.png",
- groups = utility.dig_groups("bigitem", {
- hanging_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_down_glowing", {
- description = "Icicle With Glowing Minerals",
- tiles = {"caverealms_icicle_down.png"},
- inventory_image = "caverealms_icicle_down.png",
- wield_image = "caverealms_icicle_down.png",
- groups = utility.dig_groups("bigitem", {
- hanging_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- light_source = 7,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- })
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:bluecrystal" .. i, {
- description = "Moon Gem",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"caverealms_glow_crystal.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "mesh",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- use_texture_alpha = "blend",
- sounds = default.node_sound_glass_defaults(),
- light_source = 5,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- visual_scale = 1.3,
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- utility.damage_player(player, "fleshy", (1*500), "ground")
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a moon spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:saltcrystal" .. i, {
- description = "Salt Crystal",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"caverealms_salty.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "mesh",
- groups = utility.dig_groups("crystal", {
- attached_node = 1,
- fall_damage_add_percent = 100,
- }),
- use_texture_alpha = "blend",
- sounds = default.node_sound_glass_defaults(),
- light_source = 5,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- utility.damage_player(player, "fleshy", 1*500, "ground")
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a salt spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:spike" .. i, {
- description = "Rock Spike",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"default_stone.png"},
- drawtype = "mesh",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- sounds = default.node_sound_stone_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- utility.damage_player(player, "fleshy", 1*500, "ground")
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a rock spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:redspike" .. i, {
- description = "Redstone Spike",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"default_desert_stone.png"},
- drawtype = "mesh",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- sounds = default.node_sound_stone_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- utility.damage_player(player, "fleshy", 1*500, "ground")
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a rock spike.")
- end
- end,
- })
- end
- -- Special cobble type which mimics default cobble. Needed for cavegen.
- -- The player should not be able to obtain this nodetype directly.
- minetest.register_node("cavestuff:cobble", {
- description = "Cobblestone",
- tiles = {"default_cobble.png"},
- is_ground_content = true, -- Important!
- groups = utility.dig_groups("cobble", {
- melts = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- drop = "default:cobble", -- Mimic default cobble.
- _is_bulk_mapgen_stone = true,
- sounds = default.node_sound_stone_defaults(),
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- on_finish_collapse = function(pos)
- minetest.swap_node(pos, {name="default:cobble"})
- end,
- on_collapse_to_entity = function(pos)
- return {ItemStack("default:cobble")}
- end,
- })
|