Merge pull request #5248 from VOREStation/pol-colorb

Colorblindness
This commit is contained in:
Atermonera
2018-05-05 12:15:04 -07:00
committed by GitHub
5 changed files with 41 additions and 66 deletions

View File

@@ -238,7 +238,6 @@
#define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7
// This creates a consistant definition for creating global lists, automatically inserting objects into it when they are created, and removing them when deleted.
// It is very good for removing the 'in world' junk that exists in the codebase painlessly.
// First argument is the list name/path desired, e.g. 'all_candles' would be 'var/list/all_candles = list()'.
@@ -256,3 +255,17 @@ var/global/list/##LIST_NAME = list();\
##LIST_NAME -= src;\
return ..();\
}\
//'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

@@ -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

@@ -1065,6 +1065,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