Merge pull request #14134 from Arturlang/Give_improvements

[READY]Give Improved
This commit is contained in:
silicons
2021-01-25 23:02:03 -07:00
committed by GitHub
4 changed files with 33 additions and 5 deletions

View File

@@ -51,11 +51,7 @@
//Standard reach turf to turf or reaching inside storage
if(CanReach(A,W))
if(W)
if(a_intent == INTENT_HELP && iscarbon(src))
var/mob/living/carbon/C = src
C.give()
else
return W.rightclick_melee_attack_chain(src, A, params)
return W.rightclick_melee_attack_chain(src, A, params)
else
if(!AltUnarmedAttack(A, TRUE))
. = UnarmedAttack(A, TRUE, a_intent)

View File

@@ -939,6 +939,10 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
/obj/item/proc/get_part_rating()
return 0
//Can this item be given to people?
/obj/item/proc/can_give()
return TRUE
/obj/item/doMove(atom/destination)
if (ismob(loc))
var/mob/M = loc

View File

@@ -236,6 +236,12 @@
if(!iscyborg(loc))
deductcharge(severity*10, TRUE, FALSE)
/obj/item/melee/baton/can_give()
if(turned_on)
return FALSE
else
..()
/obj/item/melee/baton/stunsword
name = "stunsword"
desc = "Not actually sharp, this sword is functionally identical to its baton counterpart."

View File

@@ -1229,3 +1229,25 @@
*/
/mob/living/carbon/proc/get_biological_state()
return BIO_FLESH_BONE
/mob/living/carbon/altattackby(obj/item/W, mob/living/carbon/user, params)
if(user.incapacitated() || !user.Adjacent(src))
return FALSE
if(W && user.a_intent == INTENT_HELP && W.can_give())
user.give()
return TRUE
/mob/living/carbon/verb/give_verb()
set src in oview(1)
set category = "IC"
set name = "Give"
if(usr.incapacitated() || !usr.Adjacent(src))
return
if(!usr.get_active_held_item()) // Let me know if this has any problems -Yota
return
var/obj/item/I = usr.get_active_held_item()
var/mob/living/carbon/C = usr
if(I.can_give())
C.give()