From 408eeaa5d18421b45e40cbbccd4c06d684fd5dce Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 27 Nov 2025 20:37:30 -0700 Subject: [PATCH] [MIRROR] Many new global signals from downstream (#12051) Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> --- code/__defines/dcs/signals.dm | 27 ++++++++++++++++++- code/controllers/subsystems/supply.dm | 10 ++++--- .../helper_datums/construction_datum.dm | 2 +- code/game/objects/items/weapons/autopsy.dm | 2 ++ code/game/objects/structures/loot_piles.dm | 1 + code/game/objects/structures/trash_pile_vr.dm | 1 + code/game/turfs/turf.dm | 2 ++ .../detectivework/tools/sample_kits.dm | 1 + code/modules/detectivework/tools/swabs.dm | 1 + code/modules/emotes/emote_define.dm | 1 + code/modules/food/recipe.dm | 2 ++ code/modules/mob/mob_helpers.dm | 2 ++ .../tools/artifact_harvester.dm | 2 ++ code/modules/xenobio/items/weapons_vr.dm | 2 +- code/modules/xenobio/machinery/processor.dm | 2 +- 15 files changed, 50 insertions(+), 8 deletions(-) diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index 27f18b4f43..b3a8c89c44 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -29,7 +29,7 @@ #define COMSIG_GLOB_BUTTON_PRESSED "!button_pressed" /// Supply shuttle selling, before all items are sold, called by /datum/controller/subsystem/supply/proc/sell() : (/list/area/supply_shuttle_areas) #define COMSIG_GLOB_SUPPLY_SHUTTLE_DEPART "!sell_supply_shuttle" -/// Supply shuttle selling, for each item sold, called by /datum/controller/subsystem/supply/proc/sell() : (atom/movable/sold_item, sold_successfully, datum/exported_crate/export_data, area/shuttle_subarea) +/// Supply shuttle selling, for each item sold, called by /datum/controller/subsystem/supply/proc/sell() : (atom/movable/sold_item, list/things_sold_successfully, datum/exported_crate/export_data, area/shuttle_subarea) #define COMSIG_GLOB_SUPPLY_SHUTTLE_SELL_ITEM "!supply_shuttle_sell_item" /// Mind inserted into body: (mob/new_owner, /datum/mind/assigned_mind) #define COMSIG_GLOB_RESLEEVED_MIND "!resleeved_mind_into_body" @@ -45,6 +45,26 @@ #define COMSIG_GLOB_BORGIFY "!borgify_mob" /// brain removed from body, called by /obj/item/organ/internal/brain/proc/transfer_identity() : (mob/living/carbon/brain/brainmob) #define COMSIG_GLOB_BRAIN_REMOVED "!brain_removed_from_mob" +// base /decl/emote/proc/do_emote() : (mob/user, extra_params) +#define COMSIG_GLOB_EMOTE_PERFORMED "!emote_performed" +// base /proc/say_dead_direct() : (message) +#define COMSIG_GLOB_DEAD_SAY "!dead_say" +// base /turf/wash() : () +#define COMSIG_GLOB_WASHED_FLOOR "!washed_floor" +// base /obj/machinery/artifact_harvester/proc/harvest() : (obj/item/anobattery/inserted_battery, mob/user) +#define COMSIG_GLOB_HARVEST_ARTIFACT "!harvest_artifact" +// upon harvesting a slime's extract : (obj/item/slime_extract/newly_made_core) +#define COMSIG_GLOB_HARVEST_SLIME_CORE "!harvest_slime_core" +// base /datum/recipe/proc/make_food() : (obj/container, list/results) +#define COMSIG_GLOB_FOOD_PREPARED "!recipe_food_completed" +// base /datum/construction/proc/spawn_result() : (/obj/mecha/result_mech) +#define COMSIG_GLOB_MECH_CONSTRUCTED "!mecha_constructed" +// when trashpiles are successfully searched : (mob/living/user, list/searched_by) +#define COMSIG_GLOB_TRASHPILE_SEARCHED "!trash_pile_searched" +// base /obj/item/autopsy_scanner/do_surgery() : (mob/user, mob/target) +#define COMSIG_GLOB_AUTOPSY_PERFORMED "!performed_autopsy" +// upon forensics swap or sample kit forensics collection : (atom/target, mob/user) +#define COMSIG_GLOB_FORENSICS_COLLECTED "!performed_forensics_collection" /// signals from globally accessible objects @@ -813,6 +833,11 @@ ///from base of /obj/effect/decal/cleanable/blood/gibs/streak(): (list/directions, list/diseases) #define COMSIG_GIBS_STREAK "gibs_streak" +//Autopsy + +//from base of /obj/item/autopsy_scanner/do_surgery() : (mob/user, mob/target) +#define COMSIG_AUTOPSY_PERFORMED "performed_autopsy" + //Mood ///called when you send a mood event from anywhere in the code. diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index 7221fc31a8..65d3b1d295 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -80,7 +80,7 @@ SUBSYSTEM_DEF(supply) var/base_value = 0 // Most items must be in a crate! - var/sold_successfully = FALSE + var/list/things_sold_successfully = list() if(istype(MA,/obj/structure/closet/crate)) var/obj/structure/closet/crate/CR = MA @@ -90,12 +90,14 @@ SUBSYSTEM_DEF(supply) // For each thing in the crate, get the value and quantity for(var/atom/A in CR) - sold_successfully = SEND_SIGNAL(A,COMSIG_ITEM_SOLD,EC,TRUE) + if(SEND_SIGNAL(A,COMSIG_ITEM_SOLD,EC,TRUE)) + things_sold_successfully += A else // Selling things that are not in crates. // Usually it just makes a log that it wasn't shipped properly, and so isn't worth anything - sold_successfully = SEND_SIGNAL(MA,COMSIG_ITEM_SOLD,EC,FALSE) - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SUPPLY_SHUTTLE_SELL_ITEM, MA, sold_successfully, EC, subarea) + if(SEND_SIGNAL(MA,COMSIG_ITEM_SOLD,EC,FALSE)) + things_sold_successfully += MA + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SUPPLY_SHUTTLE_SELL_ITEM, MA, things_sold_successfully, EC, subarea) exported_crates += EC points += EC.value diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm index d2d3136e88..6e07bc262a 100644 --- a/code/datums/helper_datums/construction_datum.dm +++ b/code/datums/helper_datums/construction_datum.dm @@ -74,7 +74,7 @@ /datum/construction/proc/spawn_result() if(result) - new result(get_turf(holder)) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MECH_CONSTRUCTED, new result(get_turf(holder))) spawn() qdel(holder) return diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 9707204f77..93df9e01c6 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -180,5 +180,7 @@ M.visible_message(span_infoplain(span_bold("\The [user]") + " scans the wounds on [M]'s [S.name] with [src]")) src.add_data(S) + SEND_SIGNAL(src,COMSIG_AUTOPSY_PERFORMED, user, M) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_AUTOPSY_PERFORMED, user, M) return 1 diff --git a/code/game/objects/structures/loot_piles.dm b/code/game/objects/structures/loot_piles.dm index a29ea3c2e0..32ceb22e18 100644 --- a/code/game/objects/structures/loot_piles.dm +++ b/code/game/objects/structures/loot_piles.dm @@ -47,6 +47,7 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh busy = TRUE if(do_after(user, rand(4 SECONDS,6 SECONDS), target = src)) SEND_SIGNAL(src,COMSIG_LOOT_REWARD,L,searchedby) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_TRASHPILE_SEARCHED,L,searchedby) busy = FALSE else return ..() diff --git a/code/game/objects/structures/trash_pile_vr.dm b/code/game/objects/structures/trash_pile_vr.dm index 76706c040d..dee67e8831 100644 --- a/code/game/objects/structures/trash_pile_vr.dm +++ b/code/game/objects/structures/trash_pile_vr.dm @@ -129,6 +129,7 @@ to_chat(user,span_danger("Some sort of creature leaps out of \the [src]!")) else SEND_SIGNAL(src,COMSIG_LOOT_REWARD,user,searchedby, 5) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_TRASHPILE_SEARCHED,user,searchedby) busy = FALSE else return ..() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 9b39f574e2..de26334175 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -520,6 +520,8 @@ if(istype(src, /turf/simulated)) var/turf/simulated/T = src + if(T.dirt > 0) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_WASHED_FLOOR) T.dirt = 0 for(var/am in src) diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm index 7d961f5317..8284c28cd8 100644 --- a/code/modules/detectivework/tools/sample_kits.dm +++ b/code/modules/detectivework/tools/sample_kits.dm @@ -137,6 +137,7 @@ /obj/item/forensics/sample_kit/proc/take_sample(var/mob/user, var/atom/supplied) var/obj/item/sample/S = new evidence_path(get_turf(user), supplied) to_chat(user, span_notice("You transfer [S.evidence.len] [S.evidence.len > 1 ? "[evidence_type]s" : "[evidence_type]"] to \the [S].")) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FORENSICS_COLLECTED, supplied, user) /obj/item/forensics/sample_kit/afterattack(var/atom/A, var/mob/user, var/proximity) if(!proximity) diff --git a/code/modules/detectivework/tools/swabs.dm b/code/modules/detectivework/tools/swabs.dm index 215ecec751..72db2afa7c 100644 --- a/code/modules/detectivework/tools/swabs.dm +++ b/code/modules/detectivework/tools/swabs.dm @@ -114,6 +114,7 @@ if(sample_type) user.visible_message("\The [user] swabs \the [A] for a sample.", "You swab \the [A] for a sample.") set_used(sample_type, A) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FORENSICS_COLLECTED, A, user) /obj/item/forensics/swab/proc/set_used(var/sample_str, var/atom/source) name = "[initial(name)] ([sample_str] - [source])" diff --git a/code/modules/emotes/emote_define.dm b/code/modules/emotes/emote_define.dm index 5704d3eec9..1e36bb9637 100644 --- a/code/modules/emotes/emote_define.dm +++ b/code/modules/emotes/emote_define.dm @@ -147,6 +147,7 @@ do_extra(user, target) do_sound(user) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_EMOTE_PERFORMED, user, extra_params) /decl/emote/proc/replace_target_tokens(var/msg, var/atom/target) . = msg diff --git a/code/modules/food/recipe.dm b/code/modules/food/recipe.dm index 97a0426dbd..5e5c7b0c76 100644 --- a/code/modules/food/recipe.dm +++ b/code/modules/food/recipe.dm @@ -270,6 +270,8 @@ result_obj.reagents.trans_to(holder, result_obj.reagents.total_volume) tally++ + if(results.len) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FOOD_PREPARED, container, results) switch(reagent_mix) if (RECIPE_REAGENT_REPLACE) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index f6c2233929..0c96c09f38 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -470,6 +470,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if(subject && subject.forbid_seeing_deadchat && !check_rights_for(subject.client, R_HOLDER)) return // Can't talk in deadchat if you can't see it. + if(ismob(subject)) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_DEAD_SAY, subject, message) for(var/mob/M in GLOB.player_list) if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || (check_rights_for(M.client, R_HOLDER) && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay)) diff --git a/code/modules/xenoarcheaology/tools/artifact_harvester.dm b/code/modules/xenoarcheaology/tools/artifact_harvester.dm index 0f4c77684f..9348e1f26f 100644 --- a/code/modules/xenoarcheaology/tools/artifact_harvester.dm +++ b/code/modules/xenoarcheaology/tools/artifact_harvester.dm @@ -253,6 +253,8 @@ inserted_battery.battery_effect = E inserted_battery.stored_charge = 0 + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_ARTIFACT, inserted_battery, user) + /obj/machinery/artifact_harvester/process() if(harvesting == 0) return diff --git a/code/modules/xenobio/items/weapons_vr.dm b/code/modules/xenobio/items/weapons_vr.dm index ca4cb59780..9b662fed3b 100644 --- a/code/modules/xenobio/items/weapons_vr.dm +++ b/code/modules/xenobio/items/weapons_vr.dm @@ -112,7 +112,7 @@ while(S.cores) playsound(src, 'sound/machines/juicer.ogg', 25, 1) if(do_after(user, 15, target = src)) - new S.coretype(get_turf(AM)) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new S.coretype(get_turf(AM))) playsound(src, 'sound/effects/splat.ogg', 50, 1) S.cores-- qdel(S) diff --git a/code/modules/xenobio/machinery/processor.dm b/code/modules/xenobio/machinery/processor.dm index 00f7799494..1ad5dc742a 100644 --- a/code/modules/xenobio/machinery/processor.dm +++ b/code/modules/xenobio/machinery/processor.dm @@ -82,7 +82,7 @@ if(istype(AM, /mob/living/simple_mob/slime)) var/mob/living/simple_mob/slime/S = AM while(S.cores) - new S.coretype(get_turf(src)) + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new S.coretype(get_turf(src))) playsound(src, 'sound/effects/splat.ogg', 50, 1) S.cores-- sleep(1 SECOND)