diff --git a/code/__DEFINES/inventory.dm b/code/__DEFINES/inventory.dm index 7ad5041344d..c3db29286d5 100644 --- a/code/__DEFINES/inventory.dm +++ b/code/__DEFINES/inventory.dm @@ -87,6 +87,7 @@ //Bit flags for the flags_inv variable, which determine when a piece of clothing hides another. IE a helmet hiding glasses. +//Make sure to update check_obscured_slots() if you add more. #define HIDEGLOVES (1<<0) #define HIDESUITSTORAGE (1<<1) #define HIDEJUMPSUIT (1<<2) //these first four are only used in exterior suits diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 009db633085..416758453b4 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -349,56 +349,52 @@ check_heat(M) for(var/obj/item/I in M.held_items) wash_obj(I) - if(M.back) - if(wash_obj(M.back)) - M.update_inv_back(0) + + if(M.back && wash_obj(M.back)) + M.update_inv_back(0) + + var/list/obscured = M.check_obscured_slots() + + if(M.head && wash_obj(M.head)) + M.update_inv_head() + + if(M.glasses && !(SLOT_GLASSES in obscured) && wash_obj(M.glasses)) + M.update_inv_glasses() + + if(M.wear_mask && !(SLOT_WEAR_MASK in obscured) && wash_obj(M.wear_mask)) + M.update_inv_wear_mask() + + if(M.ears && !(HIDEEARS in obscured) && wash_obj(M.ears)) + M.update_inv_ears() + + if(M.wear_neck && !(SLOT_NECK in obscured) && wash_obj(M.wear_neck)) + M.update_inv_neck() + + if(M.shoes && !(HIDESHOES in obscured) && wash_obj(M.shoes)) + M.update_inv_shoes() + + var/washgloves = FALSE + if(M.gloves && !(HIDEGLOVES in obscured)) + washgloves = TRUE + if(ishuman(M)) var/mob/living/carbon/human/H = M - var/washgloves = TRUE - var/washshoes = TRUE - var/washmask = TRUE - var/washears = TRUE - var/washglasses = TRUE - if(H.wear_suit) - washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES) - washshoes = !(H.wear_suit.flags_inv & HIDESHOES) - - if(H.head) - washmask = !(H.head.flags_inv & HIDEMASK) - washglasses = !(H.head.flags_inv & HIDEEYES) - washears = !(H.head.flags_inv & HIDEEARS) - - if(H.wear_mask) - if (washears) - washears = !(H.wear_mask.flags_inv & HIDEEARS) - if (washglasses) - washglasses = !(H.wear_mask.flags_inv & HIDEEYES) - - if(H.head && wash_obj(H.head)) - H.update_inv_head() if(H.wear_suit && wash_obj(H.wear_suit)) H.update_inv_wear_suit() else if(H.w_uniform && wash_obj(H.w_uniform)) H.update_inv_w_uniform() + if(washgloves) SEND_SIGNAL(H, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) - if(H.shoes && washshoes && wash_obj(H.shoes)) - H.update_inv_shoes() - if(H.wear_mask && washmask && wash_obj(H.wear_mask)) - H.update_inv_wear_mask() - else + + if(!H.is_mouth_covered()) H.lip_style = null H.update_body() - if(H.glasses && washglasses && wash_obj(H.glasses)) - H.update_inv_glasses() - if(H.ears && washears && wash_obj(H.ears)) - H.update_inv_ears() + if(H.belt && wash_obj(H.belt)) H.update_inv_belt() else - if(M.wear_mask && wash_obj(M.wear_mask)) - M.update_inv_wear_mask(0) SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) else SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 21752b0a48f..ad52b51421a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -384,6 +384,34 @@ dropItemToGround(I) drop_all_held_items() + +/mob/living/carbon/proc/check_obscured_slots() + var/list/obscured = list() + var/hidden_slots = NONE + + for(var/obj/item/I in get_equipped_items()) + hidden_slots |= I.flags_inv + + if(hidden_slots & HIDENECK) + obscured |= SLOT_NECK + if(hidden_slots & HIDEMASK) + obscured |= SLOT_WEAR_MASK + if(hidden_slots & HIDEEYES) + obscured |= SLOT_GLASSES + if(hidden_slots & HIDEEARS) + obscured |= SLOT_EARS + if(hidden_slots & HIDEGLOVES) + obscured |= SLOT_GLOVES + if(hidden_slots & HIDEJUMPSUIT) + obscured |= SLOT_W_UNIFORM + if(hidden_slots & HIDESHOES) + obscured |= SLOT_SHOES + if(hidden_slots & HIDESUITSTORAGE) + obscured |= SLOT_S_STORE + + return obscured + + /obj/item/proc/equip_to_best_slot(mob/M) if(src != M.get_active_held_item()) to_chat(M, "You are not holding anything to equip!") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 57a43484ecd..28420e31b03 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -196,13 +196,23 @@
[name]
-
Head: [(head && !(head.item_flags & ABSTRACT)) ? head : "Nothing"] -
Mask: [(wear_mask && !(wear_mask.item_flags & ABSTRACT)) ? wear_mask : "Nothing"] -
Neck: [(wear_neck && !(wear_neck.item_flags & ABSTRACT)) ? wear_neck : "Nothing"]"} +
Head: [(head && !(head.item_flags & ABSTRACT)) ? head : "Nothing"]"} + + var/list/obscured = check_obscured_slots() + + if(SLOT_NECK in obscured) + dat += "
Neck: Obscured" + else + dat += "
Neck: [(wear_neck && !(wear_neck.item_flags & ABSTRACT)) ? (wear_neck) : "Nothing"]" + + if(SLOT_WEAR_MASK in obscured) + dat += "
Mask: Obscured" + else + dat += "
Mask: [(wear_mask && !(wear_mask.item_flags & ABSTRACT)) ? wear_mask : "Nothing"]" for(var/i in 1 to held_items.len) var/obj/item/I = get_item_for_held_index(i) - dat += "
[get_held_index_name(i)]:[(I && !(I.item_flags & ABSTRACT)) ? I : "Nothing"]" + dat += "
[get_held_index_name(i)]: [(I && !(I.item_flags & ABSTRACT)) ? I : "Nothing"]" dat += "
Back: [back ? back : "Nothing"]" @@ -242,7 +252,6 @@ visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM.name].", \ "[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM.name].") - /mob/living/carbon/fall(forced) loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing @@ -895,7 +904,7 @@ for(var/X in internal_organs) var/obj/item/organ/I = X I.Insert(src) - + /mob/living/carbon/proc/update_disabled_bodyparts() for(var/B in bodyparts) var/obj/item/bodypart/BP = B diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index a279a2c5c5d..696f5e904d0 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -7,14 +7,15 @@ var/t_is = p_are() var/msg = "*---------*\nThis is [icon2html(src, user)] \a [src]!\n" + var/list/obscured = check_obscured_slots() if (handcuffed) msg += "[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed!\n" if (head) msg += "[t_He] [t_is] wearing [head.get_examine_string(user)] on [t_his] head. \n" - if (wear_mask) + if(wear_mask && !(SLOT_WEAR_MASK in obscured)) msg += "[t_He] [t_is] wearing [wear_mask.get_examine_string(user)] on [t_his] face.\n" - if (wear_neck) + if(wear_neck && !(SLOT_NECK in obscured)) msg += "[t_He] [t_is] wearing [wear_neck.get_examine_string(user)] around [t_his] neck.\n" for(var/obj/item/I in held_items) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index ec13a30ebd9..07c3ac62c39 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -35,7 +35,7 @@ if(wear_suit) msg += "[t_He] [t_is] wearing [wear_suit.get_examine_string(user)].\n" //suit/armor storage - if(s_store) + if(s_store && !(SLOT_S_STORE in obscured)) msg += "[t_He] [t_is] carrying [s_store.get_examine_string(user)] on [t_his] [wear_suit.name].\n" //back if(back) @@ -76,7 +76,7 @@ if(wear_mask && !(SLOT_WEAR_MASK in obscured)) msg += "[t_He] [t_has] [wear_mask.get_examine_string(user)] on [t_his] face.\n" - if (wear_neck && !(SLOT_NECK in obscured)) + if(wear_neck && !(SLOT_NECK in obscured)) msg += "[t_He] [t_is] wearing [wear_neck.get_examine_string(user)] around [t_his] neck.\n" //eyes diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4fc56f56c8c..d6deb81a317 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -151,10 +151,13 @@ dat += "Exosuit:[(wear_suit && !(wear_suit.item_flags & ABSTRACT)) ? wear_suit : "Empty"]" if(wear_suit) - dat += " ↳Suit Storage:[(s_store && !(s_store.item_flags & ABSTRACT)) ? s_store : "Empty"]" - if(has_breathable_mask && istype(s_store, /obj/item/tank)) - dat += " [internal ? "Disable Internals" : "Set Internals"]" - dat += "" + if(SLOT_S_STORE in obscured) + dat += " ↳Suit Storage:" + else + dat += " ↳Suit Storage:[(s_store && !(s_store.item_flags & ABSTRACT)) ? s_store : "Empty"]" + if(has_breathable_mask && istype(s_store, /obj/item/tank)) + dat += " [internal ? "Disable Internals" : "Set Internals"]" + dat += "" else dat += " ↳Suit Storage:" @@ -508,34 +511,6 @@ // Might need re-wording. to_chat(user, "There is no exposed flesh or thin material [above_neck(target_zone) ? "on [p_their()] head" : "on [p_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(wear_mask) - if(wear_mask.flags_inv & HIDEEYES) - obscured |= SLOT_GLASSES - - if(obscured.len) - return obscured - else - return null - /mob/living/carbon/human/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) if(judgement_criteria & JUDGE_EMAGGED) return 10 //Everyone is a criminal! diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index b123ebefe3a..a9f5fb1a4c0 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -486,7 +486,7 @@ L.receive_damage(0,5) Paralyze(100) -/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) +/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) //todo: update this to utilize check_obscured_slots() var/list/damaged = list() var/list/inventory_items_to_kill = list() var/acidity = acidpwr * min(acid_volume*0.005, 0.1) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index f3ab7ba347d..79547a21c1e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1546,50 +1546,45 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.on_fire) //the fire tries to damage the exposed clothes and items var/list/burning_items = list() + var/list/obscured = H.check_obscured_slots() //HEAD// - var/obj/item/clothing/head_clothes = null - if(H.glasses) - head_clothes = H.glasses - if(H.wear_mask) - head_clothes = H.wear_mask - if(H.wear_neck) - head_clothes = H.wear_neck - if(H.head) - head_clothes = H.head - if(head_clothes) - burning_items += head_clothes - else if(H.ears) + + if(H.glasses && !(SLOT_GLASSES in obscured)) + burning_items += H.glasses + if(H.wear_mask && !(SLOT_WEAR_MASK in obscured)) + burning_items += H.wear_mask + if(H.wear_neck && !(SLOT_NECK in obscured)) + burning_items += H.wear_neck + if(H.ears && !(SLOT_EARS in obscured)) burning_items += H.ears + if(H.head) + burning_items += H.head //CHEST// - var/obj/item/clothing/chest_clothes = null - if(H.w_uniform) - chest_clothes = H.w_uniform + if(H.w_uniform && !(SLOT_W_UNIFORM in obscured)) + burning_items += H.w_uniform if(H.wear_suit) - chest_clothes = H.wear_suit - - if(chest_clothes) - burning_items += chest_clothes + burning_items += H.wear_suit //ARMS & HANDS// var/obj/item/clothing/arm_clothes = null - if(H.gloves) + if(H.gloves && !(SLOT_GLOVES in obscured)) arm_clothes = H.gloves - if(H.w_uniform && ((H.w_uniform.body_parts_covered & HANDS) || (H.w_uniform.body_parts_covered & ARMS))) - arm_clothes = H.w_uniform - if(H.wear_suit && ((H.wear_suit.body_parts_covered & HANDS) || (H.wear_suit.body_parts_covered & ARMS))) + else if(H.wear_suit && ((H.wear_suit.body_parts_covered & HANDS) || (H.wear_suit.body_parts_covered & ARMS))) arm_clothes = H.wear_suit + else if(H.w_uniform && ((H.w_uniform.body_parts_covered & HANDS) || (H.w_uniform.body_parts_covered & ARMS))) + arm_clothes = H.w_uniform if(arm_clothes) burning_items |= arm_clothes //LEGS & FEET// var/obj/item/clothing/leg_clothes = null - if(H.shoes) + if(H.shoes && !(SLOT_SHOES in obscured)) leg_clothes = H.shoes - if(H.w_uniform && ((H.w_uniform.body_parts_covered & FEET) || (H.w_uniform.body_parts_covered & LEGS))) - leg_clothes = H.w_uniform - if(H.wear_suit && ((H.wear_suit.body_parts_covered & FEET) || (H.wear_suit.body_parts_covered & LEGS))) + else if(H.wear_suit && ((H.wear_suit.body_parts_covered & FEET) || (H.wear_suit.body_parts_covered & LEGS))) leg_clothes = H.wear_suit + else if(H.w_uniform && ((H.w_uniform.body_parts_covered & FEET) || (H.w_uniform.body_parts_covered & LEGS))) + leg_clothes = H.w_uniform if(leg_clothes) burning_items |= leg_clothes diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index a6f6abb042a..2641ed064f0 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -151,15 +151,13 @@ //the fire tries to damage the exposed clothes and items var/list/burning_items = list() //HEAD// - var/obj/item/clothing/head_clothes = null - if(wear_mask) - head_clothes = wear_mask - if(wear_neck) - head_clothes = wear_neck + var/list/obscured = check_obscured_slots() + if(wear_mask && !(SLOT_WEAR_MASK in obscured)) + burning_items += wear_mask + if(wear_neck && !(SLOT_NECK in obscured)) + burning_items += wear_neck if(head) - head_clothes = head - if(head_clothes) - burning_items += head_clothes + burning_items += head if(back) burning_items += back diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index b677a57d7fd..a26894b8ce3 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -122,7 +122,7 @@ inv.update_icon() if(wear_mask) - if(!(head && (head.flags_inv & HIDEMASK))) + if(!(SLOT_WEAR_MASK in check_obscured_slots())) overlays_standing[FACEMASK_LAYER] = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi') update_hud_wear_mask(wear_mask) @@ -136,7 +136,7 @@ inv.update_icon() if(wear_neck) - if(!(head && (head.flags_inv & HIDENECK))) + if(!(SLOT_NECK in check_obscured_slots())) overlays_standing[NECK_LAYER] = wear_neck.build_worn_icon(state = wear_neck.icon_state, default_layer = NECK_LAYER, default_icon_file = 'icons/mob/neck.dmi') update_hud_neck(wear_neck)