From 82eed58e9d56b01787b9fab429300df34e902ff2 Mon Sep 17 00:00:00 2001 From: throwawayuseless Date: Sun, 8 Jun 2025 10:41:18 -0400 Subject: [PATCH] Makes psyker playable (#91490) -# so help me space jesus if this doesn't compile despite working fine on my local machine Makes burdened chaplain and psyker pirates not blind, so that someone playing them isnt assaulted by irregularly flashing monochromatic lights on a black background. Instead the echolocation outlines will simply pulse to highlight nearby objects regardless of lighting conditions or other vision obscuring effects. adds support for if you want psykerization to blind people or not. keeps bitrunner psykers blind, since that's the point of the domain. Just avoid those domains if you can't handle the effect, sorry. A. It makes psyker an actual useful ability. I have personally seen, as a ghost, psyker pirates fail to navigate out of their ship for a full five minutes, and then die horribly because they are unable to actually do anything because they're **Worse than blinded** since blindness has a small radius of working vision. B. In-game effects should not cause **real world eye pain and nausea** thank you very much. neat fact: blind seers only really work when the seer-ing makes up for the blindness. example of outline highlighting hidden underfloor objects (like that satchel!) while user is not horribly blinded ![image](https://github.com/user-attachments/assets/04ce713d-5e4a-434d-b41a-5206240a27ff) :cl: fix: blind psykers are not blinded twice by two different sources, head and brain. qol: Psyker bounty hunters and chaplains are no longer blinded by default, so as to reduce the amount of eye strain from the echolocation effect. The echolocation virtual domains remain as they are. /:cl: --------- Co-authored-by: ThrowawayUseless --- code/datums/components/echolocation.dm | 34 +++++++++++++------ .../experimental_cloner_fuckup.dm | 2 +- code/modules/bitrunning/outfits.dm | 2 +- code/modules/religion/burdened/psyker.dm | 29 +++++++--------- 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/code/datums/components/echolocation.dm b/code/datums/components/echolocation.dm index e7e2fab5a1a..7ae0bd49b57 100644 --- a/code/datums/components/echolocation.dm +++ b/code/datums/components/echolocation.dm @@ -11,6 +11,8 @@ var/fade_out_time = 0.3 SECONDS /// Are images static? If yes, spawns them on the turf and makes them not change location. Otherwise they change location and pixel shift with the original. var/images_are_static = TRUE + /// Does this echolocation cause us to go blind? + var/blinding = TRUE /// With mobs that have this echo group in their echolocation receiver trait, we share echo images. var/echo_group = null /// This trait blocks us from receiving echolocation. @@ -32,7 +34,7 @@ /// Cooldown for the echolocation. COOLDOWN_DECLARE(cooldown_last) -/datum/component/echolocation/Initialize(echo_range, cooldown_time, image_expiry_time, fade_in_time, fade_out_time, images_are_static, blocking_trait, echo_group, echo_icon, color_path, use_echo = TRUE, show_own_outline = FALSE, personal_color = "#ffffff") // SKYRAT EDIT CHANGE - ORIGINAL: /datum/component/echolocation/Initialize(echo_range, cooldown_time, image_expiry_time, fade_in_time, fade_out_time, images_are_static, blocking_trait, echo_group, echo_icon = "echo", color_path) +/datum/component/echolocation/Initialize(echo_range, cooldown_time, image_expiry_time, fade_in_time, fade_out_time, images_are_static, blocking_trait, echo_group, echo_icon, color_path, blinding, use_echo = TRUE, show_own_outline = FALSE, personal_color = "#ffffff") // SKYRAT EDIT CHANGE - ORIGINAL: /datum/component/echolocation/Initialize(echo_range, cooldown_time, image_expiry_time, fade_in_time, fade_out_time, images_are_static, blocking_trait, echo_group, echo_icon = "echo", color_path, blinding) . = ..() var/mob/living/echolocator = parent if(!istype(echolocator)) @@ -51,6 +53,8 @@ src.fade_in_time = fade_in_time if(!isnull(fade_out_time)) src.fade_out_time = fade_out_time + if(!isnull(blinding)) + src.blinding = blinding if(!isnull(images_are_static)) src.images_are_static = images_are_static if(!isnull(blocking_trait)) @@ -63,7 +67,8 @@ if(ispath(color_path)) client_colour = echolocator.add_client_colour(color_path, src.echo_group) echolocator.add_traits(list(TRAIT_ECHOLOCATION_RECEIVER, TRAIT_TRUE_NIGHT_VISION), src.echo_group) //so they see all the tiles they echolocated, even if they are in the dark - echolocator.become_blind(ECHOLOCATION_TRAIT) + if(blinding) + echolocator.become_blind(ECHOLOCATION_TRAIT) // SKYRAT EDIT ADDITION START if (use_echo) // add constructor toggle to not use the eye overlay echolocator.overlay_fullscreen("echo", /atom/movable/screen/fullscreen/echo, echo_icon) @@ -75,8 +80,9 @@ var/mob/living/echolocator = parent QDEL_NULL(client_colour) echolocator.remove_traits(list(TRAIT_ECHOLOCATION_RECEIVER, TRAIT_TRUE_NIGHT_VISION), echo_group) - echolocator.cure_blind(ECHOLOCATION_TRAIT) - echolocator.clear_fullscreen("echo") + if(blinding) + echolocator.cure_blind(ECHOLOCATION_TRAIT) + echolocator.clear_fullscreen("echo") for(var/mob/living/echolocate_receiver as anything in receivers) if(!echolocate_receiver.client) continue @@ -101,11 +107,19 @@ real_echo_range += 2 var/list/filtered = list() var/list/seen = dview(real_echo_range, get_turf(echolocator.client?.eye || echolocator), invis_flags = echolocator.see_invisible) - for(var/atom/seen_atom as anything in seen) - if(!seen_atom.alpha) - continue - if(allowed_paths[seen_atom.type]) - filtered += seen_atom + if(blinding) + for(var/atom/seen_atom as anything in seen) + if(!seen_atom.alpha) + continue + if(allowed_paths[seen_atom.type]) + filtered += seen_atom + else + var/list/ranged_atoms = range(real_echo_range, get_turf(echolocator.client?.eye || echolocator)) + for(var/atom/possible_atom as anything in ranged_atoms) + if(!possible_atom.alpha) + continue + if(allowed_paths[possible_atom.type]) + filtered += possible_atom if(!length(filtered)) return var/current_time = "[world.time]" @@ -120,7 +134,7 @@ /datum/component/echolocation/proc/show_image(image/input_appearance, atom/input, current_time) var/image/final_image = image(input_appearance) - final_image.layer += EFFECTS_LAYER + //final_image.layer += FOV_EFFECT_LAYER final_image.plane = FULLSCREEN_PLANE final_image.loc = images_are_static ? get_turf(input) : input final_image.dir = input.dir diff --git a/code/game/machinery/experimental_cloner/experimental_cloner_fuckup.dm b/code/game/machinery/experimental_cloner/experimental_cloner_fuckup.dm index 681dd8c6ccd..96168a953ad 100644 --- a/code/game/machinery/experimental_cloner/experimental_cloner_fuckup.dm +++ b/code/game/machinery/experimental_cloner/experimental_cloner_fuckup.dm @@ -143,7 +143,7 @@ weight = CLONER_FAILURE_RARE /datum/experimental_cloner_fuckup/total_failure/post_emerged(mob/living/carbon/human/victim) - victim.slow_psykerize() + victim.slow_psykerize(blind_them = TRUE) /// Just fuck me up /datum/experimental_cloner_fuckup/total_failure diff --git a/code/modules/bitrunning/outfits.dm b/code/modules/bitrunning/outfits.dm index 5e9f7d12c97..0da85853f51 100644 --- a/code/modules/bitrunning/outfits.dm +++ b/code/modules/bitrunning/outfits.dm @@ -13,7 +13,7 @@ /datum/outfit/echolocator/post_equip(mob/living/carbon/human/user, visuals_only) . = ..() - user.psykerize() + user.psykerize(is_blinding = TRUE) /datum/outfit/bitductor diff --git a/code/modules/religion/burdened/psyker.dm b/code/modules/religion/burdened/psyker.dm index e28be0d4e55..446e794436d 100644 --- a/code/modules/religion/burdened/psyker.dm +++ b/code/modules/religion/burdened/psyker.dm @@ -9,10 +9,11 @@ ) organ_traits = list(TRAIT_ADVANCEDTOOLUSER, TRAIT_LITERATE, TRAIT_CAN_STRIP, TRAIT_ANTIMAGIC_NO_SELFBLOCK) w_class = WEIGHT_CLASS_NORMAL + var/does_it_blind = FALSE /obj/item/organ/brain/psyker/on_mob_insert(mob/living/carbon/inserted_into) . = ..() - inserted_into.AddComponent(/datum/component/echolocation, blocking_trait = TRAIT_DUMB, echo_group = "psyker", echo_icon = "psyker", color_path = /datum/client_colour/psyker) + inserted_into.AddComponent(/datum/component/echolocation, blocking_trait = TRAIT_DUMB, echo_group = "psyker", echo_icon = "psyker", color_path = /datum/client_colour/psyker, blinding = does_it_blind) inserted_into.AddComponent(/datum/component/anti_magic, antimagic_flags = MAGIC_RESISTANCE_MIND) /obj/item/organ/brain/psyker/on_mob_remove(mob/living/carbon/removed_from) @@ -31,6 +32,9 @@ owner.adjust_disgust(33 * seconds_per_tick) apply_organ_damage(5 * seconds_per_tick, 199) +/obj/item/organ/brain/psyker/blinding + does_it_blind = TRUE + /obj/item/bodypart/head/psyker limb_id = BODYPART_ID_PSYKER is_dimorphic = FALSE @@ -38,18 +42,8 @@ bodypart_traits = list(TRAIT_DISFIGURED, TRAIT_BALD, TRAIT_SHAVED) head_flags = HEAD_DEBRAIN -/obj/item/bodypart/head/psyker/try_attach_limb(mob/living/carbon/new_head_owner, special, lazy) - . = ..() - if(!.) - return - new_head_owner.become_blind(bodypart_trait_source) - -/obj/item/bodypart/head/psyker/drop_limb(special, dismembered) - owner.cure_blind(bodypart_trait_source) - return ..() - /// flavorful variant of psykerizing that deals damage and sends messages before calling psykerize() -/mob/living/carbon/human/proc/slow_psykerize() +/mob/living/carbon/human/proc/slow_psykerize(blind_them = FALSE) if(stat == DEAD || !get_bodypart(BODY_ZONE_HEAD) || istype(get_bodypart(BODY_ZONE_HEAD), /obj/item/bodypart/head/psyker)) return to_chat(src, span_userdanger("You feel unwell...")) @@ -60,7 +54,7 @@ emote("scream") apply_damage(30, BRUTE, BODY_ZONE_HEAD) sleep(5 SECONDS) - if(!psykerize()) + if(!psykerize(is_blinding = blind_them)) to_chat(src, span_warning("The transformation subsides...")) return apply_damage(50, BRUTE, BODY_ZONE_HEAD) @@ -69,7 +63,7 @@ emote("scream") /// Proc with no side effects that turns someone into a psyker. returns FALSE if it could not psykerize. -/mob/living/carbon/human/proc/psykerize() +/mob/living/carbon/human/proc/psykerize(is_blinding = FALSE) var/obj/item/bodypart/head/old_head = get_bodypart(BODY_ZONE_HEAD) var/obj/item/organ/brain/old_brain = get_organ_slot(ORGAN_SLOT_BRAIN) var/obj/item/organ/old_eyes = get_organ_slot(ORGAN_SLOT_EYES) @@ -79,12 +73,15 @@ if(!psyker_head.replace_limb(src, special = TRUE)) return FALSE qdel(old_head) - var/obj/item/organ/brain/psyker/psyker_brain = new() + var/obj/item/organ/brain/psyker/psyker_brain = new() /// turns out if you make a flashing monochromatic outline against black background that refreshes on inconsistant intervals, it hurts peoples eyes. Who'da thunk. + if(is_blinding) + var/obj/item/organ/brain/psyker/blinding/dummy = new() + psyker_brain = dummy old_brain.before_organ_replacement(psyker_brain) old_brain.Remove(src, special = TRUE, movement_flags = NO_ID_TRANSFER) qdel(old_brain) psyker_brain.Insert(src, special = TRUE, movement_flags = DELETE_IF_REPLACED) - if(old_eyes) + if(old_eyes && is_blinding) qdel(old_eyes) return TRUE