mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Refactors heart attacks, unbreaks incremental cloning
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
|
||||
var/pulse = PULSE_NORM //current pulse level
|
||||
|
||||
var/heart_attack = 0
|
||||
var/wetlevel = 0 //how wet the mob is
|
||||
|
||||
var/oxygen_alert = 0
|
||||
@@ -29,4 +28,4 @@
|
||||
var/fire_alert = 0
|
||||
|
||||
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
var/co2overloadtime = null
|
||||
var/co2overloadtime = null
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
stat = DEAD
|
||||
SetDizzy(0)
|
||||
SetJitter(0)
|
||||
heart_attack = 0
|
||||
set_heartattack(FALSE)
|
||||
|
||||
//Handle species-specific deaths.
|
||||
if(species) species.handle_death(src)
|
||||
|
||||
@@ -759,9 +759,9 @@
|
||||
if(species)
|
||||
species_siemens_coeff = species.siemens_coeff
|
||||
siemens_coeff = gloves_siemens_coeff * species_siemens_coeff
|
||||
if(heart_attack)
|
||||
if(undergoing_cardiac_arrest())
|
||||
if(shock_damage * siemens_coeff >= 1 && prob(25))
|
||||
heart_attack = 0
|
||||
set_heartattack(FALSE)
|
||||
if(stat == CONSCIOUS)
|
||||
to_chat(src, "<span class='notice'>You feel your heart beating again!</span>")
|
||||
. = ..()
|
||||
|
||||
@@ -1032,7 +1032,7 @@
|
||||
if(stat == DEAD)
|
||||
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
|
||||
|
||||
if(heart_attack)
|
||||
if(undergoing_cardiac_arrest())
|
||||
return PULSE_NONE
|
||||
|
||||
var/temp = PULSE_NORM
|
||||
@@ -1175,14 +1175,37 @@
|
||||
return stuttering
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/can_heartattack()
|
||||
if(species.flags & NO_BLOOD)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/proc/undergoing_cardiac_arrest()
|
||||
if(!can_heartattack())
|
||||
return FALSE
|
||||
var/obj/item/organ/internal/heart/heart = get_int_organ(/obj/item/organ/internal/heart)
|
||||
if(istype(heart) && heart.beating)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/proc/set_heartattack(status)
|
||||
if(!can_heartattack())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/internal/heart/heart = get_int_organ(/obj/item/organ/internal/heart)
|
||||
if(!istype(heart))
|
||||
return FALSE
|
||||
|
||||
heart.beating = !status
|
||||
|
||||
/mob/living/carbon/human/proc/handle_heartattack()
|
||||
if(!heart_attack)
|
||||
if(!can_heartattack() || !undergoing_cardiac_arrest() || reagents.has_reagent("corazone"))
|
||||
return
|
||||
else
|
||||
AdjustLoseBreath(2, bound_lower = 0, bound_upper = 3)
|
||||
adjustOxyLoss(5)
|
||||
Paralyse(4)
|
||||
adjustBruteLoss(2)
|
||||
AdjustLoseBreath(2, bound_lower = 0, bound_upper = 3)
|
||||
adjustOxyLoss(5)
|
||||
Paralyse(4)
|
||||
adjustBruteLoss(2)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -377,7 +377,6 @@
|
||||
if(iscarbon(src))
|
||||
var/mob/living/carbon/C = src
|
||||
C.handcuffed = initial(C.handcuffed)
|
||||
C.heart_attack = 0
|
||||
|
||||
for(var/datum/disease/D in C.viruses)
|
||||
D.cure(0)
|
||||
@@ -385,6 +384,7 @@
|
||||
// restore all of the human's blood and reset their shock stage
|
||||
if(ishuman(src))
|
||||
human_mob = src
|
||||
human_mob.set_heartattack(FALSE)
|
||||
human_mob.restore_blood()
|
||||
human_mob.shock_stage = 0
|
||||
human_mob.decaylevel = 0
|
||||
|
||||
Reference in New Issue
Block a user