[MIRROR] Added on_surgical_insertion() and signals, to match on_surgical_removal (#27242)

* Added on_surgical_insertion() and signals, to match on_surgical_removal (#82486)

## About The Pull Request

We have a proc for the effects of removing organs surgically --
currently only used for surplus organs blowing up -- so I added a
matching proc for inserting them surgically. It also comes with its own
signal, though there are no registrations.
## Why It's Good For The Game

Orderly code with matching insertion and removal verbs. Maybe we could
use this for lings, or traitors emagging cybernetics organs that make
them do something zany?

* Added on_surgical_insertion() and signals, to match on_surgical_removal

---------

Co-authored-by: Joshua Kidder <49173900+Metekillot@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-04-18 03:04:12 +02:00
committed by GitHub
co-authored by Joshua Kidder
parent 553e8f5af8
commit fc7514e804
3 changed files with 9 additions and 1 deletions
@@ -252,6 +252,7 @@
span_notice("[user] inserts something into [target]'s [parse_zone(target_zone)]!"),
)
display_pain(target, "Your [parse_zone(target_zone)] throbs with pain as your new [tool.name] comes to life!")
target_organ.on_surgical_insertion(user, target, target_zone, tool)
else
target_organ.forceMove(target.loc)
@@ -224,9 +224,14 @@
/**
* Proc that gets called when the organ is surgically removed by someone, can be used for special effects
* Currently only used so surplus organs can explode when surgically removed.
*/
/obj/item/organ/proc/on_surgical_removal(mob/living/user, mob/living/carbon/old_owner, target_zone, obj/item/tool)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ORGAN_SURGICALLY_REMOVED, user, old_owner, target_zone, tool)
RemoveElement(/datum/element/decal/blood)
/**
* Proc that gets called when the organ is surgically inserted by someone. Seem familiar?
*/
/obj/item/organ/proc/on_surgical_insertion(mob/living/user, mob/living/carbon/new_owner, target_zone, obj/item/tool)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ORGAN_SURGICALLY_INSERTED, user, new_owner, target_zone, tool)