Merge pull request #3629 from VOREStation/aro-colorblind

Fix Colorblindness
This commit is contained in:
Aronai Sieyes
2018-05-05 11:30:37 -04:00
committed by GitHub
9 changed files with 66 additions and 76 deletions

View File

@@ -237,3 +237,17 @@
#define USE_FAIL_INCAPACITATED 5
#define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7
//'Normal'ness v v v
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B
#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)
#define MATRIX_Protanopia list(0.57, 0.43, 0, 0.56, 0.44, 0, 0, 0.24, 0.76)
#define MATRIX_Protanomaly list(0.82, 0.18, 0, 0.33, 0.67, 0, 0, 0.13, 0.88)
#define MATRIX_Deuteranopia list(0.63, 0.38, 0, 0.70, 0.30, 0, 0, 0.30, 0.70)
#define MATRIX_Deuteranomaly list(0.80, 0.20, 0, 0.26, 0.74, 0, 0, 0.14, 0.86)
#define MATRIX_Tritanopia list(0.95, 0.05, 0, 0, 0.43, 0.57, 0, 0.48, 0.53)
#define MATRIX_Tritanomaly list(0.97, 0.03, 0, 0, 0.73, 0.27, 0, 0.18, 0.82)
#define MATRIX_Achromatopsia list(0.30, 0.59, 0.11, 0.30, 0.59, 0.11, 0.30, 0.59, 0.11)
#define MATRIX_Achromatomaly list(0.62, 0.32, 0.06, 0.16, 0.78, 0.06, 0.16, 0.32, 0.52)
#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80)
#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60)

View File

@@ -293,16 +293,13 @@
#define VIS_CH_SPECIAL 13
#define VIS_CH_STATUS_OOC 14
#define VIS_D_COLORBLIND 15
#define VIS_D_COLORBLINDI 16
#define VIS_ADMIN1 15
#define VIS_ADMIN2 16
#define VIS_ADMIN3 17
#define VIS_ADMIN1 17
#define VIS_ADMIN2 18
#define VIS_ADMIN3 19
#define VIS_MESONS 18
#define VIS_MESONS 20
#define VIS_COUNT 20 //Must be highest number from above.
#define VIS_COUNT 18 //Must be highest number from above.
//Some mob icon layering defines
#define BODY_LAYER -100

View File

@@ -1,13 +1,13 @@
#undef VIS_COUNT
#define VIS_CH_STATUS_R 21
#define VIS_CH_HEALTH_VR 22
#define VIS_CH_BACKUP 23
#define VIS_CH_VANTAG 24
#define VIS_CH_STATUS_R 19
#define VIS_CH_HEALTH_VR 20
#define VIS_CH_BACKUP 21
#define VIS_CH_VANTAG 22
#define VIS_AUGMENTED 25
#define VIS_AUGMENTED 23
#define VIS_COUNT 25
#define VIS_COUNT 23
//Protean organs
#define O_ORCH "orchestrator"

View File

@@ -82,4 +82,22 @@
name = "Smaller"
desc = "Your body is smaller than average."
icon_scale_percent = 0.9
icon_scale_percent = 0.9
/datum/modifier/trait/colorblind_taj
name = "Colorblind - B+R"
desc = "You are colorblind. You have a minor issue with blue colors and have difficulty recognizing them from red colors."
client_color = MATRIX_Taj_Colorblind
/datum/modifier/trait/colorblind_vulp
name = "Colorblind - G+R"
desc = "You are colorblind. You have a severe issue with green colors and have difficulty recognizing them from red colors."
client_color = MATRIX_Vulp_Colorblind
/datum/modifier/trait/colorblind_mono
name = "Colorblind - Mono"
desc = "You are colorblind. Your condition is rare, but you can see no colors at all."
client_color = MATRIX_Monochromia

View File

@@ -118,11 +118,13 @@
desc = "You simply can't see colors at all, period. You are 100% colorblind."
cost = -1
/datum/modifier/colorblindness_mono
name = "Colorblindness (Monochromancy)"
desc = "You simply can't see colors at all, period. You are 100% colorblind."
/datum/trait/colorblind/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
if(!H.plane_holder)
H.plane_holder = new(H)
H.plane_holder.set_vis(VIS_D_COLORBLIND,TRUE) //The default is monocrhomia, no need to set values
H.add_modifier(/datum/modifier/trait/colorblind_mono)
/datum/trait/colorblind/para_vulp
name = "Colorblindness (Para Vulp)"
@@ -131,7 +133,7 @@
/datum/trait/colorblind/para_vulp/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.plane_holder.alter_values(VIS_D_COLORBLIND,list("variety" = "Paradise Vulp"))
H.add_modifier(/datum/modifier/trait/colorblind_vulp)
/datum/trait/colorblind/para_taj
name = "Colorblindness (Para Taj)"
@@ -140,4 +142,4 @@
/datum/trait/colorblind/para_taj/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.plane_holder.alter_values(VIS_D_COLORBLIND,list("variety" = "Paradise Taj"))
H.add_modifier(/datum/modifier/trait/colorblind_taj)

View File

@@ -1124,6 +1124,9 @@ default behaviour is:
var/list/colors_to_blend = list()
for(var/datum/modifier/M in modifiers)
if(!isnull(M.client_color))
if(islist(M.client_color)) //It's a color matrix! Forget it. Just use that one.
animate(client, color = M.client_color, time = 10)
return
colors_to_blend += M.client_color
if(colors_to_blend.len)

View File

@@ -31,9 +31,6 @@
plane_masters[VIS_ADMIN2] = new /obj/screen/plane_master{plane = PLANE_ADMIN2} //For admin use
plane_masters[VIS_ADMIN3] = new /obj/screen/plane_master{plane = PLANE_ADMIN3} //For admin use
plane_masters[VIS_D_COLORBLIND] = new /obj/screen/plane_master/colorblindness //Colorblindness (affects world)
plane_masters[VIS_D_COLORBLINDI]= new /obj/screen/plane_master/colorblindness/items //Colorblindness (items in HUD, subplane of above, don't toggle)
plane_masters[VIS_MESONS] = new /obj/screen/plane_master{plane = PLANE_MESONS} //Meson-specific things like open ceilings.
..()
@@ -151,56 +148,3 @@
/obj/screen/plane_master/ghosts
plane = PLANE_GHOSTS
desired_alpha = 127 //When enabled, they're like half-transparent
//'Normal'ness v v v
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B
#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)
#define MATRIX_Protanopia list(0.57, 0.43, 0, 0.56, 0.44, 0, 0, 0.24, 0.76)
#define MATRIX_Protanomaly list(0.82, 0.18, 0, 0.33, 0.67, 0, 0, 0.13, 0.88)
#define MATRIX_Deuteranopia list(0.63, 0.38, 0, 0.70, 0.30, 0, 0, 0.30, 0.70)
#define MATRIX_Deuteranomaly list(0.80, 0.20, 0, 0.26, 0.74, 0, 0, 0.14, 0.86)
#define MATRIX_Tritanopia list(0.95, 0.05, 0, 0, 0.43, 0.57, 0, 0.48, 0.53)
#define MATRIX_Tritanomaly list(0.97, 0.03, 0, 0, 0.73, 0.27, 0, 0.18, 0.82)
#define MATRIX_Achromatopsia list(0.30, 0.59, 0.11, 0.30, 0.59, 0.11, 0.30, 0.59, 0.11)
#define MATRIX_Achromatomaly list(0.62, 0.32, 0.06, 0.16, 0.78, 0.06, 0.16, 0.32, 0.52)
#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80)
#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60)
/////////////////
//Colorblindness uses special color shenanigans
/obj/screen/plane_master/colorblindness
plane = PLANE_WORLD //Affects the main game world
color = MATRIX_Monochromia
alpha = 255 //Starts out nice and opaque
invisibility = 101 //Can't see it usually
mouse_opacity = 1 //Don't make entire world not visible pls
invis_toggle = TRUE
sub_planes = list(VIS_D_COLORBLINDI)
var/list/varieties = list(
"Monochromia" = MATRIX_Monochromia,
"Protanopia" = MATRIX_Protanopia,
"Protanomaly" = MATRIX_Protanomaly,
"Deuteranopia" = MATRIX_Deuteranopia,
"Deuteranomaly" = MATRIX_Deuteranomaly,
"Tritanopia" = MATRIX_Tritanopia,
"Tritanomaly" = MATRIX_Tritanomaly,
"Achromatopsia" = MATRIX_Achromatopsia,
"Achromatomaly" = MATRIX_Achromatomaly,
"Paradise Vulp" = MATRIX_Vulp_Colorblind,
"Paradise Taj" = MATRIX_Taj_Colorblind
)
/obj/screen/plane_master/colorblindness/alter_plane_values(var/variety = null)
var/new_matrix = varieties[variety]
if(!new_matrix) return
color = new_matrix
/obj/screen/plane_master/colorblindness/proc/debug_variety()
var/choice = input(usr,"Pick a type of colorblindness","Which?") as null|anything in varieties
if(choice)
color = varieties[choice]
/obj/screen/plane_master/colorblindness/items
plane = PLANE_PLAYER_HUD_ITEMS
sub_planes = null

View File

@@ -76,6 +76,7 @@
var/body_oocnotes
var/list/limb_data = list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TORSO)
var/list/organ_data = list(O_HEART, O_EYES, O_LUNGS, O_BRAIN)
var/list/genetic_modifiers = list()
var/toocomplex
var/sizemult
var/weight
@@ -174,6 +175,12 @@
//Just set the data to this. 0:normal, 1:assisted, 2:mechanical, 3:digital
organ_data[org] = I.robotic
//Genetic modifiers
for(var/modifier in M.modifiers)
var/datum/modifier/mod = modifier
if(mod.flags & MODIFIER_GENETIC)
genetic_modifiers.Add(mod.type)
if(add_to_db)
SStranscore.add_body(src)
@@ -204,6 +211,7 @@
src.body_oocnotes = orig.body_oocnotes
src.limb_data = orig.limb_data.Copy()
src.organ_data = orig.organ_data.Copy()
src.genetic_modifiers = orig.genetic_modifiers.Copy()
src.toocomplex = orig.toocomplex
src.sizemult = orig.sizemult
src.aflags = orig.aflags

View File

@@ -69,6 +69,10 @@
H.dna = R.dna.Clone()
H.original_player = current_project.ckey
//Apply genetic modifiers
for(var/modifier_type in R.genetic_modifiers)
H.add_modifier(modifier_type)
//Apply damage
H.adjustCloneLoss((H.getMaxHealth() - config.health_threshold_dead)*0.75)
H.Paralyse(4)