Conflicts:
	code/modules/mob/living/silicon/robot/robot_modules.dm
This commit is contained in:
mwerezak
2014-07-13 06:13:46 -04:00
committed by ZomgPonies
parent 5c6cfffaf8
commit 3bf0011405
2 changed files with 18 additions and 3 deletions
@@ -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
@@ -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)