POLARIS: Port's /tg/'s current sound.dm, plus pref

It's mostly the same, just a little more efficient. I added a 'preferences' var to pass a datum and decide whether or not to play the sound for that client based on some preference.
This commit is contained in:
Arokha Sieyes
2018-02-27 13:29:39 -05:00
parent 9ba3dfbea5
commit f87fcd37f1
7 changed files with 168 additions and 145 deletions
+15
View File
@@ -1210,3 +1210,18 @@ default behaviour is:
item.throw_at(target, throw_range, item.throw_speed, src)
/mob/living/get_sound_env(var/pressure_factor)
if (hallucination)
return PSYCHOTIC
else if (druggy)
return DRUGGED
else if (drowsyness)
return DIZZY
else if (confused)
return DIZZY
else if (sleeping)
return UNDERWATER
else
return ..()
+8
View File
@@ -627,3 +627,11 @@ var/global/image/backplane
backplane.mouse_opacity = 0
return TRUE
/mob/proc/get_sound_env(var/pressure_factor)
if (pressure_factor < 0.5)
return SPACE
else
var/area/A = get_area(src)
return A.sound_env