From 0e153b72267e1b226f736461650a8dfd08abf9d0 Mon Sep 17 00:00:00 2001 From: Spamcat Date: Mon, 8 Jul 2013 22:37:54 +0400 Subject: [PATCH] Updated pulse checking on examine, optimized handle_pulse(), fixed some grammer. xoxo chinsky --- code/modules/mob/living/carbon/human/examine.dm | 17 +++++------------ code/modules/mob/living/carbon/human/human.dm | 6 +++--- code/modules/mob/living/carbon/human/life.dm | 12 ++++++------ 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index dbb721afa91..754f3b13c73 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -209,20 +209,13 @@ spawn(15) usr << "\blue [t_He] has a pulse!" - if (src.stat == 2 || (status_flags & FAKEDEATH)) - if(distance <= 1) - if(istype(usr, /mob/living/carbon/human) && usr.stat == 0) - for(var/mob/O in viewers(usr.loc, null)) - O.show_message("[usr] checks [src]'s pulse.", 1) + if(distance <= 1) + if(istype(usr, /mob/living/carbon/human) && usr.stat == 0) spawn(15) - var/foundghost = 0 - if(src.client) - foundghost = 1 - if(!foundghost) - usr << "[t_He] has no pulse and [t_his] soul has departed..." + if(pulse == PULSE_NONE) + usr << "[t_He] has no pulse [src.client ? "" : "and [t_his] soul has departed"]..." else - usr << "[t_He] has no pulse..." - + usr << "[t_He] has a pulse!" msg += "" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 58c0f09373c..c357004ecee 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1238,9 +1238,9 @@ mob/living/carbon/human/yank_out_object() "You begin counting your pulse.") if(src.pulse) - usr << "\blue [self ? "I have" : "[src] has"] pulse! Counting..." + usr << "\blue [self ? "You have a" : "[src] has"] pulse! Counting..." else - usr << "\red [src] has no pulse!" + usr << "\red [src] has no pulse!" //it is REALLY UNLIKELY that a dead person would check his own pulse return usr << "Don't move until counting is finished." @@ -1249,5 +1249,5 @@ mob/living/carbon/human/yank_out_object() if(usr.l_move_time >= time) //checks if our mob has moved during the sleep() usr << "You moved while counting. Try again." else - usr << "\blue [self ? "My" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]." + usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]." diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1806bf17000..edbbaf54678 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1417,7 +1417,7 @@ Paralyse(rand(15,28)) proc/handle_pulse() - //if(life_tick % 100) return pulse //update pulse every 100 life ticks + if(life_tick % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load) if(stat == DEAD) return PULSE_NONE //that's it, you're dead, nothing can influence your pulse @@ -1427,17 +1427,17 @@ if(round(vessel.get_reagent_amount("blood")) <= BLOOD_VOLUME_BAD) //how much blood do we have temp = PULSE_THREADY //not enough :( - if(reagents.get_reagent_amount("zombiepowder")) + if(status_flags & FAKEDEATH) temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds - for(var/R in bradycardics) - if(reagents.get_reagent_amount(R)) + for(var/datum/reagent/R in reagents.reagent_list) + if(R.id in bradycardics) if(temp <= PULSE_THREADY && temp >= PULSE_NORM) temp-- break //one reagent is enough //comment out the breaks to make med effects stack - for(var/R in tachycardics) //handles different chems' influence on pulse - if(reagents.get_reagent_amount(R)) + for(var/datum/reagent/R in reagents.reagent_list) //handles different chems' influence on pulse + if(R.id in tachycardics) if(temp <= PULSE_FAST && temp >= PULSE_NONE) temp++ break