Adds Body Markings

So you can customize your character with tattoos or fur colors for Taj or whatever. I'll let Anewbe work out what he wants to whitelist other than what I did already.

The icons are sliced up with the HumanScissors program I wrote, so they are per-organ. So, lop off a limb, put it on someone else, they have the tattoos and whatnot. It's part of DNA so it comes with when cloning.

They are defined in the normal sprite_accessories file and the icons are all in markings.dm in the format of "markingname-organtag" so if you have a marking that spans both arms and torso you need "thatone-torso", "thatone-l_arm", "thatone-r_arm" icon states.
This commit is contained in:
Arokha Sieyes
2017-03-26 19:36:34 -04:00
parent eb73ee4b44
commit 52130160db
12 changed files with 300 additions and 9 deletions

View File

@@ -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)

View File

@@ -84,6 +84,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!
@@ -93,6 +94,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)
@@ -152,6 +154,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.

View File

@@ -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))

View File

@@ -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

View File

@@ -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))
. += "<br><b>Body Color</b><br>"
. += "<a href='?src=\ref[src];skin_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin)]'><tr><td>__</td></tr></table></font><br>"
. += "<br><a href='?src=\ref[src];marking_style=1'>Body Markings +</a><br>"
for(var/M in pref.body_markings)
. += "[M] <a href='?src=\ref[src];marking_remove=[M]'>-</a> <a href='?src=\ref[src];marking_color=[M]'>Color</a>"
. += "<font face='fixedsys' size='3' color='[pref.body_markings[M]]'><table style='display:inline;' bgcolor='[pref.body_markings[M]]'><tr><td>__</td></tr></table></font>"
. += "<br>"
. = 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

View File

@@ -263,7 +263,8 @@
/datum/category_item/player_setup_item/proc/get_FBP_type()
if(!is_FBP())
return 0 // Not a robot.
switch(pref.organ_data["brain"])
if(O_BRAIN in pref.organ_data)
switch(pref.organ_data[O_BRAIN])
if("assisted")
return PREF_FBP_CYBORG
if("mechanical")

View File

@@ -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()

View File

@@ -276,6 +276,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"]]"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"

View File

@@ -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

View File

@@ -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

View File

@@ -65,6 +65,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))
@@ -114,6 +123,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])

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB