mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +01:00
[MIRROR] turns triple ai mode into a station trait [MDB IGNORE] (#25346)
* turns triple ai mode into a station trait (#79995) ## About The Pull Request removes the triple ai mode secret and makes it into a station trait ## Why It's Good For The Game it seems to be an interesting way to spice up the gameplay of a given round ## Changelog 🆑 add: turns triple ai mode into a station trait /🆑 * turns triple ai mode into a station trait * Set the weight to 0 --------- Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com>
This commit is contained in:
co-authored by
Fikou
SomeRandomOwl
parent
00be1a508f
commit
faddb632cc
@@ -336,3 +336,26 @@
|
||||
show_in_report = TRUE
|
||||
report_message = "There sure are a lot of trees out there."
|
||||
|
||||
/datum/station_trait/triple_ai
|
||||
name = "AI Triumvirate"
|
||||
trait_type = STATION_TRAIT_NEUTRAL
|
||||
show_in_report = TRUE
|
||||
weight = 0 // SKYRAT EDIT Original = 1
|
||||
report_message = "Your station has been instated with three Nanotrasen Artificial Intelligence models."
|
||||
|
||||
/datum/station_trait/triple_ai/New()
|
||||
. = ..()
|
||||
RegisterSignal(SSjob, COMSIG_OCCUPATIONS_DIVIDED, PROC_REF(on_occupations_divided))
|
||||
|
||||
/datum/station_trait/triple_ai/revert()
|
||||
UnregisterSignal(SSjob, COMSIG_OCCUPATIONS_DIVIDED)
|
||||
return ..()
|
||||
|
||||
/datum/station_trait/triple_ai/proc/on_occupations_divided(datum/source, pure, allow_all)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
for(var/datum/job/ai/ai_datum in SSjob.joinable_occupations)
|
||||
ai_datum.spawn_positions = 3
|
||||
if(!pure)
|
||||
for(var/obj/effect/landmark/start/ai/secondary/secondary_ai_spawn in GLOB.start_landmarks_list)
|
||||
secondary_ai_spawn.latejoin_active = TRUE
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
///global reference to the current theme, if there is one.
|
||||
GLOBAL_DATUM(triple_ai_controller, /datum/triple_ai_controller)
|
||||
|
||||
/**
|
||||
* The triple ai controller handles the admin triple AI mode, if enabled.
|
||||
* It is first created when "Toggle AI Triumvirate" triggers it, and it can be referenced from GLOB.triple_ai_controller
|
||||
* After it handles roundstart business, it cleans itself up.
|
||||
*/
|
||||
/datum/triple_ai_controller
|
||||
|
||||
/datum/triple_ai_controller/New()
|
||||
. = ..()
|
||||
RegisterSignal(SSjob, COMSIG_OCCUPATIONS_DIVIDED, PROC_REF(on_occupations_divided))
|
||||
|
||||
/datum/triple_ai_controller/proc/on_occupations_divided(datum/source, pure, allow_all)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
for(var/datum/job/ai/ai_datum in SSjob.joinable_occupations)
|
||||
ai_datum.spawn_positions = 3
|
||||
if(!pure)
|
||||
for(var/obj/effect/landmark/start/ai/secondary/secondary_ai_spawn in GLOB.start_landmarks_list)
|
||||
secondary_ai_spawn.latejoin_active = TRUE
|
||||
qdel(src)
|
||||
|
||||
/datum/triple_ai_controller/Destroy(force)
|
||||
UnregisterSignal(SSjob, COMSIG_OCCUPATIONS_DIVIDED)
|
||||
GLOB.triple_ai_controller = null
|
||||
. = ..()
|
||||
|
||||
/client/proc/triple_ai()
|
||||
set category = "Admin.Events"
|
||||
set name = "Toggle AI Triumvirate"
|
||||
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.", confidential = TRUE)
|
||||
return
|
||||
|
||||
var/datum/job/job = SSjob.GetJobType(/datum/job/ai)
|
||||
if(!job)
|
||||
to_chat(usr, "Unable to locate the AI job", confidential = TRUE)
|
||||
CRASH("triple_ai() called, no /datum/job/ai to be found.")
|
||||
|
||||
if(!GLOB.triple_ai_controller)
|
||||
GLOB.triple_ai_controller = new()
|
||||
else
|
||||
QDEL_NULL(GLOB.triple_ai_controller)
|
||||
to_chat(usr, "There will[GLOB.triple_ai_controller ? "" : "not"] be an AI Triumvirate at round start.")
|
||||
message_admins(span_adminnotice("[key_name_admin(usr)] has toggled [GLOB.triple_ai_controller ? "on" : "off"] triple AIs at round start."))
|
||||
@@ -260,11 +260,6 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
|
||||
return
|
||||
holder.anon_names()
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anonymous Names"))
|
||||
if("tripleAI")
|
||||
if(!is_funmin)
|
||||
return
|
||||
holder.triple_ai()
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Triple AI"))
|
||||
if("onlyone")
|
||||
if(!is_funmin)
|
||||
return
|
||||
|
||||
@@ -2855,7 +2855,6 @@
|
||||
#include "code\modules\admin\verbs\adminjump.dm"
|
||||
#include "code\modules\admin\verbs\adminpm.dm"
|
||||
#include "code\modules\admin\verbs\adminsay.dm"
|
||||
#include "code\modules\admin\verbs\ai_triumvirate.dm"
|
||||
#include "code\modules\admin\verbs\anonymousnames.dm"
|
||||
#include "code\modules\admin\verbs\atmosdebug.dm"
|
||||
#include "code\modules\admin\verbs\beakerpanel.dm"
|
||||
|
||||
@@ -340,13 +340,12 @@ const FunTab = (props, context) => {
|
||||
/>
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
icon="users"
|
||||
lineHeight={lineHeightNormal}
|
||||
<NoticeBox
|
||||
mb={0.0}
|
||||
width={buttonWidthNormal}
|
||||
content="Triple AI mode"
|
||||
onClick={() => act('tripleAI')}
|
||||
/>
|
||||
height={lineHeightNormal}>
|
||||
Your admin button here, coder!
|
||||
</NoticeBox>
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user