From 0da65dd3df0587736849ade9a958f615ccbf8065 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:25:48 +0000 Subject: [PATCH] Elevator shaft sprite --- code/game/objects/effects/elevator.dm | 20 ++++++++---- code/game/turfs/floor_types.dm | 4 +-- code/modules/shuttle/vehicle_elevator.dm | 40 ++++++++++++++++++++++++ code/modules/shuttles/shuttle_supply.dm | 16 +++++----- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/code/game/objects/effects/elevator.dm b/code/game/objects/effects/elevator.dm index 443652a7f7a7..f3b6da2e442a 100644 --- a/code/game/objects/effects/elevator.dm +++ b/code/game/objects/effects/elevator.dm @@ -1,6 +1,6 @@ -/obj/effect/elevator/supply - name = "\improper empty space" - desc = "There seems to be an awful lot of machinery down below" +/obj/effect/elevator + name = "\proper empty space" + desc = "There seems to be an awful lot of machinery down below..." icon = 'icons/effects/160x160.dmi' icon_state = "supply_elevator_lowered" unacidable = TRUE @@ -8,17 +8,25 @@ layer = ABOVE_TURF_LAYER appearance_flags = KEEP_TOGETHER -/obj/effect/elevator/supply/ex_act(severity) +/obj/effect/elevator/ex_act(severity) return -/obj/effect/elevator/supply/Destroy(force) +/obj/effect/elevator/Destroy(force) if(!force) return QDEL_HINT_LETMELIVE return ..() -/obj/effect/elevator/supply/visible_message() //Prevents message spam with empty elevator shaft - "The empty space falls into the depths!" +// Don't move with the elevator. +/obj/effect/elevator/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock) + return +/obj/effect/elevator/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) + return +/obj/effect/elevator/lateShuttleMove(turf/oldT, list/movement_force, move_dir) return /obj/effect/elevator/animation_overlay blend_mode = BLEND_INSET_OVERLAY appearance_flags = KEEP_TOGETHER + +/obj/effect/elevator/vehicle + icon_state = "vehicle_elevator_lowered" diff --git a/code/game/turfs/floor_types.dm b/code/game/turfs/floor_types.dm index f7d69696ca12..81ef9aee3b0c 100644 --- a/code/game/turfs/floor_types.dm +++ b/code/game/turfs/floor_types.dm @@ -213,7 +213,7 @@ /// Base type of the requisitions and vehicle bay elevator pits. /turf/open/floor/almayer/empty name = "\proper empty space" - desc = "There seems to be an awful lot of machinery down below" + desc = "There seems to be an awful lot of machinery down below..." icon = 'icons/turf/floors/floors.dmi' icon_state = "black" @@ -231,7 +231,7 @@ /turf/open/floor/almayer/empty/Entered(atom/movable/AM) ..() - if(!isobserver(AM) && !istype(AM, /obj/docking_port)) + if(!isobserver(AM) && !istype(AM, /obj/effect/elevator) && !istype(AM, /obj/docking_port)) addtimer(CALLBACK(src, PROC_REF(enter_depths), AM), 0.2 SECONDS) /// Returns a list of turfs to be used as a destination for anyone unfortunate enough to fall into the pit. diff --git a/code/modules/shuttle/vehicle_elevator.dm b/code/modules/shuttle/vehicle_elevator.dm index e23b55c1b6ef..8f6a9025ba4f 100644 --- a/code/modules/shuttle/vehicle_elevator.dm +++ b/code/modules/shuttle/vehicle_elevator.dm @@ -87,6 +87,46 @@ id = "almayer vehicle" roundstart_template = /datum/map_template/shuttle/vehicle + //elevator effects (four so the entire elevator doesn't vanish when there's one opaque obstacle between you and the actual elevator loc). + var/obj/effect/elevator/vehicle/SW + var/obj/effect/elevator/vehicle/SE + var/obj/effect/elevator/vehicle/NW + var/obj/effect/elevator/vehicle/NE + +/obj/docking_port/stationary/vehicle_elevator/almayer/Initialize(mapload) + . = ..() + // Create and offset some effects for the elevator shaft sprite. + SW = new(locate(src.x - 2, src.y - 2, src.z)) + + SE = new(locate(src.x + 2, src.y - 2, src.z)) + SE.pixel_x = -128 + + NW = new(locate(src.x - 2, src.y + 2, src.z)) + NW.pixel_y = -128 + + NE = new(locate(src.x + 2, src.y + 2, src.z)) + NE.pixel_x = -128 + NE.pixel_y = -128 + + SW.invisibility = INVISIBILITY_ABSTRACT + SE.invisibility = INVISIBILITY_ABSTRACT + NW.invisibility = INVISIBILITY_ABSTRACT + NE.invisibility = INVISIBILITY_ABSTRACT + +// Make the elevator shaft visible when the elevator leaves. +/obj/docking_port/stationary/vehicle_elevator/almayer/on_departure(obj/docking_port/mobile/departing_shuttle) + SW.invisibility = 0 + SE.invisibility = 0 + NW.invisibility = 0 + NE.invisibility = 0 + +// And make it invisible again when the elevator returns. +/obj/docking_port/stationary/vehicle_elevator/almayer/on_arrival(obj/docking_port/mobile/arriving_shuttle) + SW.invisibility = INVISIBILITY_ABSTRACT + SE.invisibility = INVISIBILITY_ABSTRACT + NW.invisibility = INVISIBILITY_ABSTRACT + NE.invisibility = INVISIBILITY_ABSTRACT + /obj/docking_port/stationary/vehicle_elevator/adminlevel name = "Adminlevel Vehicle Elevator Dock" id = "adminlevel vehicle" diff --git a/code/modules/shuttles/shuttle_supply.dm b/code/modules/shuttles/shuttle_supply.dm index de7de2dab0c2..acbcb2937ab9 100644 --- a/code/modules/shuttles/shuttle_supply.dm +++ b/code/modules/shuttles/shuttle_supply.dm @@ -10,10 +10,10 @@ var/max_late_time = 300 var/railing_id = "supply_elevator_railing" var/gear_id = "supply_elevator_gear" - var/obj/effect/elevator/supply/SW //elevator effects (four so the entire elevator doesn't vanish when - var/obj/effect/elevator/supply/SE //there's one opaque obstacle between you and the actual elevator loc). - var/obj/effect/elevator/supply/NW - var/obj/effect/elevator/supply/NE + var/obj/effect/elevator/SW //elevator effects (four so the entire elevator doesn't vanish when + var/obj/effect/elevator/SE //there's one opaque obstacle between you and the actual elevator loc). + var/obj/effect/elevator/NW + var/obj/effect/elevator/NE var/Elevator_x var/Elevator_y var/Elevator_z @@ -34,15 +34,15 @@ Elevator_x = pick_loc().x Elevator_y = pick_loc().y Elevator_z = pick_loc().z - SW = new /obj/effect/elevator/supply(locate(Elevator_x-2,Elevator_y-2,Elevator_z)) + SW = new /obj/effect/elevator(locate(Elevator_x-2,Elevator_y-2,Elevator_z)) SW.vis_contents += elevator_animation - SE = new /obj/effect/elevator/supply(locate(Elevator_x+2,Elevator_y-2,Elevator_z)) + SE = new /obj/effect/elevator(locate(Elevator_x+2,Elevator_y-2,Elevator_z)) SE.pixel_x = -128 SE.vis_contents += elevator_animation - NW = new /obj/effect/elevator/supply(locate(Elevator_x-2,Elevator_y+2,Elevator_z)) + NW = new /obj/effect/elevator(locate(Elevator_x-2,Elevator_y+2,Elevator_z)) NW.pixel_y = -128 NW.vis_contents += elevator_animation - NE = new /obj/effect/elevator/supply(locate(Elevator_x+2,Elevator_y+2,Elevator_z)) + NE = new /obj/effect/elevator(locate(Elevator_x+2,Elevator_y+2,Elevator_z)) NE.pixel_x = -128 NE.pixel_y = -128 NE.vis_contents += elevator_animation