diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index bf5eedb2075..bdf0c15b813 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -260,6 +260,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts switch(current_tab) if(TAB_CHAR) // Character Settings + var/datum/species/S = all_species[species] dat += "
" dat += "
" dat += "Name: " @@ -290,10 +291,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(species == "Grey") dat += "Voice: [speciesprefs ? "Wingdings" : "Normal"]
" dat += "Secondary Language: [language]
" - if(species in list("Unathi", "Tajaran", "Plasmaman", "Kidan")) + if(istype(S) && S.autohiss_basic_map) dat += "Auto-accent: [autohiss_mode == 2 ? "Full" : (autohiss_mode == 1 ? "Basic" : "Off")]
" dat += "Blood Type: [b_type]
" - if(species in list("Human", "Drask", "Vox")) + if(istype(S) && S.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE)) dat += "Skin Tone: [species == "Vox" ? "[s_tone]" : "[-s_tone + 35]/220"]
" dat += "Disabilities: \[Set\]
" dat += "Nanotrasen Relation: [nanotrasen_relation]
" @@ -305,7 +306,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "

Hair & Accessories

" - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine", "Kidan")) //Species that have head accessories. + if(istype(S) && S.bodyflags & HAS_HEAD_ACCESSORY) //Species that have head accessories. var/headaccessoryname = "Head Accessory: " if(species == "Unathi") headaccessoryname = "Horns: " @@ -313,15 +314,15 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "[ha_style] " dat += "Color [color_square(r_headacc, g_headacc, b_headacc)]
" - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(S) && S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. dat += "Head Markings: " 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", "Drask")) //Species with body markings/tattoos. + if(istype(S) && S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings/tattoos. dat += "Body Markings: " 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. + if(istype(S) && S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. dat += "Tail Markings: " dat += "[m_styles["tail"]]" dat += "Color [color_square(color2R(m_colours["tail"]), color2G(m_colours["tail"]), color2B(m_colours["tail"]))]
" @@ -347,7 +348,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Eyes: " dat += "Color [color_square(r_eyes, g_eyes, b_eyes)]
" - if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) //admins can always fuck with this, because they are admins + if((istype(S) && S.bodyflags & HAS_SKIN_COLOR) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) //admins can always fuck with this, because they are admins dat += "Body Color: " dat += "Color [color_square(r_skin, g_skin, b_skin)]
" @@ -364,7 +365,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Character Records
" dat += "

Limbs

" - if(species in list("Unathi")) //Species with alt heads. + if(istype(S) && S.bodyflags & HAS_ALT_HEADS) //Species with alt heads. dat += "Alternate Head: " dat += "[alt_head]
" dat += "Limbs and Parts: Adjust
" @@ -415,9 +416,12 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts else dat += "
" dat += "

Clothing

" - dat += "Underwear: [underwear]
" - dat += "Undershirt: [undershirt]
" - dat += "Socks: [socks]
" + if(istype(S) && S.clothing_flags & HAS_UNDERWEAR) + dat += "Underwear: [underwear]
" + if(istype(S) && S.clothing_flags & HAS_UNDERSHIRT) + dat += "Undershirt: [undershirt]
" + if(istype(S) && S.clothing_flags & HAS_SOCKS) + dat += "Socks: [socks]
" dat += "Backpack Type: [backbag]
" dat += "
" @@ -1071,7 +1075,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("input") var/dflag=text2num(href_list["disability"]) if(dflag >= 0) - if(!(dflag==DISABILITY_FLAG_FAT && species!=("Human" || "Tajaran" || "Grey"))) + if(dflag==DISABILITY_FLAG_FAT && (istype(S) && S.flags & CAN_BE_FAT)) disabilities ^= text2num(href_list["disability"]) //MAGIC SetDisabilities(user) else @@ -1157,7 +1161,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts switch(href_list["task"]) if("random") var/datum/robolimb/robohead - if(species == "Machine") + if(istype(S) && S.flags & ALL_RPARTS) var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]" robohead = all_robolimbs[head_model] switch(href_list["preference"]) @@ -1190,30 +1194,30 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("f_style") f_style = random_facial_hair_style(gender, species, robohead) if("headaccessory") - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have head accessories. + if(istype(S) && S.bodyflags & HAS_HEAD_ACCESSORY) //Species that have head accessories. r_headacc = rand(0,255) g_headacc = rand(0,255) b_headacc = rand(0,255) if("ha_style") - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have head accessories. + if(istype(S) && S.bodyflags & HAS_HEAD_ACCESSORY) //Species that have head accessories. ha_style = random_head_accessory(species) if("m_style_head") - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(S) && S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. m_styles["head"] = random_marking_style("head", species, robohead, null, alt_head) if("m_head_colour") - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(S) && S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. m_colours["head"] = rgb(rand(0,255), rand(0,255), rand(0,255)) if("m_style_body") - if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox", "Drask")) //Species with body markings. + if(istype(S) && S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings. m_styles["body"] = random_marking_style("body", species) if("m_body_colour") - if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox", "Drask")) //Species with body markings. + if(istype(S) && S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings. m_colours["body"] = rgb(rand(0,255), rand(0,255), rand(0,255)) if("m_style_tail") - if(species in list("Vox", "Vulpkanin")) //Species with tail markings. + if(istype(S) && S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. m_styles["tail"] = random_marking_style("tail", species, null, body_accessory) if("m_tail_colour") - if(species in list("Vox", "Vulpkanin")) //Species with tail markings. + if(istype(S) && S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. m_colours["tail"] = rgb(rand(0,255), rand(0,255), rand(0,255)) if("underwear") underwear = random_underwear(gender, species) @@ -1229,10 +1233,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts g_eyes = rand(0,255) b_eyes = rand(0,255) if("s_tone") - if(species in list("Human", "Drask", "Vox")) + if(istype(S) && S.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE)) s_tone = random_skin_tone() if("s_color") - if(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Wryn", "Vulpkanin", "Machine")) + if(istype(S) && S.bodyflags & HAS_SKIN_COLOR) r_skin = rand(0,255) g_skin = rand(0,255) b_skin = rand(0,255) @@ -1278,7 +1282,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(NS.has_gender && gender == PLURAL) gender = pick(MALE,FEMALE) var/datum/robolimb/robohead - if(species == "Machine") + if(istype(NS) && NS.flags & ALL_RPARTS) 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 @@ -1287,7 +1291,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts //grab one of the valid facial hair styles for the newly chosen species f_style = random_facial_hair_style(gender, species, robohead) - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have head accessories. + if(istype(NS) && NS.bodyflags & HAS_HEAD_ACCESSORY) //Species that have head accessories. ha_style = random_head_accessory(species) else ha_style = "None" // No Vulp ears on Unathi @@ -1295,19 +1299,19 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts g_headacc = 0 b_headacc = 0 - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(NS) && NS.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. m_styles["head"] = random_marking_style("head", species, robohead, null, alt_head) else m_styles["head"] = "None" m_colours["head"] = "#000000" - if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox", "Drask")) //Species with body markings/tattoos. + if(istype(NS) && NS.bodyflags & HAS_BODY_MARKINGS) //Species with body markings/tattoos. m_styles["body"] = random_marking_style("body", species) else m_styles["body"] = "None" m_colours["body"] = "#000000" - if(species in list("Vox", "Vulpkanin")) //Species with tail markings. + if(istype(NS) && NS.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. m_styles["tail"] = random_marking_style("tail", species, null, body_accessory) else m_styles["tail"] = "None" @@ -1327,12 +1331,12 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts socks = random_socks(gender, species) //reset skin tone and colour - if(species in list("Human", "Drask", "Vox")) + if(istype(NS) && NS.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE)) random_skin_tone(species) else s_tone = 0 - if(!(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine"))) + if(!(istype(NS) && NS.bodyflags & HAS_SKIN_COLOR)) r_skin = 0 g_skin = 0 b_skin = 0 @@ -1346,7 +1350,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts organ_data = list() rlimb_data = list() - if(!(species in list("Unathi", "Tajaran", "Plasmaman", "Kidan"))) + if(!(istype(NS) && NS.autohiss_basic_map)) autohiss_mode = 0 if("speciesprefs") speciesprefs = !speciesprefs //Starts 0, so if someone clicks the button up top there, this won't be 0 anymore. If they click it again, it'll go back to 0. @@ -1373,7 +1377,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts language = input("Please select a secondary language", "Character Generation", null) in new_languages if("autohiss_mode") - if(species in list("Unathi", "Tajaran", "Plasmaman", "Kidan")) + if(istype(S) && S.autohiss_basic_map) var/list/autohiss_choice = list("Off" = 0, "Basic" = 1, "Full" = 2) var/new_autohiss_pref = input(user, "Choose your character's auto-accent level:", "Character Preference") as null|anything in autohiss_choice autohiss_mode = autohiss_choice[new_autohiss_pref] @@ -1415,7 +1419,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(hairstyle == "Bald") //Just in case. valid_hairstyles += hairstyle continue - if(species == "Machine") //Species that can use prosthetic heads. + if(istype(S) && S.flags & ALL_RPARTS) //Species that can use prosthetic heads. var/head_model if(!rlimb_data["head"]) //Handle situations where the head is default. head_model = "Morpheus Cyberkinetics" @@ -1437,7 +1441,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts h_style = new_h_style if("headaccessory") - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine", "Kidan")) //Species with head accessories. + if(istype(S) && S.bodyflags & HAS_HEAD_ACCESSORY) //Species with head accessories. 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) @@ -1446,7 +1450,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts b_headacc = color2B(new_head_accessory) if("ha_style") - if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine", "Kidan")) //Species with head accessories. + if(istype(S) && S.bodyflags & HAS_HEAD_ACCESSORY) //Species with head accessories. var/list/valid_head_accessory_styles = list() for(var/head_accessory_style in head_accessory_styles_list) var/datum/sprite_accessory/H = head_accessory_styles_list[head_accessory_style] @@ -1462,7 +1466,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("alt_head") if(organ_data["head"] == "cyborg") return - if(species in list("Unathi")) //Species with alt heads. + if(istype(S) && S.bodyflags & HAS_ALT_HEADS) //Species with alt heads. var/list/valid_alt_heads = list() valid_alt_heads["None"] = alt_heads_list["None"] //The only null entry should be the "None" option for(var/alternate_head in alt_heads_list) @@ -1482,7 +1486,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts m_styles["head"] = "None" if("m_style_head") - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(S) && S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. var/list/valid_markings = list() valid_markings["None"] = marking_styles_list["None"] for(var/markingstyle in marking_styles_list) @@ -1498,7 +1502,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(M.heads_allowed && !("All" in M.heads_allowed)) continue - if(species == "Machine") //Species that can use prosthetic heads. + if(istype(S) && S.flags & ALL_RPARTS) //Species that can use prosthetic heads. var/head_model if(!rlimb_data["head"]) //Handle situations where the head is default. head_model = "Morpheus Cyberkinetics" @@ -1518,14 +1522,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts m_styles["head"] = new_marking_style if("m_head_colour") - if(species in list("Machine", "Tajaran", "Unathi", "Vulpkanin")) //Species with head markings. + if(istype(S) && S.bodyflags & HAS_HEAD_MARKINGS) //Species with head markings. var/input = "Choose the colour of your your character's head markings:" var/new_markings = input(user, input, "Character Preference", m_colours["head"]) as color|null if(new_markings) m_colours["head"] = new_markings if("m_style_body") - if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox", "Drask")) //Species with body markings/tattoos. + if(istype(S) && S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings/tattoos. var/list/valid_markings = list() valid_markings["None"] = marking_styles_list["None"] for(var/markingstyle in marking_styles_list) @@ -1542,14 +1546,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts m_styles["body"] = new_marking_style if("m_body_colour") - if(species in list("Human", "Unathi", "Grey", "Vulpkanin", "Tajaran", "Skrell", "Vox", "Drask")) //Species with body markings/tattoos. + if(istype(S) && S.bodyflags & HAS_BODY_MARKINGS) //Species with body markings/tattoos. var/input = "Choose the colour of your your character's body markings:" var/new_markings = input(user, input, "Character Preference", m_colours["body"]) as color|null if(new_markings) m_colours["body"] = new_markings if("m_style_tail") - if(species in list("Vox", "Vulpkanin")) //Species with tail markings. + if(istype(S) && S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. var/list/valid_markings = list() valid_markings["None"] = marking_styles_list["None"] for(var/markingstyle in marking_styles_list) @@ -1572,7 +1576,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts m_styles["tail"] = new_marking_style if("m_tail_colour") - if(species in list("Vox", "Vulpkanin")) //Species with tail markings. + if(istype(S) && S.bodyflags & HAS_TAIL_MARKINGS) //Species with tail markings. var/input = "Choose the colour of your your character's tail markings:" var/new_markings = input(user, input, "Character Preference", m_colours["tail"]) as color|null if(new_markings) @@ -1702,17 +1706,26 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts b_eyes = color2B(new_eyes) if("s_tone") - if(species == "Human" || species == "Drask") + if(istype(S) && S.bodyflags & HAS_SKIN_TONE) var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null if(new_s_tone) s_tone = 35 - max(min(round(new_s_tone), 220), 1) - else if(species == "Vox") - var/skin_c = input(user, "Choose your Vox's skin color:\n(1 = Default Green, 2 = Dark Green, 3 = Brown, 4 = Grey, \n5 = Emerald, 6 = Azure)", "Character Preference") as num|null - if(skin_c) - s_tone = max(min(round(skin_c), 6), 1) + else if(istype(S) && S.bodyflags & HAS_ICON_SKIN_TONE) + var/const/MAX_LINE_ENTRIES = 4 + var/prompt = "Choose your character's skin tone: 1-[S.icon_skin_tones.len]\n(" + for(var/i = 1 to S.icon_skin_tones.len) + if(i > MAX_LINE_ENTRIES && !((i - 1) % MAX_LINE_ENTRIES)) + prompt += "\n" + prompt += "[i] = [S.icon_skin_tones[i]]" + if(i != S.icon_skin_tones.len) + prompt += ", " + prompt += ")" + var/skin_c = input(user, prompt, "Character Preference") as num|null + if(isnum(skin_c)) + s_tone = max(min(round(skin_c), S.icon_skin_tones.len), 1) if("skin") - if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) + if((istype(S) && S.bodyflags & HAS_SKIN_COLOR) || 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 = color2R(new_skin) @@ -1746,7 +1759,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("limbs") var/valid_limbs = list("Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand") - if(species == "Machine") + if(istype(S) && S.flags & ALL_RPARTS) valid_limbs = list("Torso", "Lower Body", "Head", "Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand") var/limb_name = input(user, "Which limb do you want to change?") as null|anything in valid_limbs if(!limb_name) return @@ -1782,19 +1795,19 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts second_limb = "r_hand" if("Left Foot") limb = "l_foot" - if(species != "Machine") + if(!(istype(S) && S.flags & ALL_RPARTS)) third_limb = "l_leg" if("Right Foot") limb = "r_foot" - if(species != "Machine") + if(!(istype(S) && S.flags & ALL_RPARTS)) third_limb = "r_leg" if("Left Hand") limb = "l_hand" - if(species != "Machine") + if(!(istype(S) && S.flags & ALL_RPARTS)) third_limb = "l_arm" if("Right Hand") limb = "r_hand" - if(species != "Machine") + if(!(istype(S) && S.flags & ALL_RPARTS)) third_limb = "r_arm" var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states @@ -1850,7 +1863,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(subchoice) choice = subchoice if(limb in list("head", "chest", "groin")) - if(species != "Machine") + if(!(istype(S) && S.flags & ALL_RPARTS)) return if(limb == "head") ha_style = "None"