Ports some lift stuff from Bay (#9257)

This commit is contained in:
fernerr
2020-07-19 20:59:45 +02:00
committed by GitHub
parent 91a4642c73
commit f9bf5aefb0
8 changed files with 98 additions and 1 deletions
+1
View File
@@ -2593,6 +2593,7 @@
#include "code\modules\shuttles\shuttle_console_multi.dm"
#include "code\modules\shuttles\shuttle_emergency.dm"
#include "code\modules\shuttles\shuttle_ferry.dm"
#include "code\modules\shuttles\shuttle_lift.dm"
#include "code\modules\shuttles\shuttle_specops.dm"
#include "code\modules\shuttles\shuttle_supply.dm"
#include "code\modules\shuttles\shuttles_multi.dm"
+3 -1
View File
@@ -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
+64
View File
@@ -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
@@ -0,0 +1,4 @@
author: Ferner, Kyres1
delete-after: True
changes:
- rscadd: "Added the possibility to map in lifts from Bay, with lift console sprites by Kyres1."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 104 KiB

@@ -0,0 +1,26 @@
<div class="item" style="padding-top: 10px">
<div class="item">
<div class="itemLabel">
Lift status:
</div>
<div class="itemContent">
{{if data.shuttle_state == "idle"}}
<span class="idle">IDLE</span>
{{else data.shuttle_state == "warmup"}}
<span style="font-weight: bold;color: #336699">SPINNING UP</span>
{{else}}
<span class="bad">ERROR</span>
{{/if}}
</div>
</div>
</div>
<h3>Lift Controls</h3>
<div class="item" style="padding-top: 10px">
<div class="item">
<div class="itemContent" style="padding-top: 2px; width: 100%">
{{:helper.link('Move Lift', 'arrowthickstop-1-e', {'move' : '1'}, data.can_launch? null : 'disabled' , null)}}
{{:helper.link('Stop Lift', 'cancel', {'cancel' : '1'}, data.can_cancel ? null : 'disabled' , null)}}
</div>
</div>
</div>
Binary file not shown.
Binary file not shown.