Merge !9
This commit is contained in:
commit
722a939651
@ -254,6 +254,8 @@ function block_league.apply_damage(user, targets, weapon, decrease_damage_with_d
|
|||||||
targets = {targets}
|
targets = {targets}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local remaining_HP
|
||||||
|
|
||||||
-- per ogni giocatore colpito
|
-- per ogni giocatore colpito
|
||||||
for _, target in pairs(targets) do
|
for _, target in pairs(targets) do
|
||||||
|
|
||||||
@ -271,7 +273,13 @@ function block_league.apply_damage(user, targets, weapon, decrease_damage_with_d
|
|||||||
target:add_player_velocity(knk)
|
target:add_player_velocity(knk)
|
||||||
end
|
end
|
||||||
|
|
||||||
local remaining_HP = target:get_hp() - damage
|
if weapon.weapon_type == 1 and decrease_damage_with_distance then
|
||||||
|
local dist = get_dist(user:get_pos(), target:get_pos())
|
||||||
|
local damage = damage - (damage * dist / weapon.weapon_range)
|
||||||
|
remaining_HP = target:get_hp() - damage
|
||||||
|
else
|
||||||
|
remaining_HP = target:get_hp() - damage
|
||||||
|
end
|
||||||
|
|
||||||
-- applico il danno
|
-- applico il danno
|
||||||
target:set_hp(remaining_HP, {type = "set_hp", player_name = p_name})
|
target:set_hp(remaining_HP, {type = "set_hp", player_name = p_name})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user