diff --git a/modular_citadel/cit_turfs.dm b/modular_citadel/cit_turfs.dm index 7487747cbf..57fe54c00c 100644 --- a/modular_citadel/cit_turfs.dm +++ b/modular_citadel/cit_turfs.dm @@ -1,7 +1,66 @@ //Yes, hi. This is the file that handles Citadel's turf modifications. + +//But before we touch turfs, we'll take some time to define a couple of things for footstep sounds. +/mob/living + var/makesfootstepsounds + var/footstepcount + +/mob/living/carbon/human + makesfootstepsounds = TRUE + +/atom + var/footstepsoundoverride + +GLOBAL_LIST_INIT(turf_footstep_sounds, list( + "floor" = list('modular_citadel/sound/footstep/floor1.ogg','modular_citadel/sound/footstep/floor2.ogg','modular_citadel/sound/footstep/floor3.ogg','modular_citadel/sound/footstep/floor4.ogg','modular_citadel/sound/footstep/floor5.ogg'), + "plating" = list('modular_citadel/sound/footstep/plating1.ogg','modular_citadel/sound/footstep/plating2.ogg','modular_citadel/sound/footstep/plating3.ogg','modular_citadel/sound/footstep/plating4.ogg','modular_citadel/sound/footstep/plating5.ogg'), + "wood" = list('modular_citadel/sound/footstep/wood1.ogg','modular_citadel/sound/footstep/wood2.ogg','modular_citadel/sound/footstep/wood3.ogg','modular_citadel/sound/footstep/wood4.ogg','modular_citadel/sound/footstep/wood5.ogg'), + "carpet" = list('modular_citadel/sound/footstep/carpet1.ogg','modular_citadel/sound/footstep/carpet2.ogg','modular_citadel/sound/footstep/carpet3.ogg','modular_citadel/sound/footstep/carpet4.ogg','modular_citadel/sound/footstep/carpet5.ogg'), + "hull" = list('modular_citadel/sound/footstep/hull1.ogg','modular_citadel/sound/footstep/hull2.ogg','modular_citadel/sound/footstep/hull3.ogg','modular_citadel/sound/footstep/hull4.ogg','modular_citadel/sound/footstep/hull5.ogg'), + "catwalk" = list('modular_citadel/sound/footstep/catwalk1.ogg','modular_citadel/sound/footstep/catwalk2.ogg','modular_citadel/sound/footstep/catwalk3.ogg','modular_citadel/sound/footstep/catwalk4.ogg','modular_citadel/sound/footstep/catwalk5.ogg'), + "asteroid" = list('modular_citadel/sound/footstep/asteroid1.ogg','modular_citadel/sound/footstep/asteroid2.ogg','modular_citadel/sound/footstep/asteroid3.ogg','modular_citadel/sound/footstep/asteroid4.ogg','modular_citadel/sound/footstep/asteroid5.ogg') + )) + +/turf/open/floor + var/footstepsounds = "floor" + +/turf/open/floor/plating + footstepsounds = "plating" + +/turf/open/floor/wood + footstepsounds = "wood" + +/turf/open/floor/plating/asteroid + footstepsounds = "asteroid" + +/turf/open/floor/grass + footstepsounds = "grass" + +/turf/open/floor/carpet + footstepsounds = "carpet" + +/obj/machinery/atmospherics/components/unary/vent_pump + footstepsoundoverride = "catwalk" + +/obj/machinery/atmospherics/components/unary/vent_scrubber + footstepsoundoverride = "catwalk" + +/obj/structure/disposalpipe + footstepsoundoverride = "catwalk" + +/obj/machinery/holopad + footstepsoundoverride = "catwalk" + +/obj/structure/table + footstepsoundoverride = "hull" + +/obj/structure/table/wood + footstepsoundoverride = "wood" + /turf/open/floor/Entered(atom/obj, atom/oldloc) . = ..() CitDirtify(obj, oldloc) + CitFootstep(obj) //Baystation-styled tile dirtification. Except 31 lines more complex than it probably has to be. /turf/open/floor/proc/CitDirtify(atom/obj, atom/oldloc) @@ -42,4 +101,40 @@ colordirt = list(-0.15,0,0,0, 0,-0.15,0,0, 0,0,-0.15,0, 0,0,0,0, 0,0,0,0) dirt.add_atom_colour(color_matrix_add(origdirtcolor, colordirt), FIXED_COLOUR_PRIORITY) dirt.alpha = dirtamount - return TRUE \ No newline at end of file + return TRUE + +//The proc that handles footsteps! It's pure, unfiltered spaghetti code. +/turf/open/floor/proc/CitFootstep(atom/obj) + if(obj && has_gravity(src) && footstepsounds && istype(obj, /mob/living)) + var/mob/living/steppingman = obj + steppingman.footstepcount++ + if(steppingman && steppingman.makesfootstepsounds && steppingman.m_intent == MOVE_INTENT_RUN && steppingman.canmove && steppingman.footstepcount >= 3) + steppingman.footstepcount = 0 + var/overriddenfootstepsound + if(obj.footstepsoundoverride) + if(isfile(obj.footstepsoundoverride)) + overriddenfootstepsound = list(obj.footstepsoundoverride) + else + overriddenfootstepsound = obj.footstepsoundoverride + if(!overriddenfootstepsound && istype(obj, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = obj + if(H && H.shoes) + var/obj/item/clothing/shoes/S = H.shoes + if(S && S.footstepsoundoverride) + if(isfile(S.footstepsoundoverride)) + overriddenfootstepsound = list(S.footstepsoundoverride) + else + overriddenfootstepsound = S.footstepsoundoverride + if(!overriddenfootstepsound) + var/objschecked + for(var/atom/childobj in contents) + if(childobj.footstepsoundoverride && childobj.invisibility < INVISIBILITY_MAXIMUM) + if(isfile(S.footstepsoundoverride)) + overriddenfootstepsound = list(childobj.footstepsoundoverride) + else + overriddenfootstepsound = childobj.footstepsoundoverride + break + objschecked++ + if(objschecked >= 25) + break //walking on 50k foam darts didn't crash the server during my testing, but its better to be safe than sorry + playsound(src,(overriddenfootstepsound ? (islist(overriddenfootstepsound) ? pick(overriddenfootstepsound) : pick(GLOB.turf_footstep_sounds[overriddenfootstepsound])) : (islist(footstepsounds) ? pick(footstepsounds) : pick(GLOB.turf_footstep_sounds[footstepsounds]))),50, 1) diff --git a/modular_citadel/sound/footstep/asteroid1.ogg b/modular_citadel/sound/footstep/asteroid1.ogg new file mode 100644 index 0000000000..1cb215dc78 Binary files /dev/null and b/modular_citadel/sound/footstep/asteroid1.ogg differ diff --git a/modular_citadel/sound/footstep/asteroid2.ogg b/modular_citadel/sound/footstep/asteroid2.ogg new file mode 100644 index 0000000000..331d0ef241 Binary files /dev/null and b/modular_citadel/sound/footstep/asteroid2.ogg differ diff --git a/modular_citadel/sound/footstep/asteroid3.ogg b/modular_citadel/sound/footstep/asteroid3.ogg new file mode 100644 index 0000000000..90fbf251a0 Binary files /dev/null and b/modular_citadel/sound/footstep/asteroid3.ogg differ diff --git a/modular_citadel/sound/footstep/asteroid4.ogg b/modular_citadel/sound/footstep/asteroid4.ogg new file mode 100644 index 0000000000..186ff17a43 Binary files /dev/null and b/modular_citadel/sound/footstep/asteroid4.ogg differ diff --git a/modular_citadel/sound/footstep/asteroid5.ogg b/modular_citadel/sound/footstep/asteroid5.ogg new file mode 100644 index 0000000000..0ea4c962d0 Binary files /dev/null and b/modular_citadel/sound/footstep/asteroid5.ogg differ diff --git a/modular_citadel/sound/footstep/carpet1.ogg b/modular_citadel/sound/footstep/carpet1.ogg new file mode 100644 index 0000000000..2735a9bf3d Binary files /dev/null and b/modular_citadel/sound/footstep/carpet1.ogg differ diff --git a/modular_citadel/sound/footstep/carpet2.ogg b/modular_citadel/sound/footstep/carpet2.ogg new file mode 100644 index 0000000000..07e5f2320a Binary files /dev/null and b/modular_citadel/sound/footstep/carpet2.ogg differ diff --git a/modular_citadel/sound/footstep/carpet3.ogg b/modular_citadel/sound/footstep/carpet3.ogg new file mode 100644 index 0000000000..edb0193f6e Binary files /dev/null and b/modular_citadel/sound/footstep/carpet3.ogg differ diff --git a/modular_citadel/sound/footstep/carpet4.ogg b/modular_citadel/sound/footstep/carpet4.ogg new file mode 100644 index 0000000000..c9598e2b73 Binary files /dev/null and b/modular_citadel/sound/footstep/carpet4.ogg differ diff --git a/modular_citadel/sound/footstep/carpet5.ogg b/modular_citadel/sound/footstep/carpet5.ogg new file mode 100644 index 0000000000..076818323a Binary files /dev/null and b/modular_citadel/sound/footstep/carpet5.ogg differ diff --git a/modular_citadel/sound/footstep/catwalk1.ogg b/modular_citadel/sound/footstep/catwalk1.ogg new file mode 100644 index 0000000000..5d6ad7b4a0 Binary files /dev/null and b/modular_citadel/sound/footstep/catwalk1.ogg differ diff --git a/modular_citadel/sound/footstep/catwalk2.ogg b/modular_citadel/sound/footstep/catwalk2.ogg new file mode 100644 index 0000000000..07a624dbe4 Binary files /dev/null and b/modular_citadel/sound/footstep/catwalk2.ogg differ diff --git a/modular_citadel/sound/footstep/catwalk3.ogg b/modular_citadel/sound/footstep/catwalk3.ogg new file mode 100644 index 0000000000..acff22e386 Binary files /dev/null and b/modular_citadel/sound/footstep/catwalk3.ogg differ diff --git a/modular_citadel/sound/footstep/catwalk4.ogg b/modular_citadel/sound/footstep/catwalk4.ogg new file mode 100644 index 0000000000..7235a6b9fe Binary files /dev/null and b/modular_citadel/sound/footstep/catwalk4.ogg differ diff --git a/modular_citadel/sound/footstep/catwalk5.ogg b/modular_citadel/sound/footstep/catwalk5.ogg new file mode 100644 index 0000000000..c33f248acd Binary files /dev/null and b/modular_citadel/sound/footstep/catwalk5.ogg differ diff --git a/modular_citadel/sound/footstep/floor1.ogg b/modular_citadel/sound/footstep/floor1.ogg new file mode 100644 index 0000000000..1e3e155839 Binary files /dev/null and b/modular_citadel/sound/footstep/floor1.ogg differ diff --git a/modular_citadel/sound/footstep/floor2.ogg b/modular_citadel/sound/footstep/floor2.ogg new file mode 100644 index 0000000000..cce5a25d82 Binary files /dev/null and b/modular_citadel/sound/footstep/floor2.ogg differ diff --git a/modular_citadel/sound/footstep/floor3.ogg b/modular_citadel/sound/footstep/floor3.ogg new file mode 100644 index 0000000000..16ab67f729 Binary files /dev/null and b/modular_citadel/sound/footstep/floor3.ogg differ diff --git a/modular_citadel/sound/footstep/floor4.ogg b/modular_citadel/sound/footstep/floor4.ogg new file mode 100644 index 0000000000..9ef15430ff Binary files /dev/null and b/modular_citadel/sound/footstep/floor4.ogg differ diff --git a/modular_citadel/sound/footstep/floor5.ogg b/modular_citadel/sound/footstep/floor5.ogg new file mode 100644 index 0000000000..0f6a66057d Binary files /dev/null and b/modular_citadel/sound/footstep/floor5.ogg differ diff --git a/modular_citadel/sound/footstep/hull1.ogg b/modular_citadel/sound/footstep/hull1.ogg new file mode 100644 index 0000000000..615df6c550 Binary files /dev/null and b/modular_citadel/sound/footstep/hull1.ogg differ diff --git a/modular_citadel/sound/footstep/hull2.ogg b/modular_citadel/sound/footstep/hull2.ogg new file mode 100644 index 0000000000..3aecb743f7 Binary files /dev/null and b/modular_citadel/sound/footstep/hull2.ogg differ diff --git a/modular_citadel/sound/footstep/hull3.ogg b/modular_citadel/sound/footstep/hull3.ogg new file mode 100644 index 0000000000..03339131f6 Binary files /dev/null and b/modular_citadel/sound/footstep/hull3.ogg differ diff --git a/modular_citadel/sound/footstep/hull4.ogg b/modular_citadel/sound/footstep/hull4.ogg new file mode 100644 index 0000000000..2fba89d318 Binary files /dev/null and b/modular_citadel/sound/footstep/hull4.ogg differ diff --git a/modular_citadel/sound/footstep/hull5.ogg b/modular_citadel/sound/footstep/hull5.ogg new file mode 100644 index 0000000000..10c5912b97 Binary files /dev/null and b/modular_citadel/sound/footstep/hull5.ogg differ diff --git a/modular_citadel/sound/footstep/plating1.ogg b/modular_citadel/sound/footstep/plating1.ogg new file mode 100644 index 0000000000..0df770e663 Binary files /dev/null and b/modular_citadel/sound/footstep/plating1.ogg differ diff --git a/modular_citadel/sound/footstep/plating2.ogg b/modular_citadel/sound/footstep/plating2.ogg new file mode 100644 index 0000000000..314b9133d2 Binary files /dev/null and b/modular_citadel/sound/footstep/plating2.ogg differ diff --git a/modular_citadel/sound/footstep/plating3.ogg b/modular_citadel/sound/footstep/plating3.ogg new file mode 100644 index 0000000000..5c571d77eb Binary files /dev/null and b/modular_citadel/sound/footstep/plating3.ogg differ diff --git a/modular_citadel/sound/footstep/plating4.ogg b/modular_citadel/sound/footstep/plating4.ogg new file mode 100644 index 0000000000..5953262764 Binary files /dev/null and b/modular_citadel/sound/footstep/plating4.ogg differ diff --git a/modular_citadel/sound/footstep/plating5.ogg b/modular_citadel/sound/footstep/plating5.ogg new file mode 100644 index 0000000000..4676a637a6 Binary files /dev/null and b/modular_citadel/sound/footstep/plating5.ogg differ diff --git a/modular_citadel/sound/footstep/wood1.ogg b/modular_citadel/sound/footstep/wood1.ogg new file mode 100644 index 0000000000..c76fc423fc Binary files /dev/null and b/modular_citadel/sound/footstep/wood1.ogg differ diff --git a/modular_citadel/sound/footstep/wood2.ogg b/modular_citadel/sound/footstep/wood2.ogg new file mode 100644 index 0000000000..71dc1aa967 Binary files /dev/null and b/modular_citadel/sound/footstep/wood2.ogg differ diff --git a/modular_citadel/sound/footstep/wood3.ogg b/modular_citadel/sound/footstep/wood3.ogg new file mode 100644 index 0000000000..bf86889006 Binary files /dev/null and b/modular_citadel/sound/footstep/wood3.ogg differ diff --git a/modular_citadel/sound/footstep/wood4.ogg b/modular_citadel/sound/footstep/wood4.ogg new file mode 100644 index 0000000000..44734425ce Binary files /dev/null and b/modular_citadel/sound/footstep/wood4.ogg differ diff --git a/modular_citadel/sound/footstep/wood5.ogg b/modular_citadel/sound/footstep/wood5.ogg new file mode 100644 index 0000000000..5ad4fa81e7 Binary files /dev/null and b/modular_citadel/sound/footstep/wood5.ogg differ