[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
@@ -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