cosmetic parts are working

This commit is contained in:
sarcoph
2022-05-12 01:11:12 -08:00
parent bf112ac42f
commit f4cd08e82e
11 changed files with 239 additions and 57 deletions
+127 -11
View File
@@ -102,16 +102,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//HS13
var/body_size = 100 //Body Size in percent
var/can_get_preg = 0 //if they can get preggers
var/list/cosmetic_parts = list(
BODY_ZONE_L_ARM
)
//HS13 jobs
var/sillyroles = FALSE //for clown and mime
var/roleplayroles = FALSE //for the roleplay roles
var/importantroles = FALSE //for things that define as important.
var/datum/species/pref_species = new /datum/species/human() //Mutant race
var/list/features = list("mcolor" = "FFF",
"tail_lizard" = "Smooth",
@@ -200,12 +196,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
"silicon_flavor_text" = "",
"ooc_text" = "",
"front_genitals_over_hair" = FALSE,
"cosmetic_head" = "default",
"cosmetic_chest" = "default",
"cosmetic_l_arm" = "default",
"cosmetic_r_arm" = "default",
"cosmetic_l_leg" = "default",
"cosmetic_r_leg" = "default"
"cosmetic_head" = /datum/cosmetic_part/head/default,
"cosmetic_chest" = /datum/cosmetic_part/chest/default,
"cosmetic_l_arm" = /datum/cosmetic_part/arms/default,
"cosmetic_r_arm" = /datum/cosmetic_part/arms/default,
"cosmetic_l_leg" = /datum/cosmetic_part/legs/default,
"cosmetic_r_leg" = /datum/cosmetic_part/legs/default
)
/// Security record note section
@@ -833,8 +829,53 @@ GLOBAL_LIST_EMPTY(preferences_datums)
mutant_category = 0
dat += "</tr></table>"
dat += "</td>"
// HYPER EDIT: Cosmetic body parts
var/datum/cosmetic_part/cosmetic_head = features["cosmetic_head"]
var/datum/cosmetic_part/cosmetic_chest = features["cosmetic_chest"]
var/datum/cosmetic_part/cosmetic_arms = features["cosmetic_l_arm"]
var/datum/cosmetic_part/cosmetic_legs = features["cosmetic_l_leg"]
dat += "<div style='width:100%;display:block;'>"
dat += "<h2>Cosmetic Parts</h2>"
dat += "<div style='display:flex; align-items:stretch; justify-content:space-between;'>"
dat += "<div style='flex: 1 1 0;'>"
dat += "<h3 style='text-align:center;'>Head</h3>"
dat += "<a style='display:block; width:100px'"
dat += "href='?_src_=prefs;preference=cosmetic_head;task=input'>"
dat += cosmetic_head.name
dat += "</a>"
dat += "</div>"
dat += "<div style='flex: 1 1 0;'>"
dat += "<h3 style='text-align:center;'>Chest</h3>"
dat += "<a style='display:block; width:100px'"
dat += "href='?_src_=prefs;preference=cosmetic_chest;task=input'>"
dat += cosmetic_chest.name
dat += "</a>"
dat += "</div>"
dat += "<div style='flex: 1 1 0;'>"
dat += "<h3 style='text-align:center;'>Arms</h3>"
dat += "<a style='display:block; width:100px'"
dat += "href='?_src_=prefs;preference=cosmetic_arms;task=input'>"
dat += cosmetic_arms.name
dat += "</a>"
dat += "</div>"
dat += "<div style='flex: 1 1 0;'>"
dat += "<h3 style='text-align:center;'>Legs</h3>"
dat += "<a style='display:block; width:100px'"
dat += "href='?_src_=prefs;preference=cosmetic_legs;task=input'>"
dat += cosmetic_legs.name
dat += "</a>"
dat += "</div>"
dat += "</div>"
dat += "</div>"
// End hyper edit
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>Clothing & Equipment</h2>"
dat += "<b>Underwear:</b><a style='display:block;width:100px' href ='?_src_=prefs;preference=underwear;task=input'>[underwear]</a>"
@@ -2297,6 +2338,81 @@ GLOBAL_LIST_EMPTY(preferences_datums)
new_dors = input(user, "Choose your character's dorsal tube type:", "Character Preference") as null|anything in GLOB.xeno_dorsal_list
if(new_dors)
features["xenodorsal"] = new_dors
// HYPER EDIT: Cosmetic body parts
if("cosmetic_head")
var/list/selectable_parts = list()
for(var/path in GLOB.cosmetic_heads)
var/datum/cosmetic_part/possible_part = GLOB.cosmetic_heads[path]
var/list/supported_species = possible_part.supported_species
if(!show_mismatched_markings && supported_species && !supported_species.Find(pref_species.id))
continue
selectable_parts[path] = possible_part
if(!selectable_parts.len)
to_chat(user, "<span class='warning'>There are no valid alt heads for this species!</span>")
var/new_cosmetic_part
var/question = "Choose your character's alt head style:"
new_cosmetic_part = input(user, question, "Character Preference") as null|anything in selectable_parts
if(new_cosmetic_part)
features["cosmetic_head"] = GLOB.cosmetic_heads[new_cosmetic_part]
if("cosmetic_chest")
var/list/selectable_parts = list()
for(var/path in GLOB.cosmetic_chests)
var/datum/cosmetic_part/possible_part = GLOB.cosmetic_chests[path]
var/list/supported_species = possible_part.supported_species
if(!show_mismatched_markings && supported_species && !supported_species.Find(pref_species.id))
continue
selectable_parts[path] = possible_part
if(!selectable_parts.len)
to_chat(user, "<span class='warning'>There are no valid alt chests for this species!</span>")
var/new_cosmetic_part
var/question = "Choose your character's alt chest style:"
new_cosmetic_part = input(user, question, "Character Preference") as null|anything in selectable_parts
if(new_cosmetic_part)
features["cosmetic_chest"] = GLOB.cosmetic_chests[new_cosmetic_part]
// currently symmetrical
if("cosmetic_arms")
var/list/selectable_parts = list()
for(var/path in GLOB.cosmetic_arms)
var/datum/cosmetic_part/possible_part = GLOB.cosmetic_arms[path]
var/list/supported_species = possible_part.supported_species
if(!show_mismatched_markings && supported_species && !supported_species.Find(pref_species.id))
continue
selectable_parts[path] = possible_part
if(!selectable_parts.len)
to_chat(user, "<span class='warning'>There are no valid alt arms for this species!</span>")
var/new_cosmetic_part
var/question = "Choose your character's alt arms style:"
new_cosmetic_part = input(user, question, "Character Preference") as null|anything in selectable_parts
if(new_cosmetic_part)
features["cosmetic_l_arm"] = GLOB.cosmetic_arms[new_cosmetic_part]
features["cosmetic_r_arm"] = GLOB.cosmetic_arms[new_cosmetic_part]
if("cosmetic_legs")
var/list/selectable_parts = list()
for(var/path in GLOB.cosmetic_legs)
var/datum/cosmetic_part/possible_part = GLOB.cosmetic_legs[path]
var/list/supported_species = possible_part.supported_species
if(!show_mismatched_markings && supported_species && !supported_species.Find(pref_species.id))
continue
selectable_parts[path] = possible_part
if(!selectable_parts.len)
to_chat(user, "<span class='warning'>There are no valid alt legs for this species!</span>")
var/new_cosmetic_part
var/question = "Choose your character's alt legs style:"
new_cosmetic_part = input(user, question, "Character Preference") as null|anything in selectable_parts
if(new_cosmetic_part)
features["cosmetic_l_leg"] = GLOB.cosmetic_legs[new_cosmetic_part]
features["cosmetic_r_leg"] = GLOB.cosmetic_legs[new_cosmetic_part]
// End hyper edit
//Genital code
if("cock_color")
var/new_cockcolor = input(user, "Penis color:", "Character Preference") as color|null
@@ -502,8 +502,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/list/standing = list()
var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD)
// hyper edit: updates cosmetic part graphics
H.handle_cosmetic_parts()
if(HD && !(HAS_TRAIT(H, TRAIT_HUSK)))
@@ -597,6 +595,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
//CITADEL EDIT - Do not forget to add this to relevent_layers list just above too!
H.remove_overlay(BODY_TAUR_LAYER)
//END EDIT
H.handle_cosmetic_parts()
if(!mutant_bodyparts)
return
+17 -11
View File
@@ -50,7 +50,7 @@
* to `species_id`. this allows us to use custom body part types for
* each limb in character customization.
*/
var/cosmetic_icon
var/datum/cosmetic_part/cosmetic_icon
var/color_src
var/base_bp_icon //Overrides the icon being used for this limb. This is mainly for downstreams, implemented and maintained as a favor in return for implementing synths. And also because should_draw_* for icon overrides was pretty messy. You're welcome.
var/should_draw_gender = FALSE
@@ -326,6 +326,11 @@
C = owner
no_update = FALSE
if(cosmetic_icon)
if(cosmetic_icon.icon)
base_bp_icon = cosmetic_icon.icon
use_digitigrade = cosmetic_icon.support_digitigrade ? use_digitigrade : NOT_DIGITIGRADE
if(HAS_TRAIT(C, TRAIT_HUSK) && is_organic_limb())
species_id = "husk" //overrides species_id
dmg_overlay_type = "" //no damage overlay shown when husked
@@ -445,6 +450,10 @@
var/icon_gender = (body_gender == FEMALE) ? "f" : "m" //gender of the icon, if applicable
var/is_husk = species_id == "husk"
/// HYPER: allow for custom limb icons in character customization
var/has_cosmetic_state = !isnull(cosmetic_icon) && !isnull(cosmetic_icon.icon_state)
var/limb_style = has_cosmetic_state ? cosmetic_icon.icon_state : species_id
if(dropped)
image_dir = SOUTH
if(dmg_overlay_type)
@@ -453,7 +462,7 @@
if(burnstate)
. += image('icons/mob/dam_mob.dmi', "[dmg_overlay_type]_[body_zone]_0[burnstate]", -DAMAGE_LAYER, image_dir)
if(!isnull(body_markings) && status == BODYPART_ORGANIC)
if(!isnull(body_markings) && status == BODYPART_ORGANIC && !has_cosmetic_state)
if(!use_digitigrade)
if(BODY_ZONE_CHEST)
. += image(body_markings_icon, "[body_markings]_[body_zone]_[icon_gender]", -MARKING_LAYER, image_dir)
@@ -484,9 +493,6 @@
if((body_zone != BODY_ZONE_HEAD && body_zone != BODY_ZONE_CHEST))
should_draw_gender = FALSE
/// HYPER: allow for custom limb icons in character customization
var/limb_style = !isnull(cosmetic_icon) ? cosmetic_icon : species_id
if(is_organic_limb())
limb.icon = base_bp_icon || 'icons/mob/human_parts.dmi'
if(should_draw_gender)
@@ -501,7 +507,7 @@
limb.icon_state = "[limb_style]_[body_zone]"
// Body markings
if(body_markings)
if(body_markings && !has_cosmetic_state)
if(is_husk)
marking = image('modular_citadel/icons/mob/markings_notmammals.dmi', "husk_[body_zone]", -MARKING_LAYER, image_dir)
else if(is_husk && use_digitigrade)
@@ -521,7 +527,7 @@
if(aux_zone)
aux = image(limb.icon, "[limb_style]_[aux_zone]", -aux_layer, image_dir)
. += aux
if(body_markings)
if(body_markings && !has_cosmetic_state)
if(is_husk)
auxmarking = image('modular_citadel/icons/mob/markings_notmammals.dmi', "husk_[aux_zone]", -aux_layer, image_dir)
else
@@ -538,14 +544,14 @@
if(aux_zone)
aux = image(limb.icon, "[aux_zone]", -aux_layer, image_dir)
. += aux
if(!isnull(auxmarking))
if(!isnull(auxmarking) && !has_cosmetic_state)
if(is_husk)
auxmarking = image('modular_citadel/icons/mob/markings_notmammals.dmi', "husk_[aux_zone]", -aux_layer, image_dir)
else
auxmarking = image(body_markings_icon, "[body_markings]_[aux_zone]", -aux_layer, image_dir)
. += auxmarking
if(!isnull(body_markings))
if(!isnull(body_markings) && !has_cosmetic_state)
if(is_husk)
marking = image('modular_citadel/icons/mob/markings_notmammals.dmi', "husk_[body_zone]", -MARKING_LAYER, image_dir)
else if(is_husk && use_digitigrade)
@@ -567,10 +573,10 @@
limb.color = "#[draw_color]"
if(aux_zone)
aux.color = "#[draw_color]"
if(!isnull(auxmarking))
if(!isnull(auxmarking) && !has_cosmetic_state)
auxmarking.color = list(markings_color)
if(!isnull(body_markings))
if(!isnull(body_markings) && !has_cosmetic_state)
if(is_husk)
marking.color = "#141414"
else