Skip to content

Commit

Permalink
Elevator shaft sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreML committed Feb 29, 2024
1 parent bc896c3 commit 0da65dd
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 16 deletions.
20 changes: 14 additions & 6 deletions code/game/objects/effects/elevator.dm
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
/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
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
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"
4 changes: 2 additions & 2 deletions code/game/turfs/floor_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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.
Expand Down
40 changes: 40 additions & 0 deletions code/modules/shuttle/vehicle_elevator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 8 additions & 8 deletions code/modules/shuttles/shuttle_supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0da65dd

Please sign in to comment.