-
Notifications
You must be signed in to change notification settings - Fork 1
/
castle_lawn.lua
170 lines (155 loc) · 4.82 KB
/
castle_lawn.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
local lawncornerstairs = {}
lawncornerstairs.types = {
-----Material Material Desc Standart tile Craft tileup tiledown tileleft tileright tilebehind tilefront
--{"lawn", "Lawn", "default_grass.png", "default_dirt.png", "default_grass.png"},
{"lawn2", "Lawn2", "castle_lawn2.png", "default_dirt.png", "castle_lawn2.png"},
{"lawn3", "Lawn3", "castle_lawn3.png", "default_dirt.png", "castle_lawn3.png"},
}
for _, row in ipairs(lawncornerstairs.types) do
local name = row[1]
local desc = row[2]
local inv = row[3]
local craft_logical = row[4]
local tileup = row[5] -- if alone , tile for all faces
local tiledown = row[6]
local tileleft = row[7]
local tileright = row[8]
local tilebehind = row[9]
local tilefront = row[10]
local alltiles -- Definition for all faces
local thesound = default.node_sound_dirt_defaults({footstep = {name="default_grass_footstep", gain=0.25},})
if tilesdown == nil then
alltiles = { inv }
else
alltiles = { tileup,tiledown,tileleft,tileright,tilebehind,tilefront }
end
minetest.register_node(":stairs:stair_" ..name.. "_cornerstairs", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Castle " ..desc.. " Corner Stairs",
tiles = alltiles ,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0,0.5}, --NodeBox1
{0,0,0,0.5,0.5,0.5}, --NodeBox2
{-0.5,0,-0.5,0,0.5,0.5},
}
},
groups = {cracky=3},
sounds = thesound,
})
minetest.register_node(":stairs:stair_" ..name.. "_cornerslab", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Castle " ..desc.. " Slab Stairs",
tiles = alltiles ,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0,0.5}, --NodeBox1
{-0.5,0,0,0,0.5,0.5}, --NodeBox2
}
},
groups = {cracky=3},
sounds = thesound,
})
--Turning Left stair
minetest.register_node(":stairs" ..name.. "_turning_stairleft",{
drawtype="nodebox",
description = desc.. " Left Turning Stair",
paramtype = "light",
paramtype2 = "facedir",
tiles = {inv},
groups = {cracky=3,attached_node=0},
sounds = thesound,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5}, --NodeBox1
{-0.5,0,0.4375,0.5,0.5,0.5}, --NodeBox18--
{-0.5,0,0.3125,0.375,0.5,0.375}, --NodeBox19--
{-0.5,0,0.1875,0.25,0.5,0.25}, --NodeBox20--
{-0.5,0,0.0625,0.125,0.5,0.125}, --NodeBox21--
{-0.5,0,-0.0625,0,0.5,0}, --NodeBox22--
{-0.5,0,-0.1875,-0.125,0.5,-0.125}, --NodeBox23--
{-0.5,0,-0.3125,-0.25,0.5,-0.25}, --NodeBox24--
{-0.5,0,-0.5,-0.4375,0.5,-0.4375}, --NodeBox25--
{-0.5,0,-0.4375,-0.375,0.5,-0.375}, --NodeBox10
{-0.5,0,-0.375,-0.3125,0.5,-0.3125}, --NodeBox11
{-0.5,0,-0.25,-0.1875,0.5,-0.1875}, --NodeBox12
{-0.5,0,-0.125,-0.0625,0.5,-0.0625}, --NodeBox13
{-0.5,0,0,0.0625,0.5,0.0625}, --NodeBox14
{-0.5,0,0.125,0.1875,0.5,0.1875}, --NodeBox15
{-0.5,0,0.25,0.3125,0.5,0.3125}, --NodeBox16
{-0.5,0,0.375,0.4375,0.5,0.4375}, --NodeBox17
},
}
})
--Turning Right stair
minetest.register_node(":stairs" ..name.. "_turning_stairright",{
drawtype="nodebox",
description = desc.. " Right Turning Stair",
paramtype = "light",
paramtype2 = "facedir",
tiles = {inv},
groups = {cracky=3,attached_node=0},
sounds = thesound,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5}, --NodeBox1
{0.5,0,0.4375,-0.5,0.5,0.5}, --NodeBox18--
{0.5,0,0.3125,-0.375,0.5,0.375}, --NodeBox19--
{0.5,0,0.1875,-0.25,0.5,0.25}, --NodeBox20--
{0.5,0,0.0625,-0.125,0.5,0.125}, --NodeBox21--
{0.5,0,-0.0625,0,0.5,0}, --NodeBox22--
{0.5,0,-0.1875,0.125,0.5,-0.125}, --NodeBox23--
{0.5,0,-0.3125,0.25,0.5,-0.25}, --NodeBox24--
{0.5,0,-0.5,0.4375,0.5,-0.4375}, --NodeBox25--
{0.5,0,-0.4375,0.375,0.5,-0.375}, --NodeBox10
{0.5,0,-0.375,0.3125,0.5,-0.3125}, --NodeBox11
{0.5,0,-0.25,0.1875,0.5,-0.1875}, --NodeBox12
{0.5,0,-0.125,0.0625,0.5,-0.0625}, --NodeBox13
{0.5,0,0,-0.0625,0.5,0.0625}, --NodeBox14
{0.5,0,0.125,-0.1875,0.5,0.1875}, --NodeBox15
{0.5,0,0.25,-0.3125,0.5,0.3125}, --NodeBox16
{0.5,0,0.375,-0.4375,0.5,0.4375}, --NodeBox17
},
}
})
stairs.register_stair_and_slab(name, craft_logical,
{cracky=3},
{inv},
"Castle " ..desc.. " Stair",
"Castle " ..desc.. " Slab",
thesound)
minetest.register_craft({
output = "castle:stairs 12",
recipe = {
{"castle:stonewall","",""},
{"castle:stonewall","castle:stonewall",""},
{"castle:stonewall","castle:stonewall","castle:stonewall"},
}
})
minetest.register_craft({
output = "castle:stairs 2",
recipe = {
{"castle:stonewall","",""},
{"castle:saw","",""},
{"","",""},
}
})
minetest.register_node("castle:" ..name, {
description = "Castle " ..desc ,
drawtype = "normal",
tiles = {inv},
paramtype = light,
-- paramtype2 = "facedir",
drop = "castle:" ..name,
groups = {cracky=3},
sounds = thesound,
})
end