diff --git a/LICENSE.txt b/LICENSE.txt index c9c7979..e49f8de 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -29,3 +29,5 @@ License Sounds: freesound.org 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) + + explosion10.wav by V-ktor - CC0 1.0 Universal (CC0 1.0) diff --git a/README.md b/README.md index fc4819b..2e2e875 100644 --- a/README.md +++ b/README.md @@ -25,35 +25,37 @@ Adds basic guns using the shooter API. [mod] Crossbow [shooter_crossbow] --------------------------------- -Depends: shooter, wool, dye +Depends: shooter + +Optional Depends: dye (required for colored arrows) Adds a crossbow with colored arrows. [mod] Flare Gun [shooter_flaregun] ---------------------------------- -Depends: shooter, tnt, wool +Depends: shooter Adds a flare-gun with temporary light emitting flares. [mod] Grenade [shooter_grenade] ------------------------------- -Depends: shooter, tnt +Depends: shooter Adds simple hand grenades. [mod] Rocket Launcher [shooter_rocket] -------------------------------------- -Depends: shooter, tnt +Depends: shooter Adds rocket missiles and launching gun. [mod] Grapple Hook [shooter_hook] --------------------------------- -Depends: shooter, tnt +Depends: shooter Adds a teleporting grapple hook which can be thrown or launched further from a grapple hook gun. diff --git a/shooter/README.md b/shooter/README.md index 257656f..89d0bd6 100644 --- a/shooter/README.md +++ b/shooter/README.md @@ -5,6 +5,17 @@ Depends: default 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 ------------- diff --git a/shooter/api.lua b/shooter/api.lua index 184fc6d..02c5780 100644 --- a/shooter/api.lua +++ b/shooter/api.lua @@ -323,14 +323,15 @@ shooter.blast = function(pos, radius, fleshy, distance, user) local name = user:get_player_name() local p1 = vector.subtract(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.enable_protection then - if not minetest.is_protected(pos, name) then - minetest.set_node(pos, {name="tnt:boom"}) - end - else - minetest.set_node(pos, {name="tnt:boom"}) + if not config.enable_protection or + not minetest.is_protected(pos, name) then + minetest.set_node(pos, {name="shooter:boom"}) end end if config.enable_particle_fx == true then @@ -348,7 +349,7 @@ shooter.blast = function(pos, radius, fleshy, distance, user) minsize = 8, maxsize = 15, collisiondetection = false, - texture = "tnt_smoke.png", + texture = "shooter_smoke.png", }) end local objects = minetest.get_objects_inside_radius(pos, distance) diff --git a/shooter/init.lua b/shooter/init.lua index b79ac22..01f16e9 100644 --- a/shooter/init.lua +++ b/shooter/init.lua @@ -76,3 +76,26 @@ if shooter.config.automatic_weapons == true then 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 diff --git a/shooter/mod.conf b/shooter/mod.conf index 5aa9ca5..ac4fd09 100644 --- a/shooter/mod.conf +++ b/shooter/mod.conf @@ -1,3 +1,3 @@ name = shooter description = Shooter mod API -depends = default, tnt +depends = default diff --git a/shooter/sounds/shooter_explode.ogg b/shooter/sounds/shooter_explode.ogg new file mode 100644 index 0000000..736c383 Binary files /dev/null and b/shooter/sounds/shooter_explode.ogg differ diff --git a/shooter/textures/shooter_boom.png b/shooter/textures/shooter_boom.png new file mode 100644 index 0000000..79a89fb Binary files /dev/null and b/shooter/textures/shooter_boom.png differ diff --git a/shooter/textures/shooter_powder.png b/shooter/textures/shooter_powder.png new file mode 100644 index 0000000..2c8c42e Binary files /dev/null and b/shooter/textures/shooter_powder.png differ diff --git a/shooter/textures/shooter_smoke.png b/shooter/textures/shooter_smoke.png new file mode 100644 index 0000000..75ddbd8 Binary files /dev/null and b/shooter/textures/shooter_smoke.png differ diff --git a/shooter_crossbow/init.lua b/shooter_crossbow/init.lua index a175657..bf3b3e4 100644 --- a/shooter_crossbow/init.lua +++ b/shooter_crossbow/init.lua @@ -300,14 +300,16 @@ if shooter.config.enable_crafting == true then {"", "default:paper", "default:stick"}, }, }) - for _, color in pairs(dye_basecolors) do - if color ~= "white" then - minetest.register_craft({ - output = "shooter_crossbow:arrow_"..color, - recipe = { - {"", "dye:"..color, "shooter_crossbow:arrow_white"}, - }, - }) + if minetest.get_modpath("dye") then + for _, color in pairs(dye_basecolors) do + if color ~= "white" then + minetest.register_craft({ + output = "shooter_crossbow:arrow_"..color, + recipe = { + {"", "dye:"..color, "shooter_crossbow:arrow_white"}, + }, + }) + end end end end diff --git a/shooter_crossbow/mod.conf b/shooter_crossbow/mod.conf index e666f4d..8e9a993 100644 --- a/shooter_crossbow/mod.conf +++ b/shooter_crossbow/mod.conf @@ -1,3 +1,4 @@ name = shooter_crossbow description = Adds a crossbow with colored arrows -depends = wool, dye, shooter +depends = shooter +optional_depends = dye diff --git a/shooter_flaregun/README.txt b/shooter_flaregun/README.txt index 85283cb..f041486 100644 --- a/shooter_flaregun/README.txt +++ b/shooter_flaregun/README.txt @@ -1,7 +1,7 @@ Minetest Mod - Flare Gun [shooter_flaregun] =========================================== -Depends: shooter, tnt, wool +Depends: shooter Adds a flare-gun with temporary light emitting flares. @@ -9,19 +9,20 @@ Crafting ======== S = Steel Ingot [default:steel_ingot] -R = Red Wool [wool:red] -G = Gun Powder [tnt:gunpowder] +C = Copper Ingot [default:copper_ingot] +P = Paper [default:paper] +G = Gunpowder [shooter:gunpowder] Flare: [shooter_flaregun:flare] +---+---+ -| G | R | +| G | P | +---+---+ Flare Gun: [shooter_flaregun:flaregun] +---+---+---+ -| R | R | R | +| C | C | C | +---+---+---+ | | | S | +---+---+---+ diff --git a/shooter_flaregun/init.lua b/shooter_flaregun/init.lua index 88710b4..3e4ca87 100644 --- a/shooter_flaregun/init.lua +++ b/shooter_flaregun/init.lua @@ -159,14 +159,13 @@ minetest.register_tool("shooter_flaregun:flaregun", { if shooter.config.enable_crafting == true then minetest.register_craft({ output = "shooter_flaregun:flare", - recipe = { - {"tnt:gunpowder", "wool:red"}, - }, + type = "shapeless", + recipe = {"shooter:gunpowder", "default:paper"}, }) minetest.register_craft({ output = "shooter_flaregun:flaregun", recipe = { - {"wool:red", "wool:red", "wool:red"}, + {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, {"", "", "default:steel_ingot"} }, }) diff --git a/shooter_flaregun/mod.conf b/shooter_flaregun/mod.conf index 8061c41..c275a00 100644 --- a/shooter_flaregun/mod.conf +++ b/shooter_flaregun/mod.conf @@ -1,3 +1,3 @@ name = shooter_flaregun description = Adds a flare-gun with temporary light emitting flares -depends = shooter, wool +depends = shooter diff --git a/shooter_grenade/README.txt b/shooter_grenade/README.txt index 65cda3a..1ed2ac6 100644 --- a/shooter_grenade/README.txt +++ b/shooter_grenade/README.txt @@ -1,7 +1,7 @@ Minetest Mod - Grenade [shooter_grenade] ======================================== -Depends: shooter, tnt +Depends: shooter Adds simple hand grenades. @@ -9,7 +9,7 @@ Crafting ======== S = Steel Ingot [default:steel_ingot] -G = Gun Powder [tnt:gunpowder] +G = Gunpowder [shooter:gunpowder] Grenade: [shooter_grenade:grenade] diff --git a/shooter_grenade/init.lua b/shooter_grenade/init.lua index 21f1751..222aea2 100644 --- a/shooter_grenade/init.lua +++ b/shooter_grenade/init.lua @@ -97,9 +97,8 @@ minetest.register_tool("shooter_grenade:grenade", { if shooter.config.enable_crafting == true then minetest.register_craft({ output = "shooter_grenade:grenade", - recipe = { - {"tnt:gunpowder", "default:steel_ingot"}, - }, + type = "shapeless", + recipe = {"shooter:gunpowder", "default:steel_ingot"}, }) end diff --git a/shooter_guns/README.txt b/shooter_guns/README.txt index 1a22273..c7cd1c5 100644 --- a/shooter_guns/README.txt +++ b/shooter_guns/README.txt @@ -11,7 +11,7 @@ Crafting S = Steel Ingot [default:steel_ingot] B = Bronze Ingot [default:bronze_ingot] M = Mese Crystal [default:mese_crysytal] -G = Gun Powder [tnt:gunpowder] +G = Gunpowder [shooter:gunpowder] Pistol: [shooter_guns:pistol] diff --git a/shooter_guns/init.lua b/shooter_guns/init.lua index 0808c4c..4f7d2d8 100644 --- a/shooter_guns/init.lua +++ b/shooter_guns/init.lua @@ -133,9 +133,8 @@ if shooter.config.enable_crafting == true then }) minetest.register_craft({ output = "shooter_guns:ammo", - recipe = { - {"tnt:gunpowder", "default:bronze_ingot"}, - }, + type = "shapeless", + recipe = {"shooter:gunpowder", "default:bronze_ingot"}, }) end diff --git a/shooter_hook/README.txt b/shooter_hook/README.txt index edeb696..45e5423 100644 --- a/shooter_hook/README.txt +++ b/shooter_hook/README.txt @@ -1,7 +1,7 @@ Minetest Mod - Grapple Hook [shooter_hook] ========================================== -Depends: shooter, tnt +Depends: shooter Adds a teleporting grapple hook which can be thrown or launched further from a grapple hook gun. diff --git a/shooter_hook/init.lua b/shooter_hook/init.lua index 4e0d71a..28eb31c 100644 --- a/shooter_hook/init.lua +++ b/shooter_hook/init.lua @@ -106,8 +106,8 @@ minetest.register_tool("shooter_hook:grapple_gun", { on_use = function(itemstack, user) local inv = user:get_inventory() if inv:contains_item("main", "shooter_hook:grapple_hook") and - inv:contains_item("main", "tnt:gunpowder") then - inv:remove_item("main", "tnt:gunpowder") + inv:contains_item("main", "shooter:gunpowder") then + inv:remove_item("main", "shooter:gunpowder") minetest.sound_play("shooter_reload", {object=user}) local stack = inv:remove_item("main", "shooter_hook:grapple_hook") itemstack = "shooter_hook:grapple_gun_loaded 1 "..stack:get_wear() diff --git a/shooter_rocket/README.txt b/shooter_rocket/README.txt index 3daea5a..ca95bba 100644 --- a/shooter_rocket/README.txt +++ b/shooter_rocket/README.txt @@ -1,7 +1,7 @@ Minetest Mod - Rocket Launcher [shooter_rocket] =============================================== -Depends: shooter, tnt +Depends: shooter Adds rocket missiles and launching gun. @@ -11,7 +11,7 @@ Crafting S = Steel Ingot [default:steel_ingot] B = Bronze Ingot [default:bronze_ingot] D = Diamond [default:diamond] -G = Gun Powder [tnt:gunpowder] +G = Gunpowder [shooter:gunpowder] Rocket: [shooter_rocket:rocket] diff --git a/shooter_rocket/init.lua b/shooter_rocket/init.lua index 2775a1b..cfba55e 100644 --- a/shooter_rocket/init.lua +++ b/shooter_rocket/init.lua @@ -130,9 +130,8 @@ if shooter.config.enable_crafting == true then }) minetest.register_craft({ output = "shooter_rocket:rocket", - recipe = { - {"default:bronze_ingot", "tnt:gunpowder", "default:bronze_ingot"}, - }, + type = "shapeless", + recipe = {"default:bronze_ingot", "shooter:gunpowder", "default:bronze_ingot"}, }) end diff --git a/shooter_turret/init.lua b/shooter_turret/init.lua index eabae06..bd6a6aa 100644 --- a/shooter_turret/init.lua +++ b/shooter_turret/init.lua @@ -185,7 +185,7 @@ minetest.register_entity("shooter_turret:turret_entity", { minsize = 8, maxsize = 15, collisiondetection = false, - texture = "tnt_smoke.png", + texture = "shooter_smoke.png", }) end end