mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
Initial pulse code. WIP
This commit is contained in:
@@ -19,4 +19,6 @@
|
||||
//Surgery info
|
||||
var/datum/surgery_status/op_stage = new/datum/surgery_status
|
||||
//Active emote/pose
|
||||
var/pose = null
|
||||
var/pose = null
|
||||
|
||||
var/pulse = PULSE_NORM //current pulse level
|
||||
@@ -440,6 +440,7 @@
|
||||
if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 )
|
||||
pose = addtext(pose,".") //Makes sure all emotes end with a period.
|
||||
msg += "\n[t_He] is [pose]"
|
||||
msg += "\n\red pulse:[src.pulse]"
|
||||
|
||||
usr << msg
|
||||
|
||||
|
||||
@@ -1218,3 +1218,43 @@ mob/living/carbon/human/yank_out_object()
|
||||
organ.status |= ORGAN_BLEEDING
|
||||
organ.take_damage(rand(1,3), 0, 0)
|
||||
src.adjustToxLoss(rand(1,3))
|
||||
|
||||
/mob/living/carbon/human/verb/check_pulse()
|
||||
set category = "Object"
|
||||
set name = "Check pulse"
|
||||
set desc = "Approximately count somebody's pulse. Requires you to stand still at least 6 seconds."
|
||||
set src in view(1)
|
||||
|
||||
if(usr.stat == 1 || usr.restrained() || !isliving(usr)) return
|
||||
|
||||
usr.visible_message("\blue [usr] kneels down, puts \his hand on [src]'s wrist and begins counting their pulse.",\
|
||||
"\blue Don't move until counting is finished.")
|
||||
if(src.pulse)
|
||||
usr << "\blue [src] has pulse! Counting..."
|
||||
else
|
||||
usr << "\red [src] has no pulse!"
|
||||
return
|
||||
|
||||
sleep(60)
|
||||
if(usr.move_speed >= 60)
|
||||
usr << "\blue [src]'s pulse is [src.get_pulse(0)]."
|
||||
|
||||
/mob/living/carbon/human/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
|
||||
var/temp = 0
|
||||
switch(src.pulse)
|
||||
if(PULSE_NONE)
|
||||
return "0"
|
||||
if(PULSE_SLOW)
|
||||
temp = rand(40, 60)
|
||||
return method ? num2text(temp) : temp + rand(-10, 10)
|
||||
if(PULSE_NORM)
|
||||
temp = rand(60, 90)
|
||||
return method ? num2text(temp) : temp + rand(-10, 10)
|
||||
if(PULSE_FAST)
|
||||
temp = rand(90, 120)
|
||||
return method ? num2text(temp) : temp + rand(-10, 10)
|
||||
if(PULSE_2FAST)
|
||||
temp = rand(120, 160)
|
||||
return method ? num2text(temp) : temp + rand(-10, 10)
|
||||
if(PULSE_THREADY)
|
||||
return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread"
|
||||
@@ -113,6 +113,8 @@
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
pulse = handle_pulse()
|
||||
|
||||
// Grabbing
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
@@ -211,6 +213,8 @@
|
||||
// Next, the method to induce stasis has some adverse side-effects, manifesting
|
||||
// as cloneloss
|
||||
adjustCloneLoss(0.1)
|
||||
//no pulse in stasis
|
||||
pulse = PULSE_NONE
|
||||
|
||||
proc/handle_mutations_and_radiation()
|
||||
if(getFireLoss())
|
||||
@@ -1414,5 +1418,34 @@
|
||||
if (shock_stage > 80)
|
||||
Paralyse(rand(15,28))
|
||||
|
||||
proc/handle_pulse()
|
||||
//if(life_tick % 100) return pulse //update pulse every 100 life ticks
|
||||
|
||||
if(stat == DEAD)
|
||||
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
|
||||
|
||||
var/temp = PULSE_NORM
|
||||
|
||||
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"))
|
||||
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))
|
||||
if(temp <= PULSE_THREADY && temp >= PULSE_NORM)
|
||||
temp--
|
||||
break //one reagent is enough
|
||||
|
||||
for(var/R in tachycardics) //handles different chems' influence on pulse
|
||||
if(reagents.get_reagent_amount(R))
|
||||
if(temp <= PULSE_FAST && temp >= PULSE_NONE)
|
||||
temp++
|
||||
break
|
||||
|
||||
return temp
|
||||
|
||||
|
||||
#undef HUMAN_MAX_OXYLOSS
|
||||
#undef HUMAN_CRIT_MAX_OXYLOSS
|
||||
|
||||
Reference in New Issue
Block a user