From 010f85e59a6214309065c0e2fd2b654b2fbf9640 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 24 Sep 2023 06:49:07 +0200 Subject: [PATCH] [MIRROR] Fixes beams rendering below mobs by default. The fishing line is no longer emissive. [MDB IGNORE] (#23876) * Fixes beams rendering below mobs by default. The fishing line is no longer emissive. (#78170) ## About The Pull Request That of beams being layered below mobs has been a minor issue ever since that mess that is FoV was implemented (with the exception of chain lighting of the 'lighting' holoparasite type). I'm changing the plane of beams to GAME_PLANE_UPPER_FOV_HIDDEN along a couple other things. ## Why It's Good For The Game Re-read the above section, also fishing lines shouldn't generally glow in the dark like very thin lightsabers, and them being layered below mobs has always been a peeve to me. ## Changelog :cl: fix: Fixed beams rendering below mobs by default. fix: The fishing line beam is no longer emissive (it doesn't glow in the dark). /:cl: --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com> * Fixes beams rendering below mobs by default. The fishing line is no longer emissive. --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com> --- code/datums/beam.dm | 21 ++++++-- code/modules/fishing/fishing_rod.dm | 53 +++++++++---------- .../projectiles/projectile/special/curse.dm | 2 - 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index a2542afcdb4..6b138387290 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -41,7 +41,21 @@ /// If set will be used instead of targets's pixel_y in offset calculations var/override_target_pixel_y = null -/datum/beam/New(origin, target, icon = 'icons/effects/beam.dmi', icon_state = "b_beam", time = INFINITY, max_distance = INFINITY, beam_type = /obj/effect/ebeam, beam_color = null, emissive = TRUE, override_origin_pixel_x = null, override_origin_pixel_y = null, override_target_pixel_x = null, override_target_pixel_y = null) +/datum/beam/New( + origin, + target, + icon = 'icons/effects/beam.dmi', + icon_state = "b_beam", + time = INFINITY, + max_distance = INFINITY, + beam_type = /obj/effect/ebeam, + beam_color = null, + emissive = TRUE, + override_origin_pixel_x = null, + override_origin_pixel_y = null, + override_target_pixel_x = null, + override_target_pixel_y = null, +) src.origin = origin src.target = target src.icon = icon @@ -65,8 +79,7 @@ visuals.icon = icon visuals.icon_state = icon_state visuals.color = beam_color - visuals.layer = ABOVE_ALL_MOB_LAYER - visuals.vis_flags = VIS_INHERIT_PLANE + visuals.vis_flags = VIS_INHERIT_PLANE|VIS_INHERIT_LAYER visuals.emissive = emissive visuals.update_appearance() Draw() @@ -166,6 +179,8 @@ /obj/effect/ebeam mouse_opacity = MOUSE_OPACITY_TRANSPARENT + plane = GAME_PLANE_UPPER_FOV_HIDDEN + layer = ABOVE_ALL_MOB_LAYER anchored = TRUE var/emissive = TRUE var/datum/beam/owner diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index 3d1090447a3..7e01f693dd5 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -160,7 +160,7 @@ if(!istype(user)) return var/beam_color = line?.line_color || default_line_color - var/datum/beam/fishing_line/fishing_line_beam = new(user, target, icon_state = "fishing_line", beam_color = beam_color, override_target_pixel_y = target_py) + var/datum/beam/fishing_line/fishing_line_beam = new(user, target, icon_state = "fishing_line", beam_color = beam_color, emissive = FALSE, override_target_pixel_y = target_py) fishing_line_beam.lefthand = user.get_held_index_of_item(src) % 2 == 1 RegisterSignal(fishing_line_beam, COMSIG_BEAM_BEFORE_DRAW, PROC_REF(check_los)) RegisterSignal(fishing_line_beam, COMSIG_QDELETING, PROC_REF(clear_line)) @@ -577,6 +577,31 @@ // Is the fishing rod held in left side hand var/lefthand = FALSE + // Make these inline with final sprites + var/righthand_s_px = 13 + var/righthand_s_py = 16 + + var/righthand_e_px = 18 + var/righthand_e_py = 16 + + var/righthand_w_px = -20 + var/righthand_w_py = 18 + + var/righthand_n_px = -14 + var/righthand_n_py = 16 + + var/lefthand_s_px = -13 + var/lefthand_s_py = 15 + + var/lefthand_e_px = 24 + var/lefthand_e_py = 18 + + var/lefthand_w_px = -17 + var/lefthand_w_py = 16 + + var/lefthand_n_px = 13 + var/lefthand_n_py = 15 + /datum/beam/fishing_line/Start() update_offsets(origin.dir) . = ..() @@ -605,29 +630,3 @@ if(NORTH) override_origin_pixel_x = lefthand ? lefthand_n_px : righthand_n_px override_origin_pixel_y = lefthand ? lefthand_n_py : righthand_n_py - -// Make these inline with final sprites -/datum/beam/fishing_line - var/righthand_s_px = 13 - var/righthand_s_py = 16 - - var/righthand_e_px = 18 - var/righthand_e_py = 16 - - var/righthand_w_px = -20 - var/righthand_w_py = 18 - - var/righthand_n_px = -14 - var/righthand_n_py = 16 - - var/lefthand_s_px = -13 - var/lefthand_s_py = 15 - - var/lefthand_e_px = 24 - var/lefthand_e_py = 18 - - var/lefthand_w_px = -17 - var/lefthand_w_py = 16 - - var/lefthand_n_px = 13 - var/lefthand_n_py = 15 diff --git a/code/modules/projectiles/projectile/special/curse.dm b/code/modules/projectiles/projectile/special/curse.dm index 3eaf6e8c7e3..624af8867eb 100644 --- a/code/modules/projectiles/projectile/special/curse.dm +++ b/code/modules/projectiles/projectile/special/curse.dm @@ -1,7 +1,5 @@ /obj/effect/ebeam/curse_arm name = "curse arm" - layer = LARGE_MOB_LAYER - plane = GAME_PLANE_UPPER_FOV_HIDDEN /obj/projectile/curse_hand name = "curse hand"