From b4638e4326e50b65918449c037dc24df5aabeb7b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 5 Aug 2023 20:55:19 +0200 Subject: [PATCH] [MIRROR] Portals now have a colorful glow [MDB IGNORE] (#22888) * Portals now have a colorful glow (#77298) ## About The Pull Request Most instances of /obj/effect/portal now faintly glow their respective color. ![image](https://github.com/tgstation/tgstation/assets/28870487/3044b435-d4e7-4ba5-86f9-ca6f9e4415c1) This was taken in the dark, the glow isn't as noticeable in the light. Anomaly/jaunter/mech wormholes do not glow, since they use the black-and-grey swirly sprite and don't look like they'd emit any kind of light. Also autodocs some portal related vars and changes one proc to not use single char vars. I also tried adding a soundloop but it sounded kind of crappy so I decided against it. ## Why It's Good For The Game Makes the portals a little bit prettier :) ## Changelog :cl: Rhials qol: Most of the colored oval-shaped portals faintly glow now. Cool! /:cl: * Portals now have a colorful glow --------- Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> --- code/game/objects/effects/portals.dm | 20 ++++++++++++++++--- code/modules/events/wormholes.dm | 2 +- .../mining/equipment/wormhole_jaunter.dm | 1 + .../projectiles/guns/energy/special.dm | 16 ++++++++------- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 4f98d447987..591036b30d9 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -18,17 +18,30 @@ anchored = TRUE density = TRUE // dense for receiving bumbs layer = HIGH_OBJ_LAYER + light_system = STATIC_LIGHT + light_range = 3 + light_power = 1 + light_on = TRUE + light_color = COLOR_BLUE_LIGHT + /// Are mechs able to enter this portal? var/mech_sized = FALSE + /// A reference to another "linked" destination portal var/obj/effect/portal/linked - var/hardlinked = TRUE //Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted. + /// Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted. + var/hardlinked = TRUE + /// What teleport channel does this portal use? var/teleport_channel = TELEPORT_CHANNEL_BLUESPACE - var/turf/hard_target //For when a portal needs a hard target and isn't to be linked. + /// For when a portal needs a hard target and isn't to be linked. + var/turf/hard_target + /// Do we teleport anchored objects? var/allow_anchored = FALSE + /// What precision value do we pass to do_teleport (how far from the target destination we will pop out at). var/innate_accuracy_penalty = 0 + /// Used to track how often sparks should be output. Might want to turn this into a cooldown. var/last_effect = 0 /// Does this portal bypass teleport restrictions? like TRAIT_NO_TELEPORT and NOTELEPORT flags. var/force_teleport = FALSE - //does this portal create spark effect when teleporting? + /// Does this portal create spark effect when teleporting? var/sparkless = FALSE /obj/effect/portal/anom @@ -39,6 +52,7 @@ plane = ABOVE_GAME_PLANE mech_sized = TRUE teleport_channel = TELEPORT_CHANNEL_WORMHOLE + light_on = FALSE /obj/effect/portal/Move(newloc) for(var/T in newloc) diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm index 8de555345a1..b04f2a4f595 100644 --- a/code/modules/events/wormholes.dm +++ b/code/modules/events/wormholes.dm @@ -53,7 +53,7 @@ GLOBAL_LIST_EMPTY(all_wormholes) // So we can pick wormholes to teleport to icon = 'icons/obj/anomaly.dmi' icon_state = "anom" mech_sized = TRUE - + light_on = FALSE /obj/effect/portal/wormhole/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override) . = ..() diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index beaa8b5c880..f42d572cb6c 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -101,6 +101,7 @@ desc = "A stable hole in the universe made by a wormhole jaunter. Turbulent doesn't even begin to describe how rough passage through one of these is, but at least it will always get you somewhere near a beacon." mech_sized = TRUE //save your ripley innate_accuracy_penalty = 6 + light_on = FALSE /obj/effect/portal/jaunt_tunnel/teleport(atom/movable/M) . = ..() diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 9e5dd17ae4d..c7d99e732bb 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -286,16 +286,18 @@ p_orange.link_portal(p_blue) p_blue.link_portal(p_orange) -/obj/item/gun/energy/wormhole_projector/proc/create_portal(obj/projectile/beam/wormhole/W, turf/target) - var/obj/effect/portal/P = new /obj/effect/portal(target, 300, null, FALSE, null) - RegisterSignal(P, COMSIG_QDELETING, PROC_REF(on_portal_destroy)) - if(istype(W, /obj/projectile/beam/wormhole/orange)) +/obj/item/gun/energy/wormhole_projector/proc/create_portal(obj/projectile/beam/wormhole/wormhole_beam, turf/target) + var/obj/effect/portal/new_portal = new /obj/effect/portal(target, 300, null, FALSE, null) + RegisterSignal(new_portal, COMSIG_QDELETING, PROC_REF(on_portal_destroy)) + if(istype(wormhole_beam, /obj/projectile/beam/wormhole/orange)) qdel(p_orange) - p_orange = P - P.icon_state = "portal1" + p_orange = new_portal + new_portal.icon_state = "portal1" + new_portal.set_light_color(COLOR_MOSTLY_PURE_ORANGE) + new_portal.update_light() else qdel(p_blue) - p_blue = P + p_blue = new_portal crosslink() /obj/item/gun/energy/wormhole_projector/core_inserted