diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm
index 8ab33689d3..37584d892d 100644
--- a/code/__DEFINES/layers_planes.dm
+++ b/code/__DEFINES/layers_planes.dm
@@ -77,6 +77,7 @@
#define PROJECTILE_HIT_THRESHHOLD_LAYER 2.75 //projectiles won't hit objects at or below this layer if possible
#define TABLE_LAYER 2.8
#define TRAY_LAYER 2.85
+#define GATEWAY_UNDERLAY_LAYER 2.85
#define BELOW_OBJ_LAYER 2.9
#define LOW_ITEM_LAYER 2.95
//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 5540cd7529..36ceabe3b4 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -4,10 +4,10 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
GLOBAL_LIST_EMPTY(gateway_destinations)
/**
- * Corresponds to single entry in gateway control.
- *
- * Will NOT be added automatically to GLOB.gateway_destinations list.
- */
+ * Corresponds to single entry in gateway control.
+ *
+ * Will NOT be added automatically to GLOB.gateway_destinations list.
+ */
/datum/gateway_destination
var/name = "Unknown Destination"
var/wait = 0 /// How long after roundstart this destination becomes active
@@ -85,7 +85,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
. = "Exit gateway unpowered."
/datum/gateway_destination/gateway/get_target_turf()
- return get_step(target_gateway.portal,SOUTH)
+ return get_step(target_gateway, SOUTH)
/datum/gateway_destination/gateway/post_transfer(atom/movable/AM)
. = ..()
@@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
name = "gateway"
desc = "A mysterious gateway built by unknown hands, it allows for faster than light travel to far-flung locations."
icon = 'icons/obj/machines/gateway.dmi'
- icon_state = "off"
+ icon_state = "portal_frame"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
// 3x2 offset by one row
@@ -171,10 +171,14 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
var/datum/gateway_destination/target
/// bumper object, the thing that starts actual teleport
var/obj/effect/gateway_portal_bumper/portal
+ /// Visual object for handling the viscontents
+ var/obj/effect/gateway_portal_effect/portal_visuals
/obj/machinery/gateway/Initialize()
generate_destination()
update_icon()
+ portal_visuals = new
+ vis_contents += portal_visuals
return ..()
/obj/machinery/gateway/proc/generate_destination()
@@ -191,6 +195,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
if(use_power == ACTIVE_POWER_USE)
use_power = IDLE_POWER_USE
update_icon()
+ portal_visuals.reset_visuals()
/obj/machinery/gateway/process()
if((stat & (NOPOWER)) && use_power)
@@ -198,12 +203,6 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
deactivate()
return
-/obj/machinery/gateway/update_icon_state()
- if(target)
- icon_state = "on"
- else
- icon_state = "off"
-
/obj/machinery/gateway/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE)
return
@@ -216,6 +215,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
return
target = D
target.activate(destination)
+ portal_visuals.setup_visuals(target)
generate_bumper()
use_power = ACTIVE_POWER_USE
update_icon()
@@ -307,7 +307,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
try_to_connect(D)
return TRUE
if("deactivate")
- if(G && G.target)
+ if(G?.target)
G.deactivate()
return TRUE
@@ -324,3 +324,39 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
/obj/item/paper/fluff/gateway
info = "Congratulations,
Your station has been selected to carry out the Gateway Project.
The equipment will be shipped to you at the start of the next quarter.
You are to prepare a secure location to house the equipment as outlined in the attached documents.
--Nanotrasen Bluespace Research"
name = "Confidential Correspondence, Pg 1"
+
+/obj/effect/gateway_portal_effect
+ appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE
+ mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ vis_flags = VIS_INHERIT_ID
+ layer = GATEWAY_UNDERLAY_LAYER //Slightly lower than gateway itself
+ var/alpha_icon = 'icons/obj/machines/gateway.dmi'
+ var/alpha_icon_state = "portal_mask"
+ var/datum/gateway_destination/our_destination
+
+
+/obj/effect/gateway_portal_effect/proc/setup_visuals(datum/gateway_destination/D)
+ our_destination = D
+ update_portal_filters()
+
+/obj/effect/gateway_portal_effect/proc/reset_visuals()
+ our_destination = null
+ update_portal_filters()
+
+/obj/effect/gateway_portal_effect/proc/update_portal_filters()
+ clear_filters()
+ vis_contents = null
+
+ if(!our_destination)
+ return
+
+
+ add_filter("portal_alpha", 1, list("type" = "alpha", "icon" = icon(alpha_icon, alpha_icon_state), "x" = 32, "y" = 32))
+ add_filter("portal_blur", 1, list("type" = "blur", "size" = 0.5))
+ add_filter("portal_ripple", 1, list("type" = "ripple", "size" = 2, "radius" = 1, "falloff" = 1, "y" = 7))
+
+ animate(get_filter("portal_ripple"), time = 1.3 SECONDS, loop = -1, easing = LINEAR_EASING, radius = 32)
+
+ var/turf/center_turf = our_destination.get_target_turf()
+
+ vis_contents += block(locate(center_turf.x - 1, center_turf.y - 1, center_turf.z), locate(center_turf.x + 1, center_turf.y + 1, center_turf.z))
diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm
index ffa2d86e15..6551b1e336 100644
--- a/code/modules/lighting/lighting_object.dm
+++ b/code/modules/lighting/lighting_object.dm
@@ -10,6 +10,7 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
layer = LIGHTING_LAYER
invisibility = INVISIBILITY_LIGHTING
+ vis_flags = VIS_HIDE
var/needs_update = FALSE
var/turf/myturf
diff --git a/icons/obj/machines/gateway.dmi b/icons/obj/machines/gateway.dmi
index fc45145ae8..5ba943bb89 100644
Binary files a/icons/obj/machines/gateway.dmi and b/icons/obj/machines/gateway.dmi differ