SPAN_ html + message for initiating give

This commit is contained in:
Cerebulon
2021-08-24 20:42:56 +01:00
parent 4ff9b181e0
commit 9c1e9559d0

View File

@@ -16,31 +16,33 @@
if(!I)
I = src.get_inactive_hand()
if(!I)
to_chat(src, "<span class='warning'>You don't have anything in your hands to give to \the [target].</span>")
to_chat(src, SPAN_WARNING("You don't have anything in your hands to give to \the [target]."))
return
usr.visible_message(SPAN_NOTICE("\The [usr] holds out \the [I] to \the [target]."), SPAN_NOTICE("You hold out \the [I] to \the [target], waiting for them to accept it."))
if(alert(target,"[src] wants to give you \a [I]. Will you accept it?",,"No","Yes") == "No")
target.visible_message("<span class='notice'>\The [src] tried to hand \the [I] to \the [target], \
but \the [target] didn't want it.</span>")
target.visible_message(SPAN_NOTICE("\The [src] tried to hand \the [I] to \the [target], \
but \the [target] didn't want it."))
return
if(!I) return
if(!Adjacent(target))
to_chat(src, "<span class='warning'>You need to stay in reaching distance while giving an object.</span>")
to_chat(target, "<span class='warning'>\The [src] moved too far away.</span>")
to_chat(src, SPAN_WARNING("You need to stay in reaching distance while giving an object"))
to_chat(target, SPAN_WARNING("\The [src] moved too far away."))
return
if(I.loc != src || !src.item_is_in_hands(I))
to_chat(src, "<span class='warning'>You need to keep the item in your hands.</span>")
to_chat(target, "<span class='warning'>\The [src] seems to have given up on passing \the [I] to you.</span>")
to_chat(src, SPAN_WARNING("You need to keep the item in your hands."))
to_chat(target, SPAN_WARNING("\The [src] seems to have given up on passing \the [I] to you."))
return
if(target.hands_are_full())
to_chat(target, "<span class='warning'>Your hands are full.</span>")
to_chat(src, "<span class='warning'>Their hands are full.</span>")
to_chat(target, SPAN_WARNING("Your hands are full."))
to_chat(src, SPAN_WARNING("Their hands are full."))
return
if(src.unEquip(I))
target.put_in_hands(I) // If this fails it will just end up on the floor, but that's fitting for things like dionaea.
target.visible_message("<span class='notice'>\The [src] handed \the [I] to \the [target].</span>")
target.visible_message(SPAN_NOTICE("\The [src] handed \the [I] to \the [target]"))