mirror of
https://github.com/LoneWolfHT/grenades_basic.git
synced 2025-04-04 06:41:24 +02:00
Fixes and improvements
This commit is contained in:
@ -1,2 +0,0 @@
|
|||||||
# grenades_basic
|
|
||||||
Adds some basic grenades using the grenades api
|
|
@ -71,4 +71,10 @@ else
|
|||||||
always_known = true,
|
always_known = true,
|
||||||
level = 1,
|
level = 1,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("ctf_treasure") then
|
||||||
|
treasurer.register_treasure("ctf_grenades:grenade_regular", 0.4, 2, 1)
|
||||||
|
treasurer.register_treasure("ctf_grenades:grenade_smoke", 0.4, 2, 1)
|
||||||
|
treasurer.register_treasure("ctf_grenades:grenade_flashbang", 0.4, 2, 1)
|
||||||
end
|
end
|
3
init.lua
3
init.lua
@ -64,6 +64,7 @@ grenades.register_grenade("grenades_basic:regular", {
|
|||||||
grenades.register_grenade("grenades_basic:flashbang", {
|
grenades.register_grenade("grenades_basic:flashbang", {
|
||||||
description = "Flashbang grenade (Blinds all who look at blast)",
|
description = "Flashbang grenade (Blinds all who look at blast)",
|
||||||
image = "grenades_flashbang.png",
|
image = "grenades_flashbang.png",
|
||||||
|
clock = 4,
|
||||||
on_explode = function(pos)
|
on_explode = function(pos)
|
||||||
for _, v in ipairs(minetest.get_objects_inside_radius(pos, 20)) do
|
for _, v in ipairs(minetest.get_objects_inside_radius(pos, 20)) do
|
||||||
local hit = minetest.raycast(pos, v:get_pos(), true, true):next()
|
local hit = minetest.raycast(pos, v:get_pos(), true, true):next()
|
||||||
@ -110,8 +111,8 @@ grenades.register_grenade("grenades_basic:flashbang", {
|
|||||||
grenades.register_grenade("grenades_basic:smoke", {
|
grenades.register_grenade("grenades_basic:smoke", {
|
||||||
description = "Smoke grenade (Generates smoke around blast site)",
|
description = "Smoke grenade (Generates smoke around blast site)",
|
||||||
image = "grenades_smoke_grenade.png",
|
image = "grenades_smoke_grenade.png",
|
||||||
|
clock = 2,
|
||||||
on_explode = function(pos)
|
on_explode = function(pos)
|
||||||
|
|
||||||
minetest.sound_play("glasslike_break", {
|
minetest.sound_play("glasslike_break", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
gain = 1.0,
|
gain = 1.0,
|
||||||
|
2
readme.md
Normal file
2
readme.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# grenades_basic
|
||||||
|
Adds some basic grenades using the grenades API
|
Reference in New Issue
Block a user