-
Notifications
You must be signed in to change notification settings - Fork 1
/
castle_walkinggrass.lua-old
178 lines (156 loc) · 6.63 KB
/
castle_walkinggrass.lua-old
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
170
171
172
173
174
175
176
177
178
local walkinggrass = {}
walkinggrass.types = {
--Sandstone
-----Material Name Material Desc Standart tile Craft tileup tiledown tileleft tileright tilebehind tilefront
{"endofroad", "End of Road", nil, "castle:dirt", "castle_endof_road_grass.png", nil, nil, nil, nil, nil},
{"crossroad", "Cross Road", nil, "castle:dirt", "castle_cross_road_grass.png"},
{"sideroad", "Side Road", nil, "castle:dirt", "castle_side_road_grass.png"},
{"middleroad", "Middle Road", nil, "castle:dirt", "castle_middle_road_grass.png"},
{"junctionwalkingroad", "Junction Walking and Road", nil, "castle:dirt", "castle_junction_road_walking_grass.png"},
{"endofwalking", "End of Walking Road", nil, "castle:dirt", "castle_endof_walking_grass.png"},
{"crosswalking", "Cross Walking Road", nil, "castle:dirt", "castle_cross_walking_grass.png"},
{"walking", "Walking", nil, "castle:dirt", "castle_walking_grass.png"},
{"turningwalking", "Turning Walking", nil, "castle:dirt", "castle_turning_walking_grass.png"},
{"Tjunctionwalking", "T Junction Walking", nil, "castle:dirt", "castle_T_junction_walking_road_grass.png"},
{"turninginsideroad", "Turning Inside Road", nil, "castle:dirt", "castle_turning_inside_road_grass.png"},
{"roundaboutroad", "Roundabout Road", nil, "castle:dirt", "castle_roundabout_road_grass.png"},
{"roundingrassroad", "Round in Grass", nil, "castle:dirt", "castle_roundingrass_road_grass.png"},
}
for _, row in ipairs(walkinggrass.types) do
local name = row[1]
local desc = row[2]
local inv = row[3] -- if alone , tile for all visible faces
local craft_logical = row[4]
local tileup = row[5]
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
if inv == nil
then inv = "default_dirt.png^default_grass_side.png"
end
if tileup == nil
then tileup = inv
end
if tiledown == nil
then tiledown = "default_dirt.png"
end
if tileleft == nil
then tileleft = inv
end
if tileright == nil
then tileright = inv
end
if tilebehind == nil
then tilebehind = inv
end
if tilefront == nil
then tilefront = inv
end
minetest.register_node("castle:walking_grass_" ..name, {
drawtype = "normal",
paramtype = "light",
paramtype2 = "facedir",
description = "Walking Grass " ..desc,
tiles = { tileup, tiledown, tileleft, tileright, tilebehind, tilefront },
inventory_image = tileup,
groups = {cracky=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
})
})
end
local walkinggrassstair = {}
walkinggrassstair.types = {
-----Material Name Material Desc Standart tile Craft tileup tiledown tileleft tileright tilebehind tilefront
-- {"endofroad", "End of Road", nil, "castle:dirt", "castle_endof_road_grass.png", nil, nil, nil, nil, nil},
-- {"crossroad", "Cross Road", nil, "castle:dirt", "castle_cross_road_grass.png"},
{"rightsideroad", "Right Side Road", nil, "castle:dirt", "castle_side_road_grass.png"},
{"leftsideroad", "Left Side Road", nil, "castle:dirt", "castle_left_side_road_grass.png"},
{"middleroad", "Middle Road", nil, "castle:dirt", "castle_middle_road_grass.png"},
-- {"junctionwalkingroad", "Junction Walking and Road", nil, "castle:dirt", "castle_junction_road_walking_grass.png"},
-- {"endofwalking", "End of Walking Road", nil, "castle:dirt", "castle_endof_walking_grass.png"},
-- {"crosswalking", "Cross Walking Road", nil, "castle:dirt", "castle_cross_walking_grass.png"},
{"walking", "Walking", nil, "castle:dirt", "castle_walking_grass.png", nil, nil, nil, nil, "castle_walking_grass.png"},
-- {"turningwalking", "Turning Walking", nil, "castle:dirt", "castle_turning_walking_grass.png"},
-- {"Tjunctionwalking", "T Junction Walking", nil, "castle:dirt", "castle_T_junction_walking_road_grass.png"},
-- {"turninginsideroad", "Turning Inside Road", nil, "castle:dirt", "castle_turning_inside_road_grass.png"},
-- {"roundaboutroad", "Roundabout Road", nil, "castle:dirt", "castle_roundabout_road_grass.png"},
{"roundingrassroad", "Round in Grass", nil, "castle:dirt", "castle_roundingrass_road_grass.png", nil, nil, nil, nil, "castle_slab_front_round_of_grass_road_grass.png",},
}
for _, row in ipairs(walkinggrassstair.types) do
local name = row[1]
local desc = row[2]
local inv = row[3] -- if alone , tile for all visible faces
local craft_logical = row[4]
local tileup = row[5]
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
if inv == nil
then inv = "default_dirt.png^default_grass_side.png"
end
if tileup == nil
then tileup = inv
end
if tiledown == nil
then tiledown = "default_dirt.png"
end
if tileleft == nil
then tileleft = inv
end
if tileright == nil
then tileright = inv
end
if tilebehind == nil
then tilebehind = inv
end
if tilefront == nil
then tilefront = tileup
end
minetest.register_node("castle:walking_grass_slabs_" ..name, {
drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Walking Grass Slab " ..desc,
tiles = { tileup, tiledown, tileleft, tileright, tilebehind, tilefront },
-- inventory_image = tileup,
groups = {cracky=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
}),
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5} --NodeBox1
}
},
})
minetest.register_node("castle:walking_grass_stairs_" ..name, {
drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Walking Grass Stairs " ..desc,
tiles = { tileup, tiledown, tileleft, tileright, tilebehind, tilefront },
-- inventory_image = tileup,
groups = {cracky=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
}),
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5}, --NodeBox1
{-0.5,0,0,0.5,0.5,0.5} --NodeBox2
}
},
})
end