added pyramid and updated textures

This commit is contained in:
Brett O'Donnell 2012-09-27 22:19:57 +09:30
parent d5dc58820d
commit b1525b4a09
34 changed files with 158 additions and 9 deletions

View File

@ -13,6 +13,10 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Textures:
deploy_nodes_blueprint.png - freeware - http://findicons.com/icon/178409/blueprint
---------------------------------- ----------------------------------
Description Description
---------------------------------- ----------------------------------
@ -65,7 +69,7 @@ mauvebic - author of multinode which provided code for spheres and cylinders
Echo - author of maze which provided code for spheres Echo - author of maze which provided code for spheres
neko259 - author of livehouse which inspired building spawning neko259 - author of livehouse which inspired building spawning
VanessaE - contributed buildings VanessaE - contributed buildings
kddekadenz - contributed buildings
ACDC - contributed buildings ACDC - contributed buildings
Nanuk - contributed buildings Nanuk - contributed buildings
irksomeduck - contributed buildings irksomeduck - contributed buildings
kddekadenz - contributed buildings

View File

@ -148,7 +148,7 @@ minetest.register_craft({
-- blueprint -- blueprint
minetest.register_craftitem("deploy_building:blueprint", { minetest.register_craftitem("deploy_building:blueprint", {
description = "Building Blueprint", description = "Building Blueprint",
inventory_image = "deploy_building_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_building_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_building:blueprint", output = "deploy_building:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 200 B

View File

@ -128,7 +128,7 @@ deploy_cylinder_y.register("Glass","glass","default:glass","default_glass.png")
-- blueprint -- blueprint
minetest.register_craftitem("deploy_cylinder_y:blueprint", { minetest.register_craftitem("deploy_cylinder_y:blueprint", {
description = "Cylinder Y Blueprint", description = "Cylinder Y Blueprint",
inventory_image = "deploy_cylinder_y_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_cylinder_y_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_cylinder_y:blueprint", output = "deploy_cylinder_y:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 216 B

View File

@ -248,7 +248,7 @@ deploy_maze.deploy = function(originpos, placer, material, size, floors)
-- print(braid_pos.x.."/"..braid_pos.y.."/"..braid_pos.l.." "..braid_pos.dx.."/"..braid_pos.dy) -- print(braid_pos.x.."/"..braid_pos.y.."/"..braid_pos.l.." "..braid_pos.dx.."/"..braid_pos.dy)
x = braid_pos.x + braid_pos.dx * 2 x = braid_pos.x + braid_pos.dx * 2
y = braid_pos.y + braid_pos.dy * 2 y = braid_pos.y + braid_pos.dy * 2
if math.random(5) == 1 and x > 0 and x < maze_size_x - 1 and y > 0 and y < maze_size_y - 1 and not maze[braid_pos.l][x][y] then if math.random(5) == 1 and x > 0 and x < maze_size_x - 1 and y > 0 and y < maze_size_z - 1 and not maze[braid_pos.l][x][y] then
-- remove wall if behind is corridor with 20% chance -- remove wall if behind is corridor with 20% chance
maze[braid_pos.l][braid_pos.x + braid_pos.dx][braid_pos.y + braid_pos.dy] = false maze[braid_pos.l][braid_pos.x + braid_pos.dx][braid_pos.y + braid_pos.dy] = false
-- print("removed "..braid_pos.l.."/"..braid_pos.x + braid_pos.dx.."/"..braid_pos.y + braid_pos.dy) -- print("removed "..braid_pos.l.."/"..braid_pos.x + braid_pos.dx.."/"..braid_pos.y + braid_pos.dy)
@ -426,7 +426,7 @@ deploy_maze.register("Glass","glass","default:glass","default_glass.png")
-- blueprint -- blueprint
minetest.register_craftitem("deploy_maze:blueprint", { minetest.register_craftitem("deploy_maze:blueprint", {
description = "Maze Blueprint", description = "Maze Blueprint",
inventory_image = "deploy_maze_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_maze_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_maze:blueprint", output = "deploy_maze:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 228 B

View File

@ -14,12 +14,12 @@ MAIN LOADER
deploy_nodes = {} deploy_nodes = {}
-- check for non-air blocks before deploying structure -- check for non-air blocks before deploying structure
deploy_nodes.check_for_space = true deploy_nodes.check_for_space = false
-- blueprint -- blueprint
minetest.register_craftitem("deploy_nodes:blueprint", { minetest.register_craftitem("deploy_nodes:blueprint", {
description = "Empty Blueprint", description = "Empty Blueprint",
inventory_image = "deploy_nodes_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_nodes_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_nodes:blueprint", output = "deploy_nodes:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 582 B

View File

@ -0,0 +1 @@
deploy_nodes

144
deploy_pyramid/init.lua Normal file
View File

@ -0,0 +1,144 @@
--[[
Deploy Nodes for Minetest
Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
Source Code: https://github.com/cornernote/minetest-deploy_nodes
License: GPLv3
Shape based on WorldEdit mod by Temperest: http://minetest.net/forum/viewtopic.php?id=2398
PYRAMID
]]--
-- expose api
deploy_pyramid = {}
-- deploy
deploy_pyramid.deploy = function(pos,placer,nodename,height)
-- check for space
if deploy_nodes.check_for_space==true then
for x=-height*0.5,height*0.5 do
for y=0,height do
for z=-height*0.5,height*0.5 do
if x~=0 or y~=0 or z~=0 then
local checkpos = {x=pos.x+x,y=pos.y+y,z=pos.z+z}
local checknode = minetest.env:get_node(checkpos).name
if checknode~="air" then
minetest.chat_send_player(placer:get_player_name(), "[deploy_pyramid] no room to build because "..checknode.." is in the way at "..dump(checkpos).."")
return
end
end
end
end
end
end
-- remove pyramid node
minetest.env:remove_node(pos)
-- build the pyramid
local pos1 = {x=pos.x-height, y=pos.y, z=pos.z-height}
local pos2 = {x=pos.x+height, y=pos.y+height, z=pos.z+height}
local np = {x=0, y=pos1.y, z=0}
local node = {name=nodename}
while np.y <= pos2.y do --each vertical level of the pyramid
np.x = pos1.x
while np.x <= pos2.x do
np.z = pos1.z
while np.z <= pos2.z do
minetest.env:add_node({x=np.x-height*0.5,y=np.y,z=np.z-height*0.5}, node)
np.z = np.z + 1
end
np.x = np.x + 1
end
np.y = np.y + 1
pos1.x, pos2.x = pos1.x + 1, pos2.x - 1
pos1.z, pos2.z = pos1.z + 1, pos2.z - 1
end
end
-- register
deploy_pyramid.register = function(label,name,material,texture)
-- small
minetest.register_node("deploy_pyramid:"..name.."_small", {
description = "Small "..label.." Pyramid",
tiles = {texture.."^deploy_pyramid_small.png"},
groups = {dig_immediate=3},
after_place_node = function(pos,placer)
deploy_pyramid.deploy(pos,placer,material,3,1,1)
end,
})
minetest.register_craft({
output = "deploy_pyramid:"..name.."_small",
recipe = {
{"deploy_pyramid:blueprint", material, material},
},
})
-- medium
minetest.register_node("deploy_pyramid:"..name.."_medium", {
description = "Medium "..label.." Pyramid",
tiles = {texture.."^deploy_pyramid_medium.png"},
groups = {dig_immediate=3},
after_place_node = function(pos,placer)
deploy_pyramid.deploy(pos,placer,material,6,2,2)
end,
})
minetest.register_craft({
output = "deploy_pyramid:"..name.."_medium",
recipe = {
{"deploy_pyramid:blueprint", "deploy_pyramid:"..name.."_small", "deploy_pyramid:"..name.."_small"},
},
})
-- large
minetest.register_node("deploy_pyramid:"..name.."_large", {
description = "Large "..label.." Pyramid",
tiles = {texture.."^deploy_pyramid_large.png"},
groups = {dig_immediate=3},
after_place_node = function(pos,placer)
deploy_pyramid.deploy(pos,placer,material,12,4,3)
end,
})
minetest.register_craft({
output = "deploy_pyramid:"..name.."_large",
recipe = {
{"deploy_pyramid:blueprint", "deploy_pyramid:"..name.."_medium", "deploy_pyramid:"..name.."_medium"},
},
})
end
-- register pyramids
deploy_pyramid.register("Dirt","dirt","default:dirt","default_dirt.png")
deploy_pyramid.register("Wood","wood","default:wood","default_wood.png")
deploy_pyramid.register("Brick","brick","default:brick","default_brick.png")
deploy_pyramid.register("Cobble","cobble","default:cobble","default_cobble.png")
deploy_pyramid.register("Stone","stone","default:stone","default_stone.png")
deploy_pyramid.register("Glass","glass","default:glass","default_glass.png")
-- blueprint
minetest.register_craftitem("deploy_pyramid:blueprint", {
description = "Pyramid Blueprint",
inventory_image = "deploy_nodes_blueprint.png^deploy_pyramid_blueprint.png",
})
minetest.register_craft({
output = "deploy_pyramid:blueprint",
recipe = {
{"", "deploy_nodes:blueprint", ""},
{"deploy_nodes:blueprint", "deploy_nodes:blueprint", "deploy_nodes:blueprint"},
},
})
-- log that we started
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname()))

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

View File

@ -129,7 +129,7 @@ deploy_sphere.register("Glass","glass","default:glass","default_glass.png")
-- blueprint -- blueprint
minetest.register_craftitem("deploy_sphere:blueprint", { minetest.register_craftitem("deploy_sphere:blueprint", {
description = "Sphere Blueprint", description = "Sphere Blueprint",
inventory_image = "deploy_sphere_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_sphere_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_sphere:blueprint", output = "deploy_sphere:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 200 B

View File

@ -176,7 +176,7 @@ deploy_spiral.register("Glass","glass","default:glass","default_glass.png")
-- blueprint -- blueprint
minetest.register_craftitem("deploy_spiral:blueprint", { minetest.register_craftitem("deploy_spiral:blueprint", {
description = "Spiral Blueprint", description = "Spiral Blueprint",
inventory_image = "deploy_spiral_blueprint.png", inventory_image = "deploy_nodes_blueprint.png^deploy_spiral_blueprint.png",
}) })
minetest.register_craft({ minetest.register_craft({
output = "deploy_spiral:blueprint", output = "deploy_spiral:blueprint",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 223 B