add technic.radiation_callback(object, damage)

preparation for https://github.com/pandorabox-io/hazmat_suit/issues/1
This commit is contained in:
BuckarooBanzay 2020-01-16 15:28:03 +01:00
parent 2a4a54afc8
commit 8f9486cc37

View File

@ -248,6 +248,12 @@ local cache_scaled_shielding = {}
local rad_dmg_cutoff = 0.2 local rad_dmg_cutoff = 0.2
local radiated_players = {} local radiated_players = {}
-- radiation callback function for external use
-- (radiation counters, etc)
-- parameters: object / damage (before armor calculations)
function technic.radiation_callback(object, damage)
end
local armor_enabled = technic.config:get_bool("enable_radiation_protection") local armor_enabled = technic.config:get_bool("enable_radiation_protection")
local entity_damage = technic.config:get_bool("enable_entity_radiation_damage") local entity_damage = technic.config:get_bool("enable_entity_radiation_damage")
local longterm_damage = technic.config:get_bool("enable_longterm_radiation_damage") local longterm_damage = technic.config:get_bool("enable_longterm_radiation_damage")
@ -324,6 +330,10 @@ local function dmg_object(pos, object, strength)
if not dmg then if not dmg then
return return
end end
-- execute radiation callback
technic.radiation_callback(object, dmg)
if armor_enabled then if armor_enabled then
dmg = dmg * mul dmg = dmg * mul
end end