mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 12:46:40 +01:00
Merge pull request #5791 from Neerti/looping_sounds
Adds Various Sounds, Looping Sound System
This commit is contained in:
@@ -54,15 +54,19 @@
|
||||
interval_upper_bound = 15 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/geiger
|
||||
sounds_to_play = list("geiger")
|
||||
interval_lower_bound = 2 SECONDS
|
||||
interval_upper_bound = 2 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/geiger_weak
|
||||
sounds_to_play = list("geiger_weak")
|
||||
sounds_to_play = list('sound/items/geiger/low1.ogg', 'sound/items/geiger/low2.ogg', 'sound/items/geiger/low3.ogg', 'sound/items/geiger/low4.ogg')
|
||||
interval_lower_bound = 1 SECOND
|
||||
interval_upper_bound = 1 SECOND
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/geiger/med
|
||||
sounds_to_play = list('sound/items/geiger/med1.ogg', 'sound/items/geiger/med2.ogg', 'sound/items/geiger/med3.ogg', 'sound/items/geiger/med4.ogg')
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/geiger/high
|
||||
sounds_to_play = list('sound/items/geiger/high1.ogg', 'sound/items/geiger/high2.ogg', 'sound/items/geiger/high3.ogg', 'sound/items/geiger/high4.ogg')
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/geiger/ext
|
||||
sounds_to_play = list('sound/items/geiger/ext1.ogg', 'sound/items/geiger/ext2.ogg', 'sound/items/geiger/ext3.ogg', 'sound/items/geiger/ext4.ogg')
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/punching
|
||||
sounds_to_play = list("punch")
|
||||
interval_lower_bound = 5
|
||||
@@ -73,10 +77,8 @@
|
||||
interval_lower_bound = 5 SECONDS
|
||||
interval_upper_bound = 10 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/distant_explosions
|
||||
/obj/effect/map_effect/interval/sound_emitter/explosions/distant
|
||||
sounds_to_play = list('sound/effects/explosionfar.ogg')
|
||||
interval_lower_bound = 5 SECONDS
|
||||
interval_upper_bound = 10 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/sound_emitter/ballistic_gunfight
|
||||
sounds_to_play = list(
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
#define RAD_LEVEL_LOW 0.01 // Around the level at which radiation starts to become harmful
|
||||
#define RAD_LEVEL_MODERATE 10
|
||||
#define RAD_LEVEL_HIGH 25
|
||||
#define RAD_LEVEL_VERY_HIGH 50
|
||||
|
||||
//Geiger counter
|
||||
//Rewritten version of TG's geiger counter
|
||||
//I opted to show exact radiation levels
|
||||
@@ -15,12 +10,16 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
var/scanning = 0
|
||||
var/radiation_count = 0
|
||||
var/datum/looping_sound/geiger/soundloop
|
||||
|
||||
/obj/item/device/geiger/New()
|
||||
/obj/item/device/geiger/Initialize()
|
||||
START_PROCESSING(SSobj, src)
|
||||
soundloop = new(list(src), FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/geiger/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/geiger/process()
|
||||
@@ -31,6 +30,7 @@
|
||||
return
|
||||
radiation_count = radiation_repository.get_rads_at_turf(get_turf(src))
|
||||
update_icon()
|
||||
update_sound()
|
||||
|
||||
/obj/item/device/geiger/examine(mob/user)
|
||||
..(user)
|
||||
@@ -44,18 +44,24 @@
|
||||
if(amount > radiation_count)
|
||||
radiation_count = amount
|
||||
|
||||
var/sound = "geiger"
|
||||
if(amount < 5)
|
||||
sound = "geiger_weak"
|
||||
playsound(src, sound, between(10, 10 + (radiation_count * 4), 100), 0)
|
||||
if(sound == "geiger_weak") // A weak geiger sound every two seconds sounds too infrequent.
|
||||
spawn(1 SECOND)
|
||||
playsound(src, sound, between(10, 10 + (radiation_count * 4), 100), 0)
|
||||
update_icon()
|
||||
update_sound()
|
||||
|
||||
/obj/item/device/geiger/proc/update_sound()
|
||||
var/datum/looping_sound/geiger/loop = soundloop
|
||||
if(!scanning)
|
||||
loop.stop()
|
||||
return
|
||||
if(!radiation_count)
|
||||
loop.stop()
|
||||
return
|
||||
loop.last_radiation = radiation_count
|
||||
loop.start()
|
||||
|
||||
/obj/item/device/geiger/attack_self(var/mob/user)
|
||||
scanning = !scanning
|
||||
update_icon()
|
||||
update_sound()
|
||||
to_chat(user, "<span class='notice'>\icon[src] You switch [scanning ? "on" : "off"] \the [src].</span>")
|
||||
|
||||
/obj/item/device/geiger/update_icon()
|
||||
@@ -76,8 +82,3 @@
|
||||
icon_state = "geiger_on_4"
|
||||
if(RAD_LEVEL_VERY_HIGH to INFINITY)
|
||||
icon_state = "geiger_on_5"
|
||||
|
||||
#undef RAD_LEVEL_LOW
|
||||
#undef RAD_LEVEL_MODERATE
|
||||
#undef RAD_LEVEL_HIGH
|
||||
#undef RAD_LEVEL_VERY_HIGH
|
||||
@@ -131,10 +131,16 @@
|
||||
var/watertemp = "normal" //freezing, normal, or boiling
|
||||
var/is_washing = 0
|
||||
var/list/temperature_settings = list("normal" = 310, "boiling" = T0C+100, "freezing" = T0C)
|
||||
var/datum/looping_sound/showering/soundloop
|
||||
|
||||
/obj/machinery/shower/New()
|
||||
..()
|
||||
/obj/machinery/shower/Initialize()
|
||||
create_reagents(50)
|
||||
soundloop = new(list(src), FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/shower/Destroy()
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
//add heat controls? when emagged, you can freeze to death in it?
|
||||
|
||||
@@ -151,11 +157,14 @@
|
||||
on = !on
|
||||
update_icon()
|
||||
if(on)
|
||||
soundloop.start()
|
||||
if (M.loc == loc)
|
||||
wash(M)
|
||||
process_heat(M)
|
||||
for (var/atom/movable/G in src.loc)
|
||||
G.clean_blood()
|
||||
else
|
||||
soundloop.stop()
|
||||
|
||||
/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(I.type == /obj/item/device/analyzer)
|
||||
|
||||
Reference in New Issue
Block a user