mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-11 00:03:55 +01:00
Merge pull request #1182 from cadyn/master
fixing defib timer and adding surgery for that shit
This commit is contained in:
@@ -33,7 +33,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
|
||||
if(!owner || owner.stat == DEAD)
|
||||
defib_timer = max(--defib_timer, 0)
|
||||
else
|
||||
defib_timer = min(++defib_timer, (config.defib_timer MINUTES) / 2)
|
||||
defib_timer = min(++defib_timer, (config.defib_timer MINUTES) / 20) // Time vars measure things in ticks. Life tick happens every ~2 seconds, therefore dividing by 20
|
||||
|
||||
/obj/item/organ/internal/brain/proc/can_assist()
|
||||
return can_assist
|
||||
@@ -81,7 +81,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
|
||||
/obj/item/organ/internal/brain/New()
|
||||
..()
|
||||
health = config.default_brain_health
|
||||
defib_timer = (config.defib_timer MINUTES) / 2
|
||||
defib_timer = (config.defib_timer MINUTES) / 20 // Time vars measure things in ticks. Life tick happens every ~2 seconds, therefore dividing by 20
|
||||
spawn(5)
|
||||
if(brainmob)
|
||||
butcherable = FALSE
|
||||
|
||||
@@ -146,4 +146,38 @@
|
||||
"<span class='danger'>Your hand slips, failing to finish the surgery, and damaging [target] with \the [tool].</span>")
|
||||
affected.createwound(CUT, 15)
|
||||
affected.createwound(BRUISE, 10)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/brain_revive
|
||||
blood_level = 0
|
||||
allowed_tools = list(/obj/item/weapon/surgical/bioregen=100)
|
||||
min_duration = 120
|
||||
max_duration = 150
|
||||
|
||||
/datum/surgery_step/internal/brain_revive/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/internal/brain/brain = target.internal_organs_by_name[O_BRAIN]
|
||||
return ..() && target_zone == BP_HEAD && istype(brain) && (brain.status & ORGAN_DEAD || brain.defib_timer == 0)
|
||||
|
||||
/datum/surgery_step/internal/brain_revive/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] begins to use \the [tool] to reverse the decay on and revatilize [target]'s brain.</span>", \
|
||||
"<span class='notice'>You begin to use \the [tool] to reverse the decay on and revatilize [target]'s brain.</span>")
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/brain_revive/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='notice'>[user] finishes reversing the decay on and revatalizing [target]'s brain.</span>", \
|
||||
"<span class='notice'>You finish reversing the decay on and revatalizing [target]'s brain.</span>")
|
||||
var/obj/item/organ/internal/brain/brain = target.internal_organs_by_name[O_BRAIN]
|
||||
brain.damage = max(0,brain.damage - 10)
|
||||
brain.status &= ~ORGAN_DEAD
|
||||
brain.handle_organ_mod_special()
|
||||
brain.defib_timer = (config.defib_timer MINUTES) / 20
|
||||
START_PROCESSING(SSobj, brain)
|
||||
..()
|
||||
|
||||
/datum/surgery_step/internal/brain_revive/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("<span class='danger'>[user]'s hand slips, failing to finish the surgery, and damaging [target] with \the [tool].</span>", \
|
||||
"<span class='danger'>Your hand slips, failing to finish the surgery, and damaging [target] with \the [tool].</span>")
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
affected.createwound(CUT, 15)
|
||||
affected.createwound(BRUISE, 10)
|
||||
..()
|
||||
Reference in New Issue
Block a user