From 8e94bff33cd73adf4d71b4e1959100fe30d24e63 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Mon, 2 Jun 2014 21:07:21 -0600 Subject: [PATCH] -Giacom's Feeback -Belt, ID, and Pockets are no longer blocked by exosuits, as they are still visible --- .../mob/living/carbon/human/examine.dm | 38 ++--- code/modules/mob/living/carbon/human/human.dm | 138 +++++++----------- 2 files changed, 64 insertions(+), 112 deletions(-) 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 b13e6c8c1d4..f19f39dd7f7 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -291,27 +291,8 @@ /mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) - var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) - var/skipgloves = 0 - var/skipsuitstorage = 0 - var/skipjumpsuit = 0 - var/skipshoes = 0 - var/skipmask = 0 - var/skipears = 0 - var/skipeyes = 0 - - //exosuits and helmets obscure what we can see - 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 + var/list/obscured = check_obscured_slots() var/dat = {" Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Empty"]
@@ -326,50 +307,50 @@ dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" - if(!skipmask) - dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" - else + if(slot_wear_mask in obscured) dat += "
Mask: Obscured by [head]" - - if(!skipeyes) - dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" else + dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" + + if(slot_glasses in obscured) dat += "
Eyes: Obscured by [head]" - - if(!skipears) - dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" 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 && !skipsuitstorage) + 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(!skipshoes) - dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" - else + if(slot_shoes in obscured) dat += "
Shoes: Obscured by [wear_suit]" - - if(!skipgloves) - dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" else + dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" + + if(slot_gloves in obscured) dat += "
Gloves: Obscured by [wear_suit]" - - if(!skipjumpsuit) - 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"]" 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 += "
" @@ -383,7 +364,7 @@
Close "} - var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 480) + var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 500) popup.set_content(dat) popup.open() @@ -406,45 +387,12 @@ /mob/living/carbon/human/Topic(href, href_list) if(canUseTopic(src)) if(href_list["item"]) - var/obscuring = null var/slot = text2num(href_list["item"]) - switch(slot) - if(slot_wear_mask) - if(head && head.flags_inv & HIDEMASK) - obscuring = head - if(slot_glasses) - if(head && head.flags_inv & HIDEEYES) - obscuring = head - if(slot_ears) - if(head && head.flags_inv & HIDEEARS) - obscuring = head - if(slot_gloves) - if(wear_suit && wear_suit.flags_inv & HIDEGLOVES) - obscuring = wear_suit - if(slot_shoes) - if(wear_suit && wear_suit.flags_inv & HIDESHOES) - obscuring = wear_suit - if(slot_s_store) - if(wear_suit && wear_suit.flags_inv & HIDESUITSTORAGE) - obscuring = wear_suit - if(slot_w_uniform) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(slot_belt) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(slot_wear_id) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(obscuring) - usr << "[obscuring] is in the way. Remove that first." + if(slot in check_obscured_slots()) + usr << "You can't reach that. Something is covering it." return if(href_list["pockets"]) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - usr << "[wear_suit] is in the way. Remove that first." - return - 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) @@ -544,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