Merge pull request #3611 from Citadel-Station-13/upstream-merge-31945
[MIRROR] Adds ambience to the SM and portable generators
This commit is contained in:
@@ -6,4 +6,19 @@
|
||||
end_sound = 'sound/machines/shower/shower_end.ogg'
|
||||
volume = 25
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/supermatter
|
||||
mid_sounds = list('sound/machines/sm/supermatter1.ogg'=1,'sound/machines/sm/supermatter2.ogg'=1,'sound/machines/sm/supermatter3.ogg'=1)
|
||||
mid_length = 6
|
||||
volume = 1
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/generator
|
||||
start_sound = 'sound/machines/generator/generator_start.ogg'
|
||||
start_length = 4
|
||||
mid_sounds = list('sound/machines/generator/generator_mid1.ogg'=1, 'sound/machines/generator/generator_mid2.ogg'=1, 'sound/machines/generator/generator_mid3.ogg'=1)
|
||||
mid_length = 4
|
||||
end_sound = 'sound/machines/generator/generator_end.ogg'
|
||||
volume = 40
|
||||
@@ -15,6 +15,15 @@
|
||||
var/power_output = 1
|
||||
var/consumption = 0
|
||||
var/base_icon = "portgen0"
|
||||
var/datum/looping_sound/generator/soundloop
|
||||
|
||||
/obj/machinery/power/port_gen/Initialize()
|
||||
. = ..()
|
||||
soundloop = new(list(src), active)
|
||||
|
||||
/obj/machinery/power/port_gen/Destroy()
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check.
|
||||
return 1
|
||||
@@ -36,11 +45,13 @@
|
||||
add_avail(power_gen * power_output)
|
||||
UseFuel()
|
||||
src.updateDialog()
|
||||
soundloop.start()
|
||||
|
||||
else
|
||||
active = 0
|
||||
handleInactive()
|
||||
update_icon()
|
||||
soundloop.stop()
|
||||
|
||||
/obj/machinery/power/port_gen/attack_hand(mob/user)
|
||||
if(..())
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
BIN
sound/machines/generator/generator_end.ogg
Normal file
BIN
sound/machines/generator/generator_end.ogg
Normal file
Binary file not shown.
BIN
sound/machines/generator/generator_mid1.ogg
Normal file
BIN
sound/machines/generator/generator_mid1.ogg
Normal file
Binary file not shown.
BIN
sound/machines/generator/generator_mid2.ogg
Normal file
BIN
sound/machines/generator/generator_mid2.ogg
Normal file
Binary file not shown.
BIN
sound/machines/generator/generator_mid3.ogg
Normal file
BIN
sound/machines/generator/generator_mid3.ogg
Normal file
Binary file not shown.
BIN
sound/machines/generator/generator_start.ogg
Normal file
BIN
sound/machines/generator/generator_start.ogg
Normal file
Binary file not shown.
BIN
sound/machines/sm/supermatter1.ogg
Normal file
BIN
sound/machines/sm/supermatter1.ogg
Normal file
Binary file not shown.
BIN
sound/machines/sm/supermatter2.ogg
Normal file
BIN
sound/machines/sm/supermatter2.ogg
Normal file
Binary file not shown.
BIN
sound/machines/sm/supermatter3.ogg
Normal file
BIN
sound/machines/sm/supermatter3.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user