Heartbeat

This commit is contained in:
volas
2015-03-07 18:03:49 +03:00
parent f09f00d8ac
commit cef52c73f8
2 changed files with 31 additions and 12 deletions

View File

@@ -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.

Binary file not shown.