Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Skirt peeking #45

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions modular_zzplurt/code/_globalvars/lists/global_lewd.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)))
70 changes: 70 additions & 0 deletions modular_zzplurt/code/datums/elements/skirt_peeking.dm
Original file line number Diff line number Diff line change
@@ -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 <b>looking closer</b>.")

/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]!"))
4 changes: 4 additions & 0 deletions modular_zzplurt/code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/mob/living/carbon/human
/// Are we currently in combat focus?
var/combat_focus = FALSE

/mob/living/carbon/human/Initialize(mapload)
. = ..()
AddElement(/datum/element/skirt_peeking)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -9292,6 +9292,7 @@
#include "modular_zzplurt\code\datums\outfit.dm"
#include "modular_zzplurt\code\datums\sprite_accessories.dm"
#include "modular_zzplurt\code\datums\components\crafting\crafting.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\game\objects\items.dm"
Expand Down
Loading