diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 678969ac096..96a23acf5c7 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -137,6 +137,36 @@ spawn(10) qdel(spark_system) +/mob/living/carbon/human/proc/becomeSlim() + to_chat(src, "You feel fit again!") + var/obj/item/organ/external/chest/C = get_organ("chest") + if(istype(C)) + C.makeSlim(0) + else + to_chat(src, "Err, well, you *would*, but you don't have a torso. Yell at a coder.") + log_debug("[src] at ([x],[y],[z]) doesn't have a torso.") + mutations.Remove(FAT) + update_mutantrace(0) + update_mutations(0) + update_body(0) + update_inv_w_uniform(0) + update_inv_wear_suit() + +/mob/living/carbon/human/proc/becomeFat() + to_chat(src, "You suddenly feel blubbery!") + var/obj/item/organ/external/chest/C = get_organ("chest") + if(istype(C)) + C.makeFat() + else + to_chat(src, "Err, well, you *would*, but you don't have a torso. Yell at a coder.") + log_debug("[src] at ([x],[y],[z]) doesn't have a torso.") + mutations.Add(FAT) + update_mutantrace(0) + update_mutations(0) + update_body(0) + update_inv_w_uniform(0) + update_inv_wear_suit() + //Handles chem traces /mob/living/carbon/human/proc/handle_trace_chems() //New are added for reagents to random organs. @@ -166,4 +196,4 @@ I use this to standardize shadowling dethrall code if(!get_int_organ(organ_name)) return null var/obj/item/organ/internal/O = get_int_organ(organ_name) - return O.parent_organ \ No newline at end of file + return O.parent_organ diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6e74c90f08c..8951b21bc74 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -675,20 +675,10 @@ if(species.flags & CAN_BE_FAT) if(FAT in mutations) if(overeatduration < 100) - to_chat(src, "You feel fit again!") - mutations.Remove(FAT) - update_mutantrace(0) - update_mutations(0) - update_inv_w_uniform(0) - update_inv_wear_suit() + becomeSlim() else if(overeatduration > 500) - to_chat(src, "You suddenly feel blubbery!") - mutations.Add(FAT) - update_mutantrace(0) - update_mutations(0) - update_inv_w_uniform(0) - update_inv_wear_suit() + becomeFat() // nutrition decrease if(nutrition > 0 && stat != 2) diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm index aed8fcf4f81..31ef55f4919 100644 --- a/code/modules/surgery/organs/organ_icon.dm +++ b/code/modules/surgery/organs/organ_icon.dm @@ -49,6 +49,38 @@ var/global/list/limb_icon_cache = list() get_icon() . = ..() +/obj/item/organ/external/proc/get_icon(skeletal, fat) + // Kasparrov, you monster + if(istext(species)) + species = all_species[species] + if(force_icon) + mob_icon = new /icon(force_icon, "[icon_name]") + if(species && species.name == "Machine") //snowflake for IPC's, sorry. + if(s_col && s_col.len >= 3) + mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD) + else + var/new_icons = get_icon_state(skeletal) + var/icon_file = new_icons[1] + var/new_icon_state = new_icons[2] + mob_icon = new /icon(icon_file, new_icon_state) + if(!skeletal && !(status & ORGAN_ROBOT)) + if(status & ORGAN_DEAD) + mob_icon.ColorTone(rgb(10,50,0)) + mob_icon.SetIntensity(0.7) + + if(!isnull(s_tone)) + if(s_tone >= 0) + mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD) + else + mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT) + else if(s_col && s_col.len >= 3) + mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD) + + dir = EAST + icon = mob_icon + + return mob_icon + /obj/item/organ/external/head/get_icon() ..() @@ -113,51 +145,39 @@ var/global/list/limb_icon_cache = list() return mob_icon -/obj/item/organ/external/proc/get_icon(var/skeletal) +/obj/item/organ/external/proc/get_icon_state(skeletal) var/gender - if(istext(species)) - species = all_species[species] - if(force_icon) - mob_icon = new /icon(force_icon, "[icon_name]") - if(species && species.name == "Machine") //snowflake for IPC's, sorry. - if(s_col && s_col.len >= 3) - mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD) + var/icon_file + var/new_icon_state + if(!dna) + icon_file = 'icons/mob/human_races/r_human.dmi' + new_icon_state = "[icon_name][gendered_icon ? "_f" : ""]" else - if(!dna) - mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]") - else - if(gendered_icon) - if(dna.GetUIState(DNA_UI_GENDER)) - gender = "f" - else - gender = "m" - - if(skeletal) - mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") - else if(status & ORGAN_ROBOT) - mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + if(gendered_icon) + if(dna.GetUIState(DNA_UI_GENDER)) + gender = "f" else - if(status & ORGAN_MUTATED) - mob_icon = new /icon(species.deform, "[icon_name][gender ? "_[gender]" : ""]") - else - mob_icon = new /icon(species.icobase, "[icon_name][gender ? "_[gender]" : ""]") + gender = "m" + new_icon_state = "[icon_name][gender ? "_[gender]" : ""]" - if(status & ORGAN_DEAD) - mob_icon.ColorTone(rgb(10,50,0)) - mob_icon.SetIntensity(0.7) + if(skeletal) + icon_file = 'icons/mob/human_races/r_skeleton.dmi' + else if(status & ORGAN_ROBOT) + icon_file = 'icons/mob/human_races/robotic.dmi' + else + if(status & ORGAN_MUTATED) + icon_file = species.deform + else + // Congratulations, you are normal + icon_file = species.icobase + return list(icon_file, new_icon_state) - if(!isnull(s_tone)) - if(s_tone >= 0) - mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD) - else - mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT) - else if(s_col && s_col.len >= 3) - mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD) +/obj/item/organ/external/chest/get_icon_state(skeletal) + var/result = ..() + if(fat && !skeletal && !(status & ORGAN_ROBOT) && (species.flags & CAN_BE_FAT)) + result[2] += "_fat" + return result - dir = EAST - icon = mob_icon - - return mob_icon // new damage icon system // adjusted to set damage_state to brute/burn code only (without r_name0 as before) diff --git a/code/modules/surgery/organs/subtypes/standard.dm b/code/modules/surgery/organs/subtypes/standard.dm index 1ed651e1e6a..02351f523a8 100644 --- a/code/modules/surgery/organs/subtypes/standard.dm +++ b/code/modules/surgery/organs/subtypes/standard.dm @@ -16,6 +16,25 @@ cannot_amputate = 1 parent_organ = null encased = "ribcage" + var/fat = FALSE + +/obj/item/organ/external/chest/proc/makeFat(update_body_icon = 1) + fat = TRUE + if(owner) + owner.update_body(update_body_icon) + else + // get_icon updates the sprite icon, update_icon updates the injuries overlay. + // Madness. + get_icon() + +/obj/item/organ/external/chest/proc/makeSlim(update_body_icon = 1) + fat = FALSE + if(owner) + owner.update_body(update_body_icon) + else + // get_icon updates the sprite icon, update_icon updates the injuries overlay. + // Madness. + get_icon() /obj/item/organ/external/groin name = "lower body"