diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm
index e7966690a8e..61bc32d378e 100644
--- a/code/__DEFINES/flags.dm
+++ b/code/__DEFINES/flags.dm
@@ -62,6 +62,7 @@
#define HAS_HEAD_MARKINGS 512
#define HAS_BODY_MARKINGS 1024
#define HAS_TAIL_MARKINGS 2048
+#define HAS_MARKINGS HAS_HEAD_MARKINGS|HAS_BODY_MARKINGS|HAS_TAIL_MARKINGS
#define TAIL_WAGGING 4096
#define NO_EYES 8192
#define HAS_FUR 16384
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index 5c11daabdba..2f551752ef7 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -401,23 +401,6 @@
mobs_found += M
return mobs_found
-/proc/GetRedPart(const/hexa)
- return hex2num(copytext(hexa,2,4))
-
-/proc/GetGreenPart(const/hexa)
- return hex2num(copytext(hexa,4,6))
-
-/proc/GetBluePart(const/hexa)
- return hex2num(copytext(hexa,6,8))
-
-/proc/GetHexColors(const/hexa)
- return list(
- GetRedPart(hexa),
- GetGreenPart(hexa),
- GetBluePart(hexa)
- )
-
-
/proc/alone_in_area(var/area/the_area, var/mob/must_be_alone, var/check_type = /mob/living/carbon)
var/area/our_area = get_area_master(the_area)
for(var/C in living_mob_list)
diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index 889a0824f35..f7a38cce758 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -1,3 +1,15 @@
+proc/GetOppositeDir(var/dir)
+ switch(dir)
+ if(NORTH) return SOUTH
+ if(SOUTH) return NORTH
+ if(EAST) return WEST
+ if(WEST) return EAST
+ if(SOUTHWEST) return NORTHEAST
+ if(NORTHWEST) return SOUTHEAST
+ if(NORTHEAST) return SOUTHWEST
+ if(SOUTHEAST) return NORTHWEST
+ return 0
+
proc/random_underwear(gender, species = "Human")
var/list/pick_list = list()
switch(gender)
@@ -34,57 +46,140 @@ proc/pick_species_allowed_underwear(list/all_picks, species)
return pick(valid_picks)
-proc/random_hair_style(var/gender, species = "Human")
+proc/random_hair_style(var/gender, species = "Human", var/robot_head)
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((gender == MALE && S.gender == FEMALE) || (gender == FEMALE && S.gender == MALE))
+ continue
+ if(species == "Machine") //If the user is a species who can have a robotic head...
+ var/datum/robolimb/robohead = all_robolimbs["[!robot_head ? "Morpheus Cyberkinetics" : robot_head]"]
+ if(species in S.species_allowed) //If this is a facial hair style native to the user's species...
+ if(robohead.is_monitor && (robohead.company in S.models_allowed)) //Check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
+ valid_hairstyles += hairstyle //Give them their hairstyles if they do.
+ continue
+ else //If they don't have the default head, they shouldn't be getting any hairstyles they wouldn't normally.
+ continue
+ else
+ if(robohead.is_monitor) //If the hairstyle is not native to the user's species and they're using a head with an ipc-style screen, don't let them access it.
+ continue
+ else
+ if("Human" in S.species_allowed) //If the user has a robotic humanoid head and the hairstyle can fit humans, let them use it as a wig.
+ valid_hairstyles += hairstyle
+ continue
+ else //If the user is not a species who can have robotic heads, use the default handling.
+ if(!(species in S.species_allowed)) //If the user's head is not of a species the hairstyle allows, skip it. Otherwise, add it to the list.
+ continue
+ valid_hairstyles += hairstyle
if(valid_hairstyles.len)
h_style = pick(valid_hairstyles)
- return h_style
+ return h_style
-proc/GetOppositeDir(var/dir)
- switch(dir)
- if(NORTH) return SOUTH
- if(SOUTH) return NORTH
- if(EAST) return WEST
- if(WEST) return EAST
- if(SOUTHWEST) return NORTHEAST
- if(NORTHWEST) return SOUTHEAST
- if(NORTHEAST) return SOUTHWEST
- if(SOUTHEAST) return NORTHWEST
- return 0
-
-proc/random_facial_hair_style(var/gender, species = "Human")
+proc/random_facial_hair_style(var/gender, species = "Human", var/robot_head)
var/f_style = "Shaved"
-
- var/list/valid_facialhairstyles = list()
+ var/list/valid_facial_hairstyles = 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((gender == MALE && S.gender == FEMALE) || (gender == FEMALE && S.gender == MALE))
+ continue
+ if(species == "Machine") //If the user is a species who can have a robotic head...
+ var/datum/robolimb/robohead = all_robolimbs["[!robot_head ? "Morpheus Cyberkinetics" : robot_head]"]
+ if(species in S.species_allowed) //If this is a facial hair style native to the user's species...
+ if(robohead.is_monitor && (robohead.company in S.models_allowed)) //Check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
+ valid_facial_hairstyles += facialhairstyle //Give them their facial hair styles if they do.
+ continue
+ else //If they don't have the default head, they shouldn't be getting any facial hair styles they wouldn't normally.
+ continue
+ else
+ if(robohead.is_monitor) //If the facial hair style is not native to the user's species and they're using a head with an ipc-style screen, don't let them access it.
+ continue
+ else
+ if("Human" in S.species_allowed) //If the user has a robotic humanoid head and the facial hair style can fit humans, let them use it as a postiche.
+ valid_facial_hairstyles += facialhairstyle
+ continue
+ else //If the user is not a species who can have robotic heads, use the default handling.
+ if(!(species in S.species_allowed)) //If the user's head is not of a species the facial hair style allows, skip it. Otherwise, add it to the list.
+ continue
+ valid_facial_hairstyles += facialhairstyle
- if(valid_facialhairstyles.len)
- f_style = pick(valid_facialhairstyles)
+ if(valid_facial_hairstyles.len)
+ f_style = pick(valid_facial_hairstyles)
- return f_style
+ return f_style
+
+proc/random_head_accessory(species = "Human")
+ var/ha_style = "None"
+ var/list/valid_head_accessories = list()
+ for(var/head_accessory in head_accessory_styles_list)
+ var/datum/sprite_accessory/S = head_accessory_styles_list[head_accessory]
+
+ if(!(species in S.species_allowed))
+ continue
+ valid_head_accessories += head_accessory
+
+ if(valid_head_accessories.len)
+ ha_style = pick(valid_head_accessories)
+
+ return ha_style
+
+proc/random_marking_style(var/location = "body", species = "Human", var/robot_head, var/body_accessory, var/alt_head)
+ var/m_style = "None"
+ var/list/valid_markings = list()
+ for(var/marking in marking_styles_list)
+ var/datum/sprite_accessory/body_markings/S = marking_styles_list[marking]
+ if(S.name == "None")
+ valid_markings += marking
+ continue
+ if(S.marking_location != location) //If the marking isn't for the location we desire, skip.
+ continue
+ if(!(species in S.species_allowed)) //If the user's head is not of a species the marking style allows, skip it. Otherwise, add it to the list.
+ continue
+ if(location == "tail")
+ if(!body_accessory)
+ if(S.tails_allowed)
+ continue
+ else
+ if(!S.tails_allowed || !(body_accessory in S.tails_allowed))
+ continue
+ if(location == "head")
+ var/datum/sprite_accessory/body_markings/head/M = marking_styles_list[S.name]
+ if(species == "Machine")//If the user is a species that can have a robotic head...
+ var/datum/robolimb/robohead = all_robolimbs[robot_head]
+ if(!(S.models_allowed && (robohead.company in S.models_allowed))) //Make sure they don't get markings incompatible with their head.
+ continue
+ else if(alt_head && alt_head != "None") //If the user's got an alt head, validate markings for that head.
+ if(!(alt_head in M.heads_allowed))
+ continue
+ else
+ if(M.heads_allowed)
+ continue
+ valid_markings += marking
+
+ if(valid_markings.len)
+ m_style = pick(valid_markings)
+
+ return m_style
+
+proc/random_body_accessory(species = "Vulpkanin")
+ var/body_accessory = null
+ var/list/valid_body_accessories = list()
+ for(var/B in body_accessory_by_name)
+ var/datum/body_accessory/A = body_accessory_by_name[B]
+ if(!istype(A))
+ valid_body_accessories += "None" //The only null entry should be the "None" option.
+ continue
+ if(species in A.allowed_species) //If the user is not of a species the body accessory style allows, skip it. Otherwise, add it to the list.
+ valid_body_accessories += B
+
+ if(valid_body_accessories.len)
+ body_accessory = pick(valid_body_accessories)
+
+ return body_accessory
proc/random_name(gender, species = "Human")
@@ -301,7 +396,7 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
var/mob/living/L = M
var/status
switch(M.stat)
- if(CONSCIOUS)
+ if(CONSCIOUS)
status = "Alive"
if(UNCONSCIOUS)
status = "Unconscious"
diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm
index 005ef4c2fc9..fac97347e80 100644
--- a/code/__HELPERS/type2type.dm
+++ b/code/__HELPERS/type2type.dm
@@ -10,7 +10,7 @@
//Returns an integer given a hex input
/proc/hex2num(hex)
- if(!( istext(hex) ))
+ if(!(istext(hex)))
return
var/num = 0
@@ -59,6 +59,27 @@
hex = "0[hex]"
return hex || "0"
+//Returns an integer value for R of R/G/B given a hex color input.
+/proc/color2R(hex)
+ if(!(istext(hex)))
+ return
+
+ return hex2num(copytext(hex, 2, 4)) //Returning R
+
+//Returns an integer value for G of R/G/B given a hex color input.
+/proc/color2G(hex)
+ if(!(istext(hex)))
+ return
+
+ return hex2num(copytext(hex, 4, 6)) //Returning G
+
+//Returns an integer value for B of R/G/B given a hex color input.
+/proc/color2B(hex)
+ if(!(istext(hex)))
+ return
+
+ return hex2num(copytext(hex, 6, 8)) //Returning B
+
/proc/text2numlist(text, delimiter="\n")
var/list/num_list = list()
for(var/x in splittext(text, delimiter))
diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm
index ea1a82fc6fd..fed9072e970 100644
--- a/code/datums/datacore.dm
+++ b/code/datums/datacore.dm
@@ -222,21 +222,19 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
//Markings
if((H.species.bodyflags & HAS_HEAD_MARKINGS) || (H.species.bodyflags & HAS_BODY_MARKINGS))
- var/list/marking_styles = params2list(H.m_styles)
- var/list/marking_colours = params2list(H.m_colours)
if(H.species.bodyflags & HAS_BODY_MARKINGS) //Body markings.
- var/body_marking = marking_styles["body"]
+ var/body_marking = H.m_styles["body"]
var/datum/sprite_accessory/body_marking_style = marking_styles_list[body_marking]
if(body_marking_style && body_marking_style.species_allowed)
var/icon/b_marking_s = new/icon("icon" = body_marking_style.icon, "icon_state" = "[body_marking_style.icon_state]_s")
- b_marking_s.Blend(rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8))), ICON_ADD)
+ b_marking_s.Blend(H.m_colours["body"], ICON_ADD)
face_s.Blend(b_marking_s, ICON_OVERLAY)
if(H.species.bodyflags & HAS_HEAD_MARKINGS) //Head markings.
- var/head_marking = marking_styles["head"]
+ var/head_marking = H.m_styles["head"]
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
if(head_marking_style && head_marking_style.species_allowed)
var/icon/h_marking_s = new/icon("icon" = head_marking_style.icon, "icon_state" = "[head_marking_style.icon_state]_s")
- h_marking_s.Blend(rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8))), ICON_ADD)
+ h_marking_s.Blend(H.m_colours["head"], ICON_ADD)
face_s.Blend(h_marking_s, ICON_OVERLAY)
preview_icon.Blend(face_s, ICON_OVERLAY)
diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm
index 114fcb1598f..8aa368eedcb 100644
--- a/code/game/dna/dna2.dm
+++ b/code/game/dna/dna2.dm
@@ -163,15 +163,11 @@ var/global/list/bad_blocks[0]
// Markings
if(!character.m_styles)
- character.m_styles = "head=None;\
- body=None;\
- tail=None"
+ character.m_styles = initial(character.m_styles)
- var/list/marking_styles = params2list(character.m_styles)
- var/list/marking_colours = params2list(character.m_colours)
- var/head_marks = marking_styles_list.Find(marking_styles["head"])
- var/body_marks = marking_styles_list.Find(marking_styles["body"])
- var/tail_marks = marking_styles_list.Find(marking_styles["tail"])
+ var/head_marks = marking_styles_list.Find(character.m_styles["head"])
+ var/body_marks = marking_styles_list.Find(character.m_styles["body"])
+ var/tail_marks = marking_styles_list.Find(character.m_styles["tail"])
SetUIValueRange(DNA_UI_HAIR_R, H.r_hair, 255, 1)
SetUIValueRange(DNA_UI_HAIR_G, H.g_hair, 255, 1)
@@ -193,17 +189,17 @@ var/global/list/bad_blocks[0]
SetUIValueRange(DNA_UI_HACC_G, H.g_headacc, 255, 1)
SetUIValueRange(DNA_UI_HACC_B, H.b_headacc, 255, 1)
- SetUIValueRange(DNA_UI_HEAD_MARK_R, hex2num(copytext(marking_colours["head"], 2, 4)), 255, 1)
- SetUIValueRange(DNA_UI_HEAD_MARK_G, hex2num(copytext(marking_colours["head"], 4, 6)), 255, 1)
- SetUIValueRange(DNA_UI_HEAD_MARK_B, hex2num(copytext(marking_colours["head"], 6, 8)), 255, 1)
+ SetUIValueRange(DNA_UI_HEAD_MARK_R, color2R(character.m_colours["head"]), 255, 1)
+ SetUIValueRange(DNA_UI_HEAD_MARK_G, color2G(character.m_colours["head"]), 255, 1)
+ SetUIValueRange(DNA_UI_HEAD_MARK_B, color2B(character.m_colours["head"]), 255, 1)
- SetUIValueRange(DNA_UI_BODY_MARK_R, hex2num(copytext(marking_colours["body"], 2, 4)), 255, 1)
- SetUIValueRange(DNA_UI_BODY_MARK_G, hex2num(copytext(marking_colours["body"], 4, 6)), 255, 1)
- SetUIValueRange(DNA_UI_BODY_MARK_B, hex2num(copytext(marking_colours["body"], 6, 8)), 255, 1)
+ SetUIValueRange(DNA_UI_BODY_MARK_R, color2R(character.m_colours["body"]), 255, 1)
+ SetUIValueRange(DNA_UI_BODY_MARK_G, color2G(character.m_colours["body"]), 255, 1)
+ SetUIValueRange(DNA_UI_BODY_MARK_B, color2B(character.m_colours["body"]), 255, 1)
- SetUIValueRange(DNA_UI_TAIL_MARK_R, hex2num(copytext(marking_colours["tail"], 2, 4)), 255, 1)
- SetUIValueRange(DNA_UI_TAIL_MARK_G, hex2num(copytext(marking_colours["tail"], 4, 6)), 255, 1)
- SetUIValueRange(DNA_UI_TAIL_MARK_B, hex2num(copytext(marking_colours["tail"], 6, 8)), 255, 1)
+ SetUIValueRange(DNA_UI_TAIL_MARK_R, color2R(character.m_colours["tail"]), 255, 1)
+ SetUIValueRange(DNA_UI_TAIL_MARK_G, color2G(character.m_colours["tail"]), 255, 1)
+ SetUIValueRange(DNA_UI_TAIL_MARK_B, color2B(character.m_colours["tail"]), 255, 1)
SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative.
diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm
index 9b0bd39dc9a..4e07171dfec 100644
--- a/code/game/dna/dna2_helpers.dm
+++ b/code/game/dna/dna2_helpers.dm
@@ -152,10 +152,9 @@
head_organ.g_headacc = dna.GetUIValueRange(DNA_UI_HACC_G, 255)
head_organ.b_headacc = dna.GetUIValueRange(DNA_UI_HACC_B, 255)
- var/list/marking_colours = params2list(H.m_colours)
- marking_colours["head"] = "#[num2hex(dna.GetUIValueRange(DNA_UI_HEAD_MARK_R,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_HEAD_MARK_G,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_HEAD_MARK_B,255),2)]"
- marking_colours["body"] = "#[num2hex(dna.GetUIValueRange(DNA_UI_BODY_MARK_R,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_BODY_MARK_G,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_BODY_MARK_B,255),2)]"
- marking_colours["tail"] = "#[num2hex(dna.GetUIValueRange(DNA_UI_TAIL_MARK_R,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_TAIL_MARK_G,255),2)][num2hex(dna.GetUIValueRange(DNA_UI_TAIL_MARK_B,255),2)]"
+ H.m_colours["head"] = rgb(dna.GetUIValueRange(DNA_UI_HEAD_MARK_R, 255), dna.GetUIValueRange(DNA_UI_HEAD_MARK_G, 255), dna.GetUIValueRange(DNA_UI_HEAD_MARK_B, 255))
+ H.m_colours["body"] = rgb(dna.GetUIValueRange(DNA_UI_BODY_MARK_R, 255), dna.GetUIValueRange(DNA_UI_BODY_MARK_G, 255), dna.GetUIValueRange(DNA_UI_BODY_MARK_B, 255))
+ H.m_colours["tail"] = rgb(dna.GetUIValueRange(DNA_UI_TAIL_MARK_R, 255), dna.GetUIValueRange(DNA_UI_TAIL_MARK_G, 255), dna.GetUIValueRange(DNA_UI_TAIL_MARK_B, 255))
H.update_eyes()
@@ -167,18 +166,18 @@
H.change_gender(MALE, 0)
//Hair
- var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE,hair_styles_list.len)
- if((0 < hair) && (hair <= hair_styles_list.len))
+ var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE, hair_styles_list.len)
+ if((hair > 0) && (hair <= hair_styles_list.len))
head_organ.h_style = hair_styles_list[hair]
//Facial Hair
- var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE,facial_hair_styles_list.len)
- if((0 < beard) && (beard <= facial_hair_styles_list.len))
+ var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE, facial_hair_styles_list.len)
+ if((beard > 0) && (beard <= facial_hair_styles_list.len))
head_organ.f_style = facial_hair_styles_list[beard]
//Head Accessories
- var/headacc = dna.GetUIValueRange(DNA_UI_HACC_STYLE,head_accessory_styles_list.len)
- if((0 < headacc) && (headacc <= head_accessory_styles_list.len))
+ var/headacc = dna.GetUIValueRange(DNA_UI_HACC_STYLE, head_accessory_styles_list.len)
+ if((headacc > 0) && (headacc <= head_accessory_styles_list.len))
head_organ.ha_style = head_accessory_styles_list[headacc]
var/number_head_marks = 0
@@ -194,23 +193,17 @@
number_tail_marks++
//Head Markings
- var/head_marks = dna.GetUIValueRange(DNA_UI_HEAD_MARK_STYLE,marking_styles_list.len)
- if((0 < head_marks) && (head_marks <= number_head_marks))
- var/list/marking_styles = params2list(H.m_styles)
- marking_styles["head"] = marking_styles_list[head_marks]
- H.m_styles = list2params(marking_styles)
+ var/head_marks = dna.GetUIValueRange(DNA_UI_HEAD_MARK_STYLE, marking_styles_list.len)
+ if((head_marks > 0) && (head_marks <= number_head_marks))
+ H.m_styles["head"] = marking_styles_list[head_marks]
//Body Markings
- var/body_marks = dna.GetUIValueRange(DNA_UI_BODY_MARK_STYLE,marking_styles_list.len)
- if((0 < body_marks) && (body_marks <= number_body_marks))
- var/list/marking_styles = params2list(H.m_styles)
- marking_styles["body"] = marking_styles_list[body_marks]
- H.m_styles = list2params(marking_styles)
+ var/body_marks = dna.GetUIValueRange(DNA_UI_BODY_MARK_STYLE, marking_styles_list.len)
+ if((body_marks > 0) && (body_marks <= number_body_marks))
+ H.m_styles["body"] = marking_styles_list[body_marks]
//Tail Markings
- var/tail_marks = dna.GetUIValueRange(DNA_UI_TAIL_MARK_STYLE,marking_styles_list.len)
- if((0 < tail_marks) && (tail_marks <= number_tail_marks))
- var/list/marking_styles = params2list(H.m_styles)
- marking_styles["tail"] = marking_styles_list[tail_marks]
- H.m_styles = list2params(marking_styles)
+ var/tail_marks = dna.GetUIValueRange(DNA_UI_TAIL_MARK_STYLE, marking_styles_list.len)
+ if((tail_marks > 0) && (tail_marks <= number_tail_marks))
+ H.m_styles["tail"] = marking_styles_list[tail_marks]
H.force_update_limbs()
H.update_eyes()
diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm
index 0f1c700a17f..796bbdb2b24 100644
--- a/code/game/dna/genes/vg_powers.dm
+++ b/code/game/dna/genes/vg_powers.dm
@@ -44,7 +44,7 @@
else
M.change_gender(FEMALE)
- var/new_eyes = input("Please select eye color.", "Character Generation", rgb(M.r_eyes,M.g_eyes,M.b_eyes)) as null|color
+ var/new_eyes = input("Please select eye color.", "Character Generation", rgb(M.r_eyes, M.g_eyes, M.b_eyes)) as null|color
if(new_eyes)
M.change_eye_color(M.r_eyes, M.g_eyes, M.b_eyes)
@@ -65,12 +65,13 @@
var/new_hair = input("Please select hair color.", "Character Generation", rgb(head_organ.r_hair, head_organ.g_hair, head_organ.b_hair)) as null|color
if(new_hair)
- M.change_hair_color(hex2num(copytext(new_hair, 2, 4)), hex2num(copytext(new_hair, 4, 6)), hex2num(copytext(new_hair, 6, 8)))
+ M.change_hair_color(color2R(new_hair), color2G(new_hair), color2B(new_hair))
var/datum/sprite_accessory/hair_style = hair_styles_list[head_organ.h_style]
if(hair_style.secondary_theme && !hair_style.no_sec_colour)
new_hair = input("Please select secondary hair color.", "Character Generation", rgb(head_organ.r_hair_sec, head_organ.g_hair_sec, head_organ.b_hair_sec)) as null|color
- M.change_hair_color(hex2num(copytext(new_hair, 2, 4)), hex2num(copytext(new_hair, 4, 6)), hex2num(copytext(new_hair, 6, 8)), 1)
+ if(new_hair)
+ M.change_hair_color(color2R(new_hair), color2G(new_hair), color2B(new_hair), 1)
// facial hair
var/list/valid_facial_hairstyles = M.generate_valid_facial_hairstyles()
@@ -81,12 +82,13 @@
var/new_facial = input("Please select facial hair color.", "Character Generation", rgb(head_organ.r_facial, head_organ.g_facial, head_organ.b_facial)) as null|color
if(new_facial)
- M.change_facial_hair_color(hex2num(copytext(new_facial, 2, 4)), hex2num(copytext(new_facial, 4, 6)), hex2num(copytext(new_facial, 6, 8)))
+ M.change_facial_hair_color(color2R(new_facial), color2G(new_facial), color2B(new_facial))
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[head_organ.f_style]
if(facial_hair_style.secondary_theme && !facial_hair_style.no_sec_colour)
new_facial = input("Please select secondary facial hair color.", "Character Generation", rgb(head_organ.r_facial_sec, head_organ.g_facial_sec, head_organ.b_facial_sec)) as null|color
- M.change_facial_hair_color(hex2num(copytext(new_facial, 2, 4)), hex2num(copytext(new_facial, 4, 6)), hex2num(copytext(new_facial, 6, 8)), 1)
+ if(new_facial)
+ M.change_facial_hair_color(color2R(new_facial), color2G(new_facial), color2B(new_facial), 1)
//Head accessory.
if(head_organ.species.bodyflags & HAS_HEAD_ACCESSORY)
@@ -97,7 +99,7 @@
var/new_head_accessory_colour = input("Please select head accessory colour.", "Character Generation", rgb(head_organ.r_headacc, head_organ.g_headacc, head_organ.b_headacc)) as null|color
if(new_head_accessory_colour)
- M.change_head_accessory_color(hex2num(copytext(new_head_accessory_colour, 2, 4)), hex2num(copytext(new_head_accessory_colour, 4, 6)), hex2num(copytext(new_head_accessory_colour, 6, 8)))
+ M.change_head_accessory_color(color2R(new_head_accessory_colour), color2G(new_head_accessory_colour), color2B(new_head_accessory_colour))
//Body accessory.
if(M.species.tail && M.species.bodyflags & HAS_TAIL)
@@ -109,41 +111,32 @@
//Head markings.
if(M.species.bodyflags & HAS_HEAD_MARKINGS)
- var/list/marking_styles = params2list(M.m_styles)
var/list/valid_head_markings = M.generate_valid_markings("head")
- var/new_marking = input("Please select head marking style", "Character Generation", marking_styles["head"]) as null|anything in valid_head_markings
+ var/new_marking = input("Please select head marking style", "Character Generation", M.m_styles["head"]) as null|anything in valid_head_markings
if(new_marking)
M.change_markings(new_marking, "head")
- var/list/marking_colours = params2list(M.m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
- var/new_marking_colour = input("Please select head marking colour.", "Character Generation", rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))) as null|color
+ var/new_marking_colour = input("Please select head marking colour.", "Character Generation", M.m_colours["head"]) as null|color
if(new_marking_colour)
M.change_marking_color(new_marking_colour, "head")
//Body markings.
if(M.species.bodyflags & HAS_BODY_MARKINGS)
- var/list/marking_styles = params2list(M.m_styles)
var/list/valid_body_markings = M.generate_valid_markings("body")
- var/new_marking = input("Please select body marking style", "Character Generation", marking_styles["body"]) as null|anything in valid_body_markings
+ var/new_marking = input("Please select body marking style", "Character Generation", M.m_styles["body"]) as null|anything in valid_body_markings
if(new_marking)
M.change_markings(new_marking, "body")
- var/list/marking_colours = params2list(M.m_colours)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
- var/new_marking_colour = input("Please select body marking colour.", "Character Generation", rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8)))) as null|color
+ var/new_marking_colour = input("Please select body marking colour.", "Character Generation", M.m_colours["body"]) as null|color
if(new_marking_colour)
M.change_marking_color(new_marking_colour, "body")
//Tail markings.
if(M.species.bodyflags & HAS_TAIL_MARKINGS)
- var/list/marking_styles = params2list(M.m_styles)
var/list/valid_tail_markings = M.generate_valid_markings("tail")
- var/new_marking = input("Please select tail marking style", "Character Generation", marking_styles["tail"]) as null|anything in valid_tail_markings
+ var/new_marking = input("Please select tail marking style", "Character Generation", M.m_styles["tail"]) as null|anything in valid_tail_markings
if(new_marking)
M.change_markings(new_marking, "tail")
- var/list/marking_colours = params2list(M.m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
- var/new_marking_colour = input("Please select tail marking colour.", "Character Generation", rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8)))) as null|color
+ var/new_marking_colour = input("Please select tail marking colour.", "Character Generation", M.m_colours["tail"]) as null|color
if(new_marking_colour)
M.change_marking_color(new_marking_colour, "tail")
@@ -175,7 +168,7 @@
if(M.species.bodyflags & HAS_SKIN_COLOR)
var/new_body_colour = input("Please select body colour.", "Character Generation", rgb(M.r_skin, M.g_skin, M.b_skin)) as null|color
if(new_body_colour)
- M.change_skin_color(hex2num(copytext(new_body_colour, 2, 4)), hex2num(copytext(new_body_colour, 4, 6)), hex2num(copytext(new_body_colour, 6, 8)))
+ M.change_skin_color(color2R(new_body_colour), color2G(new_body_colour), color2B(new_body_colour))
M.update_dna()
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index a26f941188b..302b0975802 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -148,15 +148,15 @@ proc/issyndicate(mob/living/M as mob)
if(prob(5))
facial_hair_style = pick(facial_hair_styles_list)
- head_organ.r_facial = hex2num(copytext(hair_c, 2, 4))
- head_organ.g_facial = hex2num(copytext(hair_c, 4, 6))
- head_organ.b_facial = hex2num(copytext(hair_c, 6, 8))
- head_organ.r_hair = hex2num(copytext(hair_c, 2, 4))
- head_organ.g_hair = hex2num(copytext(hair_c, 4, 6))
- head_organ.b_hair = hex2num(copytext(hair_c, 6, 8))
- M.r_eyes = hex2num(copytext(eye_c, 2, 4))
- M.g_eyes = hex2num(copytext(eye_c, 4, 6))
- M.b_eyes = hex2num(copytext(eye_c, 6, 8))
+ head_organ.r_facial = color2R(hair_c)
+ head_organ.g_facial = color2G(hair_c)
+ head_organ.b_facial = color2B(hair_c)
+ head_organ.r_hair = color2R(hair_c)
+ head_organ.g_hair = color2G(hair_c)
+ head_organ.b_hair = color2B(hair_c)
+ M.r_eyes = color2R(eye_c)
+ M.g_eyes = color2G(eye_c)
+ M.b_eyes = color2B(eye_c)
M.s_tone = skin_tone
head_organ.h_style = hair_style
head_organ.f_style = facial_hair_style
diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm
index 151478ddee6..73e590361a7 100644
--- a/code/game/machinery/dye_generator.dm
+++ b/code/game/machinery/dye_generator.dm
@@ -111,21 +111,21 @@
if(do_after(user, 50, target = H))
switch(what_to_dye)
if("hair")
- var/r_hair = hex2num(copytext(dye_color, 2, 4))
- var/g_hair = hex2num(copytext(dye_color, 4, 6))
- var/b_hair = hex2num(copytext(dye_color, 6, 8))
+ var/r_hair = color2R(dye_color)
+ var/g_hair = color2G(dye_color)
+ var/b_hair = color2B(dye_color)
if(H.change_hair_color(r_hair, g_hair, b_hair))
H.update_dna()
if("facial hair")
- var/r_facial = hex2num(copytext(dye_color, 2, 4))
- var/g_facial = hex2num(copytext(dye_color, 4, 6))
- var/b_facial = hex2num(copytext(dye_color, 6, 8))
+ var/r_facial = color2R(dye_color)
+ var/g_facial = color2G(dye_color)
+ var/b_facial = color2B(dye_color)
if(H.change_facial_hair_color(r_facial, g_facial, b_facial))
H.update_dna()
if("body")
- var/r_skin = hex2num(copytext(dye_color, 2, 4))
- var/g_skin = hex2num(copytext(dye_color, 4, 6))
- var/b_skin = hex2num(copytext(dye_color, 6, 8))
+ var/r_skin = color2R(dye_color)
+ var/g_skin = color2G(dye_color)
+ var/b_skin = color2B(dye_color)
if(H.change_skin_color(r_skin, g_skin, b_skin))
H.update_dna()
user.visible_message("[user] finishes dying [M]'s [what_to_dye]!", "You finish dying [M]'s [what_to_dye]!")
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index abda62f9420..c6b51cecb57 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -167,15 +167,15 @@ var/ert_request_answered = 0
if(prob(5))
facial_hair_style = pick(facial_hair_styles_list)
- head_organ.r_facial = hex2num(copytext(hair_c, 2, 4))
- head_organ.g_facial = hex2num(copytext(hair_c, 4, 6))
- head_organ.b_facial = hex2num(copytext(hair_c, 6, 8))
- head_organ.r_hair = hex2num(copytext(hair_c, 2, 4))
- head_organ.g_hair = hex2num(copytext(hair_c, 4, 6))
- head_organ.b_hair = hex2num(copytext(hair_c, 6, 8))
- M.r_eyes = hex2num(copytext(eye_c, 2, 4))
- M.g_eyes = hex2num(copytext(eye_c, 4, 6))
- M.b_eyes = hex2num(copytext(eye_c, 6, 8))
+ head_organ.r_facial = color2R(hair_c)
+ head_organ.g_facial = color2G(hair_c)
+ head_organ.b_facial = color2B(hair_c)
+ head_organ.r_hair = color2R(hair_c)
+ head_organ.g_hair = color2G(hair_c)
+ head_organ.b_hair = color2B(hair_c)
+ M.r_eyes = color2R(eye_c)
+ M.g_eyes = color2G(eye_c)
+ M.b_eyes = color2B(eye_c)
M.s_tone = skin_tone
head_organ.h_style = hair_style
head_organ.f_style = facial_hair_style
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index 5f0d31f9c26..9b590651974 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -110,12 +110,16 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/r_headacc = 0 //Head accessory colour
var/g_headacc = 0 //Head accessory colour
var/b_headacc = 0 //Head accessory colour
- var/m_styles = "head=None;\
- body=None;\
- tail=None" //Marking styles.
- var/m_colours = "head=#000000;\
- body=#000000;\
- tail=#000000" //Marking colours.
+ var/list/m_styles = list(
+ "head" = "None",
+ "body" = "None",
+ "tail" = "None"
+ ) //Marking styles.
+ var/list/m_colours = list(
+ "head" = "#000000",
+ "body" = "#000000",
+ "tail" = "#000000"
+ ) //Marking colours.
var/h_style = "Bald" //Hair type
var/r_hair = 0 //Hair color
var/g_hair = 0 //Hair color
@@ -296,26 +300,17 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "Color [color_square(r_headacc, g_headacc, b_headacc)]
"
if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings.
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
dat += "Head Markings: "
- dat += "[marking_styles["head"]]"
- dat += "Color [color_square(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))]
"
+ dat += "[m_styles["head"]]"
+ dat += "Color [color_square(color2R(m_colours["head"]), color2G(m_colours["head"]), color2B(m_colours["head"]))]
"
if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox")) //Species with body markings/tattoos.
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
dat += "Body Markings: "
- dat += "[marking_styles["body"]]"
- dat += "Color [color_square(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8)))]
"
+ dat += "[m_styles["body"]]"
+ dat += "Color [color_square(color2R(m_colours["body"]), color2G(m_colours["body"]), color2B(m_colours["body"]))]
"
if(species in list("Vox", "Vulpkanin")) //Species with tail markings.
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
dat += "Tail Markings: "
- dat += "[marking_styles["tail"]]"
- dat += "Color [color_square(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8)))]
"
+ dat += "[m_styles["tail"]]"
+ dat += "Color [color_square(color2R(m_colours["tail"]), color2G(m_colours["tail"]), color2B(m_colours["tail"]))]
"
dat += "Hair: "
dat += "[h_style]"
@@ -1216,43 +1211,41 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
species = input("Please select a species", "Character Generation", null) in new_species
if(prev_species != species)
+ var/datum/robolimb/robohead
+ if(species == "Machine")
+ var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]"
+ robohead = all_robolimbs[head_model]
//grab one of the valid hair styles for the newly chosen species
- 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)
- else
- //this shouldn't happen
- h_style = hair_styles_list["Bald"]
+ h_style = random_hair_style(gender, species, robohead)
//grab one of the valid facial hair styles for the newly chosen species
- 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
+ f_style = random_facial_hair_style(gender, species, robohead)
- valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
-
- if(valid_facialhairstyles.len)
- f_style = pick(valid_facialhairstyles)
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have head accessories.
+ ha_style = random_head_accessory(species)
else
- //this shouldn't happen
- f_style = facial_hair_styles_list["Shaved"]
+ ha_style = "None" // No Vulp ears on Unathi
+ r_headacc = 0
+ g_headacc = 0
+ b_headacc = 0
+
+ if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings.
+ m_styles["head"] = random_marking_style("head", species, robohead, body_accessory, alt_head)
+ else
+ m_styles["head"] = "None"
+ m_colours["head"] = "#000000"
+
+ if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox")) //Species with body markings/tattoos.
+ m_styles["body"] = random_marking_style("body", species, robohead, body_accessory, alt_head)
+ else
+ m_styles["body"] = "None"
+ m_colours["body"] = "#000000"
+
+ if(species in list("Vox", "Vulpkanin")) //Species with tail markings.
+ m_styles["tail"] = random_marking_style("tail", species, robohead, body_accessory, alt_head)
+ else
+ m_styles["tail"] = "None"
+ m_colours["tail"] = "#000000"
// Don't wear another species' underwear!
var/datum/sprite_accessory/S = underwear_list[underwear]
@@ -1267,32 +1260,17 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(!S || !(species in S.species_allowed))
socks = random_socks(gender, species)
- //reset hair colour and skin colour
- r_hair = 0
- g_hair = 0
- b_hair = 0
- r_hair_sec = 0
- g_hair_sec = 0
- b_hair_sec = 0
- r_facial = 0
- g_facial = 0
- b_facial = 0
- r_facial_sec = 0
- g_facial_sec = 0
- b_facial_sec = 0
-
- s_tone = 0
+ //reset skin tone and colour
+ if(species in list("Human", "Drask", "Vox"))
+ random_skin_tone(species)
+ else
+ s_tone = 0
if(!(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")))
r_skin = 0
g_skin = 0
b_skin = 0
- ha_style = "None" // No Vulp ears on Unathi
- m_styles = "head=None;\
- body=None;\
- tail=None" // No Unathi markings on Tajara
-
alt_head = "None" //No alt heads on species that don't have them.
body_accessory = null //no vulptail on humans damnit
@@ -1340,9 +1318,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/input = "Choose your character's hair colour:"
var/new_hair = input(user, input, "Character Preference", rgb(r_hair, g_hair, b_hair)) as color|null
if(new_hair)
- r_hair = hex2num(copytext(new_hair, 2, 4))
- g_hair = hex2num(copytext(new_hair, 4, 6))
- b_hair = hex2num(copytext(new_hair, 6, 8))
+ r_hair = color2R(new_hair)
+ g_hair = color2G(new_hair)
+ b_hair = color2B(new_hair)
if("secondary_hair")
if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
@@ -1350,9 +1328,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(hair_style.secondary_theme && !hair_style.no_sec_colour)
var/new_hair = input(user, "Choose your character's secondary hair colour:", "Character Preference", rgb(r_hair_sec, g_hair_sec, b_hair_sec)) as color|null
if(new_hair)
- r_hair_sec = hex2num(copytext(new_hair, 2, 4))
- g_hair_sec = hex2num(copytext(new_hair, 4, 6))
- b_hair_sec = hex2num(copytext(new_hair, 6, 8))
+ r_hair_sec = color2R(new_hair)
+ g_hair_sec = color2G(new_hair)
+ b_hair_sec = color2B(new_hair)
if("h_style")
var/list/valid_hairstyles = list()
@@ -1393,9 +1371,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/input = "Choose the colour of your your character's head accessory:"
var/new_head_accessory = input(user, input, "Character Preference", rgb(r_headacc, g_headacc, b_headacc)) as color|null
if(new_head_accessory)
- r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
- g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
- b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
+ r_headacc = color2R(new_head_accessory)
+ g_headacc = color2G(new_head_accessory)
+ b_headacc = color2B(new_head_accessory)
if("ha_style")
if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with head accessories.
@@ -1427,13 +1405,11 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/new_alt_head = input(user, "Choose your character's alternate head style:", "Character Preference") as null|anything in valid_alt_heads
if(new_alt_head)
alt_head = new_alt_head
- var/list/marking_styles = params2list(m_styles)
- if(marking_styles["head"])
- var/head_marking = marking_styles["head"]
+ if(m_styles["head"])
+ var/head_marking = m_styles["head"]
var/datum/sprite_accessory/body_markings/head/head_marking_style = marking_styles_list[head_marking]
if(!head_marking_style.heads_allowed || !(alt_head in head_marking_style.heads_allowed))
- marking_styles["head"] = "None"
- m_styles = list2params(marking_styles)
+ m_styles["head"] = "None"
if("m_style_head")
if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings.
@@ -1467,21 +1443,16 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
valid_markings[markingstyle] = marking_styles_list[markingstyle]
- var/list/marking_styles = params2list(m_styles)
- var/new_marking_style = input(user, "Choose the style of your character's head markings:", "Character Preference", marking_styles["head"]) as null|anything in valid_markings
+ var/new_marking_style = input(user, "Choose the style of your character's head markings:", "Character Preference", m_styles["head"]) as null|anything in valid_markings
if(new_marking_style)
- marking_styles["head"] = new_marking_style
- m_styles = list2params(marking_styles)
+ m_styles["head"] = new_marking_style
if("m_head_colour")
if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings.
var/input = "Choose the colour of your your character's head markings:"
- var/list/marking_colours = params2list(m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
- var/new_markings = input(user, input, "Character Preference", rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))) as color|null
+ var/new_markings = input(user, input, "Character Preference", m_colours["head"]) as color|null
if(new_markings)
- marking_colours["head"] = new_markings
- m_colours = list2params(marking_colours)
+ m_colours["head"] = new_markings
if("m_style_body")
if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox")) //Species with body markings/tattoos.
@@ -1496,21 +1467,16 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
valid_markings[markingstyle] = marking_styles_list[markingstyle]
- var/list/marking_styles = params2list(m_styles)
- var/new_marking_style = input(user, "Choose the style of your character's body markings:", "Character Preference", marking_styles["body"]) as null|anything in valid_markings
+ var/new_marking_style = input(user, "Choose the style of your character's body markings:", "Character Preference", m_styles["body"]) as null|anything in valid_markings
if(new_marking_style)
- marking_styles["body"] = new_marking_style
- m_styles = list2params(marking_styles)
+ m_styles["body"] = new_marking_style
if("m_body_colour")
if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox")) //Species with body markings/tattoos.
var/input = "Choose the colour of your your character's body markings:"
- var/list/marking_colours = params2list(m_colours)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
- var/new_markings = input(user, input, "Character Preference", rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8)))) as color|null
+ var/new_markings = input(user, input, "Character Preference", m_colours["body"]) as color|null
if(new_markings)
- marking_colours["body"] = new_markings
- m_colours = list2params(marking_colours)
+ m_colours["body"] = new_markings
if("m_style_tail")
if(species in list("Vox", "Vulpkanin")) //Species with tail markings.
@@ -1531,22 +1497,16 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
valid_markings[markingstyle] = marking_styles_list[markingstyle]
- var/list/marking_styles = params2list(m_styles)
- var/new_marking_style = input(user, "Choose the style of your character's tail markings:", "Character Preference", marking_styles["tail"]) as null|anything in valid_markings
-
+ var/new_marking_style = input(user, "Choose the style of your character's tail markings:", "Character Preference", m_styles["tail"]) as null|anything in valid_markings
if(new_marking_style)
- marking_styles["tail"] = new_marking_style
- m_styles = list2params(marking_styles)
+ m_styles["tail"] = new_marking_style
if("m_tail_colour")
if(species in list("Vox", "Vulpkanin")) //Species with tail markings.
var/input = "Choose the colour of your your character's tail markings:"
- var/list/marking_colours = params2list(m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
- var/new_markings = input(user, input, "Character Preference", rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8)))) as color|null
+ var/new_markings = input(user, input, "Character Preference", m_colours["tail"]) as color|null
if(new_markings)
- marking_colours["tail"] = new_markings
- m_colours = list2params(marking_colours)
+ m_colours["tail"] = new_markings
if("body_accessory")
var/list/possible_body_accessories = list()
@@ -1563,18 +1523,16 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/new_body_accessory = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories
if(new_body_accessory)
- var/list/marking_styles = params2list(m_styles)
- marking_styles["tail"] = "None"
- m_styles = list2params(marking_styles)
+ m_styles["tail"] = "None"
body_accessory = (new_body_accessory == "None") ? null : new_body_accessory
if("facial")
if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(r_facial, g_facial, b_facial)) as color|null
if(new_facial)
- r_facial = hex2num(copytext(new_facial, 2, 4))
- g_facial = hex2num(copytext(new_facial, 4, 6))
- b_facial = hex2num(copytext(new_facial, 6, 8))
+ r_facial = color2R(new_facial)
+ g_facial = color2G(new_facial)
+ b_facial = color2B(new_facial)
if("secondary_facial")
if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
@@ -1582,9 +1540,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(facial_hair_style.secondary_theme && !facial_hair_style.no_sec_colour)
var/new_facial = input(user, "Choose your character's secondary facial-hair colour:", "Character Preference", rgb(r_facial_sec, g_facial_sec, b_facial_sec)) as color|null
if(new_facial)
- r_facial_sec = hex2num(copytext(new_facial, 2, 4))
- g_facial_sec = hex2num(copytext(new_facial, 4, 6))
- b_facial_sec = hex2num(copytext(new_facial, 6, 8))
+ r_facial_sec = color2R(new_facial)
+ g_facial_sec = color2G(new_facial)
+ b_facial_sec = color2B(new_facial)
if("f_style")
var/list/valid_facialhairstyles = list()
@@ -1664,9 +1622,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if("eyes")
var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(r_eyes, g_eyes, b_eyes)) as color|null
if(new_eyes)
- r_eyes = hex2num(copytext(new_eyes, 2, 4))
- g_eyes = hex2num(copytext(new_eyes, 4, 6))
- b_eyes = hex2num(copytext(new_eyes, 6, 8))
+ r_eyes = color2R(new_eyes)
+ g_eyes = color2G(new_eyes)
+ b_eyes = color2B(new_eyes)
if("s_tone")
if(species == "Human" || species == "Drask")
@@ -1682,9 +1640,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user))
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(r_skin, g_skin, b_skin)) as color|null
if(new_skin)
- r_skin = hex2num(copytext(new_skin, 2, 4))
- g_skin = hex2num(copytext(new_skin, 4, 6))
- b_skin = hex2num(copytext(new_skin, 6, 8))
+ r_skin = color2R(new_skin)
+ g_skin = color2G(new_skin)
+ b_skin = color2B(new_skin)
if("ooccolor")
@@ -1767,11 +1725,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states
if(!new_state) return
- var/list/marking_styles = params2list(m_styles) //Handle resetting of head markings if the head is changed.
switch(new_state)
if("Normal")
if(limb == "head")
- marking_styles["head"] = "None"
+ m_styles["head"] = "None"
h_style = hair_styles_list["Bald"]
f_style = facial_hair_styles_list["Shaved"]
organ_data[limb] = null
@@ -1825,7 +1782,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
alt_head = null
h_style = hair_styles_list["Bald"]
f_style = facial_hair_styles_list["Shaved"]
- marking_styles["head"] = "None"
+ m_styles["head"] = "None"
rlimb_data[limb] = choice
organ_data[limb] = "cyborg"
if(second_limb)
@@ -1836,7 +1793,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
else
rlimb_data[second_limb] = choice
organ_data[second_limb] = "cyborg"
- m_styles = list2params(marking_styles) //Pass the reset head markings back to the preference variable.
if("organs")
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes")
if(!organ_name) return
@@ -2145,7 +2101,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
H.g_headacc = g_headacc
H.b_headacc = b_headacc
H.ha_style = ha_style
- if((character.species.bodyflags & HAS_HEAD_MARKINGS) || (character.species.bodyflags & HAS_BODY_MARKINGS) || (character.species.bodyflags & HAS_TAIL_MARKINGS))
+ if(character.species.bodyflags & HAS_MARKINGS)
character.m_colours = m_colours
character.m_styles = m_styles
diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm
index cd6177a08f1..6b99f2d101d 100644
--- a/code/modules/client/preference/preferences_mysql.dm
+++ b/code/modules/client/preference/preferences_mysql.dm
@@ -199,13 +199,13 @@
r_skin = text2num(query.item[21])
g_skin = text2num(query.item[22])
b_skin = text2num(query.item[23])
- m_colours = query.item[24]
+ m_colours = params2list(query.item[24])
r_headacc = text2num(query.item[25])
g_headacc = text2num(query.item[26])
b_headacc = text2num(query.item[27])
h_style = query.item[28]
f_style = query.item[29]
- m_styles = query.item[30]
+ m_styles = params2list(query.item[30])
ha_style = query.item[31]
alt_head = query.item[32]
r_eyes = text2num(query.item[33])
@@ -324,6 +324,8 @@
var/rlimblist
var/playertitlelist
var/gearlist
+ var/markingcolourslist = list2params(m_colours)
+ var/markingstyleslist = list2params(m_styles)
if(!isemptylist(organ_data))
organlist = list2params(organ_data)
if(!isemptylist(rlimb_data))
@@ -360,13 +362,13 @@
skin_red='[r_skin]',
skin_green='[g_skin]',
skin_blue='[b_skin]',
- marking_colours='[m_colours]',
+ marking_colours='[markingcolourslist]',
head_accessory_red='[r_headacc]',
head_accessory_green='[g_headacc]',
head_accessory_blue='[b_headacc]',
hair_style_name='[sql_sanitize_text(h_style)]',
facial_style_name='[sql_sanitize_text(f_style)]',
- marking_styles='[m_styles]',
+ marking_styles='[markingstyleslist]',
head_accessory_style_name='[sql_sanitize_text(ha_style)]',
alt_head_name='[sql_sanitize_text(alt_head)]',
eyes_red='[r_eyes]',
@@ -444,9 +446,9 @@
'[r_facial]', '[g_facial]', '[b_facial]',
'[r_facial_sec]', '[g_facial_sec]', '[b_facial_sec]',
'[s_tone]', '[r_skin]', '[g_skin]', '[b_skin]',
- '[m_colours]',
+ '[markingcolourslist]',
'[r_headacc]', '[g_headacc]', '[b_headacc]',
- '[sql_sanitize_text(h_style)]', '[sql_sanitize_text(f_style)]', '[m_styles]', '[sql_sanitize_text(ha_style)]', '[sql_sanitize_text(alt_head)]',
+ '[sql_sanitize_text(h_style)]', '[sql_sanitize_text(f_style)]', '[markingstyleslist]', '[sql_sanitize_text(ha_style)]', '[sql_sanitize_text(alt_head)]',
'[r_eyes]', '[g_eyes]', '[b_eyes]',
'[underwear]', '[undershirt]',
'[backbag]', '[b_type]', '[alternate_option]',
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index a6dca0c51cb..ff78f16c556 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -47,8 +47,7 @@
to_chat(user, "[target] has no skin, how do you expect to tattoo them?")
return
- var/list/marking_styles = params2list(target.m_styles)
- if(marking_styles["body"] != "None")
+ if(target.m_styles["body"] != "None")
to_chat(user, "[target] already has body markings, any more would look silly!")
return
@@ -67,14 +66,8 @@
user.visible_message("[user] finishes the [tattoo_name] on [target].", "You finish the [tattoo_name].")
if(!used) // No exploiting do_after to tattoo multiple folks.
- var/list/marking_colours = params2list(target.m_colours)
- marking_styles["body"] = tattoo_icon
- marking_colours["body"] = "#[num2hex(tattoo_r,2)][num2hex(tattoo_g,2)][num2hex(tattoo_b,2)]"
-
- target.m_styles = list2params(marking_styles)
- target.m_colours = list2params(marking_colours)
-
- target.update_markings()
+ target.change_markings(tattoo_icon, "body")
+ target.change_marking_color(rgb(tattoo_r, tattoo_g, tattoo_b), "body")
playsound(src.loc, 'sound/items/Welder2.ogg', 20, 1)
used = 1
@@ -106,9 +99,9 @@
if(!used)
var/ink_color = input("Please select an ink color.", "Tattoo Ink Color", rgb(tattoo_r, tattoo_g, tattoo_b)) as color|null
if(ink_color && !(user.incapacitated() || used) )
- tattoo_r = hex2num(copytext(ink_color, 2, 4))
- tattoo_g = hex2num(copytext(ink_color, 4, 6))
- tattoo_b = hex2num(copytext(ink_color, 6, 8))
+ tattoo_r = color2R(ink_color)
+ tattoo_g = color2G(ink_color)
+ tattoo_b = color2B(ink_color)
to_chat(user, "You change the color setting on the [src].")
diff --git a/code/modules/lighting/light_source.dm b/code/modules/lighting/light_source.dm
index da60e939987..fd92e6675f1 100644
--- a/code/modules/lighting/light_source.dm
+++ b/code/modules/lighting/light_source.dm
@@ -114,9 +114,9 @@
/datum/light_source/proc/parse_light_color()
if(light_color)
- lum_r = GetRedPart(light_color) / 255
- lum_g = GetGreenPart(light_color) / 255
- lum_b = GetBluePart(light_color) / 255
+ lum_r = color2R(light_color) / 255
+ lum_g = color2G(light_color) / 255
+ lum_b = color2B(light_color) / 255
else
lum_r = 1
lum_g = 1
@@ -195,7 +195,7 @@
effect_str.Cut()
effect_turf.Cut()
-
+
/datum/light_source/proc/forget_turf(turf/T)
var/idx = effect_turf.Find(T)
effect_turf.Cut(idx, idx + 1)
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
index e94620c8b47..29313624e7c 100644
--- a/code/modules/mob/living/carbon/human/appearance.dm
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -63,8 +63,7 @@
return 1
/mob/living/carbon/human/proc/change_markings(var/marking_style, var/location = "body")
- var/list/marking_styles = params2list(m_styles)
- if(!marking_style || marking_styles[location] == marking_style || !(marking_style in marking_styles_list))
+ if(!marking_style || m_styles[location] == marking_style || !(marking_style in marking_styles_list))
return
var/datum/sprite_accessory/body_markings/marking = marking_styles_list[marking_style]
@@ -93,8 +92,7 @@
if(!tail_marking.tails_allowed || !(body_accessory.name in tail_marking.tails_allowed))
return
- marking_styles[location] = marking_style
- m_styles = list2params(marking_styles)
+ m_styles[location] = marking_style
if(location == "tail")
stop_tail_wagging()
@@ -115,9 +113,7 @@
if(!found)
return
- var/list/marking_styles = params2list(m_styles)
- marking_styles["tail"] = "None"
- m_styles = list2params(marking_styles)
+ m_styles["tail"] = "None"
update_tail_layer()
return 1
@@ -129,13 +125,11 @@
H.alt_head = alternate_head
//Handle head markings if they're incompatible with the new alt head.
- var/list/marking_styles = params2list(m_styles)
- if(marking_styles["head"])
- var/head_marking = marking_styles["head"]
+ if(m_styles["head"])
+ var/head_marking = m_styles["head"]
var/datum/sprite_accessory/body_markings/head/head_marking_style = marking_styles_list[head_marking]
if(!head_marking_style.heads_allowed || !(H.alt_head in head_marking_style.heads_allowed))
- marking_styles["head"] = "None"
- m_styles = list2params(marking_styles)
+ m_styles["head"] = "None"
update_markings()
update_body(1, 1) //Update the body and force limb icon regeneration to update the head with the new icon.
@@ -145,8 +139,7 @@
reset_head_hair()
reset_facial_hair()
reset_head_accessory()
- var/list/marking_styles = params2list(m_styles)
- if(marking_styles["head"] && marking_styles["head"] != "None") //Resets head markings.
+ if(m_styles["head"] && m_styles["head"] != "None") //Resets head markings.
reset_markings()
/mob/living/carbon/human/proc/reset_head_hair()
@@ -172,25 +165,22 @@
/mob/living/carbon/human/proc/reset_markings(var/location)
var/list/valid_markings
- var/list/marking_styles = params2list(m_styles)
if(location)
valid_markings = generate_valid_markings(location)
if(valid_markings.len)
- marking_styles[location] = pick(valid_markings)
+ m_styles[location] = pick(valid_markings)
else
//this shouldn't happen
- marking_styles[location] = "None"
+ m_styles[location] = "None"
else
for(var/m_location in list("head", "body", "tail"))
valid_markings = generate_valid_markings(m_location)
if(valid_markings.len)
- marking_styles[m_location] = pick(valid_markings)
+ m_styles[m_location] = pick(valid_markings)
else
//this shouldn't happen
- marking_styles[m_location] = "None"
-
- m_styles = list2params(marking_styles)
+ m_styles[m_location] = "None"
update_markings()
stop_tail_wagging()
@@ -270,13 +260,10 @@
return 1
/mob/living/carbon/human/proc/change_marking_color(var/colour, var/location = "body")
- var/list/marking_colours = params2list(m_colours)
- marking_colours[location] = sanitize_hexcolor(marking_colours[location])
- if(colour == marking_colours[location])
+ if(colour == m_colours[location])
return
- marking_colours[location] = colour
- m_colours = list2params(marking_colours)
+ m_colours[location] = colour
if(location == "tail")
update_tail_layer()
@@ -339,7 +326,7 @@
if(H.species.flags & ALL_RPARTS) //If the user is a species who can have a robotic head...
var/datum/robolimb/robohead = all_robolimbs[H.model]
if(!H)
- return
+ return //No head, no hair.
if(H.species.name in S.species_allowed) //If this is a hairstyle native to the user's species...
if(robohead.is_monitor && (robohead.company in S.models_allowed)) //Check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
valid_hairstyles += hairstyle //Give them their hairstyles if they do.
@@ -350,7 +337,7 @@
if(robohead.is_monitor) //If the hair style is not native to the user's species and they're using a head with an ipc-style screen, don't let them access it.
continue
else
- if("Human" in S.species_allowed) //If the user has a robotic head and the hairstyle can fit humans, let them use it as a wig for their humanoid robot head.
+ if("Human" in S.species_allowed) //If the user has a robotic humanoid head and the hairstyle can fit humans, let them use it as a wig.
valid_hairstyles += hairstyle
continue
else //If the user is not a species who can have robotic heads, use the default handling.
@@ -371,7 +358,7 @@
if(H.species.flags & ALL_RPARTS) //If the user is a species who can have a robotic head...
var/datum/robolimb/robohead = all_robolimbs[H.model]
if(!H)
- continue // No head, no hair
+ return //No head, no hair.
if(H.species.name in S.species_allowed) //If this is a facial hair style native to the user's species...
if(robohead.is_monitor && (robohead.company in S.models_allowed)) //Check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
valid_facial_hairstyles += facialhairstyle //Give them their facial hair styles if they do.
@@ -379,11 +366,10 @@
else //If they don't have the default head, they shouldn't be getting any facial hair styles they wouldn't normally.
continue
else
-
if(robohead.is_monitor) //If the facial hair style is not native to the user's species and they're using a head with an ipc-style screen, don't let them access it.
continue
else
- if("Human" in S.species_allowed) //If the user has a robotic head and the facial hair style can fit humans, let them use it as a postiche for their humanoid robot head.
+ if("Human" in S.species_allowed) //If the user has a robotic humanoid head and the facial hair style can fit humans, let them use it as a postiche.
valid_facial_hairstyles += facialhairstyle
continue
else //If the user is not a species who can have robotic heads, use the default handling.
@@ -448,11 +434,10 @@
valid_body_accessories = body_accessory_by_name.Copy()
else
if(!istype(A))
- valid_body_accessories += "None" //The only null entry should be the "None" option.
+ valid_body_accessories["None"] = "None" //The only null entry should be the "None" option.
continue
- if(!(species.name in A.allowed_species)) //If the user is not of a species the body accessory style allows, skip it. Otherwise, add it to the list.
- continue
- valid_body_accessories += B
+ if(species.name in A.allowed_species) //If the user is not of a species the body accessory style allows, skip it. Otherwise, add it to the list.
+ valid_body_accessories += B
return valid_body_accessories
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index ab176e6912f..d42c48bff13 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -1539,9 +1539,9 @@
if(species.base_color && default_colour)
//Apply colour.
- r_skin = hex2num(copytext(species.base_color, 2, 4))
- g_skin = hex2num(copytext(species.base_color, 4, 6))
- b_skin = hex2num(copytext(species.base_color, 6, 8))
+ r_skin = color2R(species.base_color)
+ g_skin = color2G(species.base_color)
+ b_skin = color2B(species.base_color)
else
r_skin = 0
g_skin = 0
@@ -1563,25 +1563,25 @@
if(species.default_hair_colour)
//Apply colour.
- H.r_hair = hex2num(copytext(species.default_hair_colour, 2, 4))
- H.g_hair = hex2num(copytext(species.default_hair_colour, 4, 6))
- H.b_hair = hex2num(copytext(species.default_hair_colour, 6, 8))
+ H.r_hair = color2R(species.default_hair_colour)
+ H.g_hair = color2G(species.default_hair_colour)
+ H.b_hair = color2B(species.default_hair_colour)
else
H.r_hair = 0
H.g_hair = 0
H.b_hair = 0
if(species.default_fhair_colour)
- H.r_facial = hex2num(copytext(species.default_fhair_colour, 2, 4))
- H.g_facial = hex2num(copytext(species.default_fhair_colour, 4, 6))
- H.b_facial = hex2num(copytext(species.default_fhair_colour, 6, 8))
+ H.r_facial = color2R(species.default_fhair_colour)
+ H.g_facial = color2G(species.default_fhair_colour)
+ H.b_facial = color2B(species.default_fhair_colour)
else
H.r_facial = 0
H.g_facial = 0
H.b_facial = 0
if(species.default_headacc_colour)
- H.r_headacc = hex2num(copytext(species.default_headacc_colour, 2, 4))
- H.g_headacc = hex2num(copytext(species.default_headacc_colour, 4, 6))
- H.b_headacc = hex2num(copytext(species.default_headacc_colour, 6, 8))
+ H.r_headacc = color2R(species.default_headacc_colour)
+ H.g_headacc = color2G(species.default_headacc_colour)
+ H.b_headacc = color2B(species.default_headacc_colour)
else
H.r_headacc = 0
H.g_headacc = 0
@@ -1693,17 +1693,13 @@
if(!head_organ)
return
if(!robohead.is_monitor) //If they've got a prosthetic head and it isn't a monitor, they've no screen to adjust. Instead, let them change the colour of their optics!
- var/list/marking_colours = params2list(m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
- var/optic_colour = input(src, "Select optic colour", rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))) as color|null
+ var/optic_colour = input(src, "Select optic colour", m_colours["head"]) as color|null
if(incapacitated())
to_chat(src, "You were interrupted while changing the colour of your optics.")
return
if(optic_colour)
- marking_colours["head"] = optic_colour
- m_colours = list2params(marking_colours)
+ change_markings(optic_colour, "head")
- update_markings()
else if(robohead.is_monitor) //Means that the character's head is a monitor (has a screen). Time to customize.
var/list/hair = list()
for(var/i in hair_styles_list)
@@ -1711,14 +1707,12 @@
if((head_organ.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use.
hair += i
- var/new_style = input(src, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
+ var/new_style = input(src, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
if(incapacitated())
to_chat(src, "You were interrupted while changing your monitor display.")
return
if(new_style)
- head_organ.h_style = new_style
-
- update_hair()
+ change_hair(new_style)
//Putting a couple of procs here that I don't know where else to dump.
//Mostly going to be used for Vox and Vox Armalis, but other human mobs might like them (for adminbuse).
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 0626c89fa1f..adf951fad03 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -4,12 +4,17 @@ var/global/default_martial_art = new/datum/martial_art
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD,NATIONS_HUD)
//Marking colour and style
- var/m_colours = "head=#000000;\
- body=#000000;\
- tail=#000000"
- var/m_styles = "head=None;\
- body=None;\
- tail=None"
+ var/list/m_colours = list(
+ "head" = "#000000",
+ "body" = "#000000",
+ "tail" = "#000000"
+ )
+
+ var/list/m_styles = list(
+ "head" = "None",
+ "body" = "None",
+ "tail" = "None"
+ )
//Eye colour
var/r_eyes = 0
diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm
index 3577209ecd5..6b166f04c0c 100644
--- a/code/modules/mob/living/carbon/human/species/station.dm
+++ b/code/modules/mob/living/carbon/human/species/station.dm
@@ -162,7 +162,7 @@
flags = HAS_LIPS
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
- bodyflags = FEET_PADDED | HAS_TAIL | TAIL_WAGGING | TAIL_OVERLAPPED | HAS_HEAD_ACCESSORY | HAS_HEAD_MARKINGS | HAS_BODY_MARKINGS | HAS_TAIL_MARKINGS | HAS_SKIN_COLOR | HAS_FUR
+ bodyflags = FEET_PADDED | HAS_TAIL | TAIL_WAGGING | TAIL_OVERLAPPED | HAS_HEAD_ACCESSORY | HAS_MARKINGS | HAS_SKIN_COLOR | HAS_FUR
dietflags = DIET_OMNI
reagent_tag = PROCESS_ORG
flesh_color = "#966464"
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 130ea34f93d..a7afed9976b 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -366,31 +366,25 @@ var/global/list/damage_icon_parts = list()
//Base icon.
var/icon/markings_standing = new/icon('icons/mob/body_accessory.dmi',"accessory_none_s")
- //Prep marking styles and colours.
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
-
//Body markings.
var/obj/item/organ/external/chest/chest_organ = get_organ("chest")
- if(chest_organ && !chest_organ.is_stump() && !(chest_organ.status & ORGAN_DESTROYED) && marking_styles["body"])
- var/body_marking = marking_styles["body"]
+ if(chest_organ && !chest_organ.is_stump() && !(chest_organ.status & ORGAN_DESTROYED) && m_styles["body"])
+ var/body_marking = m_styles["body"]
var/datum/sprite_accessory/body_marking_style = marking_styles_list[body_marking]
if(body_marking_style && body_marking_style.species_allowed && (species.name in body_marking_style.species_allowed))
var/icon/b_marking_s = new/icon("icon" = body_marking_style.icon, "icon_state" = "[body_marking_style.icon_state]_s")
if(body_marking_style.do_colouration)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
- b_marking_s.Blend(rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8))), ICON_ADD)
+ b_marking_s.Blend(m_colours["body"], ICON_ADD)
markings_standing.Blend(b_marking_s, ICON_OVERLAY)
//Head markings.
var/obj/item/organ/external/head/head_organ = get_organ("head")
- if(head_organ && !head_organ.is_stump() && !(head_organ.status & ORGAN_DESTROYED) && marking_styles["head"]) //If the head is destroyed, forget the head markings. This prevents floating optical markings on decapitated IPCs, for example.
- var/head_marking = marking_styles["head"]
+ if(head_organ && !head_organ.is_stump() && !(head_organ.status & ORGAN_DESTROYED) && m_styles["head"]) //If the head is destroyed, forget the head markings. This prevents floating optical markings on decapitated IPCs, for example.
+ var/head_marking = m_styles["head"]
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
if(head_marking_style && head_marking_style.species_allowed && (head_organ.species.name in head_marking_style.species_allowed))
var/icon/h_marking_s = new/icon("icon" = head_marking_style.icon, "icon_state" = "[head_marking_style.icon_state]_s")
if(head_marking_style.do_colouration)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
- h_marking_s.Blend(rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8))), ICON_ADD)
+ h_marking_s.Blend(m_colours["head"], ICON_ADD)
markings_standing.Blend(h_marking_s, ICON_OVERLAY)
overlays_standing[MARKINGS_LAYER] = image(markings_standing)
@@ -408,7 +402,7 @@ var/global/list/damage_icon_parts = list()
return
//masks and helmets can obscure our head accessory
- if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
+ if((head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons) update_icons()
return
@@ -1147,16 +1141,13 @@ var/global/list/damage_icon_parts = list()
If the species' tail is overlapped by limbs, this will be only the N direction icon so tails can still appear on the outside of uniforms and such.
Otherwise, since the user's tail isn't overlapped by limbs, it will be a full icon with all directions. */
- var/list/marking_styles = params2list(m_styles)
var/icon/tail_marking_icon
var/datum/sprite_accessory/body_markings/tail/tail_marking_style
- if(marking_styles["tail"] != "None" && (species.bodyflags & HAS_TAIL_MARKINGS))
- var/tail_marking = marking_styles["tail"]
- var/list/marking_colours = params2list(m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
+ if(m_styles["tail"] != "None" && (species.bodyflags & HAS_TAIL_MARKINGS))
+ var/tail_marking = m_styles["tail"]
tail_marking_style = marking_styles_list[tail_marking]
tail_marking_icon = new/icon("icon" = tail_marking_style.icon, "icon_state" = "[tail_marking_style.icon_state]_s")
- tail_marking_icon.Blend(rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8))), ICON_ADD)
+ tail_marking_icon.Blend(m_colours["tail"], ICON_ADD)
if(body_accessory)
if(body_accessory.try_restrictions(src))
@@ -1217,16 +1208,13 @@ var/global/list/damage_icon_parts = list()
If the species' tail is overlapped by limbs, this will be only the N direction icon so tails can still appear on the outside of uniforms and such.
Otherwise, since the user's tail isn't overlapped by limbs, it will be a full icon with all directions. */
- var/list/marking_styles = params2list(m_styles)
var/icon/tail_marking_icon
var/datum/sprite_accessory/body_markings/tail/tail_marking_style
- if(marking_styles["tail"] != "None" && (species.bodyflags & HAS_TAIL_MARKINGS))
- var/tail_marking = marking_styles["tail"]
- var/list/marking_colours = params2list(m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
+ if(m_styles["tail"] != "None" && (species.bodyflags & HAS_TAIL_MARKINGS))
+ var/tail_marking = m_styles["tail"]
tail_marking_style = marking_styles_list[tail_marking]
tail_marking_icon = new/icon("icon" = tail_marking_style.icon, "icon_state" = "[tail_marking_style.icon_state]w_s")
- tail_marking_icon.Blend(rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8))), ICON_ADD)
+ tail_marking_icon.Blend(m_colours["tail"], ICON_ADD)
if(body_accessory)
var/icon/accessory_s = new/icon("icon" = body_accessory.get_animated_icon(), "icon_state" = body_accessory.get_animated_icon_state())
diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm
index 4c55cc9ba71..c72db051191 100644
--- a/code/modules/mob/new_player/preferences_setup.dm
+++ b/code/modules/mob/new_player/preferences_setup.dm
@@ -1,6 +1,10 @@
/datum/preferences
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
+ var/datum/robolimb/robohead
+ if(species == "Machine")
+ var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]"
+ robohead = all_robolimbs[head_model]
if(gender_override)
gender = gender_override
else
@@ -8,18 +12,39 @@
underwear = random_underwear(gender, species)
undershirt = random_undershirt(gender, species)
socks = random_socks(gender, species)
- if(species in list("Human", "Drask"))
- s_tone = random_skin_tone()
- h_style = random_hair_style(gender, species)
- f_style = random_facial_hair_style(gender, species)
- if(species == "Human" || species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Machine" || species == "Vulpkanin")
+ if(species == "Vulpkanin")
+ body_accessory = random_body_accessory(species)
+ if(body_accessory == "None") //Required to prevent a bug where the information/icons in the character preferences screen wouldn't update despite the data being changed.
+ body_accessory = null
+ if(species in list("Human", "Drask", "Vox"))
+ s_tone = random_skin_tone(species)
+ h_style = random_hair_style(gender, species, robohead)
+ f_style = random_facial_hair_style(gender, species, robohead)
+ if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
randomize_hair_color("hair")
- randomize_hair_color("facial")
- randomize_eyes_color()
- if(species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Vulpkanin")
+ randomize_hair_color("facial")
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine"))
+ ha_style = random_head_accessory(species)
+ var/list/colours = randomize_skin_color(1)
+ r_headacc = colours["red"]
+ g_headacc = colours["green"]
+ b_headacc = colours["blue"]
+ if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin"))
+ m_styles["head"] = random_marking_style("head", species, robohead, body_accessory, alt_head)
+ if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox"))
+ m_styles["body"] = random_marking_style("body", species, robohead, body_accessory, alt_head)
+ var/list/colours
+ for(var/location in list("head", "body", "tail"))
+ colours = randomize_skin_color(1)
+ m_colours[location] = rgb(colours["red"], colours["green"], colours["blue"])
+ if(species in list("Vox", "Vulpkanin")) //Species with tail markings.
+ m_styles["tail"] = random_marking_style("tail", species, robohead, body_accessory, alt_head)
+ if(species != "Machine")
+ randomize_eyes_color()
+ if(species in list("Unathi", "Tajaran", "Skrell", "Vulpkanin"))
randomize_skin_color()
backbag = 2
- age = rand(AGE_MIN,AGE_MAX)
+ age = rand(AGE_MIN, AGE_MAX)
/datum/preferences/proc/randomize_hair_color(var/target = "hair")
@@ -130,7 +155,7 @@
g_eyes = green
b_eyes = blue
-/datum/preferences/proc/randomize_skin_color()
+/datum/preferences/proc/randomize_skin_color(var/pass_to_list)
var/red
var/green
var/blue
@@ -174,9 +199,17 @@
green = max(min(green + rand (-25, 25), 255), 0)
blue = max(min(blue + rand (-25, 25), 255), 0)
- r_skin = red
- g_skin = green
- b_skin = blue
+ if(pass_to_list)
+ var/list/colours = list(
+ "red" = red,
+ "blue" = blue,
+ "green" = green
+ )
+ return colours
+ else
+ r_skin = red
+ g_skin = green
+ b_skin = blue
/datum/preferences/proc/blend_backpack(var/icon/clothes_s,var/backbag,var/satchel,var/backpack="backpack")
switch(backbag)
@@ -273,37 +306,30 @@
temp.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
if(current_species && (current_species.bodyflags & HAS_TAIL_MARKINGS))
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
- var/tail_marking = marking_styles["tail"]
+ var/tail_marking = m_styles["tail"]
var/datum/sprite_accessory/tail_marking_style = marking_styles_list[tail_marking]
if(tail_marking_style && tail_marking_style.species_allowed)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
var/icon/t_marking_s = new/icon("icon" = tail_marking_style.icon, "icon_state" = "[tail_marking_style.icon_state]_s")
- t_marking_s.Blend(rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8))), ICON_ADD)
+ t_marking_s.Blend(m_colours["tail"], ICON_ADD)
temp.Blend(t_marking_s, ICON_OVERLAY)
preview_icon.Blend(temp, ICON_OVERLAY)
//Markings
if(current_species && ((current_species.bodyflags & HAS_HEAD_MARKINGS) || (current_species.bodyflags & HAS_BODY_MARKINGS)))
- var/list/marking_styles = params2list(m_styles)
- var/list/marking_colours = params2list(m_colours)
if(current_species.bodyflags & HAS_BODY_MARKINGS) //Body markings.
- var/body_marking = marking_styles["body"]
+ var/body_marking = m_styles["body"]
var/datum/sprite_accessory/body_marking_style = marking_styles_list[body_marking]
if(body_marking_style && body_marking_style.species_allowed)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
var/icon/b_marking_s = new/icon("icon" = body_marking_style.icon, "icon_state" = "[body_marking_style.icon_state]_s")
- b_marking_s.Blend(rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8))), ICON_ADD)
+ b_marking_s.Blend(m_colours["body"], ICON_ADD)
preview_icon.Blend(b_marking_s, ICON_OVERLAY)
if(current_species.bodyflags & HAS_HEAD_MARKINGS) //Head markings.
- var/head_marking = marking_styles["head"]
+ var/head_marking = m_styles["head"]
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
if(head_marking_style && head_marking_style.species_allowed)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
var/icon/h_marking_s = new/icon("icon" = head_marking_style.icon, "icon_state" = "[head_marking_style.icon_state]_s")
- h_marking_s.Blend(rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8))), ICON_ADD)
+ h_marking_s.Blend(m_colours["head"], ICON_ADD)
preview_icon.Blend(h_marking_s, ICON_OVERLAY)
diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm
index 958cfa351f2..3a8dcb74216 100644
--- a/code/modules/mob/new_player/sprite_accessories.dm
+++ b/code/modules/mob/new_player/sprite_accessories.dm
@@ -68,7 +68,6 @@
bald
name = "Bald"
icon_state = "bald"
- gender = MALE
species_allowed = list("Human", "Unathi", "Vox", "Diona", "Kidan", "Grey", "Plasmaman", "Skeleton", "Vulpkanin", "Tajaran")
short
diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm
index 7771764c5a1..3487b45da96 100644
--- a/code/modules/nano/modules/human_appearance.dm
+++ b/code/modules/nano/modules/human_appearance.dm
@@ -67,9 +67,9 @@
if(can_change_skin_color())
var/new_skin = input(usr, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin)) as color|null
if(new_skin && can_still_topic(state))
- var/r_skin = hex2num(copytext(new_skin, 2, 4))
- var/g_skin = hex2num(copytext(new_skin, 4, 6))
- var/b_skin = hex2num(copytext(new_skin, 6, 8))
+ var/r_skin = color2R(new_skin)
+ var/g_skin = color2G(new_skin)
+ var/b_skin = color2B(new_skin)
if(owner.change_skin_color(r_skin, g_skin, b_skin))
update_dna()
return 1
@@ -82,9 +82,9 @@
if(can_change(APPEARANCE_HAIR_COLOR))
var/new_hair = input("Please select hair color.", "Hair Color", rgb(head_organ.r_hair, head_organ.g_hair, head_organ.b_hair)) as color|null
if(new_hair && can_still_topic(state))
- var/r_hair = hex2num(copytext(new_hair, 2, 4))
- var/g_hair = hex2num(copytext(new_hair, 4, 6))
- var/b_hair = hex2num(copytext(new_hair, 6, 8))
+ var/r_hair = color2R(new_hair)
+ var/g_hair = color2G(new_hair)
+ var/b_hair = color2B(new_hair)
if(owner.change_hair_color(r_hair, g_hair, b_hair))
update_dna()
return 1
@@ -92,9 +92,9 @@
if(can_change(APPEARANCE_SECONDARY_HAIR_COLOR))
var/new_hair = input("Please select secondary hair color.", "Secondary Hair Color", rgb(head_organ.r_hair_sec, head_organ.g_hair_sec, head_organ.b_hair_sec)) as color|null
if(new_hair && can_still_topic(state))
- var/r_hair_sec = hex2num(copytext(new_hair, 2, 4))
- var/g_hair_sec = hex2num(copytext(new_hair, 4, 6))
- var/b_hair_sec = hex2num(copytext(new_hair, 6, 8))
+ var/r_hair_sec = color2R(new_hair)
+ var/g_hair_sec = color2G(new_hair)
+ var/b_hair_sec = color2B(new_hair)
if(owner.change_hair_color(r_hair_sec, g_hair_sec, b_hair_sec, 1))
update_dna()
return 1
@@ -107,9 +107,9 @@
if(can_change(APPEARANCE_FACIAL_HAIR_COLOR))
var/new_facial = input("Please select facial hair color.", "Facial Hair Color", rgb(head_organ.r_facial, head_organ.g_facial, head_organ.b_facial)) as color|null
if(new_facial && can_still_topic(state))
- var/r_facial = hex2num(copytext(new_facial, 2, 4))
- var/g_facial = hex2num(copytext(new_facial, 4, 6))
- var/b_facial = hex2num(copytext(new_facial, 6, 8))
+ var/r_facial = color2R(new_facial)
+ var/g_facial = color2G(new_facial)
+ var/b_facial = color2B(new_facial)
if(owner.change_facial_hair_color(r_facial, g_facial, b_facial))
update_dna()
return 1
@@ -117,9 +117,9 @@
if(can_change(APPEARANCE_SECONDARY_FACIAL_HAIR_COLOR))
var/new_facial = input("Please select secondary facial hair color.", "Secondary Facial Hair Color", rgb(head_organ.r_facial_sec, head_organ.g_facial_sec, head_organ.b_facial_sec)) as color|null
if(new_facial && can_still_topic(state))
- var/r_facial_sec = hex2num(copytext(new_facial, 2, 4))
- var/g_facial_sec = hex2num(copytext(new_facial, 4, 6))
- var/b_facial_sec = hex2num(copytext(new_facial, 6, 8))
+ var/r_facial_sec = color2R(new_facial)
+ var/g_facial_sec = color2G(new_facial)
+ var/b_facial_sec = color2B(new_facial)
if(owner.change_facial_hair_color(r_facial_sec, g_facial_sec, b_facial_sec, 1))
update_dna()
return 1
@@ -127,9 +127,9 @@
if(can_change(APPEARANCE_EYE_COLOR))
var/new_eyes = input("Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)) as color|null
if(new_eyes && can_still_topic(state))
- var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
- var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
- var/b_eyes = hex2num(copytext(new_eyes, 6, 8))
+ var/r_eyes = color2R(new_eyes)
+ var/g_eyes = color2G(new_eyes)
+ var/b_eyes = color2B(new_eyes)
if(owner.change_eye_color(r_eyes, g_eyes, b_eyes))
update_dna()
return 1
@@ -142,9 +142,9 @@
if(can_change_head_accessory())
var/new_head_accessory = input("Please select head accessory color.", "Head Accessory Color", rgb(head_organ.r_headacc, head_organ.g_headacc, head_organ.b_headacc)) as color|null
if(new_head_accessory && can_still_topic(state))
- var/r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
- var/g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
- var/b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
+ var/r_headacc = color2R(new_head_accessory)
+ var/g_headacc = color2G(new_head_accessory)
+ var/b_headacc = color2B(new_head_accessory)
if(owner.change_head_accessory_color(r_headacc, g_headacc, b_headacc))
update_dna()
return 1
@@ -155,9 +155,7 @@
return 1
if(href_list["head_marking_color"])
if(can_change_markings("head"))
- var/list/marking_colours = params2list(owner.m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
- var/new_markings = input("Please select head marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))) as color|null
+ var/new_markings = input("Please select head marking color.", "Marking Color", owner.m_colours["head"]) as color|null
if(new_markings && can_still_topic(state))
if(owner.change_marking_color(new_markings, "head"))
update_dna()
@@ -169,9 +167,7 @@
return 1
if(href_list["body_marking_color"])
if(can_change_markings("body"))
- var/list/marking_colours = params2list(owner.m_colours)
- marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
- var/new_markings = input("Please select body marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8)))) as color|null
+ var/new_markings = input("Please select body marking color.", "Marking Color", owner.m_colours["body"]) as color|null
if(new_markings && can_still_topic(state))
if(owner.change_marking_color(new_markings, "body"))
update_dna()
@@ -183,9 +179,7 @@
return 1
if(href_list["tail_marking_color"])
if(can_change_markings("tail"))
- var/list/marking_colours = params2list(owner.m_colours)
- marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
- var/new_markings = input("Please select tail marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8)))) as color|null
+ var/new_markings = input("Please select tail marking color.", "Marking Color", owner.m_colours["tail"]) as color|null
if(new_markings && can_still_topic(state))
if(owner.change_marking_color(new_markings, "tail"))
update_dna()
@@ -246,8 +240,7 @@
data["change_head_markings"] = can_change_markings("head")
if(data["change_head_markings"])
- var/list/marking_styles = params2list(owner.m_styles)
- var/m_style = marking_styles["head"]
+ var/m_style = owner.m_styles["head"]
var/head_marking_styles[0]
for(var/head_marking_style in valid_head_marking_styles)
head_marking_styles[++head_marking_styles.len] = list("headmarkingstyle" = head_marking_style)
@@ -256,8 +249,7 @@
data["change_body_markings"] = can_change_markings("body")
if(data["change_body_markings"])
- var/list/marking_styles = params2list(owner.m_styles)
- var/m_style = marking_styles["body"]
+ var/m_style = owner.m_styles["body"]
var/body_marking_styles[0]
for(var/body_marking_style in valid_body_marking_styles)
body_marking_styles[++body_marking_styles.len] = list("bodymarkingstyle" = body_marking_style)
@@ -266,8 +258,7 @@
data["change_tail_markings"] = can_change_markings("tail")
if(data["change_tail_markings"])
- var/list/marking_styles = params2list(owner.m_styles)
- var/m_style = marking_styles["tail"]
+ var/m_style = owner.m_styles["tail"]
var/tail_marking_styles[0]
for(var/tail_marking_style in valid_tail_marking_styles)
tail_marking_styles[++tail_marking_styles.len] = list("tailmarkingstyle" = tail_marking_style)
diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm
index 0de37b1a652..74121e1537d 100644
--- a/code/modules/surgery/limb_reattach.dm
+++ b/code/modules/surgery/limb_reattach.dm
@@ -104,11 +104,9 @@
var/obj/item/organ/external/head/H = target.get_organ("head")
var/datum/robolimb/robohead = all_robolimbs[H.model]
if(robohead.is_monitor) //Ensures that if an IPC gets a head that's got a human hair wig attached to their body, the hair won't wipe.
- var/list/marking_styles = params2list(target.m_styles)
- H.h_style = ""
- H.f_style = ""
- marking_styles["head"] = "None"
- target.m_styles = list2params(marking_styles)
+ H.h_style = "Bald"
+ H.f_style = "Shaved"
+ target.m_styles["head"] = "None"
E.status &= ~ORGAN_DESTROYED
if(E.children)
for(var/obj/item/organ/external/C in E.children)
diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm
index 2f0eb84c1be..5e2521ca4c8 100644
--- a/code/modules/surgery/organs/organ_icon.dm
+++ b/code/modules/surgery/organs/organ_icon.dm
@@ -73,16 +73,13 @@ var/global/list/limb_icon_cache = list()
overlays |= lip_icon
mob_icon.Blend(lip_icon, ICON_OVERLAY)
- var/list/marking_styles = params2list(owner.m_styles)
- var/head_marking = marking_styles["head"]
+ var/head_marking = owner.m_styles["head"]
if(head_marking != "None")
- var/list/marking_colours = params2list(owner.m_colours)
- marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
if(head_marking_style && head_marking_style.species_allowed && (species.name in head_marking_style.species_allowed) && head_marking_style.marking_location == "head")
var/icon/h_marking_s = new/icon("icon" = head_marking_style.icon, "icon_state" = "[head_marking_style.icon_state]_s")
if(head_marking_style.do_colouration)
- h_marking_s.Blend(rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8))), ICON_ADD)
+ h_marking_s.Blend(owner.m_colours["head"], ICON_ADD)
overlays |= h_marking_s
if(H.ha_style)
diff --git a/icons/mob/eyes.dmi b/icons/mob/eyes.dmi
index 402bf49bd5c..c9441eb6d56 100644
Binary files a/icons/mob/eyes.dmi and b/icons/mob/eyes.dmi differ