Skip to content

Commit

Permalink
Injector and Coagulator plates now function (#7173)
Browse files Browse the repository at this point in the history
# About the pull request
made the plates actually work.
Fixes  #7142

All code was made by kiVts, I just took the code and made a PR for them
now because #7023 is on draft until it's done.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game

The things that research spends biomass points on should work???
# Testing Photographs and Procedure
tested on a private server, stabbed myself a few times with a knife, no
bloodloss, injector plate works (with all OD modes functional).


# Changelog
:cl: Private-Tristan, KiVts
fix: Injector and Coagulator plates are now functional.
/:cl:
  • Loading branch information
private-tristan committed Sep 23, 2024
1 parent cc46e3c commit fcbb099
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// Sent after the limb has taken damage
#define COMSIG_LIMB_TAKEN_DAMAGE "limb_taken_damage"

// From /datum/effects/bleeding/internal/process_mob() and /datum/effects/bleeding/external/process_mob()
#define COMSIG_BLEEDING_PROCESS "bleeding_process"
#define COMPONENT_BLEEDING_CANCEL (1<<0)

/// From /obj/effect/alien/weeds/Initialize()
#define COMSIG_WEEDNODE_GROWTH_COMPLETE "weednode_growth_complete"
/// From /obj/effect/alien/weeds/Initialize()
Expand Down
4 changes: 4 additions & 0 deletions code/datums/effects/bleeding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
if(affected_human.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
buffer_blood_loss = 0
return FALSE
if(SEND_SIGNAL(affected_human, COMSIG_BLEEDING_PROCESS, FALSE) & COMPONENT_BLEEDING_CANCEL)
return FALSE
affected_mob.drip(buffer_blood_loss)
buffer_blood_loss = 0

Expand Down Expand Up @@ -111,6 +113,8 @@
if(istype(affected_human))
if(affected_human.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
return FALSE
if(SEND_SIGNAL(affected_human, COMSIG_BLEEDING_PROCESS, TRUE) & COMPONENT_BLEEDING_CANCEL)
return FALSE

blood_loss = max(blood_loss, 0) // Bleeding shouldn't give extra blood even if its only 1 tick
affected_mob.blood_volume = max(affected_mob.blood_volume - blood_loss, 0)
Expand Down
25 changes: 12 additions & 13 deletions code/modules/cm_tech/implements/armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,26 +271,25 @@

/obj/item/clothing/accessory/health/research_plate/coagulator/on_attached(obj/item/clothing/S, mob/living/carbon/human/user)
. = ..()
if (user.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
return
user.chem_effect_flags |= CHEM_EFFECT_NO_BLEEDING
RegisterSignal(user, COMSIG_BLEEDING_PROCESS, PROC_REF(cancel_bleeding))
to_chat(user, SPAN_NOTICE("You feel tickling as you activate [src]."))

/obj/item/clothing/accessory/health/research_plate/coagulator/proc/cancel_bleeding()
SIGNAL_HANDLER
return COMPONENT_BLEEDING_CANCEL

/obj/item/clothing/accessory/health/research_plate/coagulator/on_removed(mob/living/carbon/human/user, obj/item/clothing/C)
. = ..()
if (user.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
user.chem_effect_flags &= CHEM_EFFECT_NO_BLEEDING
to_chat(user, SPAN_NOTICE("You feel [src] peeling off from your skin."))
attached_uni = null
to_chat(user, SPAN_NOTICE("You feel [src] peeling off from your skin."))
UnregisterSignal(user, COMSIG_BLEEDING_PROCESS)
attached_uni = null

/obj/item/clothing/accessory/health/research_plate/coagulator/on_removed_sig(mob/living/carbon/human/user, slot)
. = ..()
if(. == FALSE)
return
if(user.chem_effect_flags & CHEM_EFFECT_NO_BLEEDING)
to_chat(user, SPAN_NOTICE("You feel [src] peeling off from your skin."))
user.chem_effect_flags &= CHEM_EFFECT_NO_BLEEDING
attached_uni = null
UnregisterSignal(user, COMSIG_BLEEDING_PROCESS)
attached_uni = null

/obj/item/clothing/accessory/health/research_plate/emergency_injector
name = "emergency chemical plate"
Expand Down Expand Up @@ -350,7 +349,7 @@
/obj/item/clothing/accessory/health/research_plate/emergency_injector/on_attached(obj/item/clothing/S, mob/living/carbon/human/user)
. = ..()
wearer = user
activation = new /datum/action/item_action/emergency_plate/inject_chemicals(src, attached_uni)
activation = new /datum/action/item_action/toggle/emergency_plate/inject_chemicals(src, attached_uni)
activation.give_to(wearer)

/obj/item/clothing/accessory/health/research_plate/emergency_injector/on_removed(mob/living/user, obj/item/clothing/C)
Expand All @@ -366,7 +365,7 @@
attached_uni = null

//Action buttons
/datum/action/item_action/emergency_plate/inject_chemicals/New(Target, obj/item/holder)
/datum/action/item_action/toggle/emergency_plate/inject_chemicals/New(Target, obj/item/holder)
. = ..()
name = "Inject Emergency Plate"
action_icon_state = "plate_research"
Expand Down

0 comments on commit fcbb099

Please sign in to comment.