From d73413b04662b6e0f2a0d0622943a865a734c351 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Mon, 23 Jan 2017 05:51:46 -0500 Subject: [PATCH] Uses the Disabilities system more correctly Allows eyes to track eye-dependent disabilities when removed from the mob. Farwas and Wolpins are now incurably colourblind (non-genetics based), so going lesser-form and back won't wipe your colourblindness. Eyes being straight-up deleted (as per how set_species() handles setting up the organs required for the species we're changing to) no longer wipes colourblindness. Now with more helper procs, less unnecessary commenting, random changes and other cleanliness-related tweaks. --- code/__DEFINES/genetics.dm | 3 -- code/game/dna/dna2.dm | 1 - code/game/dna/dna2_domutcheck.dm | 4 +-- code/game/dna/genes/disabilities.dm | 32 +++++-------------- code/game/dna/genes/gene.dm | 3 -- .../gamemodes/changeling/powers/humanform.dm | 8 ++--- .../gamemodes/changeling/powers/lesserform.dm | 5 +-- .../gamemodes/changeling/powers/transform.dm | 2 +- code/game/gamemodes/setupgame.dm | 2 -- code/game/machinery/adv_med.dm | 3 ++ code/game/objects/items/devices/flashlight.dm | 17 +++++----- code/modules/client/preference/preferences.dm | 5 +-- .../mob/living/carbon/human/species/monkey.dm | 24 ++------------ .../living/carbon/human/species/species.dm | 4 +-- code/modules/mob/mob_helpers.dm | 9 +++--- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/mob/transform_procs.dm | 1 + code/modules/surgery/organs/helpers.dm | 1 + code/modules/surgery/organs/organ_internal.dm | 32 ++++++++++++------- .../surgery/organs/subtypes/tajaran.dm | 9 +++++- .../surgery/organs/subtypes/vulpkanin.dm | 9 +++++- nano/templates/adv_med.tmpl | 7 ++-- 22 files changed, 84 insertions(+), 99 deletions(-) diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm index 822179bf4cd..8e7be007d12 100644 --- a/code/__DEFINES/genetics.dm +++ b/code/__DEFINES/genetics.dm @@ -116,6 +116,3 @@ #define CLONER_FRESH_CLONE "fresh" #define CLONER_MATURE_CLONE "mature" - -//Gene properties -#define GENE_EYE_DEPENDENT 1 diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 2967dafe5ae..82f7ffb2e93 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -65,7 +65,6 @@ var/global/list/assigned_gene_blocks[DNA_SE_LENGTH] var/global/list/assigned_blocks[DNA_SE_LENGTH] var/global/list/datum/dna/gene/dna_genes[0] -var/global/list/datum/dna/gene/eye_dependent_genes[0] var/global/list/good_blocks[0] var/global/list/bad_blocks[0] diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm index 61ecb735459..6175d547d63 100644 --- a/code/game/dna/dna2_domutcheck.dm +++ b/code/game/dna/dna2_domutcheck.dm @@ -44,7 +44,7 @@ var/mob/living/carbon/human/H = M defaultgenes = H.species.default_genes - if((gene in defaultgenes) && gene_active && !gene.update) //Unless we want to update them with current information they depend on. + if((gene in defaultgenes) && gene_active) return // Prior state @@ -65,5 +65,3 @@ gene.deactivate(M,connected,flags) if(M) M.active_genes -= gene.type - else if(gene.update && gene_active && (gene.type in M.active_genes)) //Update the gene. It should already be in the list of active genes. Updating is only useful if it's active. - gene.activate(M,connected,flags) diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index 28c9c1c76b6..aaea991d5cf 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -116,38 +116,22 @@ block=BLINDBLOCK /datum/dna/gene/disability/colourblindness - name="Colourblindness" - activation_message="Your perception of colour warps and distorts." - deactivation_message ="Your perception of colour returns to normal." + name = "Colourblindness" + activation_message = "You feel a peculiar prickling in your eyes while your perception of colour changes." + deactivation_message ="Your eyes tingle unsettlingly, though everything seems to become alot more colourful." instability = -GENE_INSTABILITY_MODERATE disability = COLOURBLIND - flags = GENE_EYE_DEPENDENT - update = 1 /datum/dna/gene/disability/colourblindness/New() block=COLOURBLINDBLOCK /datum/dna/gene/disability/colourblindness/activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - var/mob/living/carbon/human/H = M - if(istype(M)) - var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes) - if(eyes && !eyes.robotic) //To avoid overriding the properties of cybernetic/mechassisted eyes, apply the colour matrix and darksight modifier only if the organ is organic. Robotic/mechassisted eyes currently do this, too, as is necessary. - var/list/cblind_properties = (eyes.colourblind_special) ? eyes.colourblind_special : null //If the mob's species has its own colourblindness parameters, gather them. - eyes.colourmatrix = (cblind_properties && cblind_properties["colour_matrix"]) ? cblind_properties["colour_matrix"] : MATRIX_GREYSCALE //If the mob's species has its own colourblindness colour matrix parameter, use it. - eyes.dark_view = (cblind_properties && cblind_properties["darkview"]) ? cblind_properties["darkview"] : eyes.dark_view //If the mob's species has its own colourblindness dark view parameter, use it. - H.update_client_colour() + ..() + M.update_client_colour() //Handle the activation of the colourblindness on the mob. /datum/dna/gene/disability/colourblindness/deactivate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - var/mob/living/carbon/human/H = M - if(istype(M)) - var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes) - if(eyes && !eyes.robotic) //To avoid overriding the properties of cybernetic/mechassisted eyes, apply the colour matrix and darksight modifier only if the organ is organic. Robotic/mechassisted eyes currently do this, too, as is necessary. - var/list/cblind_properties = (eyes.colourblind_special) ? eyes.colourblind_special : null //If the mob's species has its own colourblindness parameters, gather them. - eyes.colourmatrix = null //The only time a mob will have this set is if they're colourblind, so it's fine to null this out. - eyes.dark_view = (cblind_properties && cblind_properties["darkview"]) ? initial(eyes.dark_view) : eyes.dark_view //If the mob's species has its own colourblindness dark view parameter, set the mob's dark_view back to normal. - H.update_client_colour() + ..() + M.update_client_colour() //Handle the deactivation of the colourblindness on the mob. /datum/dna/gene/disability/deaf name="Deafness" @@ -160,7 +144,7 @@ block=DEAFBLOCK /datum/dna/gene/disability/deaf/activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) + ..() M.EarDeaf(1) /datum/dna/gene/disability/nearsighted diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index 63992e16a5f..f74d0c7d2a0 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -26,9 +26,6 @@ // Chance of the gene to cause adverse effects when active var/instability=0 - // Whether the gene needs to be updated regardless of whether the mob has it or not. Useful for colour vision modifiers. - var/update=0 - /* * Is the gene active in this mob's DNA? */ diff --git a/code/game/gamemodes/changeling/powers/humanform.dm b/code/game/gamemodes/changeling/powers/humanform.dm index aa333a865b5..fb3012cd274 100644 --- a/code/game/gamemodes/changeling/powers/humanform.dm +++ b/code/game/gamemodes/changeling/powers/humanform.dm @@ -26,11 +26,11 @@ to_chat(user, "We transform our appearance.") user.dna.SetSEState(MONKEYBLOCK,0,1) genemutcheck(user,MONKEYBLOCK,null,MUTCHK_FORCED) - user.real_name = chosen_dna.real_name - if(ishuman(user)) - user.set_species(chosen_dna.species) user.dna = chosen_dna.Clone() - domutcheck(user, null, MUTCHK_FORCED) + user.real_name = chosen_dna.real_name + if(istype(user)) + user.set_species(chosen_dna.species) + domutcheck(user,null,MUTCHK_FORCED) user.flavor_text = "" user.dna.UpdateSE() user.dna.UpdateUI() diff --git a/code/game/gamemodes/changeling/powers/lesserform.dm b/code/game/gamemodes/changeling/powers/lesserform.dm index 7316d635acf..9901768f1e5 100644 --- a/code/game/gamemodes/changeling/powers/lesserform.dm +++ b/code/game/gamemodes/changeling/powers/lesserform.dm @@ -23,16 +23,13 @@ var/datum/dna/DNA = changeling.GetDNA(user.dna.real_name) user.dna = DNA ? DNA.Clone() : user.dna - H.visible_message("[H] transforms!") changeling.geneticdamage = 30 to_chat(H, "Our genes cry out!") var/list/implants = list() //Try to preserve implants. for(var/obj/item/weapon/implant/W in H) implants += W - - user.dna.SetSEState(MONKEYBLOCK,1,1) - genemutcheck(user,MONKEYBLOCK,null,MUTCHK_FORCED) + H.monkeyize() changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null) feedback_add_details("changeling_powers","LF") return 1 \ No newline at end of file diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index 5ca928c77c7..b7c8abefd1d 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -14,10 +14,10 @@ if(!chosen_dna) return + user.dna = chosen_dna.Clone() user.real_name = chosen_dna.real_name if(ishuman(user)) user.set_species(chosen_dna.species) - user.dna = chosen_dna.Clone() domutcheck(user, null, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them user.flavor_text = "" user.dna.UpdateSE() diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index e55d99c4c9e..c785c511304 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -116,8 +116,6 @@ if(G.block in blocks_assigned) warning("DNA2: Gene [G.name] trying to use already-assigned block [G.block] (used by [english_list(blocks_assigned[G.block])])") dna_genes.Add(G) - if(G.flags & GENE_EYE_DEPENDENT) - eye_dependent_genes.Add(G) var/list/assignedToBlock[0] if(blocks_assigned[G.block]) assignedToBlock=blocks_assigned[G.block] diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index f7b793b6033..4f9e357cd61 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -453,6 +453,7 @@ occupantData["intOrgan"] = intOrganData occupantData["blind"] = (H.disabilities & BLIND) + occupantData["colourblind"] = (H.disabilities & COLOURBLIND) occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) data["occupant"] = occupantData @@ -639,6 +640,8 @@ dat += "" if(occupant.disabilities & BLIND) dat += "Cataracts detected.
" + if(occupant.disabilities & COLOURBLIND) + dat += "Photoreceptor abnormalities detected.
" if(occupant.disabilities & NEARSIGHTED) dat += "Retinal misalignment detected.
" else diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 7806982a627..d8f17ac4335 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -54,8 +54,8 @@ return var/mob/living/carbon/human/H = M //mob has protective eyewear - if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES))) - to_chat(user, "You're going to need to remove that [(H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask": "glasses"] first.") + if(istype(H) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES))) + to_chat(user, "You're going to need to remove that [(H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask" : "glasses"] first.") return if(M == user) //they're using it on themselves @@ -70,12 +70,13 @@ user.visible_message("[user] directs [src] to [M]'s eyes.", \ "You direct [src] to [M]'s eyes.") - if(istype(M, /mob/living/carbon/human)) //robots and aliens are unaffected - if(M.stat == DEAD || M.disabilities & BLIND) //mob is dead or fully blind - to_chat(user, "[M] pupils does not react to the light!") - else if(XRAY in M.mutations) //mob has X-RAY vision - to_chat(user, "[M] pupils give an eerie glow!") - else //they're okay! + if(istype(H)) //robots and aliens are unaffected + var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes) + if(M.stat == DEAD || !eyes || M.disabilities & BLIND) //mob is dead or fully blind + to_chat(user, "[M]'s pupils are unresponsive to the light!") + else if((XRAY in M.mutations) || (eyes.colourblind_darkview && eyes.colourblind_darkview == eyes.dark_view)) //The mob's either got the X-RAY vision or has a tapetum lucidum (extreme nightvision). + to_chat(user, "[M]'s pupils glow eerily!") + else //they're okay! if(M.flash_eyes(visual = 1)) to_chat(user, "[M]'s pupils narrow.") else diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 8a2bec6a7ef..fda5f7bedfb 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -2020,6 +2020,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts return 1 /datum/preferences/proc/copy_to(mob/living/carbon/human/character) + var/datum/species/S = all_species[species] + character.change_species(species) // Yell at me if this causes everything to melt if(be_random_name) real_name = random_name(gender,species) @@ -2169,13 +2171,12 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(disabilities & DISABILITY_FLAG_COLOURBLIND) character.dna.SetSEState(COLOURBLINDBLOCK,1,1) - character.disabilities |= COLOURBLIND if(disabilities & DISABILITY_FLAG_MUTE) character.dna.SetSEState(MUTEBLOCK,1,1) character.disabilities |= MUTE - character.species.handle_dna(character) + S.handle_dna(character) if(character.dna.dirtySE) character.dna.UpdateSE() diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index 0108d693c18..c4c705829b4 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -114,18 +114,8 @@ "kidneys" = /obj/item/organ/internal/kidneys, "brain" = /obj/item/organ/internal/brain, "appendix" = /obj/item/organ/internal/appendix, - "eyes" = /obj/item/organ/internal/eyes/tajaran //Tajara monkey-forms are uniquely colourblind and have excellent darksight, which is why they need the same organ as the Tajara. + "eyes" = /obj/item/organ/internal/eyes/tajaran/farwa //Tajara monkey-forms are uniquely colourblind and have excellent darksight, which is why they need a subtype of their greater-form's organ.. ) - default_genes = list(COLOURBLIND) - -/datum/species/monkey/tajaran/handle_dna(var/mob/living/carbon/C, var/remove) - if(!remove) - C.dna.SetSEState(COLOURBLINDBLOCK,1,1) - genemutcheck(C,COLOURBLINDBLOCK,null,MUTCHK_FORCED) - else - C.dna.SetSEState(COLOURBLINDBLOCK,0,1) - genemutcheck(C,COLOURBLINDBLOCK,null,MUTCHK_FORCED) - ..() /datum/species/monkey/vulpkanin @@ -148,18 +138,8 @@ "kidneys" = /obj/item/organ/internal/kidneys, "brain" = /obj/item/organ/internal/brain, "appendix" = /obj/item/organ/internal/appendix, - "eyes" = /obj/item/organ/internal/eyes/vulpkanin //Vulpkanin monkey-forms are uniquely colourblind and have excellent darksight, which is why they need the same organ as the Vulpkanin. + "eyes" = /obj/item/organ/internal/eyes/vulpkanin/wolpin //Vulpkanin monkey-forms are uniquely colourblind and have excellent darksight, which is why they need a subtype of their greater-form's organ.. ) - default_genes = list(COLOURBLIND) - -/datum/species/monkey/vulpkanin/handle_dna(var/mob/living/carbon/C, var/remove) - if(!remove) - C.dna.SetSEState(COLOURBLINDBLOCK,1,1) - genemutcheck(C,COLOURBLINDBLOCK,null,MUTCHK_FORCED) - else - C.dna.SetSEState(COLOURBLINDBLOCK,0,1) - genemutcheck(C,COLOURBLINDBLOCK,null,MUTCHK_FORCED) - ..() /datum/species/monkey/skrell diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 73c557c9c58..7ac64189ce8 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -588,8 +588,8 @@ It'll return null if the organ doesn't correspond, so include null checks when u /datum/species/proc/get_resultant_darksight(mob/living/carbon/human/H) //Returns default value of 2 if the mob doesn't have eyes, otherwise it grabs the eyes darksight. var/resultant_darksight = 2 var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes) - if(eyes && eyes.dark_view) - resultant_darksight = eyes.dark_view + if(eyes) + resultant_darksight = eyes.get_dark_view() return resultant_darksight /datum/species/proc/update_sight(mob/living/carbon/human/H) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index e07fb765ce7..93c79aeebfc 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -25,20 +25,21 @@ /mob/proc/get_screen_colour() /mob/proc/update_client_colour(var/time = 10) //Update the mob's client.color with an animation the specified time in length. - if(!client) + if(!client) //No client_colour without client. If the player logs back in they'll be back through here anyway. return - client.colour_transition(get_screen_colour(), time = time) + client.colour_transition(get_screen_colour(), time = time) //Get the colour matrix we're going to transition to depending on relevance (magic glasses first, eyes second). /mob/living/carbon/human/get_screen_colour() //Fetch the colour matrix from wherever (e.g. eyes) so it can be compared to client.color. . = ..() if(.) return . + var/obj/item/clothing/glasses/worn_glasses = glasses var/obj/item/organ/internal/eyes/eyes = get_int_organ(/obj/item/organ/internal/eyes) if(istype(worn_glasses) && worn_glasses.color_view) //Check to see if they got those magic glasses and they're augmenting the colour of what the wearer sees. If they're not, color_view should be null. return worn_glasses.color_view - else if(eyes && eyes.colourmatrix) //If they're not, check to see if their eyes got one of them there colour matrices. - return eyes.colourmatrix + else if(eyes) //If they're not, check to see if their eyes got one of them there colour matrices. Will be null if eyes are robotic/the mob isn't colourblind and they have no default colour matrix. + return eyes.get_colourmatrix() /proc/isloyal(A) //Checks to see if the person contains a mindshield implant, then checks that the implant is actually inside of them for(var/obj/item/weapon/implant/loyalty/L in A) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 2233c617b6e..bccd7990de9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -483,7 +483,7 @@ close_spawn_windows() check_prefs_are_sane() - var/mob/living/carbon/human/new_character = new(loc, client.prefs.species) + var/mob/living/carbon/human/new_character = new(loc) new_character.lastarea = get_area(loc) if(ticker.random_players || appearance_isbanned(new_character)) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index a484324560d..8adc505102b 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -1,6 +1,7 @@ /mob/living/carbon/human/proc/monkeyize() var/mob/H = src H.dna.SetSEState(MONKEYBLOCK,1) + domutcheck(H, null) /mob/new_player/AIize() spawning = 1 diff --git a/code/modules/surgery/organs/helpers.dm b/code/modules/surgery/organs/helpers.dm index 24ae966cd14..a61537f1985 100644 --- a/code/modules/surgery/organs/helpers.dm +++ b/code/modules/surgery/organs/helpers.dm @@ -13,6 +13,7 @@ /mob/living/carbon/get_int_organ(typepath) return (locate(typepath) in internal_organs) + /mob/living/carbon/get_organs_zone(zone, var/subzones = 0) var/list/returnorg = list() if(subzones) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 514d836bfc3..c6a81e04481 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -344,30 +344,40 @@ slot = "eyes" var/list/eye_colour = list(0,0,0) var/list/colourmatrix = null - var/list/colourblind_special = list("colour_matrix" = null, "darkview" = null) //Special colourblindness parameters. + var/list/colourblind_matrix = null //Special colourblindness parameters. + var/colourblind_darkview = null + var/dependent_disabilities = null //Gets set by eye-dependent disabilities such as colourblindness so the eyes can transfer the disability during transplantation. var/dark_view = 2 //Default dark_view for Humans. var/weld_proof = null //If set, the eyes will not take damage during welding. eg. IPC optical sensors do not take damage when they weld things while all other eyes will. /obj/item/organ/internal/eyes/proc/update_colour() dna.write_eyes_attributes(src) +/obj/item/organ/internal/eyes/proc/get_colourmatrix() //Returns a colour matrix if the eyes are organic. + return !robotic && owner.disabilities & COLOURBLIND ? (colourblind_matrix ? colourblind_matrix : MATRIX_GREYSCALE) : colourmatrix //Returns special colourmatrix if colourblind and it exists and greyscale if it doesn't, otherwise returns current velue. + +/obj/item/organ/internal/eyes/proc/get_dark_view() //Returns dark_view (if the eyes are organic) for see_invisible handling in species.dm to be autoprocessed by life(). + return !robotic && colourblind_darkview && owner.disabilities & COLOURBLIND ? colourblind_darkview : dark_view //Returns special darkview value if colourblind and it exists, otherwise returns current velue. + /obj/item/organ/internal/eyes/insert(mob/living/carbon/human/M, special = 0) ..() if(istype(M) && eye_colour) M.update_body() //Apply our eye colour to the target. - for(var/datum/dna/gene/G in eye_dependent_genes) //Handle the application of the eye-dependent genes from the eye to the new host mob if the genes are active. - if(dna && dna.GetSEState(G.block)) //If the eye-dependent gene in the eye's DNA is active, activate it on the human and genemutcheck to apply its effects. - M.dna.SetSEState(G.block,1,1) - genemutcheck(M,G.block,null,MUTCHK_FORCED) + if(!(M.disabilities & COLOURBLIND) && (dependent_disabilities & COLOURBLIND)) //If the eyes are colourblind and we're not, carry over the gene. + dependent_disabilities &= ~COLOURBLIND + M.dna.SetSEState(COLOURBLINDBLOCK,1,1) + genemutcheck(M,COLOURBLINDBLOCK,null,MUTCHK_FORCED) + else + M.update_client_colour() //If we're here, that means the mob acquired the colourblindness gene while they didn't have eyes. Better handle it. /obj/item/organ/internal/eyes/remove(mob/living/carbon/human/M, special = 0) - for(var/datum/dna/gene/G in eye_dependent_genes) //Handle the removal of the eye-dependent genes from the eye to the new host mob if the genes are active. - if(G.type in M.active_genes) //If there's an active eye-dependent gene on the mob, turn it off. - dna = M.dna.Clone() //Preserve the eye-dependent genes by ensuring the genome on the eyes remains intact. - M.dna.SetSEState(G.block,0,1) - genemutcheck(M,G.block,null,MUTCHK_FORCED) - .=..() + if(!special && (M.disabilities & COLOURBLIND)) //If special is set, that means these eyes are getting deleted (i.e. during set_species()) + if(!(dependent_disabilities & COLOURBLIND)) //We only want to change COLOURBLINDBLOCK and such it the eyes are being surgically removed. + dependent_disabilities |= COLOURBLIND + M.dna.SetSEState(COLOURBLINDBLOCK,0,1) + genemutcheck(M,COLOURBLINDBLOCK,null,MUTCHK_FORCED) + . = ..() /obj/item/organ/internal/eyes/surgeryize() if(!owner) diff --git a/code/modules/surgery/organs/subtypes/tajaran.dm b/code/modules/surgery/organs/subtypes/tajaran.dm index 7feacd4fbc4..746abd6e601 100644 --- a/code/modules/surgery/organs/subtypes/tajaran.dm +++ b/code/modules/surgery/organs/subtypes/tajaran.dm @@ -6,4 +6,11 @@ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/ name = "tajaran eyeballs" species = "Tajaran" - colourblind_special = list("colour_matrix" = MATRIX_TAJ_CBLIND, "darkview" = 8) //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + colourblind_matrix = MATRIX_TAJ_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + colourblind_darkview = 8 + +/obj/item/organ/internal/eyes/tajaran/farwa //Being the lesser form of Tajara, Farwas have an utterly incurable version of their colourblindness. + name = "farwa eyeballs" + species = "Farwa" + colourmatrix = MATRIX_TAJ_CBLIND + dark_view = 8 diff --git a/code/modules/surgery/organs/subtypes/vulpkanin.dm b/code/modules/surgery/organs/subtypes/vulpkanin.dm index 27172e50215..af3d9deab09 100644 --- a/code/modules/surgery/organs/subtypes/vulpkanin.dm +++ b/code/modules/surgery/organs/subtypes/vulpkanin.dm @@ -6,4 +6,11 @@ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/ name = "vulpkanin eyeballs" species = "Vulpkanin" - colourblind_special = list("colour_matrix" = MATRIX_VULP_CBLIND, "darkview" = 8) //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + colourblind_matrix = MATRIX_VULP_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability. + colourblind_darkview = 8 + +/obj/item/organ/internal/eyes/vulpkanin/wolpin //Being the lesser form of Vulpkanin, Wolpins have an utterly incurable version of their colourblindness. + name = "wolpin eyeballs" + species = "Wolpin" + colourmatrix = MATRIX_VULP_CBLIND + dark_view = 8 diff --git a/nano/templates/adv_med.tmpl b/nano/templates/adv_med.tmpl index 51b74a12fda..e88db47456a 100644 --- a/nano/templates/adv_med.tmpl +++ b/nano/templates/adv_med.tmpl @@ -52,10 +52,13 @@ Used In File(s): \code\game\machinery\adv_med.dm Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.
{{/if}} {{if data.occupant.blind}} - Pupils unresponsive.
+ Cataracts detected.
+ {{/if}} + {{if data.occupant.colourblind}} + Photoreceptor abnormalities detected.
{{/if}} {{if data.occupant.nearsighted}} - Retinal misalignment detected
+ Retinal misalignment detected.
{{/if}}