diff --git a/monkestation/code/datums/components/regenerator.dm b/monkestation/code/datums/components/regenerator.dm new file mode 100644 index 000000000000..1481afd6ff1e --- /dev/null +++ b/monkestation/code/datums/components/regenerator.dm @@ -0,0 +1,12 @@ +/datum/component/regenerator/RegisterWithParent() + . = ..() + RegisterSignals(parent, COMSIG_LIVING_ADJUST_ALL_DAMAGE_TYPES, PROC_REF(on_adjust_damage)) + +/datum/component/regenerator/UnregisterFromParent() + . = ..() + UnregisterSignal(parent, COMSIG_LIVING_ADJUST_ALL_DAMAGE_TYPES) + +/datum/component/regenerator/proc/on_adjust_damage(datum/source, damagetype, damage) + SIGNAL_HANDLER + if(damage > 0) + on_take_damage(source, damage, damagetype) diff --git a/tgstation.dme b/tgstation.dme index f0485f05f474..0c93343792ca 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6003,6 +6003,7 @@ #include "monkestation\code\datums\components\multi_hit.dm" #include "monkestation\code\datums\components\pathology_glasses.dm" #include "monkestation\code\datums\components\pixel_shift.dm" +#include "monkestation\code\datums\components\regenerator.dm" #include "monkestation\code\datums\components\shoesteps.dm" #include "monkestation\code\datums\components\throw_bounce.dm" #include "monkestation\code\datums\components\turf_checker_complex.dm"