From 01b09bf3e835005f13bfbfadf97191ba0e389b3f Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Wed, 21 Jun 2023 17:55:39 -0400 Subject: [PATCH] You can no longer get the supermatter sliver objective if the station does not have a supermatter (#21337) * You can no longer get the supermatter sliver objective if the station does not have a supermatter * sirryans changes --- code/_globalvars/misc_globals.dm | 2 ++ code/game/gamemodes/objective.dm | 2 ++ code/game/gamemodes/steal_items.dm | 8 ++++++++ code/modules/power/engines/supermatter/supermatter.dm | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/code/_globalvars/misc_globals.dm b/code/_globalvars/misc_globals.dm index 2ee4c944824..d9b24ec08d1 100644 --- a/code/_globalvars/misc_globals.dm +++ b/code/_globalvars/misc_globals.dm @@ -51,3 +51,5 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) // Station datacore, manifest GLOBAL_LIST_EMPTY(ability_verbs) // Create-level abilities GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) +GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/atmospherics/supermatter_crystal) + diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 9f39b6288fd..380ab2003c7 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -507,6 +507,8 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) break if(has_invalid_owner) continue + if(!O.check_objective_conditions()) + continue if(O.flags & 2) // THEFT_FLAG_UNIQUE continue diff --git a/code/game/gamemodes/steal_items.dm b/code/game/gamemodes/steal_items.dm index 5bc92bea65a..e75f9e4a284 100644 --- a/code/game/gamemodes/steal_items.dm +++ b/code/game/gamemodes/steal_items.dm @@ -28,6 +28,11 @@ return 1 return 0 +//This proc is to be used for not granting objectives if a special requirement other than job is not met. + +/datum/theft_objective/proc/check_objective_conditions() + return TRUE + /datum/proc/check_special_completion() //for objectives with special checks (is that slime extract unused? does that intellicard have an ai in it? etcetc) return 1 @@ -144,6 +149,9 @@ special_equipment = /obj/item/storage/box/syndie_kit/supermatter job_possession = FALSE //The CE / engineers / atmos techs do not carry around supermater slivers. +/datum/theft_objective/supermatter_sliver/check_objective_conditions() //If there is no supermatter, you don't get the objective. Yes, one could order it from cargo, but I don't think that is fair, especially if we get a map without a supermatter + return !isnull(GLOB.main_supermatter_engine) + /datum/theft_objective/plutonium_core name = "the plutonium core from the station's nuclear device" typepath = /obj/item/nuke_core/plutonium diff --git a/code/modules/power/engines/supermatter/supermatter.dm b/code/modules/power/engines/supermatter/supermatter.dm index 7bd21a5bc23..b41997a7afa 100644 --- a/code/modules/power/engines/supermatter/supermatter.dm +++ b/code/modules/power/engines/supermatter/supermatter.dm @@ -85,6 +85,7 @@ #define SUPERMATTER_SINGULARITY_RAYS_COLOUR "#750000" #define SUPERMATTER_SINGULARITY_LIGHT_COLOUR "#400060" + /obj/machinery/atmospherics/supermatter_crystal name = "supermatter crystal" desc = "A strangely translucent and iridescent crystal." @@ -213,7 +214,8 @@ radio.follow_target = src radio.config(list("Engineering" = 0)) investigate_log("has been created.", "supermatter") - + if(is_main_engine) + GLOB.main_supermatter_engine = src soundloop = new(list(src), TRUE) /obj/machinery/atmospherics/supermatter_crystal/Destroy() @@ -227,6 +229,8 @@ if(!processes) GLOB.frozen_atom_list -= src QDEL_NULL(countdown) + if(is_main_engine && GLOB.main_supermatter_engine == src) + GLOB.main_supermatter_engine = null QDEL_NULL(soundloop) return ..()