Ports walking element (#20822)

* Ports TG walking element

* removes call to now-removed component

* removes now-unused var
This commit is contained in:
John Willard
2023-11-05 00:29:59 -04:00
committed by GitHub
parent e74dd71bf3
commit 024824cb75
48 changed files with 363 additions and 251 deletions

View File

@@ -9,3 +9,8 @@
#define COMSIG_TURF_AFTER_SHUTTLE_MOVE "turf_after_shuttle_move" //! from base of turf/proc/afterShuttleMove: (turf/new_turf)
///from base of /datum/turf_reservation/proc/Release: (datum/turf_reservation/reservation)
#define COMSIG_TURF_RESERVATION_RELEASED "turf_reservation_released"
///from /datum/element/footstep/prepare_step(): (list/steps)
#define COMSIG_TURF_PREPARE_STEP_SOUND "turf_prepare_step_sound"
///from base of datum/thrownthing/finalize(): (turf/turf, atom/movable/thrownthing) when something is thrown and lands on us
#define COMSIG_TURF_MOVABLE_THROW_LANDED "turf_movable_throw_landed"

View File

@@ -6,6 +6,7 @@
#define FOOTSTEP_GRASS "grass"
#define FOOTSTEP_WATER "water"
#define FOOTSTEP_LAVA "lava"
#define FOOTSTEP_CATWALK "catwalk"
//barefoot sounds
#define FOOTSTEP_WOOD_BAREFOOT "woodbarefoot"
#define FOOTSTEP_WOOD_CLAW "woodclaw"
@@ -15,6 +16,25 @@
//misc footstep sounds
#define FOOTSTEP_GENERIC_HEAVY "heavy"
//footstep mob defines
#define FOOTSTEP_MOB_CLAW "footstep_claw"
#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_MOB_RUST "footstep_rust"
#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"
/*
id = list(
@@ -22,8 +42,6 @@ list(sounds),
base volume,
extra range addition
)
*/
GLOBAL_LIST_INIT(footstep, list(
@@ -71,6 +89,12 @@ GLOBAL_LIST_INIT(footstep, list(
'sound/effects/footstep/lava1.ogg',
'sound/effects/footstep/lava2.ogg',
'sound/effects/footstep/lava3.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(

View File

@@ -165,47 +165,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
#define issupplypod(A) (istype(A, /obj/structure/closet/supplypod))
GLOBAL_LIST_INIT(shoefootmob, typecacheof(list(
/mob/living/carbon/human/,
/mob/living/simple_animal/cow,
/mob/living/simple_animal/hostile/cat_butcherer,
/mob/living/simple_animal/hostile/faithless,
/mob/living/simple_animal/hostile/nanotrasen,
/mob/living/simple_animal/hostile/pirate,
/mob/living/simple_animal/hostile/russian,
/mob/living/simple_animal/hostile/syndicate,
/mob/living/simple_animal/hostile/wizard,
/mob/living/simple_animal/hostile/zombie,
/mob/living/simple_animal/hostile/retaliate/clown,
/mob/living/simple_animal/hostile/retaliate/spaceman,
/mob/living/simple_animal/hostile/retaliate/nanotrasenpeace,
/mob/living/simple_animal/hostile/retaliate/goat,
/mob/living/carbon/true_devil,
)))
GLOBAL_LIST_INIT(clawfootmob, typecacheof(list(
/mob/living/carbon/alien/humanoid,
/mob/living/simple_animal/hostile/alien,
/mob/living/simple_animal/pet/cat,
/mob/living/simple_animal/pet/dog,
/mob/living/simple_animal/pet/fox,
/mob/living/simple_animal/chicken,
/mob/living/simple_animal/hostile/bear,
/mob/living/simple_animal/hostile/jungle/mega_arachnid
)))
GLOBAL_LIST_INIT(barefootmob, typecacheof(list(
/mob/living/carbon/monkey,
/mob/living/simple_animal/pet/penguin,
/mob/living/simple_animal/hostile/gorilla,
/mob/living/simple_animal/hostile/jungle/mook
)))
GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list(
/mob/living/simple_animal/hostile/megafauna,
/mob/living/simple_animal/hostile/jungle/leaper
)))
//Misc mobs
#define isobserver(A) (istype(A, /mob/dead/observer))
@@ -221,15 +180,6 @@ GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list(
#define iseminence(A) (istype(A, /mob/camera/eminence))
//Footstep helpers
#define isshoefoot(A) (is_type_in_typecache(A, GLOB.shoefootmob))
#define isclawfoot(A) (is_type_in_typecache(A, GLOB.clawfootmob))
#define isbarefoot(A) (is_type_in_typecache(A, GLOB.barefootmob))
#define isheavyfoot(A) (is_type_in_typecache(A, GLOB.heavyfootmob))
//Objects
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs

View File

@@ -272,6 +272,8 @@
#define TRAIT_BADMAIL "badmail" //Your mail is going to be worse than average
#define TRAIT_SHORT_TELOMERES "short_telomeres" //You cannot be CLOONED
#define TRAIT_LONG_TELOMERES "long_telomeres" //You get CLOONED faster!!!
/// makes your footsteps completely silent
#define TRAIT_SILENT_FOOTSTEPS "silent_footsteps"
/// Immune to being afflicted by time stop (spell)
#define TRAIT_TIME_STOP_IMMUNE "time_stop_immune"
/// This mob has no soul
@@ -317,7 +319,7 @@
#define TRAIT_AGEUSIA "ageusia"
#define TRAIT_HEAVY_SLEEPER "heavy_sleeper"
#define TRAIT_NIGHT_VISION "night_vision"
#define TRAIT_LIGHT_STEP "light_step"
#define TRAIT_LIGHT_STEP "light_step"
#define TRAIT_SPIRITUAL "spiritual"
#define TRAIT_VORACIOUS "voracious"
#define TRAIT_SELF_AWARE "self_aware"
@@ -363,6 +365,7 @@
/// The item is magically cursed
#define CURSED_ITEM_TRAIT(item_type) "cursed_item_[item_type]"
#define ABSTRACT_ITEM_TRAIT "abstract-item"
#define PSEUDOCIDER_TRAIT "pseudocider_trait"
#define STATUS_EFFECT_TRAIT "status-effect"
#define CLOTHING_TRAIT "clothing"
#define VEHICLE_TRAIT "vehicle" // inherited from riding vehicles

View File

@@ -1,107 +0,0 @@
/datum/component/footstep
var/steps = 0
var/volume
var/e_range
/datum/component/footstep/Initialize(volume_ = 0.5, e_range_ = -1)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
volume = volume_
e_range = e_range_
RegisterSignals(parent, list(COMSIG_MOVABLE_MOVED), PROC_REF(play_footstep))
/datum/component/footstep/proc/play_footstep()
var/turf/open/T = get_turf(parent)
if(!istype(T))
return
var/mob/living/LM = parent
var/v = volume
var/e = e_range
if(!T.footstep || LM.buckled || LM.lying || !CHECK_MULTIPLE_BITFIELDS(LM.mobility_flags, MOBILITY_STAND | MOBILITY_MOVE) || LM.throwing || LM.movement_type & (VENTCRAWLING | FLYING))
if (LM.lying && !LM.buckled && !(!T.footstep || LM.movement_type & (VENTCRAWLING | FLYING))) //play crawling sound if we're lying
playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * v)
return
if(iscarbon(LM))
var/mob/living/carbon/C = LM
if(!C.get_bodypart(BODY_ZONE_L_LEG) && !C.get_bodypart(BODY_ZONE_R_LEG))
return
if(ishuman(C) && C.m_intent == MOVE_INTENT_WALK)
v /= 2
e -= 5
steps++
if(steps >= 6)
steps = 0
if(steps % 2)
return
if(!LM.has_gravity(T) && steps != 0) // don't need to step as often when you hop around
return
//begin playsound shenanigans//
//for barefooted non-clawed mobs like monkeys
if(isbarefoot(LM))
playsound(T, pick(GLOB.barefootstep[T.barefootstep][1]),
GLOB.barefootstep[T.barefootstep][2] * v,
TRUE,
GLOB.barefootstep[T.barefootstep][3] + e)
return
//for xenomorphs, dogs, and other clawed mobs
if(isclawfoot(LM))
if(isalienadult(LM)) //xenos are stealthy and get quieter footsteps
v /= 3
e -= 5
playsound(T, pick(GLOB.clawfootstep[T.clawfootstep][1]),
GLOB.clawfootstep[T.clawfootstep][2] * v,
TRUE,
GLOB.clawfootstep[T.clawfootstep][3] + e)
return
//for megafauna and other large and imtimidating mobs such as the bloodminer
if(isheavyfoot(LM))
playsound(T, pick(GLOB.heavyfootstep[T.heavyfootstep][1]),
GLOB.heavyfootstep[T.heavyfootstep][2] * v,
TRUE,
GLOB.heavyfootstep[T.heavyfootstep][3] + e)
return
//for slimes
if(isslime(LM))
playsound(T, 'sound/effects/footstep/slime1.ogg', 15 * v)
return
//for (simple) humanoid mobs (clowns, russians, pirates, etc.)
if(isshoefoot(LM))
if(!ishuman(LM))
playsound(T, pick(GLOB.footstep[T.footstep][1]),
GLOB.footstep[T.footstep][2] * v,
TRUE,
GLOB.footstep[T.footstep][3] + e)
return
if(ishuman(LM)) //for proper humans, they're special
var/mob/living/carbon/human/H = LM
var/feetCover = (H.wear_suit && (H.wear_suit.body_parts_covered & FEET)) || (H.w_uniform && (H.w_uniform.body_parts_covered & FEET))
if(H.dna.species.special_walk_sounds)
playsound(T, pick(H.dna.species.special_walk_sounds), 30, TRUE)
if((H.shoes && !istype(H.shoes, /obj/item/clothing/shoes/xeno_wraps)) || feetCover)
playsound(T, pick(GLOB.footstep[T.footstep][1]),
GLOB.footstep[T.footstep][2] * v,
TRUE,
GLOB.footstep[T.footstep][3] + e)
else
if(H.dna.species.special_step_sounds)
playsound(T, pick(H.dna.species.special_step_sounds), H.dna.species.special_step_volume, TRUE)
else
playsound(T, pick(GLOB.barefootstep[T.barefootstep][1]),
GLOB.barefootstep[T.barefootstep][2] * v,
TRUE,
GLOB.barefootstep[T.barefootstep][3] + e)

View File

@@ -0,0 +1,181 @@
#define SHOULD_DISABLE_FOOTSTEPS(source) (HAS_TRAIT(source, TRAIT_SILENT_FOOTSTEPS))
///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
switch(footstep_type)
if(FOOTSTEP_MOB_HUMAN)
if(!ishuman(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_humanstep))
steps_for_living[target] = 0
return
if(FOOTSTEP_MOB_CLAW)
footstep_sounds = GLOB.clawfootstep
if(FOOTSTEP_MOB_BAREFOOT)
footstep_sounds = GLOB.barefootstep
if(FOOTSTEP_MOB_HEAVY)
footstep_sounds = GLOB.heavyfootstep
if(FOOTSTEP_MOB_SHOE)
footstep_sounds = GLOB.footstep
if(FOOTSTEP_MOB_RUST)
footstep_sounds = 'sound/effects/footstep/rustystep1.ogg'
if(FOOTSTEP_MOB_SLIME)
footstep_sounds = 'sound/effects/footstep/slime1.ogg'
if(FOOTSTEP_OBJ_MACHINE)
footstep_sounds = 'sound/effects/bang.ogg'
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep_machine))
return
if(FOOTSTEP_OBJ_ROBOT)
footstep_sounds = 'sound/effects/tank_treads.ogg'
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep_machine))
return
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep))
steps_for_living[target] = 0
/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/open
/datum/element/footstep/proc/prepare_step(mob/living/source)
var/turf/open/turf = get_turf(source)
if(!istype(turf))
return
if(source.buckled || source.throwing || source.movement_type & (VENTCRAWLING | FLYING) || HAS_TRAIT(source, TRAIT_IMMOBILIZED))
return
if(source.body_position == LYING_DOWN) //play crawling sound if we're lying
if(turf.footstep)
playsound(turf, 'sound/effects/footstep/crawl1.ogg', 15 * volume, falloff_distance = 1, vary = sound_vary)
return
if(iscarbon(source))
var/mob/living/carbon/carbon_source = source
if(!carbon_source.get_bodypart(BODY_ZONE_L_LEG) && !carbon_source.get_bodypart(BODY_ZONE_R_LEG))
return
if(carbon_source.m_intent == MOVE_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 && !source.has_gravity(turf)) // 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)
SEND_SIGNAL(turf, COMSIG_TURF_PREPARE_STEP_SOUND, .)
//The turf has no footstep sound (e.g. open space) and none of the objects on that turf (e.g. catwalks) overrides it
if(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
if (forced || SHOULD_DISABLE_FOOTSTEPS(source))
return
var/list/prepared_steps = prepare_step(source)
if(!prepared_steps)
return
if(isfile(footstep_sounds) || istext(footstep_sounds))
playsound(source.loc, footstep_sounds, volume, falloff_distance = 1, vary = sound_vary)
return
var/turf_footstep = prepared_steps[footstep_type]
if(!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_distance = 1, vary = sound_vary)
/datum/element/footstep/proc/play_humanstep(mob/living/carbon/human/source, atom/oldloc, direction)
SIGNAL_HANDLER
if (SHOULD_DISABLE_FOOTSTEPS(source))
return
var/volume_multiplier = 1
var/range_adjustment = 0
if(HAS_TRAIT(source, TRAIT_LIGHT_STEP))
volume_multiplier = 0.6
range_adjustment = -2
var/list/prepared_steps = prepare_step(source)
if(!prepared_steps)
return
//cache for sanic speed (lists are references anyways)
var/static/list/footstep_sounds = GLOB.footstep
if ((source.wear_suit?.body_parts_covered | source.w_uniform?.body_parts_covered | source.shoes?.body_parts_covered) & FEET)
// we are wearing shoes
var/shoestep_type = prepared_steps[FOOTSTEP_MOB_SHOE]
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_distance = 1, vary = sound_vary)
else
var/barefoot_type = prepared_steps[FOOTSTEP_MOB_BAREFOOT]
if(source.dna.species.special_step_sounds)
playsound(source.loc, pick(source.dna.species.special_step_sounds), 50, TRUE, falloff_distance = 1, vary = sound_vary)
else
var/static/list/bare_footstep_sounds = GLOB.barefootstep
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_distance = 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
if (forced || SHOULD_DISABLE_FOOTSTEPS(source))
return
var/turf/open/source_loc = get_turf(source)
if(!istype(source_loc))
return
playsound(source_loc, footstep_sounds, 50, falloff_distance = 1, vary = sound_vary)
#undef SHOULD_DISABLE_FOOTSTEPS

View File

@@ -0,0 +1,80 @@
///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

View File

@@ -101,25 +101,22 @@
ADD_TRAIT(copied_mob, TRAIT_NOINTERACT, "[type]")
ADD_TRAIT(copied_mob, TRAIT_HIGHRESISTDAMAGESLOWDOWN, "[type]")
// also make their footsteps silent
var/datum/component/footstep/footsteps = copied_mob.GetComponent(/datum/component/footstep)
var/stored_footstep_volume = footsteps.volume
footsteps.volume = 0
ADD_TRAIT(copied_mob, TRAIT_SILENT_FOOTSTEPS, PSEUDOCIDER_TRAIT)
if(damagetype == STAMINA)
fake_corpse.Paralyze(100 SECONDS)
else
INVOKE_ASYNC(fake_corpse, TYPE_PROC_REF(/mob/living,death))
addtimer(CALLBACK(src, PROC_REF(unfake_death), copied_mob, stored_footstep_volume, fake_corpse), 7 SECONDS)
addtimer(CALLBACK(src, PROC_REF(unfake_death), copied_mob, fake_corpse), 7 SECONDS)
/obj/item/pseudocider/proc/unfake_death(mob/living/carbon/copied_mob, stored_footstep_volume, mob/living/carbon/fake_corpse)
/obj/item/pseudocider/proc/unfake_death(mob/living/carbon/copied_mob, mob/living/carbon/fake_corpse)
active = FALSE
update_appearance(UPDATE_ICON)
COOLDOWN_START(src, fake_death_timer, fake_death_cooldown)
if(!QDELETED(copied_mob) && istype(copied_mob))
var/datum/component/footstep/footsteps = copied_mob.GetComponent(/datum/component/footstep)
footsteps.volume = stored_footstep_volume
REMOVE_TRAIT(copied_mob, TRAIT_SILENT_FOOTSTEPS, PSEUDOCIDER_TRAIT)
animate(copied_mob, 0.5 SECONDS, alpha = 255)
REMOVE_TRAIT(copied_mob, TRAIT_NOINTERACT, "[type]")
REMOVE_TRAIT(copied_mob, TRAIT_RESISTDAMAGESLOWDOWN, "[type]")

View File

@@ -8,11 +8,14 @@
canSmoothWith = null
obj_flags = CAN_BE_HIT
/obj/structure/lattice/catwalk/Initialize(mapload)
. = ..()
AddElement(/datum/element/footstep_override, footstep = FOOTSTEP_CATWALK)
/obj/structure/lattice/catwalk/over
layer = CATWALK_LAYER
plane = GAME_PLANE
/obj/structure/lattice/catwalk/deconstruction_hints(mob/user)
to_chat(user, span_notice("The supporting rods look like they could be <b>sliced</b>."))

View File

@@ -35,6 +35,7 @@
/obj/structure/table/Initialize(mapload)
. = ..()
AddElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY)
AddElement(/datum/element/climbable)
AddComponent(/datum/component/surgery_bed, \
success_chance = 0.8, \

View File

@@ -25,9 +25,6 @@
QDEL_NULL(dna)
GLOB.carbon_list -= src
/mob/living/carbon/initialize_footstep()
AddComponent(/datum/component/footstep, 1, 2)
/mob/living/carbon/perform_hand_swap(held_index)
. = ..()
if(!.)

View File

@@ -32,6 +32,7 @@
RegisterSignal(src, COMSIG_COMPONENT_CLEAN_FACE_ACT, PROC_REF(clean_face))
AddComponent(/datum/component/personal_crafting)
AddElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6)
/mob/living/carbon/human/proc/setup_human_dna()
//initialize dna. for spawned humans; overwritten by other code

View File

@@ -9,13 +9,9 @@
diag_hud.add_atom_to_hud(src)
faction += "[REF(src)]"
GLOB.mob_living_list += src
initialize_footstep()
if(startDead)
death(FALSE)
/mob/living/proc/initialize_footstep()
AddComponent(/datum/component/footstep)
/mob/living/prepare_huds()
..()
prepare_data_huds()

View File

@@ -44,8 +44,6 @@
var/cell_type = /obj/item/stock_parts/cell
var/vest_type = /obj/item/clothing/suit/armor/vest
do_footstep = TRUE
/mob/living/simple_animal/bot/ed209/Initialize(mapload,created_name,created_lasercolor)
. = ..()

View File

@@ -316,6 +316,10 @@
/datum/action/cooldown/spell/basic_projectile/rust_wave/short,
)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/Initialize(mapload)
. = ..()
AddElement(/datum/element/footstep, FOOTSTEP_MOB_RUST)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/setDir(newdir)
. = ..()
if(newdir == NORTH)
@@ -324,10 +328,6 @@
icon_state = "rust_walker_s"
update_appearance(UPDATE_ICON)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/Moved()
. = ..()
playsound(src, 'sound/effects/footstep/rustystep1.ogg', 100, TRUE)
/mob/living/simple_animal/hostile/eldritch/rust_spirit/Life(seconds_per_tick = SSMOBS_DT, times_fired)
if(stat == DEAD)
return ..()

View File

@@ -33,7 +33,7 @@
gold_core_spawnable = FRIENDLY_SPAWN
collar_type = "cat"
can_be_held = TRUE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
wuv_happy = "purrs!"
wuv_angy = "hisses!"

View File

@@ -21,7 +21,7 @@
turns_per_move = 10
gold_core_spawnable = FRIENDLY_SPAWN
can_be_held = TRUE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
wuv_happy = "yaps happily!"
wuv_angy = "growls!"

View File

@@ -31,7 +31,7 @@
blood_volume = BLOOD_VOLUME_GENERIC
var/obj/item/udder/goat/udder = null
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/retaliate/goat/Initialize(mapload)
udder = new()
@@ -140,8 +140,7 @@
gold_core_spawnable = FRIENDLY_SPAWN
blood_volume = BLOOD_VOLUME_GENERIC
attack_vis_effect = ATTACK_EFFECT_KICK
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/cow/Initialize(mapload)
udder = new()
@@ -222,8 +221,7 @@
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
mob_size = MOB_SIZE_TINY
gold_core_spawnable = FRIENDLY_SPAWN
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
/mob/living/simple_animal/chick/Initialize(mapload)
. = ..()
@@ -281,8 +279,7 @@
var/list/validColors = list("brown","black","white")
gold_core_spawnable = FRIENDLY_SPAWN
var/static/chicken_count = 0
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
/mob/living/simple_animal/chicken/Initialize(mapload)
. = ..()
@@ -365,8 +362,7 @@
var/shaved = FALSE
gold_core_spawnable = FRIENDLY_SPAWN
blood_volume = BLOOD_VOLUME_GENERIC
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/sheep/Initialize(mapload)
udder = new()

View File

@@ -20,7 +20,7 @@
attack_vis_effect = ATTACK_EFFECT_BITE
gold_core_spawnable = FRIENDLY_SPAWN
can_be_held = TRUE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
wuv_happy = "screams happily!"
wuv_angy = "screams angrily!"

View File

@@ -15,8 +15,7 @@
turns_per_move = 10
icon = 'icons/mob/penguins.dmi'
butcher_results = list(/obj/item/organ/ears/penguin = 1, /obj/item/reagent_containers/food/snacks/meat/slab/penguin = 3)
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_BAREFOOT
wuv_happy = "noots happily!"
wuv_angy = "hisses!" //I think birds tend to hiss when they're upset right

View File

@@ -24,7 +24,7 @@
speed = 10
glide_size = 2
can_be_held = TRUE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
//Cargo Sloth

View File

@@ -25,7 +25,7 @@
speed = 8
glide_size = 2
can_be_held = TRUE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
var/turtle_hide_max = 25 //The time spent hiding in its shell
var/turtle_hide_dur = 25 //Same as above, this is the var that physically counts down

View File

@@ -37,8 +37,7 @@
gold_core_spawnable = NO_SPAWN
deathsound = 'sound/voice/hiss6.ogg'
deathmessage = "lets out a waning guttural screech, green blood bubbling from its maw..."
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
/mob/living/simple_animal/hostile/alien/drone
name = "alien drone"

View File

@@ -42,8 +42,7 @@
faction = list("russian")
gold_core_spawnable = HOSTILE_SPAWN
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
/mob/living/simple_animal/hostile/bear/loan
faction = list("hostile")

View File

@@ -22,10 +22,9 @@
projectiletype = /obj/projectile/temp
projectilesound = 'sound/weapons/emitter.ogg'
attack_sound = 'sound/hallucinations/growl1.ogg'
footstep_type = FOOTSTEP_MOB_SHOE
var/list/copies = list()
do_footstep = TRUE
//Summon Ability
//Lets the wizard summon his art to fight for him

View File

@@ -33,8 +33,7 @@
faction = list("faithless")
gold_core_spawnable = HOSTILE_SPAWN
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/faithless/AttackingTarget()
. = ..()

View File

@@ -39,7 +39,6 @@
melee_damage_upper = 20
attack_vis_effect = ATTACK_EFFECT_BITE
faction = list("spiders")
var/busy = SPIDER_IDLE
pass_flags = PASSTABLE
move_to_delay = 6
ventcrawler = VENTCRAWLER_ALWAYS
@@ -49,11 +48,11 @@
gold_core_spawnable = HOSTILE_SPAWN
see_in_dark = 4
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
footstep_type = FOOTSTEP_MOB_CLAW
var/busy = SPIDER_IDLE
var/playable_spider = FALSE
var/directive = "" //Message passed down to children, to relay the creator's orders
do_footstep = TRUE
/mob/living/simple_animal/hostile/poison/giant_spider/Initialize(mapload)
. = ..()
var/datum/action/innate/spider/lay_web/webbing = new(src)

View File

@@ -36,11 +36,10 @@
minbodytemp = 270
maxbodytemp = 350
unique_name = TRUE
footstep_type = FOOTSTEP_MOB_BAREFOOT
var/list/gorilla_overlays[GORILLA_TOTAL_LAYERS]
var/oogas = 0
do_footstep = TRUE
// Gorillas like to dismember limbs from unconscious mobs.
// Returns null when the target is not an unconscious carbon mob; a list of limbs (possibly empty) otherwise.
/mob/living/simple_animal/hostile/gorilla/proc/target_bodyparts(atom/the_target)

View File

@@ -34,10 +34,9 @@
gold_core_spawnable = HOSTILE_SPAWN
del_on_death = 1
loot = list(/obj/effect/decal/cleanable/robot_debris)
footstep_type = FOOTSTEP_MOB_CLAW
var/alert_light
do_footstep = TRUE
/mob/living/simple_animal/hostile/hivebot/Initialize(mapload)
. = ..()
deathmessage = "[src] blows apart!"

View File

@@ -22,12 +22,11 @@
speed = 10
stat_attack = UNCONSCIOUS
robust_searching = 1
footstep_type = FOOTSTEP_MOB_HEAVY
var/hopping = FALSE
var/hop_cooldown = 0 //Strictly for player controlled leapers
var/projectile_ready = FALSE //Stopping AI leapers from firing whenever they want, and only doing it after a hop has finished instead
do_footstep = TRUE
/obj/projectile/leaper
name = "leaper bubble"
icon_state = "leaper"

View File

@@ -23,8 +23,7 @@
projectiletype = /obj/projectile/mega_arachnid
projectilesound = 'sound/weapons/pierce.ogg'
alpha = 50
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_CLAW
/mob/living/simple_animal/hostile/jungle/mega_arachnid/Life(seconds_per_tick = SSMOBS_DT, times_fired)
..()

View File

@@ -29,11 +29,10 @@
deathsound = 'sound/voice/mook_death.ogg'
aggro_vision_range = 15 //A little more aggressive once in combat to balance out their really low HP
attack_vis_effect = ATTACK_EFFECT_SLASH
footstep_type = FOOTSTEP_HARD_BAREFOOT
var/attack_state = MOOK_ATTACK_NEUTRAL
var/struck_target_leap = FALSE
do_footstep = TRUE
/mob/living/simple_animal/hostile/jungle/mook/CanAllowThrough(atom/movable/O)
. = ..()
if(istype(O, /mob/living/simple_animal/hostile/jungle/mook))

View File

@@ -54,10 +54,12 @@ Difficulty: Medium
var/transform_stop_attack = FALSE // stops the blood drunk miner from attacking after transforming his weapon until the next attack chain
deathmessage = "falls to the ground, decaying into glowing particles."
deathsound = "bodyfall"
do_footstep = TRUE
attack_action_types = list(/datum/action/innate/megafauna_attack/dash,
/datum/action/innate/megafauna_attack/kinetic_accelerator,
/datum/action/innate/megafauna_attack/transform_weapon)
footstep_type = FOOTSTEP_MOB_HEAVY
attack_action_types = list(
/datum/action/innate/megafauna_attack/dash,
/datum/action/innate/megafauna_attack/kinetic_accelerator,
/datum/action/innate/megafauna_attack/transform_weapon,
)
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/Initialize(mapload)
. = ..()

View File

@@ -61,7 +61,7 @@ Difficulty: Medium
internal_type = /obj/item/gps/internal/dragon
deathmessage = "collapses into a pile of bones, its flesh sloughing away."
deathsound = 'sound/magic/demon_dies.ogg'
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_HEAVY
initial_language_holder = /datum/language_holder/lizard
attack_action_types = list(/datum/action/innate/megafauna_attack/fire_cone,
/datum/action/innate/megafauna_attack/fire_cone_meteors,

View File

@@ -31,11 +31,10 @@
move_force = MOVE_FORCE_VERY_STRONG
move_resist = MOVE_FORCE_VERY_STRONG
pull_force = MOVE_FORCE_VERY_STRONG
loot = list(/obj/item/stack/sheet/animalhide/goliath_hide)
footstep_type = FOOTSTEP_MOB_HEAVY
var/pre_attack = 0
var/pre_attack_icon = "Goliath_preattack"
loot = list(/obj/item/stack/sheet/animalhide/goliath_hide)
do_footstep = TRUE
/mob/living/simple_animal/hostile/asteroid/goliath/Life(seconds_per_tick = SSMOBS_DT, times_fired)
. = ..()

View File

@@ -30,8 +30,7 @@
status_flags = CANPUSH
speak = list("Stop resisting!", "I AM THE LAW!", "Face the wrath of the golden bolt!", "Stop breaking the law, asshole!")
search_objects = 1
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/nanotrasen/Aggro()

View File

@@ -42,8 +42,7 @@
attack_vis_effect = ATTACK_EFFECT_SLASH
attacktext = "slashes"
attack_sound = 'sound/weapons/rapierhit.ogg'
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/pirate/melee/space
name = "Space Pirate Swashbuckler"

View File

@@ -33,7 +33,7 @@
minbodytemp = 270
maxbodytemp = 370
unsuitable_atmos_damage = 10
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
var/banana_time = 0 // If there's no time set it won't spawn.
var/banana_type = /obj/item/grown/bananapeel
var/attack_reagent

View File

@@ -22,8 +22,7 @@
attack_sound = 'sound/weapons/punch1.ogg'
obj_damage = 0
environment_smash = ENVIRONMENT_SMASH_NONE
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/retaliate/nanotrasenpeace //this should be in a different file
name = "Nanotrasen Private Security Officer"

View File

@@ -28,8 +28,7 @@
faction = list("russian")
status_flags = CANPUSH
del_on_death = 1
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/russian/sentience_act()
faction -= "russian"

View File

@@ -34,8 +34,7 @@
deathmessage = "collapses into a pile of bones!"
del_on_death = 1
loot = list(/obj/effect/decal/remains/human)
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/skeleton/eskimo
name = "undead eskimo"

View File

@@ -48,8 +48,7 @@
del_on_death = 1
dodging = TRUE
rapid_melee = 2
do_footstep = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
/mob/living/simple_animal/hostile/syndicate/sentience_act()
faction -= ROLE_SYNDICATE

View File

@@ -28,7 +28,8 @@
retreat_distance = 3 //out of fireball range
minimum_distance = 3
del_on_death = 1
del_on_death = TRUE
footstep_type = FOOTSTEP_MOB_SHOE
loot = list(
/obj/effect/mob_spawn/human/corpse/wizard,
/obj/item/staff,
@@ -40,8 +41,6 @@
var/next_cast = 0
do_footstep = TRUE
/mob/living/simple_animal/hostile/wizard/Initialize(mapload)
. = ..()
var/obj/item/implant/exile/exiled = new /obj/item/implant/exile(src)

View File

@@ -93,6 +93,8 @@
var/tame = 0
var/my_z // I don't want to confuse this with client registered_z
///What kind of footstep this mob should have. Null if it shouldn't have any.
var/footstep_type
var/do_footstep = FALSE
@@ -125,6 +127,8 @@
AddComponent(/datum/component/personal_crafting)
if(music_component && music_path)
AddComponent(music_component, music_path)
if(footstep_type)
AddElement(/datum/element/footstep, footstep_type)
/mob/living/simple_animal/Destroy()
GLOB.simple_animals[AIStatus] -= src
@@ -146,10 +150,6 @@
if(stat == DEAD)
. += span_deadsay("Upon closer examination, [p_they()] appear[p_s()] to be dead.")
/mob/living/simple_animal/initialize_footstep()
if(do_footstep)
..()
/mob/living/simple_animal/updatehealth()
..()
health = clamp(health, 0, maxHealth)

View File

@@ -61,6 +61,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
// create a conveyor
/obj/machinery/conveyor/Initialize(mapload, newdir, newid)
. = ..()
AddElement(/datum/element/footstep_override, priority = STEP_SOUND_CONVEYOR_PRIORITY)
if(newdir)
setDir(newdir)
if(newid)

Binary file not shown.

View File

@@ -512,7 +512,6 @@
#include "code\datums\components\echolocation.dm"
#include "code\datums\components\edit_complainer.dm"
#include "code\datums\components\explodable.dm"
#include "code\datums\components\footstep.dm"
#include "code\datums\components\forced_gravity.dm"
#include "code\datums\components\forensics.dm"
#include "code\datums\components\grillable.dm"
@@ -660,6 +659,8 @@
#include "code\datums\elements\earhealing.dm"
#include "code\datums\elements\effect_trail.dm"
#include "code\datums\elements\firestacker.dm"
#include "code\datums\elements\footstep.dm"
#include "code\datums\elements\footstep_override.dm"
#include "code\datums\elements\frozen.dm"
#include "code\datums\elements\life_drain.dm"
#include "code\datums\elements\movetype_handler.dm"

View File

@@ -4,16 +4,18 @@
#define SHADOWWALK_THRESHOLD 0.02
#define WALK_COMPONENT_TRAIT "walk_component_trait"
/datum/component/walk
/datum/component/walk/Initialize()
if(!istype(parent, /mob/living))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_MOB_CLIENT_PRE_MOVE, PROC_REF(handle_move))
var/datum/component/footstep/footsteps = parent.GetComponent(/datum/component/footstep)
if (footsteps)
qdel(footsteps)
ADD_TRAIT(parent, TRAIT_SILENT_FOOTSTEPS, WALK_COMPONENT_TRAIT)
/datum/component/walk/RemoveComponent()
parent.AddComponent(/datum/component/footstep)
REMOVE_TRAIT(parent, TRAIT_SILENT_FOOTSTEPS, WALK_COMPONENT_TRAIT)
return ..()
/datum/component/walk/proc/handle_move(datum/source, direction)