/mob/living/carbon/verb/give()
set category = "IC"
set name = "Give"
set desc = "Give something to someone!"
set src in oview(1)
give_item(usr)
/mob/living/carbon/proc/give_item(mob/living/carbon/user)
/mob/living/carbon/give_item(mob/living/carbon/user)
if(!istype(user))
to_chat(usr, "There's noone around to give this!")
return
if(src.stat == 2 || user.stat == 2 || src.client == null)
to_chat(usr, "Doesn't look like they are taking it any sooner.")
return
if(src.handcuffed)
to_chat(usr, "Those hands are cuffed right now.")
return //Can't receive items while cuffed
var/obj/item/I
if(user.get_active_held_item() == null)
to_chat(usr, "You don't have anything in your [get_held_index_name(get_held_index_of_item(I))] to give to [src].")
return
I = user.get_active_held_item()
if(!I)
to_chat(usr, "You don't have anything to give!")
return
if(src == user) //Shouldn't happen
to_chat(usr, "You tried to give yourself \the [I], but you didn't want it.")
return
if(get_empty_held_index_for_side())
to_chat(usr, "You offer \the [I] to [src].")
switch(alert(src, "[user] wants to give you \a [I], do you accept it?", , "Yes", "No"))
if("Yes")
if(!I)
to_chat(usr, "You need the item with you to give it!")
return
if(HAS_TRAIT(I, TRAIT_NODROP) || HAS_TRAIT(I, ABSTRACT_ITEM_TRAIT)) //thanks trigg
to_chat(usr, "That's not something you can give.")
return
if(src.stat != CONSCIOUS | src.client == null)
to_chat(usr, "They are not awake!")
return
if(!Adjacent(user))
to_chat(usr, "You need to stay still while giving an object.")
to_chat(src, "[user] moved away.")//What an asshole
return
if(user.get_active_held_item() != I)
to_chat(usr, "You need to keep the item in your hand.")
to_chat(src, "[user] has put \the [I] away!")
return
if(!get_empty_held_index_for_side())
to_chat(usr, "Your hands are full.")
to_chat(src, "Their hands are full.")
return
if(!user.dropItemToGround(I))
to_chat(src, "[user] can't let go of \the [I]!")
to_chat(usr, "You can't seem to let go of \the [I].")
return
src.put_in_hands(I)
update_inv_hands()
src.visible_message("[user] handed \the [I] to [src].")
log_game("[user] gave \the [I] to [src].")
if("No")
src.visible_message("[user] tried to hand \the [I] to [src] but \he didn't want it.")
log_game("[src] declined [user]'s item, the item: [I]")
else
to_chat(usr, "[src]'s hands are full.")