[MIRROR] some more admin verbs (#12480)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-02 23:50:24 +01:00
committed by GitHub
co-authored by Kashargul
parent 2cb976153e
commit df328ef354
24 changed files with 383 additions and 570 deletions
+8 -13
View File
@@ -36,21 +36,16 @@
message_admins("[key_name_admin(src)] jumped to [target_area]")
feedback_add_details("admin_verb","JA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/jumptoturf(var/turf/T in world)
set name = "Jump to Turf"
set category = "Admin.Game"
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
ADMIN_VERB(jumptoturf, R_ADMIN|R_MOD|R_DEBUG|R_EVENT, "Jump to Turf", "Jump to a specific turf in the game.", ADMIN_CATEGORY_GAME, turf/T in world)
if(CONFIG_GET(flag/allow_admin_jump))
log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
message_admins("[key_name_admin(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
usr.on_mob_jump()
usr.reset_perspective(usr)
usr.forceMove(T)
log_admin("[key_name(user)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
message_admins("[key_name_admin(user)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
user.mob.on_mob_jump()
user.mob.reset_perspective(user)
user.mob.forceMove(T)
feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
else
tgui_alert_async(usr, "Admin jumping disabled")
return
return
tgui_alert_async(user, "Admin jumping disabled")
/// Verb wrapper around do_jumptomob()
/client/proc/jumptomob(mob as null|anything in GLOB.mob_list)
+34 -39
View File
@@ -34,64 +34,59 @@
H.change_appearance(APPEARANCE_ALL, H, check_species_whitelist = 1)
feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/editappear()
set name = "Edit Appearance"
set category = "Fun.Event Kit"
ADMIN_VERB(editappear, R_FUN, "Edit Appearance", "Edit a human's apperance.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/mob/living/carbon/human/target_human = tgui_input_list(user, "Select mob.", "Edit Appearance", GLOB.human_mob_list)
if(!check_rights(R_FUN)) return
var/mob/living/carbon/human/M = tgui_input_list(usr, "Select mob.", "Edit Appearance", GLOB.human_mob_list)
if(!ishuman(M))
to_chat(usr, span_warning("You can only do this to humans!"))
if(!ishuman(target_human))
to_chat(user, span_warning("You can only do this to humans!"))
return
if(tgui_alert(usr, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No")) != "Yes")
if(tgui_alert(user, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No")) != "Yes")
return
var/new_facial = tgui_color_picker(usr, "Please select facial hair color.", "Character Generation")
var/new_facial = tgui_color_picker(user, "Please select facial hair color.", "Character Generation")
if(new_facial)
M.r_facial = hex2num(copytext(new_facial, 2, 4))
M.g_facial = hex2num(copytext(new_facial, 4, 6))
M.b_facial = hex2num(copytext(new_facial, 6, 8))
target_human.r_facial = hex2num(copytext(new_facial, 2, 4))
target_human.g_facial = hex2num(copytext(new_facial, 4, 6))
target_human.b_facial = hex2num(copytext(new_facial, 6, 8))
var/new_hair = tgui_color_picker(usr, "Please select hair color.", "Character Generation")
var/new_hair = tgui_color_picker(user, "Please select hair color.", "Character Generation")
if(new_facial)
M.r_hair = hex2num(copytext(new_hair, 2, 4))
M.g_hair = hex2num(copytext(new_hair, 4, 6))
M.b_hair = hex2num(copytext(new_hair, 6, 8))
target_human.r_hair = hex2num(copytext(new_hair, 2, 4))
target_human.g_hair = hex2num(copytext(new_hair, 4, 6))
target_human.b_hair = hex2num(copytext(new_hair, 6, 8))
var/new_eyes = tgui_color_picker(usr, "Please select eye color.", "Character Generation")
var/new_eyes = tgui_color_picker(user, "Please select eye color.", "Character Generation")
if(new_eyes)
M.r_eyes = hex2num(copytext(new_eyes, 2, 4))
M.g_eyes = hex2num(copytext(new_eyes, 4, 6))
M.b_eyes = hex2num(copytext(new_eyes, 6, 8))
M.update_eyes()
target_human.r_eyes = hex2num(copytext(new_eyes, 2, 4))
target_human.g_eyes = hex2num(copytext(new_eyes, 4, 6))
target_human.b_eyes = hex2num(copytext(new_eyes, 6, 8))
target_human.update_eyes()
var/new_skin = tgui_color_picker(usr, "Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation")
var/new_skin = tgui_color_picker(user, "Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation")
if(new_skin)
M.r_skin = hex2num(copytext(new_skin, 2, 4))
M.g_skin = hex2num(copytext(new_skin, 4, 6))
M.b_skin = hex2num(copytext(new_skin, 6, 8))
target_human.r_skin = hex2num(copytext(new_skin, 2, 4))
target_human.g_skin = hex2num(copytext(new_skin, 4, 6))
target_human.b_skin = hex2num(copytext(new_skin, 6, 8))
var/new_tone = tgui_input_number(usr, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", null, 220, 1)
var/new_tone = tgui_input_number(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", null, 220, 1)
if (new_tone)
M.s_tone = max(min(round(text2num(new_tone)), 220), 1)
M.s_tone = -M.s_tone + 35
target_human.s_tone = max(min(round(text2num(new_tone)), 220), 1)
target_human.s_tone = -target_human.s_tone + 35
// hair
var/new_hstyle = tgui_input_list(usr, "Select a hair style", "Grooming", GLOB.hair_styles_list)
var/new_hstyle = tgui_input_list(user, "Select a hair style", "Grooming", GLOB.hair_styles_list)
if(new_hstyle)
M.h_style = new_hstyle
target_human.h_style = new_hstyle
// facial hair
var/new_fstyle = tgui_input_list(usr, "Select a facial hair style", "Grooming", GLOB.facial_hair_styles_list)
var/new_fstyle = tgui_input_list(user, "Select a facial hair style", "Grooming", GLOB.facial_hair_styles_list)
if(new_fstyle)
M.f_style = new_fstyle
target_human.f_style = new_fstyle
var/new_gender = tgui_alert(usr, "Please select gender.", "Character Generation", list("Male", "Female", "Neuter"))
var/new_gender = tgui_alert(user, "Please select gender.", "Character Generation", list("Male", "Female", "Neuter"))
if (new_gender)
M.set_gender(new_gender)
target_human.set_gender(new_gender)
M.update_dna(M)
M.update_hair(FALSE)
M.update_icons_body()
target_human.update_dna(target_human)
target_human.update_hair(FALSE)
target_human.update_icons_body()
+8 -11
View File
@@ -421,28 +421,25 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct
for(var/areatype in areas_without_camera)
to_chat(world, "* [areatype]")
/datum/admins/proc/cmd_admin_dress(input in getmobs())
set category = "Fun.Event Kit"
set name = "Select equipment"
if(!check_rights(R_FUN))
return
ADMIN_VERB(cmd_admin_dress, R_FUN, "elect equipment", "Select equipment for a mob.", ADMIN_CATEGORY_FUN_EVENT_KIT, input)
if(!input)
input = tgui_input_list(user, "Pick Target", "Select the target to dress.", getmobs())
if(!input)
return
var/target = getmobs()[input]
if(!target)
return
if(!ishuman(target))
return
var/mob/living/carbon/human/H = target
var/mob/living/carbon/human/target_human = target
var/datum/decl/hierarchy/outfit/outfit = tgui_input_list(usr, "Select outfit.", "Select equipment.", outfits())
var/datum/decl/hierarchy/outfit/outfit = tgui_input_list(user, "Select outfit.", "Select equipment.", outfits())
if(!outfit)
return
feedback_add_details("admin_verb","SEQ")
dressup_human(H, outfit, 1)
dressup_human(target_human, outfit, 1)
/proc/dressup_human(var/mob/living/carbon/human/H, var/datum/decl/hierarchy/outfit/outfit)
if(!H || !outfit)
+6 -10
View File
@@ -1,11 +1,7 @@
/client/proc/roll_dices()
set category = "Fun.Event Kit"
set name = "Roll Dice"
if(!check_rights(R_FUN))
return
var/sum = tgui_input_number(usr, "How many times should we throw?")
var/side = tgui_input_number(usr, "Select the number of sides.")
ADMIN_VERB(roll_dices, R_FUN, "Roll Dice", "Allows to roll a dice.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/sum = tgui_input_number(user, "How many times should we throw?")
var/side = tgui_input_number(user, "Select the number of sides.")
if(!side)
side = 6
if(!sum)
@@ -13,12 +9,12 @@
var/dice = num2text(sum) + "d" + num2text(side)
if(tgui_alert(usr, "Do you want to inform the world about your game?","Show world?",list("Yes", "No")) == "Yes")
if(tgui_alert(user, "Do you want to inform the world about your game?","Show world?",list("Yes", "No")) == "Yes")
to_chat(world, "<h2 style=\"color:#A50400\">The dice have been rolled by Gods!</h2>")
var/result = roll(dice)
if(tgui_alert(usr, "Do you want to inform the world about the result?","Show world?",list("Yes", "No")) == "Yes")
if(tgui_alert(user, "Do you want to inform the world about the result?","Show world?",list("Yes", "No")) == "Yes")
to_chat(world, "<h2 style=\"color:#A50400\">Gods rolled [dice], result is [result]</h2>")
message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]", 1)
message_admins("[key_name_admin(user)] rolled dice [dice], result is [result]", 1)
+36 -44
View File
@@ -1,16 +1,8 @@
/*
Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\game\objects\effects\landmarks_events.dm
*/
/client/proc/manage_event_triggers()
set name = "Manage Event Triggers"
set desc = "Open dialogue to create or delete narration/notification triggers"
set category = "Fun.Event Kit"
if(!check_rights(R_FUN)) return
var/mode = tgui_input_list(src, "What do you wish to do?", "Manage Event Triggers", \
ADMIN_VERB(manage_event_triggers, R_FUN, "Manage Event Triggers", "Open dialogue to create or delete narration/notification triggers", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/mode = tgui_input_list(user, "What do you wish to do?", "Manage Event Triggers", \
list(
"Create Notification Trigger",
"Create Narration Trigger",
@@ -24,26 +16,26 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga
switch(mode)
if("Create Notification Trigger")
var/obj/effect/landmark/event_trigger/ET = new /obj/effect/landmark/event_trigger(usr.loc)
ET.set_vars(src)
var/obj/effect/landmark/event_trigger/ET = new /obj/effect/landmark/event_trigger(user.mob.loc)
ET.set_vars(user)
if("Create Narration Trigger")
var/obj/effect/landmark/event_trigger/auto_narrate/AN = new /obj/effect/landmark/event_trigger/auto_narrate(usr.loc)
AN.set_vars(src)
var/obj/effect/landmark/event_trigger/auto_narrate/AN = new /obj/effect/landmark/event_trigger/auto_narrate(user.mob.loc)
AN.set_vars(user)
if("Manage Personal Triggers")
var/personal_list = GLOB.event_triggers[src.ckey]
var/personal_list = GLOB.event_triggers[user.ckey]
if(!LAZYLEN(personal_list))
to_chat(src, span_notice("You don't have any landmarks to manage!"))
to_chat(user, span_notice("You don't have any landmarks to manage!"))
return
personal_list |= list("Cancel", "Delete All")
var/choice = tgui_input_list(src, "Select a landmark to choose between teleporting to it or deleting it, select delete all to clear them.", \
var/choice = tgui_input_list(user, "Select a landmark to choose between teleporting to it or deleting it, select delete all to clear them.", \
"Manage Personal Triggers", personal_list)
if(!choice || choice == "Cancel")
return
if(choice == "Delete All")
var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE)
var/confirm = tgui_alert(user, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE)
if(!confirm || confirm == "Go Back")
return
for(var/obj/effect/landmark/event_trigger/ET in personal_list)
@@ -51,78 +43,78 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga
qdel(ET)
else if(istype(choice, /obj/effect/landmark/event_trigger))
var/obj/effect/landmark/event_trigger/ET = choice
var/decision = tgui_alert(src, "Teleport to Landmark or Delete it?", "Manage [ET.name]", list("Teleport", "Delete"), autofocus = FALSE)
var/decision = tgui_alert(user, "Teleport to Landmark or Delete it?", "Manage [ET.name]", list("Teleport", "Delete"), autofocus = FALSE)
if(decision == "Teleport")
var/mob/M = usr
if(isobserver(M))
var/confirm_teleport = tgui_alert(src, "You're not a ghost! Admin-ghost?", "You're not a ghost", \
var/mob/user_mob = user.mob
if(isobserver(user_mob))
var/confirm_teleport = tgui_alert(user, "You're not a ghost! Admin-ghost?", "You're not a ghost", \
list("Cancel", "Teleport me with my character"))
if(confirm_teleport == "Cancel")
return
M.forceMove(get_turf(ET))
user_mob.forceMove(get_turf(ET))
if(decision == "Delete")
var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE)
var/confirm = tgui_alert(user, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE)
if(!confirm || confirm == "Go Back")
return
ET.delete_me = TRUE
qdel(ET)
if("Manage Other's Triggers")
var/other_ckey = tgui_input_text(src, "input trigger owner's ckey", "CKEY", "", MAX_MESSAGE_LEN)
var/other_ckey = tgui_input_text(user, "input trigger owner's ckey", "CKEY", "", MAX_MESSAGE_LEN)
var/others_list = GLOB.event_triggers[other_ckey]
if(!LAZYLEN(others_list))
to_chat(src, span_notice("[other_ckey] doesn't have any landmarks to manage!"))
to_chat(user, span_notice("[other_ckey] doesn't have any landmarks to manage!"))
return
others_list |= list("Cancel", "Delete All")
var/choice = tgui_input_list(src, "Select a landmark to choose between teleporting to it or deleting it, select delete all to clear them.", \
var/choice = tgui_input_list(user, "Select a landmark to choose between teleporting to it or deleting it, select delete all to clear them.", \
"Manage Personal Triggers", others_list)
if(!choice || choice == "Cancel")
return
if(choice == "Delete All")
if(other_ckey && GLOB.directory[other_ckey])
var/client/C = GLOB.directory[other_ckey]
var/mob/M = C.statobj
if(M.client && M.client.inactivity < 30 MINUTES)
if(tgui_alert(src, "[M] has only been inactive for [M.client.inactivity / (1 MINUTE)] minutes.\n \
var/mob/stat_mob = C.statobj
if(stat_mob.client?.inactivity < 30 MINUTES)
if(tgui_alert(user, "[stat_mob] has only been inactive for [stat_mob.client.inactivity / (1 MINUTE)] minutes.\n \
If you want to delete their event triggers, ask them in asay or discord to do it themselves or wait 30 minutes. \n \
Only proceed if you are absolutely certain.", "Force Delete", list("Confirm", "Cancel")) == "Confirm")
for(var/obj/effect/landmark/event_trigger/ET in others_list)
ET.delete_me = TRUE
qdel(ET)
log_and_message_admins("[src.ckey] deleted all of [other_ckey]'s event triggers while [other_ckey] was active", src)
log_and_message_admins("[user.ckey] deleted all of [other_ckey]'s event triggers while [other_ckey] was active", user)
return
var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE)
var/confirm = tgui_alert(user, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE)
if(!confirm || confirm == "Go Back")
return
for(var/obj/effect/landmark/event_trigger/ET in others_list)
ET.delete_me = TRUE
qdel(ET)
log_and_message_admins("[src.ckey] deleted all of [other_ckey]'s event triggers. [other_ckey] was either inactive or disconnected at this time.", src)
log_and_message_admins("[user.ckey] deleted all of [other_ckey]'s event triggers. [other_ckey] was either inactive or disconnected at this time.", user)
else if(istype(choice, /obj/effect/landmark/event_trigger))
var/obj/effect/landmark/event_trigger/ET = choice
var/decision = tgui_alert(src, "Teleport to Landmark or Delete it?", "Manage [ET]", list("Teleport", "Delete"), autofocus = FALSE)
var/decision = tgui_alert(user, "Teleport to Landmark or Delete it?", "Manage [ET]", list("Teleport", "Delete"), autofocus = FALSE)
if(decision == "Teleport")
var/mob/M = usr
if(isobserver(M))
var/confirm_teleport = tgui_alert(src, "You're not a ghost! Admin-ghost?", "You're not a ghost", \
var/mob/user_mob = user.mob
if(isobserver(user_mob))
var/confirm_teleport = tgui_alert(user, "You're not a ghost! Admin-ghost?", "You're not a ghost", \
list("Cancel", "Teleport me with my character"))
if(!confirm_teleport || confirm_teleport == "Cancel")
return
M.forceMove(get_turf(ET))
user_mob.forceMove(get_turf(ET))
if(decision == "Delete")
if(other_ckey && GLOB.directory[other_ckey])
var/client/C = GLOB.directory[other_ckey]
var/mob/M = C.statobj
if(M.client && M.client.inactivity < 30 MINUTES)
if(tgui_alert(src, "[M] has only been inactive for [M.client.inactivity / (1 MINUTE)] minutes.\n \
var/mob/stat_mob = C.statobj
if(stat_mob?.client.inactivity < 30 MINUTES)
if(tgui_alert(user, "[stat_mob] has only been inactive for [stat_mob.client.inactivity / (1 MINUTE)] minutes.\n \
If you want to delete their event triggers, ask them in asay or discord to do it themselves or wait 30 minutes. \n \
Only proceed if you are absolutely certain.", "Force Delete", list("Confirm", "Cancel")) == "Confirm")
ET.delete_me = TRUE
qdel(ET)
log_and_message_admins("[src.ckey] tried to delete event trigger [ET.name] while [other_ckey] is active.", src)
log_and_message_admins("[user.ckey] tried to delete event trigger [ET.name] while [other_ckey] is active.", user)
return
var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE)
var/confirm = tgui_alert(user, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE)
if(!confirm || confirm == "Go Back")
return
ET.delete_me = TRUE
qdel(ET)
log_and_message_admins("[src.ckey] tried to deleted event trigger [ET.name], [other_ckey] is either disconnected or inactive.", src)
log_and_message_admins("[user.ckey] tried to deleted event trigger [ET.name], [other_ckey] is either disconnected or inactive.", user)
+9 -19
View File
@@ -3,32 +3,22 @@
//TGUI functionality planned for easier readability, so creating a new file for this
//TGUI functionality will call a datum to handle things separately
/client/proc/getPlayerStatus()
set name = "Report Player Status"
set desc = "Get information on all active players in-game."
set category = "Fun.Event Kit"
if(!check_rights(R_FUN)) return
var/player_list_local = GLOB.player_list //Copying player list so we don't touch a global var all the time
ADMIN_VERB(getPlayerStatus, R_FUN, "Report Player Status", "Get information on all active players in-game.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/list/area_list = list() //An associative list, where key is area name, value is a list of mob references
var/inactives = 0
var/players = 0
//Initializing our working list
for(var/player in player_list_local)
if(!isliving(player)) continue //We only care for living players
var/mob/living/L = player
for(var/mob/living/player in GLOB.player_list)
players += 1
if(L.client.inactivity > INACTIVITY_CAP)
if(player.client.inactivity > INACTIVITY_CAP)
inactives += 1
continue //Anyone who hasn't done anything in 15 minutes is likely too busy
var/area_name = get_area_name(L)
var/area_name = get_area_name(player)
if(area_name in area_list)
area_list[area_name] += L // area_name:list(A,B,C); we add L to (A,B,C)
area_list[area_name] += player // area_name:list(A,B,C); we add player to (A,B,C)
else
area_list[area_name] = list(L)
area_list[area_name] = list(player)
var/message = "#### The Following Players Are Likely Available #### \n"
for(var/cur_area in area_list)
@@ -36,11 +26,11 @@
message += "**** There are currently [LAZYLEN(area_players)] in [cur_area] **** \n"
for(var/mob/living/L in area_players)
message += "[L.name] ([L.key]) at ([L.x];[L.y]) has been inactive for [round(L.client.inactivity / (60 SECONDS))] minutes. \n"
for(var/mob/living/player in area_players)
message += "[player.name] ([player.key]) at ([player.x];[player.y]) has been inactive for [round(player.client.inactivity / (60 SECONDS))] minutes. \n"
message += "#### Over all, there are [players] eligible players, of which [inactives] were hidden due to inactivity. ####"
to_chat(usr, span_notice(message))
to_chat(user, span_notice(message))
#undef INACTIVITY_CAP
+6 -12
View File
@@ -1,20 +1,14 @@
/client/proc/admin_lightning_strike()
set name = "Lightning Strike"
set desc = "Causes lightning to strike on your tile. This can be made to hurt things on or nearby it severely."
set category = "Fun.Do Not"
if(!check_rights(R_FUN))
return
var/result = tgui_alert(src, "Really strike your tile with lightning?", "Confirm Badmin" , list("No", "Yes (Cosmetic)", "Yes (Real)"))
ADMIN_VERB(admin_lightning_strike, R_FUN, "Lightning Strike", "Causes lightning to strike on your tile. This can be made to hurt things on or nearby it severely.", ADMIN_CATEGORY_FUN_DO_NOT)
var/result = tgui_alert(user, "Really strike your tile with lightning?", "Confirm Badmin" , list("No", "Yes (Cosmetic)", "Yes (Real)"))
if(!result || result == "No")
return
var/fake_lightning = result == "Yes (Cosmetic)"
lightning_strike(get_turf(usr), fake_lightning)
log_and_message_admins("has caused [fake_lightning ? "cosmetic":"harmful"] lightning to strike at their position ([src.mob.x], [src.mob.y], [src.mob.z]). \
(<A href='byond://?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[src.mob.x];Y=[src.mob.y];Z=[src.mob.z]'>JMP</a>)", src)
var/mob/user_mob = user.mob
lightning_strike(get_turf(user_mob), fake_lightning)
log_and_message_admins("has caused [fake_lightning ? "cosmetic":"harmful"] lightning to strike at their position ([user_mob.x], [user_mob.y], [user_mob.z]). \
(<A href='byond://?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[user_mob.x];Y=[user_mob.y];Z=[user_mob.z]'>JMP</a>)", user)
#define LIGHTNING_REDIRECT_RANGE 28 // How far in tiles certain things draw lightning from.
#define LIGHTNING_ZAP_RANGE 1 // How far the tesla effect zaps, as well as the bad effects from a direct strike.
+32 -62
View File
@@ -5,14 +5,9 @@
var/list/sounds_cache = list()
/client/proc/play_sound(S as sound)
set category = "Fun.Sounds"
set name = "Play Global Sound"
if(!check_rights(R_SOUNDS))
return
ADMIN_VERB(play_sound, R_SOUNDS, "Play Global Sound", "Plays a sound to all players.", ADMIN_CATEGORY_FUN_SOUNDS, S as sound)
var/freq = 1
var/vol = tgui_input_number(usr, "What volume would you like the sound to play at?",, 100, 100, 1)
var/vol = tgui_input_number(user, "What volume would you like the sound to play at?",, 100, 100, 1)
if(!vol)
return
vol = clamp(vol, 1, 100)
@@ -29,7 +24,7 @@ var/list/sounds_cache = list()
sounds_cache += S
var/res = tgui_alert(usr, "Show the title of this song ([S]) to the players?\nOptions 'Yes' and 'No' will play the sound.",, list("Yes", "No", "Cancel"))
var/res = tgui_alert(user, "Show the title of this song ([S]) to the players?\nOptions 'Yes' and 'No' will play the sound.",, list("Yes", "No", "Cancel"))
if(!res)
return
switch(res)
@@ -38,8 +33,8 @@ var/list/sounds_cache = list()
if("Cancel")
return
log_admin("[key_name(src)] played sound [S]")
message_admins("[key_name_admin(src)] played sound [S]", 1)
log_admin("[key_name(user)] played sound [S]")
message_admins("[key_name_admin(user)] played sound [S]", 1)
for(var/mob/M in GLOB.player_list)
if(M.read_preference(/datum/preference/toggle/play_admin_midis))
@@ -49,70 +44,50 @@ var/list/sounds_cache = list()
feedback_add_details("admin_verb", "Play Global Sound")
/client/proc/play_local_sound(S as sound)
set category = "Fun.Sounds"
set name = "Play Local Sound"
if(!check_rights(R_SOUNDS))
return
log_admin("[key_name(src)] played a local sound [S]")
message_admins("[key_name_admin(src)] played a local sound [S]", 1)
playsound(src.mob, S, 50, 0, 0)
ADMIN_VERB(play_local_sound, R_SOUNDS, "Play Local Sound", "Plays a sound around your own mob.", ADMIN_CATEGORY_FUN_SOUNDS, S as sound)
log_admin("[key_name(user)] played a local sound [S]")
message_admins("[key_name_admin(user)] played a local sound [S]", 1)
playsound(user.mob, S, 50, 0, 0)
feedback_add_details("admin_verb", "Play Local Sound")
/client/proc/play_direct_mob_sound(S as sound, mob/M)
set category = "Fun.Sounds"
set name = "Play Direct Mob Sound"
if(!check_rights(R_SOUNDS))
ADMIN_VERB(play_direct_mob_sound, R_SOUNDS, "Play Direct Mob Sound", "Plays a sound to a single mob.", ADMIN_CATEGORY_FUN_SOUNDS, S as sound)
var/mob/target_mob = tgui_input_list(user, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound", sortNames(GLOB.player_list))
if(QDELETED(target_mob))
return
if(!M)
M = tgui_input_list(usr, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound", sortNames(GLOB.player_list))
if(!M || QDELETED(M))
return
log_admin("[key_name(src)] played a direct mob sound [S] to [M].")
message_admins("[key_name_admin(src)] played a direct mob sound [S] to [ADMIN_LOOKUPFLW(M)].")
SEND_SOUND(M, S)
log_admin("[key_name(user)] played a direct mob sound [S] to [target_mob].")
message_admins("[key_name_admin(user)] played a direct mob sound [S] to [ADMIN_LOOKUPFLW(target_mob)].")
SEND_SOUND(target_mob, S)
feedback_add_details("admin_verb", "Play Direct Mob Sound")
/client/proc/play_z_sound(S as sound)
set category = "Fun.Sounds"
set name = "Play Z Sound"
if(!check_rights(R_SOUNDS)) return
var/target_z = mob.z
ADMIN_VERB(play_z_sound, R_SOUNDS, "Play Z Sound", "Plays a sound to a single z-level.", ADMIN_CATEGORY_FUN_SOUNDS, S as sound)
var/target_z = user.mob.z
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777)
uploaded_sound.priority = 250
sounds_cache += S
if(tgui_alert(usr, "Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request", list("Play","Cancel")) != "Play")
if(tgui_alert(user, "Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request", list("Play","Cancel")) != "Play")
return
log_admin("[key_name(src)] played sound [S] on Z[target_z]")
message_admins("[key_name_admin(src)] played sound [S] on Z[target_z]", 1)
log_admin("[key_name(user)] played sound [S] on Z[target_z]")
message_admins("[key_name_admin(user)] played sound [S] on Z[target_z]", 1)
for(var/mob/M in GLOB.player_list)
if(M.read_preference(/datum/preference/toggle/play_admin_midis) && M.z == target_z)
M << uploaded_sound
feedback_add_details("admin_verb", "Play Z Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/play_server_sound()
set category = "Fun.Sounds"
set name = "Play Server Sound"
if(!check_rights(R_SOUNDS))
return
ADMIN_VERB(play_server_sound, R_SOUNDS, "Play Server Sound", "Plays a sound from the server to play.", ADMIN_CATEGORY_FUN_SOUNDS, S as sound)
var/list/sounds = world.file2list("sound/serversound_list.txt");
sounds += "--CANCEL--"
sounds += sounds_cache
var/melody = tgui_input_list(usr, "Select a sound from the server to play", "Server sound list", sounds, "--CANCEL--")
var/melody = tgui_input_list(user, "Select a sound from the server to play", "Server sound list", sounds, "--CANCEL--")
if(melody == "--CANCEL--")
if(!melody || melody == "--CANCEL--")
return
play_sound(melody)
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/play_sound, melody)
feedback_add_details("admin_verb", "Play Server Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
///Takes an input from either proc/play_web_sound or the request manager and runs it through youtube-dl and prompts the user before playing it to the server.
@@ -214,33 +189,28 @@ var/list/sounds_cache = list()
feedback_add_details("admin_verb", "Play Internet Sound")
/client/proc/play_web_sound()
set category = "Fun.Sounds"
set name = "Play Internet Sound"
if(!check_rights(R_SOUNDS))
return
ADMIN_VERB(play_web_sound, R_SOUNDS, "Play Internet Sound", "Plays a sound from the internet to all players.", ADMIN_CATEGORY_FUN_SOUNDS)
var/ytdl = CONFIG_GET(string/invoke_youtubedl)
if(!ytdl)
to_chat(src, span_boldwarning("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value
to_chat(user, span_boldwarning("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value
return
if(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND))
if(tgui_alert(usr, "Someone else is already playing an Internet sound! It has [DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND), 1)] remaining. \
if(tgui_alert(user, "Someone else is already playing an Internet sound! It has [DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND), 1)] remaining. \
Would you like to override?", "Musicalis Interruptus", list("No","Yes")) != "Yes")
return
var/web_sound_input = tgui_input_text(usr, "Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound", null)
var/web_sound_input = tgui_input_text(user, "Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound", null)
if(length(web_sound_input))
web_sound_input = trim(web_sound_input)
if(findtext(web_sound_input, ":") && !findtext(web_sound_input, GLOB.is_http_protocol))
to_chat(src, span_boldwarning("Non-http(s) URIs are not allowed."), confidential = TRUE)
to_chat(src, span_warning("For youtube-dl shortcuts like ytsearch: please use the appropriate full URL from the website."), confidential = TRUE)
to_chat(user, span_boldwarning("Non-http(s) URIs are not allowed."), confidential = TRUE)
to_chat(user, span_warning("For youtube-dl shortcuts like ytsearch: please use the appropriate full URL from the website."), confidential = TRUE)
return
web_sound(usr, web_sound_input)
web_sound(user.mob, web_sound_input)
else
web_sound(usr, null)
web_sound(user.mob, null)
/client/proc/stop_sounds()
set category = "Debug.Dangerous"