diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index fcc2d0c91b..72937092c4 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -51,6 +51,7 @@ var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessor var/global/list/facial_hair_styles_male_list = list() var/global/list/facial_hair_styles_female_list = list() var/global/list/skin_styles_female_list = list() //unused +var/global/list/body_marking_styles_list = list() //stores /datum/sprite_accessory/marking indexed by name //Underwear var/datum/category_collection/underwear/global_underwear = new() @@ -141,6 +142,12 @@ var/global/list/string_slot_flags = list( facial_hair_styles_male_list += H.name facial_hair_styles_female_list += H.name + //Body markings - Initialise all /datum/sprite_accessory/marking into an list indexed by marking name + paths = typesof(/datum/sprite_accessory/marking) - /datum/sprite_accessory/marking + for(var/path in paths) + var/datum/sprite_accessory/marking/M = new path() + body_marking_styles_list[M.name] = M + //Surgery Steps - Initialize all /datum/surgery_step into a list paths = typesof(/datum/surgery_step)-/datum/surgery_step for(var/T in paths) diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 45ccd0f678..6866f8fcb4 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -94,6 +94,7 @@ var/global/list/datum/dna/gene/dna_genes[0] // New stuff var/species = "Human" + var/list/body_markings = list() // Make a copy of this strand. // USE THIS WHEN COPYING STUFF OR YOU'LL GET CORRUPTION! @@ -103,6 +104,7 @@ var/global/list/datum/dna/gene/dna_genes[0] new_dna.b_type=b_type new_dna.real_name=real_name new_dna.species=species + new_dna.body_markings=body_markings.Copy() for(var/b=1;b<=DNA_SE_LENGTH;b++) new_dna.SE[b]=SE[b] if(b<=DNA_UI_LENGTH) @@ -196,6 +198,11 @@ var/global/list/datum/dna/gene/dna_genes[0] SetUIValueRange(DNA_UI_HAIR_STYLE, hair, hair_styles_list.len, 1) SetUIValueRange(DNA_UI_BEARD_STYLE, beard, facial_hair_styles_list.len,1) + body_markings.Cut() + for(var/obj/item/organ/external/E in character.organs) + if(E.markings.len) + body_markings[E.organ_tag] = E.markings.Copy() + UpdateUI() // Set a DNA UI block's raw value. diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 4aae068d22..129bb025ae 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -156,6 +156,13 @@ else H.gender = MALE + //Body markings + for(var/tag in dna.body_markings) + var/obj/item/organ/external/E = H.organs_by_name[tag] + if(E) + var/list/marklist = dna.body_markings[tag] + E.markings = marklist.Copy() + //Hair var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE,hair_styles_list.len) if((0 < hair) && (hair <= hair_styles_list.len)) diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index 94dc40578f..36aa0249e4 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -130,7 +130,11 @@ datum/preferences/proc/set_biological_gender(var/gender) return ..() /datum/category_item/player_setup_item/general/basic/proc/get_genders() - var/datum/species/S = all_species[pref.species] + var/datum/species/S + if(pref.species) + S = all_species[pref.species] + else + S = all_species["Human"] var/list/possible_genders = S.genders if(!pref.organ_data || pref.organ_data[BP_TORSO] != "cyborg") return possible_genders diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 68c88b4968..b4276400c1 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -28,6 +28,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["disabilities"] >> pref.disabilities S["organ_data"] >> pref.organ_data S["rlimb_data"] >> pref.rlimb_data + S["body_markings"] >> pref.body_markings pref.preview_icon = null /datum/category_item/player_setup_item/general/body/save_character(var/savefile/S) @@ -51,6 +52,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["disabilities"] << pref.disabilities S["organ_data"] << pref.organ_data S["rlimb_data"] << pref.rlimb_data + S["body_markings"] << pref.body_markings /datum/category_item/player_setup_item/general/body/sanitize_character(var/savefile/S) if(!pref.species || !(pref.species in playable_species)) @@ -75,6 +77,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.disabilities = sanitize_integer(pref.disabilities, 0, 65535, initial(pref.disabilities)) if(!pref.organ_data) pref.organ_data = list() if(!pref.rlimb_data) pref.rlimb_data = list() + if(!pref.body_markings) pref.body_markings = list() + else pref.body_markings &= body_marking_styles_list // Moved from /datum/preferences/proc/copy_to() /datum/category_item/player_setup_item/general/body/copy_to_mob(var/mob/living/carbon/human/character) @@ -123,6 +127,20 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O I.robotize() else if(status == "digital") I.digitize() + + for(var/N in character.organs_by_name) + var/obj/item/organ/external/O = character.organs_by_name[N] + O.markings.Cut() + + for(var/M in pref.body_markings) + var/datum/sprite_accessory/marking/mark_datum = body_marking_styles_list[M] + var/mark_color = "[pref.body_markings[M]]" + + for(var/BP in mark_datum.body_parts) + var/obj/item/organ/external/O = character.organs_by_name[BP] + if(O) + O.markings[M] = list("color" = mark_color, "datum" = mark_datum) + return /datum/category_item/player_setup_item/general/body/content(var/mob/user) @@ -251,6 +269,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(has_flag(mob_species, HAS_SKIN_COLOR)) . += "
Body Color
" . += "Change Color
__

" + + . += "
Body Markings +
" + for(var/M in pref.body_markings) + . += "[M] - Color" + . += "
__
" + . += "
" + . = jointext(.,null) /datum/category_item/player_setup_item/general/body/proc/has_flag(var/datum/species/mob_species, var/flag) @@ -289,7 +314,6 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!(pref.biological_gender in mob_species.genders)) pref.set_biological_gender(mob_species.genders[1]) - //grab one of the valid hair styles for the newly chosen species var/list/valid_hairstyles = list() for(var/hairstyle in hair_styles_list) @@ -334,6 +358,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.s_tone = 0 reset_limbs() // Safety for species with incompatible manufacturers; easier than trying to do it case by case. + pref.body_markings.Cut() // Basically same as above. var/min_age = get_min_age() var/max_age = get_max_age() @@ -421,6 +446,32 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.f_style = new_f_style return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["marking_style"]) + var/list/usable_markings = pref.body_markings.Copy() ^ body_marking_styles_list.Copy() + for(var/M in usable_markings) + var/datum/sprite_accessory/S = usable_markings[M] + if(!S.species_allowed.len) + continue + else if(!(pref.species in S.species_allowed)) + usable_markings -= M + + var/new_marking = input(user, "Choose a body marking:", "Character Preference") as null|anything in usable_markings + if(new_marking && CanUseTopic(user)) + pref.body_markings[new_marking] = "#000000" //New markings start black + return TOPIC_REFRESH_UPDATE_PREVIEW + + else if(href_list["marking_remove"]) + var/M = href_list["marking_remove"] + pref.body_markings -= M + return TOPIC_REFRESH_UPDATE_PREVIEW + + else if(href_list["marking_color"]) + var/M = href_list["marking_color"] + var/mark_color = input(user, "Choose the [M] color: ", "Character Preference", pref.body_markings[M]) as color|null + if(mark_color && CanUseTopic(user)) + pref.body_markings[M] = "[mark_color]" + return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["reset_limbs"]) reset_limbs() return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/code/modules/client/preference_setup/preference_setup.dm b/code/modules/client/preference_setup/preference_setup.dm index f72ff0645c..b3c253647e 100644 --- a/code/modules/client/preference_setup/preference_setup.dm +++ b/code/modules/client/preference_setup/preference_setup.dm @@ -263,13 +263,14 @@ /datum/category_item/player_setup_item/proc/get_FBP_type() if(!is_FBP()) return 0 // Not a robot. - switch(pref.organ_data["brain"]) - if("assisted") - return PREF_FBP_CYBORG - if("mechanical") - return PREF_FBP_POSI - if("digital") - return PREF_FBP_SOFTWARE + if(O_BRAIN in pref.organ_data) + switch(pref.organ_data[O_BRAIN]) + if("assisted") + return PREF_FBP_CYBORG + if("mechanical") + return PREF_FBP_POSI + if("digital") + return PREF_FBP_SOFTWARE return 0 //Something went wrong! /datum/category_item/player_setup_item/proc/get_min_age() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 824b7a988b..2c35c44fff 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -88,6 +88,8 @@ datum/preferences var/list/rlimb_data = list() var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor" + var/list/body_markings = list() // "name" = "#rgbcolor" + var/list/flavor_texts = list() var/list/flavour_texts_robot = list() diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 7b46894221..57daff2b76 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -268,6 +268,8 @@ var/global/list/damage_icon_parts = list() icon_key += "[rgb(part.h_col[1],part.h_col[2],part.h_col[3])]" else icon_key += "#000000" + for(var/M in part.markings) + icon_key += "[M][part.markings[M]["color"]]" if(part.robotic >= ORGAN_ROBOT) icon_key += "2[part.model ? "-[part.model]": ""]" diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index 9e2cdf02e0..2b40db75aa 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -973,6 +973,197 @@ species_allowed = list("Teshari") gender = NEUTER +/* +//////////////////////////// +/ =--------------------= / +/ == Body Markings == / +/ =--------------------= / +//////////////////////////// +*/ +/datum/sprite_accessory/marking + icon = 'icons/mob/human_races/markings.dmi' + do_colouration = 1 //Almost all of them have it, COLOR_ADD + + //Empty list is unrestricted. Should only restrict the ones that make NO SENSE on other species, + //like Tajara inner-ear coloring overlay stuff. + species_allowed = list() + + var/body_parts = list() //A list of bodyparts this covers, in organ_tag defines + //Reminder: BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_TORSO,BP_GROIN,BP_HEAD + + tat_heart + name = "Tattoo (Heart, Torso)" + icon_state = "tat_heart" + body_parts = list(BP_TORSO) + + tat_hive + name = "Tattoo (Hive, Back)" + icon_state = "tat_hive" + body_parts = list(BP_TORSO) + + tat_nightling + name = "Tattoo (Nightling, Back)" + icon_state = "tat_nightling" + body_parts = list(BP_TORSO) + + tat_campbell + name = "Tattoo (Campbell, R.Arm)" + icon_state = "tat_campbell" + body_parts = list(BP_R_ARM) + + tat_tiger + name = "Tattoo (Tiger Stripes, Body)" + icon_state = "tat_campbell" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_TORSO,BP_GROIN) + + taj_paw_socks + name = "Socks Coloration (Taj)" + icon_state = "taj_pawsocks" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND) + species_allowed = list("Tajara") + + una_paw_socks + name = "Socks Coloration (Una)" + icon_state = "una_pawsocks" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND) + species_allowed = list("Unathi") + + paw_socks + name = "Socks Coloration (Generic)" + icon_state = "pawsocks" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND) + + paw_socks_belly + name = "Socks+Belly Coloration (Generic)" + icon_state = "pawsocksbelly" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_GROIN,BP_TORSO) + + belly_hands_feet + name = "Hands/Feet/Belly Color (Minor)" + icon_state = "bellyhandsfeetsmall" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_GROIN,BP_TORSO) + + hands_feet_belly_full + name = "Hands/Feet/Belly Color (Major)" + icon_state = "bellyhandsfeet" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_GROIN,BP_TORSO) + + patches + name = "Color Patches" + icon_state = "patches" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_TORSO,BP_GROIN) + + patchesface + name = "Color Patches (Face)" + icon_state = "patchesface" + body_parts = list(BP_HEAD) + + bands + name = "Color Bands" + icon_state = "bands" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_L_HAND,BP_R_HAND,BP_TORSO,BP_GROIN) + + bandsface + name = "Color Bands (Face)" + icon_state = "bandsface" + body_parts = list(BP_HEAD) + + tiger_stripes + name = "Tiger Stripes" + icon_state = "tiger" + body_parts = list(BP_L_FOOT,BP_R_FOOT,BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_TORSO,BP_GROIN) + species_allowed = list("Tajara") //There's a tattoo for non-cats + + tigerhead + name = "Tiger Stripes (Head, Minor)" + icon_state = "tigerhead" + body_parts = list(BP_HEAD) + + tigerface + name = "Tiger Stripes (Head, Major)" + icon_state = "tigerface" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") //There's a tattoo for non-cats + + backstripe + name = "Back Stripe" + icon_state = "backstripe" + body_parts = list(BP_TORSO) + + //Taj specific stuff + taj_belly + name = "Belly Fur (Taj)" + icon_state = "taj_belly" + body_parts = list(BP_TORSO) + species_allowed = list("Tajara") + + taj_bellyfull + name = "Belly Fur Wide (Taj)" + icon_state = "taj_bellyfull" + body_parts = list(BP_TORSO) + species_allowed = list("Tajara") + + taj_earsout + name = "Outer Ear (Taj)" + icon_state = "taj_earsout" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + taj_earsin + name = "Inner Ear (Taj)" + icon_state = "taj_earsin" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + taj_nose + name = "Nose Color (Taj)" + icon_state = "taj_nose" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + taj_crest + name = "Chest Fur Crest (Taj)" + icon_state = "taj_crest" + body_parts = list(BP_TORSO) + species_allowed = list("Tajara") + + taj_muzzle + name = "Muzzle Color (Taj)" + icon_state = "taj_muzzle" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + taj_face + name = "Cheeks Color (Taj)" + icon_state = "taj_face" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + taj_all + name = "All Taj Head (Taj)" + icon_state = "taj_all" + body_parts = list(BP_HEAD) + species_allowed = list("Tajara") + + //Una specific stuff + una_face + name = "Face Color (Una)" + icon_state = "una_face" + body_parts = list(BP_HEAD) + species_allowed = list("Unathi") + + una_facelow + name = "Face Color Low (Una)" + icon_state = "una_facelow" + body_parts = list(BP_HEAD) + species_allowed = list("Unathi") + + una_scutes + name = "Scutes (Una)" + icon_state = "una_scutes" + body_parts = list(BP_TORSO) + species_allowed = list("Unathi") + //skin styles - WIP //going to have to re-integrate this with surgery //let the icon_state hold an icon preview for now diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 017d6b4bcd..2b7188462d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -39,6 +39,7 @@ var/list/h_col // hair colour var/body_hair // Icon blend for body hair if any. var/mob/living/applied_pressure + var/list/markings = list() // Markings (body_markings) to apply to the icon // Wound and structural data. var/wound_update_accuracy = 1 // how often wounds should be updated, a higher number means less often diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 4074d3aaab..c64fb36cc4 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -69,6 +69,15 @@ var/global/list/limb_icon_cache = list() overlays |= lip_icon mob_icon.Blend(lip_icon, ICON_OVERLAY) + //Head markings, duplicated (sadly) below. + for(var/M in markings) + var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"] + var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]") + mark_s.Blend(markings[M]["color"], ICON_ADD) + overlays |= mark_s //So when it's not on your body, it has icons + mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons + icon_cache_key += "[M][markings[M]["color"]]" + if(owner.f_style) var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style] if(facial_hair_style && facial_hair_style.species_allowed && (species.get_bodytype(owner) in facial_hair_style.species_allowed)) @@ -119,6 +128,15 @@ var/global/list/limb_icon_cache = list() mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]") apply_colouration(mob_icon) + //Body markings, does not include head, duplicated (sadly) above. + for(var/M in markings) + var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"] + var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]") + mark_s.Blend(markings[M]["color"], ICON_ADD) + overlays |= mark_s //So when it's not on your body, it has icons + mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons + icon_cache_key += "[M][markings[M]["color"]]" + if(body_hair && islist(h_col) && h_col.len >= 3) var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]" if(!limb_icon_cache[cache_key]) diff --git a/icons/mob/human_races/markings.dmi b/icons/mob/human_races/markings.dmi new file mode 100644 index 0000000000..e1f77c077e Binary files /dev/null and b/icons/mob/human_races/markings.dmi differ