Update 7
This commit is contained in:
parent
6f4872283f
commit
39ff103f82
@ -2,7 +2,7 @@ quake.explode = function(self)
|
|||||||
local explosion_range = self.initial_properties.explosion_range
|
local explosion_range = self.initial_properties.explosion_range
|
||||||
local explosion_damage = self.initial_properties.explosion_damage
|
local explosion_damage = self.initial_properties.explosion_damage
|
||||||
local origin = self.object:get_pos()
|
local origin = self.object:get_pos()
|
||||||
local objs = minetest.env:get_objects_inside_radius(origin, explosion_range)
|
local objs = minetest:get_objects_inside_radius(origin, explosion_range)
|
||||||
|
|
||||||
-- se ho colpito qualcosa
|
-- se ho colpito qualcosa
|
||||||
if objs then
|
if objs then
|
||||||
@ -24,19 +24,19 @@ quake.explode = function(self)
|
|||||||
quake.shoot(self.p_name, obj, (damage/5), false)
|
quake.shoot(self.p_name, obj, (damage/5), false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--[[
|
||||||
elseif obj:get_luaentity() then
|
elseif obj:get_luaentity() then
|
||||||
local entity = obj:get_luaentity()
|
local entity = obj:get_luaentity()
|
||||||
if entity.initial_properties ~= nil then
|
if entity.initial_properties ~= nil then
|
||||||
|
if entity.initial_properties.is_bullet or entity.initial_properties.is_grenade then
|
||||||
if entity.initial_properties.is_bullet or entity.initial_properties.is_grenade then
|
--distrugge sia il proiettile con cui collide che se stesso
|
||||||
--distrugge sia il proiettile con cui collide che se stesso
|
entity:_destroy()
|
||||||
entity:_destroy()
|
return
|
||||||
self:_destroy()
|
end
|
||||||
return
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -46,7 +46,8 @@ quake.grenade_explode = function(self)
|
|||||||
local explosion_range = self.initial_properties.explosion_range
|
local explosion_range = self.initial_properties.explosion_range
|
||||||
local explosion_damage = self.initial_properties.explosion_damage
|
local explosion_damage = self.initial_properties.explosion_damage
|
||||||
local origin = self.object:get_pos()
|
local origin = self.object:get_pos()
|
||||||
local objs = minetest.env:get_objects_inside_radius(origin, explosion_range)
|
if origin.x == nil or origin.y == nil or origin.z == nil then return end
|
||||||
|
local objs = minetest:get_objects_inside_radius(origin, explosion_range)
|
||||||
|
|
||||||
-- se ho colpito qualcosa
|
-- se ho colpito qualcosa
|
||||||
if objs then
|
if objs then
|
||||||
@ -61,23 +62,22 @@ quake.grenade_explode = function(self)
|
|||||||
local dist = math.sqrt((hypot * hypot) + (leny * leny))
|
local dist = math.sqrt((hypot * hypot) + (leny * leny))
|
||||||
local damage = explosion_damage - (explosion_damage * dist / explosion_range)
|
local damage = explosion_damage - (explosion_damage * dist / explosion_range)
|
||||||
|
|
||||||
|
|
||||||
quake.shoot(self.p_name, obj, damage, false)
|
quake.shoot(self.p_name, obj, damage, false)
|
||||||
|
|
||||||
end
|
end
|
||||||
elseif obj:get_luaentity() then
|
--[[
|
||||||
local entity = obj:get_luaentity()
|
elseif obj:get_luaentity() then
|
||||||
if entity.initial_properties ~= nil then
|
local entity = obj:get_luaentity()
|
||||||
|
if entity.initial_properties ~= nil then
|
||||||
if entity.initial_properties.is_bullet or entity.initial_properties.is_grenade then
|
if entity.initial_properties.is_bullet or entity.initial_properties.is_grenade then
|
||||||
--distrugge sia il proiettile con cui collide che se stesso
|
--distrugge sia il proiettile con cui collide che se stesso
|
||||||
entity:_destroy()
|
entity:_destroy()
|
||||||
self:_destroy()
|
return
|
||||||
return
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user