mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
## About The Pull Request just macro-izes all the usages of verbs in the codebase as a pre-requisite to my follow up pr that serializes all the verbs arguments so we can tgui-ify the command bar, so we can then put it on the onscreen map. this also basically does the same as #94487 so can easily be integrated into the verb queueing stuff... but does not actually do any verb queueing by itself. basically im just trying to be https://github.com/tgstation/tgstation/labels/Atomic ## Why It's Good For The Game it doesn't really do anything by itself but it does let us do more stuff ## Changelog 🆑 code: the backend to all verbs in the game has been played with, please report any issues to github /🆑 --------- Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
|
|
///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
|
|
. = ..()
|
|
|
|
GAME_VERB_PROC(/client, triple_ai, "Toggle AI Triumvirate", "Admin.Events")
|
|
|
|
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.get_job_type(/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."))
|