458 lines
15 KiB
Lua
458 lines
15 KiB
Lua
-- TODO: refactor / cleanup
|
|
--
|
|
function illuna.wikiconstruct(pos)
|
|
local meta = minetest.get_meta(pos)
|
|
minetest.add_entity({x=pos.x, y=pos.y+0.96, z=pos.z}, "illuna:wikitop")
|
|
local timer = minetest.get_node_timer(pos)
|
|
timer:start(5.0)
|
|
end
|
|
|
|
function illuna.wikidestruct(pos)
|
|
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.96)) do
|
|
if obj and obj:get_luaentity() and
|
|
obj:get_luaentity().name == "illuna:wikitop" then
|
|
obj:remove()
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
minetest.override_item("wiki:wiki", {
|
|
tiles= {
|
|
"illuna_wiki_top.png",
|
|
"illuna_wiki_bottom.png",
|
|
"illuna_wiki_side.png",
|
|
"illuna_wiki_side.png",
|
|
"illuna_wiki_side.png",
|
|
"illuna_wiki_side.png",
|
|
},
|
|
on_construct = illuna.wikiconstruct,
|
|
on_destruct = illuna.wikidestruct
|
|
})
|
|
|
|
minetest.register_entity("illuna:wikitop", {
|
|
visual = "wielditem",
|
|
visual_size = {x=0.4, y=0.4},
|
|
collisionbox = {0},
|
|
physical = false,
|
|
automatic_rotate = math.pi * 0.15,
|
|
nametag = "Illuna Wiki",
|
|
nametag_color = "#6893c4",
|
|
textures = {"illuna:wikitop"},
|
|
on_activate = function(self)
|
|
local pos = self.object:getpos()
|
|
local pos_under = {x=pos.x, y=pos.y-1, z=pos.z}
|
|
if minetest.get_node(pos_under).name ~= "wiki:wiki" then
|
|
self.object:remove()
|
|
end
|
|
end
|
|
})
|
|
|
|
minetest.register_craftitem("illuna:wikitop", {
|
|
inventory_image = "illuna_wikitop.png",
|
|
})
|
|
|
|
minetest.register_node("illuna:desert_gravel", {
|
|
description = "Gravel",
|
|
tiles = {"illuna_desertgravel.png"},
|
|
groups = {crumbly = 2, falling_node = 1},
|
|
sounds = default.node_sound_dirt_defaults({
|
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
|
dug = {name="default_gravel_footstep", gain=1.0},
|
|
}),
|
|
drop = {
|
|
max_items = 1,
|
|
items = {
|
|
{items = {'default:flint'}, rarity = 16},
|
|
{items = {'illuna:desert_gravel'}}
|
|
}
|
|
}
|
|
})
|
|
|
|
minetest.register_alias("illuna:desertgravel", "illuna:desert_gravel")
|
|
|
|
minetest.register_node("illuna:stonebrick", {
|
|
description = "Stone Brick",
|
|
paramtype2 = "facedir",
|
|
place_param2 = 0,
|
|
tiles = {"default_stone_brick.png"},
|
|
is_ground_content = false,
|
|
groups = {cracky = 2, stone = 1},
|
|
light_source = 3,
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:moonbrick", {
|
|
description = "Moon Brick",
|
|
paramtype2 = "facedir",
|
|
tiles = {"xdecor_moonbrick.png"},
|
|
groups = {cracky = 2},
|
|
light_source = 3,
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:hotstone", {
|
|
description = "Hot Stone",
|
|
paramtype2 = "facedir",
|
|
tiles = {"illuna_hotstone.png"},
|
|
groups = {cracky = 2, igniter = 1, stone = 1},
|
|
light_source = 4,
|
|
damage_per_second = 6,
|
|
drop = "caverealms:hot_cobble",
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
function illuna.teamconstruct(pos)
|
|
minetest.add_entity({x=pos.x, y=pos.y+1.35, z=pos.z}, "illuna:teamlist")
|
|
local timer = minetest.get_node_timer(pos)
|
|
timer:start(5.0)
|
|
end
|
|
|
|
function illuna.particleconstruct(pos)
|
|
minetest.add_particlespawner({
|
|
amount = 2,
|
|
time = 0,
|
|
minpos = pos,
|
|
maxpos = pos,
|
|
minvel = {x = -0, y = 0, z = -0},
|
|
maxvel = {x = 1, y = 1, z = 1},
|
|
minacc = {x = -1, y = -1, z = -1},
|
|
maxacc = {x = 1, y = 1, z = 1},
|
|
minexptime = 2,
|
|
maxexptime = 3,
|
|
minsize = 0.2,
|
|
maxsize = 1,
|
|
texture = "illuna_particle.png",
|
|
})
|
|
end
|
|
|
|
minetest.register_entity("illuna:teamlist", {
|
|
visual = "sprite",
|
|
visual_size = {x=0.85, y=0.85},
|
|
collisionbox = {0},
|
|
physical = false,
|
|
textures = {"moreores_tin_block.png^team_wall.png"},
|
|
on_activate = function(self)
|
|
local pos = self.object:getpos()
|
|
local pos_under = {x=pos.x, y=pos.y-1, z=pos.z}
|
|
|
|
if minetest.get_node(pos_under).name ~= "illuna:team" then
|
|
self.object:remove()
|
|
end
|
|
end
|
|
})
|
|
|
|
minetest.register_node("illuna:team", {
|
|
description = "Illuna Teamlist",
|
|
tiles = {"caverealms_glow_obsidian.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {cracky = 3},
|
|
light_source = 20,
|
|
drop = 'illuna:team',
|
|
on_construct = illuna.teamconstruct,
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:particlespawner", {
|
|
description = "Illuna Particlespawner",
|
|
tiles = {"caverealms_glow_obsidian.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {cracky = 3},
|
|
light_source = 20,
|
|
drop = 'illuna:particlespawner',
|
|
on_construct = illuna.particleconstruct,
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:welcome_block_1", {
|
|
description = "Illuna Welcome Block 1",
|
|
tiles = {"default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png^welcome_block_1.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {cracky = 3},
|
|
on_place = minetest.rotate_node,
|
|
drop = 'illuna:welcome_block_1',
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:welcome_block_2", {
|
|
description = "Illuna Welcome Block 2",
|
|
tiles = {"default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png^welcome_block_2.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {cracky = 3},
|
|
on_place = minetest.rotate_node,
|
|
drop = 'illuna:welcome_block_2',
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:welcome_block_3", {
|
|
description = "Illuna Welcome Block 3",
|
|
tiles = {"default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png^welcome_block_3.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {cracky = 3},
|
|
on_place = minetest.rotate_node,
|
|
drop = 'illuna:welcome_block_3',
|
|
sounds = default.node_sound_stone_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:instruction_block_1", {
|
|
description = "Instruction Block 1",
|
|
tiles = {"default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png^instruction_block_1.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {unbreakable = 1},
|
|
on_place = minetest.rotate_node,
|
|
sounds = default.node_sound_dirt_defaults({
|
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
|
dug = {name="default_gravel_footstep", gain=1.0},
|
|
}),
|
|
drop = {
|
|
max_items = 1,
|
|
items = {
|
|
{items = {'illuna:instruction_block_1'}}
|
|
}
|
|
}
|
|
})
|
|
|
|
minetest.register_node("illuna:instruction_block_2", {
|
|
description = "Instruction Block 2",
|
|
tiles = {"default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png^instruction_block_2.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {unbreakable = 1},
|
|
on_place = minetest.rotate_node,
|
|
sounds = default.node_sound_dirt_defaults({
|
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
|
dug = {name="default_gravel_footstep", gain=1.0},
|
|
}),
|
|
drop = {
|
|
max_items = 1,
|
|
items = {
|
|
{items = {'illuna:instruction_block_2'}}
|
|
}
|
|
}
|
|
})
|
|
|
|
minetest.register_node("illuna:instruction_block_3", {
|
|
description = "Instruction Block 3",
|
|
tiles = {"default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png^instruction_block_3.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {unbreakable = 1},
|
|
on_place = minetest.rotate_node,
|
|
sounds = default.node_sound_dirt_defaults({
|
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
|
dug = {name="default_gravel_footstep", gain=1.0},
|
|
}),
|
|
drop = {
|
|
max_items = 1,
|
|
items = {
|
|
{items = {'illuna:instruction_block_3'}}
|
|
}
|
|
}
|
|
})
|
|
|
|
minetest.register_node("illuna:instruction_block_4", {
|
|
description = "Instruction Block 4",
|
|
tiles = {"default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png", "default_stone_brick.png^instruction_block_4.png"},
|
|
paramtype2 = "facedir",
|
|
groups = {unbreakable = 1},
|
|
on_place = minetest.rotate_node,
|
|
sounds = default.node_sound_dirt_defaults({
|
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
|
dug = {name="default_gravel_footstep", gain=1.0},
|
|
}),
|
|
drop = {
|
|
max_items = 1,
|
|
items = {
|
|
{items = {'illuna:instruction_block_4'}}
|
|
}
|
|
}
|
|
})
|
|
minetest.register_node("illuna:lw_instructions", {
|
|
description = "Instructions for the biopodworld",
|
|
drawtype = "signlike",
|
|
tiles = {"lw_instructions.png"},
|
|
visual_scale = 3.0,
|
|
inventory_image = "lw_instructions.png",
|
|
wield_image = "lw_instructions.png",
|
|
paramtype = "light",
|
|
paramtype2 = "wallmounted",
|
|
light_source = 12,
|
|
sunlight_propagates = true,
|
|
walkable = false,
|
|
selection_box = {
|
|
type = "wallmounted",
|
|
},
|
|
groups = { unbreakable = 1 },
|
|
})
|
|
|
|
minetest.register_node("illuna:worldmap", {
|
|
description = "TechEth Worldmap",
|
|
drawtype = "signlike",
|
|
tiles = {"worldmap.png"},
|
|
visual_scale = 3.0,
|
|
inventory_image = "worldmap.png",
|
|
wield_image = "worldmap.png",
|
|
paramtype = "light",
|
|
paramtype2 = "wallmounted",
|
|
light_source = 12,
|
|
sunlight_propagates = true,
|
|
walkable = false,
|
|
selection_box = {
|
|
type = "wallmounted",
|
|
},
|
|
groups = { unbreakable = 1 },
|
|
})
|
|
minetest.register_node("illuna:techeth_logo", {
|
|
description = "Blabla Rabarber",
|
|
drawtype = "signlike",
|
|
tiles = {
|
|
{
|
|
name = "techeth_alpha.png",
|
|
animation = {
|
|
type = "vertical_frames",
|
|
aspect_w = 1000,
|
|
aspect_h = 1000,
|
|
length = 1
|
|
},
|
|
},
|
|
},
|
|
visual_scale = 3.0,
|
|
inventory_image = "techeth_alpha.png",
|
|
wield_image = "techeth_alpha.png",
|
|
paramtype2 = "wallmounted",
|
|
light_source = 12,
|
|
sunlight_propagates = true,
|
|
walkable = false,
|
|
selection_box = {
|
|
type = "wallmounted",
|
|
},
|
|
groups = { unbreakable = 1 },
|
|
})
|
|
if minetest.get_modpath("ethereal") then
|
|
-- disallow placing of lava below -2 except player has the trusted_player priv
|
|
minetest.override_item("default:lava_source", {
|
|
after_place_node = function(pos, placer, node)
|
|
if (minetest.check_player_privs(placer:get_player_name(), {trusted_player=true})) then
|
|
-- node was placed - let's store some playerinformations to make the moderators work easier
|
|
local meta = minetest.get_meta(pos)
|
|
meta:set_string("placer", placer:get_player_name() or "")
|
|
meta:set_string("infotext", "Some Lava (graceful placer: "..meta:get_string("placer") .. " - it's a trusted player.)")
|
|
else
|
|
-- player has not trusted_player, we will remove the node when not placed at least two nodes below sealevel
|
|
if pos.y >= -2 then
|
|
minetest.env:remove_node(pos)
|
|
else
|
|
-- node was placed - let's store some playerinformations to make the moderators work easier
|
|
local meta = minetest.get_meta(pos)
|
|
meta:set_string("placer", placer:get_player_name() or "")
|
|
meta:set_string("infotext", "Some Lava (graceful placer: "..meta:get_string("placer") .. ")")
|
|
end
|
|
end
|
|
end,
|
|
on_construct = function(pos, player)
|
|
local meta = minetest.get_meta(pos)
|
|
meta:set_string("placer", "")
|
|
end,
|
|
pointable = true,
|
|
})
|
|
|
|
-- nodeboxes by https://github.com/D00Med/LegendofMinetest
|
|
minetest.override_item("default:furnace", {
|
|
drawtype = "nodebox",
|
|
paramtype = "light",
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {
|
|
{-0.5, -0.5, -0.5, 0.5, -0.3125, 0.5}, -- NodeBox1
|
|
{-0.4375, 0.375, -0.5, 0.4375, 0.4375, 0.5}, -- NodeBox2
|
|
{-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5}, -- NodeBox3
|
|
{-0.5, 0.3125, -0.5, 0.5, 0.375, 0.5}, -- NodeBox4
|
|
{-0.5, -0.5, -0.5, -0.3125, 0.3125, 0.5}, -- NodeBox5
|
|
{0.3125, -0.5, -0.5, 0.5, 0.375, 0.5}, -- NodeBox6
|
|
{-0.5, -0.0625, -0.5, 0.5, 0.0625, 0.5}, -- NodeBox7
|
|
{-0.5, -0.5, -0.375, 0.5, 0.3125, 0.5}, -- NodeBox8
|
|
}
|
|
},
|
|
})
|
|
|
|
minetest.override_item("default:chest_locked", {
|
|
paramtype = "light",
|
|
drawtype = "nodebox",
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {
|
|
{-0.5, -0.5, -0.5, 0.5, 0.25, 0.5}, -- NodeBox1
|
|
{-0.5, 0.375, -0.375, 0.5, 0.4375, 0.375}, -- NodeBox2
|
|
{-0.5, 0.25, -0.4375, 0.5, 0.375, 0.4375}, -- NodeBox3
|
|
{-0.5, 0.4375, -0.3125, 0.5, 0.5, 0.3125}, -- NodeBox4
|
|
}
|
|
},
|
|
})
|
|
|
|
|
|
minetest.override_item("default:chest", {
|
|
paramtype = "light",
|
|
drawtype = "nodebox",
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {
|
|
{-0.5, -0.5, -0.5, 0.5, 0.25, 0.5}, -- NodeBox1
|
|
{-0.5, 0.375, -0.375, 0.5, 0.4375, 0.375}, -- NodeBox2
|
|
{-0.5, 0.25, -0.4375, 0.5, 0.375, 0.4375}, -- NodeBox3
|
|
{-0.5, 0.4375, -0.3125, 0.5, 0.5, 0.3125}, -- NodeBox4
|
|
}
|
|
},
|
|
})
|
|
end
|
|
|
|
function illuna.node_sound_wool(table)
|
|
table = table or {}
|
|
table.footstep = table.footstep or
|
|
{name = "wool", gain = 1.0}
|
|
table.dug = table.dug or
|
|
{name = "default_dug_node", gain = 0.25}
|
|
table.place = table.place or
|
|
{name = "default_place_node_hard", gain = 1.0}
|
|
return table
|
|
end
|
|
local name = {"red", "green", "white", "black", "blue", "brown", "cyan",
|
|
"grey", "dark_green", "dark_grey", "magenta", "orange", "pink",
|
|
"red", "violet", "yellow"}
|
|
|
|
for i = 1, 16 do
|
|
local name = name[i]
|
|
minetest.override_item("wool:"..name, {sounds = illuna.node_sound_wool()})
|
|
end
|
|
|
|
minetest.register_node("illuna:hardwood_sink", {
|
|
description = "Illuna Hardwood Sinking",
|
|
tiles = {"building_blocks_hardwood.png"},
|
|
liquid_viscosity = 15,
|
|
liquidtype = "source",
|
|
liquid_alternative_flowing = "illuna:hardwood_sink",
|
|
liquid_alternative_source = "illuna:hardwood_sink",
|
|
liquid_renewable = false,
|
|
liquid_range = 0,
|
|
drowning = 1,
|
|
walkable = false,
|
|
climbable = false,
|
|
post_effect_color = {r = 35, g = 21, b = 15, a = 245},
|
|
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
|
sounds = default.node_sound_wood_defaults(),
|
|
})
|
|
|
|
minetest.register_node("illuna:junglewood_sink", {
|
|
description = "Illuna Junglewood Sinking",
|
|
tiles = {"default_junglewood.png"},
|
|
liquid_viscosity = 15,
|
|
liquidtype = "source",
|
|
liquid_alternative_flowing = "illuna:junglewood_sink",
|
|
liquid_alternative_source = "illuna:junglewood_sink",
|
|
liquid_renewable = false,
|
|
liquid_range = 0,
|
|
drowning = 1,
|
|
walkable = false,
|
|
climbable = false,
|
|
post_effect_color = {r = 35, g = 21, b = 15, a = 245},
|
|
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1},
|
|
sounds = default.node_sound_wood_defaults(),
|
|
})
|