From 9e962ff5b7910923f91e7d4d5c8a659088d891c3 Mon Sep 17 00:00:00 2001 From: 4dplanner <3combined@gmail.com> Date: Wed, 2 Jan 2019 20:23:10 +0000 Subject: [PATCH] Transparent protection for clothing [READY] (#42075) * Transparent_protection * No longer protects captain mask webedit? * Use NONE --- code/game/objects/items.dm | 1 + code/game/objects/structures/watercloset.dm | 2 +- code/modules/clothing/suits/cloaks.dm | 2 ++ code/modules/mob/inventory.dm | 4 +++- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/mob/living/carbon/human/human_defense.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 2 +- 8 files changed, 11 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 3b20fa8e242..5113ac5a7da 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -48,6 +48,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) //Since any item can now be a piece of clothing, this has to be put here so all items share it. var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc. + var/transparent_protection = NONE //you can see someone's mask through their transparent visor, but you can't reach it var/interaction_flags_item = INTERACT_ITEM_ATTACK_HAND_PICKUP diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 7722d56a071..26b0a9cd6aa 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -360,7 +360,7 @@ if(M.back && wash_obj(M.back)) M.update_inv_back(0) - var/list/obscured = M.check_obscured_slots() + var/list/obscured = M.check_obscured_slots(TRUE) //can't wash a gas mask through a visor if(M.head && wash_obj(M.head)) M.update_inv_head() diff --git a/code/modules/clothing/suits/cloaks.dm b/code/modules/clothing/suits/cloaks.dm index 81acca03588..07e046ce21c 100644 --- a/code/modules/clothing/suits/cloaks.dm +++ b/code/modules/clothing/suits/cloaks.dm @@ -72,6 +72,7 @@ desc = "A protective & concealing hood." armor = list("melee" = 35, "bullet" = 10, "laser" = 25, "energy" = 10, "bomb" = 25, "bio" = 0, "rad" = 0, "fire" = 60, "acid" = 60) flags_inv = HIDEEARS|HIDEEYES|HIDEHAIR|HIDEFACIALHAIR + transparent_protection = HIDEMASK /obj/item/clothing/suit/hooded/cloak/drake name = "drake armour" @@ -84,6 +85,7 @@ body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT resistance_flags = FIRE_PROOF | ACID_PROOF + transparent_protection = HIDEGLOVES|HIDESUITSTORAGE|HIDEJUMPSUIT|HIDESHOES /obj/item/clothing/head/hooded/cloakhood/drake name = "drake helm" diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index ad52b51421a..89ce83d0ae6 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -385,12 +385,14 @@ drop_all_held_items() -/mob/living/carbon/proc/check_obscured_slots() +/mob/living/carbon/proc/check_obscured_slots(transparent_protection) var/list/obscured = list() var/hidden_slots = NONE for(var/obj/item/I in get_equipped_items()) hidden_slots |= I.flags_inv + if(transparent_protection) + hidden_slots |= I.transparent_protection if(hidden_slots & HIDENECK) obscured |= SLOT_NECK diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a23cf4bbe36..fec4461f7bf 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -240,7 +240,7 @@ if(href_list["item"]) //canUseTopic check for this is handled by mob/Topic() var/slot = text2num(href_list["item"]) - if(slot in check_obscured_slots()) + if(slot in check_obscured_slots(TRUE)) to_chat(usr, "You can't reach that! Something is covering it.") return diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 01e265e1b33..851da8e17db 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -492,7 +492,7 @@ L.receive_damage(0,5) Paralyze(100) -/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) //todo: update this to utilize check_obscured_slots() +/mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) //todo: update this to utilize check_obscured_slots() //and make sure it's check_obscured_slots(TRUE) to stop aciding through visors etc 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 2b2ce3fbf88..39420824d82 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1579,7 +1579,7 @@ 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() + var/list/obscured = H.check_obscured_slots(TRUE) //HEAD// if(H.glasses && !(SLOT_GLASSES in obscured)) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 358144a7df1..c1cf4ad774b 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -151,7 +151,7 @@ //the fire tries to damage the exposed clothes and items var/list/burning_items = list() //HEAD// - var/list/obscured = check_obscured_slots() + var/list/obscured = check_obscured_slots(TRUE) if(wear_mask && !(SLOT_WEAR_MASK in obscured)) burning_items += wear_mask if(wear_neck && !(SLOT_NECK in obscured))