diff --git a/modular_citadel/code/modules/admin/chat_commands.dm b/modular_citadel/code/modules/admin/chat_commands.dm index 918b1dda5a..39f4158646 100644 --- a/modular_citadel/code/modules/admin/chat_commands.dm +++ b/modular_citadel/code/modules/admin/chat_commands.dm @@ -20,3 +20,26 @@ /datum/tgs_chat_command/despacito/Run() return "https://www.youtube.com/watch?v=kJQP7kiw5Fk" + +/datum/tgs_chat_command/poly + name = "poly" + help_text = "The Lewder, more applicable Poly speak for Citadel Station 13." + var/list/speech_buffer + +/datum/tgs_chat_command/poly/Run() + GenerateSayList() //Has a check in here, but we're gunna sanity it after + if(!speech_buffer) + return "**BAWWWWWK!** LEAVE THE HEADSET! ***BAWKKKKK!!***" + + +/datum/tgs_chat_command/poly/proc/GenerateSayList() + LAZYINITLIST(speech_buffer) //I figure this is just safe to do for everything at this point + if(length(speech_buffer)) //Let's not look up the whole json EVERY TIME, just the first time. + return "[pick(speech_buffer)]" + else + var/json_file = file("data/npc_saves/Poly.json") + if(!fexists(json_file)) + return + var/list/json = json_decode(file2text(json_file)) + speech_buffer = json["phrases"] + return "[pick(speech_buffer)]" \ No newline at end of file