From efb735af1e7dad50d9e9fb3db94b50f2292787e5 Mon Sep 17 00:00:00 2001 From: 1080pCat <96908085+1080pCat@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:11:33 +1000 Subject: [PATCH] Adds/ports the AI Triumvirate station trait. (triple ai mode as a VERY rare trait) (#25957) * yippie itt works * Update tripAI.dm * Update code/modules/admin/verbs/tripAI.dm Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> * Update code/datums/station_traits/neutral_traits.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> --------- Signed-off-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> --- code/__HELPERS/trait_helpers.dm | 1 + code/controllers/subsystem/SSticker.dm | 6 ++++++ code/datums/station_traits/neutral_traits.dm | 16 ++++++++++++++++ code/modules/admin/verbs/tripAI.dm | 8 ++++++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/trait_helpers.dm b/code/__HELPERS/trait_helpers.dm index 48feea04b4e..e8e7aaead06 100644 --- a/code/__HELPERS/trait_helpers.dm +++ b/code/__HELPERS/trait_helpers.dm @@ -396,6 +396,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define STATION_TRAIT_FORESTED "station_trait_forested" #define STATION_TRAIT_VENDING_SHORTAGE "station_trait_vending_shortage" #define STATION_TRAIT_MESSY "station_trait_messy" +#define STATION_TRAIT_TRIAI "station_trait_triai" //***** TURF TRAITS *****// /// Removes slowdown while walking on these tiles. diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index bc19b6c93fd..08b385df6e1 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -284,6 +284,12 @@ SUBSYSTEM_DEF(ticker) Master.SetRunLevel(RUNLEVEL_GAME) // Generate the list of empty playable AI cores in the world + if(HAS_TRAIT(SSstation, STATION_TRAIT_TRIAI)) + for(var/obj/effect/landmark/tripai in GLOB.landmarks_list) + if(tripai.name == "tripai") + if(locate(/mob/living) in get_turf(tripai)) + continue + GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(tripai)) for(var/obj/effect/landmark/start/ai/A in GLOB.landmarks_list) if(locate(/mob/living) in get_turf(A)) continue diff --git a/code/datums/station_traits/neutral_traits.dm b/code/datums/station_traits/neutral_traits.dm index 4661f5efed8..370ef497779 100644 --- a/code/datums/station_traits/neutral_traits.dm +++ b/code/datums/station_traits/neutral_traits.dm @@ -64,3 +64,19 @@ /datum/station_trait/hangover/revert() . = ..() SSjobs.drunken_spawning = FALSE + +/datum/station_trait/triple_ai + name = "AI Triumvirate" + trait_type = STATION_TRAIT_NEUTRAL + weight = 1 + show_in_report = TRUE + report_message = "As part of Operation Magi, your station has been equipped with three Nanotrasen Artificial Intelligence models. Please try not to break them." + trait_to_give = STATION_TRAIT_TRIAI + +/datum/station_trait/triple_ai/New() + . = ..() + SSticker.triai = TRUE + +/datum/station_trait/triple_ai/revert() + . = ..() + SSticker.triai = FALSE diff --git a/code/modules/admin/verbs/tripAI.dm b/code/modules/admin/verbs/tripAI.dm index 5eedd9f2811..4fc6b4aade3 100644 --- a/code/modules/admin/verbs/tripAI.dm +++ b/code/modules/admin/verbs/tripAI.dm @@ -11,12 +11,16 @@ if(!job) to_chat(usr, "Unable to locate the AI job") return + if(HAS_TRAIT(SSstation, STATION_TRAIT_TRIAI)) + to_chat(usr, "The triple AI station trait is now enabled. This trait can be disabled in the Modify Station Traits menu.") + return + if(SSticker.triai) - SSticker.triai = 0 + SSticker.triai = FALSE to_chat(usr, "Only one AI will be spawned at round start.") message_admins("[key_name_admin(usr)] has toggled off triple AIs at round start.", 1) else - SSticker.triai = 1 + SSticker.triai = TRUE to_chat(usr, "There will be an AI Triumvirate at round start.") message_admins("[key_name_admin(usr)] has toggled on triple AIs at round start.", 1) return