diff --git a/__DEFINES/clothing.dm b/__DEFINES/clothing.dm index ab745d87baa..154ded31478 100644 --- a/__DEFINES/clothing.dm +++ b/__DEFINES/clothing.dm @@ -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" diff --git a/code/datums/gamemode/role/ninja.dm b/code/datums/gamemode/role/ninja.dm index 6715a618ad2..7c281b9f6ff 100644 --- a/code/datums/gamemode/role/ninja.dm +++ b/code/datums/gamemode/role/ninja.dm @@ -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 diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index ee0897451a8..866f5de997e 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -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) diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index dd439aa1dc6..d5947f9397e 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -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 diff --git a/code/game/turfs/simulated/snow.dm b/code/game/turfs/simulated/snow.dm index 610d1648074..713e5135cd5 100644 --- a/code/game/turfs/simulated/snow.dm +++ b/code/game/turfs/simulated/snow.dm @@ -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 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 6a1ce6ac1ca..810002817b2 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -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) diff --git a/code/game/turfs/unsimulated/floor.dm b/code/game/turfs/unsimulated/floor.dm index 24afc04cb0c..2581991aec8 100644 --- a/code/game/turfs/unsimulated/floor.dm +++ b/code/game/turfs/unsimulated/floor.dm @@ -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" diff --git a/code/game/turfs/unsimulated/snow.dm b/code/game/turfs/unsimulated/snow.dm index 7e0ad0b0653..0da377dcc65 100644 --- a/code/game/turfs/unsimulated/snow.dm +++ b/code/game/turfs/unsimulated/snow.dm @@ -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() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index c827edc2e86..4dff2b4bd80 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -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 diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 749e31b1082..050d68b720d 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -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" diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 94bf8e6fa81..a47c5c185b1 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/footsteps.dm b/code/modules/mob/living/carbon/human/footsteps.dm new file mode 100644 index 00000000000..ce6e9f94064 --- /dev/null +++ b/code/modules/mob/living/carbon/human/footsteps.dm @@ -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') diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ae01e81f787..3695b4b0c38 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index b9b06993215..2e9deb72147 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -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