Adds random character when antagonist preference (#46952)

About The Pull Request

Well known statics rejoice! You can now choose to have random name/body/age/gender whenever you roll roundstart antagonist.

Since player mobs are generated before antag datums are handed out, I added a list that collects minds chosen as antags during pre_setup() to keep track of this.

"Other" was also missing from the random gender, added it.

Wizard, clown op, nukeop, latejoin and midround antags are excempt.
Why It's Good For The Game

Some static namers get metagamed to the extreme when antagonists, this should help alleviate that while allowing them to keep static naming for the RP. Keep in mind all conversion, midround and latejoin antag rolls are excempt, this is not a guarantee someone is a non-antag.
Changelog

cl Skoglol
add: Random name/body/age/gender when roundstart antagonist preference added.
add: Random gender will now have a chance of picking "Other".
/cl
This commit is contained in:
skoglol
2019-10-13 06:00:17 +02:00
committed by oranges
parent 6628f692aa
commit b68abe7e6d
15 changed files with 93 additions and 29 deletions
+21 -9
View File
@@ -48,6 +48,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/uses_glasses_colour = 0
//character preferences
var/slot_randomized //keeps track of round-to-round randomization of the character slot, prevents overwriting
var/real_name //our character's name
var/gender = MALE //gender of character (well duh)
var/age = 30 //age of character
@@ -137,6 +138,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/datum/preferences/proc/ShowChoices(mob/user)
if(!user || !user.client)
return
if(slot_randomized)
load_character(default_slot) // Reloads the character slot. Prevents random features from overwriting the slot if saved.
slot_randomized = FALSE
update_preview_icon()
var/list/dat = list("<center>")
@@ -182,8 +186,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(is_banned_from(user.ckey, "Appearance"))
dat += "<b>You are banned from using custom names and appearances. You can continue to adjust your characters, but you will be randomised once you join the game.</b><br>"
dat += "<a href='?_src_=prefs;preference=name;task=random'>Random Name</A> "
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_NAME]'>Always Random Name: [(randomise[RANDOM_NAME]) ? "Yes" : "No"]</a><BR>"
dat += "<b>Name:</b> "
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_NAME]'>Always Random Name: [(randomise[RANDOM_NAME]) ? "Yes" : "No"]</a>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_NAME_ANTAG]'>When Antagonist: [(randomise[RANDOM_NAME_ANTAG]) ? "Yes" : "No"]</a>"
dat += "<br><b>Name:</b> "
dat += "<a href='?_src_=prefs;preference=name;task=input'>[real_name]</a><BR>"
if(!(AGENDER in pref_species.species_traits))
@@ -195,10 +200,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else
dispGender = "Other"
dat += "<b>Gender:</b> <a href='?_src_=prefs;preference=gender'>[dispGender]</a>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_GENDER]'>Always Random Gender: [(randomise[RANDOM_GENDER]) ? "Yes" : "No"]</A>"
if(randomise[RANDOM_BODY] || randomise[RANDOM_BODY_ANTAG]) //doesn't work unless random body
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_GENDER]'>Always Random Gender: [(randomise[RANDOM_GENDER]) ? "Yes" : "No"]</A>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_GENDER_ANTAG]'>When Antagonist: [(randomise[RANDOM_GENDER_ANTAG]) ? "Yes" : "No"]</A>"
dat += "<br><b>Age:</b> <a href='?_src_=prefs;preference=age;task=input'>[age]</a>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_AGE]'>Always Random Age: [(randomise[RANDOM_AGE]) ? "Yes" : "No"]</A>"
if(randomise[RANDOM_BODY] || randomise[RANDOM_BODY_ANTAG]) //doesn't work unless random body
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_AGE]'>Always Random Age: [(randomise[RANDOM_AGE]) ? "Yes" : "No"]</A>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_AGE_ANTAG]'>When Antagonist: [(randomise[RANDOM_AGE_ANTAG]) ? "Yes" : "No"]</A>"
dat += "<br><br><b>Special Names:</b><BR>"
var/old_group
@@ -220,7 +229,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<h2>Body</h2>"
dat += "<a href='?_src_=prefs;preference=all;task=random'>Random Body</A> "
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_BODY]'>Always Random Body: [(randomise[RANDOM_BODY]) ? "Yes" : "No"]</A><br>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_BODY]'>Always Random Body: [(randomise[RANDOM_BODY]) ? "Yes" : "No"]</A>"
dat += "<a href='?_src_=prefs;preference=toggle_random;random_type=[RANDOM_BODY_ANTAG]'>When Antagonist: [(randomise[RANDOM_BODY_ANTAG]) ? "Yes" : "No"]</A><br>"
dat += "<table width='100%'><tr><td width='24%' valign='top'>"
@@ -1561,15 +1571,17 @@ GLOBAL_LIST_EMPTY(preferences_datums)
ShowChoices(user)
return 1
/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE, character_setup = FALSE)
/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE, character_setup = FALSE, antagonist = FALSE)
if(randomise[RANDOM_SPECIES] && !character_setup)
random_species()
if(randomise[RANDOM_BODY] && !character_setup)
random_character(gender)
if((randomise[RANDOM_BODY] || randomise[RANDOM_BODY_ANTAG] && antagonist) && !character_setup)
slot_randomized = TRUE
random_character(gender, antagonist)
if(randomise[RANDOM_NAME] && !character_setup)
if((randomise[RANDOM_NAME] || randomise[RANDOM_NAME_ANTAG] && antagonist) && !character_setup)
slot_randomized = TRUE
real_name = pref_species.random_name(gender)
if(roundstart_checks)