2019-03-17 18:13:26 +00:00
|
|
|
--[[
|
|
|
|
Shooter Guns [shooter_guns]
|
|
|
|
Copyright (C) 2013-2019 stujones11, Stuart Jones
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
]]--
|
|
|
|
|
2019-03-16 19:33:08 +00:00
|
|
|
shooter.register_weapon("shooter_guns:pistol", {
|
2014-07-26 20:18:10 +00:00
|
|
|
description = "Pistol",
|
|
|
|
inventory_image = "shooter_pistol.png",
|
|
|
|
spec = {
|
2019-03-13 18:24:22 +00:00
|
|
|
rounds = 200,
|
|
|
|
range = 160,
|
2014-07-26 20:18:10 +00:00
|
|
|
step = 20,
|
2020-07-01 18:42:17 +00:00
|
|
|
tool_caps = {full_punch_interval=0.5, damage_groups={fleshy=2, ranged=1}},
|
2014-07-26 20:18:10 +00:00
|
|
|
groups = {snappy=3, fleshy=3, oddly_breakable_by_hand=3},
|
2019-04-02 17:44:25 +00:00
|
|
|
sounds = {
|
|
|
|
shot = "shooter_pistol",
|
|
|
|
},
|
2019-03-17 16:46:27 +00:00
|
|
|
bullet_image = "shooter_cap.png",
|
|
|
|
particles = {
|
|
|
|
amount = 8,
|
|
|
|
minsize = 0.25,
|
|
|
|
maxsize = 0.75,
|
|
|
|
},
|
2014-07-26 20:18:10 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2019-03-16 19:33:08 +00:00
|
|
|
shooter.register_weapon("shooter_guns:rifle", {
|
2014-07-26 20:18:10 +00:00
|
|
|
description = "Rifle",
|
|
|
|
inventory_image = "shooter_rifle.png",
|
|
|
|
spec = {
|
2020-12-02 20:09:22 +00:00
|
|
|
user_knockback = 4,
|
2019-03-13 18:24:22 +00:00
|
|
|
rounds = 100,
|
|
|
|
range = 240,
|
2014-07-26 20:18:10 +00:00
|
|
|
step = 30,
|
2020-09-20 20:27:42 +00:00
|
|
|
automatic = true,
|
2020-10-31 16:22:56 +00:00
|
|
|
tool_caps = {full_punch_interval=1.0, damage_groups={fleshy=7, ranged=1}},
|
2014-07-26 20:18:10 +00:00
|
|
|
groups = {snappy=3, crumbly=3, choppy=3, fleshy=2, oddly_breakable_by_hand=2},
|
2019-04-02 17:44:25 +00:00
|
|
|
sounds = {
|
|
|
|
shot = "shooter_rifle",
|
|
|
|
},
|
2019-03-17 16:46:27 +00:00
|
|
|
bullet_image = "shooter_bullet.png",
|
|
|
|
particles = {
|
|
|
|
amount = 12,
|
|
|
|
minsize = 0.75,
|
|
|
|
maxsize = 1.5,
|
|
|
|
},
|
2014-07-26 20:18:10 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2019-03-16 19:33:08 +00:00
|
|
|
shooter.register_weapon("shooter_guns:shotgun", {
|
2014-07-26 20:18:10 +00:00
|
|
|
description = "Shotgun",
|
|
|
|
inventory_image = "shooter_shotgun.png",
|
|
|
|
spec = {
|
2020-12-02 20:09:22 +00:00
|
|
|
user_knockback = 12,
|
2020-04-23 02:19:15 +00:00
|
|
|
rounds = 12,
|
2019-03-22 09:43:18 +00:00
|
|
|
range = 30,
|
2014-07-26 20:18:10 +00:00
|
|
|
step = 15,
|
2019-04-02 14:18:17 +00:00
|
|
|
shots = 15,
|
|
|
|
spread = 10,
|
2020-12-02 20:09:22 +00:00
|
|
|
tool_caps = {full_punch_interval=1.5, damage_groups={fleshy=2, ranged=1}},
|
2019-04-02 14:18:17 +00:00
|
|
|
groups = {snappy=3, fleshy=3, oddly_breakable_by_hand=3},
|
2019-04-02 17:44:25 +00:00
|
|
|
sounds = {
|
|
|
|
shot = "shooter_shotgun",
|
|
|
|
},
|
2019-04-02 14:18:17 +00:00
|
|
|
bullet_image = "shooter_cap.png",
|
2019-03-17 16:46:27 +00:00
|
|
|
particles = {
|
2019-04-02 14:18:17 +00:00
|
|
|
amount = 8,
|
|
|
|
minsize = 0.25,
|
|
|
|
maxsize = 0.75,
|
2019-03-17 16:46:27 +00:00
|
|
|
},
|
2014-07-26 20:18:10 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2019-03-16 19:33:08 +00:00
|
|
|
shooter.register_weapon("shooter_guns:machine_gun", {
|
2014-07-26 20:18:10 +00:00
|
|
|
description = "Sub Machine Gun",
|
|
|
|
inventory_image = "shooter_smgun.png",
|
|
|
|
spec = {
|
2019-03-13 18:24:22 +00:00
|
|
|
automatic = true,
|
2020-12-02 20:09:22 +00:00
|
|
|
user_knockback = 2,
|
|
|
|
rounds = 42,
|
2019-03-13 18:24:22 +00:00
|
|
|
range = 160,
|
2014-07-26 20:18:10 +00:00
|
|
|
step = 20,
|
2020-07-01 18:42:17 +00:00
|
|
|
tool_caps = {full_punch_interval=0.1, damage_groups={fleshy=2, ranged=1}},
|
2014-07-26 20:18:10 +00:00
|
|
|
groups = {snappy=3, fleshy=3, oddly_breakable_by_hand=3},
|
2019-04-02 17:44:25 +00:00
|
|
|
sounds = {
|
|
|
|
shot = "shooter_pistol",
|
|
|
|
},
|
2019-03-17 16:46:27 +00:00
|
|
|
bullet_image = "shooter_cap.png",
|
|
|
|
particles = {
|
|
|
|
amount = 4,
|
|
|
|
minsize = 0.25,
|
|
|
|
maxsize = 0.75,
|
|
|
|
},
|
2014-07-26 20:18:10 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2017-07-13 12:33:00 +00:00
|
|
|
minetest.register_craftitem("shooter_guns:ammo", {
|
2014-07-26 20:18:10 +00:00
|
|
|
description = "Ammo pack",
|
|
|
|
inventory_image = "shooter_ammo.png",
|
|
|
|
})
|
|
|
|
|
2018-01-05 20:02:18 +00:00
|
|
|
if shooter.config.enable_crafting == true then
|
2014-07-26 20:18:10 +00:00
|
|
|
minetest.register_craft({
|
2017-07-13 12:33:00 +00:00
|
|
|
output = "shooter_guns:pistol 1 65535",
|
2014-07-26 20:18:10 +00:00
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot", "default:steel_ingot"},
|
|
|
|
{"", "default:mese_crystal"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-07-13 12:33:00 +00:00
|
|
|
output = "shooter_guns:rifle 1 65535",
|
2014-07-26 20:18:10 +00:00
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot", "", ""},
|
|
|
|
{"", "default:bronze_ingot", ""},
|
|
|
|
{"", "default:mese_crystal", "default:bronze_ingot"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-07-13 12:33:00 +00:00
|
|
|
output = "shooter_guns:shotgun 1 65535",
|
2014-07-26 20:18:10 +00:00
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot", "", ""},
|
|
|
|
{"", "default:steel_ingot", ""},
|
|
|
|
{"", "default:mese_crystal", "default:bronze_ingot"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-07-13 12:33:00 +00:00
|
|
|
output = "shooter_guns:machine_gun 1 65535",
|
2014-07-26 20:18:10 +00:00
|
|
|
recipe = {
|
2019-05-25 13:56:29 +00:00
|
|
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
2014-07-26 20:18:10 +00:00
|
|
|
{"", "default:bronze_ingot", "default:mese_crystal"},
|
|
|
|
{"", "default:bronze_ingot", ""},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-07-13 12:33:00 +00:00
|
|
|
output = "shooter_guns:ammo",
|
2019-03-21 21:08:40 +00:00
|
|
|
type = "shapeless",
|
|
|
|
recipe = {"shooter:gunpowder", "default:bronze_ingot"},
|
2014-07-26 20:18:10 +00:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-07-13 12:33:00 +00:00
|
|
|
--Backwards compatibility
|
2019-03-23 17:55:21 +00:00
|
|
|
minetest.register_alias("shooter:shotgun", "shooter_guns:shotgun_loaded")
|
|
|
|
minetest.register_alias("shooter:pistol", "shooter_guns:pistol_loaded")
|
|
|
|
minetest.register_alias("shooter:machine_gun", "shooter_guns:machine_gun_loaded")
|
|
|
|
minetest.register_alias("shooter:rifle", "shooter_guns:rifle_loaded")
|
2017-07-13 12:33:00 +00:00
|
|
|
minetest.register_alias("shooter:ammo", "shooter_guns:ammo")
|