diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 8057d5f5178..170b8842f54 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -53,6 +53,7 @@ #define DOOR_HELPER_LAYER 2.71 //keep this above OPEN_DOOR_LAYER #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 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 cf2eb2292cc..b1a10024201 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -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,14 +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 - /// icon when off - var/icon_off = "off" - /// icon when on - var/icon_on = "on" + /// 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() @@ -194,19 +194,13 @@ GLOBAL_LIST_EMPTY(gateway_destinations) QDEL_NULL(portal) use_power = IDLE_POWER_USE update_icon() + portal_visuals.reset_visuals() /obj/machinery/gateway/process() if((machine_stat & (NOPOWER)) && use_power) if(target) deactivate() return - -/obj/machinery/gateway/update_icon_state() - if(target) - icon_state = icon_on - else - icon_state = icon_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 @@ -219,6 +213,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() @@ -327,3 +322,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 72cc4c20a04..bee199d5b11 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 fc45145ae86..5ba943bb896 100644 Binary files a/icons/obj/machines/gateway.dmi and b/icons/obj/machines/gateway.dmi differ