mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 14:44:05 +01:00
do_cpr() proc for humans
This commit is contained in:
@@ -1728,6 +1728,39 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/proc/do_cpr(mob/living/carbon/human/H)
|
||||
if(H.stat == DEAD || (H.status_flags & FAKEDEATH))
|
||||
to_chat(src, "<span class='warning'>[H.name] is dead!</span>")
|
||||
return
|
||||
if(!check_has_mouth())
|
||||
to_chat(src, "<span class='danger'>You don't have a mouth, you cannot perform CPR!</span>")
|
||||
return
|
||||
if(!H.check_has_mouth())
|
||||
to_chat(src, "<span class='danger'>They don't have a mouth, you cannot perform CPR!</span>")
|
||||
return
|
||||
if((head && (head.flags_cover & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH) && !wear_mask.mask_adjusted))
|
||||
to_chat(src, "<span class='warning'>Remove your mask first!</span>")
|
||||
return 0
|
||||
if((H.head && (H.head.flags_cover & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags_cover & MASKCOVERSMOUTH) && !H.wear_mask.mask_adjusted))
|
||||
to_chat(src, "<span class='warning'>Remove their mask first!</span>")
|
||||
return 0
|
||||
visible_message("<span class='danger'>[src] is trying to perform CPR on [H.name]!</span>", \
|
||||
"<span class='danger'>You try to perform CPR on [H.name]!</span>")
|
||||
if(do_mob(src, H, 40))
|
||||
if(H.health > config.health_threshold_dead && H.health <= config.health_threshold_crit)
|
||||
var/suff = min(H.getOxyLoss(), 7)
|
||||
H.adjustOxyLoss(-suff)
|
||||
H.updatehealth()
|
||||
visible_message("<span class='danger'>[src] performs CPR on [H.name]!</span>", \
|
||||
"<span class='notice'>You perform CPR on [H.name].</span>")
|
||||
|
||||
to_chat(H, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
|
||||
to_chat(src, "<span class='alert'>Repeat at least every 7 seconds.")
|
||||
add_logs(src, H, "CPRed")
|
||||
return 1
|
||||
else
|
||||
to_chat(src, "<span class='danger'>You need to stay still while performing CPR!</span>")
|
||||
|
||||
/mob/living/carbon/human/canBeHandcuffed()
|
||||
if(get_num_arms() >= 2)
|
||||
return TRUE
|
||||
|
||||
@@ -322,35 +322,8 @@
|
||||
target.help_shake_act(user)
|
||||
add_attack_logs(user, target, "Shaked")
|
||||
return 1
|
||||
if(!user.check_has_mouth())
|
||||
to_chat(user, "<span class='danger'>You don't have a mouth, you cannot perform CPR!</span>")
|
||||
return
|
||||
if(!target.check_has_mouth())
|
||||
to_chat(user, "<span class='danger'>They don't have a mouth, you cannot perform CPR!</span>")
|
||||
return
|
||||
if((user.head && (user.head.flags_cover & HEADCOVERSMOUTH)) || (user.wear_mask && (user.wear_mask.flags_cover & MASKCOVERSMOUTH) && !user.wear_mask.mask_adjusted))
|
||||
to_chat(user, "<span class='warning'>Remove your mask!</span>")
|
||||
return 0
|
||||
if((target.head && (target.head.flags_cover & HEADCOVERSMOUTH)) || (target.wear_mask && (target.wear_mask.flags_cover & MASKCOVERSMOUTH) && !target.wear_mask.mask_adjusted))
|
||||
to_chat(user, "<span class='warning'>Remove his mask!</span>")
|
||||
return 0
|
||||
|
||||
user.visible_message("<span class='danger'>\The [user] is trying to perform CPR on \the [target]!</span>", \
|
||||
"<span class='danger'>You try to perform CPR on \the [target]!</span>")
|
||||
if(do_mob(user, target, 40))
|
||||
if(target.health > config.health_threshold_dead && target.health <= config.health_threshold_crit)
|
||||
var/suff = min(target.getOxyLoss(), 7)
|
||||
target.adjustOxyLoss(-suff)
|
||||
target.updatehealth()
|
||||
user.visible_message("<span class='danger'>\The [user] performs CPR on \the [target]!</span>", \
|
||||
"<span class='notice'>You perform CPR on \the [target].</span>")
|
||||
|
||||
to_chat(target, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
|
||||
to_chat(user, "<span class='alert'>Repeat at least every 7 seconds.")
|
||||
add_attack_logs(user, target, "CPRed", FALSE)
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='danger'>You need to stay still while performing CPR!</span>")
|
||||
user.do_cpr(target)
|
||||
|
||||
/datum/species/proc/grab(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
|
||||
if(attacker_style && attacker_style.grab_act(user, target))
|
||||
|
||||
Reference in New Issue
Block a user