From ca98cde94425712fb2dbc20cf9a9c320153f5daf Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 29 Aug 2014 03:08:52 +0400 Subject: [PATCH] Ported catching things from TG If something hits human with throw intent on, he'll catch it instead of getting hit. Uses speed var to determine if it's 2fast4catch. credit to PeteTheGoat --- code/modules/mob/living/carbon/human/human_defense.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 407b83c9c3..bd6c0f30e6 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -294,6 +294,15 @@ emp_act /mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = 5) if(istype(AM,/obj/)) var/obj/O = AM + + if(in_throw_mode && !get_active_hand() && speed <= 5) //empty active hand and we're in throw mode + if(canmove && !restrained()) + if(isturf(O.loc)) + put_in_active_hand(O) + visible_message("[src] catches [O]!") + throw_mode_off() + return + var/dtype = BRUTE if(istype(O,/obj/item/weapon)) var/obj/item/weapon/W = O