Sound crusade part 1: footsteps (#37600)

* sounds take 1

take 1

* silent mime shoes

* greatly reduced range

* Silent walking, silent mimes
This commit is contained in:
mentgah
2025-05-27 14:23:40 +02:00
committed by GitHub
parent c1b7fe39d9
commit d0e258f3ef
93 changed files with 192 additions and 27 deletions

View File

@@ -18,6 +18,7 @@
#define MAGPULSE (1 << 12) //prevents slipping in space, singulo pulling, etc
#define GENDERFIT (1 << 13) //Toggles gender fitting so it appends _f for female mob icon.
#define COLORS_OVERLAY (1 << 14)//if toggled on, the color variable will also modify the color of how it looks on the wearer
#define SILENT_SHOES (1 << 15) //makes the shoes not make any noise
//clothing audible emote flags
#define CLOTHING_SOUND_SCREAM "scream"

View File

@@ -775,7 +775,7 @@ Suit and assorted
item_state = "s-ninja"
permeability_coefficient = 0.01
mag_slow = NO_SLOWDOWN
clothing_flags = NOSLIP | MAGPULSE
clothing_flags = NOSLIP | MAGPULSE | SILENT_SHOES
species_fit = list(VOX_SHAPED)
/obj/item/clothing/shoes/ninja/redsun

View File

@@ -63,6 +63,9 @@ var/global/list/turf/simulated/floor/phazontiles = list()
icon_regular_floor = "floor"
else
icon_regular_floor = icon_state
footstep_sound = sounds_floor
footstep_sound_barefoot = sounds_floor_barefoot
footstep_sound_claw = sounds_floor_claw
/turf/simulated/floor/proc/create_floor_tile()
if(!floor_tile)

View File

@@ -66,6 +66,12 @@
thermal_material = new/datum/thermal_material/wood()
thermal_mass = 5
/turf/simulated/floor/wood/New()
..()
footstep_sound = sounds_wood
footstep_sound_barefoot = sounds_wood_barefoot
footstep_sound_claw = sounds_wood_claw
/turf/simulated/floor/wood/create_floor_tile()
floor_tile = new /obj/item/stack/tile/wood(null)
@@ -414,6 +420,10 @@
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly
footstep_sound = sounds_grass
footstep_sound_barefoot = sounds_grass
footstep_sound_claw = sounds_grass
/turf/simulated/floor/carpet
name = "Carpet"
@@ -430,6 +440,7 @@
if(!icon_state)
icon_state = initial(icon_state)
..()
if(has_siding)
spawn(4)
if(src)
@@ -439,6 +450,10 @@
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly
footstep_sound = sounds_carpet
footstep_sound_barefoot = sounds_carpet_barefoot
footstep_sound_claw = sounds_carpet_barefoot
/turf/simulated/floor/carpet/cultify()
return

View File

@@ -25,6 +25,9 @@
overlays += snowfx2
icon_state_to_appearance[icon_state] = appearance
snowballs = rand(5, 10) //Used to be (30, 50). A quick way to overload the server with atom instances.
footstep_sound = sounds_snow
footstep_sound_barefoot = sounds_snow
footstep_sound_claw = sounds_snow
/turf/simulated/floor/plating/snow/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -103,11 +106,6 @@
return BUILD_SUCCESS
return BUILD_FAILURE
/turf/simulated/floor/plating/snow/Entered(mob/user)
..()
if(isliving(user) && !user.locked_to && !user.lying && !user.flying)
playsound(src, pick(snowsound), 10, 1, -1, channel = 123)
/turf/simulated/floor/plating/snow/cold
temperature = T_ARCTIC

View File

@@ -75,6 +75,10 @@
var/datum/paint_overlay/paint_overlay = null
var/list/footstep_sound = list()
var/list/footstep_sound_barefoot = list()
var/list/footstep_sound_claw = list()
/turf/examine(mob/user)
..()
if(bullet_marks)

View File

@@ -17,6 +17,12 @@
if(prob(20))
new/obj/effect/decal/cleanable/soot(src)
/turf/unsimulated/floor/New()
..()
footstep_sound = sounds_floor
footstep_sound_barefoot = sounds_floor_barefoot
footstep_sound_claw = sounds_floor_claw
/turf/unsimulated/floor/attack_paw(user as mob)
return src.attack_hand(user)
@@ -37,6 +43,9 @@
/turf/unsimulated/floor/grass/New()
..()
icon_state = "grass[rand(1,4)]"
footstep_sound = sounds_grass
footstep_sound_barefoot = sounds_grass
footstep_sound_claw = sounds_grass
/turf/unsimulated/floor/mars
name = "surface"

View File

@@ -47,6 +47,9 @@
global_snowtiles += src
if(real_snow_tile && !ignore_blizzard_updates)
environment_snowtiles += src
footstep_sound = sounds_snow
footstep_sound_barefoot = sounds_snow
footstep_sound_claw = sounds_snow
/turf/unsimulated/floor/snow/Destroy()
if(real_snow_tile && !ignore_blizzard_updates)
@@ -127,9 +130,6 @@
if(H.client)
if(!istype(OL,/turf/unsimulated/floor/snow))
H << sound(snowstorm_ambience[snow_state+1], repeat = 1, wait = 0, channel = CHANNEL_WEATHER, volume = snowstorm_ambience_volumes[snow_state+1])
if(isliving(H) && !H.locked_to && !H.lying && !H.flying)
if(snowsound?.len)
playsound(src, pick(snowsound), 10, 1, -1, channel = 123)
/turf/unsimulated/floor/snow/cultify()

View File

@@ -949,15 +949,7 @@ var/global/maxStackDepth = 10
var/luminous_paint = FALSE
/obj/item/clothing/shoes/proc/step_action()
stepstaken++
if(step_sound != "" && ishuman(loc))
var/mob/living/carbon/human/H = loc
switch(H.m_intent)
if("run")
if(stepstaken % modulo_steps == 0)
playsound(H, step_sound, 50, 1) // this will NEVER GET ANNOYING!
if("walk")
playsound(H, step_sound, 20, 1)
return
/obj/item/clothing/shoes/proc/on_kick(mob/living/user, mob/living/victim)
return

View File

@@ -80,6 +80,7 @@
name = "mime shoes"
icon_state = "mime"
_color = "mime"
clothing_flags = SILENT_SHOES
/obj/item/clothing/shoes/mime/biker
name = "Biker's shoes"

View File

@@ -660,6 +660,7 @@ var/list/icon_state_to_appearance = list()
if(prob(20) && icon_state == "asteroid")
icon_state = "asteroid[rand(0,12)]"
add_rock_overlay()
footstep_sound = sounds_asteroid
/turf/unsimulated/floor/asteroid/add_rock_overlay(var/image/img = image('icons/turf/rock_overlay.dmi', overlay_state,layer = SIDE_LAYER),var/offset=-4)
if(!overlay_state || overlay_state == "")
@@ -750,6 +751,9 @@ var/list/icon_state_to_appearance = list()
icon_regular_floor = initial(icon_state)
add_rock_overlay()
footstep_sound = sounds_asteroid
/turf/simulated/floor/asteroid/add_rock_overlay(var/image/img = image('icons/turf/rock_overlay.dmi', overlay_state,layer = SIDE_LAYER),var/offset=-4)
if(!overlay_state || overlay_state == "")
return

View File

@@ -0,0 +1,86 @@
#define FOOTSOUND_HUMAN 1
#define FOOTSOUND_VOX 2
var/list/sounds_asteroid = list(
'sound/effects/footstep/asteroid1.ogg',
'sound/effects/footstep/asteroid2.ogg',
'sound/effects/footstep/asteroid3.ogg',
'sound/effects/footstep/asteroid4.ogg',
'sound/effects/footstep/asteroid5.ogg'
)
var/list/sounds_carpet = list(
'sound/effects/footstep/carpet1.ogg',
'sound/effects/footstep/carpet2.ogg',
'sound/effects/footstep/carpet3.ogg',
'sound/effects/footstep/carpet4.ogg',
'sound/effects/footstep/carpet5.ogg'
)
var/list/sounds_carpet_barefoot = list(
'sound/effects/footstep/carpetbarefoot1.ogg',
'sound/effects/footstep/carpetbarefoot2.ogg',
'sound/effects/footstep/carpetbarefoot3.ogg',
'sound/effects/footstep/carpetbarefoot4.ogg',
'sound/effects/footstep/carpetbarefoot5.ogg'
)
var/list/sounds_floor = list(
'sound/effects/footstep/floor1.ogg',
'sound/effects/footstep/floor2.ogg',
'sound/effects/footstep/floor3.ogg',
'sound/effects/footstep/floor4.ogg',
'sound/effects/footstep/floor5.ogg'
)
var/list/sounds_floor_barefoot = list(
'sound/effects/footstep/hardbarefoot1.ogg',
'sound/effects/footstep/hardbarefoot2.ogg',
'sound/effects/footstep/hardbarefoot3.ogg',
'sound/effects/footstep/hardbarefoot4.ogg',
'sound/effects/footstep/hardbarefoot5.ogg'
)
var/list/sounds_floor_claw = list(
'sound/effects/footstep/hardclaw1.ogg',
'sound/effects/footstep/hardclaw2.ogg',
'sound/effects/footstep/hardclaw3.ogg',
'sound/effects/footstep/hardclaw4.ogg',
)
var/list/sounds_grass = list(
'sound/effects/footstep/grass1.ogg',
'sound/effects/footstep/grass2.ogg',
'sound/effects/footstep/grass3.ogg',
'sound/effects/footstep/grass4.ogg'
)
var/list/sounds_wood = list(
'sound/effects/footstep/wood1.ogg',
'sound/effects/footstep/wood2.ogg',
'sound/effects/footstep/wood3.ogg',
'sound/effects/footstep/wood4.ogg',
'sound/effects/footstep/wood5.ogg'
)
var/list/sounds_wood_barefoot = list(
'sound/effects/footstep/woodbarefoot1.ogg',
'sound/effects/footstep/woodbarefoot2.ogg',
'sound/effects/footstep/woodbarefoot3.ogg',
'sound/effects/footstep/woodbarefoot4.ogg',
'sound/effects/footstep/woodbarefoot5.ogg'
)
var/list/sounds_wood_claw = list(
'sound/effects/footstep/woodclaw1.ogg',
'sound/effects/footstep/woodclaw2.ogg',
'sound/effects/footstep/woodclaw3.ogg',
)
var/list/sounds_ayy = list(
'sound/effects/metal_walk.ogg',
'sound/effects/metal_walk2.ogg',
)
var/list/sounds_snow = list(
'sound/misc/snow1.ogg',
'sound/misc/snow2.ogg',
'sound/misc/snow3.ogg',
'sound/misc/snow4.ogg',
'sound/misc/snow5.ogg',
'sound/misc/snow6.ogg')

View File

@@ -9,7 +9,9 @@
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/human
var/datum/species/species //Contains icon generation and language information, set during New().
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/footsound = FOOTSOUND_HUMAN
var/stepstaken = 0
var/modulo_step = 2
var/fartCooldown = 20 SECONDS
/mob/living/carbon/human/dummy
@@ -42,6 +44,7 @@
/mob/living/carbon/human/vox/New(var/new_loc, delay_ready_dna = 0)
..(new_loc, "Vox")
my_appearance.h_style = "Short Vox Quills"
footsound = FOOTSOUND_VOX
regenerate_icons()
/mob/living/carbon/human/diona/New(var/new_loc, delay_ready_dna = 0)
@@ -91,6 +94,7 @@
/mob/living/carbon/human/insectoid/New(var/new_loc, delay_ready_dna = 0)
..(new_loc, "Insectoid")
my_appearance.h_style = "Insectoid Antennae"
footsound = FOOTSOUND_VOX
regenerate_icons()
/mob/living/carbon/human/NPC/New(var/new_loc, delay_ready_dna = 0)

View File

@@ -147,6 +147,7 @@
return 0*/
if(.)
if(shoes && istype(shoes, /obj/item/clothing/shoes))
var/obj/item/clothing/shoes/S = shoes
S.step_action()
@@ -158,6 +159,53 @@
for(var/obj/item/weapon/bomberman/dispenser in src)
if(dispenser.spam_bomb)
dispenser.attack_self(src)
//FOOTSTEPS
if (!on_foot()) //are our feet on the ground?
return
if (m_intent != "run")
return
if (mind?.miming)
return
stepstaken++
var/modulo = modulo_step
if(shoes && istype(shoes, /obj/item/clothing/shoes)) //shoes override
var/obj/item/clothing/shoes/S = shoes
if (S.clothing_flags & SILENT_SHOES)
return
modulo = S.modulo_steps<modulo? S.modulo_steps : modulo
if (stepstaken % modulo == 0) //once every other step by default, so that it doesn't spam too much (shoes override)
var/step_volume = 50
var/list/sounds_to_play
var/turf/T = get_turf(src)
if (!T || !T.footstep_sound || istype(T, /turf/space))
return
if(shoes && istype(shoes, /obj/item/clothing/shoes)) //shoes
var/obj/item/clothing/shoes/S = shoes
if (S.step_sound) //shoes override
sounds_to_play = S.step_sound
else //otherwise just use the turf's sound
sounds_to_play = T.footstep_sound
else
var/datum/organ/external/foot = has_vulnerable_foot()
if (foot)
switch(footsound)
if (FOOTSOUND_HUMAN)
sounds_to_play = T.footstep_sound_barefoot
if (FOOTSOUND_VOX)
sounds_to_play = T.footstep_sound_claw
else //check for robo limbs?
sounds_to_play = T.footstep_sound
stepstaken = 0
if (!sounds_to_play)
return
playsound(src, pick(sounds_to_play), step_volume, 1, -4)
/mob/living/carbon/human/CheckSlip(slip_on_walking = FALSE, overlay_type = TURF_WET_WATER, slip_on_magbooties = FALSE)
var/shoes_slip_factor
@@ -177,3 +225,5 @@
return SLIP_HAS_MAGBOOTS
// We don't have magboots, or magboots can't protect us
return (. && !shoes_slip_factor)

View File

@@ -138,6 +138,11 @@
temperature = T20C
plane = PLATING_PLANE
/turf/unsimulated/floor/ayy/New()
..()
footstep_sound = sounds_ayy
/turf/unsimulated/floor/ayy/Entered(atom/A, atom/OL) // Ayy alloy tiles play walking sound effects!
..()
if(istype(A,/mob/living/simple_animal))
@@ -148,14 +153,6 @@
else
playsound(src, 'sound/effects/metal_walk2.ogg', 50, 0)
if(istype(A,/mob/living/carbon))
var/mob/living/carbon/M = A
if(M.on_foot() && prob(33)) // If the mob is flying, nothing happens. But if it's walking, 33% chance to play a sound effect
if(prob(50))
playsound(src, 'sound/effects/metal_walk.ogg', 50, 0)
else
playsound(src, 'sound/effects/metal_walk2.ogg', 50, 0)
/turf/unsimulated/floor/ayy/tech
name = "alien plating"
icon_state = "alien_tile2"

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.

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.

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.

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.

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.

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.

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.

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2000,6 +2000,7 @@
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\footsteps.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
#include "code\modules\mob\living\carbon\human\human_attackhand.dm"