Selectively randomisable characters (#46108)

* Selectively randomisable characters

* it's a list now

* this doesn't work

* it's totally fucking fucked mate big time

* it works

* so sick of this goddamn pull request and yes i know this is a retarded way to do this it didn't work the other way

* anturk forestalls the inevitable suicide

'associative lists are more performant'

* final changes anturk requested

'remove all the "in randomise" and it's ready'
This commit is contained in:
cacogen
2019-09-06 08:50:12 +02:00
committed by AnturK
parent 37c5663b5b
commit 1f010e7144
35 changed files with 378 additions and 309 deletions
@@ -1,29 +1,50 @@
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
if(gender_override)
if(randomise[RANDOM_SPECIES])
random_species()
else if(randomise[RANDOM_NAME])
real_name = pref_species.random_name(gender,1)
if(gender_override && !(randomise[RANDOM_GENDER]))
gender = gender_override
else
gender = pick(MALE,FEMALE)
underwear = random_underwear(gender)
underwear_color = random_short_color()
undershirt = random_undershirt(gender)
socks = random_socks()
skin_tone = random_skin_tone()
hair_style = random_hair_style(gender)
facial_hair_style = random_facial_hair_style(gender)
hair_color = random_short_color()
facial_hair_color = hair_color
eye_color = random_eye_color()
if(randomise[RANDOM_AGE])
age = rand(AGE_MIN,AGE_MAX)
if(randomise[RANDOM_UNDERWEAR])
underwear = random_underwear(gender)
if(randomise[RANDOM_UNDERWEAR_COLOR])
underwear_color = random_short_color()
if(randomise[RANDOM_UNDERSHIRT])
undershirt = random_undershirt(gender)
if(randomise[RANDOM_SOCKS])
socks = random_socks()
if(randomise[RANDOM_BACKPACK])
backpack = random_backpack()
if(randomise[RANDOM_JUMPSUIT_STYLE])
jumpsuit_style = pick(GLOB.jumpsuitlist)
if(randomise[RANDOM_HAIRSTYLE])
hairstyle = random_hairstyle(gender)
if(randomise[RANDOM_FACIAL_HAIRSTYLE])
facial_hairstyle = random_facial_hairstyle(gender)
if(randomise[RANDOM_HAIR_COLOR])
hair_color = random_short_color()
if(randomise[RANDOM_FACIAL_HAIR_COLOR])
facial_hair_color = random_short_color()
if(randomise[RANDOM_SKIN_TONE])
skin_tone = random_skin_tone()
if(randomise[RANDOM_EYE_COLOR])
eye_color = random_eye_color()
if(!pref_species)
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features()
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/random_species()
var/random_species_type = GLOB.species_list[pick(GLOB.roundstart_races)]
pref_species = new random_species_type
if(randomise[RANDOM_NAME])
real_name = pref_species.random_name(gender,1)
/datum/preferences/proc/update_preview_icon()
// Determine what job is marked as 'High' priority, and dress them up as such.
@@ -45,7 +66,7 @@
// Set up the dummy for its photoshoot
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
copy_to(mannequin)
copy_to(mannequin, 1, TRUE, TRUE)
if(previewJob)
mannequin.job = previewJob.title
@@ -53,4 +74,4 @@
COMPILE_OVERLAYS(mannequin)
parent.show_character_previews(new /mutable_appearance(mannequin))
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)