diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index c22f0515e3b..ae7bbaecb44 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -41,6 +41,8 @@ var/list/global_huds druggy.icon_state = "druggy" druggy.layer = 17 druggy.mouse_opacity = 0 + druggy.alpha = 127 + druggy.blend_mode = BLEND_MULTIPLY //that white blurry effect you get when you eyes are damaged blurry = new /obj/screen() diff --git a/code/modules/client/client_color.dm b/code/modules/client/client_color.dm index 26dfd75b830..f4692057a92 100644 --- a/code/modules/client/client_color.dm +++ b/code/modules/client/client_color.dm @@ -1,7 +1,7 @@ /datum/client_color var/client_color = "" //Any client.color-valid value - var/priority = 1 //Since only one client.color can be rendered on screen, we take the one with the highest priority value: - //eg: "Bloody screen" > "goggles color" as the former is much more important + var/priority = 1 + var/override = FALSE //If set to override we will stop multiplying the moment we get here. NOTE: Priority remains, if your override is on position 4, the other 3 will still have a say. /mob @@ -13,31 +13,42 @@ Adds an instance of color_type to the mob's client_colors list color_type - a typepath (subtyped from /datum/client_color) */ -/mob/proc/add_client_color(color_type) - if(!ispath(/datum/client_color)) - return +/mob/proc/has_client_color(color_type) + if(!ispath(/datum/client_color) || !LAZYLEN(client_colors)) + return FALSE + for(var/thing in client_colors) + var/datum/client_color/col = thing + if(col.type == color_type) + return TRUE + return FALSE - var/datum/client_color/CC = new color_type() - client_colors |= CC - sortTim(client_colors, /proc/cmp_clientcolor_priority) - update_client_color() +/mob/proc/add_client_color(color_type) + if(!has_client_color(color_type)) + var/datum/client_color/CC = new color_type() + client_colors |= CC + sortTim(client_colors, /proc/cmp_clientcolor_priority) + update_client_color() /* Removes an instance of color_type from the mob's client_colors list color_type - a typepath (subtyped from /datum/client_color) + returns true if instance was found, false otherwise */ /mob/proc/remove_client_color(color_type) if(!ispath(/datum/client_color)) - return + return FALSE + var/result = FALSE for(var/cc in client_colors) var/datum/client_color/CC = cc if(CC.type == color_type) + result = TRUE client_colors -= CC qdel(CC) break update_client_color() + return result /* @@ -50,26 +61,53 @@ client.color = null if(!client_colors.len) return - var/datum/client_color/CC = client_colors[1] - if(CC) - animate(client, color = CC.client_color) + var/list/c = list(1,0,0, 0,1,0, 0,0,1) //Star at normal + for(var/datum/client_color/CC in client_colors) + //Matrix multiplication newcolor * current + var/list/current = c.Copy() + + for(var/m = 1; m <= 3; m += 1) //For each row + for(var/i = 1; i <= 3; i += 1) //go over each column of the second matrix + var/sum = 0 + for(var/j = 1; j <= 3; j += 1) //multiply each pair + sum += CC.client_color[(m-1)*3 + j] * current[(j-1)*3 + i] + + c[(m-1)*3 + i] = sum + + if(CC.override) + break + + animate(client, color = c) /datum/client_color/monochrome - client_color = list(0.33,0.33,0.33, 0.33,0.33,0.33, 0.33,0.33,0.33) - priority = INFINITY + client_color = list(0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33) + priority = 100 + +//Similar to monochrome but shouldn't look as flat, same priority +/datum/client_color/noir + client_color = list(0.299, 0.299, 0.299, 0.587, 0.587, 0.587, 0.114, 0.114, 0.114) + priority = 200 + +/datum/client_color/thirdeye + client_color = list(0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.05, 0.05, 0.05) + priority = 300 /datum/client_color/deuteranopia - client_color = list(0.47,0.38,0.15, 0.54,0.31,0.15, 0,0.3,0.7) + client_color = list(0.47, 0.38, 0.15, 0.54, 0.31, 0.15, 0, 0.3, 0.7) priority = 100 /datum/client_color/protanopia - client_color = list(0.51,0.4,0.12, 0.49,0.41,0.12, 0,0.2,0.76) + client_color = list(0.51, 0.4, 0.12, 0.49, 0.41, 0.12, 0, 0.2, 0.76) priority = 100 /datum/client_color/tritanopia - client_color = list(0.95,0.07,0, 0,0.44,0.52, 0.05,0.49,0.48) + client_color = list(0.95, 0.07, 0, 0, 0.44, 0.52, 0.05, 0.49, 0.48) priority = 100 /datum/client_color/berserk client_color = "#AF111C" - priority = 100 \ No newline at end of file + priority = INFINITY //This effect sort of exists on its own you /have/ to be seeing RED + override = TRUE //Because multiplying this will inevitably fail + +/datum/client_color/oversaturated/New() + client_color = color_saturation(40) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 058764b1874..78a75ce6b55 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -225,8 +225,12 @@ if (eye_blurry) client.screen += global_hud.blurry - if (druggy) + if(druggy) client.screen += global_hud.druggy + if(druggy > 5) + add_client_color(/datum/client_color/oversaturated) + else + remove_client_color(/datum/client_color/oversaturated) if (stat != 2) if (machine) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 0da6d4c41d1..269061fe473 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -494,8 +494,15 @@ H.client.screen += global_hud.darkMask else if((!H.equipment_prescription && (H.disabilities & NEARSIGHTED)) || H.equipment_tint_total == TINT_MODERATE) H.client.screen += global_hud.vimpaired - if(H.eye_blurry) H.client.screen += global_hud.blurry - if(H.druggy) H.client.screen += global_hud.druggy + if(H.eye_blurry) + H.client.screen += global_hud.blurry + + if(H.druggy) + H.client.screen += global_hud.druggy + if(H.druggy > 5) + H.add_client_color(/datum/client_color/oversaturated) + else + H.remove_client_color(/datum/client_color/oversaturated) for(var/overlay in H.equipment_overlays) H.client.screen |= overlay diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 6d8135a2382..b99ff1b373c 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -152,12 +152,17 @@ blind.invisibility = 0 else blind.invisibility = 101 - if (disabilities & NEARSIGHTED) + if(disabilities & NEARSIGHTED) client.screen += global_hud.vimpaired - if (eye_blurry) + if(eye_blurry) client.screen += global_hud.blurry - if (druggy) + + if(druggy) client.screen += global_hud.druggy + if(druggy > 5) + add_client_color(/datum/client_color/oversaturated) + else + remove_client_color(/datum/client_color/oversaturated) if(machine) var/viewflags = machine.check_eye(src) if(viewflags < 0) diff --git a/html/changelogs/geeves-drug_lord.yml b/html/changelogs/geeves-drug_lord.yml new file mode 100644 index 00000000000..4c15e9696b1 --- /dev/null +++ b/html/changelogs/geeves-drug_lord.yml @@ -0,0 +1,6 @@ +author: Geeves, Code by Chinsky and CrimsonShrike + +delete-after: True + +changes: + - rscadd: "The druggy overlay has been upgraded." \ No newline at end of file