mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-16 12:07:48 +00:00
* Delimbs Stamina * SR skews * out of band upstream hotfix Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com> Co-authored-by: Tastyfish <crazychris32@gmail.com>
32 lines
1.3 KiB
Plaintext
32 lines
1.3 KiB
Plaintext
/datum/component/unbreakable
|
|
COOLDOWN_DECLARE(surge_cooldown)
|
|
|
|
/datum/component/unbreakable/Initialize()
|
|
if(!ishuman(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
ADD_TRAIT(parent, TRAIT_UNBREAKABLE, INNATE_TRAIT)
|
|
|
|
/datum/component/unbreakable/Destroy(force, silent)
|
|
REMOVE_TRAIT(parent, TRAIT_UNBREAKABLE, INNATE_TRAIT)
|
|
return ..()
|
|
|
|
/datum/component/unbreakable/RegisterWithParent()
|
|
RegisterSignal(parent, COMSIG_MOB_STATCHANGE, PROC_REF(surge))
|
|
|
|
/datum/component/unbreakable/UnregisterFromParent()
|
|
UnregisterSignal(parent, COMSIG_MOB_STATCHANGE)
|
|
|
|
/datum/component/unbreakable/proc/surge(mob/living/carbon/human/surged, new_stat)
|
|
SIGNAL_HANDLER
|
|
if(new_stat < SOFT_CRIT || new_stat >= DEAD)
|
|
return
|
|
if(!COOLDOWN_FINISHED(src, surge_cooldown))
|
|
return
|
|
COOLDOWN_START(src, surge_cooldown, 1 MINUTES)
|
|
surged.balloon_alert(surged, "you refuse to give up!")//breaks balloon alert conventions by using a "!" for a fail message but that's okay because it's a pretty awesome moment
|
|
surged.heal_overall_damage(15, 15, BODYTYPE_ORGANIC)
|
|
if(surged.reagents.get_reagent_amount(/datum/reagent/medicine/ephedrine) < 20)
|
|
surged.reagents.add_reagent(/datum/reagent/medicine/ephedrine, 10)
|
|
if(surged.reagents.get_reagent_amount(/datum/reagent/medicine/epinephrine) < 20)
|
|
surged.reagents.add_reagent(/datum/reagent/medicine/epinephrine, 10)
|