From f4471e4fdb1a8fcbd24e6ef5082949056edc1559 Mon Sep 17 00:00:00 2001 From: Lethal Ghost Date: Sun, 25 Jan 2015 20:33:18 +0500 Subject: [PATCH 1/2] More convenient give verb. You can give item by one click. And you are not able try to give items to yourself. --- code/modules/mob/living/carbon/give.dm | 42 ++++++++++++-------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 47e4282424..a7e29cfeae 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -1,18 +1,14 @@ -/mob/living/carbon/verb/give() +mob/living/carbon/verb/give(var/mob/living/carbon/target in view(1)-usr) 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 << "\red 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 << "\red You don't have anything in your left hand to give to [target.name]" return if(usr.hand) I = usr.l_hand @@ -20,38 +16,38 @@ I = usr.r_hand if(!I) 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." + target << "\red [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." + target << "\red [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." + target << "\red Your hands are full." usr << "\red 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) - src.update_inv_l_hand() - src.update_inv_r_hand() + I.add_fingerprint(target) + target.update_inv_l_hand() + target.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("\blue [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("\red [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." + usr << "\red [target.name]'s hands are full." From f8ad509eb7b87ee1b0df3a6d6c257c4273ae27d5 Mon Sep 17 00:00:00 2001 From: Lethal Ghost Date: Tue, 27 Jan 2015 19:51:24 +0500 Subject: [PATCH 2/2] Update give verb (text lines). Replace the outdated macros with span classes. --- code/modules/mob/living/carbon/give.dm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index a7e29cfeae..107e660d39 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -5,10 +5,10 @@ mob/living/carbon/verb/give(var/mob/living/carbon/target in view(1)-usr) 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 [target.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 [target.name]" + usr << "You don't have anything in your left hand to give to [target.name]" return if(usr.hand) I = usr.l_hand @@ -22,16 +22,16 @@ mob/living/carbon/verb/give(var/mob/living/carbon/target in view(1)-usr) if(!I) return if(!Adjacent(usr)) - usr << "\red You need to stay in reaching distance while giving an object." - target << "\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." - target << "\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) - target << "\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() @@ -46,8 +46,8 @@ mob/living/carbon/verb/give(var/mob/living/carbon/target in view(1)-usr) target.update_inv_r_hand() usr.update_inv_l_hand() usr.update_inv_r_hand() - target.visible_message("\blue [usr.name] handed \the [I.name] to [target.name].") + target.visible_message("[usr.name] handed \the [I.name] to [target.name].") if("No") - target.visible_message("\red [usr.name] tried to hand [I.name] to [target.name] but [target.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 [target.name]'s hands are full." + usr << "[target.name]'s hands are full."