From 4a7199020c78faa948244e3aac5acb697f7c58db Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 30 Oct 2014 22:27:58 +0100 Subject: [PATCH] Makes the AI radio channel listing more dynamic. Kills copy-pasting. --- code/modules/mob/living/silicon/ai/ai.dm | 37 ++++++++++++++++-------- code/modules/mob/transform_procs.dm | 12 +------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index ccc199d2a79..aaa27b33f3c 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -146,18 +146,7 @@ var/list/ai_verbs_default = list( if (B.brainmob.mind) B.brainmob.mind.transfer_to(src) - src << "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras)." - src << "To look at other parts of the station, click on yourself to get a camera menu." - src << "While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc." - src << "To use something, simply click on it." - src << "Use say :b to speak to your cyborgs through binary." - src << "For department channels, use the following say commands:" - src << ":o - AI Private, :c - Command, :s - Security, :e - Engineering, :u - Supply, :m - Medical, :n - Science." - if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai))) - show_laws() - src << "These laws may be changed by other players, or by you being the traitor." - - job = "AI" + on_mob_init() spawn(5) new /obj/machinery/ai_powersupply(src) @@ -176,6 +165,30 @@ var/list/ai_verbs_default = list( ..() return +/mob/living/silicon/ai/proc/on_mob_init() + src << "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras)." + src << "To look at other parts of the station, click on yourself to get a camera menu." + src << "While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc." + src << "To use something, simply click on it." + src << "Use say :b to speak to your cyborgs through binary. Use say :h to speak from an active holopad." + src << "For department channels, use the following say commands:" + + var/radio_text = "" + for(var/i = 1 to common_radio.channels.len) + var/channel = common_radio.channels[i] + var/key = get_radio_key_from_channel(channel) + radio_text += "[key] - [channel]" + if(i != common_radio.channels.len) + radio_text += ", " + + src << radio_text + + if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai))) + show_laws() + src << "These laws may be changed by other players, or by you being the traitor." + + job = "AI" + /mob/living/silicon/ai/Del() ai_list -= src ..() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index cbaf3690ca9..515067da79b 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -111,19 +111,9 @@ for (var/obj/item/device/radio/intercom/comm in O.loc) comm.ai += O - O << "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras)." - O << "To look at other parts of the station, click on yourself to get a camera menu." - O << "While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc." - O << "To use something, simply click on it." - O << {"Use say ":b to speak to your cyborgs through binary."} - O << "For department channels, use the following say commands:" - O << ":o - AI Private, :c - Command, :s - Security, :e - Engineering, :u - Supply, :m - Medical, :n - Science." - if (!(ticker && ticker.mode && (O.mind in ticker.mode.malf_ai))) - O.show_laws() - O << "These laws may be changed by other players, or by you being the traitor." + O.on_mob_init() O.add_ai_verbs() - O.job = "AI" O.rename_self("ai",1) . = O