mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Heartbeat
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
var/pressure_alert = 0
|
||||
var/temperature_alert = 0
|
||||
var/in_stasis = 0
|
||||
var/heartbeat = 0
|
||||
|
||||
/mob/living/carbon/human/Life()
|
||||
|
||||
@@ -102,6 +103,8 @@
|
||||
|
||||
handle_medical_side_effects()
|
||||
|
||||
handle_heartbeat()
|
||||
|
||||
handle_stasis_bag()
|
||||
|
||||
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle
|
||||
@@ -1558,6 +1561,22 @@
|
||||
|
||||
return temp
|
||||
|
||||
proc/handle_heartbeat()
|
||||
if(pulse == PULSE_NONE)
|
||||
return
|
||||
|
||||
if(pulse >= PULSE_2FAST || shock_stage >= 10 || istype(get_turf(src), /turf/space))
|
||||
//PULSE_THREADY - maximum value for pulse, currently it 5.
|
||||
//High pulse value corresponds to a fast rate of heartbeat.
|
||||
//Divided by 2, otherwise it is too slow.
|
||||
var/rate = (PULSE_THREADY - pulse)/2
|
||||
|
||||
if(heartbeat >= rate)
|
||||
heartbeat = 0
|
||||
src << sound('sound/effects/singlebeat.ogg',0,0,0,60)
|
||||
else
|
||||
heartbeat++
|
||||
|
||||
/*
|
||||
Called by life(), instead of having the individual hud items update icons each tick and check for status changes
|
||||
we only set those statuses and icons upon changes. Then those HUD items will simply add those pre-made images.
|
||||
|
||||
BIN
sound/effects/singlebeat.ogg
Normal file
BIN
sound/effects/singlebeat.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user