Footstep element (#8576)

This commit is contained in:
Guti
2024-06-28 16:00:23 +02:00
committed by GitHub
parent 5cb31ac195
commit c3e49d6b42
54 changed files with 733 additions and 26 deletions

View File

@@ -0,0 +1,251 @@
#define FOOTSTEP_WOOD "wood"
#define FOOTSTEP_FLOOR "floor"
#define FOOTSTEP_PLATING "plating"
#define FOOTSTEP_CARPET "carpet"
#define FOOTSTEP_SAND "sand"
#define FOOTSTEP_GRASS "grass"
#define FOOTSTEP_WATER "water"
#define FOOTSTEP_LAVA "lava"
#define FOOTSTEP_MEAT "meat"
#define FOOTSTEP_CATWALK "catwalk"
//barefoot sounds
#define FOOTSTEP_WOOD_BAREFOOT "woodbarefoot"
#define FOOTSTEP_WOOD_CLAW "woodclaw"
#define FOOTSTEP_WOOD_LIGHTCLAW "woodlightclaw"
#define FOOTSTEP_HARD_BAREFOOT "hardbarefoot"
#define FOOTSTEP_HARD_CLAW "hardclaw"
#define FOOTSTEP_HARD_LIGHTCLAW "hardlightclaw"
#define FOOTSTEP_CARPET_BAREFOOT "carpetbarefoot"
//misc footstep sounds
#define FOOTSTEP_GENERIC_HEAVY "heavy"
//footstep mob defines
#define FOOTSTEP_MOB_CLAW "footstep_claw"
#define FOOTSTEP_MOB_TESHARI "footstep_lightclaw"
#define FOOTSTEP_MOB_BAREFOOT "footstep_barefoot"
#define FOOTSTEP_MOB_HEAVY "footstep_heavy"
#define FOOTSTEP_MOB_SHOE "footstep_shoe"
#define FOOTSTEP_MOB_HUMAN "footstep_human" //Warning: Only works on /mob/living/carbon/human
#define FOOTSTEP_MOB_SLIME "footstep_slime"
#define FOOTSTEP_OBJ_MACHINE "footstep_machine"
#define FOOTSTEP_OBJ_ROBOT "footstep_robot"
//priority defines for the footstep_override element
#define STEP_SOUND_NO_PRIORITY 0
#define STEP_SOUND_CONVEYOR_PRIORITY 1
#define STEP_SOUND_TABLE_PRIORITY 2
///the name of the index key for priority
#define STEP_SOUND_PRIORITY "step_sound_priority"
/*
Below is how the following lists are defined
id = list(
list(sounds),
base volume,
extra range addition
)
*/
GLOBAL_LIST_INIT(footstep, list(
FOOTSTEP_WOOD = list(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'), 100, 0),
FOOTSTEP_FLOOR = list(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'), 75, -1),
FOOTSTEP_PLATING = list(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'), 100, 1),
FOOTSTEP_CARPET = list(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'), 75, -1),
FOOTSTEP_SAND = list(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'), 75, 0),
FOOTSTEP_GRASS = list(list(
'sound/effects/footstep/grass1.ogg',
'sound/effects/footstep/grass2.ogg',
'sound/effects/footstep/grass3.ogg',
'sound/effects/footstep/grass4.ogg'), 75, 0),
FOOTSTEP_WATER = list(list(
'sound/effects/footstep/water1.ogg',
'sound/effects/footstep/water2.ogg',
'sound/effects/footstep/water3.ogg',
'sound/effects/footstep/water4.ogg'), 100, 1),
FOOTSTEP_LAVA = list(list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'modular_chomp/sound/effects/meatslap.ogg'), 100, 0),
FOOTSTEP_CATWALK = list(list(
'sound/effects/footstep/catwalk1.ogg',
'sound/effects/footstep/catwalk2.ogg',
'sound/effects/footstep/catwalk3.ogg',
'sound/effects/footstep/catwalk4.ogg',
'sound/effects/footstep/catwalk5.ogg'), 100, 1),
))
//bare footsteps lists
GLOBAL_LIST_INIT(barefootstep, list(
FOOTSTEP_WOOD_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/woodbarefoot1.ogg',
'modular_chomp/sound/effects/footstep/woodbarefoot2.ogg',
'modular_chomp/sound/effects/footstep/woodbarefoot3.ogg',
'modular_chomp/sound/effects/footstep/woodbarefoot4.ogg',
'modular_chomp/sound/effects/footstep/woodbarefoot5.ogg'), 80, -1),
FOOTSTEP_HARD_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/hardbarefoot1.ogg',
'modular_chomp/sound/effects/footstep/hardbarefoot2.ogg',
'modular_chomp/sound/effects/footstep/hardbarefoot3.ogg',
'modular_chomp/sound/effects/footstep/hardbarefoot4.ogg',
'modular_chomp/sound/effects/footstep/hardbarefoot5.ogg'), 80, -1),
FOOTSTEP_CARPET_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/carpetbarefoot1.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot2.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot3.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot4.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot5.ogg'), 75, -1),
FOOTSTEP_SAND = list(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'), 75, 0),
FOOTSTEP_GRASS = list(list(
'sound/effects/footstep/grass1.ogg',
'sound/effects/footstep/grass2.ogg',
'sound/effects/footstep/grass3.ogg',
'sound/effects/footstep/grass4.ogg'), 75, 0),
FOOTSTEP_WATER = list(list(
'sound/effects/footstep/water1.ogg',
'sound/effects/footstep/water2.ogg',
'sound/effects/footstep/water3.ogg',
'sound/effects/footstep/water4.ogg'), 100, 1),
FOOTSTEP_LAVA = list(list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'modular_chomp/sound/effects/meatslap.ogg'), 100, 0),
))
//claw footsteps lists
GLOBAL_LIST_INIT(clawfootstep, list(
FOOTSTEP_WOOD_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/woodclaw1.ogg',
'modular_chomp/sound/effects/footstep/woodclaw2.ogg',
'modular_chomp/sound/effects/footstep/woodclaw3.ogg',
'modular_chomp/sound/effects/footstep/woodclaw2.ogg',
'modular_chomp/sound/effects/footstep/woodclaw1.ogg'), 90, 1),
FOOTSTEP_HARD_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/hardclaw1.ogg',
'modular_chomp/sound/effects/footstep/hardclaw2.ogg',
'modular_chomp/sound/effects/footstep/hardclaw3.ogg',
'modular_chomp/sound/effects/footstep/hardclaw4.ogg',
'modular_chomp/sound/effects/footstep/hardclaw1.ogg'), 90, 1),
FOOTSTEP_CARPET_BAREFOOT = list(list(
'modular_chomp/sound/effects/footstep/carpetbarefoot1.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot2.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot3.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot4.ogg',
'modular_chomp/sound/effects/footstep/carpetbarefoot5.ogg'), 75, -2),
FOOTSTEP_SAND = list(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'), 75, 0),
FOOTSTEP_GRASS = list(list(
'sound/effects/footstep/grass1.ogg',
'sound/effects/footstep/grass2.ogg',
'sound/effects/footstep/grass3.ogg',
'sound/effects/footstep/grass4.ogg'), 75, 0),
FOOTSTEP_WATER = list(list(
'sound/effects/footstep/water1.ogg',
'sound/effects/footstep/water2.ogg',
'sound/effects/footstep/water3.ogg',
'sound/effects/footstep/water4.ogg'), 100, 1),
FOOTSTEP_LAVA = list(list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'modular_chomp/sound/effects/meatslap.ogg'), 100, 0),
))
//light claw footsteps list
GLOBAL_LIST_INIT(lightclawfootstep, list(
FOOTSTEP_WOOD_BAREFOOT = list(list(
'sound/effects/footstep/BudgieStep1.ogg',
'sound/effects/footstep/BudgieStep2.ogg',
'sound/effects/footstep/BudgieStep3.ogg',
'sound/effects/footstep/BudgieStep4.ogg',
'sound/effects/footstep/BudgieStep5.ogg',
'sound/effects/footstep/BudgieStep6.ogg'), 90, 1),
FOOTSTEP_HARD_BAREFOOT = list(list(
'sound/effects/footstep/BudgieStep1.ogg',
'sound/effects/footstep/BudgieStep2.ogg',
'sound/effects/footstep/BudgieStep3.ogg',
'sound/effects/footstep/BudgieStep4.ogg',
'sound/effects/footstep/BudgieStep5.ogg',
'sound/effects/footstep/BudgieStep6.ogg'), 90, 1),
FOOTSTEP_CARPET_BAREFOOT = list(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'), 75, -2),
FOOTSTEP_GRASS = list(list(
'sound/effects/footstep/grass1.ogg',
'sound/effects/footstep/grass2.ogg',
'sound/effects/footstep/grass3.ogg',
'sound/effects/footstep/grass4.ogg'), 75, 0),
FOOTSTEP_WATER = list(list(
'sound/effects/footstep/water1.ogg',
'sound/effects/footstep/water2.ogg',
'sound/effects/footstep/water3.ogg',
'sound/effects/footstep/water4.ogg'), 100, 1),
FOOTSTEP_LAVA = list(list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'modular_chomp/sound/effects/meatslap.ogg'), 100, 0),
))
//heavy footsteps list
GLOBAL_LIST_INIT(heavyfootstep, list(
FOOTSTEP_GENERIC_HEAVY = list(list(
'modular_chomp/sound/effects/footstep/heavy1.ogg',
'modular_chomp/sound/effects/footstep/heavy2.ogg'), 100, 2),
FOOTSTEP_WATER = list(list(
'sound/effects/footstep/water1.ogg',
'sound/effects/footstep/water2.ogg',
'sound/effects/footstep/water3.ogg',
'sound/effects/footstep/water4.ogg'), 100, 2),
FOOTSTEP_LAVA = list(list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.ogg'), 100, 0),
FOOTSTEP_MEAT = list(list(
'modular_chomp/sound/effects/meatslap.ogg'), 100, 0),
))

View File

@@ -0,0 +1,11 @@
GLOBAL_LIST_INIT(slosh, list(
'sound/vore/walkslosh2.ogg',
'sound/vore/walkslosh3.ogg',
'sound/vore/walkslosh4.ogg',
'sound/vore/walkslosh5.ogg',
'sound/vore/walkslosh6.ogg',
'sound/vore/walkslosh7.ogg',
'sound/vore/walkslosh8.ogg',
'sound/vore/walkslosh9.ogg',
'sound/vore/walkslosh10.ogg'
))

View File

@@ -1,5 +1,5 @@
/decl/flooring
var/list/vorefootstep_sounds = list() // key=species name, value = list of sounds, used for reagent sloshing in vore belly
/* var/list/vorefootstep_sounds = list() // key=species name, value = list of sounds, used for reagent sloshing in vore belly
vorefootstep_sounds = list("human" = list(
'sound/vore/walkslosh1.ogg',
@@ -12,6 +12,7 @@
'sound/vore/walkslosh8.ogg',
'sound/vore/walkslosh9.ogg',
'sound/vore/walkslosh10.ogg'))
*/
/turf/simulated/floor/boxing
name = "boxing mat"
@@ -20,4 +21,4 @@
/turf/simulated/floor/boxing/gym
name = "gym mat"
icon_state = "gym_mat"
icon_state = "gym_mat"

View File

@@ -187,6 +187,11 @@
icon_state = "grass0"
can_dirty = FALSE //VOREStation Edit
initial_flooring = /decl/flooring/grass
// CHOMPAdd - Grass has grass footsteps
footstep = FOOTSTEP_GRASS
barefootstep = FOOTSTEP_GRASS
clawfootstep = FOOTSTEP_GRASS
// CHOMPEnd
/turf/simulated/floor/tiled
name = "floor"
@@ -515,7 +520,7 @@
/turf/simulated/floor/snow/plating/drift
name = "snowy plating"
icon_state = "snowyplayingdrift"
initial_flooring = /decl/flooring/snow/plating/drift
initial_flooring = /decl/flooring/snow/plating/drift
// TODO: Move foortprints to a datum-component signal so they can actually be applied to other turf types, like sand, or mud
/turf/simulated/floor/snow/Entered(atom/A)

View File

@@ -13,7 +13,7 @@
var/base_desc = "The naked hull."
var/base_icon = 'icons/turf/flooring/plating_vr.dmi'
var/base_icon_state = "plating"
var/static/list/base_footstep_sounds = list("human" = list(
/* var/static/list/base_footstep_sounds = list("human" = list(
'sound/effects/footstep/plating1.ogg',
'sound/effects/footstep/plating2.ogg',
'sound/effects/footstep/plating3.ogg',
@@ -26,7 +26,7 @@
'sound/effects/footstep/BudgieStep4.ogg',
'sound/effects/footstep/BudgieStep5.ogg',
'sound/effects/footstep/BudgieStep6.ogg',
)) // CHOMPedit: tesh steps
))*/ // CHOMPedit: tesh steps CHOMPEdit - Better footsteps
var/list/old_decals = null
@@ -50,9 +50,9 @@
if(floortype)
set_flooring(get_flooring_data(floortype), TRUE)
. = INITIALIZE_HINT_LATELOAD // We'll update our icons after everyone is ready
else
vorefootstep_sounds = base_vorefootstep_sounds //CHOMPstation edit
footstep_sounds = base_footstep_sounds
// else
// vorefootstep_sounds = base_vorefootstep_sounds //CHOMPstation edit
// footstep_sounds = base_footstep_sounds CHOMPEdit - Better footsteps
if(can_dirty && can_start_dirty)
if(prob(dirty_prob))
dirt += rand(50,100)
@@ -72,8 +72,8 @@
if(is_plating() && !initializing) // Plating -> Flooring
swap_decals()
flooring = newflooring
vorefootstep_sounds = newflooring.vorefootstep_sounds //CHOMPstation edit
footstep_sounds = newflooring.footstep_sounds
// vorefootstep_sounds = newflooring.vorefootstep_sounds //CHOMPstation edit
// footstep_sounds = newflooring.footstep_sounds CHOMPEdit - Better footsteps
if(!initializing)
update_icon(1)
levelupdate()
@@ -90,8 +90,8 @@
desc = base_desc
icon = base_icon
icon_state = base_icon_state
vorefootstep_sounds = base_vorefootstep_sounds //CHOMPstation edit
footstep_sounds = base_footstep_sounds
// vorefootstep_sounds = base_vorefootstep_sounds //CHOMPstation edit
// footstep_sounds = base_footstep_sounds CHOMPEdit - Better footsteps
if(!is_plating()) // Flooring -> Plating
swap_decals()

View File

@@ -24,8 +24,8 @@
/turf/simulated/floor/water/Initialize()
. = ..()
var/decl/flooring/F = get_flooring_data(/decl/flooring/water)
footstep_sounds = F?.footstep_sounds
// var/decl/flooring/F = get_flooring_data(/decl/flooring/water) - CHOMPEdit
// footstep_sounds = F?.footstep_sounds CHOMPEdit - Footsteps
update_icon()
handle_fish()
// soundloop = new(list(src), FALSE) // CHOMPEdit: Removing soundloop for now.

View File

@@ -41,8 +41,8 @@
var/movement_cost = 0 // How much the turf slows down movement, if any.
var/list/footstep_sounds = null
var/list/vorefootstep_sounds = null //CHOMPstation edit
// var/list/footstep_sounds = null CHOMPEdit - Better footstep sounds
// var/list/vorefootstep_sounds = null //CHOMPstation edit
var/block_tele = FALSE // If true, most forms of teleporting to or from this turf tile will fail.
var/can_build_into_floor = FALSE // Used for things like RCDs (and maybe lattices/floor tiles in the future), to see if a floor should replace it.

View File

@@ -214,8 +214,8 @@ var/list/mining_overlay_cache = list()
if(random_icon)
dir = pick(alldirs)
. = INITIALIZE_HINT_LATELOAD
var/decl/flooring/F = get_flooring_data(/decl/flooring/sand)
footstep_sounds = F?.footstep_sounds
// var/decl/flooring/F = get_flooring_data(/decl/flooring/sand) - CHOMPEdit
// footstep_sounds = F?.footstep_sounds CHOMPEdit footsteps
/turf/simulated/mineral/LateInitialize()
if(density && mineral)

View File

@@ -259,6 +259,7 @@
// Handle footstep sounds
/mob/living/carbon/human/handle_footstep(var/turf/T)
/*CHOMPEdit - This is an Element now
if(!istype(T) || is_incorporeal() || !CONFIG_GET(number/footstep_volume) || !T.footstep_sounds || !T.footstep_sounds.len) // CHOMPEdit
return //CHOMPEdit - Condensed some return checks
// CHOMPedit start: Future Upgrades - Multi species support
@@ -277,9 +278,11 @@
// Play every other step while running
if(m_intent == "run" && step_count++ % 2 != 0)
check_vorefootstep(m_intent, T) //CHOMPstation edit: sloshing reagent belly walk system
*/
if(shoes && loc == T && has_gravity(loc) && !flying)
if(SEND_SIGNAL(shoes, COMSIG_SHOES_STEP_ACTION, m_intent)) //CHOMPEdit - Shoe step comsig
return
/*
if(step_count % 2 == 0) //CHOMPAdd, since I removed the returns up above, need this to track each odd step.
return
@@ -303,6 +306,7 @@
return // Far less likely to make noise in no gravity
playsound(T, S, volume, FALSE)
*/
return
/mob/living/carbon/human/set_dir(var/new_dir)

View File

@@ -1,5 +1,5 @@
//CHOMP reagent vore belly sloshing
/* This is an ELEMENT now
// Handle footstep sounds
/mob/living/carbon/human/handle_vorefootstep(var/m_intent, var/turf/T)
@@ -29,3 +29,4 @@
return // Far less likely to make noise in no gravity
playsound(T, S, volume, FALSE, preference = /datum/client_preference/digestion_noises)
return
*/

View File

@@ -109,6 +109,8 @@
var/gasp_volume = 50 // Self-explanatory, define this separately on your species if the sound files are louder.
var/death_volume = 50 // Self-explanatory, define this separately on your species if the sound files are louder.
// var/species_sounds_herm // If you want a custom sound played for other genders, just add them like so
var/footstep = FOOTSTEP_MOB_HUMAN
var/list/special_step_sounds = null
// CHOMPEdit End
// Combat/health/chem/etc. vars.
@@ -349,6 +351,9 @@
inherent_verbs |= /mob/living/carbon/human/proc/regurgitate
update_sort_hint()
// CHOMPadd
/datum/species/proc/get_footstep_sounds()
return footstep
/datum/species/proc/update_sort_hint()
if(spawn_flags & SPECIES_IS_RESTRICTED)

View File

@@ -137,6 +137,8 @@ var/datum/species/shapeshifter/promethean/prometheans
/decl/emote/visible/vibrate
)
footstep = FOOTSTEP_MOB_SLIME // CHOMPEdit
/datum/species/shapeshifter/promethean/New()
..()
prometheans = src

View File

@@ -90,6 +90,7 @@
// CHOMPEdit: Reverted these back to Polaris, but commented them out. We're using species-specific sounds instead.
// male_scream_sound = list ('sound/effects/mob_effects/una_scream1.ogg','sound/effects/mob_effects/una_scream2.ogg')
// female_scream_sound = list ('sound/effects/mob_effects/una_scream1.ogg','sound/effects/mob_effects/una_scream2.ogg')
footstep = FOOTSTEP_MOB_CLAW // CHOMPEdit
species_sounds = "Lizard" // Species sounds
pain_verb_1p = list("hiss", "growl") // CHOMPEdit: Unathi pain emotes

View File

@@ -21,6 +21,7 @@
// CHOMPEdit Start: Species Sounds
species_sounds = "Teshari"
footstep = FOOTSTEP_MOB_TESHARI // CHOMPEdit
// male_cough_sounds = list('sound/effects/mob_effects/tesharicougha.ogg','sound/effects/mob_effects/tesharicoughb.ogg')
// female_cough_sounds = list('sound/effects/mob_effects/tesharicougha.ogg','sound/effects/mob_effects/tesharicoughb.ogg')
// male_sneeze_sound = 'sound/effects/mob_effects/tesharisneeze.ogg'

View File

@@ -1400,3 +1400,10 @@
to_chat(src, SPAN_NOTICE("You are [toggled_sleeping ? "now sleeping. Use the Sleep verb again to wake up" : "no longer sleeping"]."))
if(toggled_sleeping)
Sleeping(1)
// CHOMPAdd - Everyone starts as a human, augh.
/mob/living/proc/set_footsteps(footstep_sounds = FOOTSTEP_MOB_HUMAN)
AddElement(/datum/element/footstep, footstep_sounds, 1, -6)
/mob/living/proc/set_slosh()
AddElement(/datum/element/slosh)

View File

@@ -37,6 +37,8 @@
init_id()
init_subsystems()
set_slosh() // CHOMPAdd - Slosh element, for VORE
/mob/living/silicon/Destroy()
silicon_mob_list -= src
for(var/datum/alarm_handler/AH in SSalarm.all_handlers)

View File

@@ -761,6 +761,9 @@
new_character.update_icons_body()
new_character.update_transform() //VOREStation Edit
new_character.set_footsteps(chosen_species.footstep) // CHOMPEdit
new_character.set_slosh() //CHOMPEdit
new_character.key = key //Manually transfer the key to log them in
return new_character

View File

@@ -1,9 +1,9 @@
///////////////////// Mob Living /////////////////////
/mob/living
var/list/vore_organs_reagents = list() //Reagent datums in vore bellies in a mob
var/vore_footstep_volume = 0 //Variable volume for a mob, updated every 5 steps where a footstep hasnt occurred.
var/vore_footstep_chance = 0
var/vore_footstep_volume_cooldown = 0 //goes up each time a step isnt heard, and will proc update of list of viable bellies to determine the most filled and loudest one to base audio on.
// var/list/vore_organs_reagents = list() //Reagent datums in vore bellies in a mob
// var/vore_footstep_volume = 0 //Variable volume for a mob, updated every 5 steps where a footstep hasnt occurred.
// var/vore_footstep_chance = 0
// var/vore_footstep_volume_cooldown = 0 //goes up each time a step isnt heard, and will proc update of list of viable bellies to determine the most filled and loudest one to base audio on.
var/mute_entry = FALSE //Toggleable vorgan entry logs.
var/parasitic = FALSE //Digestion immunity and nutrition leeching variable
var/liquidbelly_visuals = TRUE //Toggle for liquidbelly level visuals.
@@ -54,7 +54,7 @@
updating_fullness = FALSE
return new_fullness
/* This is an ELEMENT now
/mob/living/proc/check_vorefootstep(var/m_intent, var/turf/T)
if(vore_footstep_volume_cooldown++ >= 5) //updating the 'dominating' belly, the one that has most liquid and is loudest.
choose_vorefootstep()
@@ -85,7 +85,7 @@
else //Volume will start at least at 20 so theres more initial sound
vore_footstep_volume = 20 + highest_vol * 4/5
vore_footstep_chance = highest_vol/4
*/
//
// Returns examine messages for how much reagents are in bellies

View File

@@ -0,0 +1,2 @@
#define COMSIG_TURF_PREPARE_STEP_SOUND "turf_prepare_step_sound"
#define FOOTSTEP_OVERRIDEN (1<<0)

View File

@@ -0,0 +1,171 @@
#define SHOULD_DISABLE_FOOTSTEPS(source)
///Footstep element. Plays footsteps at parents location when it is appropriate.
/datum/element/footstep
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY|ELEMENT_BESPOKE
argument_hash_start_idx = 2
///A list containing living mobs and the number of steps they have taken since the last time their footsteps were played.
var/list/steps_for_living = list()
///volume determines the extra volume of the footstep. This is multiplied by the base volume, should there be one.
var/volume
///e_range stands for extra range - aka how far the sound can be heard. This is added to the base value and ignored if there isn't a base value.
var/e_range
///footstep_type is a define which determines what kind of sounds should get chosen.
var/footstep_type
///This can be a list OR a soundfile OR null. Determines whatever sound gets played.
var/footstep_sounds
///Whether or not to add variation to the sounds played
var/sound_vary = FALSE
/datum/element/footstep/Attach(datum/target, footstep_type = FOOTSTEP_MOB_BAREFOOT, volume = 0.5, e_range = -8, sound_vary = FALSE)
. = ..()
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
src.volume = volume
src.e_range = e_range
src.footstep_type = footstep_type
src.sound_vary = sound_vary
if(ishuman(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_humanstep))
steps_for_living[target] = 0
return
footstep_sounds = check_footstep_type(footstep_type)
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep))
steps_for_living[target] = 0
/datum/element/footstep/proc/check_footstep_type(footstep_type)
var/footstep_ret
switch(footstep_type)
if(FOOTSTEP_MOB_TESHARI)
footstep_ret = GLOB.lightclawfootstep
if(FOOTSTEP_MOB_CLAW)
footstep_ret = GLOB.clawfootstep
if(FOOTSTEP_MOB_BAREFOOT)
footstep_ret = GLOB.barefootstep
if(FOOTSTEP_MOB_HEAVY)
footstep_ret = GLOB.heavyfootstep
if(FOOTSTEP_MOB_SHOE)
footstep_ret = GLOB.footstep
if(FOOTSTEP_MOB_SLIME)
footstep_ret = 'modular_chomp/sound/effects/footstep/slime1.ogg'
return footstep_ret
/datum/element/footstep/Detach(atom/movable/source)
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
steps_for_living -= source
return ..()
///Prepares a footstep for living mobs. Determines if it should get played. Returns the turf it should get played on. Note that it is always a /turf/simulated
/datum/element/footstep/proc/prepare_step(mob/living/source)
var/turf/simulated/turf = get_turf(source)
if(!istype(turf))
return
if(source.is_incorporeal())
return
if(source.buckled || source.throwing || source.movement_type & (source.is_ventcrawling | source.flying))
return
if(source.lying) //play crawling sound if we're lying
if(turf.footstep)
playsound(turf, 'modular_chomp/sound/effects/footstep/crawl1.ogg', 15 * volume, falloff = 1, vary = sound_vary)
return
if(iscarbon(source))
var/mob/living/carbon/carbon_source = source
if(!carbon_source.get_organ(BP_L_LEG) && !carbon_source.get_organ(BP_R_LEG))
return
if(carbon_source.m_intent == "walk")
return// stealth
steps_for_living[source] += 1
var/steps = steps_for_living[source]
if(steps >= 6)
steps_for_living[source] = 0
steps = 0
if(steps % 2)
return
if(steps != 0 && !has_gravity(source)) // don't need to step as often when you hop around
return
. = list(FOOTSTEP_MOB_SHOE = turf.footstep, FOOTSTEP_MOB_BAREFOOT = turf.barefootstep, FOOTSTEP_MOB_HEAVY = turf.heavyfootstep, FOOTSTEP_MOB_CLAW = turf.clawfootstep, STEP_SOUND_PRIORITY = STEP_SOUND_NO_PRIORITY)
var/overriden = SEND_SIGNAL(turf, COMSIG_TURF_PREPARE_STEP_SOUND, .) & FOOTSTEP_OVERRIDEN
//The turf has no footstep sound (e.g. open space) and none of the objects on that turf (e.g. catwalks) overrides it
if(!overriden && isnull(turf.footstep))
return null
return .
/datum/element/footstep/proc/play_simplestep(mob/living/source, atom/oldloc, direction, forced, list/old_locs, momentum_change)
SIGNAL_HANDLER
var/list/prepared_steps = prepare_step(source)
if(isnull(prepared_steps))
return
if(isfile(footstep_sounds) || istext(footstep_sounds))
playsound(source.loc, footstep_sounds, volume, falloff = 1, vary = sound_vary)
return
var/turf_footstep = prepared_steps[footstep_type]
if(isnull(turf_footstep) || !footstep_sounds[turf_footstep])
return
playsound(source.loc, pick(footstep_sounds[turf_footstep][1]), footstep_sounds[turf_footstep][2] * volume, TRUE, footstep_sounds[turf_footstep][3] + e_range, falloff = 1, vary = sound_vary)
/datum/element/footstep/proc/play_humanstep(mob/living/carbon/human/source, atom/oldloc, direction, forced, list/old_locs, momentum_change)
SIGNAL_HANDLER
var/volume_multiplier = 1
var/range_adjustment = 0
var/list/prepared_steps = prepare_step(source)
if(isnull(prepared_steps))
return
//cache for sanic speed (lists are references anyways)
var/footstep_sounds = GLOB.footstep
if( source.shoes || ( source.wear_suit && (source.wear_suit.body_parts_covered & FEET) ) )
// we are wearing shoes
var/shoestep_type = prepared_steps[FOOTSTEP_MOB_SHOE]
if(!isnull(shoestep_type) && footstep_sounds[shoestep_type]) // shoestep type can be null
playsound(source.loc, pick(footstep_sounds[shoestep_type][1]),
footstep_sounds[shoestep_type][2] * volume * volume_multiplier,
TRUE,
footstep_sounds[shoestep_type][3] + e_range + range_adjustment, falloff = 1, vary = sound_vary)
else
// we are barefoot
if(source.species.special_step_sounds)
playsound(source.loc, pick(source.species.special_step_sounds), 50, TRUE, falloff = 1, vary = sound_vary)
else if (istype(source.species, /datum/species/shapeshifter/promethean))
playsound(source.loc, 'modular_chomp/sound/effects/footstep/slime1.ogg', 25, TRUE, falloff = 1)
else
var/barefoot_type = prepared_steps[FOOTSTEP_MOB_BAREFOOT]
var/bare_footstep_sounds
if(source.species.footstep != FOOTSTEP_MOB_HUMAN)
bare_footstep_sounds = check_footstep_type(source.species.footstep)
else
bare_footstep_sounds = GLOB.barefootstep
if(!isnull(barefoot_type) && bare_footstep_sounds[barefoot_type]) // barefoot_type can be null
playsound(source.loc, pick(bare_footstep_sounds[barefoot_type][1]),
bare_footstep_sounds[barefoot_type][2] * volume * volume_multiplier,
TRUE,
bare_footstep_sounds[barefoot_type][3] + e_range + range_adjustment, falloff = 1, vary = sound_vary)
///Prepares a footstep for machine walking
/datum/element/footstep/proc/play_simplestep_machine(atom/movable/source, atom/oldloc, direction, forced, list/old_locs, momentum_change)
SIGNAL_HANDLER
var/turf/simulated/source_loc = get_turf(source)
if(!istype(source_loc))
return
playsound(source_loc, footstep_sounds, 50, falloff = 1, vary = sound_vary)
#undef SHOULD_DISABLE_FOOTSTEPS

View File

@@ -0,0 +1,81 @@
///When attached, the footstep sound played by the footstep element will be replaced by this one's
/datum/element/footstep_override
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH_ON_HOST_DESTROY
argument_hash_start_idx = 2
///The sound played for movables with claw step sound type.
var/clawfootstep
///The sound played for movables with barefoot step sound type.
var/barefootstep
///The sound played for movables with heavy step sound type.
var/heavyfootstep
///The sound played for movables with shoed step sound type.
var/footstep
///The priority this element has in relation to other elements of the same type attached to other movables on the same turf.
var/priority
/**
* A list of turfs occupied by the movables this element is attached to.
* Needed so it stops listening the turf's signals ONLY when it has no movable with the element.
*/
var/list/occupied_turfs = list()
/datum/element/footstep_override/Attach(atom/movable/target, clawfootstep = FOOTSTEP_HARD_CLAW, barefootstep = FOOTSTEP_HARD_BAREFOOT, heavyfootstep = FOOTSTEP_GENERIC_HEAVY, footstep = FOOTSTEP_FLOOR, priority = STEP_SOUND_NO_PRIORITY)
. = ..()
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
src.clawfootstep = clawfootstep
src.barefootstep = barefootstep
src.heavyfootstep = heavyfootstep
src.footstep = footstep
src.priority = priority
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
if(isturf(target.loc))
occupy_turf(target, target.loc)
/datum/element/footstep_override/Detach(atom/movable/source)
if(isturf(source.loc))
vacate_turf(source, source.loc)
return ..()
/datum/element/footstep_override/proc/on_moved(atom/movable/source, atom/oldloc)
SIGNAL_HANDLER
if(isturf(oldloc))
vacate_turf(source, oldloc)
if(isturf(source.loc))
occupy_turf(source, source.loc)
/**
* Adds the movable to the list of movables with the element occupying the turf.
* If the turf was not on the list of occupied turfs before, a signal will be registered
* to it.
*/
/datum/element/footstep_override/proc/occupy_turf(atom/movable/movable, turf/location)
if(occupied_turfs[location])
occupied_turfs[location] |= movable
return
occupied_turfs[location] = list(movable)
RegisterSignal(location, COMSIG_TURF_PREPARE_STEP_SOUND, PROC_REF(prepare_steps))
/**
* Removes the movable from the list of movables with the element occupying the turf.
* If the turf is no longer occupied, it'll be removed from the list, and the signal
* unregistered from it
*/
/datum/element/footstep_override/proc/vacate_turf(atom/movable/movable, turf/location)
LAZYREMOVE(occupied_turfs[location], movable)
if(!occupied_turfs[location])
occupied_turfs -= location
UnregisterSignal(location, COMSIG_TURF_PREPARE_STEP_SOUND)
///Changes the sound types to be played if the element priority is higher than the one in the steps list.
/datum/element/footstep_override/proc/prepare_steps(turf/source, list/steps)
SIGNAL_HANDLER
if(steps[STEP_SOUND_PRIORITY] > priority)
return
steps[FOOTSTEP_MOB_SHOE] = footstep
steps[FOOTSTEP_MOB_BAREFOOT] = barefootstep
steps[FOOTSTEP_MOB_HEAVY] = heavyfootstep
steps[FOOTSTEP_MOB_CLAW] = clawfootstep
steps[STEP_SOUND_PRIORITY] = priority
return FOOTSTEP_OVERRIDEN

View File

@@ -0,0 +1,94 @@
/datum/element/slosh
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY|ELEMENT_BESPOKE
var/step_count
var/vore_organs_reagents
var/vore_footstep_volume
var/vore_footstep_chance
/datum/element/slosh/Attach(datum/target)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(handle_footstep))
step_count = 0
vore_organs_reagents = list()
vore_footstep_volume = 0
vore_footstep_chance = 0
return
/datum/element/slosh/Detach(datum/source)
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
step_count -= source
return ..()
/datum/element/slosh/proc/handle_footstep(mob/living/source)
SIGNAL_HANDLER
if(ishuman(source))
var/mob/living/carbon/human/source_human = source
if(source_human.m_intent == "walk" && step_count++ % 20 == 0)
return
if(source_human.m_intent == "run" && step_count++ % 2 != 0)
return
choose_vorefootstep(source)
if(issilicon(source))
if(step_count++ % 2)
choose_vorefootstep(source)
/datum/element/slosh/proc/choose_vorefootstep(mob/living/source)
if(step_count++ >= 5)
vore_organs_reagents = list()
var/highest_vol = 0
for(var/obj/belly/B in source.vore_organs)
var/total_volume = B.reagents.total_volume
vore_organs_reagents += total_volume
if(B.show_liquids && B.vorefootsteps_sounds && highest_vol < total_volume)
highest_vol = total_volume
if(highest_vol < 20)
vore_footstep_volume = 0
vore_footstep_chance = 0
else
vore_footstep_volume = 20 + highest_vol * 4/5
vore_footstep_chance = highest_vol/4
step_count = 0
if(!vore_footstep_volume || !vore_footstep_chance)
return
if(prob(vore_footstep_chance))
handle_vorefootstep(source)
/datum/element/slosh/proc/handle_vorefootstep(mob/living/source)
if(!CONFIG_GET(number/vorefootstep_volume) || !vore_footstep_volume)
return
var/S = pick(GLOB.slosh)
if(!S) return
var/volume = CONFIG_GET(number/vorefootstep_volume) * (vore_footstep_volume/100)
if(ishuman(source))
var/mob/living/carbon/human/human_source = source
if(!human_source.shoes || human_source.m_intent == "walk")
volume = CONFIG_GET(number/vorefootstep_volume) * (vore_footstep_volume/100) * 0.75
else if(human_source.shoes)
var/obj/item/clothing/shoes/feet = human_source.shoes
if(istype(feet))
volume = feet.step_volume_mod * CONFIG_GET(number/vorefootstep_volume) * (vore_footstep_volume/100) * 0.75
if(!human_source.has_organ(BP_L_FOOT) && !human_source.has_organ(BP_R_FOOT))
return
if(source.buckled || source.lying || source.throwing)
return
if(!has_gravity(source) && prob(75))
return
playsound(source.loc, S, volume, FALSE, preference = /datum/client_preference/digestion_noises)
return

View File

@@ -1,2 +1,52 @@
/turf
var/blocks_nonghost_incorporeal = FALSE
var/footstep
var/barefootstep
var/heavyfootstep
var/clawfootstep
/turf/simulated/floor
footstep = FOOTSTEP_FLOOR
barefootstep = FOOTSTEP_HARD_BAREFOOT
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
clawfootstep = FOOTSTEP_HARD_CLAW
/turf/simulated/floor/wood
footstep = FOOTSTEP_WOOD
barefootstep = FOOTSTEP_WOOD_BAREFOOT
clawfootstep = FOOTSTEP_WOOD_CLAW
/turf/simulated/floor/carpet
footstep = FOOTSTEP_CARPET
barefootstep = FOOTSTEP_CARPET_BAREFOOT
clawfootstep = FOOTSTEP_CARPET_BAREFOOT
/turf/simulated/floor/plating
footstep = FOOTSTEP_PLATING
barefootstep = FOOTSTEP_HARD_BAREFOOT
clawfootstep = FOOTSTEP_HARD_CLAW
/turf/simulated/mineral
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
/turf/simulated/floor/outdoors
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
/turf/simulated/floor/outdoors/grass
footstep = FOOTSTEP_GRASS
barefootstep = FOOTSTEP_GRASS
clawfootstep = FOOTSTEP_GRASS
/turf/simulated/floor/water
footstep = FOOTSTEP_WATER
barefootstep = FOOTSTEP_WATER
clawfootstep = FOOTSTEP_WATER
/turf/simulated/floor/lava
footstep = FOOTSTEP_LAVA
barefootstep = FOOTSTEP_LAVA
clawfootstep = FOOTSTEP_LAVA

View File

@@ -229,3 +229,11 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
if(reopen)
ooc_notes_window(user)
//ChompEDIT END - Removal of usr
/mob/living/revive()
..()
RemoveElement(/datum/element/footstep)
if(ishuman(src))
var/mob/living/carbon/human/H = src
H.set_footsteps(H.species.footstep)

View File

@@ -1,5 +1,5 @@
//CHOMP reagent vore belly sloshing
/* This is an ELEMENT now
/mob/living/silicon/robot
var/step_count = 0
@@ -28,3 +28,4 @@
return // Far less likely to make noise in no gravity
playsound(T, S, volume, FALSE, preference = /datum/client_preference/digestion_noises)
return
*/

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

@@ -65,6 +65,7 @@
#include "code\__defines\events.dm"
#include "code\__defines\exosuit_fab.dm"
#include "code\__defines\flags.dm"
#include "code\__defines\footsteps_ch.dm"
#include "code\__defines\gamemode.dm"
#include "code\__defines\holder.dm"
#include "code\__defines\holomap.dm"
@@ -129,6 +130,7 @@
#include "code\__defines\shuttle.dm"
#include "code\__defines\simple_mob.dm"
#include "code\__defines\size.dm"
#include "code\__defines\slosh_ch.dm"
#include "code\__defines\sound.dm"
#include "code\__defines\span_vr.dm"
#include "code\__defines\species_languages.dm"
@@ -4674,6 +4676,7 @@
#include "modular_chomp\code\__defines\_planes+layers.dm"
#include "modular_chomp\code\__defines\span.dm"
#include "modular_chomp\code\__defines\text.dm"
#include "modular_chomp\code\__defines\dcs\signals\signals_turf.dm"
#include "modular_chomp\code\_global_vars\tgui.dm"
#include "modular_chomp\code\_global_vars\list\names.dm"
#include "modular_chomp\code\_HELPERS\announcements.dm"
@@ -4693,6 +4696,9 @@
#include "modular_chomp\code\datums\components\xenoqueen.dm"
#include "modular_chomp\code\datums\crafting\items.dm"
#include "modular_chomp\code\datums\crafting\recipes.dm"
#include "modular_chomp\code\datums\elements\footstep.dm"
#include "modular_chomp\code\datums\elements\footstep_override.dm"
#include "modular_chomp\code\datums\elements\slosh.dm"
#include "modular_chomp\code\datums\outfits\jobs\cargo.dm"
#include "modular_chomp\code\datums\outfits\jobs\command.dm"
#include "modular_chomp\code\datums\outfits\jobs\noncrew.dm"