diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 3536b72cf5..74f105c115 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -1031,23 +1031,29 @@
return(visible_implants)
+/mob/living/carbon/human/embedded_needs_process()
+ for(var/obj/item/organ/external/organ in src.organs)
+ for(var/obj/item/O in organ.implants)
+ if(!istype(O, /obj/item/weapon/implant)) //implant type items do not cause embedding effects, see handle_embedded_objects()
+ return 1
+ return 0
+
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/obj/item/organ/external/organ in src.organs)
if(organ.status & ORGAN_SPLINTED) //Splints prevent movement.
continue
- for(var/obj/item/weapon/O in organ.implants)
+ for(var/obj/item/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && prob(5)) //Moving with things stuck in you could be bad.
// All kinds of embedded objects cause bleeding.
- var/msg = null
- switch(rand(1,3))
- if(1)
- msg ="A spike of pain jolts your [organ.name] as you bump [O] inside."
- if(2)
- msg ="Your movement jostles [O] in your [organ.name] painfully."
- if(3)
- msg ="[O] in your [organ.name] twists painfully as you move."
- src << msg
+ if(species.flags & NO_PAIN)
+ src << "You feel [O] moving inside your [organ.name]."
+ else
+ var/msg = pick( \
+ "A spike of pain jolts your [organ.name] as you bump [O] inside.", \
+ "Your movement jostles [O] in your [organ.name] painfully.", \
+ "Your movement jostles [O] in your [organ.name] painfully.")
+ src << msg
organ.take_damage(rand(1,3), 0, 0)
if(!(organ.status & ORGAN_ROBOT) && !(species.flags & NO_BLOOD)) //There is no blood in protheses.
diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm
index f2c64fa52a..8598ce04b3 100644
--- a/code/modules/mob/living/carbon/human/human_organs.dm
+++ b/code/modules/mob/living/carbon/human/human_organs.dm
@@ -134,28 +134,29 @@
continue
if(E.is_broken() || E.is_dislocated())
- if(E.body_part == HAND_LEFT)
- if(!l_hand)
- continue
- drop_from_inventory(l_hand)
- else
- if(!r_hand)
- continue
- drop_from_inventory(r_hand)
+ switch(E.body_part)
+ if(HAND_LEFT, ARM_LEFT)
+ if(!l_hand)
+ continue
+ drop_from_inventory(l_hand)
+ if(HAND_RIGHT, ARM_RIGHT)
+ if(!r_hand)
+ continue
+ drop_from_inventory(r_hand)
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
emote("me", 1, "[(species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [E.name]!")
else if(E.is_malfunctioning())
-
- if(E.body_part == HAND_LEFT)
- if(!l_hand)
- continue
- drop_from_inventory(l_hand)
- else
- if(!r_hand)
- continue
- drop_from_inventory(r_hand)
+ switch(E.body_part)
+ if(HAND_LEFT, ARM_LEFT)
+ if(!l_hand)
+ continue
+ drop_from_inventory(l_hand)
+ if(HAND_RIGHT, ARM_RIGHT)
+ if(!r_hand)
+ continue
+ drop_from_inventory(r_hand)
emote("me", 1, "drops what they were holding, their [E.name] malfunctioning!")
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 18312abf92..d3268bfc39 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -1018,9 +1018,7 @@
//Periodically double-check embedded_flag
if(embedded_flag && !(life_tick % 10))
- var/list/E
- E = get_visible_implants(0)
- if(!E.len)
+ if(!embedded_needs_process())
embedded_flag = 0
//Eyes
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 0010f189e6..f93b139430 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -856,6 +856,9 @@
visible_implants += O
return visible_implants
+/mob/proc/embedded_needs_process()
+ return (embedded.len > 0)
+
mob/proc/yank_out_object()
set category = "Object"
set name = "Yank out object"
diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm
index db62aa91d0..94e1c94ae7 100644
--- a/code/modules/organs/organ_external.dm
+++ b/code/modules/organs/organ_external.dm
@@ -50,7 +50,7 @@
var/joint = "joint" // Descriptive string used in dislocation.
var/amputation_point // Descriptive string used in amputation.
var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ.
- var/can_grasp
+ var/can_grasp //It would be more appropriate if these two were named "affects_grasp" and "affects_stand" at this point
var/can_stand
/obj/item/organ/external/Destroy()