mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
@@ -6,11 +6,6 @@
|
||||
/// Max number of playing notes per instrument.
|
||||
#define CHANNELS_PER_INSTRUMENT 128
|
||||
|
||||
/// Distance multiplier that makes us not be impacted by 3d sound as much. This is a multiplier so lower it is the closer we will pretend to be to people.
|
||||
#define INSTRUMENT_DISTANCE_FALLOFF_BUFF 0.2
|
||||
/// How many tiles instruments have no falloff for
|
||||
#define INSTRUMENT_DISTANCE_NO_FALLOFF 3
|
||||
|
||||
/// Maximum length a note should ever go for
|
||||
#define INSTRUMENT_MAX_TOTAL_SUSTAIN (5 SECONDS)
|
||||
|
||||
|
||||
+11
-1
@@ -14,8 +14,18 @@
|
||||
|
||||
#define MAX_INSTRUMENT_CHANNELS (128 * 6)
|
||||
|
||||
///Default range of a sound.
|
||||
#define SOUND_RANGE 17
|
||||
///default extra range for sounds considered to be quieter
|
||||
#define SHORT_RANGE_SOUND_EXTRARANGE -9
|
||||
///The range deducted from sound range for things that are considered silent / sneaky
|
||||
#define SILENCED_SOUND_EXTRARANGE -11
|
||||
///Percentage of sound's range where no falloff is applied
|
||||
#define SOUND_DEFAULT_FALLOFF_DISTANCE 1 //For a normal sound this would be 1 tile of no falloff
|
||||
///The default exponent of sound falloff
|
||||
#define SOUND_FALLOFF_EXPONENT 6
|
||||
|
||||
#define SOUND_MINIMUM_PRESSURE 10
|
||||
#define FALLOFF_SOUNDS 0.5
|
||||
|
||||
#define EQUIP_SOUND_VOLUME 30
|
||||
#define PICKUP_SOUND_VOLUME 15
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
else
|
||||
SEND_SIGNAL(M, COMSIG_ITEM_ATTACK)
|
||||
if(hitsound)
|
||||
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
|
||||
playsound(loc, hitsound, get_clamped_volume(), TRUE, extrarange = stealthy_audio ? SILENCED_SOUND_EXTRARANGE : -1, falloff_distance = 0)
|
||||
|
||||
M.lastattacker = user.real_name
|
||||
M.lastattackerckey = user.ckey
|
||||
|
||||
@@ -251,7 +251,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
SSdbcore.SetRoundStart()
|
||||
to_chat(world, "<span class='darkmblue'><B>Enjoy the game!</B></span>")
|
||||
world << sound('sound/AI/welcome.ogg')
|
||||
SEND_SOUND(world, sound('sound/AI/welcome.ogg'))
|
||||
|
||||
if(SSholiday.holidays)
|
||||
to_chat(world, "<span class='darkmblue'>and...</span>")
|
||||
@@ -325,23 +325,23 @@ SUBSYSTEM_DEF(ticker)
|
||||
if("nuclear emergency") //Nuke wasn't on station when it blew up
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
flick("station_intact_fade_red", cinematic)
|
||||
cinematic.icon_state = "summary_nukefail"
|
||||
if("fake") //The round isn't over, we're just freaking people out for fun
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
world << sound('sound/items/bikehorn.ogg')
|
||||
SEND_SOUND(world, sound('sound/items/bikehorn.ogg'))
|
||||
flick("summary_selfdes", cinematic)
|
||||
else
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
|
||||
|
||||
if(2) //nuke was nowhere nearby //TODO: a really distant explosion animation
|
||||
sleep(50)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
else //station was destroyed
|
||||
if(mode && !override)
|
||||
override = mode.name
|
||||
@@ -350,25 +350,25 @@ SUBSYSTEM_DEF(ticker)
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red", cinematic)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
cinematic.icon_state = "summary_nukewin"
|
||||
if("AI malfunction") //Malf (screen,explosion,summary)
|
||||
flick("intro_malf", cinematic)
|
||||
sleep(76)
|
||||
flick("station_explode_fade_red", cinematic)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
cinematic.icon_state = "summary_malf"
|
||||
if("blob") //Station nuked (nuke,explosion,summary)
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red", cinematic)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
cinematic.icon_state = "summary_selfdes"
|
||||
else //Station nuked (nuke,explosion,summary)
|
||||
flick("intro_nuke", cinematic)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red", cinematic)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
SEND_SOUND(world, sound('sound/effects/explosion_distant.ogg'))
|
||||
cinematic.icon_state = "summary_selfdes"
|
||||
//If its actually the end of the round, wait for it to end.
|
||||
//Otherwise if its a verb it will continue on afterwards.
|
||||
|
||||
@@ -249,11 +249,11 @@ SUBSYSTEM_DEF(vote)
|
||||
You have [config.vote_period/10] seconds to vote.</font>"})
|
||||
switch(vote_type)
|
||||
if("crew_transfer")
|
||||
world << sound('sound/ambience/alarm4.ogg')
|
||||
SEND_SOUND(world, sound('sound/ambience/alarm4.ogg'))
|
||||
if("gamemode")
|
||||
world << sound('sound/ambience/alarm4.ogg')
|
||||
SEND_SOUND(world, sound('sound/ambience/alarm4.ogg'))
|
||||
if("custom")
|
||||
world << sound('sound/ambience/alarm4.ogg')
|
||||
SEND_SOUND(world, sound('sound/ambience/alarm4.ogg'))
|
||||
if(mode == "gamemode" && SSticker.ticker_going)
|
||||
SSticker.ticker_going = FALSE
|
||||
to_chat(world, "<font color='red'><b>Round start has been delayed.</b></font>")
|
||||
|
||||
@@ -12,7 +12,14 @@
|
||||
var/last_use = 0
|
||||
var/use_delay = 20
|
||||
|
||||
/datum/component/squeak/Initialize(custom_sounds, volume_override, chance_override, step_delay_override, use_delay_override, squeak_on_move)
|
||||
///extra-range for this component's sound
|
||||
var/sound_extra_range = -1
|
||||
///when sounds start falling off for the squeak
|
||||
var/sound_falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE
|
||||
///sound exponent for squeak. Defaults to 10 as squeaking is loud and annoying enough.
|
||||
var/sound_falloff_exponent = 10
|
||||
|
||||
/datum/component/squeak/Initialize(custom_sounds, volume_override, chance_override, step_delay_override, use_delay_override, squeak_on_move, extrarange, falloff_exponent, fallof_distance)
|
||||
if(!isatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(parent, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_HULK_ATTACK, COMSIG_PARENT_ATTACKBY), .proc/play_squeak)
|
||||
@@ -39,6 +46,12 @@
|
||||
step_delay = step_delay_override
|
||||
if(isnum(use_delay_override))
|
||||
use_delay = use_delay_override
|
||||
if(isnum(extrarange))
|
||||
sound_extra_range = extrarange
|
||||
if(isnum(falloff_exponent))
|
||||
sound_falloff_exponent = falloff_exponent
|
||||
if(isnum(fallof_distance))
|
||||
sound_falloff_distance = fallof_distance
|
||||
|
||||
/datum/component/squeak/proc/play_squeak()
|
||||
if(ismob(parent))
|
||||
@@ -47,9 +60,9 @@
|
||||
return
|
||||
if(prob(squeak_chance))
|
||||
if(!override_squeak_sounds)
|
||||
playsound(parent, pickweight(default_squeak_sounds), volume, 1, -1)
|
||||
playsound(parent, pickweight(default_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance)
|
||||
else
|
||||
playsound(parent, pickweight(override_squeak_sounds), volume, 1, -1)
|
||||
playsound(parent, pickweight(override_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance)
|
||||
|
||||
/datum/component/squeak/proc/step_squeak()
|
||||
if(steps > step_delay)
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
var/end_sound
|
||||
var/chance
|
||||
var/volume = 100
|
||||
var/muted = TRUE
|
||||
var/vary = FALSE
|
||||
var/max_loops
|
||||
var/direct
|
||||
var/extra_range = 0
|
||||
var/falloff_exponent
|
||||
var/muted = TRUE
|
||||
var/falloff_distance
|
||||
|
||||
/datum/looping_sound/New(list/_output_atoms = list(), start_immediately = FALSE, _direct = FALSE)
|
||||
if(!mid_sounds)
|
||||
@@ -79,7 +82,7 @@
|
||||
if(direct)
|
||||
SEND_SOUND(thing, S)
|
||||
else
|
||||
playsound(thing, S, volume, extrarange = extra_range)
|
||||
playsound(thing, S, volume, vary, extra_range, falloff_exponent = falloff_exponent, falloff_distance = falloff_distance)
|
||||
|
||||
/datum/looping_sound/proc/get_sound(looped, _mid_sounds)
|
||||
if(!_mid_sounds)
|
||||
|
||||
@@ -12,4 +12,7 @@
|
||||
mid_sounds = list('sound/machines/sm/loops/calm.ogg' = 1)
|
||||
mid_length = 60
|
||||
volume = 40
|
||||
extra_range = 10
|
||||
extra_range = 25
|
||||
falloff_exponent = 10
|
||||
falloff_distance = 5
|
||||
vary = TRUE
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
start_sound = 'sound/weather/ashstorm/outside/active_start.ogg'
|
||||
start_length = 130
|
||||
end_sound = 'sound/weather/ashstorm/outside/active_end.ogg'
|
||||
volume = 40
|
||||
volume = 80
|
||||
|
||||
/datum/looping_sound/active_inside_ashstorm
|
||||
mid_sounds = list(
|
||||
@@ -20,7 +20,7 @@
|
||||
start_sound = 'sound/weather/ashstorm/inside/active_start.ogg'
|
||||
start_length = 130
|
||||
end_sound = 'sound/weather/ashstorm/inside/active_end.ogg'
|
||||
volume = 30
|
||||
volume = 60
|
||||
|
||||
/datum/looping_sound/weak_outside_ashstorm
|
||||
mid_sounds = list(
|
||||
@@ -32,7 +32,7 @@
|
||||
start_sound = 'sound/weather/ashstorm/outside/weak_start.ogg'
|
||||
start_length = 130
|
||||
end_sound = 'sound/weather/ashstorm/outside/weak_end.ogg'
|
||||
volume = 20
|
||||
volume = 50
|
||||
|
||||
/datum/looping_sound/weak_inside_ashstorm
|
||||
mid_sounds = list(
|
||||
@@ -44,4 +44,4 @@
|
||||
start_sound = 'sound/weather/ashstorm/inside/weak_start.ogg'
|
||||
start_length = 130
|
||||
end_sound = 'sound/weather/ashstorm/inside/weak_end.ogg'
|
||||
volume = 10
|
||||
volume = 30
|
||||
|
||||
@@ -165,7 +165,7 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event
|
||||
if(!message_sound)
|
||||
return
|
||||
for(var/mob/M in receivers)
|
||||
M << message_sound
|
||||
SEND_SOUND(M, message_sound)
|
||||
|
||||
/datum/announcement/proc/Log(message as text, message_title as text)
|
||||
if(log)
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
receivers |= M
|
||||
for(var/mob/R in receivers)
|
||||
to_chat(R, msg_text)
|
||||
R << sound('sound/misc/notice1.ogg')
|
||||
SEND_SOUND(R, sound('sound/misc/notice1.ogg'))
|
||||
|
||||
/area/syndicate_depot/core/proc/shields_up()
|
||||
if(shield_list.len)
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
M.AdjustConfused(20)
|
||||
M.Jitter(50)
|
||||
else
|
||||
M << sound('sound/effects/screech.ogg')
|
||||
SEND_SOUND(M, sound('sound/effects/screech.ogg'))
|
||||
|
||||
if(issilicon(M))
|
||||
M << sound('sound/weapons/flash.ogg')
|
||||
SEND_SOUND(M, sound('sound/weapons/flash.ogg'))
|
||||
M.Weaken(rand(5,10))
|
||||
|
||||
for(var/obj/machinery/light/L in range(4, user))
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
if(current_charges)
|
||||
owner.visible_message("<span class='danger'>[attack_text] is deflected in a burst of blood-red sparks!</span>")
|
||||
current_charges--
|
||||
playsound(loc, "sparks", 100, TRUE)
|
||||
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new /obj/effect/temp_visual/cult/sparks(get_turf(owner))
|
||||
if(!current_charges)
|
||||
owner.visible_message("<span class='danger'>The runed shield around [owner] suddenly disappears!</span>")
|
||||
@@ -355,7 +355,7 @@
|
||||
var/turf/destination = pick(turfs)
|
||||
if(uses <= 0)
|
||||
icon_state ="shifter_drained"
|
||||
playsound(mobloc, "sparks", 50, TRUE)
|
||||
playsound(mobloc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new /obj/effect/temp_visual/dir_setting/cult/phase/out(mobloc, C.dir)
|
||||
|
||||
var/atom/movable/pulled = handle_teleport_grab(destination, C)
|
||||
@@ -364,8 +364,8 @@
|
||||
C.start_pulling(pulled) //forcemove resets pulls, so we need to re-pull
|
||||
|
||||
new /obj/effect/temp_visual/dir_setting/cult/phase(destination, C.dir)
|
||||
playsound(destination, 'sound/effects/phasein.ogg', 25, TRUE)
|
||||
playsound(destination, "sparks", 50, TRUE)
|
||||
playsound(destination, 'sound/effects/phasein.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
else
|
||||
to_chat(C, "<span class='danger'>The veil cannot be torn here!</span>")
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
/obj/item/organ/internal/heart/gland/electric/activate()
|
||||
owner.visible_message("<span class='danger'>[owner]'s skin starts emitting electric arcs!</span>",\
|
||||
"<span class='warning'>You feel electric energy building up inside you!</span>")
|
||||
playsound(get_turf(owner), "sparks", 100, 1, -1)
|
||||
playsound(get_turf(owner), "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
addtimer(CALLBACK(src, .proc/zap), rand(30, 100))
|
||||
|
||||
/obj/item/organ/internal/heart/gland/electric/proc/zap()
|
||||
|
||||
@@ -559,7 +559,7 @@
|
||||
|
||||
/obj/effect/temp_visual/swarmer/disintegration/Initialize(mapload)
|
||||
. = ..()
|
||||
playsound(loc, "sparks", 100, TRUE)
|
||||
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
/obj/effect/temp_visual/swarmer/dismantle
|
||||
icon_state = "dismantle"
|
||||
|
||||
@@ -532,7 +532,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\
|
||||
message += "<b>Agony blazes across your consciousness as your body is torn apart.</b><br>"
|
||||
message += "<i>Is this what dying is like? Yes it is.</i>"
|
||||
to_chat(occupant, "<span class='warning'>[message]</span>")
|
||||
occupant << sound('sound/hallucinations/veryfar_noise.ogg',0,1,50)
|
||||
SEND_SOUND(occupant, sound('sound/hallucinations/veryfar_noise.ogg', 0, 1, 50))
|
||||
for(var/i in missing_organs)
|
||||
qdel(i)
|
||||
missing_organs.Cut()
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
blocked = 1
|
||||
var/attackamt = rand(2,6)
|
||||
temp = "You attack for [attackamt] damage!"
|
||||
playsound(src.loc, 'sound/arcade/hit.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE)
|
||||
updateUsrDialog()
|
||||
if(turtle > 0)
|
||||
turtle--
|
||||
@@ -127,7 +127,7 @@
|
||||
var/pointamt = rand(1,3)
|
||||
var/healamt = rand(6,8)
|
||||
temp = "You use [pointamt] magic to heal for [healamt] damage!"
|
||||
playsound(src.loc, 'sound/arcade/heal.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE)
|
||||
updateUsrDialog()
|
||||
turtle++
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
blocked = 1
|
||||
var/chargeamt = rand(4,7)
|
||||
temp = "You regain [chargeamt] points"
|
||||
playsound(src.loc, 'sound/arcade/mana.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/mana.ogg', 50, TRUE)
|
||||
player_mp += chargeamt
|
||||
if(turtle > 0)
|
||||
turtle--
|
||||
@@ -177,7 +177,7 @@
|
||||
if(!gameover)
|
||||
gameover = 1
|
||||
temp = "[enemy_name] has fallen! Rejoice!"
|
||||
playsound(src.loc, 'sound/arcade/win.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/win.ogg', 50, TRUE)
|
||||
|
||||
if(emagged)
|
||||
SSblackbox.record_feedback("tally", "arcade_status", 1, "win_emagged")
|
||||
@@ -195,13 +195,13 @@
|
||||
else if(emagged && (turtle >= 4))
|
||||
var/boomamt = rand(5,10)
|
||||
temp = "[enemy_name] throws a bomb, exploding you for [boomamt] damage!"
|
||||
playsound(src.loc, 'sound/arcade/boom.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/boom.ogg', 50, TRUE)
|
||||
player_hp -= boomamt
|
||||
|
||||
else if((enemy_mp <= 5) && (prob(70)))
|
||||
var/stealamt = rand(2,3)
|
||||
temp = "[enemy_name] steals [stealamt] of your power!"
|
||||
playsound(src.loc, 'sound/arcade/steal.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/steal.ogg', 50, TRUE)
|
||||
player_mp -= stealamt
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
gameover = 1
|
||||
sleep(10)
|
||||
temp = "You have been drained! GAME OVER"
|
||||
playsound(src.loc, 'sound/arcade/lose.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE)
|
||||
if(emagged)
|
||||
SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_mana_emagged")
|
||||
usr.gib()
|
||||
@@ -218,20 +218,20 @@
|
||||
|
||||
else if((enemy_hp <= 10) && (enemy_mp > 4))
|
||||
temp = "[enemy_name] heals for 4 health!"
|
||||
playsound(src.loc, 'sound/arcade/heal.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE)
|
||||
enemy_hp += 4
|
||||
enemy_mp -= 4
|
||||
|
||||
else
|
||||
var/attackamt = rand(3,6)
|
||||
temp = "[enemy_name] attacks for [attackamt] damage!"
|
||||
playsound(src.loc, 'sound/arcade/hit.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE)
|
||||
player_hp -= attackamt
|
||||
|
||||
if((player_mp <= 0) || (player_hp <= 0))
|
||||
gameover = 1
|
||||
temp = "You have been crushed! GAME OVER"
|
||||
playsound(src.loc, 'sound/arcade/lose.ogg', 20, 1, extrarange = -6, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE)
|
||||
if(emagged)
|
||||
SSblackbox.record_feedback("tally", "arcade_status", 1, "loss_hp_emagged")
|
||||
usr.gib()
|
||||
@@ -451,7 +451,7 @@
|
||||
else
|
||||
to_chat(usr, "<span class='userdanger'>Something strikes you from behind! It hurts like hell and feel like a blunt weapon, but nothing is there...</span>")
|
||||
M.take_organ_damage(30)
|
||||
playsound(loc, 'sound/weapons/genhit2.ogg', 100, 1)
|
||||
playsound(loc, 'sound/weapons/genhit2.ogg', 100, TRUE)
|
||||
if(ORION_TRAIL_ILLNESS)
|
||||
var/severity = rand(1,3) //pray to RNGesus. PRAY, PIGS
|
||||
if(severity == 1)
|
||||
@@ -465,7 +465,7 @@
|
||||
M.Stun(5)
|
||||
sleep(30)
|
||||
atom_say("[M] violently throws up!")
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, TRUE)
|
||||
M.adjust_nutrition(-50) //lose a lot of food
|
||||
var/turf/location = usr.loc
|
||||
if(istype(location, /turf/simulated))
|
||||
@@ -475,12 +475,12 @@
|
||||
M.Weaken(3)
|
||||
atom_say("A sudden gust of powerful wind slams [M] into the floor!")
|
||||
M.take_organ_damage(25)
|
||||
playsound(src.loc, 'sound/weapons/genhit.ogg', 100, 1)
|
||||
playsound(loc, 'sound/weapons/genhit.ogg', 100, TRUE)
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>A violent gale blows past you, and you barely manage to stay standing!</span>")
|
||||
if(ORION_TRAIL_COLLISION) //by far the most damaging event
|
||||
if(prob(90))
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 100, 1)
|
||||
playsound(loc, 'sound/effects/bang.ogg', 100, TRUE)
|
||||
var/turf/simulated/floor/F
|
||||
for(F in orange(1, src))
|
||||
F.ChangeTurf(F.baseturf)
|
||||
@@ -488,15 +488,15 @@
|
||||
if(hull)
|
||||
sleep(10)
|
||||
atom_say("A new floor suddenly appears around [src]. What the hell?")
|
||||
playsound(src.loc, 'sound/weapons/genhit.ogg', 100, 1)
|
||||
playsound(loc, 'sound/weapons/genhit.ogg', 100, TRUE)
|
||||
var/turf/space/T
|
||||
for(T in orange(1, src))
|
||||
T.ChangeTurf(/turf/simulated/floor/plating)
|
||||
else
|
||||
atom_say("Something slams into the floor around [src] - luckily, it didn't get through!")
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 20, 1)
|
||||
playsound(loc, 'sound/effects/bang.ogg', 50, TRUE)
|
||||
if(ORION_TRAIL_MALFUNCTION)
|
||||
playsound(src.loc, 'sound/effects/empulse.ogg', 20, 1)
|
||||
playsound(loc, 'sound/effects/empulse.ogg', 50, TRUE)
|
||||
visible_message("<span class='danger'>[src] malfunctions, randomizing in-game stats!</span>")
|
||||
var/oldfood = food
|
||||
var/oldfuel = fuel
|
||||
@@ -510,7 +510,7 @@
|
||||
audible_message("<span class='danger'>[src] lets out a somehow ominous chime.</span>")
|
||||
food = oldfood
|
||||
fuel = oldfuel
|
||||
playsound(src.loc, 'sound/machines/chime.ogg', 20, 1)
|
||||
playsound(loc, 'sound/machines/chime.ogg', 50, TRUE)
|
||||
|
||||
else if(href_list["newgame"]) //Reset everything
|
||||
newgame()
|
||||
@@ -553,7 +553,7 @@
|
||||
event = ORION_TRAIL_BLACKHOLE
|
||||
event()
|
||||
if(emagged) //has to be here because otherwise it doesn't work
|
||||
playsound(src.loc, 'sound/effects/supermatter.ogg', 100, 1)
|
||||
playsound(loc, 'sound/effects/supermatter.ogg', 100, TRUE)
|
||||
atom_say("A miniature black hole suddenly appears in front of [src], devouring [usr] alive!")
|
||||
usr.Stun(10) //you can't run :^)
|
||||
var/S = new /obj/singularity/academy(usr.loc)
|
||||
@@ -574,7 +574,7 @@
|
||||
if(length(settlers) <= 0 || alive <= 0)
|
||||
return
|
||||
var/sheriff = remove_crewmember() //I shot the sheriff
|
||||
playsound(loc, 'sound/weapons/gunshots/gunshot.ogg', 100, 1)
|
||||
playsound(loc, 'sound/weapons/gunshots/gunshot.ogg', 100, TRUE)
|
||||
|
||||
if(length(settlers) == 0 || alive == 0)
|
||||
atom_say("The last crewmember [sheriff], shot themselves, GAME OVER!")
|
||||
@@ -998,14 +998,14 @@
|
||||
to_chat(user, "<span class='warning'>You flip the switch on the underside of [src].</span>")
|
||||
active = 1
|
||||
visible_message("<span class='notice'>[src] softly beeps and whirs to life!</span>")
|
||||
playsound(src.loc, 'sound/machines/defib_saftyon.ogg', 25, 1)
|
||||
playsound(loc, 'sound/machines/defib_saftyon.ogg', 25, TRUE)
|
||||
atom_say("This is ship ID #[rand(1,1000)] to Orion Port Authority. We're coming in for landing, over.")
|
||||
sleep(20)
|
||||
visible_message("<span class='warning'>[src] begins to vibrate...</span>")
|
||||
atom_say("Uh, Port? Having some issues with our reactor, could you check it out? Over.")
|
||||
sleep(30)
|
||||
atom_say("Oh, God! Code Eight! CODE EIGHT! IT'S GONNA BL-")
|
||||
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 1)
|
||||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 25, TRUE)
|
||||
sleep(3.6)
|
||||
visible_message("<span class='userdanger'>[src] explodes!</span>")
|
||||
explosion(src.loc, 1,2,4, flame_range = 3)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
emagged = 1
|
||||
req_access = list()
|
||||
req_one_access = list()
|
||||
playsound(loc, "sparks", 100, 1)
|
||||
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
/obj/machinery/door_control/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
emagged = TRUE
|
||||
operating = TRUE
|
||||
flick("[base_state]spark", src)
|
||||
playsound(src, "sparks", 75, 1)
|
||||
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
sleep(6)
|
||||
operating = FALSE
|
||||
open(2)
|
||||
|
||||
@@ -132,9 +132,9 @@
|
||||
linked_pad.sparks()
|
||||
|
||||
flick("qpad-beam", src)
|
||||
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
|
||||
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
|
||||
flick("qpad-beam", linked_pad)
|
||||
playsound(get_turf(linked_pad), 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
|
||||
playsound(get_turf(linked_pad), 'sound/weapons/emitter2.ogg', 25, TRUE)
|
||||
var/tele_success = TRUE
|
||||
for(var/atom/movable/ROI in get_turf(src))
|
||||
// if is anchored, don't let through
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(emergency_mode)
|
||||
emergency_mode = FALSE
|
||||
update_icon()
|
||||
playsound(loc, "sparks", 75, 1, -1)
|
||||
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
to_chat(user, "<span class='notice'>You use the cryptographic sequencer on the [name].</span>")
|
||||
|
||||
/obj/machinery/recycler/update_icon()
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
if(!emagged)
|
||||
emagged = TRUE
|
||||
to_chat(user, "<span class='notice'>You slide the card through [src]'s ID slot.</span>")
|
||||
playsound(loc, "sparks", 100, 1)
|
||||
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
desc += "</br><span class='danger'>The mech's equipment slots spark dangerously!</span>"
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src]'s ID slot rejects the card.</span>")
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/obj/effect/particle_effect/sparks/New()
|
||||
..()
|
||||
flick("sparks", src) // replay the animation
|
||||
playsound(loc, "sparks", 100, 1)
|
||||
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
var/turf/T = loc
|
||||
if(isturf(T))
|
||||
T.hotspot_expose(hotspottemp, 100)
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
//TODO: Flash range does nothing currently
|
||||
|
||||
#define CREAK_DELAY 5 SECONDS //Time taken for the creak to play after explosion, if applicable.
|
||||
#define DEVASTATION_PROB 30 //The probability modifier for devistation, maths!
|
||||
#define HEAVY_IMPACT_PROB 5 //ditto
|
||||
#define FAR_UPPER 60 //Upper limit for the far_volume, distance, clamped.
|
||||
#define FAR_LOWER 40 //lower limit for the far_volume, distance, clamped.
|
||||
#define PROB_SOUND 75 //The probability modifier for a sound to be an echo, or a far sound. (0-100)
|
||||
#define SHAKE_CLAMP 2.5 //The limit for how much the camera can shake for out of view booms.
|
||||
#define FREQ_UPPER 40 //The upper limit for the randomly selected frequency.
|
||||
#define FREQ_LOWER 25 //The lower of the above.
|
||||
|
||||
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0, silent = 0, smoke = 1, cause = null, breach = TRUE)
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter)
|
||||
return
|
||||
|
||||
// Archive the uncapped explosion for the doppler array
|
||||
var/orig_dev_range = devastation_range
|
||||
var/orig_heavy_range = heavy_impact_range
|
||||
var/orig_light_range = light_impact_range
|
||||
|
||||
var/orig_max_distance = max(devastation_range, heavy_impact_range, light_impact_range, flash_range, flame_range)
|
||||
|
||||
if(!ignorecap)
|
||||
// Clamp all values to MAX_EXPLOSION_RANGE
|
||||
devastation_range = min (GLOB.max_ex_devastation_range, devastation_range)
|
||||
@@ -16,17 +30,21 @@
|
||||
flash_range = min (GLOB.max_ex_flash_range, flash_range)
|
||||
flame_range = min (GLOB.max_ex_flame_range, flame_range)
|
||||
|
||||
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
|
||||
|
||||
spawn(0)
|
||||
var/watch = start_watch()
|
||||
if(!epicenter) return
|
||||
|
||||
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
|
||||
var/list/cached_exp_block = list()
|
||||
|
||||
if(adminlog)
|
||||
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] [cause ? "(Cause: [cause])" : ""] [ADMIN_COORDJMP(epicenter)] ")
|
||||
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] [cause ? "(Cause: [cause])" : ""] [COORD(epicenter)] ")
|
||||
|
||||
var/x0 = epicenter.x
|
||||
var/y0 = epicenter.y
|
||||
var/z0 = epicenter.z
|
||||
|
||||
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
|
||||
// Stereo users will also hear the direction of the explosion!
|
||||
|
||||
@@ -34,41 +52,69 @@
|
||||
// 3/7/14 will calculate to 80 + 35
|
||||
|
||||
var/far_dist = 0
|
||||
far_dist += heavy_impact_range * 5
|
||||
far_dist += heavy_impact_range * 15
|
||||
far_dist += devastation_range * 20
|
||||
|
||||
if(!silent)
|
||||
var/frequency = get_rand_frequency()
|
||||
var/sound/explosion_sound = sound(get_sfx("explosion"))
|
||||
var/sound/global_boom = sound('sound/effects/explosionfar.ogg')
|
||||
var/sound/far_explosion_sound = sound('sound/effects/explosionfar.ogg')
|
||||
var/sound/creaking_explosion_sound = sound(get_sfx("explosion_creaking"))
|
||||
var/sound/hull_creaking_sound = sound(get_sfx("hull_creaking"))
|
||||
var/sound/explosion_echo_sound = sound('sound/effects/explosion_distant.ogg')
|
||||
var/on_station = is_station_level(epicenter.z)
|
||||
var/creaking_explosion = FALSE
|
||||
|
||||
for(var/P in GLOB.player_list)
|
||||
var/mob/M = P
|
||||
if(prob(devastation_range * DEVASTATION_PROB + heavy_impact_range * HEAVY_IMPACT_PROB) && on_station) // Huge explosions are near guaranteed to make the station creak and whine, smaller ones might.
|
||||
creaking_explosion = TRUE // prob over 100 always returns true
|
||||
|
||||
for(var/MN in GLOB.player_list)
|
||||
var/mob/M = MN
|
||||
// Double check for client
|
||||
if(M && M.client)
|
||||
var/turf/M_turf = get_turf(M)
|
||||
if(M_turf && M_turf.z == epicenter.z)
|
||||
var/dist = get_dist(M_turf, epicenter)
|
||||
// If inside the blast radius + world.view - 2
|
||||
if(dist <= round(max_range + world.view - 2, 1))
|
||||
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
|
||||
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
|
||||
else if(M.can_hear() && !isspaceturf(M.loc))
|
||||
M << global_boom
|
||||
var/turf/M_turf = get_turf(M)
|
||||
if(M_turf && M_turf.z == z0)
|
||||
var/dist = get_dist(M_turf, epicenter)
|
||||
var/baseshakeamount
|
||||
if(orig_max_distance - dist > 0)
|
||||
baseshakeamount = sqrt((orig_max_distance - dist) * 0.1)
|
||||
// If inside the blast radius + world.view - 2
|
||||
if(dist <= round(max_range + world.view - 2, 1))
|
||||
M.playsound_local(epicenter, null, 100, 1, frequency, S = explosion_sound)
|
||||
if(baseshakeamount > 0)
|
||||
shake_camera(M, 25, clamp(baseshakeamount, 0, 10))
|
||||
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
|
||||
else if(dist <= far_dist)
|
||||
var/far_volume = clamp(far_dist / 2, FAR_LOWER, FAR_UPPER) // Volume is based on explosion size and dist
|
||||
if(creaking_explosion)
|
||||
M.playsound_local(epicenter, null, far_volume, 1, frequency, S = creaking_explosion_sound, distance_multiplier = 0)
|
||||
else if(prob(PROB_SOUND)) // Sound variety during meteor storm/tesloose/other bad event
|
||||
M.playsound_local(epicenter, null, far_volume, 1, frequency, S = far_explosion_sound, distance_multiplier = 0) // Far sound
|
||||
else
|
||||
M.playsound_local(epicenter, null, far_volume, 1, frequency, S = explosion_echo_sound, distance_multiplier = 0) // Echo sound
|
||||
|
||||
if(baseshakeamount > 0 || devastation_range)
|
||||
if(!baseshakeamount) // Devastating explosions rock the station and ground
|
||||
baseshakeamount = devastation_range * 3
|
||||
shake_camera(M, 10, clamp(baseshakeamount * 0.25, 0, SHAKE_CLAMP))
|
||||
else if(!isspaceturf(get_turf(M)) && heavy_impact_range) // Big enough explosions echo throughout the hull
|
||||
var/echo_volume = 40
|
||||
if(devastation_range)
|
||||
baseshakeamount = devastation_range
|
||||
shake_camera(M, 10, clamp(baseshakeamount * 0.25, 0, SHAKE_CLAMP))
|
||||
echo_volume = 60
|
||||
M.playsound_local(epicenter, null, echo_volume, 1, frequency, S = explosion_echo_sound, distance_multiplier = 0)
|
||||
|
||||
if(creaking_explosion) // 5 seconds after the bang, the station begins to creak
|
||||
addtimer(CALLBACK(M, /mob/proc/playsound_local, epicenter, null, rand(FREQ_LOWER, FREQ_UPPER), 1, frequency, null, null, FALSE, hull_creaking_sound, 0), CREAK_DELAY)
|
||||
|
||||
if(heavy_impact_range > 1)
|
||||
var/datum/effect_system/explosion/E
|
||||
if(smoke)
|
||||
var/datum/effect_system/explosion/smoke/E = new/datum/effect_system/explosion/smoke()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
E = new /datum/effect_system/explosion/smoke
|
||||
else
|
||||
var/datum/effect_system/explosion/E = new/datum/effect_system/explosion()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
|
||||
var/x0 = epicenter.x
|
||||
var/y0 = epicenter.y
|
||||
var/z0 = epicenter.z
|
||||
E = new
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
|
||||
var/list/affected_turfs = spiral_range_turfs(max_range, epicenter)
|
||||
|
||||
@@ -226,3 +272,13 @@
|
||||
for(var/turf/T in wipe_colours)
|
||||
T.color = null
|
||||
T.maptext = ""
|
||||
|
||||
#undef CREAK_DELAY
|
||||
#undef DEVASTATION_PROB
|
||||
#undef HEAVY_IMPACT_PROB
|
||||
#undef FAR_UPPER
|
||||
#undef FAR_LOWER
|
||||
#undef PROB_SOUND
|
||||
#undef SHAKE_CLAMP
|
||||
#undef FREQ_UPPER
|
||||
#undef FREQ_LOWER
|
||||
|
||||
@@ -33,6 +33,8 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
|
||||
var/pickup_sound
|
||||
///Sound uses when dropping the item, or when its thrown.
|
||||
var/drop_sound
|
||||
///Whether or not we use stealthy audio levels for this item's attack sounds
|
||||
var/stealthy_audio = FALSE
|
||||
|
||||
var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
|
||||
var/w_class = WEIGHT_CLASS_NORMAL
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
/obj/item/lightreplacer/proc/Emag()
|
||||
emagged = !emagged
|
||||
playsound(loc, "sparks", 100, TRUE)
|
||||
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
if(emagged)
|
||||
name = "shortcircuited [initial(name)]"
|
||||
else
|
||||
|
||||
@@ -254,9 +254,9 @@ effective or pretty fucking useless.
|
||||
var/turf/fragging_location = destination
|
||||
telefrag(fragging_location, user)
|
||||
C.forceMove(destination)
|
||||
playsound(mobloc, "sparks", 50, TRUE)
|
||||
playsound(mobloc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc)
|
||||
playsound(destination, "sparks", 50, TRUE)
|
||||
playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(destination)
|
||||
else if (EMP_D == FALSE && !(bagholding.len && !flawless)) // This is where the fun begins
|
||||
var/direction = get_dir(user, destination)
|
||||
@@ -315,10 +315,10 @@ effective or pretty fucking useless.
|
||||
var/turf/fragging_location = new_destination
|
||||
telefrag(fragging_location, user)
|
||||
C.forceMove(new_destination)
|
||||
playsound(mobloc, "sparks", 50, TRUE)
|
||||
playsound(mobloc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new /obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc)
|
||||
new /obj/effect/temp_visual/teleport_abductor/syndi_teleporter(new_destination)
|
||||
playsound(new_destination, "sparks", 50, TRUE)
|
||||
playsound(new_destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
else //We tried to save. We failed. Death time.
|
||||
get_fragged(user, destination)
|
||||
|
||||
@@ -326,10 +326,10 @@ effective or pretty fucking useless.
|
||||
/obj/item/teleporter/proc/get_fragged(mob/user, turf/destination)
|
||||
var/turf/mobloc = get_turf(user)
|
||||
user.forceMove(destination)
|
||||
playsound(mobloc, "sparks", 50, TRUE)
|
||||
playsound(mobloc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new /obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc)
|
||||
new /obj/effect/temp_visual/teleport_abductor/syndi_teleporter(destination)
|
||||
playsound(destination, "sparks", 50, TRUE)
|
||||
playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
playsound(destination, "sound/magic/disintegrate.ogg", 50, TRUE)
|
||||
destination.ex_act(rand(1,2))
|
||||
for(var/obj/item/W in user)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/obj/item/bikehorn/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/squeak, honk_sounds, 50)
|
||||
AddComponent(/datum/component/squeak, honk_sounds, 50, falloff_exponent = 20) //die off quick please
|
||||
|
||||
/obj/item/bikehorn/airhorn
|
||||
name = "air horn"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var/throwforce_on = 20
|
||||
var/faction_bonus_force = 0 //Bonus force dealt against certain factions
|
||||
var/list/nemesis_factions //Any mob with a faction that exists in this list will take bonus damage/effects
|
||||
stealthy_audio = TRUE //Most of these are antag weps so we dont want them to be /too/ overt.
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
var/w_class_on = WEIGHT_CLASS_BULKY
|
||||
var/icon_state_on
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(istype(weapon, /obj/item/melee/energy/blade))
|
||||
do_sparks(5, 0, loc)
|
||||
playsound(loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(loc, "sparks", 50, 1)
|
||||
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
to_chat(user, "You slice through the lock on [src].")
|
||||
else
|
||||
to_chat(user, "You short out the lock on [src].")
|
||||
|
||||
@@ -728,7 +728,7 @@
|
||||
if(wielded)
|
||||
//if(charged == 5)
|
||||
//charged = 0
|
||||
playsound(loc, "sparks", 50, 1)
|
||||
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
if(isliving(M))
|
||||
M.Stun(3)
|
||||
shock(M)
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
if(locked)
|
||||
overlays += sparks
|
||||
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
|
||||
playsound(src.loc, "sparks", 60, 1)
|
||||
playsound(src.loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
src.locked = 0
|
||||
src.broken = 1
|
||||
update_icon()
|
||||
|
||||
+38
-8
@@ -23,14 +23,34 @@
|
||||
)
|
||||
environment = SOUND_ENVIRONMENT_NONE //Default to none so sounds without overrides dont get reverb
|
||||
|
||||
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, use_reverb = TRUE)
|
||||
/*! playsound
|
||||
|
||||
playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.
|
||||
|
||||
source - Origin of sound
|
||||
soundin - Either a file, or a string that can be used to get an SFX
|
||||
vol - The volume of the sound, excluding falloff and pressure affection.
|
||||
vary - bool that determines if the sound changes pitch every time it plays
|
||||
extrarange - modifier for sound range. This gets added on top of SOUND_RANGE
|
||||
falloff_exponent - Rate of falloff for the audio. Higher means quicker drop to low volume. Should generally be over 1 to indicate a quick dive to 0 rather than a slow dive.
|
||||
frequency - playback speed of audio
|
||||
channel - The channel the sound is played at
|
||||
pressure_affected - Whether or not difference in pressure affects the sound (E.g. if you can hear in space)
|
||||
ignore_walls - Whether or not the sound can pass through walls.
|
||||
falloff_distance - Distance at which falloff begins. Sound is at peak volume (in regards to falloff) aslong as it is in this range.
|
||||
|
||||
*/
|
||||
|
||||
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff_exponent = SOUND_FALLOFF_EXPONENT, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, use_reverb = TRUE)
|
||||
if(isarea(source))
|
||||
error("[source] is an area and is trying to make the sound: [soundin]")
|
||||
return
|
||||
|
||||
var/turf/turf_source = get_turf(source)
|
||||
|
||||
if(!turf_source)
|
||||
return
|
||||
|
||||
if(!SSsounds.channel_list) // Not ready yet
|
||||
return
|
||||
|
||||
@@ -39,10 +59,12 @@
|
||||
|
||||
// Looping through the player list has the added bonus of working for mobs inside containers
|
||||
var/sound/S = sound(get_sfx(soundin))
|
||||
var/maxdistance = (world.view + extrarange) * 3
|
||||
var/maxdistance = SOUND_RANGE + extrarange
|
||||
|
||||
var/list/listeners = GLOB.player_list
|
||||
if(!ignore_walls) //these sounds don't carry through walls
|
||||
listeners = listeners & hearers(maxdistance, turf_source)
|
||||
|
||||
for(var/P in listeners)
|
||||
var/mob/M = P
|
||||
if(!M || !M.client)
|
||||
@@ -57,9 +79,9 @@
|
||||
var/distance = get_dist(M, turf_source)
|
||||
|
||||
if(distance <= maxdistance)
|
||||
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, 1, use_reverb)
|
||||
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance, 1, use_reverb)
|
||||
|
||||
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, channel = 0, pressure_affected = TRUE, sound/S, distance_multiplier = 1, use_reverb = TRUE)
|
||||
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1, use_reverb = TRUE)
|
||||
if(!client || !can_hear())
|
||||
return
|
||||
|
||||
@@ -84,9 +106,12 @@
|
||||
|
||||
//sound volume falloff with distance
|
||||
var/distance = get_dist(T, turf_source)
|
||||
|
||||
distance *= distance_multiplier
|
||||
|
||||
S.volume -= max(distance - world.view, 0) * 2 //multiplicative falloff to add on top of natural audio falloff.
|
||||
if(max_distance) //If theres no max_distance we're not a 3D sound, so no falloff.
|
||||
S.volume -= (max(distance - falloff_distance, 0) ** (1 / falloff_exponent)) / ((max(max_distance, distance) - falloff_distance) ** (1 / falloff_exponent)) * S.volume
|
||||
//https://www.desmos.com/calculator/sqdfl8ipgf
|
||||
|
||||
if(pressure_affected)
|
||||
//Atmosphere affects sound
|
||||
@@ -116,7 +141,8 @@
|
||||
S.z = dz * distance_multiplier
|
||||
// The y value is for above your head, but there is no ceiling in 2d spessmens.
|
||||
S.y = 1
|
||||
S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)
|
||||
|
||||
S.falloff = max_distance || 1 //use max_distance, else just use 1 as we are a direct sound so falloff isnt relevant.
|
||||
|
||||
// Sounds can't have their own environment. A sound's environment will be:
|
||||
// 1. the mob's
|
||||
@@ -133,13 +159,13 @@
|
||||
|
||||
SEND_SOUND(src, S)
|
||||
|
||||
/proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, falloff = FALSE, channel = 0, pressure_affected = FALSE, sound/S)
|
||||
/proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, channel = 0, pressure_affected = FALSE, sound/S)
|
||||
if(!S)
|
||||
S = sound(get_sfx(soundin))
|
||||
for(var/m in GLOB.player_list)
|
||||
if(ismob(m) && !isnewplayer(m))
|
||||
var/mob/M = m
|
||||
M.playsound_local(M, null, volume, vary, frequency, falloff, channel, pressure_affected, S)
|
||||
M.playsound_local(M, null, volume, vary, frequency, null, channel, pressure_affected, S)
|
||||
|
||||
/mob/proc/stop_sound_channel(chan)
|
||||
SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = chan))
|
||||
@@ -165,6 +191,10 @@
|
||||
soundin = pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg')
|
||||
if("explosion")
|
||||
soundin = pick('sound/effects/explosion1.ogg','sound/effects/explosion2.ogg')
|
||||
if("explosion_creaking")
|
||||
soundin = pick('sound/effects/explosioncreak1.ogg', 'sound/effects/explosioncreak2.ogg')
|
||||
if("hull_creaking")
|
||||
soundin = pick('sound/effects/creak1.ogg', 'sound/effects/creak2.ogg', 'sound/effects/creak3.ogg')
|
||||
if("sparks")
|
||||
soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
|
||||
if("rustle")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(opening)
|
||||
return
|
||||
opening = 1
|
||||
playsound(src.loc, 'sound/items/bubblewrap.ogg', 30, 1, extrarange = -4, falloff = 10)
|
||||
playsound(loc, 'sound/items/bubblewrap.ogg', 30, TRUE)
|
||||
icon_state = "prizeconfetti"
|
||||
src.color = pick(GLOB.random_color_list)
|
||||
var/prize_inside = pick(possible_contents)
|
||||
|
||||
@@ -57,7 +57,7 @@ GLOBAL_VAR(claw_game_html)
|
||||
else
|
||||
atom_say("WINNER!")
|
||||
new /obj/item/toy/prizeball(get_turf(src))
|
||||
playsound(src.loc, 'sound/arcade/win.ogg', 50, 1, extrarange = -3, falloff = 10)
|
||||
playsound(loc, 'sound/arcade/win.ogg', 50, TRUE)
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 10)
|
||||
|
||||
/obj/machinery/arcade/claw/start_play(mob/user as mob)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
/obj/item/clothing/under/rank/clown/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50)
|
||||
AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50, falloff_exponent = 20) //die off quick please
|
||||
|
||||
/obj/item/clothing/under/rank/clown/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
if(ishuman(loc))
|
||||
|
||||
@@ -91,5 +91,5 @@
|
||||
var/mob/M = i
|
||||
if(!(M.client?.prefs?.sound & SOUND_INSTRUMENTS))
|
||||
continue
|
||||
M.playsound_local(source, null, volume * using_instrument.volume_multiplier, falloff = 5, S = music_played)
|
||||
M.playsound_local(source, null, volume * using_instrument.volume_multiplier, S = music_played)
|
||||
// Could do environment and echo later but not for now
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
var/mob/M = i
|
||||
if(!(M.client?.prefs?.sound & SOUND_INSTRUMENTS))
|
||||
continue
|
||||
M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, INSTRUMENT_DISTANCE_NO_FALLOFF, channel, null, copy, distance_multiplier = INSTRUMENT_DISTANCE_FALLOFF_BUFF)
|
||||
M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, null, channel, null, copy)
|
||||
// Could do environment and echo later but not for now
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
to_chat(user, "<span class='notice'>You emag [src].</span>")
|
||||
var/turf/T = get_turf(src)
|
||||
do_sparks(5, 0, T)
|
||||
playsound(T, "sparks", 50, 1)
|
||||
playsound(T, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
/obj/effect/portal/jaunt_tunnel
|
||||
name = "jaunt tunnel"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/mob/living/simple_animal/mouse/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/squeak, list('sound/creatures/mousesqueak.ogg' = 1), 100)
|
||||
AddComponent(/datum/component/squeak, list('sound/creatures/mousesqueak.ogg' = 1), 100, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) //as quiet as a mouse or whatever
|
||||
|
||||
/mob/living/simple_animal/mouse/handle_automated_action()
|
||||
if(prob(chew_probability) && isturf(loc))
|
||||
|
||||
@@ -400,7 +400,7 @@ GLOBAL_LIST_EMPTY(ts_spiderling_list)
|
||||
to_chat(src, "<span class='warning'>Your type of spider is not strong enough to force open doors.</span>")
|
||||
else
|
||||
visible_message("<span class='danger'>[src] forces the door!</span>")
|
||||
playsound(src.loc, "sparks", 100, 1)
|
||||
playsound(src.loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
if(D.density)
|
||||
D.open(TRUE)
|
||||
else
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
if(proximity_flag && user.mind.special_role == "Ninja" && !cooldown && isobj(target))
|
||||
cooldown = 1
|
||||
spark_system.start()
|
||||
playsound(user, "sparks", 50, 1)
|
||||
playsound(user, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
playsound(user, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
user.visible_message("<span class='danger'>[user] masterfully slices [target]!</span>", "<span class='notice'>You masterfully slice [target]!</span>")
|
||||
target.emag_act(user)
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
if(doSpark)
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), "sparks", 50, 1)
|
||||
playsound(get_turf(src), "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
|
||||
var/msg = ""
|
||||
|
||||
|
||||
@@ -255,11 +255,11 @@
|
||||
/obj/machinery/power/supermatter_crystal/proc/alarm()
|
||||
switch(get_status())
|
||||
if(SUPERMATTER_DELAMINATING)
|
||||
playsound(src, 'sound/misc/bloblarm.ogg', 100, FALSE, 40, 30)
|
||||
playsound(src, 'sound/misc/bloblarm.ogg', 100, FALSE, 40, 30, falloff_distance = 10)
|
||||
if(SUPERMATTER_EMERGENCY)
|
||||
playsound(src, 'sound/machines/engine_alert1.ogg', 100, FALSE, 30, 30)
|
||||
playsound(src, 'sound/machines/engine_alert1.ogg', 100, FALSE, 30, 30, falloff_distance = 10)
|
||||
if(SUPERMATTER_DANGER)
|
||||
playsound(src, 'sound/machines/engine_alert2.ogg', 100, FALSE, 30, 30)
|
||||
playsound(src, 'sound/machines/engine_alert2.ogg', 100, FALSE, 30, 30, falloff_distance = 10)
|
||||
if(SUPERMATTER_WARNING)
|
||||
playsound(src, 'sound/machines/terminal_alert.ogg', 75)
|
||||
|
||||
@@ -373,9 +373,9 @@
|
||||
if(last_accent_sound < world.time && prob(20))
|
||||
var/aggression = min(((damage / 800) * (power / 2500)), 1.0) * 100
|
||||
if(damage >= 300)
|
||||
playsound(src, "smdelam", max(50, aggression), FALSE, 40, 30)
|
||||
playsound(src, "smdelam", max(50, aggression), FALSE, 40, 30, falloff_distance = 10)
|
||||
else
|
||||
playsound(src, "smcalm", max(50, aggression), FALSE, 25, 25)
|
||||
playsound(src, "smcalm", max(50, aggression), FALSE, 25, 25, falloff_distance = 10)
|
||||
var/next_sound = round((100 - aggression) * 5)
|
||||
last_accent_sound = world.time + max(SUPERMATTER_ACCENT_SOUND_MIN_COOLDOWN, next_sound)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
var/muzzle_strength = chambered.muzzle_flash_strength
|
||||
var/muzzle_flash_time = 0.2 SECONDS
|
||||
if(suppressed)
|
||||
playsound(user, fire_sound, 10, 1)
|
||||
playsound(user, fire_sound, 10, TRUE, ignore_walls = FALSE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_distance = 0)
|
||||
muzzle_range *= 0.5
|
||||
muzzle_strength *= 0.2
|
||||
muzzle_flash_time *= 0.5
|
||||
|
||||
@@ -461,7 +461,7 @@
|
||||
to_chat(C, "<span class='warning'>Something doesn't feel right...</span>")
|
||||
C.AdjustDizzy(volume)
|
||||
ADD_TRAIT(C, TRAIT_COMIC_SANS, id)
|
||||
C.AddComponent(/datum/component/squeak, null, null, null, null, null, TRUE)
|
||||
C.AddComponent(/datum/component/squeak, null, null, null, null, null, TRUE, falloff_exponent = 20)
|
||||
C.AddElement(/datum/element/waddling)
|
||||
|
||||
/datum/reagent/jestosterone/on_mob_life(mob/living/carbon/M)
|
||||
|
||||
@@ -1235,7 +1235,7 @@
|
||||
if(shock_timer >= rand(5,30)) //Random shocks are wildly unpredictable
|
||||
shock_timer = 0
|
||||
M.electrocute_act(rand(5, 20), "Teslium in their body", 1, SHOCK_NOGLOVES) //Override because it's caused from INSIDE of you
|
||||
playsound(M, "sparks", 50, 1)
|
||||
playsound(M, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/teslium/on_mob_add(mob/living/M)
|
||||
|
||||
@@ -651,20 +651,20 @@
|
||||
smoke.start()
|
||||
|
||||
/obj/item/relic/proc/floofcannon(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src.loc, "sparks", rand(25, 50), TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
var/mob/living/C = new floof(get_turf(user))
|
||||
C.throw_at(pick(oview(10,user)),10,rand(3,8))
|
||||
throwSmoke(get_turf(C))
|
||||
warn_admins(user, "Floof Cannon", 0)
|
||||
|
||||
/obj/item/relic/proc/clean(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src.loc, "sparks", rand(25,50), TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
var/obj/item/grenade/chem_grenade/cleaner/CL = new/obj/item/grenade/chem_grenade/cleaner(get_turf(user))
|
||||
CL.prime()
|
||||
warn_admins(user, "Smoke", 0)
|
||||
|
||||
/obj/item/relic/proc/flash(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src.loc, "sparks", rand(25,50), TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
var/obj/item/grenade/flashbang/CB = new/obj/item/grenade/flashbang(get_turf(user))
|
||||
CB.prime()
|
||||
warn_admins(user, "Flash")
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
singlemutcheck(M, GLOB.comicblock, MUTCHK_FORCED)
|
||||
organhonked = world.time
|
||||
M.AddElement(/datum/element/waddling)
|
||||
squeak = M.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50)
|
||||
squeak = M.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50, falloff_exponent = 20)
|
||||
|
||||
/obj/item/organ/internal/honktumor/remove(mob/living/carbon/M, special = 0)
|
||||
. = ..()
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
/obj/item/organ/internal/honkbladder/insert(mob/living/carbon/M, special = 0)
|
||||
|
||||
squeak = M.AddComponent(/datum/component/squeak, list('sound/effects/clownstep1.ogg'=1,'sound/effects/clownstep2.ogg'=1), 50)
|
||||
squeak = M.AddComponent(/datum/component/squeak, list('sound/effects/clownstep1.ogg'=1,'sound/effects/clownstep2.ogg'=1), 50, falloff_exponent = 20)
|
||||
|
||||
/obj/item/organ/internal/honkbladder/remove(mob/living/carbon/M, special = 0)
|
||||
. = ..()
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
dest = target
|
||||
|
||||
flick("pad-beam", telepad)
|
||||
playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
|
||||
playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, TRUE)
|
||||
for(var/atom/movable/ROI in source)
|
||||
// if is anchored, don't let through
|
||||
if(ROI.anchored)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user