diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 6a6de9d49e0..39c76e379be 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -12,3 +12,4 @@ var/timezoneOffset = 0 // The difference betwen midnight (of the host computer) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. var/fileaccess_timer = 0 +var/TAB = "    " \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 0f7690a1a4d..ea0cc16a2d5 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -6,28 +6,8 @@ usr << "Something is there but you can't see it." return - var/skipgloves = 0 - var/skipsuitstorage = 0 - var/skipjumpsuit = 0 - var/skipshoes = 0 - var/skipmask = 0 - var/skipears = 0 - var/skipeyes = 0 + var/list/obscured = check_obscured_slots() var/skipface = 0 - - //exosuits and helmets obscure our view and stuff. - if(wear_suit) - skipgloves = wear_suit.flags_inv & HIDEGLOVES - skipsuitstorage = wear_suit.flags_inv & HIDESUITSTORAGE - skipjumpsuit = wear_suit.flags_inv & HIDEJUMPSUIT - skipshoes = wear_suit.flags_inv & HIDESHOES - - if(head) - skipmask = head.flags_inv & HIDEMASK - skipeyes = head.flags_inv & HIDEEYES - skipears = head.flags_inv & HIDEEARS - skipface = head.flags_inv & HIDEFACE - if(wear_mask) skipface |= wear_mask.flags_inv & HIDEFACE @@ -40,7 +20,7 @@ var/msg = "*---------*\nThis is " - if( skipjumpsuit && skipface ) //big suits/masks/helmets make it hard to tell their gender + if( slot_w_uniform in obscured && skipface ) //big suits/masks/helmets make it hard to tell their gender t_He = "They" t_his = "their" t_him = "them" @@ -62,7 +42,7 @@ msg += "[src.name]!\n" //uniform - if(w_uniform && !skipjumpsuit) + if(w_uniform && !(slot_w_uniform in obscured)) //Ties var/tie_msg if(istype(w_uniform,/obj/item/clothing/under)) @@ -90,7 +70,7 @@ msg += "[t_He] [t_is] wearing \icon[wear_suit] \a [wear_suit].\n" //suit/armour storage - if(s_store && !skipsuitstorage) + if(s_store) if(s_store.blood_DNA) msg += "[t_He] [t_is] carrying \icon[s_store] [s_store.gender==PLURAL?"some":"a"] blood-stained [s_store.name] on [t_his] [wear_suit.name]!\n" else @@ -118,7 +98,7 @@ msg += "[t_He] [t_is] holding \icon[r_hand] \a [r_hand] in [t_his] right hand.\n" //gloves - if(gloves && !skipgloves) + if(gloves && !(slot_gloves in obscured)) if(gloves.blood_DNA) msg += "[t_He] [t_has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] blood-stained [gloves.name] on [t_his] hands!\n" else @@ -143,28 +123,28 @@ msg += "[t_He] [t_has] \icon[belt] \a [belt] about [t_his] waist.\n" //shoes - if(shoes && !skipshoes) + if(shoes && !(slot_shoes in obscured)) if(shoes.blood_DNA) msg += "[t_He] [t_is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] blood-stained [shoes.name] on [t_his] feet!\n" else msg += "[t_He] [t_is] wearing \icon[shoes] \a [shoes] on [t_his] feet.\n" //mask - if(wear_mask && !skipmask) + if(wear_mask && !(slot_wear_mask in obscured)) if(wear_mask.blood_DNA) msg += "[t_He] [t_has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] blood-stained [wear_mask.name] on [t_his] face!\n" else msg += "[t_He] [t_has] \icon[wear_mask] \a [wear_mask] on [t_his] face.\n" //eyes - if(glasses && !skipeyes) + if(glasses && !(slot_glasses in obscured)) if(glasses.blood_DNA) msg += "[t_He] [t_has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] blood-stained [glasses] covering [t_his] eyes!\n" else msg += "[t_He] [t_has] \icon[glasses] \a [glasses] covering [t_his] eyes.\n" //ears - if(ears && !skipears) + if(ears && !(slot_ears in obscured)) msg += "[t_He] [t_has] \icon[ears] \a [ears] on [t_his] ears.\n" //ID diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 95ca9cf0f7c..f19f39dd7f7 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -292,54 +292,81 @@ /mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) + var/list/obscured = check_obscured_slots() + var/dat = {" -
- [name] -
-
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"] -
Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"] -
Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"] -
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Nothing"] -
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Nothing"] -
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Nothing"] -
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"] -
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Nothing"]"} + Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Empty"]
+ Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Empty"]
+ "} - dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Nothing"]" - if(w_uniform) - dat += "
Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Nothing"]" - if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" - - dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Nothing"]" - if(wear_suit) - dat += "
Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Nothing"]" - if(has_breathable_mask && istype(wear_suit, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" - - dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Nothing"]" + dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Empty"]" if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - if(w_uniform) //we checked already, but a different place. - dat += "
ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" + dat += "
" + + dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" + + if(slot_wear_mask in obscured) + dat += "
Mask: Obscured by [head]" + else + dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" + + if(slot_glasses in obscured) + dat += "
Eyes: Obscured by [head]" + else + dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" + + if(slot_ears in obscured) + dat += "
Ears: Obscured by [head]" + else + dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" + + dat += "
" + + dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Empty"]" + if(wear_suit) + dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Empty"]" + if(has_breathable_mask && istype(wear_suit, /obj/item/weapon/tank)) + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + + if(slot_shoes in obscured) + dat += "
Shoes: Obscured by [wear_suit]" + else + dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" + + if(slot_gloves in obscured) + dat += "
Gloves: Obscured by [wear_suit]" + else + dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" + + if(slot_w_uniform in obscured) + dat += "
Uniform: Obscured by [wear_suit]" + else + dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]" + if(w_uniform) + dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" + if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" + dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" + dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" + + dat += "
" if(handcuffed) - dat += "
Handcuffed" + dat += "
Handcuffed: Remove" if(legcuffed) - dat += "
Legcuffed" - if(w_uniform) - dat += "

Left Pocket ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right Pocket ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" + dat += "
Legcuffed: Remove" dat += {"

Close "} - user << browse(dat, "window=mob\ref[src];size=340x480") - onclose(user, "mob\ref[src]") - + var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 500) + popup.set_content(dat) + popup.open() // called when something steps onto a human // this could be made more general, but for now just handle mulebot @@ -358,11 +385,14 @@ /mob/living/carbon/human/Topic(href, href_list) - ..() - //strip panel - if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) - if(href_list["pockets"]) + if(canUseTopic(src)) + if(href_list["item"]) + var/slot = text2num(href_list["item"]) + if(slot in check_obscured_slots()) + usr << "You can't reach that. Something is covering it." + return + if(href_list["pockets"]) var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) @@ -390,13 +420,14 @@ // Update strip window if(usr.machine == src && in_range(src, usr)) show_inv(usr) - - - else // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" + ..() + return + + if(href_list["criminal"]) if(istype(usr, /mob/living/carbon/human)) var/mob/living/carbon/human/H = usr @@ -461,4 +492,28 @@ . = 0 if(!. && error_msg && user) // Might need re-wording. - user << "There is no exposed flesh or thin material [above_neck(target_zone) ? "on their head" : "on their body"]." \ No newline at end of file + user << "There is no exposed flesh or thin material [above_neck(target_zone) ? "on their head" : "on their body"]." + +/mob/living/carbon/human/proc/check_obscured_slots() + var/list/obscured = list() + + if(wear_suit) + if(wear_suit.flags_inv & HIDEGLOVES) + obscured |= slot_gloves + if(wear_suit.flags_inv & HIDEJUMPSUIT) + obscured |= slot_w_uniform + if(wear_suit.flags_inv & HIDESHOES) + obscured |= slot_shoes + + if(head) + if(head.flags_inv & HIDEMASK) + obscured |= slot_wear_mask + if(head.flags_inv & HIDEEYES) + obscured |= slot_glasses + if(head.flags_inv & HIDEEARS) + obscured |= slot_ears + + if(obscured.len > 0) + return obscured + else + return null \ No newline at end of file