Skip to content

Commit

Permalink
Sounds forever!
Browse files Browse the repository at this point in the history
  • Loading branch information
Tk420634 committed Jul 17, 2024
1 parent 2c7112d commit 88063f3
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 31 deletions.
45 changes: 27 additions & 18 deletions _maps/map_files/coyote_bayou/foxybar.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,12 @@
/area/f13/fb/bar)
"cVe" = (
/obj/effect/overlay/fog/fog2{
plane = -2
},
/obj/machinery/gear_painter,
/turf/open/indestructible/ground/outside/sidewalk{
icon_state = "horizontalbottomborderbottom3"
plane = -2;
alpha = 175
},
/area/f13/wasteland/city/newboston/outdoors)
/obj/effect/sound_emitter/foxybar/clock,
/turf/closed/wall/mineral/brick,
/area/f13/fb/bar)
"cWl" = (
/obj/machinery/telecomms/server/presets/supply,
/turf/open/floor/plasteel/f13{
Expand Down Expand Up @@ -860,10 +859,13 @@
},
/area/f13/wasteland/city/newboston/outdoors)
"esa" = (
/obj/machinery/gear_painter{
pixel_y = 13;
plane = 0
},
/obj/effect/overlay/fog/fog2{
plane = -2
plane = 1
},
/obj/machinery/gear_painter,
/turf/open/indestructible/ground/outside/sidewalk{
icon_state = "horizontalbottomborderbottom0"
},
Expand Down Expand Up @@ -1007,7 +1009,8 @@
},
/obj/effect/landmark/start/f13/wastelander,
/obj/effect/overlay/fog/fog2{
plane = -2
plane = -2;
pixel_y = 0
},
/turf/open/indestructible/ground/outside/road{
color = "#999999"
Expand Down Expand Up @@ -2929,10 +2932,6 @@
light_range = 2;
pixel_y = 13
},
/obj/effect/overlay/fog/fog2{
plane = -2;
alpha = 175
},
/obj/effect/turf_decal/siding/wood{
dir = 1;
color = "#3B2B1A"
Expand All @@ -2941,6 +2940,13 @@
dir = 8;
color = "#3B2B1A"
},
/obj/structure/decoration/clock/active{
pixel_y = 25
},
/obj/effect/overlay/fog/fog2{
plane = -2;
alpha = 175
},
/turf/open/floor/wood_fancy{
color = "#779999"
},
Expand Down Expand Up @@ -2970,10 +2976,14 @@
},
/area/f13/fb/bar)
"qge" = (
/obj/machinery/recycler{
pixel_y = 9;
plane = 0;
density = 0
},
/obj/effect/overlay/fog/fog2{
plane = -2
plane = 1
},
/obj/machinery/recycler,
/turf/open/indestructible/ground/outside/sidewalk{
icon_state = "horizontalbottomborderbottom0"
},
Expand Down Expand Up @@ -3126,7 +3136,6 @@
/obj/effect/overlay/fog/fog2{
plane = -2
},
/obj/machinery/recycler,
/turf/open/indestructible/ground/outside/sidewalk{
icon_state = "horizontalbottomborderbottom2"
},
Expand Down Expand Up @@ -6097,7 +6106,7 @@ ePQ
bPG
bPG
bPG
bPG
cVe
pXS
okV
bPG
Expand Down Expand Up @@ -7753,7 +7762,7 @@ lyo
kcI
hEt
nXE
cVe
wTs
fdf
xfT
uWY
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/coyote_bayou/foxybarupper.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6478,7 +6478,7 @@ sx
dS
dS
dS
nZ
il
il
il
il
Expand Down
2 changes: 2 additions & 0 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@
//Return either pick(list) or null if list is not of type /list or is empty
/proc/safepick(list/L)
if(LAZYLEN(L))
if(!islist(L))
return L
return pick(L)

//Checks if the list is empty
Expand Down
12 changes: 12 additions & 0 deletions code/datums/looping_sounds/ambient_sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,18 @@
SOUND_LOOP_ENTRY('sound/f13ambience/ambiflouriscentlight_1.ogg', 5 SECONDS, 1),
)

/datum/looping_sound/ambient/lightbulb/quiet
chance = 100
vary = FALSE
vary_direction = TRUE
extra_range = SOUND_DISTANCE(2)
volume = SOUND_LOOP_VOL_RANGE(12, 14)
direct = TRUE
loop_delay = 0 SECONDS
mid_sounds = list(
SOUND_LOOP_ENTRY('sound/f13ambience/ambiflouriscentlight_1.ogg', 4.5 SECONDS, 1),
)

/datum/looping_sound/ambient/torch
chance = 100
vary = FALSE
Expand Down
42 changes: 42 additions & 0 deletions code/game/objects/effects/sound_emitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,45 @@
snd = /datum/looping_sound/soundrock/creek
synchronize = TRUE

//Foxybar Soundrocks//

/obj/effect/sound_emitter/foxybar/
name = "sound emitter (creek)"
desc = "Sound emitter for some sort of noise."
icon = 'modular_coyote/icons/objects/c13ammo.dmi'
icon_state = "rock"
snd = /datum/looping_sound/soundrock/foxybar
synchronize = TRUE

/datum/looping_sound/soundrock/foxybar
chance = 100 //% to play per time passing on the sound loop entry, in this case every 1 seconds. If it doesn't get a true then it still uses the last played sounds
vary = TRUE //wink wonk versus wInK wOnK
extra_range = SOUND_DISTANCE(15) //flat out, this is 15 tiles from the sound rock itself
volume = SOUND_LOOP_VOL_RANGE(70, 70)
direct = FALSE
managed = FALSE //true = sound dies when you leave the area, must be direct to use.
loop_delay = 0
mid_sounds = list(
SOUND_LOOP_ENTRY('sound/machines/glassclink.ogg', 1 SECONDS, 1), //sound, how long it plays, weighted play
)

/obj/effect/sound_emitter/foxybar/clock
name = "sound emitter (clock)"
desc = "Sound emitter for some sort of noise."
icon = 'modular_coyote/icons/objects/c13ammo.dmi'
icon_state = "rock"
snd = /datum/looping_sound/soundrock/foxybar/clock
synchronize = TRUE


/datum/looping_sound/soundrock/foxybar/clock
chance = 100 //% to play per time passing on the sound loop entry, in this case every 1 seconds. If it doesn't get a true then it still uses the last played sounds time.
vary = TRUE //wink wonk versus wInK wOnK
extra_range = SOUND_DISTANCE(5) //flat out, this is 15 tiles from the sound rock itself
volume = SOUND_LOOP_VOL_RANGE(4, 8)
direct = FALSE
managed = FALSE //true = sound dies when you leave the area, must be direct to use.
loop_delay = 0
mid_sounds = list(
SOUND_LOOP_ENTRY('sound/machines/clocktick.ogg', 1 SECONDS, 1), //sound, how long it plays, weighted play
)
15 changes: 5 additions & 10 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
var/usesound = null
var/throwhitsound = null
var/equipsound = null
var/tableplacesound = null
var/tableplacesound = 'sound/tableplace.ogg'

/// Weight class for how much storage capacity it uses and how big it physically is meaning storages can't hold it if their maximum weight class isn't as high as it.
var/w_class = WEIGHT_CLASS_NORMAL
Expand Down Expand Up @@ -229,11 +229,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
if(!special_transform && transform != initial(transform))
special_transform = transform

if(!isnull(equipsound))
listify(equipsound)
if(!isnull(tableplacesound))
listify(tableplacesound)

/// CB Dual Wielding
if(force != 0)
if(w_class < DUAL_WIELDING_MAX_WEIGHT_ALLOWED)
Expand Down Expand Up @@ -1308,11 +1303,11 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
return ..()

/obj/item/proc/play_equip_sound(volume=50)
if(!LAZYLEN(equipsound))
if(!equipsound)
return
playsound(src, safepick(equipsound), volume, TRUE)
playsound(src, safepick(equipsound), 100, TRUE)

/obj/item/proc/after_placed_on_table(obj/structure/table, volume=50)
if(!LAZYLEN(tableplacesound))
if(!tableplacesound)
return
playsound(src, safepick(tableplacesound), volume, TRUE)
playsound(src, safepick(tableplacesound), 100, TRUE)
2 changes: 0 additions & 2 deletions code/modules/fallout/areas/area.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
name = "Town"
icon_state = "green"
ambience_area = list(
/datum/looping_sound/ambient/town,

/datum/looping_sound/ambient/swamp/quiet,
/datum/looping_sound/ambient/critters/birds,
/datum/looping_sound/ambient/critters/birds/crow,
Expand Down
1 change: 1 addition & 0 deletions code/modules/food_and_drinks/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
var/foodtype = NONE
var/last_check_time
var/food_quality = 50
tableplacesound = 'sound/tableplace.ogg'

/obj/item/reagent_containers/food/Initialize(mapload)
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/food_and_drinks/food/condiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
volume = 20
list_reagents = list(/datum/reagent/consumable/sodiumchloride = 20)
possible_states = list()


/obj/item/reagent_containers/food/condiment/saltshaker/on_reagent_change(changetype)
if(reagents.reagent_list.len == 0)
Expand Down Expand Up @@ -158,6 +159,7 @@
volume = 20
list_reagents = list(/datum/reagent/consumable/blackpepper = 20)
possible_states = list()


/obj/item/reagent_containers/food/condiment/peppermill/on_reagent_change(changetype)
if(reagents.reagent_list.len == 0)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/power/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@

var/flicker_chance = 100/90 // the chance to flicker every tick (2 seconds) as a percentage;
// 100/90 is once every 90 ticks/three minutes, roughly.
var/datum/looping_sound/ambient/debug3/zzzzhummmmmzzzzzz

/obj/machinery/light/broken
status = LIGHT_BROKEN
Expand Down Expand Up @@ -292,6 +293,14 @@
if(flicker_chance)
START_PROCESSING(SSmachines, src)
RegisterSignal(src, COMSIG_ATOM_LICKED,PROC_REF(lick_light))
zzzzhummmmmzzzzzz = new(list(src), FALSE)
if(!istype(zzzzhummmmmzzzzzz))
zzzzhummmmmzzzzzz = new /datum/looping_sound/ambient/debug3(list(src), FALSE)
if(!istype(zzzzhummmmmzzzzzz))
to_chat(world, span_narsie("FUCK YOU"))
zzzzhummmmmzzzzzz?.start()



/obj/machinery/light/proc/lick_light(atom/A, mob/living/carbon/licker, obj/item/hand_item/tongue)
if(!iscarbon(licker) || !tongue)
Expand Down Expand Up @@ -360,6 +369,7 @@
// A.update_lights()
UnregisterSignal(src, COMSIG_ATOM_LICKED)
QDEL_NULL(cell)
QDEL_NULL(zzzzhummmmmzzzzzz)
return ..()

/obj/machinery/light/update_icon_state()
Expand Down Expand Up @@ -397,6 +407,7 @@
on = FALSE
emergency_mode = FALSE
if(on)
zzzzhummmmmzzzzzz?.start()
var/BR = brightness
var/PO = bulb_power
var/CO = bulb_colour
Expand Down Expand Up @@ -442,6 +453,7 @@
addStaticPower(static_power_used, CHANNEL_STATIC_LIGHT)
else
removeStaticPower(static_power_used, CHANNEL_STATIC_LIGHT)
zzzzhummmmmzzzzzz?.stop()

/obj/machinery/light/update_atom_colour()
. = ..()
Expand Down
Binary file added sound/machines/clocktick.ogg
Binary file not shown.
Binary file added sound/tableplace.ogg
Binary file not shown.

0 comments on commit 88063f3

Please sign in to comment.