Adds ambience to the SM and portable generators (#31945)

* Adds aambience to the SM and portable generators

* lowered pitch of supermatter

* start and end fix
This commit is contained in:
Emmett Gaines
2017-10-26 00:36:08 -04:00
committed by CitadelStationBot
parent 630b332848
commit c7d3696636
11 changed files with 36 additions and 2 deletions
@@ -135,6 +135,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
var/is_main_engine = FALSE
var/datum/looping_sound/supermatter/soundloop
/obj/machinery/power/supermatter_shard/Initialize()
. = ..()
SSair.atmos_machinery += src
@@ -149,6 +151,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
if(is_main_engine)
GLOB.main_supermatter_engine = src
soundloop = new(list(src), TRUE)
/obj/machinery/power/supermatter_shard/Destroy()
investigate_log("has been destroyed.", INVESTIGATE_SUPERMATTER)
SSair.atmos_machinery -= src
@@ -157,7 +161,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
QDEL_NULL(countdown)
if(is_main_engine && GLOB.main_supermatter_engine == src)
GLOB.main_supermatter_engine = null
. = ..()
QDEL_NULL(soundloop)
return ..()
/obj/machinery/power/supermatter_shard/examine(mob/user)
..()
@@ -251,6 +256,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
if(!istype(T)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(power)
soundloop.volume = min(50, (round(power, 50)/50)+1) // 5 +1 volume per 20 power. 2500 power is max
//Ok, get the air from the turf
var/datum/gas_mixture/env = T.return_air()