From c8d9598098f8b4521fa3ae38574886685f96d4cd Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Thu, 26 Feb 2015 10:03:24 -0500 Subject: [PATCH] Fixed up the give verb --- code/modules/mob/living/carbon/give.dm | 47 ++++++++++++-------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 12673d50549..63dbfac240c 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -1,18 +1,15 @@ -/mob/living/carbon/verb/give() +/mob/living/carbon/verb/give(var/mob/living/carbon/target in oview(1)) set category = "IC" set name = "Give" - set src in view(1) - if(src.stat == 2 || usr.stat == 2 || src.client == null) - return - if(src == usr) - usr << "\red I feel stupider, suddenly." + + if(target.stat == 2 || usr.stat == 2|| target.client == null) return var/obj/item/I if(!usr.hand && usr.r_hand == null) - usr << "\red You don't have anything in your right hand to give to [src.name]" + usr << " You don't have anything in your right hand to give to [target.name]" return if(usr.hand && usr.l_hand == null) - usr << "\red You don't have anything in your left hand to give to [src.name]" + usr << " You don't have anything in your left hand to give to [target.name]" return if(usr.hand) I = usr.l_hand @@ -23,38 +20,38 @@ if((I.flags & NODROP) || (I.flags & ABSTRACT)) usr << "That's not exactly something you can give." return - if(src.r_hand == null || src.l_hand == null) - switch(alert(src,"[usr] wants to give you \a [I]?",,"Yes","No")) + if(target.r_hand == null || target.l_hand == null) + switch(alert(target,"[usr] wants to give you \a [I]?",,"Yes","No")) if("Yes") if(!I) return if(!Adjacent(usr)) - usr << "\red You need to stay in reaching distance while giving an object." - src << "\red [usr.name] moved too far away." + usr << " You need to stay in reaching distance while giving an object." + target << " [usr.name] moved too far away." return if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I)) - usr << "\red You need to keep the item in your active hand." - src << "\red [usr.name] seem to have given up on giving \the [I.name] to you." + usr << " You need to keep the item in your active hand." + target << " [usr.name] seem to have given up on giving \the [I.name] to you." return - if(src.r_hand != null && src.l_hand != null) - src << "\red Your hands are full." - usr << "\red Their hands are full." + if(target.r_hand != null && target.l_hand != null) + target << " Your hands are full." + usr << " Their hands are full." return else usr.drop_item() - if(src.r_hand == null) - src.r_hand = I + if(target.r_hand == null) + target.r_hand = I else - src.l_hand = I - I.loc = src + target.l_hand = I + I.loc = target I.layer = 20 - I.add_fingerprint(src) + I.add_fingerprint(target) src.update_inv_l_hand() src.update_inv_r_hand() usr.update_inv_l_hand() usr.update_inv_r_hand() - src.visible_message("\blue [usr.name] handed \the [I.name] to [src.name].") + target.visible_message(" [usr.name] handed \the [I.name] to [target.name].") if("No") - src.visible_message("\red [usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.") + target.visible_message(" [usr.name] tried to hand [I.name] to [target.name] but [target.name] didn't want it.") else - usr << "\red [src.name]'s hands are full." \ No newline at end of file + usr << " [target.name]'s hands are full." \ No newline at end of file