diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index 6955872c27..9131c02240 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -37,9 +37,9 @@
return 1
-/obj/item/device/flashlight/attack(mob/living/carbon/human/M, mob/living/carbon/human/user)
+/obj/item/device/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user)
add_fingerprint(user)
- if(on && user.zone_selected == "eyes")
+ if(istype(M) && on && user.zone_selected in list("eyes", "mouth"))
if((user.disabilities & CLUMSY || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
@@ -48,28 +48,101 @@
to_chat(user, "You don't have the dexterity to do this!")
return
- var/mob/living/carbon/human/H = M //mob has protective eyewear
- if(ishuman(M) && ((H.head && H.head.flags_cover & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags_cover & MASKCOVERSEYES) || (H.glasses && H.glasses.flags_cover & GLASSESCOVERSEYES)))
- to_chat(user, "You're going to need to remove that [(H.head && H.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first.")
+ if(!M.get_bodypart("head"))
+ to_chat(user, "[M] doesn't have a head!")
return
- if(M == user) //they're using it on themselves
- if(M.flash_act(visual = 1))
- M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes! Trippy!")
- else
- M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes.")
- else
- user.visible_message("[user] directs [src] to [M]'s eyes.", \
- "You direct [src] to [M]'s eyes.")
- var/mob/living/carbon/C = M
- if(istype(C))
- if(C.stat == DEAD || (C.disabilities & BLIND)) //mob is dead or fully blind
- to_chat(user, "[C] pupils don't react to the light!")
- else if(C.dna.check_mutation(XRAY)) //mob has X-RAY vision
- to_chat(user, "[C] pupils give an eerie glow!")
- else //they're okay!
- if(C.flash_act(visual = 1))
- to_chat(user, "[C]'s pupils narrow.")
+ switch(user.zone_selected)
+ if("eyes")
+ if((M.head && M.head.flags_cover & HEADCOVERSEYES) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) || (M.glasses && M.glasses.flags_cover & GLASSESCOVERSEYES))
+ to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first.")
+ return
+
+ var/obj/item/organ/eyes/E = M.getorganslot("eye_sight")
+ if(!E)
+ to_chat(user, "[M] doesn't have any eyes!")
+ return
+
+ if(M == user) //they're using it on themselves
+ if(M.flash_act(visual = 1))
+ M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes! Trippy!")
+ else
+ M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes.")
+ else
+ user.visible_message("[user] directs [src] to [M]'s eyes.", \
+ "You direct [src] to [M]'s eyes.")
+ if(M.stat == DEAD || (M.disabilities & BLIND) || !M.flash_act(visual = 1)) //mob is dead or fully blind
+ to_chat(user, "[M]'s pupils don't react to the light!")
+ else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-RAY vision
+ to_chat(user, "[M]'s pupils give an eerie glow!")
+ else //they're okay!
+ to_chat(user, "[M]'s pupils narrow.")
+
+ if("mouth")
+
+ if((M.head && M.head.flags_cover & HEADCOVERSMOUTH) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH))
+ to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSMOUTH) ? "helmet" : "mask"] first.")
+ return
+
+ var/their = M.p_their()
+
+ var/list/mouth_organs = new
+ for(var/obj/item/organ/O in M.internal_organs)
+ if(O.zone == "mouth")
+ mouth_organs.Add(O)
+ var/organ_list = ""
+ var/organ_count = LAZYLEN(mouth_organs)
+ if(organ_count)
+ for(var/I in 1 to organ_count)
+ if(I > 1)
+ if(I == mouth_organs.len)
+ organ_list += ", and "
+ else
+ organ_list += ", "
+ var/obj/item/organ/O = mouth_organs[I]
+ organ_list += (O.gender == "plural" ? O.name : "\an [O.name]")
+
+ var/pill_count = 0
+ for(var/datum/action/item_action/hands_free/activate_pill/AP in M.actions)
+ pill_count++
+
+ if(M == user)
+ var/can_use_mirror = FALSE
+ if(isturf(user.loc))
+ var/obj/structure/mirror/mirror = locate(/obj/structure/mirror, user.loc)
+ if(mirror)
+ switch(user.dir)
+ if(NORTH)
+ can_use_mirror = mirror.pixel_y > 0
+ if(SOUTH)
+ can_use_mirror = mirror.pixel_y < 0
+ if(EAST)
+ can_use_mirror = mirror.pixel_x > 0
+ if(WEST)
+ can_use_mirror = mirror.pixel_x < 0
+
+ M.visible_message("[M] directs [src] to [their] mouth.", \
+ "You point [src] into your mouth.")
+ if(!can_use_mirror)
+ to_chat(user, "You can't see anything without a mirror.")
+ return
+ if(organ_count)
+ to_chat(user, "Inside your mouth [organ_count > 1 ? "are" : "is"] [organ_list].")
+ else
+ to_chat(user, "There's nothing inside your mouth.")
+ if(pill_count)
+ to_chat(user, "You have [pill_count] implanted pill[pill_count > 1 ? "s" : ""].")
+
+ else
+ user.visible_message("[user] directs [src] to [M]'s mouth.",\
+ "You direct [src] to [M]'s mouth.")
+ if(organ_count)
+ to_chat(user, "Inside [their] mouth [organ_count > 1 ? "are" : "is"] [organ_list].")
+ else
+ to_chat(user, "[M] doesn't have any organs in [their] mouth.")
+ if(pill_count)
+ to_chat(user, "[M] has [pill_count] pill[pill_count > 1 ? "s" : ""] implanted in [their] teeth.")
+
else
return ..()
@@ -280,7 +353,7 @@
return TRUE
/obj/item/device/flashlight/emp/attack(mob/living/M, mob/living/user)
- if(on && user.zone_selected == "eyes") // call original attack proc only if aiming at the eyes
+ if(on && user.zone_selected in list("eyes", "mouth")) // call original attack when examining organs
..()
return