[Merge ready] Adds, well Ports Echolocation (#29108)

* I See Clearly Now: customizable echolocation quirk (#525)

* Add echolocation quirk w/ customizable echo overlay, and echo types

* Make sure echolocation can't be taken with similar quirks

* Actually use the right path

* Static type and reorder dme

* Remove some leftover test comments

* Modularization improvements

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>

* Further modularization and dejankify client_colour handling

* Clean up client_colours in remove()

* Add stall/toggle power to echolocation quirk holders

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>

* all fixed

* No more NOVA

* We are blind, so its not fair to not get points.

* Unbreaks it, and QOL

* Waterpig's epic fixes

* that is buffed

* Moves quirks around to a new module because holy fuck

* Update echolocation.dm

---------

Co-authored-by: Ephemeralis <Ephemeralis@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Waterpig <wtryoutube@seznam.cz>
Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
This commit is contained in:
Erol509
2024-08-01 19:15:20 +05:30
committed by GitHub
co-authored by Bloop Ephemeralis Waterpig Waterpig
parent 71ada75a5e
commit 012487c475
11 changed files with 217 additions and 10 deletions
+20 -6
View File
@@ -32,7 +32,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 = "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, 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)
. = ..()
var/mob/living/echolocator = parent
if(!istype(echolocator))
@@ -55,12 +55,19 @@
src.images_are_static = images_are_static
if(!isnull(blocking_trait))
src.blocking_trait = blocking_trait
// SKYRAT ADDITION START: echolocation
src.show_own_outline = show_own_outline
src.echo_color = personal_color
// SKYRAT EDIT ADDITION END
if(ispath(color_path))
client_color = echolocator.add_client_colour(color_path)
src.echo_group = echo_group || REF(src)
echolocator.add_traits(list(TRAIT_ECHOLOCATION_RECEIVER, TRAIT_TRUE_NIGHT_VISION), echo_group) //so they see all the tiles they echolocated, even if they are in the dark
echolocator.become_blind(ECHOLOCATION_TRAIT)
echolocator.overlay_fullscreen("echo", /atom/movable/screen/fullscreen/echo, echo_icon)
// 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)
// SKYRAT EDIT ADDITION END
START_PROCESSING(SSfastprocess, src)
/datum/component/echolocation/Destroy(force)
@@ -85,7 +92,7 @@
echolocate()
/datum/component/echolocation/proc/echolocate()
if(!COOLDOWN_FINISHED(src, cooldown_last))
if(stall || !COOLDOWN_FINISHED(src, cooldown_last)) // SKYRAT EDIT CHANGE - ORIGINAL: if(!COOLDOWN_FINISHED(src, cooldown_last))
return
COOLDOWN_START(src, cooldown_last, cooldown_time)
var/mob/living/echolocator = parent
@@ -121,11 +128,18 @@
if(images_are_static)
final_image.pixel_x = input.pixel_x
final_image.pixel_y = input.pixel_y
if(HAS_TRAIT_FROM(input, TRAIT_ECHOLOCATION_RECEIVER, echo_group)) //mark other echolocation with full white
final_image.color = white_matrix
// SKYRAT ADDITION START: echolocation (show outlines on self)
if(HAS_TRAIT_FROM(input, TRAIT_ECHOLOCATION_RECEIVER, echo_group)) //mark other echolocation with full white, except ourselves
var/datum/component/echolocation/located_component = input.GetComponent(/datum/component/echolocation)
var/mob/living/echolocator = parent
if(located_component)
final_image.color = located_component.echo_color
else if(input != echolocator)
final_image.color = white_matrix
// SKYRAT EDIT ADDITION END
var/list/fade_ins = list(final_image)
for(var/mob/living/echolocate_receiver as anything in receivers)
if(echolocate_receiver == input)
if(echolocate_receiver == input && !show_own_outline) // SKYRAT EDIT CHANGE - ORIGINAL: if(echolocate_receiver == input)
continue
if(receivers[echolocate_receiver][input])
var/previous_image = receivers[echolocate_receiver][input]["image"]