From 3bf00114054d4ae13fb4b95094fd0d5d968c32ef Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 1 Jul 2014 16:39:57 -0400 Subject: [PATCH] Fixes #5446 Conflicts: code/modules/mob/living/silicon/robot/robot_modules.dm --- code/modules/mob/living/carbon/human/human_damage.dm | 12 +++++++++--- .../mob/living/silicon/robot/robot_modules.dm | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index c629e5f114a..9f5aca031a8 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -311,9 +311,15 @@ This function restores all organs. //Embedded object code. if(!organ) return if(istype(used_weapon,/obj/item)) - var/obj/item/W = used_weapon //Sharp objects will always embed if they do enough damage. - if((damage > (10*W.w_class)) || ((sharp && !ismob(W.loc)) || prob(damage/W.w_class))) - organ.embed(W) + var/obj/item/W = used_weapon + if (!W.is_robot_module()) + //blunt objects should really not be embedding in things unless a huge amount of force is involved + var/embed_chance = sharp? damage/W.w_class : damage/(W.w_class*3) + var/embed_threshold = sharp? 5*W.w_class : 15*W.w_class + + //Sharp objects will always embed if they do enough damage. + if((sharp && damage > (10*W.w_class)) || (damage > embed_threshold && prob(embed_chance))) + organ.embed(W) return 1 diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 753e4e8f7bc..36fc0af33a4 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -324,3 +324,12 @@ LR.Charge(R) return + +//checks whether this item is a module of the robot it is located in. +/obj/item/proc/is_robot_module() + if (!istype(src.loc, /mob/living/silicon/robot)) + return 0 + + var/mob/living/silicon/robot/R = src.loc + + return (src in R.module.modules)