Skip to content

Commit 05a2494

Browse files
authored
feat: add basic textures for railguns (#19)
1 parent 4ab6284 commit 05a2494

6 files changed

+29
-11
lines changed

cannon.lua

+29-11
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,22 @@ local register_spacecannon = function(def)
9898
end
9999
})
100100

101-
101+
-- top, bottom
102+
local textures = {
103+
"cannon_blank.png" .. cable_entry,
104+
"cannon_front_" .. def.color .. ".png",
105+
"cannon_blank.png" .. cable_entry,
106+
"cannon_blank.png" .. cable_entry,
107+
"cannon_blank.png" .. cable_entry,
108+
"cannon_blank.png" .. cable_entry
109+
}
110+
if def.textures then
111+
textures = def.textures
112+
end
102113

103114
minetest.register_node("spacecannon:cannon_" .. def.color, {
104115
description = def.name .. " (" .. def.desc .. ")",
105-
106-
-- top, bottom
107-
tiles = {
108-
"cannon_blank.png" .. cable_entry,
109-
"cannon_front_" .. def.color .. ".png",
110-
"cannon_blank.png" .. cable_entry,
111-
"cannon_blank.png" .. cable_entry,
112-
"cannon_blank.png" .. cable_entry,
113-
"cannon_blank.png" .. cable_entry
114-
},
116+
tiles = textures,
115117

116118
groups = {cracky=3,oddly_breakable_by_hand=3,technic_machine = 1, technic_hv = 1},
117119
drop = "spacecannon:cannon_" .. def.color,
@@ -286,6 +288,14 @@ register_spacecannon({
286288
color = "blue",
287289
name = "Railgun cannon",
288290
desc = "fast, 2x penetrating damage",
291+
textures = {
292+
"railgun_blank.png" .. cable_entry,
293+
"railgun_front.png",
294+
"railgun_blank.png" .. cable_entry,
295+
"railgun_blank.png" .. cable_entry,
296+
"railgun_top_bottom.png",
297+
"railgun_top_bottom.png",
298+
},
289299
is_th = false,
290300
range = 0,
291301
storage_require_mod = 1,
@@ -302,6 +312,14 @@ register_spacecannon({
302312
color = "purple",
303313
name = "Helical railgun cannon",
304314
desc = "fast, 4x penetrating damage",
315+
textures = {
316+
"railgun_blank.png" .. cable_entry,
317+
"helical_railgun_front.png",
318+
"railgun_blank.png" .. cable_entry,
319+
"railgun_blank.png" .. cable_entry,
320+
"helical_railgun_top_bottom.png",
321+
"helical_railgun_top_bottom.png",
322+
},
305323
is_th = false,
306324
range = 0,
307325
storage_require_mod = 1.5,

textures/helical_railgun_front.png

617 Bytes
Loading
552 Bytes
Loading

textures/railgun_blank.png

429 Bytes
Loading

textures/railgun_front.png

605 Bytes
Loading

textures/railgun_top_bottom.png

568 Bytes
Loading

0 commit comments

Comments
 (0)