mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Implements footstep sound system and adds sounds to various floor types.
* Adds system for turfs to have "footstep sounds" that play when someone walks over them. * Adds system for floor types (the kind of turfs where you can put tiles on them) to support the footstep sounds. * Adds sounds to plating, tiles, wood, and carpet floor types. * Footstep sound system is configurable in game_options.txt, it can be turned off completely or the volume adjusted.
This commit is contained in:
@@ -156,6 +156,8 @@ var/list/gamemode_cache = list()
|
|||||||
var/slime_delay = 0
|
var/slime_delay = 0
|
||||||
var/animal_delay = 0
|
var/animal_delay = 0
|
||||||
|
|
||||||
|
var/footstep_volume = 0
|
||||||
|
|
||||||
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
|
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
|
||||||
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
|
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
|
||||||
var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database
|
var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database
|
||||||
@@ -768,6 +770,8 @@ var/list/gamemode_cache = list()
|
|||||||
if("animal_delay")
|
if("animal_delay")
|
||||||
config.animal_delay = value
|
config.animal_delay = value
|
||||||
|
|
||||||
|
if("footstep_volume")
|
||||||
|
config.footstep_volume = text2num(value)
|
||||||
|
|
||||||
if("use_loyalty_implants")
|
if("use_loyalty_implants")
|
||||||
config.use_loyalty_implants = 1
|
config.use_loyalty_implants = 1
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ var/list/flooring_types
|
|||||||
var/descriptor = "tiles"
|
var/descriptor = "tiles"
|
||||||
var/flags
|
var/flags
|
||||||
var/can_paint
|
var/can_paint
|
||||||
|
var/list/footstep_sounds = list() // key=species name, value = list of soundss
|
||||||
|
|
||||||
/decl/flooring/grass
|
/decl/flooring/grass
|
||||||
name = "grass"
|
name = "grass"
|
||||||
@@ -90,6 +91,12 @@ var/list/flooring_types
|
|||||||
build_type = /obj/item/stack/tile/carpet
|
build_type = /obj/item/stack/tile/carpet
|
||||||
damage_temperature = T0C+200
|
damage_temperature = T0C+200
|
||||||
flags = TURF_HAS_EDGES | TURF_HAS_CORNERS | TURF_REMOVE_CROWBAR | TURF_CAN_BURN
|
flags = TURF_HAS_EDGES | TURF_HAS_CORNERS | TURF_REMOVE_CROWBAR | TURF_CAN_BURN
|
||||||
|
footstep_sounds = list("human" = 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'))
|
||||||
|
|
||||||
/decl/flooring/carpet/blue
|
/decl/flooring/carpet/blue
|
||||||
name = "carpet"
|
name = "carpet"
|
||||||
@@ -107,6 +114,12 @@ var/list/flooring_types
|
|||||||
flags = TURF_REMOVE_CROWBAR | TURF_CAN_BREAK | TURF_CAN_BURN
|
flags = TURF_REMOVE_CROWBAR | TURF_CAN_BREAK | TURF_CAN_BURN
|
||||||
build_type = /obj/item/stack/tile/floor
|
build_type = /obj/item/stack/tile/floor
|
||||||
can_paint = 1
|
can_paint = 1
|
||||||
|
footstep_sounds = list("human" = 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'))
|
||||||
|
|
||||||
/decl/flooring/linoleum
|
/decl/flooring/linoleum
|
||||||
name = "linoleum"
|
name = "linoleum"
|
||||||
@@ -193,6 +206,12 @@ var/list/flooring_types
|
|||||||
descriptor = "planks"
|
descriptor = "planks"
|
||||||
build_type = /obj/item/stack/tile/wood
|
build_type = /obj/item/stack/tile/wood
|
||||||
flags = TURF_CAN_BREAK | TURF_IS_FRAGILE | TURF_REMOVE_SCREWDRIVER
|
flags = TURF_CAN_BREAK | TURF_IS_FRAGILE | TURF_REMOVE_SCREWDRIVER
|
||||||
|
footstep_sounds = list("human" = 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'))
|
||||||
|
|
||||||
/decl/flooring/reinforced
|
/decl/flooring/reinforced
|
||||||
name = "reinforced floor"
|
name = "reinforced floor"
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
var/base_desc = "The naked hull."
|
var/base_desc = "The naked hull."
|
||||||
var/base_icon = 'icons/turf/flooring/plating.dmi'
|
var/base_icon = 'icons/turf/flooring/plating.dmi'
|
||||||
var/base_icon_state = "plating"
|
var/base_icon_state = "plating"
|
||||||
|
var/static/list/base_footstep_sounds = list("human" = list(
|
||||||
|
'sound/effects/footstep/plating1.ogg',
|
||||||
|
'sound/effects/footstep/plating2.ogg',
|
||||||
|
'sound/effects/footstep/plating3.ogg',
|
||||||
|
'sound/effects/footstep/plating4.ogg',
|
||||||
|
'sound/effects/footstep/plating5.ogg'))
|
||||||
|
|
||||||
// Flooring data.
|
// Flooring data.
|
||||||
var/flooring_override
|
var/flooring_override
|
||||||
@@ -33,10 +39,13 @@
|
|||||||
floortype = initial_flooring
|
floortype = initial_flooring
|
||||||
if(floortype)
|
if(floortype)
|
||||||
set_flooring(get_flooring_data(floortype))
|
set_flooring(get_flooring_data(floortype))
|
||||||
|
else
|
||||||
|
footstep_sounds = base_footstep_sounds
|
||||||
|
|
||||||
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring)
|
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring)
|
||||||
make_plating(defer_icon_update = 1)
|
make_plating(defer_icon_update = 1)
|
||||||
flooring = newflooring
|
flooring = newflooring
|
||||||
|
footstep_sounds = newflooring.footstep_sounds
|
||||||
update_icon(1)
|
update_icon(1)
|
||||||
levelupdate()
|
levelupdate()
|
||||||
|
|
||||||
@@ -53,6 +62,7 @@
|
|||||||
desc = base_desc
|
desc = base_desc
|
||||||
icon = base_icon
|
icon = base_icon
|
||||||
icon_state = base_icon_state
|
icon_state = base_icon_state
|
||||||
|
footstep_sounds = base_footstep_sounds
|
||||||
|
|
||||||
if(flooring)
|
if(flooring)
|
||||||
if(flooring.build_type && place_product)
|
if(flooring.build_type && place_product)
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
var/movement_cost = 0 // How much the turf slows down movement, if any.
|
var/movement_cost = 0 // How much the turf slows down movement, if any.
|
||||||
|
|
||||||
|
var/list/footstep_sounds = null
|
||||||
|
|
||||||
/turf/New()
|
/turf/New()
|
||||||
..()
|
..()
|
||||||
for(var/atom/movable/AM as mob|obj in src)
|
for(var/atom/movable/AM as mob|obj in src)
|
||||||
@@ -145,6 +147,9 @@ var/const/enterloopsanity = 100
|
|||||||
else if(!is_space())
|
else if(!is_space())
|
||||||
M.inertia_dir = 0
|
M.inertia_dir = 0
|
||||||
M.make_floating(0)
|
M.make_floating(0)
|
||||||
|
if(isliving(M))
|
||||||
|
var/mob/living/L = M
|
||||||
|
L.handle_footstep(src)
|
||||||
..()
|
..()
|
||||||
var/objects = 0
|
var/objects = 0
|
||||||
if(A && (A.flags & PROXMOVE))
|
if(A && (A.flags & PROXMOVE))
|
||||||
|
|||||||
@@ -93,3 +93,5 @@
|
|||||||
mob_swap_flags = ~HEAVY
|
mob_swap_flags = ~HEAVY
|
||||||
|
|
||||||
var/identifying_gender // In case the human identifies as another gender than it's biological
|
var/identifying_gender // In case the human identifies as another gender than it's biological
|
||||||
|
|
||||||
|
var/step_count = 0 // Track how many footsteps have been taken to know when to play footstep sounds
|
||||||
|
|||||||
@@ -140,3 +140,34 @@
|
|||||||
|
|
||||||
prob_slip = round(prob_slip)
|
prob_slip = round(prob_slip)
|
||||||
return(prob_slip)
|
return(prob_slip)
|
||||||
|
|
||||||
|
// Handle footstep sounds
|
||||||
|
/mob/living/carbon/human/handle_footstep(var/turf/T)
|
||||||
|
if(!config.footstep_volume || !T.footstep_sounds || !T.footstep_sounds.len)
|
||||||
|
return
|
||||||
|
// Future Upgrades - Multi species support
|
||||||
|
var/list/footstep_sounds = T.footstep_sounds["human"]
|
||||||
|
if(!footstep_sounds)
|
||||||
|
return
|
||||||
|
|
||||||
|
var/S = pick(footstep_sounds)
|
||||||
|
if(!S) return
|
||||||
|
|
||||||
|
// Only play every other step while running
|
||||||
|
if(m_intent == "run" && step_count++ % 2 == 0)
|
||||||
|
return
|
||||||
|
|
||||||
|
// Future Upgrades - Consider quieter noises if you walk or have no shoes
|
||||||
|
var/volume = config.footstep_volume
|
||||||
|
|
||||||
|
if(!has_organ(BP_L_FOOT) && !has_organ(BP_R_FOOT))
|
||||||
|
return // no feet = no footsteps
|
||||||
|
|
||||||
|
if(buckled || lying || throwing)
|
||||||
|
return // people flying, lying down or sitting do not step
|
||||||
|
|
||||||
|
if(!has_gravity(src) && prob(75))
|
||||||
|
return // Far less likely to make noise in no gravity
|
||||||
|
|
||||||
|
playsound(T, S, volume, FALSE)
|
||||||
|
return
|
||||||
|
|||||||
@@ -570,6 +570,9 @@ default behaviour is:
|
|||||||
for(var/mob/living/carbon/slime/M in view(1,src))
|
for(var/mob/living/carbon/slime/M in view(1,src))
|
||||||
M.UpdateFeed(src)
|
M.UpdateFeed(src)
|
||||||
|
|
||||||
|
/mob/living/proc/handle_footstep(turf/T)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
/mob/living/verb/resist()
|
/mob/living/verb/resist()
|
||||||
set name = "Resist"
|
set name = "Resist"
|
||||||
set category = "IC"
|
set category = "IC"
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ ALIEN_DELAY 0
|
|||||||
METROID_DELAY 0
|
METROID_DELAY 0
|
||||||
ANIMAL_DELAY 0
|
ANIMAL_DELAY 0
|
||||||
|
|
||||||
|
## Volume of footstep sound effects. Range: 1-100, Set to 0 to disable footstep sounds.
|
||||||
|
FOOTSTEP_VOLUME 60
|
||||||
|
|
||||||
### Miscellaneous ###
|
### Miscellaneous ###
|
||||||
|
|
||||||
|
|||||||
4
html/changelogs/Leshana-footstep-sounds.yml
Normal file
4
html/changelogs/Leshana-footstep-sounds.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Leshana
|
||||||
|
delete-after: True
|
||||||
|
changes:
|
||||||
|
- rscadd: "Implements footstep sound system and adds sounds to various floor types including plating, tiles, wood, and carpet."
|
||||||
BIN
sound/effects/footstep/carpet1.ogg
Normal file
BIN
sound/effects/footstep/carpet1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/carpet2.ogg
Normal file
BIN
sound/effects/footstep/carpet2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/carpet3.ogg
Normal file
BIN
sound/effects/footstep/carpet3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/carpet4.ogg
Normal file
BIN
sound/effects/footstep/carpet4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/carpet5.ogg
Normal file
BIN
sound/effects/footstep/carpet5.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/floor1.ogg
Normal file
BIN
sound/effects/footstep/floor1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/floor2.ogg
Normal file
BIN
sound/effects/footstep/floor2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/floor3.ogg
Normal file
BIN
sound/effects/footstep/floor3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/floor4.ogg
Normal file
BIN
sound/effects/footstep/floor4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/floor5.ogg
Normal file
BIN
sound/effects/footstep/floor5.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/hull1.ogg
Normal file
BIN
sound/effects/footstep/hull1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/hull2.ogg
Normal file
BIN
sound/effects/footstep/hull2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/hull3.ogg
Normal file
BIN
sound/effects/footstep/hull3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/hull4.ogg
Normal file
BIN
sound/effects/footstep/hull4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/hull5.ogg
Normal file
BIN
sound/effects/footstep/hull5.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/plating1.ogg
Normal file
BIN
sound/effects/footstep/plating1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/plating2.ogg
Normal file
BIN
sound/effects/footstep/plating2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/plating3.ogg
Normal file
BIN
sound/effects/footstep/plating3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/plating4.ogg
Normal file
BIN
sound/effects/footstep/plating4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/plating5.ogg
Normal file
BIN
sound/effects/footstep/plating5.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/wood1.ogg
Normal file
BIN
sound/effects/footstep/wood1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/wood2.ogg
Normal file
BIN
sound/effects/footstep/wood2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/wood3.ogg
Normal file
BIN
sound/effects/footstep/wood3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/wood4.ogg
Normal file
BIN
sound/effects/footstep/wood4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/wood5.ogg
Normal file
BIN
sound/effects/footstep/wood5.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user