Fixes being able to have alien species hair on humans or other species.

This commit is contained in:
Erthilo
2013-08-20 10:37:05 +01:00
parent 97a8347e6b
commit de6eb16e1a
3 changed files with 39 additions and 12 deletions

View File

@@ -1,14 +1,41 @@
proc/random_hair_style(gender, species = "Human")
switch(gender)
if(MALE) return pick(hair_styles_male_list)
if(FEMALE) return pick(hair_styles_female_list)
else return pick(hair_styles_list)
var/h_style = "Bald"
var/list/valid_hairstyles = list()
for(var/hairstyle in hair_styles_list)
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue
if( !(species in S.species_allowed))
continue
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
if(valid_hairstyles.len)
h_style = pick(valid_hairstyles)
return h_style
proc/random_facial_hair_style(gender, species = "Human")
switch(gender)
if(MALE) return pick(facial_hair_styles_male_list)
if(FEMALE) return pick(facial_hair_styles_female_list)
else return pick(facial_hair_styles_list)
var/f_style = "Shaved"
var/list/valid_facialhairstyles = list()
for(var/facialhairstyle in facial_hair_styles_list)
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
if(gender == MALE && S.gender == FEMALE)
continue
if(gender == FEMALE && S.gender == MALE)
continue
if( !(species in S.species_allowed))
continue
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
if(valid_facialhairstyles.len)
f_style = pick(valid_facialhairstyles)
return f_style
proc/random_name(gender, species = "Human")
if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))

View File

@@ -764,13 +764,13 @@ datum/preferences
g_hair = rand(0,255)
b_hair = rand(0,255)
if("h_style")
h_style = random_hair_style(gender)
h_style = random_hair_style(gender, species)
if("facial")
r_facial = rand(0,255)
g_facial = rand(0,255)
b_facial = rand(0,255)
if("f_style")
f_style = random_facial_hair_style(gender)
f_style = random_facial_hair_style(gender, species)
if("underwear")
underwear = rand(1,underwear_m.len)
ShowChoices(user)

View File

@@ -7,8 +7,8 @@ datum/preferences
else
gender = FEMALE
s_tone = random_skin_tone()
h_style = random_hair_style(gender)
f_style = random_facial_hair_style(gender)
h_style = random_hair_style(gender, species)
f_style = random_facial_hair_style(gender, species)
randomize_hair_color("hair")
randomize_hair_color("facial")
randomize_eyes_color()