From b6cba5b9a7d8d8facecc420c3781085a27878135 Mon Sep 17 00:00:00 2001 From: KnighTheThrasher Date: Tue, 27 Feb 2024 10:53:43 +0100 Subject: [PATCH 1/4] Footprint Sprites are BASED (on shoes and legs) (#81588) Footprint sprites no longer have to be the same "shoe" sprite, they are now based on what shoes you're wearing and what legs you have They are also renamed, i.e., if they're paws, they're called pawprints and not footprints Shoes have priority over legs I have changed monkey legs to have paw footprints Code is from https://github.com/DaedalusDock/daedalusdock/pull/813, except I renamed some defines and vars and tweaked it a bit A future use for this is, adding human FOOT (not shoe) print sprites, so people without shoes would make actual FEET print sprites I didn't do this cuz I can't sprite, but it's possible now Also didn't do this cuz I'd like to replace the existing footprints with the more grimy Baystation footprints, they look much better, but that's for a separate PR Any lizard superfans could also sprite something for lizards, the possibilities are endless --- code/__DEFINES/cleaning.dm | 5 +++ code/datums/components/bloodysoles.dm | 19 +++++---- .../effects/decals/cleanable/humans.dm | 39 +++++++++++++----- code/modules/clothing/shoes/_shoes.dm | 1 + code/modules/mob/living/carbon/carbon.dm | 3 ++ code/modules/mob/living/carbon/human/human.dm | 10 ++++- code/modules/surgery/bodyparts/parts.dm | 4 ++ icons/effects/footprints.dmi | Bin 3946 -> 3962 bytes 8 files changed, 60 insertions(+), 21 deletions(-) diff --git a/code/__DEFINES/cleaning.dm b/code/__DEFINES/cleaning.dm index 7c954602215e..79708cd152b6 100644 --- a/code/__DEFINES/cleaning.dm +++ b/code/__DEFINES/cleaning.dm @@ -29,3 +29,8 @@ #define CLEAN_SCRUB (CLEAN_WASH | CLEAN_TYPE_FINGERPRINTS | CLEAN_TYPE_FIBERS | CLEAN_TYPE_HARD_DECAL) #define CLEAN_RAD CLEAN_TYPE_RADIATION #define CLEAN_ALL ALL + +// Footprint sprites to use when making footprints in blood, oil, etc. +#define FOOTPRINT_SPRITE_SHOES "shoes" +#define FOOTPRINT_SPRITE_PAWS "paws" +#define FOOTPRINT_SPRITE_CLAWS "claws" diff --git a/code/datums/components/bloodysoles.dm b/code/datums/components/bloodysoles.dm index e2f8a7d064fe..9fab9bf8d4b5 100644 --- a/code/datums/components/bloodysoles.dm +++ b/code/datums/components/bloodysoles.dm @@ -21,6 +21,8 @@ /// The world.time when we last picked up blood var/last_pickup + var/footprint_sprite = FOOTPRINT_SPRITE_SHOES + /datum/component/bloodysoles/Initialize() if(!isclothing(parent)) return COMPONENT_INCOMPATIBLE @@ -100,9 +102,9 @@ /** * Find a blood decal on a turf that matches our last_blood_state */ -/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null) +/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null, footprint_sprite) for(var/obj/effect/decal/cleanable/blood/pool in turfLoc) - if(pool.blood_state == last_blood_state && (!typeFilter || istype(pool, typeFilter))) + if(pool.blood_state == last_blood_state && pool.footprint_sprite == footprint_sprite && (!typeFilter || istype(pool, typeFilter))) return pool /** @@ -158,23 +160,23 @@ return var/half_our_blood = bloody_shoes[last_blood_state] / 2 - + var/footprint_sprite = wielder.get_footprint_sprite() // Add footprints in old loc if we have enough cream if(half_our_blood >= BLOOD_FOOTPRINTS_MIN) var/turf/oldLocTurf = get_turf(OldLoc) - var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints) + var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints, footprint_sprite) if(oldLocFP) // Footprints found in the tile we left, add us to it add_parent_to_footprint(oldLocFP) if (!(oldLocFP.exited_dirs & wielder.dir)) oldLocFP.exited_dirs |= wielder.dir oldLocFP.update_appearance() - else if(find_pool_by_blood_state(oldLocTurf)) + else if(find_pool_by_blood_state(oldLocTurf, footprint_sprite = footprint_sprite)) // No footprints in the tile we left, but there was some other blood pool there. Add exit footprints on it adjust_bloody_shoes(last_blood_state, half_our_blood) update_icon() - oldLocFP = new(oldLocTurf) + oldLocFP = new(oldLocTurf, footprint_sprite) if(!QDELETED(oldLocFP)) ///prints merged oldLocFP.blood_state = last_blood_state oldLocFP.exited_dirs |= wielder.dir @@ -194,7 +196,7 @@ adjust_bloody_shoes(last_blood_state, half_our_blood) update_icon() - var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom)) + var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom), footprint_sprite) if(!QDELETED(FP)) ///prints merged FP.blood_state = last_blood_state FP.entered_dirs |= wielder.dir @@ -253,7 +255,8 @@ return COMPONENT_INCOMPATIBLE parent_atom = parent wielder = parent - + if(footprint_sprite) + src.footprint_sprite = footprint_sprite if(!bloody_feet) bloody_feet = mutable_appearance('icons/effects/blood.dmi', "shoeblood", SHOES_LAYER) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index 27b5f1f97dc4..51d85439986a 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -13,6 +13,7 @@ var/drydesc = "Looks like it's been here a while. Eew." //as above var/drytime = 0 var/count = 0 + var/footprint_sprite = null /obj/effect/decal/cleanable/blood/Initialize(mapload) . = ..() @@ -232,7 +233,7 @@ name = "footprints" desc = "WHOSE FOOTPRINTS ARE THESE?" icon = 'icons/effects/footprints.dmi' - icon_state = "blood1" + icon_state = "blood_shoes_enter" random_icon_states = null blood_state = BLOOD_STATE_HUMAN //the icon state to load images from var/entered_dirs = 0 @@ -247,12 +248,13 @@ dryname = "dried footprints" drydesc = "HMM... SOMEONE WAS HERE!" -/obj/effect/decal/cleanable/blood/footprints/Initialize(mapload) +/obj/effect/decal/cleanable/blood/footprints/Initialize(mapload, footprint_sprite) + src.footprint_sprite = footprint_sprite . = ..() icon_state = "" //All of the footprint visuals come from overlays if(mapload) entered_dirs |= dir //Keep the same appearance as in the map editor - update_appearance() + update_appearance(mapload ? (ALL) : (UPDATE_NAME | UPDATE_DESC)) //Rotate all of the footprint directions too /obj/effect/decal/cleanable/blood/footprints/setDir(newdir) @@ -274,6 +276,21 @@ update_appearance() return ..() +/obj/effect/decal/cleanable/blood/footprints/update_name(updates) + switch(footprint_sprite) + if(FOOTPRINT_SPRITE_CLAWS) + name = "clawprints" + if(FOOTPRINT_SPRITE_SHOES) + name = "footprints" + if(FOOTPRINT_SPRITE_PAWS) + name = "pawprints" + dryname = "dried [name]" + return ..() + +/obj/effect/decal/cleanable/blood/footprints/update_desc(updates) + desc = "WHOSE [uppertext(name)] ARE THESE?" + return ..() + /obj/effect/decal/cleanable/blood/footprints/update_icon() . = ..() alpha = min(BLOODY_FOOTPRINT_BASE_ALPHA + (255 - BLOODY_FOOTPRINT_BASE_ALPHA) * bloodiness / (BLOOD_ITEM_MAX / 2), 255) @@ -288,22 +305,22 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) . = ..() for(var/Ddir in GLOB.cardinals) if(entered_dirs & Ddir) - var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] + var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[footprint_sprite]-[blood_state]-[Ddir]"] if(!bloodstep_overlay) - GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]1", dir = Ddir) + GLOB.bloody_footprints_cache["entered-[footprint_sprite]-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]_[footprint_sprite]_enter", dir = Ddir) . += bloodstep_overlay if(exited_dirs & Ddir) - var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] + var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[footprint_sprite]-[blood_state]-[Ddir]"] if(!bloodstep_overlay) - GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]2", dir = Ddir) + GLOB.bloody_footprints_cache["exited-[footprint_sprite]-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]_[footprint_sprite]_exit", dir = Ddir) . += bloodstep_overlay /obj/effect/decal/cleanable/blood/footprints/examine(mob/user) . = ..() if((shoe_types.len + species_types.len) > 0) - . += "You recognise the footprints as belonging to:" + . += "You recognise the [name] as belonging to:" for(var/sole in shoe_types) var/obj/item/clothing/item = sole var/article = initial(item.gender) == PLURAL ? "Some" : "A" @@ -313,14 +330,14 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) if(species == "unknown") . += "Some feet." else if(species == SPECIES_MONKEY) - . += "[icon2html('icons/mob/species/human/human.dmi', user, "monkey")] Some monkey feet." + . += "[icon2html('icons/mob/human/human.dmi', user, "monkey")] Some monkey paws." else if(species == SPECIES_HUMAN) . += "[icon2html('icons/mob/species/human/bodyparts.dmi', user, "default_human_l_leg")] Some human feet." else . += "[icon2html('icons/mob/species/human/bodyparts.dmi', user, "[species]_l_leg")] Some [species] feet." -/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/C) - if(blood_state != C.blood_state) //We only replace footprints of the same type as us +/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/blood/blood_decal) + if(blood_state != blood_decal.blood_state || footprint_sprite != blood_decal.footprint_sprite) //We only replace footprints of the same type as us return FALSE return ..() diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index b0ef5a29c703..c4e8f9133175 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -23,6 +23,7 @@ var/lace_time = 5 SECONDS ///An active alert var/datum/weakref/our_alert_ref + var/footprint_sprite = FOOTPRINT_SPRITE_SHOES /datum/armor/clothing_shoes bio = 50 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index b61bd33abf2f..07aee95636fe 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1008,6 +1008,9 @@ /proc/cmp_organ_slot_asc(slot_a, slot_b) return GLOB.organ_process_order.Find(slot_a) - GLOB.organ_process_order.Find(slot_b) +/mob/living/carbon/proc/get_footprint_sprite() + return FOOTPRINT_SPRITE_PAWS + /mob/living/carbon/vv_get_dropdown() . = ..() VV_DROPDOWN_OPTION("", "---------") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 797d34e56bca..39a8f4487f69 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -24,7 +24,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) - AddComponent(/datum/component/bloodysoles/feet) + AddComponent(/datum/component/bloodysoles/feet, FOOTPRINT_SPRITE_SHOES) AddElement(/datum/element/ridable, /datum/component/riding/creature/human) AddElement(/datum/element/strippable, GLOB.strippable_human_items, TYPE_PROC_REF(/mob/living/carbon/human/, should_strip)) var/static/list/loc_connections = list( @@ -345,6 +345,12 @@ var/obj/item/bodypart/the_part = isbodypart(target_zone) ? target_zone : get_bodypart(check_zone(target_zone)) //keep these synced to_chat(user, span_alert("There is no exposed flesh or thin material on [p_their()] [the_part.name].")) +/mob/living/carbon/human/get_footprint_sprite() + var/obj/item/bodypart/leg/L = get_bodypart(BODY_ZONE_R_LEG) || get_bodypart(BODY_ZONE_L_LEG) + return shoes?.footprint_sprite || L?.footprint_sprite + +#define CHECK_PERMIT(item) (item && item.item_flags & NEEDS_PERMIT) + /mob/living/carbon/human/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) if(judgement_criteria & JUDGE_EMAGGED) return 10 //Everyone is a criminal! @@ -911,7 +917,7 @@ if(diff < 0) //Taking damage, not healing return diff * physiology.stamina_mod return diff - + /mob/living/carbon/human/adjust_nutrition(change) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return FALSE diff --git a/code/modules/surgery/bodyparts/parts.dm b/code/modules/surgery/bodyparts/parts.dm index f441643ba768..55d42f4993d1 100644 --- a/code/modules/surgery/bodyparts/parts.dm +++ b/code/modules/surgery/bodyparts/parts.dm @@ -323,6 +323,8 @@ var/digitigrade_id /// Used solely by digitigrade limbs to remember what their old limb ID was. var/old_limb_id + /// Used by the bloodysoles component to make footprints + var/footprint_sprite = FOOTPRINT_SPRITE_SHOES biological_state = BIO_STANDARD_JOINTED /obj/item/bodypart/leg/Destroy() @@ -407,6 +409,7 @@ unarmed_damage_low = 2 unarmed_damage_high = 3 unarmed_stun_threshold = 4 + footprint_sprite = FOOTPRINT_SPRITE_PAWS /obj/item/bodypart/leg/left/alien icon = 'icons/mob/species/alien/bodyparts.dmi' @@ -501,6 +504,7 @@ unarmed_damage_low = 2 unarmed_damage_high = 3 unarmed_stun_threshold = 4 + footprint_sprite = FOOTPRINT_SPRITE_PAWS /obj/item/bodypart/leg/right/alien icon = 'icons/mob/species/alien/bodyparts.dmi' diff --git a/icons/effects/footprints.dmi b/icons/effects/footprints.dmi index a98344abe41ee0f33fe3caad7c46d4230a345cae..a00c6a0f780dbb69645897e1687dee69be1e2106 100644 GIT binary patch delta 236 zcmVfFDZ*Bkpc$}4#!485j5Jb=IS2S=pf*!nh zF%ZK+et}e3ZIen(yAeKL5EFVaY;W6S=FPO5G!>`vT-BnuRQwIjYukyV*l)I+^}0nh z9(Flr3iLzaeDEj{#xc1XYum;v3%-F4!6lrv+W85<+1<$}Oki{N$1!MJHCSz;0s=h+ zKlgdbKJEguf!aR;zsTwBZzi_>&q3`U6A9=dRUR>>r$jsagCaavM#>=#|IE)Pm;(QPS3L;0Z9&V!fn9- delta 220 zcmV<203-kU9_k*DQh&yJR9JLGWpiV4X>fFDZ*Bkpc$|%s!3x4K42I9`Q Date: Tue, 27 Feb 2024 10:55:46 +0100 Subject: [PATCH 2/4] other dmi --- code/game/objects/effects/decals/cleanable/humans.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index 51d85439986a..3e0cc9adf136 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -330,7 +330,7 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) if(species == "unknown") . += "Some feet." else if(species == SPECIES_MONKEY) - . += "[icon2html('icons/mob/human/human.dmi', user, "monkey")] Some monkey paws." + . += "[icon2html('icons/mob/species/human/human.dmi', user, "monkey")] Some monkey paws." else if(species == SPECIES_HUMAN) . += "[icon2html('icons/mob/species/human/bodyparts.dmi', user, "default_human_l_leg")] Some human feet." else From b98f8cbf4014c3c820950d037ac074c70e4ba83e Mon Sep 17 00:00:00 2001 From: KnighTheThrasher Date: Tue, 27 Feb 2024 11:44:14 +0100 Subject: [PATCH 3/4] simian support --- code/game/objects/effects/decals/cleanable/humans.dm | 2 +- monkestation/code/modules/surgery/bodyparts/simian_bodyparts.dm | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index 3e0cc9adf136..f1b2d2cdcbe3 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -329,7 +329,7 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) // god help me if(species == "unknown") . += "Some feet." - else if(species == SPECIES_MONKEY) + else if(species == SPECIES_MONKEY || SPECIES_SIMIAN) . += "[icon2html('icons/mob/species/human/human.dmi', user, "monkey")] Some monkey paws." else if(species == SPECIES_HUMAN) . += "[icon2html('icons/mob/species/human/bodyparts.dmi', user, "default_human_l_leg")] Some human feet." diff --git a/monkestation/code/modules/surgery/bodyparts/simian_bodyparts.dm b/monkestation/code/modules/surgery/bodyparts/simian_bodyparts.dm index 6f9d58a8a585..da57550c7dc7 100644 --- a/monkestation/code/modules/surgery/bodyparts/simian_bodyparts.dm +++ b/monkestation/code/modules/surgery/bodyparts/simian_bodyparts.dm @@ -37,11 +37,13 @@ husk_type = "simian" limb_id = SPECIES_SIMIAN bodytype = BODYTYPE_HUMANOID | BODYTYPE_ORGANIC | BODYTYPE_CUSTOM + footprint_sprite = FOOTPRINT_SPRITE_PAWS /obj/item/bodypart/leg/right/simian icon_greyscale = 'monkestation/icons/mob/species/simian/bodyparts.dmi' husk_type = "simian" limb_id = SPECIES_SIMIAN bodytype = BODYTYPE_HUMANOID | BODYTYPE_ORGANIC | BODYTYPE_CUSTOM + footprint_sprite = FOOTPRINT_SPRITE_PAWS dmg_overlay_type = "monkey" From 4dd01500b04d9b7c72c2c52701628a65cb54b30d Mon Sep 17 00:00:00 2001 From: KnighTheThrasher Date: Tue, 27 Feb 2024 12:55:22 +0100 Subject: [PATCH 4/4] lizard claws + fixes simian support --- code/game/objects/effects/decals/cleanable/humans.dm | 6 +++++- .../surgery/bodyparts/species_parts/lizard_bodyparts.dm | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index f1b2d2cdcbe3..83d905882447 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -329,8 +329,12 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) // god help me if(species == "unknown") . += "Some feet." - else if(species == SPECIES_MONKEY || SPECIES_SIMIAN) + else if(species == SPECIES_MONKEY) . += "[icon2html('icons/mob/species/human/human.dmi', user, "monkey")] Some monkey paws." + else if(species == SPECIES_SIMIAN) + . += "[icon2html('monkestation/icons/mob/species/simian/bodyparts.dmi', user, "simian_l_leg")] Some simian paws." + else if(species == SPECIES_LIZARD) + . += "[icon2html('icons/mob/species/lizard/bodyparts.dmi', user, "digitigrade_l_leg")] Some lizard claws." else if(species == SPECIES_HUMAN) . += "[icon2html('icons/mob/species/human/bodyparts.dmi', user, "default_human_l_leg")] Some human feet." else diff --git a/code/modules/surgery/bodyparts/species_parts/lizard_bodyparts.dm b/code/modules/surgery/bodyparts/species_parts/lizard_bodyparts.dm index 233afcd9b19b..08622f070176 100644 --- a/code/modules/surgery/bodyparts/species_parts/lizard_bodyparts.dm +++ b/code/modules/surgery/bodyparts/species_parts/lizard_bodyparts.dm @@ -35,9 +35,11 @@ limb_id = SPECIES_LIZARD can_be_digitigrade = TRUE digitigrade_id = "digitigrade" + footprint_sprite = FOOTPRINT_SPRITE_CLAWS /obj/item/bodypart/leg/right/lizard icon_greyscale = 'icons/mob/species/lizard/bodyparts.dmi' limb_id = SPECIES_LIZARD can_be_digitigrade = TRUE digitigrade_id = "digitigrade" + footprint_sprite = FOOTPRINT_SPRITE_CLAWS