From 75dec8ce2cf5659e952b27ca68d0b9af0d4682ff Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Mon, 18 May 2020 13:46:22 +0200 Subject: [PATCH] Ports "Removes the absolute istype fest from footsteps" (#12259) * Ports "Removes the absolute istype fest from footsteps" * Update species.dm --- code/__DEFINES/footsteps.dm | 9 + code/__DEFINES/is_helpers.dm | 44 ----- code/datums/components/footstep.dm | 164 +++++++++++------- code/datums/dna.dm | 13 +- .../living/carbon/alien/humanoid/humanoid.dm | 1 + code/modules/mob/living/carbon/carbon.dm | 3 - code/modules/mob/living/carbon/human/human.dm | 1 + .../mob/living/carbon/human/physiology.dm | 3 + .../mob/living/carbon/human/species.dm | 15 ++ .../mob/living/carbon/monkey/monkey.dm | 1 + code/modules/mob/living/living.dm | 4 - .../mob/living/simple_animal/bot/ed209bot.dm | 2 - .../mob/living/simple_animal/friendly/cat.dm | 2 +- .../mob/living/simple_animal/friendly/dog.dm | 2 +- .../simple_animal/friendly/farm_animals.dm | 12 +- .../mob/living/simple_animal/friendly/fox.dm | 2 +- .../living/simple_animal/friendly/panda.dm | 2 +- .../living/simple_animal/friendly/penguin.dm | 2 +- .../living/simple_animal/friendly/sloth.dm | 2 +- .../mob/living/simple_animal/hostile/alien.dm | 4 +- .../mob/living/simple_animal/hostile/bear.dm | 2 +- .../hostile/bosses/paperwizard.dm | 2 +- .../simple_animal/hostile/dark_wizard.dm | 2 +- .../living/simple_animal/hostile/faithless.dm | 2 +- .../simple_animal/hostile/giant_spider.dm | 3 +- .../simple_animal/hostile/gorilla/gorilla.dm | 2 +- .../living/simple_animal/hostile/hivebot.dm | 2 +- .../simple_animal/hostile/jungle/leaper.dm | 2 +- .../hostile/jungle/mega_arachnid.dm | 2 +- .../simple_animal/hostile/jungle/mook.dm | 2 +- .../hostile/megafauna/blood_drunk_miner.dm | 2 +- .../hostile/megafauna/bubblegum.dm | 2 +- .../simple_animal/hostile/megafauna/drake.dm | 2 +- .../hostile/mining_mobs/goliath.dm | 2 +- .../simple_animal/hostile/nanotrasen.dm | 2 +- .../living/simple_animal/hostile/pirate.dm | 2 +- .../simple_animal/hostile/retaliate/clown.dm | 1 + .../hostile/retaliate/spaceman.dm | 5 +- .../living/simple_animal/hostile/russian.dm | 2 +- .../living/simple_animal/hostile/skeleton.dm | 2 +- .../living/simple_animal/hostile/syndicate.dm | 2 +- .../living/simple_animal/hostile/wizard.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 9 +- .../mob/living/simple_animal/slime/slime.dm | 3 +- 44 files changed, 184 insertions(+), 163 deletions(-) diff --git a/code/__DEFINES/footsteps.dm b/code/__DEFINES/footsteps.dm index 16d763606b..5acda2274c 100644 --- a/code/__DEFINES/footsteps.dm +++ b/code/__DEFINES/footsteps.dm @@ -24,6 +24,15 @@ #define FOOTPRINT_SNAKE "snake" #define FOOTPRINT_DRAG "drag" +//footstep mob defines +#define FOOTSTEP_MOB_CLAW 1 +#define FOOTSTEP_MOB_BAREFOOT 2 +#define FOOTSTEP_MOB_HEAVY 3 +#define FOOTSTEP_MOB_SHOE 4 +#define FOOTSTEP_MOB_HUMAN 5 //Warning: Only works on /mob/living/carbon/human +#define FOOTSTEP_MOB_SLIME 6 +#define FOOTSTEP_MOB_CRAWL 7 + /* id = list( diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 122ba67402..28ec3383ae 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -148,50 +148,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown)) -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, - /mob/living/simple_animal/hostile/asteroid/ice_whelp, - /mob/living/simple_animal/hostile/asteroid/wolf, - /mob/living/simple_animal/hostile/asteroid/polarbear - ))) - -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)) diff --git a/code/datums/components/footstep.dm b/code/datums/components/footstep.dm index fbf559fe35..f767c607a5 100644 --- a/code/datums/components/footstep.dm +++ b/code/datums/components/footstep.dm @@ -1,26 +1,52 @@ +///Footstep component. Plays footsteps at parents location when it is appropriate. /datum/component/footstep + ///How many steps the parent has taken since the last time a footstep was played var/steps = 0 + ///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 -/datum/component/footstep/Initialize(volume_ = 0.5, e_range_ = -1) +/datum/component/footstep/Initialize(footstep_type_ = FOOTSTEP_MOB_BAREFOOT, volume_ = 0.5, e_range_ = -1) if(!isliving(parent)) return COMPONENT_INCOMPATIBLE volume = volume_ e_range = e_range_ - RegisterSignal(parent, list(COMSIG_MOVABLE_MOVED), .proc/play_footstep) + footstep_type = footstep_type_ + switch(footstep_type) + if(FOOTSTEP_MOB_HUMAN) + if(!ishuman(parent)) + return COMPONENT_INCOMPATIBLE + RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/play_humanstep) + 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_SLIME) + footstep_sounds = 'sound/effects/footstep/slime1.ogg' + if(FOOTSTEP_MOB_CRAWL) + footstep_sounds = 'sound/effects/footstep/crawl1.ogg' + RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/play_simplestep) //Note that this doesn't get called for humans. -/datum/component/footstep/proc/play_footstep() +///Prepares a footstep. Determines if it should get played. Returns the turf it should get played on. Note that it is always a /turf/open +/datum/component/footstep/proc/prepare_step() 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 || !CHECK_MOBILITY(LM, MOBILITY_STAND) || LM.buckled || 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) + playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * volume) return if(HAS_TRAIT(LM, TRAIT_SILENT_STEP)) @@ -30,79 +56,83 @@ 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 + if(C.m_intent == MOVE_INTENT_WALK) + return steps++ - if(steps >= 3) + if(steps >= 6) steps = 0 - else + if(steps % 2) return - if(prob(80) && !LM.has_gravity(T)) // don't need to step as often when you hop around + if(steps != 0 && !LM.has_gravity(T)) // don't need to step as often when you hop around return + return T - //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) +/datum/component/footstep/proc/play_simplestep() + var/turf/open/T = prepare_step() + if(!T) 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) + if(isfile(footstep_sounds) || istext(footstep_sounds)) + playsound(T, footstep_sounds, volume) 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) + var/turf_footstep + switch(footstep_type) + if(FOOTSTEP_MOB_CLAW) + turf_footstep = T.clawfootstep + if(FOOTSTEP_MOB_BAREFOOT) + turf_footstep = T.barefootstep + if(FOOTSTEP_MOB_HEAVY) + turf_footstep = T.heavyfootstep + if(FOOTSTEP_MOB_SHOE) + turf_footstep = T.footstep + if(!turf_footstep) return + playsound(T, pick(footstep_sounds[turf_footstep][1]), footstep_sounds[turf_footstep][2] * volume, TRUE, footstep_sounds[turf_footstep][3] + e_range) - //for slimes - if(isslime(LM)) - playsound(T, 'sound/effects/footstep/slime1.ogg', 15 * v) +/datum/component/footstep/proc/play_humanstep() + var/turf/open/T = prepare_step() + if(!T) 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) || (H.shoes && (H.shoes.body_parts_covered & FEET))) - - if (H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle") //are we a naga or tentacle taur creature - playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * v) + var/mob/living/carbon/human/H = parent + var/list/L = GLOB.barefootstep + var/turf_footstep = T.barefootstep + var/special = FALSE + if(H.physiology.footstep_type) + switch(H.physiology.footstep_type) + if(FOOTSTEP_MOB_CLAW) + turf_footstep = T.clawfootstep + L = GLOB.clawfootstep + if(FOOTSTEP_MOB_BAREFOOT) + turf_footstep = T.barefootstep + L = GLOB.barefootstep + if(FOOTSTEP_MOB_HEAVY) + turf_footstep = T.heavyfootstep + L = GLOB.heavyfootstep + if(FOOTSTEP_MOB_SHOE) + turf_footstep = T.footstep + L = GLOB.footstep + if(FOOTSTEP_MOB_SLIME) + playsound(T, 'sound/effects/footstep/slime1.ogg', 50 * volume) return + if(FOOTSTEP_MOB_CRAWL) + playsound(T, 'sound/effects/footstep/crawl1.ogg', 50 * volume) + return + special = TRUE + else + var/feetCover = (H.wear_suit && (H.wear_suit.body_parts_covered & FEET)) || (H.w_uniform && (H.w_uniform.body_parts_covered & FEET) || (H.shoes && (H.shoes.body_parts_covered & FEET))) + if(feetCover) //are we wearing shoes + playsound(T, pick(GLOB.footstep[T.footstep][1]), + GLOB.footstep[T.footstep][2] * volume, + TRUE, + GLOB.footstep[T.footstep][3] + e_range) + return - if(feetCover) //are we wearing shoes - playsound(T, pick(GLOB.footstep[T.footstep][1]), - GLOB.footstep[T.footstep][2] * v, - TRUE, - GLOB.footstep[T.footstep][3] + e) - - if(!feetCover) //are we NOT wearing shoes - playsound(T, pick(GLOB.barefootstep[T.barefootstep][1]), - GLOB.barefootstep[T.barefootstep][2] * v, - TRUE, - GLOB.barefootstep[T.barefootstep][3] + e) \ No newline at end of file + if(!special && H.dna.species.special_step_sounds) + playsound(T, pick(H.dna.species.special_step_sounds), 50, TRUE) + else + playsound(T, pick(L[turf_footstep][1]), + L[turf_footstep][2] * volume, + TRUE, + L[turf_footstep][3] + e_range) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 26786da776..747db3d6ce 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -47,8 +47,8 @@ destination.dna.uni_identity = uni_identity destination.dna.blood_type = blood_type destination.dna.skin_tone_override = skin_tone_override - destination.set_species(species.type, icon_update=0) destination.dna.features = features.Copy() + destination.set_species(species.type, icon_update=0) destination.dna.real_name = real_name destination.dna.nameless = nameless destination.dna.custom_species = custom_species @@ -246,6 +246,17 @@ construct_block(GLOB.mam_body_markings_list.Find(features["mam_body_markings"]), GLOB.mam_body_markings_list.len) if(DNA_TAUR_BLOCK) construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len) + if(species.mutant_bodyparts["taur"] && ishuman(holder)) + var/datum/sprite_accessory/taur/T = GLOB.taur_list[features["taur"]] + switch(T?.taur_mode) + if(STYLE_HOOF_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_SHOE + if(STYLE_PAW_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_CLAW + if(STYLE_SNEK_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_CRAWL + else + H.physiology.footstep_type = null //Please use add_mutation or activate_mutation instead /datum/dna/proc/force_give(datum/mutation/human/HM) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index c813ce40f0..11849641ef 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -25,6 +25,7 @@ /mob/living/carbon/alien/humanoid/Initialize() AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null)) . = ..() + AddComponent(/datum/component/footstep, FOOTSTEP_MOB_CLAW, 0.5, -3) /mob/living/carbon/alien/humanoid/restrained(ignore_grab) return handcuffed diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f694890b95..de582c8ec2 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -22,9 +22,6 @@ QDEL_NULL(dna) GLOB.carbon_list -= src -/mob/living/carbon/initialize_footstep() - AddComponent(/datum/component/footstep, 0.6, 2) - /mob/living/carbon/relaymove(mob/user, direction) if(user in src.stomach_contents) if(prob(40)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ea91a90ee9..007bca3518 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -26,6 +26,7 @@ physiology = new() AddComponent(/datum/component/personal_crafting) + AddComponent(/datum/component/footstep, FOOTSTEP_MOB_HUMAN, 1, 2) . = ..() if(CONFIG_GET(flag/disable_stambuffer)) diff --git a/code/modules/mob/living/carbon/human/physiology.dm b/code/modules/mob/living/carbon/human/physiology.dm index 4d411deb53..fd0df0bde9 100644 --- a/code/modules/mob/living/carbon/human/physiology.dm +++ b/code/modules/mob/living/carbon/human/physiology.dm @@ -25,5 +25,8 @@ var/do_after_speed = 1 //Speed mod for do_after. Lower is better. If temporarily adjusting, please only modify using *= and /=, so you don't interrupt other calculations. + /// footstep type override for both shoeless and not footstep sounds. + var/footstep_type + /datum/physiology/New() armor = new diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 65d09f6cf2..2712f34ce7 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -332,6 +332,21 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(mutant_bodyparts["meat_type"]) //I can't believe it's come to the meat H.type_of_meat = GLOB.meat_types[H.dna.features["meat_type"]] + if(H.physiology) + if(mutant_bodyparts["taur"]) + var/datum/sprite_accessory/taur/T = GLOB.taur_list[H.dna.features["taur"]] + switch(T?.taur_mode) + if(STYLE_HOOF_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_SHOE + if(STYLE_PAW_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_CLAW + if(STYLE_SNEK_TAURIC) + H.physiology.footstep_type = FOOTSTEP_MOB_CRAWL + else + H.physiology.footstep_type = null + else + H.physiology.footstep_type = null + if(H.client && has_field_of_vision && CONFIG_GET(flag/use_field_of_vision)) H.LoadComponent(/datum/component/field_of_vision, H.field_of_vision_type) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 18c3fde188..5b91119789 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -45,6 +45,7 @@ /mob/living/carbon/monkey/ComponentInitialize() . = ..() AddElement(/datum/element/mob_holder, worn_state = "monkey", inv_slots = ITEM_SLOT_HEAD) + AddComponent(/datum/component/footstep, FOOTSTEP_MOB_BAREFOOT, 1, 2) /mob/living/carbon/monkey/Destroy() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ffc6caded8..3c75e71c5a 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -9,10 +9,6 @@ diag_hud.add_to_hud(src) faction += "[REF(src)]" GLOB.mob_living_list += src - initialize_footstep() - -/mob/living/proc/initialize_footstep() - AddComponent(/datum/component/footstep) /mob/living/prepare_huds() ..() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 469a395169..6febb942a1 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -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) . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 7d41068020..c91863a167 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -32,7 +32,7 @@ gold_core_spawnable = FRIENDLY_SPAWN collar_type = "cat" var/held_icon = "cat2" - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/pet/cat/Initialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 485cece8b7..8db462b384 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -15,7 +15,7 @@ turns_per_move = 10 var/held_icon = "corgi" - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/pet/dog/ComponentInitialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index e67e649ac6..298806edc9 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -30,7 +30,7 @@ blood_volume = BLOOD_VOLUME_NORMAL var/obj/item/udder/udder = null - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/hostile/retaliate/goat/Initialize() udder = new() @@ -132,7 +132,7 @@ gold_core_spawnable = FRIENDLY_SPAWN blood_volume = BLOOD_VOLUME_NORMAL - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/cow/Initialize() udder = new() @@ -210,7 +210,7 @@ mob_size = MOB_SIZE_TINY gold_core_spawnable = FRIENDLY_SPAWN - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/chick/Initialize() . = ..() @@ -268,7 +268,7 @@ gold_core_spawnable = FRIENDLY_SPAWN var/static/chicken_count = 0 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/chicken/Initialize() . = ..() @@ -358,6 +358,8 @@ gold_core_spawnable = FRIENDLY_SPAWN var/static/kiwi_count = 0 + footstep_type = FOOTSTEP_MOB_CLAW + /mob/living/simple_animal/kiwi/Destroy() --kiwi_count return ..() @@ -430,6 +432,8 @@ mob_size = MOB_SIZE_TINY gold_core_spawnable = FRIENDLY_SPAWN + footstep_type = FOOTSTEP_MOB_CLAW + /mob/living/simple_animal/babyKiwi/Initialize() . = ..() pixel_x = rand(-6, 6) diff --git a/code/modules/mob/living/simple_animal/friendly/fox.dm b/code/modules/mob/living/simple_animal/friendly/fox.dm index 95b082b733..de24bf5463 100644 --- a/code/modules/mob/living/simple_animal/friendly/fox.dm +++ b/code/modules/mob/living/simple_animal/friendly/fox.dm @@ -18,7 +18,7 @@ response_disarm = "gently pushes aside" response_harm = "kicks" gold_core_spawnable = FRIENDLY_SPAWN - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/pet/fox/ComponentInitialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/panda.dm b/code/modules/mob/living/simple_animal/friendly/panda.dm index a7b6143ef5..6bb78730f7 100644 --- a/code/modules/mob/living/simple_animal/friendly/panda.dm +++ b/code/modules/mob/living/simple_animal/friendly/panda.dm @@ -17,4 +17,4 @@ response_disarm = "gently pushes aside" response_harm = "kicks" gold_core_spawnable = FRIENDLY_SPAWN - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW diff --git a/code/modules/mob/living/simple_animal/friendly/penguin.dm b/code/modules/mob/living/simple_animal/friendly/penguin.dm index 9835840dbf..45f3c72d9e 100644 --- a/code/modules/mob/living/simple_animal/friendly/penguin.dm +++ b/code/modules/mob/living/simple_animal/friendly/penguin.dm @@ -15,7 +15,7 @@ turns_per_move = 10 icon = 'icons/mob/penguins.dmi' - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_BAREFOOT /mob/living/simple_animal/pet/penguin/emperor name = "Emperor penguin" diff --git a/code/modules/mob/living/simple_animal/friendly/sloth.dm b/code/modules/mob/living/simple_animal/friendly/sloth.dm index 28063d6e52..25d16a4d3a 100644 --- a/code/modules/mob/living/simple_animal/friendly/sloth.dm +++ b/code/modules/mob/living/simple_animal/friendly/sloth.dm @@ -22,7 +22,7 @@ maxHealth = 50 speed = 10 glide_size = 2 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/pet/fox/ComponentInitialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 8aec10ec48..0007eae1dc 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -37,7 +37,9 @@ death_sound = 'sound/voice/hiss6.ogg' deathmessage = "lets out a waning guttural screech, green blood bubbling from its maw..." - do_footstep = TRUE +/mob/living/simple_animal/hostile/alien/Initialize() + . = ..() + AddComponent(/datum/component/footstep, FOOTSTEP_MOB_CLAW) /mob/living/simple_animal/hostile/alien/drone name = "alien drone" diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index a77098cb80..2f12420060 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -40,7 +40,7 @@ faction = list("russian") gold_core_spawnable = HOSTILE_SPAWN - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW //SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!! /mob/living/simple_animal/hostile/bear/Hudson diff --git a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm index 07572fff83..aef3fb714d 100644 --- a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm @@ -23,7 +23,7 @@ attack_sound = 'sound/hallucinations/growl1.ogg' var/list/copies = list() - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE //Summon Ability diff --git a/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm b/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm index 6ca6eac0cc..fc11817be4 100644 --- a/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/dark_wizard.dm @@ -25,7 +25,7 @@ turns_per_move = 5 gold_core_spawnable = HOSTILE_SPAWN faction = list(ROLE_WIZARD) - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE weather_immunities = list("lava","ash") minbodytemp = 0 maxbodytemp = INFINITY diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 7ac0ea2b44..1df4e2f67f 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -36,7 +36,7 @@ faction = list("faithless") gold_core_spawnable = HOSTILE_SPAWN - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/hostile/faithless/AttackingTarget() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index b556cce8fe..6bd2ac0925 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -49,13 +49,12 @@ gold_core_spawnable = HOSTILE_SPAWN see_in_dark = 4 lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE + footstep_type = FOOTSTEP_MOB_CLAW has_field_of_vision = FALSE // 360° vision. var/playable_spider = FALSE var/datum/action/innate/spider/lay_web/lay_web 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() . = ..() lay_web = new diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm index 7c6f9e9c7b..da9f96df55 100644 --- a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm +++ b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm @@ -39,7 +39,7 @@ var/list/gorilla_overlays[GORILLA_TOTAL_LAYERS] var/oogas = 0 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_BAREFOOT // Gorillas like to dismember limbs from unconcious mobs. // Returns null when the target is not an unconcious carbon mob; a list of limbs (possibly empty) otherwise. diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 1cc675825f..d9dbc94fae 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -30,7 +30,7 @@ loot = list(/obj/effect/decal/cleanable/robot_debris) blood_volume = 0 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/hostile/hivebot/Initialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 05c4007b6f..574811c968 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -27,7 +27,7 @@ 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 + footstep_type = FOOTSTEP_MOB_HEAVY /obj/item/projectile/leaper name = "leaper bubble" diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/mega_arachnid.dm b/code/modules/mob/living/simple_animal/hostile/jungle/mega_arachnid.dm index ae161d596d..40274c0029 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/mega_arachnid.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/mega_arachnid.dm @@ -25,7 +25,7 @@ projectilesound = 'sound/weapons/pierce.ogg' alpha = 50 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_CLAW /mob/living/simple_animal/hostile/jungle/mega_arachnid/Life() ..() diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm index c05d14965e..6efa0cf468 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm @@ -32,7 +32,7 @@ var/attack_state = MOOK_ATTACK_NEUTRAL var/struck_target_leap = FALSE - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_BAREFOOT /mob/living/simple_animal/hostile/jungle/mook/CanPass(atom/movable/O) if(istype(O, /mob/living/simple_animal/hostile/jungle/mook)) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index fd278eb438..8c358fd625 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -54,7 +54,7 @@ Difficulty: Medium deathmessage = "falls to the ground, decaying into glowing particles." death_sound = "bodyfall" - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_HEAVY /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/guidance guidance = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 1e63767649..766c38b306 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -55,7 +55,7 @@ Difficulty: Hard deathmessage = "sinks into a pool of blood, fleeing the battle. You've won, for now... " death_sound = 'sound/magic/enter_blood.ogg' - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_HEAVY /obj/item/gps/internal/bubblegum icon_state = null diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index c59272214b..cae5e32344 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -64,7 +64,7 @@ Difficulty: Medium death_sound = 'sound/magic/demon_dies.ogg' var/datum/action/small_sprite/smallsprite = new/datum/action/small_sprite/drake() - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_HEAVY /mob/living/simple_animal/hostile/megafauna/dragon/Initialize() smallsprite.Grant(src) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm index 3c8cf9025f..24faa32c3b 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm @@ -35,7 +35,7 @@ var/pre_attack_icon = "Goliath_preattack" loot = list(/obj/item/stack/sheet/animalhide/goliath_hide) - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_HEAVY /mob/living/simple_animal/hostile/asteroid/goliath/Life() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm index ed2a407b8e..b664f1ad93 100644 --- a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm +++ b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm @@ -31,7 +31,7 @@ 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() diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index d8737d1edc..119d6383ef 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -43,7 +43,7 @@ attack_sound = 'sound/weapons/blade1.ogg' var/obj/effect/light_emitter/red_energy_sword/sord - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/hostile/pirate/melee/space name = "Space Pirate Swashbuckler" diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm index c94046329b..bc9c3fb22d 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm @@ -30,6 +30,7 @@ minbodytemp = 270 maxbodytemp = 370 unsuitable_atmos_damage = 10 + 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 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm index 16358f736b..085a1855d2 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm @@ -23,9 +23,8 @@ obj_damage = 0 environment_smash = ENVIRONMENT_SMASH_NONE del_on_death = 0 - has_field_of_vision = FALSE //Legacy. Also they only have one dir visually. - - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE + has_field_of_vision = FALSE //Legacy gameplay experience. Also they only have one dir visually. /mob/living/simple_animal/hostile/retaliate/nanotrasenpeace //this should be in a different file name = "Nanotrasen Private Security Officer" diff --git a/code/modules/mob/living/simple_animal/hostile/russian.dm b/code/modules/mob/living/simple_animal/hostile/russian.dm index 9c3e3e0b92..47b1409816 100644 --- a/code/modules/mob/living/simple_animal/hostile/russian.dm +++ b/code/modules/mob/living/simple_animal/hostile/russian.dm @@ -30,7 +30,7 @@ status_flags = CANPUSH del_on_death = 1 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/hostile/russian/ranged diff --git a/code/modules/mob/living/simple_animal/hostile/skeleton.dm b/code/modules/mob/living/simple_animal/hostile/skeleton.dm index df71701bb7..630d93c070 100644 --- a/code/modules/mob/living/simple_animal/hostile/skeleton.dm +++ b/code/modules/mob/living/simple_animal/hostile/skeleton.dm @@ -36,7 +36,7 @@ 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" diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 8c4e19774d..530bedf5cb 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -50,7 +50,7 @@ dodging = TRUE rapid_melee = 2 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE ///////////////Melee//////////// diff --git a/code/modules/mob/living/simple_animal/hostile/wizard.dm b/code/modules/mob/living/simple_animal/hostile/wizard.dm index 15d641299d..ed144bd963 100644 --- a/code/modules/mob/living/simple_animal/hostile/wizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/wizard.dm @@ -38,7 +38,7 @@ var/next_cast = 0 - do_footstep = TRUE + footstep_type = FOOTSTEP_MOB_SHOE /mob/living/simple_animal/hostile/wizard/Initialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index def6327461..e066120cf6 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -92,7 +92,8 @@ var/my_z // I don't want to confuse this with client registered_z - var/do_footstep = FALSE + ///What kind of footstep this mob should have. Null if it shouldn't have any. + var/footstep_type /mob/living/simple_animal/Initialize() . = ..() @@ -106,6 +107,8 @@ update_simplemob_varspeed() if(dextrous) AddComponent(/datum/component/personal_crafting) + if(footstep_type) + AddComponent(/datum/component/footstep, footstep_type) /mob/living/simple_animal/Destroy() GLOB.simple_animals[AIStatus] -= src @@ -122,10 +125,6 @@ return ..() -/mob/living/simple_animal/initialize_footstep() - if(do_footstep) - ..() - /mob/living/simple_animal/updatehealth() ..() health = clamp(health, 0, maxHealth) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 1c5916a249..092792e7fd 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -64,8 +64,6 @@ var/mutator_used = FALSE //So you can't shove a dozen mutators into a single slime var/force_stasis = FALSE - do_footstep = TRUE - var/static/regex/slime_name_regex = new("\\w+ (baby|adult) slime \\(\\d+\\)") ///////////TIME FOR SUBSPECIES @@ -103,6 +101,7 @@ create_reagents(100, NONE, NO_REAGENTS_VALUE) set_colour(new_colour) . = ..() + AddComponent(/datum/component/footstep, FOOTSTEP_MOB_SLIME, 7.5) /mob/living/simple_animal/slime/Destroy() for (var/A in actions)