diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 09ef814f68..55bfcaff79 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -224,6 +224,8 @@ GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list( #define isorgan(A) (istype(A, /obj/item/organ)) +#define isclothing(A) (istype(A, /obj/item/clothing)) + GLOBAL_LIST_INIT(pointed_types, typecacheof(list( /obj/item/pen, /obj/item/screwdriver, diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 94c2c372f0..831f73ac74 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -41,6 +41,7 @@ #define VOICEBOX_TOGGLABLE (1<<6) //The voicebox in this clothing can be toggled. #define VOICEBOX_DISABLED (1<<7) //The voicebox is currently turned off. #define IGNORE_HAT_TOSS (1<<8) //Hats with negative effects when worn (i.e the tinfoil hat). +#define SCAN_REAGENTS (1<<9) // Allows helmets and glasses to scan reagents. // Flags for the organ_flags var on /obj/item/organ diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index e0cf8ebdd5..bf179760c0 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -143,6 +143,7 @@ GLOBAL_LIST_INIT(bitfields, list( "VOICEBOX_TOGGLABLE" = VOICEBOX_TOGGLABLE, "VOICEBOX_DISABLED" = VOICEBOX_DISABLED, "IGNORE_HAT_TOSS" = IGNORE_HAT_TOSS, + "SCAN_REAGENTS" = SCAN_REAGENTS ), "tesla_flags" = list( "TESLA_MOB_DAMAGE" = TESLA_MOB_DAMAGE, diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index dc9e46c4b4..2b6b262395 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -22,7 +22,6 @@ var/cooldown = 0 var/obj/item/flashlight/F = null var/can_flashlight = 0 - var/scan_reagents = 0 //Can the wearer see reagents while it's equipped? var/blocks_shove_knockdown = FALSE //Whether wearing the clothing item blocks the ability for shove to knock down. diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 206165a495..1a178158d8 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -99,7 +99,7 @@ desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents." icon_state = "purple" item_state = "glasses" - scan_reagents = TRUE //You can see reagents while wearing science goggles + clothing_flags = SCAN_REAGENTS //You can see reagents while wearing science goggles actions_types = list(/datum/action/item_action/toggle_research_scanner) glass_colour_type = /datum/client_colour/glass_colour/purple resistance_flags = ACID_PROOF @@ -203,7 +203,7 @@ /obj/item/clothing/glasses/sunglasses/reagent name = "beer goggles" desc = "A pair of sunglasses outfitted with apparatus to scan reagents." - scan_reagents = TRUE + clothing_flags = SCAN_REAGENTS /obj/item/clothing/glasses/sunglasses/garb name = "black gar glasses" @@ -405,7 +405,7 @@ item_state = "godeye" vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS darkness_view = 8 - scan_reagents = TRUE + clothing_flags = SCAN_REAGENTS lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE resistance_flags = LAVA_PROOF | FIRE_PROOF diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 0d22b16388..9a5c919720 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -445,7 +445,7 @@ flash_protect = 0 armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 10, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 75) flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR - scan_reagents = TRUE + clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS /obj/item/clothing/suit/space/hardsuit/medical icon_state = "hardsuit-medical" @@ -467,7 +467,7 @@ max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 100, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 80) var/obj/machinery/doppler_array/integrated/bomb_radar - scan_reagents = TRUE + clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_research_scanner) /obj/item/clothing/head/helmet/space/hardsuit/rd/Initialize() @@ -638,7 +638,7 @@ armor = list("melee" = 20, "bullet" = 15, "laser" = 15, "energy" = 45, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100) item_color = "ancient" brightness_on = 16 - scan_reagents = TRUE + clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS flash_protect = 5 //We will not be flash by bombs tint = 1 var/obj/machinery/doppler_array/integrated/bomb_radar diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6ecedba3be..52cf82a06a 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -977,3 +977,14 @@ if(combatmode) toggle_combat_mode(TRUE, TRUE) return ..() + +/mob/living/carbon/can_see_reagents() + . = ..() + if(.) //No need to run through all of this if it's already true. + return + if(isclothing(head)) + var/obj/item/clothing/H = head + if(H.clothing_flags & SCAN_REAGENTS) + return TRUE + if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_REAGENTS)) + return TRUE diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 63d02af31a..e5e546fdf8 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -117,7 +117,8 @@ /mob/living/carbon/human/can_use_guns(obj/item/G) . = ..() - + if(!.) + return if(G.trigger_guard == TRIGGER_GUARD_NORMAL) if(HAS_TRAIT(src, TRAIT_CHUNKYFINGERS)) to_chat(src, "Your meaty finger is much too large for the trigger guard!") @@ -126,7 +127,13 @@ to_chat(src, "Your fingers don't fit in the trigger guard!") return FALSE - return . +/mob/living/carbon/human/can_see_reagents() + . = ..() + if(.) //No need to run through all of this if it's already true. + return + if(isclothing(glasses) && (glasses.clothing_flags & SCAN_REAGENTS)) + return TRUE + /* /mob/living/carbon/human/transfer_blood_dna(list/blood_dna) ..() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 463b29772c..28fb1f5a42 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -275,6 +275,15 @@ /mob/living/simple_animal/drone/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) return 0 //So they don't die trying to fix wiring +/mob/living/simple_animal/drone/can_see_reagents() + . = ..() + if(.) + return + if(isclothing(head)) + var/obj/item/clothing/H = head + if(H.clothing_flags & SCAN_REAGENTS) + return TRUE + /mob/living/simple_animal/drone/generate_mob_holder() var/obj/item/clothing/head/mob_holder/holder = new(get_turf(src), src, "[visualAppearence]_hat", null, null, null, TRUE) return holder diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ee99c7e7b6..5ecd668b96 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -811,26 +811,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/proc/can_interact_with(atom/A) return IsAdminGhost(src) || Adjacent(A) -//Can the mob see reagents inside of containers? -/mob/proc/can_see_reagents() - if(stat == DEAD) //Ghosts and such can always see reagents - return 1 - if(has_unlimited_silicon_privilege) //Silicons can automatically view reagents - return 1 - if(ishuman(src)) - var/mob/living/carbon/human/H = src - if(H.head && istype(H.head, /obj/item/clothing)) - var/obj/item/clothing/CL = H.head - if(CL.scan_reagents) - return 1 - if(H.wear_mask && H.wear_mask.scan_reagents) - return 1 - if(H.glasses && istype(H.glasses, /obj/item/clothing)) - var/obj/item/clothing/CL = H.glasses - if(CL.scan_reagents) - return 1 - return 0 - //Can the mob use Topic to interact with machines /mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE) return diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c18fc36e9a..18fc2bfb42 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -532,3 +532,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if(!held_item) return return held_item.GetID() + +//Can the mob see reagents inside of containers? +/mob/proc/can_see_reagents() + return stat == DEAD || has_unlimited_silicon_privilege //Dead guys and silicons can always see reagents