Remove hard mod dependencies other than default
This commit is contained in:
parent
16451b7c35
commit
d1e1dcc1d6
24 changed files with 90 additions and 51 deletions
|
@ -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
|
||||
-------------
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
name = shooter
|
||||
description = Shooter mod API
|
||||
depends = default, tnt
|
||||
depends = default
|
||||
|
|
BIN
shooter/sounds/shooter_explode.ogg
Normal file
BIN
shooter/sounds/shooter_explode.ogg
Normal file
Binary file not shown.
BIN
shooter/textures/shooter_boom.png
Normal file
BIN
shooter/textures/shooter_boom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 320 B |
BIN
shooter/textures/shooter_powder.png
Normal file
BIN
shooter/textures/shooter_powder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 367 B |
BIN
shooter/textures/shooter_smoke.png
Normal file
BIN
shooter/textures/shooter_smoke.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 236 B |
Loading…
Add table
Add a link
Reference in a new issue