Fixed randomised appearances being batshit crazy.

Improved the janicart a bit. It should be less cursed now.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5264 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-12-05 22:27:16 +00:00
parent 1f504fe2e5
commit 3ac67f339a
4 changed files with 126 additions and 34 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ proc/random_name(gender)
else return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
proc/random_skin_tone()
switch(pick(55;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino", 5;"weird"))
switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino"))
if("caucasian") . = -10
if("afroamerican") . = -115
if("african") . = -165
+3 -1
View File
@@ -45,10 +45,12 @@
mybag.loc = get_turf(user)
user.put_in_hands(mybag)
mybag = null
else
..()
/obj/structure/stool/bed/chair/janicart/relaymove(mob/user, direction)
if(user.stat || user.stunned)
if(user.stat || user.stunned || user.weakened || user.paralysis)
unbuckle()
if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key))
step(src, direction)
+1 -17
View File
@@ -446,23 +446,7 @@ datum/preferences
if("bag")
backbag = rand(1,3)
if("all")
gender = pick(MALE,FEMALE)
real_name = random_name(gender)
age = rand(AGE_MIN,AGE_MAX)
underwear = rand(1,12)
backbag = rand(1,3)
r_hair = rand(0,255)
g_hair = rand(0,255)
b_hair = rand(0,255)
r_facial = r_hair
g_facial = g_hair
b_facial = b_hair
r_eyes = rand(0,255)
g_eyes = rand(0,255)
b_eyes = rand(0,255)
h_style = random_hair_style(gender)
f_style = random_facial_hair_style(gender)
s_tone = random_skin_tone()
randomize_appearance_for() //no params needed
if("input")
switch(href_list["preference"])
+121 -15
View File
@@ -1,26 +1,132 @@
datum/preferences
//The mob should have a gender you want before running this proc.
//The mob should have a gender you want before running this proc. Will run fine without H
proc/randomize_appearance_for(var/mob/living/carbon/human/H)
if(H.gender == MALE)
gender = MALE
else
gender = FEMALE
if(H)
if(H.gender == MALE)
gender = MALE
else
gender = FEMALE
s_tone = random_skin_tone()
h_style = random_hair_style(gender)
f_style = random_facial_hair_style(gender)
r_hair = rand(0,255)
g_hair = rand(0,255)
b_hair = rand(0,255)
r_facial = r_hair
g_facial = g_hair
b_facial = b_hair
r_eyes = rand(0,255)
g_eyes = rand(0,255)
b_eyes = rand(0,255)
randomize_hair_color("hair")
randomize_hair_color("facial")
randomize_eyes_color()
underwear = rand(1,underwear_m.len)
backbag = 2
age = rand(AGE_MIN,AGE_MAX)
copy_to(H,1)
if(H)
copy_to(H,1)
proc/randomize_hair_color(var/target = "hair")
if(prob (75) && target == "facial") // Chance to inherit hair color
r_facial = r_hair
g_facial = g_hair
b_facial = b_hair
return
var/red
var/green
var/blue
var/col = pick ("blonde", "black", "chestnut", "copper", "brown", "wheat", "old", "punk")
switch(col)
if("blonde")
red = 255
green = 255
blue = 0
if("black")
red = 0
green = 0
blue = 0
if("chestnut")
red = 153
green = 102
blue = 51
if("copper")
red = 255
green = 153
blue = 0
if("brown")
red = 102
green = 51
blue = 0
if("wheat")
red = 255
green = 255
blue = 153
if("old")
red = rand (100, 255)
green = red
blue = red
if("punk")
red = rand (0, 255)
green = rand (0, 255)
blue = rand (0, 255)
red = max(min(red + rand (-25, 25), 255), 0)
green = max(min(green + rand (-25, 25), 255), 0)
blue = max(min(blue + rand (-25, 25), 255), 0)
switch(target)
if("hair")
r_hair = red
g_hair = green
b_hair = blue
if("facial")
r_facial = red
g_facial = green
b_facial = blue
proc/randomize_eyes_color()
var/red
var/green
var/blue
var/col = pick ("black", "grey", "brown", "chestnut", "blue", "lightblue", "green", "albino")
switch(col)
if("black")
red = 0
green = 0
blue = 0
if("grey")
red = rand (100, 200)
green = red
blue = red
if("brown")
red = 102
green = 51
blue = 0
if("chestnut")
red = 153
green = 102
blue = 0
if("blue")
red = 51
green = 102
blue = 204
if("lightblue")
red = 102
green = 204
blue = 255
if("green")
red = 0
green = 102
blue = 0
if("albino")
red = rand (200, 255)
green = rand (0, 150)
blue = rand (0, 150)
red = max(min(red + rand (-25, 25), 255), 0)
green = max(min(green + rand (-25, 25), 255), 0)
blue = max(min(blue + rand (-25, 25), 255), 0)
r_eyes = red
g_eyes = green
b_eyes = blue
proc/update_preview_icon() //seriously. This is horrendous.
del(preview_icon_front)