Adds the ability to force launch escape pods

Also reduces their countdown from 15 to 10 seconds.
This commit is contained in:
mwerezak
2014-06-28 19:40:18 -04:00
parent c8bddfb219
commit 1cc840dccc
5 changed files with 168 additions and 13 deletions

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -527,12 +527,12 @@
"akg" = (/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/security/brig)
"akh" = (/obj/structure/disposalpipe/segment{dir = 1; icon_state = "pipe-c"},/obj/machinery/door/airlock/security{name = "Security Pods"; req_access_txt = "1"},/turf/simulated/floor/plating,/area/security/brig)
"aki" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plating,/area/maintenance/fsmaint)
"akj" = (/obj/structure/stool/bed/chair{dir = 4},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = 32},/obj/machinery/embedded_controller/radio/simple_docking_controller{frequency = 1380; id_tag = "escape_pod_3"; pixel_x = 0; pixel_y = -25; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_3_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod3/station)
"akj" = (/obj/structure/stool/bed/chair{dir = 4},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = 32},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_3"; pixel_x = 0; pixel_y = -25; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_3_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod3/station)
"akk" = (/obj/machinery/door/airlock/external{frequency = 1380; icon_state = "door_locked"; id_tag = "escape_pod_3_hatch"; locked = 1; name = "Escape Pod Hatch"; req_access_txt = "13"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod3/station)
"akl" = (/turf/simulated/floor/plating,/area/security/main)
"akm" = (/obj/machinery/door/airlock/external{frequency = 1380; icon_state = "door_locked"; id_tag = "escape_pod_3_berth_hatch"; locked = 1; name = "Escape Pod"; req_access_txt = "13"},/turf/simulated/floor/plating,/area/security/main)
"akn" = (/obj/structure/stool/bed/chair{dir = 4},/obj/item/device/radio/intercom{broadcasting = 0; listening = 1; name = "Station Intercom (General)"; pixel_y = 20},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod3/station)
"ako" = (/obj/structure/disposalpipe/segment{dir = 2; icon_state = "pipe-c"},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_3_berth"; pixel_x = 25; pixel_y = 25; tag_door = "escape_pod_3_berth_hatch"},/turf/simulated/floor/plating,/area/maintenance/fsmaint)
"ako" = (/obj/structure/disposalpipe/segment{dir = 2; icon_state = "pipe-c"},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth{frequency = 1380; id_tag = "escape_pod_3_berth"; pixel_x = 25; pixel_y = 25; tag_door = "escape_pod_3_berth_hatch"},/turf/simulated/floor/plating,/area/maintenance/fsmaint)
"akp" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/maintenance/fsmaint)
"akq" = (/obj/structure/stool/bed/roller,/turf/simulated/floor{icon_state = "white"},/area/security/brig)
"akr" = (/obj/structure/stool/bed,/turf/simulated/floor{icon_state = "white"},/area/security/brig)
@@ -7825,7 +7825,7 @@
"cUy" = (/turf/simulated/shuttle/wall{dir = 8; icon_state = "swall_floor_f6"},/area/supply/dock)
"cUz" = (/turf/unsimulated/floor{icon_state = "floor"},/area/centcom/holding)
"cUA" = (/obj/machinery/door/airlock/glass{name = "Arrivals Processing"},/turf/unsimulated/floor{icon_state = "floor"},/area/centcom/holding)
"cUB" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_2_berth"; pixel_x = -25; pixel_y = 30; tag_door = "escape_pod_2_berth_hatch"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry)
"cUB" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth{frequency = 1380; id_tag = "escape_pod_2_berth"; pixel_x = -25; pixel_y = 30; tag_door = "escape_pod_2_berth_hatch"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry)
"cUC" = (/turf/unsimulated/floor{dir = 8; icon_state = "carpetside"},/area/wizard_station)
"cUD" = (/turf/unsimulated/floor{icon_state = "vault"; dir = 5},/area/centcom/evac)
"cUE" = (/turf/unsimulated/floor{dir = 4; icon_state = "carpetside"},/area/wizard_station)
@@ -8774,8 +8774,8 @@
"dmL" = (/obj/machinery/mass_driver{dir = 4; id = "research"},/turf/simulated/floor/plating/airless/asteroid,/area/mine/explored)
"dmM" = (/obj/structure/sign/science{desc = "A warning sign which reads 'ANOMALOUS MATERIALS'"; name = "\improper ANOMALOUS MATERIALS"; pixel_x = 32},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0},/obj/machinery/atmospherics/pipe/manifold/hidden/supply{dir = 4},/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/research_outpost/hallway)
"dmN" = (/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/obj/machinery/atmospherics/unary/vent_pump{dir = 4; layer = 2.4; on = 1},/turf/simulated/floor{dir = 4; icon_state = "whitebluecorner"},/area/research_outpost/hallway)
"dmO" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_1_berth"; pixel_x = -25; pixel_y = 30; tag_door = "escape_pod_1_berth_hatch"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry)
"dmP" = (/obj/structure/stool/bed/chair{dir = 1},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 32; pixel_y = 0},/obj/machinery/embedded_controller/radio/simple_docking_controller{frequency = 1380; id_tag = "escape_pod_1"; pixel_x = -25; pixel_y = 0; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_1_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod1/station)
"dmO" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth{frequency = 1380; id_tag = "escape_pod_1_berth"; pixel_x = -25; pixel_y = 30; tag_door = "escape_pod_1_berth_hatch"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry)
"dmP" = (/obj/structure/stool/bed/chair{dir = 1},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 32; pixel_y = 0},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_1"; pixel_x = -25; pixel_y = 0; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_1_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod1/station)
"dmQ" = (/obj/machinery/door/airlock/external{frequency = 1380; icon_state = "door_locked"; id_tag = "research_outpost_hatch"; locked = 1; name = "Research Outpost Docking Hatch"; req_access_txt = "13"},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/research_outpost/entry)
"dmR" = (/obj/structure/sign/deathsposal{pixel_x = 32},/obj/machinery/disposal/deliveryChute{dir = 8; name = "disposal inlet"},/obj/structure/disposalpipe/trunk{dir = 4},/obj/structure/window/reinforced{dir = 1},/turf/simulated/floor/plating{dir = 1; icon_state = "warnplate"; nitrogen = 0.01; oxygen = 0.01},/area/research_outpost/power)
"dmS" = (/obj/machinery/driver_button{id = "research"; pixel_x = 6; pixel_y = -26},/obj/machinery/conveyor{dir = 4; id = "archgunc"},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/window/westleft{base_state = "right"; dir = 1; icon_state = "right"},/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 9},/area/research_outpost/power)
@@ -8801,11 +8801,11 @@
"dnm" = (/obj/structure/window/reinforced{dir = 5; health = 1e+007},/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/door/firedoor/border_only{dir = 8; layer = 2.6; name = "Firelock West"},/obj/structure/sign/greencross,/turf/simulated/floor{icon_state = "white"},/area/research_outpost/entry)
"dnn" = (/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 4},/obj/machinery/door/firedoor/border_only{dir = 8; layer = 2.6; name = "Firelock West"},/obj/structure/disposalpipe/segment{dir = 4},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0},/turf/simulated/floor{icon_state = "white"},/area/research_outpost/hallway)
"dno" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{dir = 1},/obj/machinery/firealarm{pixel_y = -24},/obj/machinery/atmospherics/unary/vent_pump{dir = 1; on = 1},/turf/simulated/floor{icon_state = "white"},/area/research_outpost/hallway)
"dnp" = (/obj/structure/stool/bed/chair{dir = 1},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 32; pixel_y = 0},/obj/machinery/embedded_controller/radio/simple_docking_controller{frequency = 1380; id_tag = "escape_pod_2"; pixel_x = -25; pixel_y = 0; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_2_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod2/station)
"dnq" = (/obj/structure/stool/bed/chair{dir = 8},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = 32},/obj/machinery/embedded_controller/radio/simple_docking_controller{frequency = 1380; id_tag = "escape_pod_5"; pixel_x = 0; pixel_y = -25; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_5_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod5/station)
"dnp" = (/obj/structure/stool/bed/chair{dir = 1},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 32; pixel_y = 0},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_2"; pixel_x = -25; pixel_y = 0; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_2_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod2/station)
"dnq" = (/obj/structure/stool/bed/chair{dir = 8},/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = 32},/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_5"; pixel_x = 0; pixel_y = -25; req_access_txt = "0"; req_one_access_txt = "0"; tag_door = "escape_pod_5_hatch"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod5/station)
"dnr" = (/obj/machinery/door/airlock/external{frequency = 1380; icon_state = "door_locked"; id_tag = "escape_pod_5_hatch"; locked = 1; name = "Escape Pod Hatch"; req_access_txt = "13"},/turf/simulated/shuttle/floor,/area/shuttle/escape_pod5/station)
"dns" = (/obj/machinery/door/airlock/external{frequency = 1380; icon_state = "door_locked"; id_tag = "escape_pod_5_berth_hatch"; locked = 1; name = "Escape Pod"; req_access_txt = "13"},/turf/simulated/floor/plating,/area/maintenance/aft)
"dnt" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod{frequency = 1380; id_tag = "escape_pod_5_berth"; pixel_x = -25; pixel_y = 25; tag_door = "escape_pod_5_berth_hatch"},/turf/simulated/floor/plating,/area/maintenance/aft)
"dnt" = (/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth{frequency = 1380; id_tag = "escape_pod_5_berth"; pixel_x = -25; pixel_y = 25; tag_door = "escape_pod_5_berth_hatch"},/turf/simulated/floor/plating,/area/maintenance/aft)
"dnu" = (/obj/machinery/alarm{frequency = 1441; pixel_y = 22},/turf/simulated/floor{icon_state = "white"},/area/research_outpost/sample)
"dnv" = (/obj/machinery/atmospherics/portables_connector{dir = 1},/obj/machinery/portable_atmospherics/canister/air,/turf/simulated/floor/plating,/area/storage/emergency)
"dnw" = (/obj/machinery/atmospherics/pipe/simple/hidden,/turf/simulated/wall,/area/hallway/secondary/exit)

View File

@@ -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>