Fixes a bug with meatbrain FBPs.

This commit is contained in:
Anewbe
2017-03-26 16:34:47 -05:00
parent 629a044761
commit 22ae87c376
2 changed files with 12 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
Global associative list for caching humanoid icons.
Index format m or f, followed by a string of 0 and 1 to represent bodyparts followed by husk fat hulk skeleton 1 or 0.
TODO: Proper documentation
icon_key is [species.race_key][g][husk][fat][hulk][skeleton][model][s_tone]
icon_key is [species.race_key][g][husk][fat][hulk][skeleton][s_tone]
*/
var/global/list/human_icon_cache = list()
var/global/list/tail_icon_cache = list() //key is [species.race_key][r_skin][g_skin][b_skin]
@@ -242,22 +242,7 @@ var/global/list/damage_icon_parts = list()
if(gender == FEMALE)
g = "female"
var/model = "1"
for(var/organ_tag in species.has_limbs)
var/obj/item/organ/external/part = organs_by_name[organ_tag]
if(isnull(part) || part.is_stump())
model = "0"
continue
if(part)
if(part.robotic >= ORGAN_ROBOT)
model = "2[part.model ? "-[part.model]": ""]"
else if(part.status & ORGAN_DEAD)
model = "3"
else
model = "1"
var/icon_key = "[species.get_race_key(src)][g][model][s_tone][r_skin][g_skin][b_skin]"
var/icon_key = "[species.get_race_key(src)][g][s_tone][r_skin][g_skin][b_skin]"
if(lip_style)
icon_key += "[lip_style]"
else
@@ -276,7 +261,7 @@ var/global/list/damage_icon_parts = list()
if(part)
icon_key += "[part.species.get_race_key(part.owner)]"
icon_key += "[part.dna.GetUIState(DNA_UI_GENDER)]"
icon_key += "[part.dna.GetUIValue(DNA_UI_SKIN_TONE)]"
icon_key += "[part.s_tone]"
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)
@@ -284,6 +269,13 @@ var/global/list/damage_icon_parts = list()
else
icon_key += "#000000"
if(part.robotic >= ORGAN_ROBOT)
icon_key += "2[part.model ? "-[part.model]": ""]"
else if(part.status & ORGAN_DEAD)
icon_key += "3"
else
icon_key += "1"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"
var/icon/base_icon

View File

@@ -114,6 +114,7 @@ var/global/list/limb_icon_cache = list()
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if (robotic >= ORGAN_ROBOT)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
else
mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
@@ -135,8 +136,6 @@ var/global/list/limb_icon_cache = list()
return mob_icon
/obj/item/organ/external/proc/apply_colouration(var/icon/applying)
if(robotic == ORGAN_ROBOT)
return applying
if(nonsolid)
applying.MapColors("#4D4D4D","#969696","#1C1C1C", "#000000")
@@ -195,7 +194,7 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F
if(!icon_cache_key || !limb_icon_cache[cache_key])
limb_icon_cache[cache_key] = icon(get_icon(), null, SOUTH)
var/image/temp = image(limb_icon_cache[cache_key])
if((robotic == ORGAN_ROBOT) && species)
if((robotic < ORGAN_ROBOT) && species)
// Calculate the required colour matrix.
var/r = 0.30 * species.health_hud_intensity
var/g = 0.59 * species.health_hud_intensity