forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full revert of tgstation#79995 (tri-ai station trait). Partal revert of
tgstation#81681 (human ai) (tgstation#84850) tgstation#79995 removed the verb and secrets button for no reason. This means you can no longer decide to do tri-ai in the lobby, you have to do it next round or make players suffer thru another init cycle. **__In general systems that require things be decided the previous round are really fucking annoying and should be minimized to only specific things that absolutely have to for technical reason.__** This is not one of them. I do not have the time to redesign the station trait to make use of the existing admin code so this is a full revert instead. If the station trait is re-added, it should be done so without removing the secrets button or admin verb. tgstation#81681 had an undocumented and un-atmoized change, in that it removed a job related signal needlessly, that undocumented change has been reverted because this system used that signal. @Fikou @JohnFulpWillard (also cc @tralezab and @Ghommie as you merged the reverted prs)
- Loading branch information
1 parent
7728652
commit 45ca171
Showing
8 changed files
with
67 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
///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.")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters