[MIRROR] Allows you to offer an item to only one person with Shift+Ctrl+Click [MDB IGNORE] (#12176)

* Allows you to offer an item to only one person with Shift+Ctrl+Click (#65441)

You can click someone directly with shift+ctrl+click to offer an item only to them. This is in contrast with pressing G, which offers the item to every adjacent carbon mob.

Also fixes a runtime where the Give screen alert on a potential recipient was trying to remove itself on proximity loss after the Offering status effect had already done it.

Removes duplicate range check on Give screen alert that was causing the runtime as Offering status effect takes care of it.

Also adds a check after clicking the screen alert to take something to make sure we're not dead or incapacitated, so dead people can no longer take things.

Also adds a screentip for this functionality.

Also adds some more checks to give() to make sure we can do it before sending the message to players that we're offering something.

* Allows you to offer an item to only one person with Shift+Ctrl+Click

Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-03-22 22:03:06 +01:00
committed by GitHub
parent 4f8cdbcfa2
commit dfc7e7022e
5 changed files with 42 additions and 25 deletions

View File

@@ -331,7 +331,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
add_overlay(receiving)
src.receiving = receiving
src.offerer = offerer
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/check_in_range, override = TRUE) //Override to prevent runtimes when people offer a item multiple times
/atom/movable/screen/alert/give/Click(location, control, params)
. = ..()
@@ -348,14 +347,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
var/mob/living/carbon/taker = owner
taker.take(offerer, receiving)
/// Simply checks if the other person is still in range
/atom/movable/screen/alert/give/proc/check_in_range(atom/taker)
SIGNAL_HANDLER
if(!offerer.CanReach(taker))
to_chat(owner, span_warning("You moved out of range of [offerer]!"))
owner.clear_alert("[offerer]")
/atom/movable/screen/alert/give/highfive/setup(mob/living/carbon/taker, mob/living/carbon/offerer, obj/item/receiving)
. = ..()
name = "[offerer] is offering a high-five!"
@@ -415,7 +406,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
add_overlay(receiving)
src.receiving = receiving
src.offerer = offerer
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/check_in_range, override = TRUE) //Override to prevent runtimes when people offer a item multiple times
/// Gives the player the option to succumb while in critical condition
/atom/movable/screen/alert/succumb