mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +01:00
Modifies Kathira's custom leg aug (#21870)
This adds a signal that can be used to stop bone repair surgery for any cause that might prevent such. In this particular case, I used it with Kathira's leg aug to fit with it being a support for her leg, which can't heal properly otherwise. This is primarily for when she ends up in surgery and can't inform the doctors they shouldn't be trying to begin with.
This commit is contained in:
@@ -2087,6 +2087,38 @@ All custom items with worn sprites must follow the contained sprite system: http
|
||||
else
|
||||
collapse()
|
||||
|
||||
/obj/item/organ/internal/augment/fluff/kath_legbrace/Initialize()
|
||||
. = ..()
|
||||
if(!owner)
|
||||
return
|
||||
RegisterSignal(owner, COMSIG_BEGIN_SURGERY, PROC_REF(negate_healing), override = TRUE)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
parent.fracture(TRUE)
|
||||
|
||||
/obj/item/organ/internal/augment/fluff/kath_legbrace/replaced()
|
||||
. = ..()
|
||||
if(!owner)
|
||||
return
|
||||
RegisterSignal(owner, COMSIG_BEGIN_SURGERY, PROC_REF(negate_healing), override = TRUE)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
parent.fracture(TRUE)
|
||||
|
||||
/obj/item/organ/internal/augment/fluff/kath_legbrace/removed()
|
||||
if(!owner)
|
||||
return ..()
|
||||
UnregisterSignal(owner, COMSIG_BEGIN_SURGERY)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/augment/fluff/kath_legbrace/proc/negate_healing(var/owner, var/canceled, var/obj/item/organ/external/affected, var/mob/living/user, var/singleton/surgery_step/surgery)
|
||||
SIGNAL_HANDLER
|
||||
if(!istype(surgery, /singleton/surgery_step/glue_bone) && !istype(surgery, /singleton/surgery_step/set_bone))
|
||||
return
|
||||
if(affected.limb_name != parent_organ)
|
||||
return
|
||||
*canceled = TRUE
|
||||
user.visible_message(SPAN_WARNING("[user] seems to be unable to set the bone in [owner]'s [affected.name]."), \
|
||||
SPAN_WARNING("The bone in [owner]'s [affected.name] appears to be impossible to set correctly!"))
|
||||
|
||||
/obj/item/organ/internal/augment/fluff/kath_legbrace/proc/collapse(var/prob_chance = 20, var/weaken_strength = 2, var/pain_strength = 40)
|
||||
if(prob(prob_chance))
|
||||
var/obj/item/organ/external/E = owner.organs_by_name[parent_organ]
|
||||
|
||||
@@ -53,6 +53,13 @@
|
||||
/singleton/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(!ishuman(target))
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
var/canceled = FALSE
|
||||
SEND_SIGNAL(target, COMSIG_BEGIN_SURGERY, &canceled, affected, user, src)
|
||||
if(canceled)
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/// Does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
|
||||
|
||||
Reference in New Issue
Block a user