diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm
index 11393957fc1..822179bf4cd 100644
--- a/code/__DEFINES/genetics.dm
+++ b/code/__DEFINES/genetics.dm
@@ -12,6 +12,7 @@
#define DISABILITY_FLAG_DEAF 8
#define DISABILITY_FLAG_BLIND 16
#define DISABILITY_FLAG_MUTE 32
+#define DISABILITY_FLAG_COLOURBLIND 64
///////////////////////////////////////
// MUTATIONS
@@ -84,8 +85,9 @@
#define TOURETTES 8
#define NERVOUS 16
#define BLIND 32
-#define MUTE 64
-#define DEAF 128
+#define COLOURBLIND 64
+#define MUTE 128
+#define DEAF 256
//Nutrition levels for humans. No idea where else to put it
#define NUTRITION_LEVEL_FAT 600
@@ -113,4 +115,7 @@
#define GENETIC_DAMAGE_STAGE_3 35
#define CLONER_FRESH_CLONE "fresh"
-#define CLONER_MATURE_CLONE "mature"
\ No newline at end of file
+#define CLONER_MATURE_CLONE "mature"
+
+//Gene properties
+#define GENE_EYE_DEPENDENT 1
diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index 09ea7bf366f..bf19a447232 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -253,6 +253,16 @@
#define MATRIX_GREYSCALE list(0.33, 0.33, 0.33,\
0.33, 0.33, 0.33,\
0.33, 0.33, 0.33)
+
+#define MATRIX_VULP_CBLIND list(0.5,0.4,0.1,\
+ 0.5,0.4,0.1,\
+ 0.0,0.2,0.8)
+
+#define MATRIX_TAJ_CBLIND list(0.4,0.2,0.4,\
+ 0.4,0.6,0.0,\
+ 0.2,0.2,0.6)
+
+
//Gun trigger guards
#define TRIGGER_GUARD_ALLOW_ALL -1
#define TRIGGER_GUARD_NONE 0
diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm
index 73b2b7304f6..116aa0797cb 100644
--- a/code/_globalvars/genetics.dm
+++ b/code/_globalvars/genetics.dm
@@ -1,5 +1,6 @@
///////////
var/BLINDBLOCK = 0
+var/COLOURBLINDBLOCK = 0
var/DEAFBLOCK = 0
var/HULKBLOCK = 0
var/TELEBLOCK = 0
diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm
index 82f7ffb2e93..2967dafe5ae 100644
--- a/code/game/dna/dna2.dm
+++ b/code/game/dna/dna2.dm
@@ -65,6 +65,7 @@ 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 6175d547d63..61ecb735459 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)
+ if((gene in defaultgenes) && gene_active && !gene.update) //Unless we want to update them with current information they depend on.
return
// Prior state
@@ -65,3 +65,5 @@
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 4cfa6f45750..28c9c1c76b6 100644
--- a/code/game/dna/genes/disabilities.dm
+++ b/code/game/dna/genes/disabilities.dm
@@ -115,6 +115,40 @@
/datum/dna/gene/disability/blindness/New()
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."
+ 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()
+
+/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()
+
/datum/dna/gene/disability/deaf
name="Deafness"
activation_message="It's kinda quiet."
@@ -139,7 +173,6 @@
/datum/dna/gene/disability/nearsighted/New()
block=GLASSESBLOCK
-
/datum/dna/gene/disability/lisp
name = "Lisp"
desc = "I wonder wath thith doeth."
diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm
index f74d0c7d2a0..63992e16a5f 100644
--- a/code/game/dna/genes/gene.dm
+++ b/code/game/dna/genes/gene.dm
@@ -26,6 +26,9 @@
// 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 e587a7db0ab..aa333a865b5 100644
--- a/code/game/gamemodes/changeling/powers/humanform.dm
+++ b/code/game/gamemodes/changeling/powers/humanform.dm
@@ -24,15 +24,18 @@
if(!user)
return 0
to_chat(user, "We transform our appearance.")
- user.dna.SetSEState(MONKEYBLOCK,0)
- domutcheck(user, null) // Do a pre-mutcheck to cleanly switch from monkey form.
- user.dna = chosen_dna
+ user.dna.SetSEState(MONKEYBLOCK,0,1)
+ genemutcheck(user,MONKEYBLOCK,null,MUTCHK_FORCED)
user.real_name = chosen_dna.real_name
- user.flavor_text = ""
if(ishuman(user))
- user.set_species()
+ user.set_species(chosen_dna.species)
+ user.dna = chosen_dna.Clone()
+ domutcheck(user, null, MUTCHK_FORCED)
+ user.flavor_text = ""
+ user.dna.UpdateSE()
+ user.dna.UpdateUI()
+ user.sync_organ_dna(1)
user.UpdateAppearance()
- domutcheck(user, null)
changeling.purchasedpowers -= src
//O.mind.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/lesserform(null)
diff --git a/code/game/gamemodes/changeling/powers/lesserform.dm b/code/game/gamemodes/changeling/powers/lesserform.dm
index e5040af282f..7316d635acf 100644
--- a/code/game/gamemodes/changeling/powers/lesserform.dm
+++ b/code/game/gamemodes/changeling/powers/lesserform.dm
@@ -21,13 +21,18 @@
to_chat(H, "We cannot perform this ability in this form!")
return
+ 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
- H.monkeyize()
+
+ user.dna.SetSEState(MONKEYBLOCK,1,1)
+ genemutcheck(user,MONKEYBLOCK,null,MUTCHK_FORCED)
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 f1ff51a42a2..5ca928c77c7 100644
--- a/code/game/gamemodes/changeling/powers/transform.dm
+++ b/code/game/gamemodes/changeling/powers/transform.dm
@@ -14,14 +14,17 @@
if(!chosen_dna)
return
- user.dna = chosen_dna.Clone()
user.real_name = chosen_dna.real_name
- user.flavor_text = ""
if(ishuman(user))
- user.set_species()
+ 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()
+ user.dna.UpdateUI()
+ user.sync_organ_dna(1)
user.UpdateAppearance()
- domutcheck(user, null)
-
+
user.changeling_update_languages(changeling.absorbed_languages)
feedback_add_details("changeling_powers","TR")
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index c177e85f870..e55d99c4c9e 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -35,6 +35,7 @@
// Standard muts
BLINDBLOCK = getAssignedBlock("BLIND", numsToAssign)
+ COLOURBLINDBLOCK = getAssignedBlock("COLOURBLIND", numsToAssign)
DEAFBLOCK = getAssignedBlock("DEAF", numsToAssign)
HULKBLOCK = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good=1)
TELEBLOCK = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good=1)
@@ -115,6 +116,8 @@
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/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index 4ec7516a409..8a2bec6a7ef 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -282,8 +282,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "Species: [species]
"
if(species == "Vox")
dat += "N2 Tank: [speciesprefs ? "Large N2 Tank" : "Specialized N2 Tank"]
"
- else if(species in list("Vulpkanin", "Tajaran"))
- dat += "Colour Vision: [speciesprefs ? "Unaugmented" : "Surgically Corrected"]
"
dat += "Secondary Language: [language]
"
dat += "Blood Type: [b_type]
"
if(species in list("Human", "Drask", "Vox"))
@@ -817,6 +815,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
HTML += ShowDisabilityState(user,DISABILITY_FLAG_EPILEPTIC,"Seizures")
HTML += ShowDisabilityState(user,DISABILITY_FLAG_DEAF,"Deaf")
HTML += ShowDisabilityState(user,DISABILITY_FLAG_BLIND,"Blind")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_COLOURBLIND,"Colourblind")
HTML += ShowDisabilityState(user,DISABILITY_FLAG_MUTE,"Mute")
@@ -1340,12 +1339,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
organ_data = list()
rlimb_data = list()
if("speciesprefs")
- if(species == "Vox") //oldvox code
- speciesprefs = !speciesprefs //Starts 0, so if someone clicks the button up top there, this won't be 0 anymore. If they click it again, it'll go back to 0.
- else if(species in list("Vulpkanin", "Tajaran")) //Species that can be colourblind.
- var/list/vision_options = list("Surgically Corrected", "Unaugmented") //Surgically corrected eyes (default option) see in full colour but have 2 darksight. Unaugmented eyes are colourblind but have 8 darksight.
- speciesprefs = input("Please select your vision preference. \nOverridden by mech. assisted or mechanical eyes. \nSurgically Corrected: Full colour, low darksight. \n Unaugmented: Colourblind, full darksight.", "Character Generation", 0) in vision_options
- speciesprefs = (speciesprefs != "Surgically Corrected") //Ensure the default option (surgically corrected) returns 0. I would've set up the vision_options list such that Surgically Corrected = 0, but input() didn't care for it.
+ speciesprefs = !speciesprefs //Starts 0, so if someone clicks the button up top there, this won't be 0 anymore. If they click it again, it'll go back to 0.
if("language")
// var/languages_available
var/list/new_languages = list("None")
@@ -2173,6 +2167,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.dna.SetSEState(BLINDBLOCK,1,1)
character.disabilities |= BLIND
+ 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
diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm
index 34f4e16bfdf..0108d693c18 100644
--- a/code/modules/mob/living/carbon/human/species/monkey.dm
+++ b/code/modules/mob/living/carbon/human/species/monkey.dm
@@ -54,8 +54,9 @@
..()
/datum/species/monkey/handle_dna(var/mob/living/carbon/human/H)
- H.dna.SetSEState(MONKEYBLOCK,1)
- genemutcheck(H, MONKEYBLOCK)
+ if(!is_type_in_list(/datum/dna/gene/monkey, H.active_genes)) //Only activate the monkey gene if it isn't already.
+ H.dna.SetSEState(MONKEYBLOCK,1,1)
+ genemutcheck(H,MONKEYBLOCK,null,MUTCHK_FORCED)
/datum/species/monkey/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user)
switch(slot)
@@ -106,7 +107,6 @@
base_color = "#000000"
tail = "farwatail"
reagent_tag = PROCESS_ORG
-
has_organ = list(
"heart" = /obj/item/organ/internal/heart,
"lungs" = /obj/item/organ/internal/lungs,
@@ -114,8 +114,18 @@
"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.
+ "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.
)
+ 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
@@ -131,7 +141,6 @@
base_color = "#000000"
tail = "wolpintail"
reagent_tag = PROCESS_ORG
-
has_organ = list(
"heart" = /obj/item/organ/internal/heart,
"lungs" = /obj/item/organ/internal/lungs,
@@ -139,8 +148,18 @@
"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.
+ "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.
)
+ 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/station.dm b/code/modules/mob/living/carbon/human/species/station.dm
index 4ae52431e9a..f7635e2a9c4 100644
--- a/code/modules/mob/living/carbon/human/species/station.dm
+++ b/code/modules/mob/living/carbon/human/species/station.dm
@@ -125,8 +125,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 /*Most Tajara are surgically augmented at birth for full colour vision, although it cost them their darksight (darksight = 2) unless they choose otherwise in character creation (darksight = 8 but colourblind).
- However, this organ define is for unaugmented eyes so cloned Tajara are colourblind but have excellent darksight.*/
+ "eyes" = /obj/item/organ/internal/eyes/tajaran /*Most Tajara see in full colour as a result of genetic augmentation, although it cost them their darksight (darksight = 2)
+ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/
)
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/chick, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/parrot,
@@ -138,15 +138,6 @@
"is twisting their own neck!",
"is holding their breath!")
-/datum/species/tajaran/equip(var/mob/living/carbon/human/H) //Handles colourblindness preferences. Should only happen if the client is in a mob otherwise it won't work.
- var/sight_pref = H.client.prefs.speciesprefs
- if(!sight_pref)
- var/obj/item/organ/internal/eyes/tajaran/tajeyes = H.get_int_organ(/obj/item/organ/internal/eyes)
- if(tajeyes && !tajeyes.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.
- tajeyes.colourmatrix = null //For individuals who recieved the modification, they lose much of their darksight and gain full colour vision.
- tajeyes.dark_view = 2 //If they didn't, they would have their unique colour-vision and full darksight. See code\modules\surgery\organs\subtypes\tajaran.dm
- H.update_client_colour(0)
-
/datum/species/tajaran/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
@@ -184,8 +175,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 /*Most Vulpkanin are surgically augmented at birth for full colour vision, although it cost them their darksight (darksight = 2) unless they choose otherwise in character creation (darksight = 8 but colourblind).
- However, this organ define is for unaugmented eyes so cloned Vulpkanin are colourblind but have excellent darksight.*/
+ "eyes" = /obj/item/organ/internal/eyes/vulpkanin /*Most Vulpkanin see in full colour as a result of genetic augmentation, although it cost them their darksight (darksight = 2)
+ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/
)
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/lizard, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
@@ -197,15 +188,6 @@
"is twisting their own neck!",
"is holding their breath!")
-/datum/species/vulpkanin/equip(var/mob/living/carbon/human/H) //Handles colourblindness preferences. Should only happen if the client is in a mob otherwise it won't work.
- var/sight_pref = H.client.prefs.speciesprefs
- if(!sight_pref)
- var/obj/item/organ/internal/eyes/vulpkanin/vulpeyes = H.get_int_organ(/obj/item/organ/internal/eyes)
- if(vulpeyes && !vulpeyes.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.
- vulpeyes.colourmatrix = null //For individuals who recieved the modification, they lose much of their darksight and gain full colour vision.
- vulpeyes.dark_view = 2 //If they didn't, they would have their unique colour-vision and full darksight. See code\modules\surgery\organs\subtypes\vulpkanin.dm
- H.update_client_colour(0)
-
/datum/species/vulpkanin/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
@@ -732,11 +714,9 @@
/datum/species/grey/handle_dna(var/mob/living/carbon/C, var/remove)
if(!remove)
C.dna.SetSEState(REMOTETALKBLOCK,1,1)
- C.mutations |= REMOTE_TALK
genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED)
else
C.dna.SetSEState(REMOTETALKBLOCK,0,1)
- C.mutations -= REMOTE_TALK
genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED)
..()
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index 8adc505102b..a484324560d 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -1,7 +1,6 @@
/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/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm
index 79d1ed5faae..514d836bfc3 100644
--- a/code/modules/surgery/organs/organ_internal.dm
+++ b/code/modules/surgery/organs/organ_internal.dm
@@ -344,6 +344,7 @@
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/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.
@@ -355,6 +356,19 @@
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)
+
+/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)
+ .=..()
+
/obj/item/organ/internal/eyes/surgeryize()
if(!owner)
return
diff --git a/code/modules/surgery/organs/subtypes/tajaran.dm b/code/modules/surgery/organs/subtypes/tajaran.dm
index f65070feb6c..7feacd4fbc4 100644
--- a/code/modules/surgery/organs/subtypes/tajaran.dm
+++ b/code/modules/surgery/organs/subtypes/tajaran.dm
@@ -2,11 +2,8 @@
alcohol_intensity = 1.4
species = "Tajaran"
-/obj/item/organ/internal/eyes/tajaran /*Most Tajara are surgically augmented at birth for full colour vision, although it cost them their darksight (darksight = 2) unless they choose otherwise in character creation (darksight = 8 but colourblind).
- However, this organ define is for unaugmented eyes so cloned Tajara are colourblind but have excellent darksight.*/
+/obj/item/organ/internal/eyes/tajaran /*Most Tajara see in full colour as a result of genetic augmentation, although it cost them their darksight (darksight = 2)
+ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/
name = "tajaran eyeballs"
species = "Tajaran"
- dark_view = 8
- colourmatrix = list(0.4,0.2,0.4,\
- 0.4,0.6,0.0,\
- 0.2,0.2,0.6) //Slightly less richness of hues or saturation of colours than Vulpkanin eyes. Pastel colour scheme, blues slightly green-shifted, reds slightly blue-shifted, greens yellow-shifted.
+ 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.
diff --git a/code/modules/surgery/organs/subtypes/vulpkanin.dm b/code/modules/surgery/organs/subtypes/vulpkanin.dm
index 39ee9463425..27172e50215 100644
--- a/code/modules/surgery/organs/subtypes/vulpkanin.dm
+++ b/code/modules/surgery/organs/subtypes/vulpkanin.dm
@@ -2,11 +2,8 @@
alcohol_intensity = 1.4
species = "Vulpkanin"
-/obj/item/organ/internal/eyes/vulpkanin /*Most Vulpkanin are surgically augmented at birth for full colour vision, although it cost them their darksight (darksight = 2) unless they choose otherwise in character creation (darksight = 8 but colourblind).
- However, this organ define is for unaugmented eyes so cloned Vulpkanin are colourblind but have excellent darksight.*/
+/obj/item/organ/internal/eyes/vulpkanin /*Most Vulpkanin see in full colour as a result of genetic augmentation, although it cost them their darksight (darksight = 2)
+ unless they choose otherwise by selecting the colourblind disability in character creation (darksight = 8 but colourblind).*/
name = "vulpkanin eyeballs"
species = "Vulpkanin"
- dark_view = 8
- colourmatrix = list(0.5,0.4,0.1,\
- 0.5,0.4,0.1,\
- 0.0,0.2,0.8) //Seeing in tones of blues and yellows, blind to greens. More richness of hue and saturation of colour than Tajara.
+ 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.