mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 08:27:13 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
69 lines
2.2 KiB
Plaintext
69 lines
2.2 KiB
Plaintext
//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/structure/machinery/computer/shuttle_control/assigned_controller
|
|
|
|
/datum/shuttle/autodock/ferry/lift/New(_name, var/obj/effect/shuttle_landmark/initial_location)
|
|
..()
|
|
for(var/obj/structure/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/structure/machinery/computer/shuttle_control/lift
|
|
name = "lift controller"
|
|
ui_template = "ShuttleControlConsoleLift"
|
|
icon = 'icons/obj/computer.dmi'
|
|
icon_state = "lift"
|
|
icon_screen = null
|
|
density = FALSE
|
|
|
|
/obj/structure/machinery/computer/shuttle_control/lift/wall
|
|
icon_state = "lift_wall"
|