mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Limbs now copy hair data from their owner and may have optional body hair icons blended into them.
This commit is contained in:
@@ -95,6 +95,8 @@
|
||||
g_hair = green
|
||||
b_hair = blue
|
||||
|
||||
force_update_limbs()
|
||||
update_body()
|
||||
update_hair()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -271,8 +271,13 @@ var/global/list/damage_icon_parts = list()
|
||||
icon_key += "[part.species.race_key]"
|
||||
icon_key += "[part.dna.GetUIState(DNA_UI_GENDER)]"
|
||||
icon_key += "[part.dna.GetUIValue(DNA_UI_SKIN_TONE)]"
|
||||
if(part.s_col)
|
||||
if(part.s_col && part.s_col.len >= 3)
|
||||
icon_key += "[rgb(part.s_col[1],part.s_col[2],part.s_col[3])]"
|
||||
if(part.body_hair && part.h_col && part.h_col.len >= 3)
|
||||
icon_key += "[rgb(part.h_col[1],part.h_col[2],part.h_col[3])]"
|
||||
else
|
||||
icon_key += "#000000"
|
||||
|
||||
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"
|
||||
|
||||
var/icon/base_icon
|
||||
|
||||
@@ -152,6 +152,8 @@
|
||||
generate_data()
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/generate_data()
|
||||
if(!owner)
|
||||
return
|
||||
if(!valid_species.len)
|
||||
valid_species = owner.generate_valid_species(check_whitelist, whitelist, blacklist)
|
||||
if(!valid_hairstyles.len || !valid_facial_hairstyles.len)
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
var/cannot_break
|
||||
var/s_tone
|
||||
var/list/s_col
|
||||
var/list/h_col
|
||||
var/list/wounds = list()
|
||||
var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len!
|
||||
var/perma_injury = 0
|
||||
@@ -55,6 +56,7 @@
|
||||
var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ.
|
||||
var/can_grasp //It would be more appropriate if these two were named "affects_grasp" and "affects_stand" at this point
|
||||
var/can_stand
|
||||
var/body_hair
|
||||
|
||||
/obj/item/organ/external/Destroy()
|
||||
if(parent && parent.children)
|
||||
@@ -258,7 +260,7 @@
|
||||
createwound(BURN, min(burn,can_inflict))
|
||||
//How much burn damage is left to inflict
|
||||
spillover += max(0, burn - can_inflict)
|
||||
|
||||
|
||||
//If there are still hurties to dispense
|
||||
if (spillover)
|
||||
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
|
||||
@@ -275,7 +277,7 @@
|
||||
//2. If the damage amount dealt exceeds the disintegrate threshold, the organ is completely obliterated.
|
||||
//3. If the organ has already reached or would be put over it's max damage amount (currently redundant),
|
||||
// and the brute damage dealt exceeds the tearoff threshold, the organ is torn off.
|
||||
|
||||
|
||||
//Check edge eligibility
|
||||
var/edge_eligible = 0
|
||||
if(edge)
|
||||
|
||||
@@ -15,6 +15,7 @@ var/global/list/limb_icon_cache = list()
|
||||
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
s_tone = null
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
if(species && human.species && species.name != human.species.name)
|
||||
@@ -23,16 +24,19 @@ var/global/list/limb_icon_cache = list()
|
||||
s_tone = human.s_tone
|
||||
if(human.species.appearance_flags & HAS_SKIN_COLOR)
|
||||
s_col = list(human.r_skin, human.g_skin, human.b_skin)
|
||||
h_col = list(human.r_hair, human.g_hair, human.b_hair)
|
||||
|
||||
/obj/item/organ/external/proc/sync_colour_to_dna()
|
||||
s_tone = null
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.appearance_flags & HAS_SKIN_TONE))
|
||||
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
|
||||
if(species.appearance_flags & HAS_SKIN_COLOR)
|
||||
s_col = list(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
|
||||
h_col = list(dna.GetUIValue(DNA_UI_HAIR_R),dna.GetUIValue(DNA_UI_HAIR_G),dna.GetUIValue(DNA_UI_HAIR_B))
|
||||
|
||||
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
..()
|
||||
@@ -77,8 +81,8 @@ var/global/list/limb_icon_cache = list()
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
|
||||
if(hair_style && (species.get_bodytype() in hair_style.species_allowed))
|
||||
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
|
||||
if(hair_style.do_colouration)
|
||||
hair_s.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD)
|
||||
if(hair_style.do_colouration && islist(h_col) && h_col.len >= 3)
|
||||
hair_s.Blend(rgb(h_col[1], h_col[2], h_col[3]), ICON_ADD)
|
||||
overlays |= hair_s
|
||||
|
||||
return mob_icon
|
||||
@@ -121,6 +125,14 @@ var/global/list/limb_icon_cache = list()
|
||||
else if(s_col && s_col.len >= 3)
|
||||
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
|
||||
|
||||
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])
|
||||
var/icon/I = icon(species.icobase, "[icon_name]_[body_hair]")
|
||||
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_ADD)
|
||||
limb_icon_cache[cache_key] = I
|
||||
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
|
||||
|
||||
dir = EAST
|
||||
icon = mob_icon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user