[MIRROR] Fixes some bugs with spectral tech (#12632)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-04-04 01:44:48 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 7b83dcbe72
commit 569c821cb4
5 changed files with 33 additions and 24 deletions
+13 -2
View File
@@ -25,6 +25,17 @@
ghost_reporter = new(null)
START_PROCESSING(SSobj, src)
var/static/list/ghost_signals = list(
COMSIG_GLOB_GHOST_CAPTURED = TYPE_PROC_REF(/datum/component/experiment_handler, try_run_spectral_experiment),
COMSIG_GLOB_WIGHT_CAPTURED = TYPE_PROC_REF(/datum/component/experiment_handler, try_run_spectral_experiment),
)
AddComponent(/datum/component/experiment_handler, \
allowed_experiments = list(/datum/experiment/ghost_capture), \
config_mode = EXPERIMENT_CONFIG_UI, \
config_flags = EXPERIMENT_CONFIG_ALWAYS_ACTIVE, \
experiment_signals = ghost_signals)
/obj/item/ghost_trap/Destroy()
STOP_PROCESSING(SSobj, src)
var/mob/our_entity = captured_entity?.resolve()
@@ -191,12 +202,12 @@
if(isobserver(passing_entity))
to_chat(passing_entity, span_info("((You are incapable of moving or 'jumping' to turf by clicking, but can still escape via teleport or orbit!))"))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_GHOST_CAPTURED, passing_entity)
SEND_SIGNAL(src, COMSIG_GLOB_GHOST_CAPTURED, passing_entity)
/obj/item/ghost_trap/Crossed(atom/movable/AM)
if(istype(AM, /obj/effect/shadow_wight))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_WIGHT_CAPTURED, AM)
SEND_SIGNAL(src, COMSIG_GLOB_WIGHT_CAPTURED, AM)
visible_message(span_danger("A flurry of beams shoot into the air from \the [src] and into [AM], capturing and disintegrating it!"))
return
@@ -366,7 +366,7 @@
//Loop for the 'advanced' emfs, which detect actual ghosts/phasers.
if(advanced)
for(var/mob/living/entity in range(detection_range, our_turf))
for(var/mob/entity in range(detection_range, our_turf))
if(isobserver(entity))
var/mob/observer/dead/ghost = entity
if(ghost.following || !ghost.interact_with_world || ghost.admin_ghosted) //Ghosts orbiting us or someone else, or have opted out of interactions.
@@ -143,6 +143,16 @@
playsound(source, 'sound/machines/ping.ogg', 25)
source.atom_say("Destructive analysis complete.")
/**
* Hooks on to RD server to try and run a spectral experiment.
*/
/datum/component/experiment_handler/proc/try_run_spectral_experiment(obj/source, atom/scan_target)
SIGNAL_HANDLER
if(action_experiment(source, scan_target))
playsound(source, 'sound/machines/ping.ogg', 25)
source.atom_say("Spectral analysis complete.")
/**
* Hooks on doppler array scans to try and run a explosive experiment.
*/
@@ -3,20 +3,15 @@
name = "Spectral Capture"
description = "There's supposed 'ghosts' and 'specters' roaming around this section of space! Let's capture one of these entities for science!"
exp_tag = "Spectral"
allowed_experimentors = list(/obj/machinery/rnd/server)
allowed_experimentors = list(/obj/item/ghost_trap)
var/ghost_captured = FALSE
/datum/experiment/ghost_capture/is_complete()
return completed
return ghost_captured
/datum/experiment/ghost_capture/New()
..()
RegisterSignal(SSdcs, COMSIG_GLOB_GHOST_CAPTURED, PROC_REF(ghost_captured))
RegisterSignal(SSdcs, COMSIG_GLOB_WIGHT_CAPTURED, PROC_REF(ghost_captured))
return TRUE
/datum/experiment/ghost_capture/proc/ghost_captured(datum/source, mob/captured_entity)
SIGNAL_HANDLER
// We don't actually care about the mob that's captured, just that something was captured.
completed = TRUE
UnregisterSignal(SSdcs, COMSIG_GLOB_GHOST_CAPTURED)
UnregisterSignal(SSdcs, COMSIG_GLOB_WIGHT_CAPTURED)
/datum/experiment/ghost_capture/perform_experiment_actions(datum/source, atom/movable/captured_entity)
if(isobserver(captured_entity) || isliving(captured_entity) || isliving(/obj/effect/shadow_wight))
// We don't actually care about the mob that's captured, just that something was captured.
ghost_captured = TRUE
return TRUE
return FALSE
-7
View File
@@ -24,13 +24,6 @@
stored_research.techweb_servers |= src
name += " [num2hex(rand(1,65535), -1)]" //gives us a random four-digit hex number as part of the name. Y'know, for fluff.
//So we can be listening for experiments that are global.
AddComponent(/datum/component/experiment_handler, \
allowed_experiments = list(/datum/experiment/ghost_capture), \
config_mode = EXPERIMENT_CONFIG_UI, \
config_flags = EXPERIMENT_CONFIG_ALWAYS_ACTIVE)
/obj/machinery/rnd/server/Destroy()
if(stored_research)
stored_research.techweb_servers -= src