Adds pref SOUND_HEARTBEAT

This commit is contained in:
Tigercat2000
2015-03-17 17:30:28 +01:00
parent 07e9b18f6c
commit 008cf4d365
3 changed files with 34 additions and 17 deletions
+15 -1
View File
@@ -25,7 +25,7 @@
src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTRADIO) ? "hear all radio chat in the world" : "only hear from nearby speakers"]."
prefs.save_preferences(src)
feedback_add_details("admin_verb","TGR")
/client/proc/toggle_hear_radio()
set name = "Show/Hide RadioChatter"
set category = "Preferences"
@@ -134,6 +134,20 @@
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)
feedback_add_details("admin_verb","TAmbi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/Toggle_Heartbeat() //to toggle off heartbeat sounds, in case they get too annoying
set name = "Hear/Silence Heartbeat"
set category = "Preferences"
set desc = "Toggles hearing heart beating sound effects"
prefs.sound ^= SOUND_HEARTBEAT
prefs.save_preferences(src)
if(prefs.sound & SOUND_HEARTBEAT)
src << "You will now hear heartbeat sounds."
else
src << "You will no longer hear heartbeat sounds."
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1)
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)
feedback_add_details("admin_verb","Thb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//be special
/client/verb/toggle_be_special(role in be_special_flags)
set name = "Toggle Special Role Candidacy"
+17 -15
View File
@@ -1653,25 +1653,27 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
H.vomit()
proc/handle_heartbeat()
if(pulse == PULSE_NONE)
return
var/client/C = src.client
if(C.prefs.sound & SOUND_HEARTBEAT) //disable heartbeat by pref
if(pulse == PULSE_NONE)
return
var/datum/organ/internal/heart/H = internal_organs_by_name["heart"]
var/datum/organ/internal/heart/H = internal_organs_by_name["heart"]
if(!H || istype(H,/datum/organ/internal/heart/robotic))
return
if(!H || istype(H,/datum/organ/internal/heart/robotic))
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(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,50)
else
heartbeat++
if(heartbeat >= rate)
heartbeat = 0
src << sound('sound/effects/singlebeat.ogg',0,0,0,50)
else
heartbeat++
/*
Called by life(), instead of having the individual hud items update icons each tick and check for status changes