mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Adds the ability to force launch escape pods
Also reduces their countdown from 15 to 10 seconds. Conflicts: maps/tgstation2.dmm
This commit is contained in:
@@ -269,6 +269,12 @@ var/global/datum/shuttle_controller/shuttle_controller
|
||||
shuttle = dock_controller_map[C.id_tag]
|
||||
shuttle.docking_controller = C.program
|
||||
dock_controller_map -= C.id_tag
|
||||
|
||||
//escape pods
|
||||
if(istype(C, /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod))
|
||||
var/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/EPC = C
|
||||
EPC.pod = shuttle
|
||||
|
||||
if (C.id_tag in dock_controller_map_station)
|
||||
multidock = dock_controller_map_station[C.id_tag]
|
||||
if (istype(multidock))
|
||||
|
||||
@@ -1,12 +1,58 @@
|
||||
//This controller goes on the escape pod itself
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod
|
||||
var/datum/shuttle/ferry/pod
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
var/data[0]
|
||||
|
||||
data = list(
|
||||
"docking_status" = docking_program.get_docking_status(),
|
||||
"override_enabled" = docking_program.override_enabled,
|
||||
"door_state" = docking_program.memory["door_status"]["state"],
|
||||
"door_lock" = docking_program.memory["door_status"]["lock"],
|
||||
"can_force" = pod.can_force(),
|
||||
)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "simple_docking_console_pod.tmpl", name, 470, 290)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
var/clean = 0
|
||||
switch(href_list["command"]) //anti-HTML-hacking checks
|
||||
if("force_door")
|
||||
clean = 1
|
||||
if("toggle_override")
|
||||
clean = 1
|
||||
if("force_launch")
|
||||
pod.force_launch(src)
|
||||
|
||||
if(clean)
|
||||
program.receive_user_command(href_list["command"])
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
//This controller is for the escape pod berth (station side)
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth
|
||||
name = "escape pod berth controller"
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/initialize()
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/initialize()
|
||||
..()
|
||||
docking_program = new/datum/computer/file/embedded_program/docking/simple/escape_pod(src)
|
||||
program = docking_program
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
var/data[0]
|
||||
|
||||
var/armed = null
|
||||
@@ -28,7 +74,7 @@
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
user << "\blue You emag the [src], arming the escape pod!"
|
||||
emagged = 1
|
||||
@@ -43,7 +89,7 @@
|
||||
//A docking controller program for a simple door based docking port
|
||||
/datum/computer/file/embedded_program/docking/simple/escape_pod
|
||||
var/armed = 0
|
||||
var/eject_delay = 15 //give latecomers some time to get out of the way if they don't make it onto the pod
|
||||
var/eject_delay = 10 //give latecomers some time to get out of the way if they don't make it onto the pod
|
||||
var/eject_time = null
|
||||
var/closing = 0
|
||||
|
||||
|
||||
@@ -235,7 +235,9 @@
|
||||
return ..()
|
||||
|
||||
/datum/shuttle/ferry/escape_pod/can_force()
|
||||
return 0
|
||||
if (arming_controller.eject_time && world.time < arming_controller.eject_time + 50)
|
||||
return 0 //dont allow force launching until 5 seconds after the arming controller has reached it's countdown
|
||||
return ..()
|
||||
|
||||
/datum/shuttle/ferry/escape_pod/can_cancel()
|
||||
return 0
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<div class="item" style="padding-top: 10px">
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Docking Port Status:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{if docking_status == "docked"}}
|
||||
{{if !override_enabled}}
|
||||
<span class="good">DOCKED</span>
|
||||
{{else}}
|
||||
<span class="bad">DOCKED-OVERRIDE ENABLED</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "docking"}}
|
||||
{{if !override_enabled}}
|
||||
<span class="average">DOCKING</span>
|
||||
{{else}}
|
||||
<span class="bad">DOCKING-OVERRIDE ENABLED</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "undocking"}}
|
||||
{{if !override_enabled}}
|
||||
<span class="average">UNDOCKING</span>
|
||||
{{else}}
|
||||
<span class="bad">UNDOCKING-OVERRIDE ENABLED</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "undocked"}}
|
||||
{{if !override_enabled}}
|
||||
<span class="idle">NOT IN USE</span>
|
||||
{{else}}
|
||||
<span class="bad" style="float:left">OVERRIDE ENABLED</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="padding-top: 10px">
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Docking Hatch:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{if docking_status == "docked"}}
|
||||
{{if door_state == "open"}}
|
||||
<span class="good">OPEN</span>
|
||||
{{else door_state == "closed"}}
|
||||
<span class="good">CLOSED</span>
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "docking"}}
|
||||
{{if door_state == "open"}}
|
||||
<span class="good">OPEN</span>
|
||||
{{else door_state == "closed" && door_lock == "locked"}}
|
||||
<span class="good">SECURED</span>
|
||||
{{else door_state == "closed" && door_lock == "unlocked"}}
|
||||
<span class="good">UNSECURED</span>
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "undocking"}}
|
||||
{{if door_state == "open"}}
|
||||
<span class="average">OPEN</span>
|
||||
{{else door_state == "closed" && door_lock == "locked"}}
|
||||
<span class="good">SECURED</span>
|
||||
{{else door_state == "closed" && door_lock == "unlocked"}}
|
||||
<span class="average">UNSECURED</span>
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
{{else docking_status == "undocked"}}
|
||||
{{if door_state == "open"}}
|
||||
<span class="bad">OPEN</span>
|
||||
{{else door_state == "closed" && door_lock == "locked"}}
|
||||
<span class="good">SECURED</span>
|
||||
{{else door_state == "closed" && door_lock == "unlocked"}}
|
||||
<span class="bad">UNSECURED</span>
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="padding-top: 10px">
|
||||
<div class="item">
|
||||
<div class="itemContent" style="padding-top: 2px; width: 100%">
|
||||
{{if docking_status == "docked"}}
|
||||
{{:~link('Force exterior door', 'alert', {'command' : 'force_door'}, override_enabled ? null : 'disabled', null)}}
|
||||
{{:~link('Override', 'alert', {'command' : 'toggle_override'}, null, override_enabled ? 'redBackground' : null)}}
|
||||
{{:~link('MANUAL EJECT', 'alert', {'command' : 'toggle_override'}, 'disabled', null)}}
|
||||
{{else}}
|
||||
{{:~link('Force exterior door', 'alert', {'command' : 'force_door'}, override_enabled ? null : 'disabled', override_enabled? 'redBackground' : null)}}
|
||||
{{:~link('Override', 'alert', {'command' : 'toggle_override'}, null, override_enabled ? 'redBackground' : 'yellowBackground')}}
|
||||
{{:~link('MANUAL EJECT', 'alert', {'command' : 'toggle_override'}, can_force ? null : 'disabled', can_force ? 'redBackground' : null)}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user