forked from mff/lavatemple
Compare commits
No commits in common. "master" and "master" have entirely different histories.
12
dagger.lua
12
dagger.lua
@ -6,11 +6,11 @@ local function tick()
|
|||||||
for i,player in ipairs(players) do
|
for i,player in ipairs(players) do
|
||||||
local target = lavatemple.mapgen_data.pos;
|
local target = lavatemple.mapgen_data.pos;
|
||||||
if not target then return end
|
if not target then return end
|
||||||
local pos = player:get_pos()
|
local pos = player:getpos()
|
||||||
local dir = player:get_look_horizontal()
|
local dir = player:get_look_yaw()
|
||||||
local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z))
|
local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z))
|
||||||
if angle_north < 0 then angle_north = angle_north + 360 end
|
if angle_north < 0 then angle_north = angle_north + 360 end
|
||||||
local angle_dir = 360-math.deg(math.abs(dir))
|
local angle_dir = 90 - math.deg(dir)
|
||||||
local angle_relative = (angle_north - angle_dir) % 360
|
local angle_relative = (angle_north - angle_dir) % 360
|
||||||
local compass_image = math.floor((angle_relative/30) + 0.5)%12
|
local compass_image = math.floor((angle_relative/30) + 0.5)%12
|
||||||
|
|
||||||
@ -64,9 +64,9 @@ end
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'lavatemple:dagger_1',
|
output = 'lavatemple:dagger_1',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'mobs:lava_orb', 'default:steel_ingot', 'mobs:lava_orb'},
|
{'zmobs:lava_orb', 'default:steel_ingot', 'zmobs:lava_orb'},
|
||||||
{'mobs:lava_orb', 'default:steel_ingot', 'mobs:lava_orb'},
|
{'zmobs:lava_orb', 'default:steel_ingot', 'zmobs:lava_orb'},
|
||||||
{'mobs:lava_orb', 'default:stick', 'mobs:lava_orb'}
|
{'zmobs:lava_orb', 'default:stick', 'zmobs:lava_orb'}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
5
depends.txt
Executable file
5
depends.txt
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
default
|
||||||
|
stairs
|
||||||
|
mobs
|
||||||
|
worldedit
|
||||||
|
watershed?
|
1
init.lua
1
init.lua
@ -5,4 +5,3 @@ dofile(MODPATH.."/items.lua")
|
|||||||
dofile(MODPATH.."/mapgen.lua")
|
dofile(MODPATH.."/mapgen.lua")
|
||||||
dofile(MODPATH.."/dagger.lua")
|
dofile(MODPATH.."/dagger.lua")
|
||||||
|
|
||||||
minetest.log("action", "[lavatemple] loaded.")
|
|
||||||
|
@ -43,7 +43,7 @@ minetest.register_on_generated(function(minp,maxp,seed)
|
|||||||
io.close(f)
|
io.close(f)
|
||||||
if not contents then return end
|
if not contents then return end
|
||||||
-- Clear the area since worldedit doesn't save "air" nodes
|
-- Clear the area since worldedit doesn't save "air" nodes
|
||||||
local pos1, pos2, count = worldedit.allocate(ltp, contents)
|
pos1, pos2, count = worldedit.allocate(ltp, contents)
|
||||||
for x=pos1.x,pos2.x do
|
for x=pos1.x,pos2.x do
|
||||||
for y=pos1.y,pos2.y do
|
for y=pos1.y,pos2.y do
|
||||||
for z=pos1.z,pos2.z do
|
for z=pos1.z,pos2.z do
|
||||||
|
5
mod.conf
5
mod.conf
@ -1,5 +0,0 @@
|
|||||||
name = lavatemple
|
|
||||||
title = Lava Temple
|
|
||||||
description = Add a special hidden structure
|
|
||||||
depends = default,stairs,mobs,worldedit
|
|
||||||
optional_depends = watershed,moreblocks
|
|
33
nodes.lua
33
nodes.lua
@ -6,29 +6,15 @@ minetest.register_node("lavatemple:brick", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
if minetest.get_modpath("moreblocks") then
|
stairs.register_stair_and_slab(
|
||||||
local nodename = "lavatemple:brick"
|
"lavatemple_brick",
|
||||||
local ndef = table.copy(minetest.registered_nodes[nodename])
|
"lavatemple:brick",
|
||||||
ndef.sunlight_propagates = true
|
{dark=1},
|
||||||
ndef.place_param2 = nil
|
{"lavatemple_brick.png"},
|
||||||
|
"Darkbrick Stair",
|
||||||
stairsplus:register_all(
|
"Darkbrick Slab",
|
||||||
"lavatemple",
|
default.node_sound_stone_defaults()
|
||||||
"brick",
|
)
|
||||||
nodename,
|
|
||||||
ndef
|
|
||||||
)
|
|
||||||
else
|
|
||||||
stairs.register_stair_and_slab(
|
|
||||||
"lavatemple_brick",
|
|
||||||
"lavatemple:brick",
|
|
||||||
{dark=1},
|
|
||||||
{"lavatemple_brick.png"},
|
|
||||||
"Darkbrick Stair",
|
|
||||||
"Darkbrick Slab",
|
|
||||||
default.node_sound_stone_defaults()
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("lavatemple:ladder", {
|
minetest.register_node("lavatemple:ladder", {
|
||||||
description = "Darkbrick Ladder",
|
description = "Darkbrick Ladder",
|
||||||
@ -36,7 +22,6 @@ minetest.register_node("lavatemple:ladder", {
|
|||||||
tiles = {"lavatemple_ladder.png"},
|
tiles = {"lavatemple_ladder.png"},
|
||||||
inventory_image = "lavatemple_ladder_inv.png",
|
inventory_image = "lavatemple_ladder_inv.png",
|
||||||
wield_image = "lavatemple_ladder_inv.png",
|
wield_image = "lavatemple_ladder_inv.png",
|
||||||
use_texture_alpha = "clip",
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
|
Loading…
Reference in New Issue
Block a user