-
Notifications
You must be signed in to change notification settings - Fork 1
/
castle_towerwall.lua
126 lines (114 loc) · 4.43 KB
/
castle_towerwall.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
local towerwall = {}
towerwall.types = {
{"stonewall","StoneWall","castle_stonewall.png","castle:stonewall"},
{"dungeon","DungeonWall","castle_dungeon_stone.png","castle:dungeonwall"},
{"cornerwall","CornerWall","castle_cornwall.png","castle:cornerwall"},
{"pavingstone","Paving Stone","castle_pavement_brick.png","castle:pavement"},
-- {"bookshelf","Bookshelf","default_bookshelf.png","default:bookshelf"},
-- {"dirt","Dirt","default_dirt.png","default:dirt"},
-- {"stone","Stone","default_stone.png","default:stone"},
-- {"cobble","Cobble","default_cobble.png","default:cobble"},
-- {"sand","Sand","default_sand.png","default:sand"},
-- {"desert_sand","Desert Sand","default_desert_sand.png","default:desert_sand"},
-- {"desert_stone","Desert Stone","default_desert_stone.png","default:desert-stone"},
-- {"brick","Brick","default_brick.png","default:brick"},
-- {"steel","Steel","default_steel_block.png","default:steelblock"},
-- {"glass","Glass","default_glass.png","default:glass"},
-- {"stonebrick","Stone Brick","default_stone_brick.png","default:stonebrick"},
-- {"desert_stone_brick","Desert Stone Brick","default_desert_stone_brick.png","default:desertstonebrick"},
-- {"sand_stone_brick","Sand Stone Brick","default_sandstone_brick.png","default:sandstonebrick"},
-- {"tree","Tree","default_tree.png","default:tree"},
-- {"wood","Wood","default_wood.png","default:wood"},
-- {"sand_stone","Sand Stone","default_sandstone.png","default:sandstone"},
-- {"obsidian","Obsidian","default_obsidian.png","default:obsidian"},
-- {"gravel","Gravel","default_gravel.png","default:gravel"},
-- {"desertcobble","Desert Cobble","desert_cobble.png","castle:desert_cobble"},
}
for _, row in ipairs(towerwall.types) do
local name = row[1]
local desc = row[2]
local tile = row[3]
local craft_material = row[4]
--Standart towerwall
minetest.register_node("castle:" ..name.. "normaltowerwall", {
drawtype = "nodebox",
description = desc.." Normal Tower Wall ",
tiles = {tile},
groups = {cracky=3,attached_node=0},
sounds = default.node_sound_stone_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,-0.4375,0.5,0.5},
{-0.375,-0.5,-0.375,-0.3125,0.5,0.5},
{-0.25,-0.5,-0.25,-0.1875,0.5,0.5},
{-0.125,-0.5,-0.125,-0.0625,0.5,0.5},
{0,-0.5,0,0.0625,0.5,0.5},
{0.125,-0.5,0.125,0.1875,0.5,0.5},
{0.25,-0.5,0.25,0.3125,0.5,0.5},
{0.375,-0.5,0.375,0.4375,0.5,0.5},
{-0.4375,-0.5,-0.4375,-0.375,0.5,0.5},
{-0.3125,-0.5,-0.3125,-0.25,0.5,0.5},
{-0.1875,-0.5,-0.1875,-0.125,0.5,0.5},
{-0.0625,-0.5,-0.0625,0,0.5,0.5},
{0.0625,-0.5,0.0625,0.125,0.5,0.5},
{0.1875,-0.5,0.1875,0.25,0.5,0.5},
{0.3125,-0.5,0.3125,0.375,0.5,0.5},
{0.4375,-0.5,0.4375,0.5,0.5,0.5},
},
},
})
if craft_material then
--Choose craft material
minetest.register_craft({
output = "castle:" ..name.. "normaltowerwall 4",
recipe = {
{"",craft_material,""},
{"",craft_material,""},
{craft_material,craft_material,craft_material} },
})
end
-- TowerWall Slab Defense Wall
minetest.register_node("castle:" ..name.. "towerslab", {
drawtype = "nodebox",
description = desc.." Tower Slab",
tiles = {tile},
groups = {cracky=3,attached_node=0},
sounds = default.node_sound_stone_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,-0.4375,-0.25,0.5}, --NodeBox1
{-0.375,-0.5,-0.375,-0.3125,-0.25,0.5}, --NodeBox2
{-0.25,-0.5,-0.25,-0.1875,-0.25,0.5}, --NodeBox3
{-0.125,-0.5,-0.125,-0.0625,-0.25,0.5}, --NodeBox4
{0,-0.5,0,0.0625,-0.25,0.5}, --NodeBox5
{0.125,-0.5,0.125,0.1875,-0.25,0.5}, --NodeBox6
{0.25,-0.5,0.25,0.3125,-0.25,0.5}, --NodeBox7
{0.375,-0.5,0.375,0.4375,-0.25,0.5}, --NodeBox8
{-0.4375,-0.5,-0.4375,-0.375,-0.25,0.5}, --NodeBox9
{-0.3125,-0.5,-0.3125,-0.25,-0.25,0.5}, --NodeBox10
{-0.1875,-0.5,-0.1875,-0.125,-0.25,0.5}, --NodeBox11
{-0.0625,-0.5,-0.0625,0,-0.25,0.5}, --NodeBox12
{0.0625,-0.5,0.0625,0.125,-0.25,0.5}, --NodeBox13
{0.1875,-0.5,0.1875,0.25,-0.25,0.5}, --NodeBox14
{0.3125,-0.5,0.3125,0.375,-0.25,0.5}, --NodeBox15
{0.4375,-0.5,0.4375,0.5,-0.25,0.5}, --NodeBox16
},
},
})
if craft_material then
--Choose craft material
minetest.register_craft({
output = "castle:" ..name.. "towerslab 4",
recipe = {
{"",craft_material,""},
{"",craft_material,""},
{craft_material,craft_material,craft_material} },
})
end
end