mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user