Files
Bubberstation/code/datums/components/unbreakable.dm
Kapu1178 1d0eadcb12 Kapulimbs (#65523)
* i wanna go to bed so im pushing this

* It compiles but doesn't work yet

* It works!

* I WANT TO DIE

* Appease linters

* some CI fixes

* Address reviews + oversight

* Limb grower fix

* more icon fixes

* forgot to hit save

* I'm a dumbass

* Removes bodypart parent from unit test

* Fixes monkeys and CI

* Grammar pass

* I hate zombie code so much

* General code cleanup

* THE SHITCODERS ARE COMING FOR MY VARS

* THE UNIT TESTS ARE COMING FOR MY SHITCODE

* Reviews + skirts

* Removes an unused DMI

* Why didn't I do this in the first place?

* HAIR REFACTOR

* Haha whoops

* How did I miss this

* Admin spawned creatures now have their features

* Optimize me harder

* minor fix i need to push to merge master

* Fixes hair (maybe) and a runtime

* Maybe fixes mirrors

* Attempts to fix women

* Fixes hair on dismembered heads and a grammar change

* Caps lock did me dirty

* address reviews

* icon failures fix + missed reviews

* Fixes: Facehuggers and Regenerate_limb

* Fixes ethereal color pref appearance

* How the fuck did this not break everything else horribly?

* JESUS FUCKING CHRIST IM A MORON

* Fixes compile

* I'm not high I swear

* Im a dipshiiiit

* grumble grumble

* Fixes a visual bug with digitigrade legs. Adds \improper to roundstart species names. Added two new clothing-related helper procs. Renamed a couple procs to be more accurate. Adds SHOULD_CALL_PARENT(TRUE) to examine_more. Addresses reviews.

* Forgot this little readability thing.

* Updates CODEOWNERS

* Me when I forget how github works

* mapload me harder

* Last second fixes
2022-04-01 21:07:46 -04:00

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/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, 0, 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)