diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index e26eb16f6cc..ed01cf11d6b 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -129,6 +129,11 @@ /atom/movable/screen/fullscreen/blind/cyborg show_when_dead = TRUE +/atom/movable/screen/fullscreen/blind/noflicker + icon_state = "blackimageoverlaystatic" + layer = BLIND_LAYER + plane = FULLSCREEN_PLANE + /atom/movable/screen/fullscreen/curse icon_state = "curse" layer = CURSE_LAYER diff --git a/code/datums/status_effects/debuffs/vision/blindness.dm b/code/datums/status_effects/debuffs/vision/blindness.dm index ba77ad2e77e..35c643c34e2 100644 --- a/code/datums/status_effects/debuffs/vision/blindness.dm +++ b/code/datums/status_effects/debuffs/vision/blindness.dm @@ -25,36 +25,41 @@ return FALSE RegisterSignals(owner, update_signals, PROC_REF(update_blindness)) - update_blindness() return ..() /datum/status_effect/grouped/blindness/source_added(source, ...) - update_blindness() + update_blindness(source) /datum/status_effect/grouped/blindness/source_removed(source, removing) if (!removing) - update_blindness() + update_blindness(source) -/datum/status_effect/grouped/blindness/proc/update_blindness() +/datum/status_effect/grouped/blindness/proc/update_blindness(changed_source) if (!CAN_BE_BLIND(owner)) // future proofing qdel(src) return if (!HAS_TRAIT(owner, TRAIT_SIGHT_BYPASS)) - make_blind() + make_blind(changed_source) return for (var/blocker in blocking_sources) if (owner.is_blind_from(blocker)) - make_blind() + make_blind(changed_source) return make_unblind() -/datum/status_effect/grouped/blindness/proc/make_blind() - owner.overlay_fullscreen(id, /atom/movable/screen/fullscreen/blind) +/datum/status_effect/grouped/blindness/proc/make_blind(changed_source) + // have some extra logic to determine what overlay to use + // by default we use the noflicker overlay + // but if our one and only source is from "temp blindness", use flicker overlay + var/overlay_to_use = /atom/movable/screen/fullscreen/blind/noflicker + if(changed_source == /datum/status_effect/temporary_blindness::id && length(sources) == 1) + overlay_to_use = /atom/movable/screen/fullscreen/blind + owner.overlay_fullscreen(id, overlay_to_use ) // You are blind - at most, able to make out shapes near you - owner.add_client_colour(/datum/client_colour/monochrome, REF(src)) + owner.add_client_colour(/datum/client_colour/blindness, REF(src)) /datum/status_effect/grouped/blindness/proc/make_unblind() owner.clear_fullscreen(id) diff --git a/code/modules/client/client_colour.dm b/code/modules/client/client_colour.dm index 524f24eb149..bb4ad106f73 100644 --- a/code/modules/client/client_colour.dm +++ b/code/modules/client/client_colour.dm @@ -170,6 +170,14 @@ // Color types +///we want it to be less harsh for players to take blindness quirk, this adds enough color to not cause too much eye strain +/datum/client_colour/blindness + priority = CLIENT_COLOR_HELMET_PRIORITY + split_filters = TRUE + color = list(/*R*/ 0.51,0.3,0.3,0, /*G*/ 0.29,0.51,0.29,0, /*B*/ 0.3,0.3,0.61,0, /*A*/ 0,0,0,1, /*C*/ 0,0,0,0) // dim and less saturated + fade_in = 2 SECONDS + fade_out = 2 SECONDS + ///A client color that makes the screen look a bit more grungy, halloweenesque even. /datum/client_colour/halloween_helmet priority = CLIENT_COLOR_HELMET_PRIORITY diff --git a/code/modules/unit_tests/blindness.dm b/code/modules/unit_tests/blindness.dm index 9d47e45ca5a..20a8349302b 100644 --- a/code/modules/unit_tests/blindness.dm +++ b/code/modules/unit_tests/blindness.dm @@ -52,14 +52,14 @@ // Check for the status effect, duh TEST_ASSERT(dummy.is_blind(), "Dummy, [status_message], did not have the blind status effect.") // Being more technical, we need to check for client color and screen overlays - TEST_ASSERT(HAS_CLIENT_COLOR(dummy, /datum/client_colour/monochrome), "Dummy, [status_message], did not have the monochrome client color.") + TEST_ASSERT(HAS_CLIENT_COLOR(dummy, /datum/client_colour/blindness), "Dummy, [status_message], did not have the monochrome client color.") TEST_ASSERT(HAS_SCREEN_OVERLAY(dummy, /atom/movable/screen/fullscreen/blind), "Dummy, [status_message], did not have a blind screen overlay in their list of screens.") /datum/unit_test/blindness/proc/check_if_not_blind(mob/living/carbon/human/dummy, status_message = "after being cured of blindness") // Check for no status effect TEST_ASSERT(!dummy.is_blind(), "Dummy, [status_message], still had the blindness status effect.") // Check that the client color and screen overlay are gone - TEST_ASSERT(!HAS_CLIENT_COLOR(dummy, /datum/client_colour/monochrome), "Dummy, [status_message], still had the monochrome client color.") + TEST_ASSERT(!HAS_CLIENT_COLOR(dummy, /datum/client_colour/blindness), "Dummy, [status_message], still had the monochrome client color.") TEST_ASSERT(!HAS_SCREEN_OVERLAY(dummy, /atom/movable/screen/fullscreen/blind), "Dummy, [status_message], still had the blind sceen overlay.") /** diff --git a/icons/hud/screen_full.dmi b/icons/hud/screen_full.dmi index be4571638b1..f507bd754fd 100644 Binary files a/icons/hud/screen_full.dmi and b/icons/hud/screen_full.dmi differ