mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
Ports some lift stuff from Bay (#9257)
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
var/mothershuttle //tag of mothershuttle
|
||||
var/motherdock //tag of mothershuttle landmark, defaults to starting location
|
||||
|
||||
var/squishes = TRUE //decides whether or not things get squished when it moves.
|
||||
|
||||
/datum/shuttle/New(_name, var/obj/effect/shuttle_landmark/initial_location)
|
||||
..()
|
||||
if(_name)
|
||||
@@ -172,7 +174,7 @@
|
||||
|
||||
for(var/turf/src_turf in turf_translation)
|
||||
var/turf/dst_turf = turf_translation[src_turf]
|
||||
if(src_turf.is_solid_structure()) //in case someone put a hole in the shuttle and you were lucky enough to be under it
|
||||
if(squishes && src_turf.is_solid_structure()) //in case someone put a hole in the shuttle and you were lucky enough to be under it
|
||||
for(var/atom/movable/AM in dst_turf)
|
||||
if(!AM.simulated)
|
||||
continue
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//Used to create small industrial-esque lifts used between two floors
|
||||
/datum/shuttle/autodock/ferry/lift
|
||||
warmup_time = 3
|
||||
knockdown = FALSE
|
||||
squishes = FALSE
|
||||
ceiling_type = null
|
||||
sound_takeoff = 'sound/effects/lift_heavy_start.ogg'
|
||||
sound_landing = 'sound/effects/lift_heavy_stop.ogg'
|
||||
category = /datum/shuttle/autodock/ferry/lift
|
||||
var/obj/machinery/computer/shuttle_control/assigned_controller
|
||||
|
||||
/datum/shuttle/autodock/ferry/lift/New(_name, var/obj/effect/shuttle_landmark/initial_location)
|
||||
..()
|
||||
for(var/obj/machinery/computer/shuttle_control/lift/controller in shuttle_area[1])
|
||||
assigned_controller = controller
|
||||
break
|
||||
|
||||
/datum/shuttle/autodock/ferry/lift/Destroy()
|
||||
assigned_controller = null
|
||||
..()
|
||||
|
||||
/datum/shuttle/autodock/ferry/lift/short_jump(var/obj/effect/shuttle_landmark/destination)
|
||||
var/obj/effect/shuttle_landmark/start_location = current_location
|
||||
if(!obstruction_check(start_location, destination))
|
||||
if(assigned_controller)
|
||||
assigned_controller.audible_message("\The [assigned_controller] buzzes loudly: <i>Obstruction detected!</i>")
|
||||
playsound(assigned_controller.loc, "sound/machines/buzz-two.ogg", 50, 1)
|
||||
return FALSE
|
||||
..()
|
||||
|
||||
/datum/shuttle/autodock/ferry/lift/proc/obstruction_check(var/obj/effect/shuttle_landmark/start, var/obj/effect/shuttle_landmark/destination)
|
||||
var/list/translation = list()
|
||||
for(var/area/A in shuttle_area)
|
||||
translation += get_turf_translation(get_turf(current_location), get_turf(destination), A.contents)
|
||||
|
||||
for(var/turf/src_turf in translation)
|
||||
var/turf/dst_turf = translation[src_turf]
|
||||
|
||||
if(dst_turf.density)
|
||||
return FALSE
|
||||
if(!location)
|
||||
if(!istype(dst_turf, /turf/simulated/open))
|
||||
return FALSE
|
||||
else
|
||||
for(var/atom/A in dst_turf)
|
||||
if(A.density)
|
||||
return FALSE
|
||||
if(istype(A, /mob/living))
|
||||
var/mob/living/blockage = A
|
||||
if(blockage.mob_size > MOB_SMALL)
|
||||
return FALSE
|
||||
if(location)
|
||||
squishes = TRUE
|
||||
else
|
||||
squishes = FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/shuttle_control/lift
|
||||
name = "lift controller"
|
||||
ui_template = "shuttle_control_console_lift.tmpl"
|
||||
icon_state = "lift"
|
||||
icon_screen = null
|
||||
density = FALSE
|
||||
Reference in New Issue
Block a user