diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm
index 11393957fc1..8e7be007d12 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,4 @@
#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"
diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index 64e38bba06d..b9f32e9b49a 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -253,16 +253,19 @@
#define MAP_MAXZ 6
//Matricies
-#define MATRIX_DEFAULT list(1, 0, 0, 0,\
- 0, 1, 0, 0,\
- 0, 0, 1, 0,\
- 0, 0, 0, 1)
+#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)
+
-#define MATRIX_GREYSCALE list(0.33, 0.33, 0.33, 0,\
- 0.33, 0.33, 0.33, 0,\
- 0.33, 0.33, 0.33, 0,\
- 0.00, 0.00, 0.00, 1,\
- 0.00, 0.00, 0.00, 0)
//Gun trigger guards
#define TRIGGER_GUARD_ALLOW_ALL -1
#define TRIGGER_GUARD_NONE 0
diff --git a/code/__HELPERS/AnimationLibrary.dm b/code/__HELPERS/AnimationLibrary.dm
index fcabe2e0a78..fd79fe197f2 100644
--- a/code/__HELPERS/AnimationLibrary.dm
+++ b/code/__HELPERS/AnimationLibrary.dm
@@ -7,7 +7,7 @@
/proc/animate_fade_grayscale(var/atom/A, var/time = 5)
if(!istype(A) && !istype(A, /client))
return
- A.color = MATRIX_DEFAULT
+ A.color = null
animate(A, color = MATRIX_GREYSCALE, time = time, easing = SINE_EASING)
/proc/animate_melt_pixel(var/atom/A)
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/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm
index 4cfa6f45750..aaea991d5cf 100644
--- a/code/game/dna/genes/disabilities.dm
+++ b/code/game/dna/genes/disabilities.dm
@@ -115,6 +115,24 @@
/datum/dna/gene/disability/blindness/New()
block=BLINDBLOCK
+/datum/dna/gene/disability/colourblindness
+ 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
+
+/datum/dna/gene/disability/colourblindness/New()
+ block=COLOURBLINDBLOCK
+
+/datum/dna/gene/disability/colourblindness/activate(var/mob/M, var/connected, var/flags)
+ ..()
+ 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.update_client_colour() //Handle the deactivation of the colourblindness on the mob.
+
/datum/dna/gene/disability/deaf
name="Deafness"
activation_message="It's kinda quiet."
@@ -126,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
@@ -139,7 +157,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/gamemodes/changeling/powers/humanform.dm b/code/game/gamemodes/changeling/powers/humanform.dm
index e587a7db0ab..fb3012cd274 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.dna = chosen_dna.Clone()
user.real_name = chosen_dna.real_name
+ if(istype(user))
+ user.set_species(chosen_dna.species)
+ domutcheck(user,null,MUTCHK_FORCED)
user.flavor_text = ""
- if(ishuman(user))
- user.set_species()
+ 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..8ba1e53cb10 100644
--- a/code/game/gamemodes/changeling/powers/lesserform.dm
+++ b/code/game/gamemodes/changeling/powers/lesserform.dm
@@ -21,6 +21,7 @@
to_chat(H, "We cannot perform this ability in this form!")
return
+ user.dna = user.dna.Clone()
H.visible_message("[H] transforms!")
changeling.geneticdamage = 30
to_chat(H, "Our genes cry out!")
diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm
index f1ff51a42a2..b7c8abefd1d 100644
--- a/code/game/gamemodes/changeling/powers/transform.dm
+++ b/code/game/gamemodes/changeling/powers/transform.dm
@@ -16,12 +16,15 @@
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)
+ 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..c785c511304 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)
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..216c37e7a51 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.get_dark_view())) //The mob's either got the X-RAY vision or has a tapetum lucidum (extreme nightvision, i.e. Vulp/Tajara with COLOURBLIND & their monkey forms).
+ 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/client procs.dm b/code/modules/client/client procs.dm
index 6e1fe9126fd..3e2e1f54e0c 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -621,3 +621,6 @@
if(lang.flags & RESTRICTED)
message += " (RESTRICTED)"
to_chat(world, "[message]")
+
+/client/proc/colour_transition(var/list/colour_to = null, var/time = 10) //Call this with no parameters to reset to default.
+ animate(src, color=colour_to, time=time, easing=SINE_EASING)
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index c9b3127094b..764e88f02fa 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -817,6 +817,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")
@@ -1339,9 +1340,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
//Reset prosthetics.
organ_data = list()
rlimb_data = list()
- if("speciesprefs")//oldvox code
- speciesprefs = !speciesprefs
-
+ if("speciesprefs")
+ 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")
@@ -2168,6 +2168,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(disabilities & DISABILITY_FLAG_BLIND)
character.dna.SetSEState(BLINDBLOCK,1,1)
+ if(disabilities & DISABILITY_FLAG_COLOURBLIND)
+ character.dna.SetSEState(COLOURBLINDBLOCK,1,1)
+
if(disabilities & DISABILITY_FLAG_MUTE)
character.dna.SetSEState(MUTEBLOCK,1,1)
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index 4fde338ba54..5b38adc6a82 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -232,8 +232,6 @@
name = "noir sunglasses"
desc = "Somehow these seem even more out-of-date than normal sunglasses."
actions_types = list(/datum/action/item_action/noir)
- var/noir_mode = 0
- color_view = MATRIX_GREYSCALE
/obj/item/clothing/glasses/sunglasses/noir/attack_self()
toggle_noir()
@@ -243,36 +241,8 @@
return 1
/obj/item/clothing/glasses/sunglasses/noir/proc/toggle_noir()
- var/list/difference = difflist(usr.client.color, color_view)
-
- if(!noir_mode)
- if(color_view && usr.client && (!usr.client.color || difference))
- animate(usr.client, color = color_view, time = 10)
- noir_mode = 1
- else
- if(usr.client && usr.client.color && !difference)
- animate(usr.client, color = initial(usr.client.color), time = 10)
- noir_mode = 0
-
-/obj/item/clothing/glasses/sunglasses/noir/equipped(mob/user, slot)
- var/list/difference = difflist(user.client.color, color_view)
-
- if(slot == slot_glasses)
- if(noir_mode)
- if(color_view && user.client && (!user.client.color || difference.len))
- animate(user.client, color = color_view, time = 10)
- else
- if(user.client && user.client.color && !difference.len)
- animate(user.client, color = initial(user.client.color), time = 10)
- ..(user, slot)
-
-/obj/item/clothing/glasses/sunglasses/noir/dropped(mob/living/carbon/human/user)
- var/list/difference = difflist(user.client.color, color_view)
-
- if(istype(user) && user.glasses == src)
- if(user.client && user.client.color && !difference.len)
- animate(user.client, color = initial(user.client.color), time = 10)
- ..(user)
+ color_view = color_view ? null : MATRIX_GREYSCALE //Toggles between null and grayscale, with null being the default option.
+ usr.update_client_colour()
/obj/item/clothing/glasses/sunglasses/yeah
name = "agreeable glasses"
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 07ba42b69d7..d0289e1f32e 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -309,7 +309,7 @@
Stun(2)
var/obj/item/organ/internal/eyes/E = get_int_organ(/obj/item/organ/internal/eyes)
- if(!E)
+ if(!E || (E && E.weld_proof))
return
switch(damage)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index ae88df869d9..c2e2f090bb2 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -721,8 +721,6 @@
if(istype(id))
return id
-
-
/mob/living/carbon/human/update_sight()
if(!client)
return
@@ -1533,12 +1531,6 @@
if(species.default_language)
add_language(species.default_language)
- see_in_dark = species.darksight
- if(see_in_dark > 2)
- see_invisible = SEE_INVISIBLE_LEVEL_ONE
- else
- see_invisible = SEE_INVISIBLE_LIVING
-
hunger_drain = species.hunger_drain
digestion_ratio = species.digestion_ratio
@@ -1608,8 +1600,17 @@
dna.real_name = real_name
species.handle_post_spawn(src)
+
+ see_in_dark = species.get_resultant_darksight(src)
+ if(see_in_dark > 2)
+ see_invisible = SEE_INVISIBLE_LEVEL_ONE
+ else
+ see_invisible = SEE_INVISIBLE_LIVING
+
species.handle_dna(src) //Give them whatever special dna business they got.
+ update_client_colour(0)
+
spawn(0)
overlays.Cut()
update_mutantrace(1)
@@ -1632,7 +1633,6 @@
return null
return species.default_language ? all_languages[species.default_language] : null
-
/mob/living/carbon/human/proc/bloody_doodle()
set category = "IC"
set name = "Write in blood"
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 4e90d763e9e..c375d718e3d 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -119,6 +119,7 @@
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
update_sight()
update_inv_glasses()
+ update_client_colour()
else if(I == head)
head = null
if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR)
@@ -271,6 +272,7 @@
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
update_sight()
update_inv_glasses(redraw_mob)
+ update_client_colour()
if(slot_gloves)
gloves = W
update_inv_gloves(redraw_mob)
diff --git a/code/modules/mob/living/carbon/human/species/abductor.dm b/code/modules/mob/living/carbon/human/species/abductor.dm
index 3bcade9f00d..4690529524f 100644
--- a/code/modules/mob/living/carbon/human/species/abductor.dm
+++ b/code/modules/mob/living/carbon/human/species/abductor.dm
@@ -7,8 +7,16 @@
language = "Abductor Mindlink"
default_language = "Abductor Mindlink"
unarmed_type = /datum/unarmed_attack/punch
- darksight = 3
eyes = "blank_eyes"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes/abductor //3 darksight.
+ )
flags = HAS_LIPS | NO_BLOOD | NO_BREATHE
diff --git a/code/modules/mob/living/carbon/human/species/apollo.dm b/code/modules/mob/living/carbon/human/species/apollo.dm
index 416a1e8e88e..4c871405c8d 100644
--- a/code/modules/mob/living/carbon/human/species/apollo.dm
+++ b/code/modules/mob/living/carbon/human/species/apollo.dm
@@ -9,7 +9,6 @@
punchdamagelow = 0
punchdamagehigh = 1
//primitive = /mob/living/carbon/monkey/wryn
- darksight = 3
slowdown = 1
warning_low_pressure = -300
hazard_low_pressure = 1
@@ -32,7 +31,7 @@
has_organ = list(
"heart" = /obj/item/organ/internal/heart,
"brain" = /obj/item/organ/internal/brain,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes/wryn, //3 darksight.
"appendix" = /obj/item/organ/internal/appendix,
"antennae" = /obj/item/organ/internal/wryn/hivenode
)
@@ -89,7 +88,7 @@
name_plural = "Nucleations"
icobase = 'icons/mob/human_races/r_nucleation.dmi'
unarmed_type = /datum/unarmed_attack/punch
- blurb = "A sub-race of unforunates who have been exposed to too much supermatter radiation. As a result, \
+ blurb = "A sub-race of unfortunates who have been exposed to too much supermatter radiation. As a result, \
supermatter crystal clusters have begun to grow across their bodies. Research to find a cure for this ailment \
has been slow, and so this is a common fate for veteran engineers. The supermatter crystals produce oxygen, \
negating the need for the individual to breathe. Their massive change in biology, however, renders most medicines \
@@ -109,8 +108,8 @@
reagent_tag = PROCESS_ORG
has_organ = list(
"heart" = /obj/item/organ/internal/heart,
- "crystalized brain" = /obj/item/organ/internal/brain/crystal,
- "eyes" = /obj/item/organ/internal/eyes/luminescent_crystal,
+ "crystallized brain" = /obj/item/organ/internal/brain/crystal,
+ "eyes" = /obj/item/organ/internal/eyes/luminescent_crystal, //Standard darksight of 2.
"strange crystal" = /obj/item/organ/internal/nucleation/strange_crystal,
"resonant crystal" = /obj/item/organ/internal/nucleation/resonant_crystal
)
diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm
index 1bb4ba8e214..a2f2eb30467 100644
--- a/code/modules/mob/living/carbon/human/species/golem.dm
+++ b/code/modules/mob/living/carbon/human/species/golem.dm
@@ -40,7 +40,8 @@
has_organ = list(
"brain" = /obj/item/organ/internal/brain/golem
- )
+ ) //Has standard darksight of 2.
+
suicide_messages = list(
"is crumbling into dust!",
"is smashing their body apart!")
diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm
index dffc73d4e1d..6e29d658cfe 100644
--- a/code/modules/mob/living/carbon/human/species/monkey.dm
+++ b/code/modules/mob/living/carbon/human/species/monkey.dm
@@ -26,6 +26,7 @@
tail = "chimptail"
bodyflags = FEET_PADDED | HAS_TAIL
reagent_tag = PROCESS_ORG
+ //Has standard darksight of 2.
//unarmed_types = list(/datum/unarmed_attack/bite, /datum/unarmed_attack/claws)
//inherent_verbs = list(/mob/living/proc/ventcrawl)
@@ -54,7 +55,7 @@
/datum/species/monkey/handle_dna(var/mob/living/carbon/human/H)
H.dna.SetSEState(MONKEYBLOCK,1)
- genemutcheck(H, MONKEYBLOCK)
+ 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)
@@ -105,6 +106,15 @@
base_color = "#000000"
tail = "farwatail"
reagent_tag = PROCESS_ORG
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/tajaran,
+ "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/farwa //Tajara monkey-forms are uniquely colourblind and have excellent darksight, which is why they need a subtype of their greater-form's organ..
+ )
/datum/species/monkey/vulpkanin
@@ -120,6 +130,15 @@
base_color = "#000000"
tail = "wolpintail"
reagent_tag = PROCESS_ORG
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/vulpkanin,
+ "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/wolpin //Vulpkanin monkey-forms are uniquely colourblind and have excellent darksight, which is why they need a subtype of their greater-form's organ..
+ )
/datum/species/monkey/skrell
diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm
index e76aaa91b02..05f24facc65 100644
--- a/code/modules/mob/living/carbon/human/species/plasmaman.dm
+++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm
@@ -20,6 +20,8 @@
heat_level_2 = 400 // Heat damage level 2 above this point.
heat_level_3 = 500 // Heat damage level 3 above this point.
+ //Has default darksight of 2.
+
suicide_messages = list(
"is twisting their own neck!",
"is letting some O2 in!",
diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm
index 66a62f1b10c..6f594768d4e 100644
--- a/code/modules/mob/living/carbon/human/species/shadow.dm
+++ b/code/modules/mob/living/carbon/human/species/shadow.dm
@@ -7,15 +7,14 @@
default_language = "Galactic Common"
unarmed_type = /datum/unarmed_attack/claws
-
- darksight = 8
-
+
ignored_by = list(/mob/living/simple_animal/hostile/faithless)
blood_color = "#CCCCCC"
flesh_color = "#AAAAAA"
has_organ = list(
- "brain" = /obj/item/organ/internal/brain
+ "brain" = /obj/item/organ/internal/brain,
+ "eyes" = /obj/item/organ/internal/eyes/shadow //8 darksight.
)
flags = NO_BLOOD | NO_BREATHE | RADIMMUNE
@@ -23,7 +22,7 @@
oxy_mod = 0
virus_immune = 1
-
+
dietflags = DIET_OMNI //the mutation process allowed you to now digest all foods regardless of initial race
reagent_tag = PROCESS_ORG
suicide_messages = list(
@@ -31,10 +30,10 @@
"is jamming their claws into their eye sockets!",
"is twisting their own neck!",
"is staring into the closest light source!")
-
+
var/grant_vision_toggle = 1
var/datum/action/innate/shadow/darkvision/vision_toggle
-
+
/datum/action/innate/shadow/darkvision //Darkvision toggle so shadowpeople can actually see where darkness is
name = "Toggle Darkvision"
check_flags = AB_CHECK_CONSCIOUS
@@ -49,13 +48,13 @@
else
H.vision_type = null
to_chat(H, "You adjust your vision to recognize the shadows.")
-
+
/datum/species/shadow/grant_abilities(var/mob/living/carbon/human/H)
. = ..()
if(grant_vision_toggle)
vision_toggle = new
vision_toggle.Grant(H)
-
+
/datum/species/shadow/remove_abilities(var/mob/living/carbon/human/H)
. = ..()
if(grant_vision_toggle && vision_toggle)
diff --git a/code/modules/mob/living/carbon/human/species/skeleton.dm b/code/modules/mob/living/carbon/human/species/skeleton.dm
index 4a3b087e93d..d09c8dd1699 100644
--- a/code/modules/mob/living/carbon/human/species/skeleton.dm
+++ b/code/modules/mob/living/carbon/human/species/skeleton.dm
@@ -41,7 +41,7 @@
"is twisting their skull off!")
has_organ = list(
"brain" = /obj/item/organ/internal/brain/golem,
- )
+ ) //Has default darksight of 2.
/datum/species/skeleton/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R)
// Crazylemon is still silly
diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm
index 7745f950aec..d8769a3acea 100644
--- a/code/modules/mob/living/carbon/human/species/species.dm
+++ b/code/modules/mob/living/carbon/human/species/species.dm
@@ -49,8 +49,7 @@
var/siemens_coeff = 1 //base electrocution coefficient
var/invis_sight = SEE_INVISIBLE_LIVING
- var/darksight = 2
-
+
var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure.
var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning.
var/warning_low_pressure = WARNING_LOW_PRESSURE // Low pressure warning.
@@ -85,7 +84,7 @@
var/ventcrawler = 0 //Determines if the mob can go through the vents.
var/has_fine_manipulation = 1 // Can use small items.
-
+
var/mob/living/list/ignored_by = list() // list of mobs that will ignore this species
var/list/allowed_consumed_mobs = list() //If a species can consume mobs, put the type of mobs it can consume here.
@@ -588,12 +587,23 @@ It'll return null if the organ doesn't correspond, so include null checks when u
return null
return has_organ[organ_slot]
+/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)
+ resultant_darksight = eyes.get_dark_view()
+ return resultant_darksight
/datum/species/proc/update_sight(mob/living/carbon/human/H)
H.sight = initial(H.sight)
- H.see_in_dark = darksight
+ H.see_in_dark = get_resultant_darksight(H)
H.see_invisible = invis_sight
+ if(H.see_in_dark > 2) //Preliminary see_invisible handling as per set_species() in code\modules\mob\living\carbon\human\human.dm.
+ H.see_invisible = SEE_INVISIBLE_LEVEL_ONE
+ else
+ H.see_invisible = SEE_INVISIBLE_LIVING
+
if(H.client.eye != H)
var/atom/A = H.client.eye
if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates.
@@ -644,7 +654,7 @@ It'll return null if the organ doesn't correspond, so include null checks when u
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
var/obj/item/clothing/glasses/G = rig.visor.vision.glasses
if(istype(G))
- H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision.
+ H.see_in_dark = (G.darkness_view ? G.darkness_view : get_resultant_darksight(H)) // Otherwise we keep our darkness view with togglable nightvision.
if(G.vision_flags) // MESONS
H.sight |= G.vision_flags
@@ -654,7 +664,7 @@ It'll return null if the organ doesn't correspond, so include null checks when u
H.see_in_dark = max(lesser_darkview_bonus, H.see_in_dark)
if(H.vision_type)
- H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight)
+ H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, get_resultant_darksight(H))
H.see_invisible = H.vision_type.see_invisible
if(H.vision_type.light_sensitive)
H.weakeyes = 1
diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm
index ec4fe892af9..1ea4387e477 100644
--- a/code/modules/mob/living/carbon/human/species/station.dm
+++ b/code/modules/mob/living/carbon/human/species/station.dm
@@ -18,6 +18,7 @@
worlds tumultous at best."
reagent_tag = PROCESS_ORG
+ //Has standard darksight of 2.
/datum/species/unathi
name = "Unathi"
@@ -30,7 +31,6 @@
tail = "sogtail"
unarmed_type = /datum/unarmed_attack/claws
primitive_form = "Stok"
- darksight = 3
blurb = "A heavily reptillian species, Unathi (or 'Sinta as they call themselves) hail from the \
Uuosa-Eso system, which roughly translates to 'burning mother'.
Coming from a harsh, radioactive \
@@ -66,7 +66,7 @@
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
"appendix" = /obj/item/organ/internal/appendix,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes/unathi //3 darksight.
)
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/lizard, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
@@ -91,7 +91,6 @@
language = "Siik'tajr"
tail = "tajtail"
unarmed_type = /datum/unarmed_attack/claws
- darksight = 8
blurb = "The Tajaran race is a species of feline-like bipeds hailing from the planet of Ahdomai in the \
S'randarr system. They have been brought up into the space age by the Humans and Skrell, and have been \
@@ -126,7 +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,
+ "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,
@@ -152,7 +152,6 @@
primitive_form = "Wolpin"
tail = "vulptail"
unarmed_type = /datum/unarmed_attack/claws
- darksight = 8
blurb = "Vulpkanin are a species of sharp-witted canine-pideds residing on the planet Altam just barely within the \
dual-star Vazzend system. Their politically de-centralized society and independent natures have led them to become a species and \
@@ -176,7 +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,
+ "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,
@@ -226,7 +226,7 @@
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
"appendix" = /obj/item/organ/internal/appendix,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes //Default darksight of 2.
)
suicide_messages = list(
@@ -315,7 +315,7 @@
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
"appendix" = /obj/item/organ/internal/appendix,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes, //Default darksight of 2.
"stack" = /obj/item/organ/internal/stack/vox //Not the same as the cortical stack implant Vox Raiders spawn with. The cortical stack implant is used
) //for determining the success of the heist game-mode's 'leave nobody behind' objective, while this is just an organ.
@@ -439,7 +439,7 @@
"liver" = /obj/item/organ/internal/liver,
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes, //Default darksight of 2.
"stack" = /obj/item/organ/internal/stack/vox //Not the same as the cortical stack implant Vox Raiders spawn with. The cortical stack implant is used
) //for determining the success of the heist game-mode's 'leave nobody behind' objective, while this is just an organ.
@@ -478,7 +478,7 @@
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
"appendix" = /obj/item/organ/internal/appendix,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes //Default darksight of 2.
)
allowed_consumed_mobs = list(/mob/living/simple_animal/diona)
@@ -517,6 +517,7 @@
exotic_blood = "water"
//ventcrawler = 1 //ventcrawling commented out
butt_sprite = "slime"
+ //Has default darksight of 2.
has_organ = list(
"brain" = /obj/item/organ/internal/brain/slime
@@ -685,7 +686,6 @@
default_language = "Galactic Common"
language = "Psionic Communication"
unarmed_type = /datum/unarmed_attack/punch
- darksight = 5 // BOOSTED from 2
eyes = "grey_eyes_s"
butt_sprite = "grey"
@@ -696,7 +696,7 @@
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain/grey,
"appendix" = /obj/item/organ/internal/appendix,
- "eyes" = /obj/item/organ/internal/eyes,
+ "eyes" = /obj/item/organ/internal/eyes/grey //5 darksight.
)
brute_mod = 1.25 //greys are fragile
@@ -714,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)
..()
@@ -771,13 +769,13 @@
has_organ = list(
"nutrient channel" = /obj/item/organ/internal/liver/diona,
"neural strata" = /obj/item/organ/internal/heart/diona,
- "receptor node" = /obj/item/organ/internal/diona_receptor,
+ "receptor node" = /obj/item/organ/internal/eyes/diona, //Default darksight of 2.
"gas bladder" = /obj/item/organ/internal/brain/diona,
"polyp segment" = /obj/item/organ/internal/kidneys/diona,
"anchoring ligament" = /obj/item/organ/internal/appendix/diona
)
- vision_organ = /obj/item/organ/internal/diona_receptor
+ vision_organ = /obj/item/organ/internal/eyes/diona
has_limbs = list(
"chest" = list("path" = /obj/item/organ/external/chest/diona),
"groin" = list("path" = /obj/item/organ/external/groin/diona),
@@ -883,10 +881,10 @@
has_organ = list(
"brain" = /obj/item/organ/internal/brain/mmi_holder/posibrain,
"cell" = /obj/item/organ/internal/cell,
- "optics" = /obj/item/organ/internal/optical_sensor
+ "optics" = /obj/item/organ/internal/eyes/optical_sensor //Default darksight of 2.
)
- vision_organ = /obj/item/organ/internal/optical_sensor
+ vision_organ = /obj/item/organ/internal/eyes/optical_sensor
has_limbs = list(
"chest" = list("path" = /obj/item/organ/external/chest/ipc),
"groin" = list("path" = /obj/item/organ/external/groin/ipc),
@@ -932,7 +930,6 @@
language = "Orluum"
unarmed_type = /datum/unarmed_attack/punch
eyes = "drask_eyes_s"
- darksight = 5
speech_sounds = list('sound/voice/DraskTalk.ogg')
speech_chance = 20
@@ -982,7 +979,7 @@
"heart" = /obj/item/organ/internal/heart/drask,
"lungs" = /obj/item/organ/internal/lungs/drask,
"metabolic strainer" = /obj/item/organ/internal/liver/drask,
- "eyes" = /obj/item/organ/internal/eyes/drask,
+ "eyes" = /obj/item/organ/internal/eyes/drask, //5 darksight.
"brain" = /obj/item/organ/internal/brain/drask
)
diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm
index 8cc51882ebf..27197474c00 100644
--- a/code/modules/mob/login.dm
+++ b/code/modules/mob/login.dm
@@ -72,6 +72,8 @@
for(var/datum/alternate_appearance/AA in viewing_alternate_appearances)
AA.display_to(list(src))
+ update_client_colour(0)
+
callHook("mob_login", list("client" = client, "mob" = src))
// Calling update_interface() in /mob/Login() causes the Cyborg to immediately be ghosted; because of winget().
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 95fce0b9399..0a9e0e77912 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -22,6 +22,25 @@
return 0
return 1
+/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) //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) //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) //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)
if(L && L.implanted)
@@ -291,10 +310,10 @@ proc/muffledspeech(phrase)
/mob/proc/abiotic(var/full_body = 0)
- if(full_body && ((src.l_hand && !(src.l_hand.flags & ABSTRACT)) || (src.r_hand && !(src.r_hand.flags & ABSTRACT)) || (src.back || src.wear_mask)))
+ if(full_body && ((l_hand && !(l_hand.flags & ABSTRACT)) || (r_hand && !(r_hand.flags & ABSTRACT)) || (back || wear_mask)))
return 1
- if((src.l_hand && !(src.l_hand.flags & ABSTRACT)) || (src.r_hand && !(src.r_hand.flags & ABSTRACT)))
+ if((l_hand && !(l_hand.flags & ABSTRACT)) || (r_hand && !(r_hand.flags & ABSTRACT)))
return 1
return 0
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index 8adc505102b..f7fb545d495 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -1,7 +1,7 @@
/mob/living/carbon/human/proc/monkeyize()
var/mob/H = src
H.dna.SetSEState(MONKEYBLOCK,1)
- domutcheck(H, null)
+ genemutcheck(H,MONKEYBLOCK,null,MUTCHK_FORCED)
/mob/new_player/AIize()
spawning = 1
diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm
index 5ea86d2c7a3..cc9a33cde8e 100644
--- a/code/modules/research/designs/mechfabricator_designs.dm
+++ b/code/modules/research/designs/mechfabricator_designs.dm
@@ -1110,7 +1110,7 @@
name = "IPC Optical Sensor"
id = "ipc_optics"
build_type = MECHFAB
- build_path = /obj/item/organ/internal/optical_sensor
+ build_path = /obj/item/organ/internal/eyes/optical_sensor
materials = list(MAT_METAL=1000, MAT_GLASS=2500)
construction_time = 200
category = list("Misc")
diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm
index 0d029c8e1ce..16a22ea81f6 100644
--- a/code/modules/surgery/organs/organ.dm
+++ b/code/modules/surgery/organs/organ.dm
@@ -228,10 +228,10 @@ var/list/organ_cache = list()
/obj/item/organ/proc/take_damage(amount, var/silent=0)
if(tough)
return
- if(src.status & ORGAN_ROBOT)
- src.damage = between(0, src.damage + (amount * 0.8), max_damage)
+ if(status & ORGAN_ROBOT)
+ damage = between(0, damage + (amount * 0.8), max_damage)
else
- src.damage = between(0, src.damage + amount, max_damage)
+ damage = between(0, damage + amount, max_damage)
//only show this if the organ is not robotic
if(owner && parent_organ && amount > 0)
@@ -241,18 +241,18 @@ var/list/organ_cache = list()
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
robotic = 2
- src.status &= ~ORGAN_BROKEN
- src.status &= ~ORGAN_BLEEDING
- src.status &= ~ORGAN_SPLINTED
- src.status &= ~ORGAN_CUT_AWAY
- src.status &= ~ORGAN_ATTACHABLE
- src.status &= ~ORGAN_DESTROYED
- src.status |= ORGAN_ROBOT
- src.status |= ORGAN_ASSISTED
+ status &= ~ORGAN_BROKEN
+ status &= ~ORGAN_BLEEDING
+ status &= ~ORGAN_SPLINTED
+ status &= ~ORGAN_CUT_AWAY
+ status &= ~ORGAN_ATTACHABLE
+ status &= ~ORGAN_DESTROYED
+ status |= ORGAN_ROBOT
+ status |= ORGAN_ASSISTED
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
- robotize()
- src.status &= ~ORGAN_ROBOT
+ robotize(1) //Skip the icon/name setting that occurs in robotize to avoid having to reset the icon file.
+ status &= ~ORGAN_ROBOT
robotic = 1
min_bruised_damage = 15
min_broken_damage = 35
@@ -325,7 +325,7 @@ var/list/organ_cache = list()
affected.internal_organs |= src
if(!target.get_int_organ(src))
target.internal_organs += src
- src.loc = target
+ loc = target
if(robotic)
status |= ORGAN_ROBOT
diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm
index 8a5a6a6b158..8de7cccd2d6 100644
--- a/code/modules/surgery/organs/organ_internal.dm
+++ b/code/modules/surgery/organs/organ_internal.dm
@@ -201,7 +201,7 @@
/obj/item/organ/internal/heart/prepare_eat()
var/obj/S = ..()
- S.icon_state = "heart-off"
+ S.icon_state = dead_icon
return S
/obj/item/organ/internal/heart/cursed
@@ -343,16 +343,47 @@
parent_organ = "head"
slot = "eyes"
var/list/eye_colour = list(0,0,0)
+ var/list/colourmatrix = null
+ var/list/colourblind_matrix = MATRIX_GREYSCALE //Special colourblindness parameters. By default, it's black-and-white.
+ 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/insert(mob/living/carbon/M, special = 0)
+/obj/item/organ/internal/eyes/proc/get_colourmatrix() //Returns a special colour matrix if the eyes are organic and the mob is colourblind, otherwise it uses the current one.
+ if(!robotic && owner.disabilities & COLOURBLIND)
+ return colourblind_matrix
+ else
+ return colourmatrix
+
+/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().
+ if(!robotic && colourblind_darkview && owner.disabilities & COLOURBLIND) //Returns special darkview value if colourblind and it exists, otherwise reuse current.
+ return colourblind_darkview
+ else
+ return dark_view
+
+/obj/item/organ/internal/eyes/insert(mob/living/carbon/human/M, special = 0)
..()
if(istype(M) && eye_colour)
- var/mob/living/carbon/human/H = M
- // Apply our eye colour to the target.
- H.update_body()
+ M.update_body() //Apply our eye colour to the target.
+
+ 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)
+ 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)
+ 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)
+ genemutcheck(M,COLOURBLINDBLOCK,null,MUTCHK_FORCED)
+ . = ..()
/obj/item/organ/internal/eyes/surgeryize()
if(!owner)
@@ -362,6 +393,38 @@
owner.SetEyeBlurry(0)
owner.SetEyeBlind(0)
+/obj/item/organ/internal/robotize(var/icon_bypass) //If icon bypass isn't null, skip the processing here and go straight to the parent call.
+ if(!icon_bypass && !(status & ORGAN_ROBOT)) //Don't override the icons for the already-mechanical IPC organs.
+ var/list/states = icon_states('icons/obj/surgery.dmi') //Insensitive to specially-defined icon files for species like the Drask or whomever else. Everyone gets the same robotic heart.
+ if(slot == "heart" && ("[slot]-prosthetic-on" in states) && ("[slot]-prosthetic-off" in states)) //Give the robotic heart its robotic heart icons if they exist.
+ var/obj/item/organ/internal/heart/H = src
+ H.icon = icon('icons/obj/surgery.dmi')
+ H.icon_base = "[slot]-prosthetic"
+ H.dead_icon = "[slot]-prosthetic-off"
+ H.update_icon()
+ else if("[slot]-prosthetic" in states) //Give the robotic organ its robotic organ icons if they exist.
+ icon = icon('icons/obj/surgery.dmi')
+ icon_state = "[slot]-prosthetic"
+ name = "mechanical [slot]"
+ ..() //Go apply all the organ flags/robotic statuses.
+
+/obj/item/organ/internal/eyes/robotize()
+ colourmatrix = null
+ dark_view = 2
+ ..() //Make sure the organ's got the robotic status indicators before updating the client colour.
+ owner.update_client_colour(0) //Since both mechassisted and mechanical eyes give dark_view of 2 and full colour vision atm, just having this here is fine as mechassist() will call it anyway.
+
+/obj/item/organ/internal/mechassist()
+ ..() //Go back, call robotize(), adjust the robotic status indicators and the organ damage parameters.
+ var/list/states = icon_states(icon) //Sensitive to specially-defined icon files since the organs are not fully synthetic.
+ if(slot == "heart" && ("[organ_tag]-assisted-on" in states) && ("[organ_tag]-assisted-off" in states)) //Give the mechassisted heart its mechassisted heart icons if they exist.
+ var/obj/item/organ/internal/heart/H = src
+ H.icon_base = "[organ_tag]-assisted"
+ H.dead_icon = "[organ_tag]-assisted-off"
+ H.update_icon()
+ else if("[organ_tag]-assisted" in states) //Give the mechassisted organ its mechassisted organ icons if they exist.
+ icon_state = "[organ_tag]-assisted"
+ name = "mechanically assisted [initial(name)]" //Avoid setting the organ's name to something like "mechanically assisted mechanical eyes".
/obj/item/organ/internal/liver
name = "liver"
@@ -372,7 +435,6 @@
var/alcohol_intensity = 1
/obj/item/organ/internal/liver/process()
-
..()
if(!owner)
diff --git a/code/modules/surgery/organs/subtypes/abductor.dm b/code/modules/surgery/organs/subtypes/abductor.dm
new file mode 100644
index 00000000000..6fd234bc501
--- /dev/null
+++ b/code/modules/surgery/organs/subtypes/abductor.dm
@@ -0,0 +1,4 @@
+/obj/item/organ/internal/eyes/abductor
+ name = "abductor eyeballs"
+ dark_view = 3
+ species = "Abductor"
diff --git a/code/modules/surgery/organs/subtypes/diona.dm b/code/modules/surgery/organs/subtypes/diona.dm
index 48ad2fb3cea..c7044f92fb9 100644
--- a/code/modules/surgery/organs/subtypes/diona.dm
+++ b/code/modules/surgery/organs/subtypes/diona.dm
@@ -97,74 +97,42 @@
/obj/item/organ/diona/process()
return
-/obj/item/organ/internal/heart/diona
+/obj/item/organ/internal/heart/diona // Turns into a nymph instantly, no transplanting possible.
name = "neural strata"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
- organ_tag = "heart" // Turns into a nymph instantly, no transplanting possible.
- origin_tech = "biotech=3"
- parent_organ = "chest"
- slot = "heart"
species = "Diona"
-/obj/item/organ/internal/brain/diona
+/obj/item/organ/internal/brain/diona // Turns into a nymph instantly, no transplanting possible.
name = "gas bladder"
- parent_organ = "head"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
- organ_tag = "brain" // Turns into a nymph instantly, no transplanting possible.
- origin_tech = "biotech=3"
- slot = "brain"
species = "Diona"
-/obj/item/organ/internal/kidneys/diona
+/obj/item/organ/internal/kidneys/diona // Turns into a nymph instantly, no transplanting possible.
name = "polyp segment"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
- organ_tag = "kidneys" // Turns into a nymph instantly, no transplanting possible.
- origin_tech = "biotech=3"
- parent_organ = "groin"
- slot = "kidneys"
species = "Diona"
-/obj/item/organ/internal/appendix/diona
+/obj/item/organ/internal/appendix/diona // Turns into a nymph instantly, no transplanting possible.
name = "anchoring ligament"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
- organ_tag = "appendix" // Turns into a nymph instantly, no transplanting possible.
- origin_tech = "biotech=3"
- parent_organ = "groin"
- slot = "appendix"
species = "Diona"
-/obj/item/organ/internal/diona_receptor
+/obj/item/organ/internal/eyes/diona // Turns into a nymph instantly, no transplanting possible.
name = "receptor node"
- organ_tag = "eyes"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
- origin_tech = "biotech=3"
- parent_organ = "head"
- slot = "eyes"
species = "Diona"
-/obj/item/organ/internal/diona_receptor/surgeryize()
- if(!owner)
- return
- owner.CureNearsighted()
- owner.CureBlind()
- owner.SetEyeBlurry(0)
- owner.SetEyeBlind(0)
-
-
//TODO:Make absorb rads on insert
-/obj/item/organ/internal/liver/diona
+/obj/item/organ/internal/liver/diona // Turns into a nymph instantly, no transplanting possible.
name = "nutrient vessel"
- parent_organ = "chest"
- organ_tag = "liver"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
- slot = "liver"
alcohol_intensity = 0.5
species = "Diona"
diff --git a/code/modules/surgery/organs/subtypes/drask.dm b/code/modules/surgery/organs/subtypes/drask.dm
index b3b260a28a0..6e1e6662d0a 100644
--- a/code/modules/surgery/organs/subtypes/drask.dm
+++ b/code/modules/surgery/organs/subtypes/drask.dm
@@ -9,51 +9,29 @@
/obj/item/organ/internal/heart/drask
name = "drask heart"
icon = 'icons/obj/surgery_drask.dmi'
- icon_state = "heart-on"
- dead_icon = "heart-off"
- organ_tag = "heart"
parent_organ = "head"
- slot = "heart"
species = "Drask"
/obj/item/organ/internal/lungs/drask
- name = "lungs"
icon = 'icons/obj/surgery_drask.dmi'
- icon_state = "lungs"
- gender = PLURAL
- organ_tag = "lungs"
- parent_organ = "chest"
- slot = "lungs"
species = "Drask"
/obj/item/organ/internal/liver/drask
name = "metabolic strainer"
icon = 'icons/obj/surgery_drask.dmi'
- icon_state = "kidneys"
- gender = PLURAL
- organ_tag = "kidneys"
- parent_organ = "groin"
- slot = "kidneys"
alcohol_intensity = 0.8
species = "Drask"
/obj/item/organ/internal/brain/drask
- name = "brain"
icon = 'icons/obj/surgery_drask.dmi'
icon_state = "brain2"
- organ_tag = "brain"
- slot = "brain"
mmi_icon = 'icons/obj/surgery_drask.dmi'
mmi_icon_state = "mmi_full"
species = "Drask"
/obj/item/organ/internal/eyes/drask
- name = "eyes"
+ name = "drask eyeballs"
icon = 'icons/obj/surgery_drask.dmi'
- icon_state = "eyes"
- gender = PLURAL
- organ_tag = "eyes"
- parent_organ = "head"
- slot = "eyes"
desc = "Drask eyes. They look even stranger disembodied"
+ dark_view = 5
species = "Drask"
diff --git a/code/modules/surgery/organs/subtypes/grey.dm b/code/modules/surgery/organs/subtypes/grey.dm
index a47ab801d6f..6c06da373b7 100644
--- a/code/modules/surgery/organs/subtypes/grey.dm
+++ b/code/modules/surgery/organs/subtypes/grey.dm
@@ -14,3 +14,8 @@
/obj/item/organ/internal/brain/grey/remove(var/mob/living/carbon/M, var/special = 0)
. = ..()
M.remove_language("Psionic Communication")
+
+/obj/item/organ/internal/eyes/grey
+ name = "grey eyeballs"
+ dark_view = 5
+ species = "Grey"
diff --git a/code/modules/surgery/organs/subtypes/machine.dm b/code/modules/surgery/organs/subtypes/machine.dm
index 0f402a42e5d..b3bb3f61e07 100644
--- a/code/modules/surgery/organs/subtypes/machine.dm
+++ b/code/modules/surgery/organs/subtypes/machine.dm
@@ -117,37 +117,26 @@
robotize()
..()
-/obj/item/organ/internal/optical_sensor
+/obj/item/organ/internal/eyes/optical_sensor
name = "optical sensor"
- organ_tag = "eyes"
- parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"
- slot = "eyes"
status = ORGAN_ROBOT
species = "Machine"
// dead_icon = "camera_broken"
+ weld_proof = 1
-/obj/item/organ/internal/optical_sensor/New()
+/obj/item/organ/internal/eyes/optical_sensor/New()
robotize()
..()
-/obj/item/organ/internal/optical_sensor/remove(var/mob/living/user,special = 0)
+/obj/item/organ/internal/eyes/optical_sensor/remove(var/mob/living/user,special = 0)
if(!special)
to_chat(owner, "Error 404:Optical Sensors not found.")
. = ..()
-/obj/item/organ/internal/optical_sensor/surgeryize()
- if(!owner)
- return
- owner.CureNearsighted()
- owner.CureBlind()
- owner.SetEyeBlurry(0)
- owner.SetEyeBlind(0)
-
-
// Used for an MMI or posibrain being installed into a human.
/obj/item/organ/internal/brain/mmi_holder
name = "brain"
@@ -160,7 +149,6 @@
species = "Machine"
var/obj/item/device/mmi/stored_mmi
-
/obj/item/organ/internal/brain/mmi_holder/Destroy()
if(stored_mmi)
qdel(stored_mmi)
diff --git a/code/modules/surgery/organs/subtypes/nucleation.dm b/code/modules/surgery/organs/subtypes/nucleation.dm
index d234b666ae3..4223834501d 100644
--- a/code/modules/surgery/organs/subtypes/nucleation.dm
+++ b/code/modules/surgery/organs/subtypes/nucleation.dm
@@ -26,8 +26,6 @@
icon_state = "crystal-eyes"
organ_tag = "luminescent eyes"
light_color = "#1C1C00"
- parent_organ = "head"
- slot = "eyes"
species = "Nucleation"
/obj/item/organ/internal/eyes/luminescent_crystal/New()
@@ -35,8 +33,7 @@
..()
/obj/item/organ/internal/brain/crystal
- name = "crystalized brain"
+ name = "crystallized brain"
icon_state = "crystal-brain"
- organ_tag = "crystalized brain"
- slot = "brain"
+ organ_tag = "crystallized brain"
species = "Nucleation"
diff --git a/code/modules/surgery/organs/subtypes/shadow.dm b/code/modules/surgery/organs/subtypes/shadow.dm
new file mode 100644
index 00000000000..f81fc54bfb1
--- /dev/null
+++ b/code/modules/surgery/organs/subtypes/shadow.dm
@@ -0,0 +1,4 @@
+/obj/item/organ/internal/eyes/shadow
+ name = "dark orbs"
+ dark_view = 8
+ species = "Shadow"
diff --git a/code/modules/surgery/organs/subtypes/tajaran.dm b/code/modules/surgery/organs/subtypes/tajaran.dm
index e37686a05ca..746abd6e601 100644
--- a/code/modules/surgery/organs/subtypes/tajaran.dm
+++ b/code/modules/surgery/organs/subtypes/tajaran.dm
@@ -1,3 +1,16 @@
/obj/item/organ/internal/liver/tajaran
alcohol_intensity = 1.4
species = "Tajaran"
+
+/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"
+ 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/unathi.dm b/code/modules/surgery/organs/subtypes/unathi.dm
index a769bce7a02..0fb45319ce5 100644
--- a/code/modules/surgery/organs/subtypes/unathi.dm
+++ b/code/modules/surgery/organs/subtypes/unathi.dm
@@ -1,3 +1,8 @@
/obj/item/organ/internal/liver/unathi
alcohol_intensity = 0.8
species = "Unathi"
+
+/obj/item/organ/internal/eyes/unathi
+ name = "unathi eyeballs"
+ dark_view = 3
+ species = "Unathi"
diff --git a/code/modules/surgery/organs/subtypes/vulpkanin.dm b/code/modules/surgery/organs/subtypes/vulpkanin.dm
index ca47ac83ddd..af3d9deab09 100644
--- a/code/modules/surgery/organs/subtypes/vulpkanin.dm
+++ b/code/modules/surgery/organs/subtypes/vulpkanin.dm
@@ -1,3 +1,16 @@
/obj/item/organ/internal/liver/vulpkanin
alcohol_intensity = 1.4
species = "Vulpkanin"
+
+/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"
+ 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/code/modules/surgery/organs/subtypes/wryn.dm b/code/modules/surgery/organs/subtypes/wryn.dm
index f51adb6054e..ee1a12fd1ab 100644
--- a/code/modules/surgery/organs/subtypes/wryn.dm
+++ b/code/modules/surgery/organs/subtypes/wryn.dm
@@ -7,3 +7,7 @@
parent_organ = "head"
slot = "hivenode"
species = "Wryn"
+
+/obj/item/organ/internal/eyes/wryn
+ dark_view = 3
+ species = "Wryn"
diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm
index f86cf41bcd0..73416045624 100644
--- a/code/modules/surgery/organs_internal.dm
+++ b/code/modules/surgery/organs_internal.dm
@@ -182,7 +182,7 @@
H.custom_pain("The pain in your [affected.name] is living hell!", 1)
else if(istype(tool, /obj/item/weapon/reagent_containers/food/snacks/organ))
- to_chat(user, "[tool] was biten by someone! It's too damaged to use!")
+ to_chat(user, "[tool] was bitten by someone! It's too damaged to use!")
return -1
..()
@@ -244,6 +244,8 @@
thing.forceMove(get_turf(target))
else
user.put_in_hands(thing)
+
+ target.update_icons()
else
user.visible_message("[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!",
"You can't extract anything from [target]'s [parse_zone(target_zone)]!")
diff --git a/icons/obj/surgery.dmi b/icons/obj/surgery.dmi
index a5638d1db1b..2f055a0c491 100644
Binary files a/icons/obj/surgery.dmi and b/icons/obj/surgery.dmi differ
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}}
diff --git a/paradise.dme b/paradise.dme
index 15d3c08f39d..eb3c0a4890e 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -2094,6 +2094,7 @@
#include "code\modules\surgery\organs\skeleton.dm"
#include "code\modules\surgery\organs\vocal_cords.dm"
#include "code\modules\surgery\organs\wound.dm"
+#include "code\modules\surgery\organs\subtypes\abductor.dm"
#include "code\modules\surgery\organs\subtypes\diona.dm"
#include "code\modules\surgery\organs\subtypes\drask.dm"
#include "code\modules\surgery\organs\subtypes\grey.dm"
@@ -2101,6 +2102,7 @@
#include "code\modules\surgery\organs\subtypes\machine.dm"
#include "code\modules\surgery\organs\subtypes\misc.dm"
#include "code\modules\surgery\organs\subtypes\nucleation.dm"
+#include "code\modules\surgery\organs\subtypes\shadow.dm"
#include "code\modules\surgery\organs\subtypes\skrell.dm"
#include "code\modules\surgery\organs\subtypes\standard.dm"
#include "code\modules\surgery\organs\subtypes\tajaran.dm"