Remove hard mod dependencies other than default

This commit is contained in:
stujones11 2019-03-21 21:08:40 +00:00
parent 16451b7c35
commit d1e1dcc1d6
24 changed files with 90 additions and 51 deletions

View file

@ -29,3 +29,5 @@ License Sounds: freesound.org
AGM-114 Hellfire Rocket Missile Launch.flac by qubodup - CC0 1.0 Universal (CC0 1.0) AGM-114 Hellfire Rocket Missile Launch.flac by qubodup - CC0 1.0 Universal (CC0 1.0)
Sparkler.aif by Ned Bouhalassa - CC0 1.0 Universal (CC0 1.0) Sparkler.aif by Ned Bouhalassa - CC0 1.0 Universal (CC0 1.0)
explosion10.wav by V-ktor - CC0 1.0 Universal (CC0 1.0)

View file

@ -25,35 +25,37 @@ Adds basic guns using the shooter API.
[mod] Crossbow [shooter_crossbow] [mod] Crossbow [shooter_crossbow]
--------------------------------- ---------------------------------
Depends: shooter, wool, dye Depends: shooter
Optional Depends: dye (required for colored arrows)
Adds a crossbow with colored arrows. Adds a crossbow with colored arrows.
[mod] Flare Gun [shooter_flaregun] [mod] Flare Gun [shooter_flaregun]
---------------------------------- ----------------------------------
Depends: shooter, tnt, wool Depends: shooter
Adds a flare-gun with temporary light emitting flares. Adds a flare-gun with temporary light emitting flares.
[mod] Grenade [shooter_grenade] [mod] Grenade [shooter_grenade]
------------------------------- -------------------------------
Depends: shooter, tnt Depends: shooter
Adds simple hand grenades. Adds simple hand grenades.
[mod] Rocket Launcher [shooter_rocket] [mod] Rocket Launcher [shooter_rocket]
-------------------------------------- --------------------------------------
Depends: shooter, tnt Depends: shooter
Adds rocket missiles and launching gun. Adds rocket missiles and launching gun.
[mod] Grapple Hook [shooter_hook] [mod] Grapple Hook [shooter_hook]
--------------------------------- ---------------------------------
Depends: shooter, tnt Depends: shooter
Adds a teleporting grapple hook which can be thrown or launched Adds a teleporting grapple hook which can be thrown or launched
further from a grapple hook gun. further from a grapple hook gun.

View file

@ -5,6 +5,17 @@ Depends: default
Handles raycasting, blasting and audio-visual effects of dependent mods Handles raycasting, blasting and audio-visual effects of dependent mods
Crafting
--------
### Gunpowder
1 x Coal Lump + 1 x Clay Lump = 5 x Gunpowder (shapeless)
```
output = "shooter:gunpowder 5",
type = "shapeless",
recipe = {"default:coal_lump", "default:clay_lump"},
```
Configuration Configuration
------------- -------------

View file

@ -323,14 +323,15 @@ shooter.blast = function(pos, radius, fleshy, distance, user)
local name = user:get_player_name() local name = user:get_player_name()
local p1 = vector.subtract(pos, radius) local p1 = vector.subtract(pos, radius)
local p2 = vector.add(pos, radius) local p2 = vector.add(pos, radius)
minetest.sound_play("tnt_explode", {pos=pos, gain=1}) minetest.sound_play("shooter_explode", {
pos = pos,
gain = 10,
max_hear_distance = 100
})
if config.allow_nodes and config.enable_blasting then if config.allow_nodes and config.enable_blasting then
if config.enable_protection then if not config.enable_protection or
if not minetest.is_protected(pos, name) then not minetest.is_protected(pos, name) then
minetest.set_node(pos, {name="tnt:boom"}) minetest.set_node(pos, {name="shooter:boom"})
end
else
minetest.set_node(pos, {name="tnt:boom"})
end end
end end
if config.enable_particle_fx == true then if config.enable_particle_fx == true then
@ -348,7 +349,7 @@ shooter.blast = function(pos, radius, fleshy, distance, user)
minsize = 8, minsize = 8,
maxsize = 15, maxsize = 15,
collisiondetection = false, collisiondetection = false,
texture = "tnt_smoke.png", texture = "shooter_smoke.png",
}) })
end end
local objects = minetest.get_objects_inside_radius(pos, distance) local objects = minetest.get_objects_inside_radius(pos, distance)

View file

@ -76,3 +76,26 @@ if shooter.config.automatic_weapons == true then
end end
end) end)
end end
minetest.register_node("shooter:boom", {
drawtype = "airlike",
light_source = 14,
walkable = false,
drop = "",
groups = {dig_immediate = 3},
-- unaffected by explosions
on_blast = function() end,
})
minetest.register_craftitem("shooter:gunpowder", {
description = "Gunpowder",
inventory_image = "shooter_powder.png",
})
if shooter.config.enable_crafting then
minetest.register_craft({
output = "shooter:gunpowder 5",
type = "shapeless",
recipe = {"default:coal_lump", "default:clay_lump"},
})
end

View file

@ -1,3 +1,3 @@
name = shooter name = shooter
description = Shooter mod API description = Shooter mod API
depends = default, tnt depends = default

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View file

@ -300,14 +300,16 @@ if shooter.config.enable_crafting == true then
{"", "default:paper", "default:stick"}, {"", "default:paper", "default:stick"},
}, },
}) })
for _, color in pairs(dye_basecolors) do if minetest.get_modpath("dye") then
if color ~= "white" then for _, color in pairs(dye_basecolors) do
minetest.register_craft({ if color ~= "white" then
output = "shooter_crossbow:arrow_"..color, minetest.register_craft({
recipe = { output = "shooter_crossbow:arrow_"..color,
{"", "dye:"..color, "shooter_crossbow:arrow_white"}, recipe = {
}, {"", "dye:"..color, "shooter_crossbow:arrow_white"},
}) },
})
end
end end
end end
end end

View file

@ -1,3 +1,4 @@
name = shooter_crossbow name = shooter_crossbow
description = Adds a crossbow with colored arrows description = Adds a crossbow with colored arrows
depends = wool, dye, shooter depends = shooter
optional_depends = dye

View file

@ -1,7 +1,7 @@
Minetest Mod - Flare Gun [shooter_flaregun] Minetest Mod - Flare Gun [shooter_flaregun]
=========================================== ===========================================
Depends: shooter, tnt, wool Depends: shooter
Adds a flare-gun with temporary light emitting flares. Adds a flare-gun with temporary light emitting flares.
@ -9,19 +9,20 @@ Crafting
======== ========
S = Steel Ingot [default:steel_ingot] S = Steel Ingot [default:steel_ingot]
R = Red Wool [wool:red] C = Copper Ingot [default:copper_ingot]
G = Gun Powder [tnt:gunpowder] P = Paper [default:paper]
G = Gunpowder [shooter:gunpowder]
Flare: [shooter_flaregun:flare] Flare: [shooter_flaregun:flare]
+---+---+ +---+---+
| G | R | | G | P |
+---+---+ +---+---+
Flare Gun: [shooter_flaregun:flaregun] Flare Gun: [shooter_flaregun:flaregun]
+---+---+---+ +---+---+---+
| R | R | R | | C | C | C |
+---+---+---+ +---+---+---+
| | | S | | | | S |
+---+---+---+ +---+---+---+

View file

@ -159,14 +159,13 @@ minetest.register_tool("shooter_flaregun:flaregun", {
if shooter.config.enable_crafting == true then if shooter.config.enable_crafting == true then
minetest.register_craft({ minetest.register_craft({
output = "shooter_flaregun:flare", output = "shooter_flaregun:flare",
recipe = { type = "shapeless",
{"tnt:gunpowder", "wool:red"}, recipe = {"shooter:gunpowder", "default:paper"},
},
}) })
minetest.register_craft({ minetest.register_craft({
output = "shooter_flaregun:flaregun", output = "shooter_flaregun:flaregun",
recipe = { recipe = {
{"wool:red", "wool:red", "wool:red"}, {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
{"", "", "default:steel_ingot"} {"", "", "default:steel_ingot"}
}, },
}) })

View file

@ -1,3 +1,3 @@
name = shooter_flaregun name = shooter_flaregun
description = Adds a flare-gun with temporary light emitting flares description = Adds a flare-gun with temporary light emitting flares
depends = shooter, wool depends = shooter

View file

@ -1,7 +1,7 @@
Minetest Mod - Grenade [shooter_grenade] Minetest Mod - Grenade [shooter_grenade]
======================================== ========================================
Depends: shooter, tnt Depends: shooter
Adds simple hand grenades. Adds simple hand grenades.
@ -9,7 +9,7 @@ Crafting
======== ========
S = Steel Ingot [default:steel_ingot] S = Steel Ingot [default:steel_ingot]
G = Gun Powder [tnt:gunpowder] G = Gunpowder [shooter:gunpowder]
Grenade: [shooter_grenade:grenade] Grenade: [shooter_grenade:grenade]

View file

@ -97,9 +97,8 @@ minetest.register_tool("shooter_grenade:grenade", {
if shooter.config.enable_crafting == true then if shooter.config.enable_crafting == true then
minetest.register_craft({ minetest.register_craft({
output = "shooter_grenade:grenade", output = "shooter_grenade:grenade",
recipe = { type = "shapeless",
{"tnt:gunpowder", "default:steel_ingot"}, recipe = {"shooter:gunpowder", "default:steel_ingot"},
},
}) })
end end

View file

@ -11,7 +11,7 @@ Crafting
S = Steel Ingot [default:steel_ingot] S = Steel Ingot [default:steel_ingot]
B = Bronze Ingot [default:bronze_ingot] B = Bronze Ingot [default:bronze_ingot]
M = Mese Crystal [default:mese_crysytal] M = Mese Crystal [default:mese_crysytal]
G = Gun Powder [tnt:gunpowder] G = Gunpowder [shooter:gunpowder]
Pistol: [shooter_guns:pistol] Pistol: [shooter_guns:pistol]

View file

@ -133,9 +133,8 @@ if shooter.config.enable_crafting == true then
}) })
minetest.register_craft({ minetest.register_craft({
output = "shooter_guns:ammo", output = "shooter_guns:ammo",
recipe = { type = "shapeless",
{"tnt:gunpowder", "default:bronze_ingot"}, recipe = {"shooter:gunpowder", "default:bronze_ingot"},
},
}) })
end end

View file

@ -1,7 +1,7 @@
Minetest Mod - Grapple Hook [shooter_hook] Minetest Mod - Grapple Hook [shooter_hook]
========================================== ==========================================
Depends: shooter, tnt Depends: shooter
Adds a teleporting grapple hook which can be thrown or launched Adds a teleporting grapple hook which can be thrown or launched
further from a grapple hook gun. further from a grapple hook gun.

View file

@ -106,8 +106,8 @@ minetest.register_tool("shooter_hook:grapple_gun", {
on_use = function(itemstack, user) on_use = function(itemstack, user)
local inv = user:get_inventory() local inv = user:get_inventory()
if inv:contains_item("main", "shooter_hook:grapple_hook") and if inv:contains_item("main", "shooter_hook:grapple_hook") and
inv:contains_item("main", "tnt:gunpowder") then inv:contains_item("main", "shooter:gunpowder") then
inv:remove_item("main", "tnt:gunpowder") inv:remove_item("main", "shooter:gunpowder")
minetest.sound_play("shooter_reload", {object=user}) minetest.sound_play("shooter_reload", {object=user})
local stack = inv:remove_item("main", "shooter_hook:grapple_hook") local stack = inv:remove_item("main", "shooter_hook:grapple_hook")
itemstack = "shooter_hook:grapple_gun_loaded 1 "..stack:get_wear() itemstack = "shooter_hook:grapple_gun_loaded 1 "..stack:get_wear()

View file

@ -1,7 +1,7 @@
Minetest Mod - Rocket Launcher [shooter_rocket] Minetest Mod - Rocket Launcher [shooter_rocket]
=============================================== ===============================================
Depends: shooter, tnt Depends: shooter
Adds rocket missiles and launching gun. Adds rocket missiles and launching gun.
@ -11,7 +11,7 @@ Crafting
S = Steel Ingot [default:steel_ingot] S = Steel Ingot [default:steel_ingot]
B = Bronze Ingot [default:bronze_ingot] B = Bronze Ingot [default:bronze_ingot]
D = Diamond [default:diamond] D = Diamond [default:diamond]
G = Gun Powder [tnt:gunpowder] G = Gunpowder [shooter:gunpowder]
Rocket: [shooter_rocket:rocket] Rocket: [shooter_rocket:rocket]

View file

@ -130,9 +130,8 @@ if shooter.config.enable_crafting == true then
}) })
minetest.register_craft({ minetest.register_craft({
output = "shooter_rocket:rocket", output = "shooter_rocket:rocket",
recipe = { type = "shapeless",
{"default:bronze_ingot", "tnt:gunpowder", "default:bronze_ingot"}, recipe = {"default:bronze_ingot", "shooter:gunpowder", "default:bronze_ingot"},
},
}) })
end end

View file

@ -185,7 +185,7 @@ minetest.register_entity("shooter_turret:turret_entity", {
minsize = 8, minsize = 8,
maxsize = 15, maxsize = 15,
collisiondetection = false, collisiondetection = false,
texture = "tnt_smoke.png", texture = "shooter_smoke.png",
}) })
end end
end end