mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Footstep sounds
This adds a system for footstep sounds - Only xenomorphs and humans currently use it, could expand to robutts and simple_animals easily, but haven't. - Only enabled for three turf types currently: - Plating (ala Maintnance) - Carpets - Wooden floors
This commit is contained in:
@@ -115,6 +115,12 @@ var/list/wood_icons = list("wood","wood-broken")
|
||||
else if(is_plating())
|
||||
if(!broken && !burnt)
|
||||
icon_state = icon_plating //Because asteroids are 'platings' too.
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/plating_human.ogg'),
|
||||
"xeno" = list('sound/effects/footstep/plating_xeno.ogg')
|
||||
)
|
||||
|
||||
else if(is_light_floor())
|
||||
var/obj/item/stack/tile/light/T = floor_tile
|
||||
if(T.on)
|
||||
@@ -193,11 +199,20 @@ var/list/wood_icons = list("wood","wood-broken")
|
||||
|
||||
icon_state = "carpet[connectdir]-[diagonalconnect]"
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/carpet_human.ogg'),
|
||||
"xeno" = list('sound/effects/footstep/carpet_xeno.ogg')
|
||||
)
|
||||
|
||||
else if(is_wood_floor())
|
||||
if(!broken && !burnt)
|
||||
if( !(icon_state in wood_icons) )
|
||||
icon_state = "wood"
|
||||
//world << "[icon_state]y's got [icon_state]"
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/wood_all.ogg'), //@RonaldVanWonderen of Freesound.org
|
||||
"xeno" = list('sound/effects/footstep/wood_all.ogg') //@RonaldVanWonderen of Freesound.org
|
||||
)
|
||||
|
||||
|
||||
/turf/simulated/floor/return_siding_icon_state()
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
icon_state = "wood"
|
||||
floor_tile = new/obj/item/stack/tile/wood
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/wood_all.ogg'), //@RonaldVanWonderen of Freesound.org
|
||||
"xeno" = list('sound/effects/footstep/wood_all.ogg') //@RonaldVanWonderen of Freesound.org
|
||||
)
|
||||
|
||||
/turf/simulated/floor/vault
|
||||
icon_state = "rockvault"
|
||||
|
||||
@@ -131,6 +136,11 @@
|
||||
floor_tile = null
|
||||
intact = 0
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/plating_human.ogg'),
|
||||
"xeno" = list('sound/effects/footstep/plating_xeno.ogg')
|
||||
)
|
||||
|
||||
/turf/simulated/floor/plating/airless
|
||||
icon_state = "plating"
|
||||
name = "airless plating"
|
||||
@@ -246,6 +256,11 @@
|
||||
icon_state = "carpet"
|
||||
floor_tile = new/obj/item/stack/tile/carpet
|
||||
|
||||
footstep_sounds = list(
|
||||
"human" = list('sound/effects/footstep/carpet_human.ogg'),
|
||||
"xeno" = list('sound/effects/footstep/carpet_xeno.ogg')
|
||||
)
|
||||
|
||||
New()
|
||||
floor_tile.New() //I guess New() isn't ran on objects spawned without the definition of a turf to house them, ah well.
|
||||
if(!icon_state)
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
var/image/obscured //camerachunks
|
||||
|
||||
var/list/footstep_sounds = list()
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
for(var/atom/movable/AM in src)
|
||||
|
||||
@@ -295,3 +295,16 @@ Des: Removes all infected images from the alien.
|
||||
#undef HEAT_DAMAGE_LEVEL_1
|
||||
#undef HEAT_DAMAGE_LEVEL_2
|
||||
#undef HEAT_DAMAGE_LEVEL_3
|
||||
|
||||
/mob/living/carbon/alien/handle_footstep(turf/T)
|
||||
if(..())
|
||||
if(T.footstep_sounds["xeno"])
|
||||
var/S = pick(T.footstep_sounds["xeno"])
|
||||
if(S)
|
||||
if(m_intent == "run")
|
||||
if(!(step_count % 2)) //every other turf makes a sound
|
||||
return 0
|
||||
if(leaping)
|
||||
return 0
|
||||
playsound(T, S, 6, 1, -(world.view/2)) //xenos are quiet fuckers
|
||||
return 0
|
||||
@@ -81,4 +81,22 @@
|
||||
if(!has_gravity(loc))
|
||||
return
|
||||
var/obj/item/clothing/shoes/S = shoes
|
||||
S.step_action(src)
|
||||
S.step_action(src)
|
||||
|
||||
/mob/living/carbon/human/handle_footstep(turf/T)
|
||||
if(..())
|
||||
if(T.footstep_sounds["human"])
|
||||
var/S = pick(T.footstep_sounds["human"])
|
||||
if(S)
|
||||
if(m_intent == "run")
|
||||
if(!(step_count % 2)) //every other turf makes a sound
|
||||
return 0
|
||||
playsound(T, S, shoes ? 15 : 7, 1, shoes ? 0 : -(world.view/2))
|
||||
//this looks insane but it actually is quite simple
|
||||
//play sound at turf T, using sound S
|
||||
//volume = 15 w/ shoes, volume = 7 w/o shoes
|
||||
//do use vary
|
||||
//add negative world.view/2 if not wearing shoes
|
||||
return 1
|
||||
|
||||
return 0
|
||||
@@ -492,10 +492,18 @@
|
||||
if (s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
|
||||
s_active.close(src)
|
||||
|
||||
handle_footstep(loc)
|
||||
step_count++
|
||||
|
||||
if(update_slimes)
|
||||
for(var/mob/living/carbon/slime/M in view(1,src))
|
||||
M.UpdateFeed(src)
|
||||
|
||||
/mob/living/proc/handle_footstep(turf/T)
|
||||
if(istype(T))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*//////////////////////
|
||||
START RESIST PROCS
|
||||
*///////////////////////
|
||||
|
||||
@@ -51,4 +51,5 @@
|
||||
var/list/icon/pipes_shown = list()
|
||||
var/last_played_vent
|
||||
|
||||
var/list/datum/action/actions = list()
|
||||
var/list/datum/action/actions = list()
|
||||
var/step_count = 0
|
||||
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