Tweak and slightly nerf grenades
This commit is contained in:
parent
630f772e02
commit
063c6fb458
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ local fragdef = {
|
||||||
|
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
|
||||||
local radius = 8
|
local radius = 10
|
||||||
|
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 20,
|
amount = 20,
|
||||||
|
@ -67,7 +67,7 @@ local fragdef = {
|
||||||
|
|
||||||
if hit and player and v:is_player() and v:get_hp() > 0 and hit.type == "object" and hit.ref:is_player() and
|
if hit and player and v:is_player() and v:get_hp() > 0 and hit.type == "object" and hit.ref:is_player() and
|
||||||
hit.ref:get_player_name() == v:get_player_name() then
|
hit.ref:get_player_name() == v:get_player_name() then
|
||||||
v:punch(player, 2, {damage_groups = {grenade = 1, fleshy = 34 - ((25/radius) * vector.distance(pos, v:get_pos()))}}, nil)
|
v:punch(player, 2, {damage_groups = {grenade = 1, fleshy = 30 - ((radius/3) * vector.distance(pos, v:get_pos()))}}, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
grenades = {
|
grenades = {
|
||||||
grenade_deaccel = 9
|
grenade_deaccel = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
function grenades.throw_grenade(name, startspeed, player)
|
function grenades.throw_grenade(name, startspeed, player)
|
||||||
|
@ -140,7 +140,7 @@ function grenades.register_grenade(name, def)
|
||||||
newdef.inventory_image = def.image
|
newdef.inventory_image = def.image
|
||||||
newdef.on_use = function(itemstack, user, pointed_thing)
|
newdef.on_use = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
grenades.throw_grenade(name, 16, user)
|
grenades.throw_grenade(name, 17, user)
|
||||||
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item(1)
|
itemstack:take_item(1)
|
||||||
|
|
Loading…
Reference in a new issue