From d8835029c9c64cda9b0b7b5213820979c1f38caf Mon Sep 17 00:00:00 2001 From: silencer-pl <103842328+silencer-pl@users.noreply.github.com> Date: Fri, 6 Sep 2024 06:50:53 -0400 Subject: [PATCH] outsources roleplay into the hands of one sweaty admin --- code/_globalvars/misc.dm | 3 ++ code/controllers/subsystem/statpanel.dm | 3 ++ .../objects/effects/landmarks/landmarks.dm | 2 ++ code/modules/admin/PvE/spawner_control.dm | 24 ++++++------- code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/tabs/event_tab.dm | 35 ++++++++++++++++++- .../mob/living/carbon/human/human_defines.dm | 14 +++++--- 7 files changed, 65 insertions(+), 17 deletions(-) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index c7ee34f855..c3ba691faa 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -71,3 +71,6 @@ GLOBAL_VAR_INIT(spawner_number, 1) GLOBAL_VAR_INIT(ammo_restock_next, 0) GLOBAL_VAR_INIT(ammo_restock_full, 0) GLOBAL_VAR_INIT(ammo_restock_delay, 6000) + +GLOBAL_VAR_INIT(primary_objective, "Awaiting Orders") +GLOBAL_VAR_INIT(secondary_objective, "Awaiting Orders") diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index ba07898dec..caac477fc7 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -34,6 +34,9 @@ SUBSYSTEM_DEF(statpanels) "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]", "Round Time: [duration2text()]", "Operation Time: [worldtime2text()]", + "------", + "Primary Objective:", + ) src.currentrun = GLOB.clients.Copy() diff --git a/code/game/objects/effects/landmarks/landmarks.dm b/code/game/objects/effects/landmarks/landmarks.dm index 89dda34836..07765f9498 100644 --- a/code/game/objects/effects/landmarks/landmarks.dm +++ b/code/game/objects/effects/landmarks/landmarks.dm @@ -544,6 +544,8 @@ H.name = npc_name H.langchat_color = npc_chat_color H.gender = gender_to_set + H.talking_npc = 1 + H.wear_id.set_user_data(H) for(var/obj/structure/bed/chair/dropship/pilot/chair in get_area(H)) if(chair != null) if(get_turf(chair) == get_turf(H)) diff --git a/code/modules/admin/PvE/spawner_control.dm b/code/modules/admin/PvE/spawner_control.dm index e3f3048bf4..81db3cf8d1 100644 --- a/code/modules/admin/PvE/spawner_control.dm +++ b/code/modules/admin/PvE/spawner_control.dm @@ -1,6 +1,6 @@ /client/proc/create_spawner_setup() - set category = "Xenosurge.Spawners" - set name = "Spawners - Create Setup" + set category = "DM.Xenosurge.Spawners" + set name = "Create Setup" set desc = "Configures spawner creation variables." if(!check_rights(R_ADMIN)) @@ -13,8 +13,8 @@ GLOB.xenosurge_spawner_delay = delay_to_pass /client/proc/create_spawner() - set category = "Xenosurge.Spawners" - set name = "Spawners - Create" + set category = "DM.Xenosurge.Spawners" + set name = "Create Action" set desc = "Starts the spawner creation loop." if(!check_rights(R_ADMIN)) @@ -33,8 +33,8 @@ /client/proc/setup_surge() - set category = "Xenosurge.Spawners" - set name = "Xenosurge - Setup" + set category = "DM.Xenosurge.Surge" + set name = "Setup" set desc = "Sets parameters for next wave surge." if(!check_rights(R_ADMIN)) @@ -81,8 +81,8 @@ /client/proc/start_surge() - set category = "Xenosurge.Spawners" - set name = "Xenosurge - Start" + set category = "DM.Xenosurge.Surge" + set name = "Start" set desc = "Checks critcial params, starts surge." if(!check_rights(R_ADMIN)) @@ -100,8 +100,8 @@ log_admin("[usr] has activated a [spawner_count] spawner Xenosurge. Parameters: Max:[GLOB.xenosurge_spawner_limit], Xenos:[GLOB.xenosurge_wave_xenos_max]") /client/proc/stop_surge() - set category = "Xenosurge.Spawners" - set name = "Xenosurge - Stop" + set category = "DM.Xenosurge.Surge" + set name = "Stop" set desc = "Deinitalizes all spawners, stopping them." if(!check_rights(R_ADMIN)) @@ -115,8 +115,8 @@ to_chat(usr, SPAN_INFO("All spawners have been deactivated, the surge is effectively stopped.")) /client/proc/remove_spawners() - set category = "Xenosurge.Spawners" - set name = "Spawners - Remove All" + set category = "DM.Xenosurge.Spawners" + set name = "Remove All" set desc = "Removes all spawners." if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 084192f274..13f6f85efd 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -151,6 +151,7 @@ var/list/admin_verbs_minor_event = list( /client/proc/speak_to_comms, /client/proc/call_tgui_play_directly, /client/proc/opener_blurb, + /client/proc/npc_interaction, ) var/list/admin_verbs_major_event = list( diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 35d585707b..a9b64171c4 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -1110,7 +1110,7 @@ show_blurb(GLOB.player_list, 10 SECONDS, "[message_to_display]", screen_position = "LEFT+0:16,BOTTOM+1:16", text_alignment = "left", text_color = "#FFFFFF", blurb_key = "song[title]", ignore_key = TRUE, speed = 1) /client/proc/call_tgui_play_directly() - set category = "Admin.Fun" + set category = "DM.Music" set name = "Play Music From Direct Link" set desc = "Plays a music file from a https:// link through tguis music player, bypassing the filtering done by the other admin command. This will play as an admin atmospheric and will be muted by clinets who have that setting turned on as expected. A blurb displaying song info can also be displayed as an extra option." @@ -1140,3 +1140,36 @@ show_blurb(GLOB.player_list, duration = 15 SECONDS, message = "The year is 2224.\n\nLocated on the edge of the Neroid Sector\nLV-624 grew from an insignificant prison\nplanet with a minor corporate interest\nto an important way-station, with all\nthree major factions maintaining\ninstallations on the planet.\n\nOn February 11th, 2224, an unidentified\nflying object enters the solar system\nand impacts the planets communications\narray.\nAll contact with the planet and its\nsurrounding infrastructure is lost.",scroll_down = TRUE, screen_position = "CENTER,BOTTOM+4.5:16", text_alignment = "center", text_color = "#ffaef2", blurb_key = "introduction", ignore_key = TRUE, speed = 1) sleep(600) show_blurb(GLOB.player_list, duration = 15 SECONDS, message = "Due to the politics involved, it takes\nmonths to organize a rescue. Now, thanks\nto an one-of-a-kind agreement\nthe 1st United Expeditionary Response\nconsisting of elements coming from all\nthree of the major political players\nback on Earth is finally close to\narriving in the system.\n\nYou are part of the United Americas\nColonial Marines element of the UER.\nYou have been hand picked from a narrow\nfield of qualified volunteers to take\npart in this operation and have been\nassigned to the UAS Arrowhead.\nYou are the first organized military\nresponse in the system since it lost\ncontact.\n\nYour mission begins now.",scroll_down = TRUE, screen_position = "CENTER,BOTTOM+3.5:16", text_alignment = "center", text_color = "#ffaef2", blurb_key = "introduction", ignore_key = TRUE, speed = 1) + +/client/proc/npc_interaction() + set category = "DM.Narration" + set name = "Speak as in world NPC" + set desc = "Speaks as NPC from spawners or otherwise with the talking_npc var turned on." + + if(!check_rights(R_ADMIN)) + return + + var/list/speaker_list = list() + for(var/mob/living/carbon/human/H in GLOB.mob_list) + if(H.talking_npc == 1) + speaker_list.Add(H) + if(speaker_list.len == 0) + to_chat(usr, SPAN_WARNING("Error: No talking NPCs available.")) + return + var/target_mob = tgui_input_list(src, "Select a NPC to talk as:", "NPC", speaker_list, timeout = 0) + if(target_mob == null) return + var/mob/living/carbon/human/mob_to_talk_as = target_mob + var/use_radio = 0 + if(tgui_alert(usr, "Broadcast over radio?", "NPC", list("No", "Yes"), timeout = 0) == "Yes") use_radio = 1 + var/speaking_mode = tgui_alert(usr, "Emote or Speak?", "NPC", list("Emote", "Speak"), timeout = 0) + if(speaking_mode == null) return + var/text_to_say = tgui_input_text(usr, "[speaking_mode] as [target_mob]","[uppertext(speaking_mode)]-[uppertext(target_mob)]", timeout = 0) + while(text_to_say != null) + switch(speaking_mode) + if("Emote") + INVOKE_ASYNC(mob_to_talk_as, TYPE_PROC_REF(/mob/living/carbon/human, emoteas), text_to_say, 0, use_radio) + text_to_say = tgui_input_text(usr, "[speaking_mode] as [target_mob]","[uppertext(speaking_mode)]-[uppertext(target_mob)]",timeout = 0) + if("Speak") + INVOKE_ASYNC(mob_to_talk_as, TYPE_PROC_REF(/mob/living/carbon/human, talkas), text_to_say, 0, use_radio) + text_to_say = tgui_input_text(usr, "[speaking_mode] as [target_mob]","[uppertext(speaking_mode)]-[uppertext(target_mob)]",timeout = 0) + return diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 1343be4d19..994c5fd8e4 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -171,6 +171,10 @@ //hypo shenanigans var/obj/item/stim_injector/bound_injector + //talking npc identifier to limit speaking picker + + var/talking_npc = 0 + /client/var/cached_human_playtime /client/proc/get_total_human_playtime(skip_cache = FALSE) @@ -279,8 +283,9 @@ /mob/living/carbon/human/proc/talkas(str, delay, radio) //Talk as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length. if (!str) return var/list/heard = get_mobs_in_view(world_view_size, src) + var/rank_text = src.get_paygrade() src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE) - src.visible_message("[src] says, \"[str]\"") + src.visible_message("[rank_text] [src] says, \"[str]\"") var/talkdelay = delay if (!talkdelay) if ((length("[str]")) <= 64) @@ -288,15 +293,16 @@ if ((length("[str]")) > 64) talkdelay = 60 if(radio) - to_chat(world, "[src][icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.job]\u0029\u005D , says \"[str]\"", type = MESSAGE_TYPE_RADIO) + to_chat(world, "[rank_text] [src][icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.comm_title]\u0029\u005D , says \"[str]\"", type = MESSAGE_TYPE_RADIO) sleep(talkdelay) return /mob/living/carbon/human/proc/emoteas(str, delay, radio) //Emote as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length. if (!str) return var/list/heard = get_mobs_in_view(world_view_size, src) + var/rank_text = src.get_paygrade() src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE, animation_style = LANGCHAT_FAST_POP, additional_styles = list("langchat_small", "emote")) - src.visible_message("[src] [str]") + src.visible_message("[rank_text] [src] [str]") var/talkdelay = delay if (!talkdelay) if ((length("[str]")) <= 64) @@ -304,6 +310,6 @@ if ((length("[str]")) > 64) talkdelay = 60 if(radio) - to_chat(world, "[src][icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[usr.job]\u0029\u005D [str]", type = MESSAGE_TYPE_RADIO) + to_chat(world, "[rank_text] [src][icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.comm_title]\u0029\u005D [str]", type = MESSAGE_TYPE_RADIO) sleep(talkdelay) return