diff --git a/modular_zzplurt/code/_globalvars/lists/global_lewd.dm b/modular_zzplurt/code/_globalvars/lists/global_lewd.dm index 40a2143965d82..65a3399a49b06 100644 --- a/modular_zzplurt/code/_globalvars/lists/global_lewd.dm +++ b/modular_zzplurt/code/_globalvars/lists/global_lewd.dm @@ -10,3 +10,107 @@ GLOBAL_LIST_INIT(brap_noises, list( 'modular_zzplurt/sound/voice/farts/fart8.ogg' )) +GLOBAL_LIST_INIT(skirt_peekable, typecacheof(list( + // Everyone's jumpskirts + /obj/item/clothing/under/color/jumpskirt, + /obj/item/clothing/under/costume/buttondown/skirt, + /obj/item/clothing/under/dress, + /obj/item/clothing/under/suit/white/skirt, + /obj/item/clothing/under/suit/black_really/skirt, + /obj/item/clothing/under/syndicate/skirt, + /obj/item/clothing/under/syndicate/tacticool/skirt, + /obj/item/clothing/accessory/skilt, + /obj/item/clothing/under/rank/civilian/curator/skirt, + + /* Centcom */ + /obj/item/clothing/under/rank/centcom/officer_skirt, + /obj/item/clothing/under/rank/centcom/centcom_skirt, + + /* Heads */ + // Captain + /obj/item/clothing/under/rank/captain/skirt, + /obj/item/clothing/under/rank/captain/suit/skirt, + + + /* Service */ + // Head of Personnel + /obj/item/clothing/under/rank/civilian/head_of_personnel/skirt, + /obj/item/clothing/under/rank/civilian/head_of_personnel/suit/skirt, + // Chaplain + /obj/item/clothing/under/rank/civilian/chaplain/skirt, + + // Botanist + /obj/item/clothing/under/rank/civilian/hydroponics/skirt, + + // Janitor + /obj/item/clothing/under/rank/civilian/janitor/skirt, + // Lawyer + /obj/item/clothing/under/rank/civilian/lawyer/black/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/beige/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/red/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/blue/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/bluesuit/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/purpsuit/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/galaxy/skirt, + /obj/item/clothing/under/rank/civilian/lawyer/galaxy/red/skirt, + // Clown and Mime + /obj/item/clothing/under/rank/civilian/mime/skirt, + /* Security */ + // Head of Security + /obj/item/clothing/under/rank/security/head_of_security/skirt, + /obj/item/clothing/under/rank/security/head_of_security/alt/skirt, + // Warden + /obj/item/clothing/under/rank/security/warden/skirt, + // Secoff + /obj/item/clothing/under/rank/security/officer/skirt, + // Detective + /obj/item/clothing/under/rank/security/detective/skirt, + /obj/item/clothing/under/rank/security/detective/noir/skirt, + // Prisoner + /obj/item/clothing/under/rank/prisoner/skirt, + + + /* Science */ + // Research director + /obj/item/clothing/under/rank/rnd/research_director/skirt, + /obj/item/clothing/under/rank/rnd/research_director/alt/skirt, + /obj/item/clothing/under/rank/rnd/research_director/turtleneck/skirt, + // Scientist + /obj/item/clothing/under/rank/rnd/scientist/skirt, + // Roboticist + /obj/item/clothing/under/rank/rnd/roboticist/skirt, + // Geneticist + /obj/item/clothing/under/rank/rnd/geneticist/skirt, + + + /* Engineering */ + // Chief Engineer + /obj/item/clothing/under/rank/engineering/chief_engineer/skirt, + /obj/item/clothing/under/rank/engineering/chief_engineer/turtleneck/skirt, + // Engineer + /obj/item/clothing/under/rank/engineering/engineer/skirt, + // Atmos tech + /obj/item/clothing/under/rank/engineering/atmospheric_technician/skirt, + + + /* Medical */ + // Chief Medical Officer + /obj/item/clothing/under/rank/medical/chief_medical_officer/skirt, + /obj/item/clothing/under/rank/medical/chief_medical_officer/turtleneck/skirt, + // Medical doctor + /obj/item/clothing/under/rank/medical/doctor/skirt, + /obj/item/clothing/under/rank/medical/virologist/skirt, + // Coroner + /obj/item/clothing/under/rank/medical/coroner/skirt, + // Paramedic + /obj/item/clothing/under/rank/medical/paramedic/skirt, + // Chemist + /obj/item/clothing/under/rank/medical/chemist/skirt, + + + /* Cargo */ + // Quartermaster + /obj/item/clothing/under/rank/cargo/qm/skirt, + // Everyone else + /obj/item/clothing/under/rank/cargo/tech/skirt, +))) diff --git a/modular_zzplurt/code/datums/elements/skirt_peeking.dm b/modular_zzplurt/code/datums/elements/skirt_peeking.dm new file mode 100644 index 0000000000000..37c7b72d6cf23 --- /dev/null +++ b/modular_zzplurt/code/datums/elements/skirt_peeking.dm @@ -0,0 +1,70 @@ +/datum/element/skirt_peeking + element_flags = ELEMENT_DETACH_ON_HOST_DESTROY + +/datum/element/skirt_peeking/Attach(datum/peeked) + . = ..() + if(!ishuman(peeked)) + return ELEMENT_INCOMPATIBLE + + RegisterSignal(peeked, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) + RegisterSignal(peeked, COMSIG_ATOM_EXAMINE_MORE, PROC_REF(on_closer_look)) + +/datum/element/skirt_peeking/Detach(datum/peeked, ...) + . = ..() + UnregisterSignal(peeked, list(COMSIG_ATOM_EXAMINE, COMSIG_ATOM_EXAMINE_MORE)) + +/datum/element/skirt_peeking/proc/can_skirt_peek(mob/living/carbon/human/peeked, mob/peeker) + if(peeked == peeker) + return FALSE + + var/mob/living/living_peeker = peeker + var/obj/item/clothing/under/worn_uniform = peeked.get_item_by_slot(ITEM_SLOT_ICLOTHING) + var/obj/item/clothing/suit/outer_clothing = peeked.get_item_by_slot(ITEM_SLOT_OCLOTHING) + + // Check if the clothing is valid + if(outer_clothing && outer_clothing.body_parts_covered & (CHEST | GROIN | LEGS | FEET)) + return FALSE + + // We are now peeking under a uniform + if(worn_uniform && (is_type_in_typecache(worn_uniform.type, GLOB.skirt_peekable) || worn_uniform.female_sprite_flags & FEMALE_UNIFORM_TOP_ONLY)) // FEMALE_UNIFORM_TOP_ONLY fallback incase something is missed + if(isobserver(peeker)) + return TRUE + if(istype(living_peeker)) + // Is the peeker not standing and the peeked not laying down + if((living_peeker.loc == peeked.loc) && (living_peeker.resting && !peeked.resting)) + return TRUE + + var/obj/structure/high_ground_peeked = locate(/obj/structure) in get_turf(peeked) + var/obj/structure/high_ground_peeker = locate(/obj/structure) in get_turf(peeker) + if(high_ground_peeked && HAS_TRAIT(high_ground_peeked, TRAIT_CLIMBABLE) && (peeked.mobility_flags & MOBILITY_STAND) && peeked.Adjacent(peeker)) + if(!(high_ground_peeker && HAS_TRAIT(high_ground_peeker, TRAIT_CLIMBABLE))) + return TRUE + return FALSE + +/datum/element/skirt_peeking/proc/on_examine(mob/living/carbon/human/peeked, mob/peeker, list/examine_list) + if(can_skirt_peek(peeked, peeker)) + examine_list += span_purple("[peeked.p_theyre(TRUE)] wearing a skirt! I can probably give it a little peek looking closer.") + +/datum/element/skirt_peeking/proc/on_closer_look(mob/living/carbon/human/peeked, mob/peeker, list/examine_content) + if(can_skirt_peek(peeked, peeker)) + for(var/obj/item/organ/external/genital/genital in peeked.organs) + if(genital.zone != BODY_ZONE_PRECISE_GROIN) + continue + if(genital.visibility_preference == GENITAL_SKIP_VISIBILITY) + continue + examine_content += genital.get_description_string() + addtimer(CALLBACK(src, PROC_REF(try_notice), peeked, peeker), 1) + +/// Alright, they've peeked us and everything, did we notice it though? +/datum/element/skirt_peeking/proc/try_notice(mob/living/carbon/human/peeked, mob/living/peeker) + if(isnull(peeked) || isnull(peeker)) + return + if(!istype(peeked) || !istype(peeker)) + return + var/obj/item/clothing/under/worn_uniform = peeked.get_item_by_slot(ITEM_SLOT_ICLOTHING) + if(!istype(worn_uniform)) + return + if(!(!peeked.client && (peeked.stat == CONSCIOUS) && peeked.has_status_effect(/datum/status_effect/grouped/blindness))) + return + to_chat(peeked, span_warning("You notice [peeker] looking under your [worn_uniform.name]!")) + to_chat(peeker, span_warning("[peeked] notices you peeking under [peeked.p_their()] [worn_uniform.name]!")) diff --git a/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm index 6d6f4de9f2fe6..24da0060b8d91 100644 --- a/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm +++ b/modular_zzplurt/code/modules/mob/living/carbon/human/human.dm @@ -4,6 +4,7 @@ /mob/living/carbon/human/Initialize(mapload) . = ..() + AddElement(/datum/element/skirt_peeking) AddElement(/datum/element/mob_holder/micro) /mob/living/carbon/human/on_entered(datum/source, mob/living/carbon/human/moving) diff --git a/tgstation.dme b/tgstation.dme index 9a8b6bd560b22..115e832788582 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9413,6 +9413,7 @@ #include "modular_zzplurt\code\datums\components\crafting\crafting.dm" #include "modular_zzplurt\code\datums\elements\holder_micro.dm" #include "modular_zzplurt\code\datums\elements\mob_holder.dm" +#include "modular_zzplurt\code\datums\elements\skirt_peeking.dm" #include "modular_zzplurt\code\datums\keybinding\human.dm" #include "modular_zzplurt\code\datums\keybinding\living.dm" #include "modular_zzplurt\code\datums\mutations\body.dm"