Add recipes for guns

This commit is contained in:
IamPyu 2024-12-29 17:01:33 -06:00
parent 0f7f9a7fbb
commit b294ba6197
3 changed files with 23 additions and 2 deletions

View File

@ -34,7 +34,7 @@ PyuTest.make_gun = function(name, desc, texture, cooldown, damage)
}, {
on_hit_node = function(self, pos, node) end,
on_hit_object = function(self, object)
if not self._owner:is_valid() then
if self._owner == nil or not self._owner:is_valid() then
return
end
PyuTest.deal_damage(object, damage, {

View File

@ -4,5 +4,26 @@ dofile(modpath .. "/api.lua")
PyuTest.make_gun("pyutest_guns:flintlock", "Flintlock",
"pyutest-flintlock.png", 2, 6)
PyuTest.make_gun("pyutest_guns:blunderbuss", "Blunderbuss", "pyutest-blunderbuss.png",
5, 12)
core.register_craft({
output = "pyutest_guns:flintlock",
recipe = {
"pyutest_tools:gunpowder",
"pyutest_tools:flint",
"pyutest_tools:stick"
},
type = "shapeless",
})
core.register_craft({
output = "pyutest_guns:blunderbuss",
recipe = {
"pyutest_tools:gunpowder",
"pyutest_ores:iron_ingot",
"pyutest_tools:stick"
},
type = "shapeless",
})

View File

@ -1 +1 @@
depends = pyutest_tools,pyutest_projectiles
depends = pyutest_tools,pyutest_projectiles,pyutest_ores