mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
Secrets Panel button: Anonymous Names (and refactors a bit of admin code) (#50478)
* whew * now accepts random names * it compiles * bobbah's review
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=power'>Make all areas powered</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=unpower'>Make all areas unpowered</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=quickpower'>Power all SMES</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=anon_name'>Anonymous Names (needs to be used in the lobby)</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=tripleAI'>Triple AI mode (needs to be used in the lobby)</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=traitor_all'>Everyone is the traitor</A><BR>
|
||||
<A href='?src=[REF(src)];[HrefToken()];secrets=guns'>Summon Guns</A><BR>
|
||||
@@ -304,6 +305,12 @@
|
||||
var/mob/living/carbon/human/H = i
|
||||
H.set_species(newtype)
|
||||
|
||||
if("anon_name")
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
usr.client.anon_names()
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Anonymous Names"))
|
||||
|
||||
if("tripleAI")
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/client/proc/anon_names()
|
||||
set category = "Admin - Events"
|
||||
set name = "Setup Anonymous Names"
|
||||
|
||||
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "This option is currently only usable during pregame.")
|
||||
return
|
||||
|
||||
if(SSticker.anonymousnames)
|
||||
SSticker.anonymousnames = ANON_DISABLED
|
||||
to_chat(usr, "Disabled anonymous names.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has disabled anonymous names.</span>")
|
||||
return
|
||||
var/list/names = list("Cancel", ANON_RANDOMNAMES, ANON_EMPLOYEENAMES)
|
||||
var/result = input(usr, "Choose an anonymous theme","going dark") as null|anything in names
|
||||
if(!usr || !result || result == "Cancel")
|
||||
return
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "You took too long! The game has started.")
|
||||
return
|
||||
|
||||
SSticker.anonymousnames = result
|
||||
to_chat(usr, "Enabled anonymous names. THEME: [SSticker.anonymousnames].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has enabled anonymous names. THEME: [SSticker.anonymousnames].</span>")
|
||||
|
||||
/**
|
||||
* anonymous_name: generates a corporate random name. used in admin event tool anonymous names
|
||||
*
|
||||
* first letter is always a letter
|
||||
* Example name = "Employee Q5460Z"
|
||||
* Arguments:
|
||||
* * M - mob for preferences and gender
|
||||
*/
|
||||
/proc/anonymous_name(mob/M)
|
||||
switch(SSticker.anonymousnames)
|
||||
if(ANON_RANDOMNAMES)
|
||||
return M.client.prefs.pref_species.random_name(M.gender,1)
|
||||
if(ANON_EMPLOYEENAMES)
|
||||
var/name = "Employee "
|
||||
|
||||
for(var/i in 1 to 6)
|
||||
if(prob(30) || i == 1)
|
||||
name += ascii2text(rand(65, 90)) //A - Z
|
||||
else
|
||||
name += ascii2text(rand(48, 57)) //0 - 9
|
||||
return name
|
||||
|
||||
/**
|
||||
* anonymous_ai_name: generates a corporate random name (but for sillycones). used in admin event tool anonymous names
|
||||
*
|
||||
* first letter is always a letter
|
||||
* Example name = "Employee Assistant Assuming Delta"
|
||||
* Arguments:
|
||||
* * is_ai - boolean to decide whether the name has "Core" (AI) or "Assistant" (Cyborg)
|
||||
*/
|
||||
/proc/anonymous_ai_name(is_ai = FALSE)
|
||||
switch(SSticker.anonymousnames)
|
||||
if(ANON_RANDOMNAMES)
|
||||
return pick(GLOB.ai_names)
|
||||
if(ANON_EMPLOYEENAMES)
|
||||
var/verbs = capitalize(pick(GLOB.ing_verbs))
|
||||
var/phonetic = pick(GLOB.phonetic_alphabet)
|
||||
|
||||
return "Employee [is_ai ? "Core" : "Assistant"] [verbs] [phonetic]"
|
||||
@@ -1,20 +1,15 @@
|
||||
/client/proc/triple_ai()
|
||||
set category = "Admin - Events"
|
||||
set name = "Create AI Triumvirate"
|
||||
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.", confidential = TRUE)
|
||||
return
|
||||
|
||||
var/datum/job/job = SSjob.GetJob("AI")
|
||||
if(!job)
|
||||
to_chat(usr, "Unable to locate the AI job", confidential = TRUE)
|
||||
return
|
||||
if(SSticker.triai)
|
||||
SSticker.triai = 0
|
||||
to_chat(usr, "Only one AI will be spawned at round start.", confidential = TRUE)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>")
|
||||
else
|
||||
SSticker.triai = 1
|
||||
to_chat(usr, "There will be an AI Triumvirate at round start.", confidential = TRUE)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>")
|
||||
/client/proc/triple_ai()
|
||||
set category = "Admin - Events"
|
||||
set name = "Toggle AI Triumvirate"
|
||||
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.", confidential = TRUE)
|
||||
return
|
||||
|
||||
var/datum/job/job = SSjob.GetJob("AI")
|
||||
if(!job)
|
||||
to_chat(usr, "Unable to locate the AI job", confidential = TRUE)
|
||||
return
|
||||
SSticker.triai = !SSticker.triai
|
||||
to_chat(usr, "There will [SSticker.triai ? "" : "not"] be an AI Triumvirate at round start.")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has toggled [SSticker.triai ? "on" : "off"] triple AIs at round start.</span>")
|
||||
|
||||
Reference in New Issue
Block a user