Skip to content

Commit

Permalink
outsources roleplay into the hands of one sweaty admin
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Sep 6, 2024
1 parent 0b28d58 commit d883502
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 17 deletions.
3 changes: 3 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
3 changes: 3 additions & 0 deletions code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
24 changes: 12 additions & 12 deletions code/modules/admin/PvE/spawner_control.dm
Original file line number Diff line number Diff line change
@@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
35 changes: 34 additions & 1 deletion code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down Expand Up @@ -1140,3 +1140,36 @@
show_blurb(GLOB.player_list, duration = 15 SECONDS, message = "<b>The year is 2224.</b>\n\nLocated on the edge of the <b>Neroid Sector</b>\n<b>LV-624</b> grew from an insignificant prison\nplanet with a minor corporate interest\nto an <b>important way-station</b>, with all\nthree major factions maintaining\ninstallations on the planet.\n\n<b>On February 11th, 2224</b>, an <b>unidentified\nflying object</b> enters the solar system\nand impacts the planets communications\narray.\n<b>All contact</b> with the planet and its\nsurrounding infrastructure <b>is lost.</b>",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, <b>it takes\nmonths</b> to organize a rescue. Now, thanks\nto an one-of-a-kind agreement\nthe <b>1st United Expeditionary Response</b>\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 <b>United Americas\nColonial Marines</b> element of the <b>UER</b>.\nYou have been hand picked from a narrow\nfield of qualified volunteers to take\npart in this operation and have been\nassigned to the <b>UAS Arrowhead</b>.\nYou are the first organized military\nresponse in the system since it lost\ncontact.\n\n<b>Your mission begins now.</b>",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
14 changes: 10 additions & 4 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -279,31 +283,33 @@
/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("<b>[src]</b> says, \"[str]\"")
src.visible_message("<b>[rank_text] [src]</b> says, \"[str]\"")
var/talkdelay = delay
if (!talkdelay)
if ((length("[str]")) <= 64)
talkdelay = 40
if ((length("[str]")) > 64)
talkdelay = 60
if(radio)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.job]\u0029\u005D </b></span><span class='message'>, says \"[str]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[rank_text] [src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.comm_title]\u0029\u005D </b></span><span class='message'>, says \"[str]\"</span></span></span>", 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("<b>[src]</b> [str]")
src.visible_message("<b>[rank_text] [src]</b> [str]")
var/talkdelay = delay
if (!talkdelay)
if ((length("[str]")) <= 64)
talkdelay = 40
if ((length("[str]")) > 64)
talkdelay = 60
if(radio)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[usr.job]\u0029\u005D </b></span><span class='message'>[str]</span></span></span>", type = MESSAGE_TYPE_RADIO)
to_chat(world, "<span class='big'><span class='radio'><span class='name'>[rank_text] [src]<b>[icon2html('icons/obj/items/radio.dmi', usr, "beacon")] \u005BUAS Arrowhead\u0028[src.comm_title]\u0029\u005D </b></span><span class='message'>[str]</span></span></span>", type = MESSAGE_TYPE_RADIO)
sleep(talkdelay)
return

0 comments on commit d883502

Please sign in to comment.