diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index d7726bc2844..6a73d9108dd 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -135,7 +135,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H) if(H.gender == FEMALE) g = "f" - var/icon/icobase = H.icobase + var/icon/icobase = head_organ.icobase //At this point all the organs would have the same icobase, so this is just recycling. preview_icon = new /icon(icobase, "torso_[g]") var/icon/temp diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0326fb91b1f..d0439a45678 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1515,8 +1515,6 @@ if(oldspecies.default_genes.len) oldspecies.handle_dna(src,1) // Remove any genes that belong to the old species - icobase = species.icobase - deform = species.deform tail = species.tail if(vessel) @@ -2055,6 +2053,10 @@ return . +/mob/living/carbon/human/proc/change_icobase(var/new_icobase, var/new_deform, var/owner_sensitive) + for(var/obj/item/organ/external/O in organs) + O.change_organ_icobase(new_icobase, new_deform, owner_sensitive) //Change the icobase/deform of all our organs. If owner_sensitive is set, that means the proc won't mess with frankenstein limbs. + /mob/living/carbon/human/serialize() // Currently: Limbs/organs only var/list/data = ..() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index e1ce10f70b2..63378d1a776 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -72,6 +72,4 @@ var/global/default_martial_art = new/datum/martial_art var/fire_sprite = "Standing" var/datum/body_accessory/body_accessory = null - var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set. - var/deform = 'icons/mob/human_races/r_def_human.dmi' // Mutated icon set. - var/tail // Name of tail image in species effects icon file. + var/tail // Name of tail image in species effects icon file. diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index cc97e59626b..c802b733b97 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -360,34 +360,35 @@ //H.verbs += /mob/living/carbon/human/proc/leap ..() -/datum/species/vox/updatespeciescolor(var/mob/living/carbon/human/H) //Handling species-specific skin-tones for the Vox race. +/datum/species/vox/updatespeciescolor(var/mob/living/carbon/human/H, var/owner_sensitive = 1) //Handling species-specific skin-tones for the Vox race. if(H.species.name == "Vox") //Making sure we don't break Armalis. + var/new_icobase = 'icons/mob/human_races/vox/r_vox.dmi' //Default Green Vox. + var/new_deform = 'icons/mob/human_races/vox/r_def_vox.dmi' //Default Green Vox. switch(H.s_tone) if(6) //Azure Vox. - H.icobase = 'icons/mob/human_races/vox/r_voxazu.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_voxazu.dmi' + new_icobase = 'icons/mob/human_races/vox/r_voxazu.dmi' + new_deform = 'icons/mob/human_races/vox/r_def_voxazu.dmi' H.tail = "voxtail_azu" if(5) //Emerald Vox. - H.icobase = 'icons/mob/human_races/vox/r_voxemrl.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_voxemrl.dmi' + new_icobase = 'icons/mob/human_races/vox/r_voxemrl.dmi' + new_deform = 'icons/mob/human_races/vox/r_def_voxemrl.dmi' H.tail = "voxtail_emrl" if(4) //Grey Vox. - H.icobase = 'icons/mob/human_races/vox/r_voxgry.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_voxgry.dmi' + new_icobase = 'icons/mob/human_races/vox/r_voxgry.dmi' + new_deform = 'icons/mob/human_races/vox/r_def_voxgry.dmi' H.tail = "voxtail_gry" if(3) //Brown Vox. - H.icobase = 'icons/mob/human_races/vox/r_voxbrn.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_voxbrn.dmi' + new_icobase = 'icons/mob/human_races/vox/r_voxbrn.dmi' + new_deform = 'icons/mob/human_races/vox/r_def_voxbrn.dmi' H.tail = "voxtail_brn" if(2) //Dark Green Vox. - H.icobase = 'icons/mob/human_races/vox/r_voxdgrn.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_voxdgrn.dmi' + new_icobase = 'icons/mob/human_races/vox/r_voxdgrn.dmi' + new_deform = 'icons/mob/human_races/vox/r_def_voxdgrn.dmi' H.tail = "voxtail_dgrn" else //Default Green Vox. - H.icobase = 'icons/mob/human_races/vox/r_vox.dmi' - H.deform = 'icons/mob/human_races/vox/r_def_vox.dmi' H.tail = "voxtail" //Ensures they get an appropriately coloured tail depending on the skin-tone. + H.change_icobase(new_icobase, new_deform, owner_sensitive) //Update the icobase/deform of all our organs, but make sure we don't mess with frankenstein limbs in doing so. H.update_dna() /datum/species/vox/armalis/handle_post_spawn(var/mob/living/carbon/human/H) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 58af3bced34..d24471dc7e2 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -298,9 +298,9 @@ var/global/list/damage_icon_parts = list() base_icon.MapColors(rgb(tone[1],0,0),rgb(0,tone[2],0),rgb(0,0,tone[3])) //Handle husk overlay. - if(husk && ("overlay_husk" in icon_states(icobase))) + if(husk && ("overlay_husk" in icon_states(chest.icobase))) var/icon/mask = new(base_icon) - var/icon/husk_over = new(icobase,"overlay_husk") + var/icon/husk_over = new(chest.icobase,"overlay_husk") mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0) husk_over.Blend(mask, ICON_ADD) base_icon.Blend(husk_over, ICON_OVERLAY) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 30874195989..15473caf5f2 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -241,8 +241,9 @@ var/mob/living/carbon/human/H = new H.species = current_species H.s_tone = s_tone - H.species.updatespeciescolor(H) - icobase = H.icobase ? H.icobase : H.species.icobase + H.species.updatespeciescolor(H, 0) //The mob's species wasn't set, so it's almost certainly different than the character's species at the moment. Thus, we need to be owner-insensitive. + var/obj/item/organ/external/chest/C = H.get_organ("chest") + icobase = C.icobase ? C.icobase : C.species.icobase if(H.species.bodyflags & HAS_TAIL) coloured_tail = H.tail ? H.tail : H.species.tail diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index ce4b55efb11..110584d5d2a 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -18,6 +18,9 @@ var/model var/force_icon + var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set. + var/deform = 'icons/mob/human_races/r_def_human.dmi' // Mutated icon set. + var/damage_state = "00" var/brute_dam = 0 var/burn_dam = 0 @@ -127,9 +130,12 @@ /obj/item/organ/external/New(var/mob/living/carbon/holder) ..() - if(istype(holder, /mob/living/carbon/human)) - replaced(holder) - sync_colour_to_human(holder) + var/mob/living/carbon/human/H = holder + icobase = species.icobase + deform = species.deform + if(istype(H)) + replaced(H) + sync_colour_to_human(H) spawn(1) get_icon() diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm index ddfcc566d16..e174ed55a3f 100644 --- a/code/modules/surgery/organs/organ_icon.dm +++ b/code/modules/surgery/organs/organ_icon.dm @@ -14,6 +14,16 @@ var/global/list/limb_icon_cache = list() overlays += organ.mob_icon child_icons += organ.mob_icon +/obj/item/organ/external/proc/change_organ_icobase(var/new_icobase, var/new_deform, var/owner_sensitive) //Change the icobase/deform of this organ. If owner_sensitive is set, that means the proc won't mess with frankenstein limbs. + if(owner_sensitive) //This and the below statements mean that the icobase/deform will only get updated if the limb is the same species as and is owned by the mob it's attached to. + if(species && owner.species && species.name != owner.species.name) + return + if(dna.unique_enzymes != owner.dna.unique_enzymes) // This isn't MY arm + return + + icobase = new_icobase ? new_icobase : icobase + deform = new_deform ? new_deform : deform + /obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/H) if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color return @@ -29,6 +39,9 @@ var/global/list/limb_icon_cache = list() if(H.species.bodyflags & HAS_SKIN_COLOR) s_tone = null s_col = list(H.r_skin, H.g_skin, H.b_skin) + if(H.species.bodyflags & HAS_ICON_SKIN_TONE) + var/obj/item/organ/external/chest/C = H.get_organ("chest") + change_organ_icobase(C.icobase, C.deform) /obj/item/organ/external/proc/sync_colour_to_dna() if(status & ORGAN_ROBOT) @@ -171,10 +184,10 @@ var/global/list/limb_icon_cache = list() icon_file = 'icons/mob/human_races/robotic.dmi' else if(status & ORGAN_MUTATED) - icon_file = owner ? owner.deform : species.deform + icon_file = deform else // Congratulations, you are normal - icon_file = owner ? owner.icobase : species.icobase + icon_file = icobase return list(icon_file, new_icon_state) /obj/item/organ/external/chest/get_icon_state(skeletal)