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?
This commit is contained in:
Joshua Kidder
2024-04-08 22:25:50 -06:00
committed by GitHub
parent 403bb5511f
commit 87e049c2e9
3 changed files with 9 additions and 1 deletions
@@ -12,6 +12,8 @@
#define COMSIG_ORGAN_BEING_REPLACED "organ_being_replaced"
/// Called when an organ gets surgically removed (mob/living/user, mob/living/carbon/old_owner, target_zone, obj/item/tool)
#define COMSIG_ORGAN_SURGICALLY_REMOVED "organ_surgically_removed"
/// Called when an organ gets surgically removed (mob/living/user, mob/living/carbon/new_owner, target_zone, obj/item/tool)
#define COMSIG_ORGAN_SURGICALLY_INSERTED "organ_surgically_inserted"
///Called when movement intent is toggled.
#define COMSIG_MOVE_INTENT_TOGGLED "move_intent_toggled"
@@ -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)