mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 11:34:19 +01:00
Adds docking controllers to shuttles
Shuttles dock at round start. Conflicts: code/modules/shuttles/shuttle.dm maps/tgstation2.dmm
This commit is contained in:
@@ -133,6 +133,8 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
//here to initialize the random events nicely at round start
|
||||
setup_economy()
|
||||
|
||||
setup_shuttle_docks()
|
||||
|
||||
spawn(0)//Forking here so we dont have to wait for this to finish
|
||||
mode.post_setup()
|
||||
|
||||
@@ -157,4 +157,4 @@
|
||||
set category = "Debug"
|
||||
set src in view(1)
|
||||
src.program:initiate_undocking()
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,10 @@ var/global/datum/shuttle_controller/shuttles
|
||||
//Shuttles with multiple destinations don't quite behave in the same way as ferries.
|
||||
var/list/multi_shuttles = list()
|
||||
|
||||
//docking stuff
|
||||
var/list/docking_controller = list()
|
||||
var/list/docking_targets = list()
|
||||
|
||||
/datum/shuttle_controller/New()
|
||||
|
||||
..()
|
||||
@@ -23,6 +27,7 @@ var/global/datum/shuttle_controller/shuttles
|
||||
moving["Supply"] = 0
|
||||
areas_offsite["Supply"] = locate(/area/supply/dock)
|
||||
areas_station["Supply"] = locate(/area/supply/station)
|
||||
docking_targets["Supply"] = list(null, null)
|
||||
|
||||
// Admin shuttles.
|
||||
locations["Centcom"] = 1
|
||||
@@ -30,18 +35,21 @@ var/global/datum/shuttle_controller/shuttles
|
||||
moving["Centcom"] = 0
|
||||
areas_offsite["Centcom"] = locate(/area/shuttle/transport1/centcom)
|
||||
areas_station["Centcom"] = locate(/area/shuttle/transport1/station)
|
||||
docking_targets["Centcom"] = list(null, null)
|
||||
|
||||
locations["Administration"] = 1
|
||||
delays["Administration"] = 0
|
||||
moving["Administration"] = 0
|
||||
areas_offsite["Administration"] = locate(/area/shuttle/administration/centcom)
|
||||
areas_station["Administration"] = locate(/area/shuttle/administration/station)
|
||||
docking_targets["Administration"] = list(null, null)
|
||||
|
||||
locations["Alien"] = 0
|
||||
delays["Alien"] = 0
|
||||
moving["Alien"] = 0
|
||||
areas_offsite["Alien"] = locate(/area/shuttle/alien/base)
|
||||
areas_station["Alien"] = locate(/area/shuttle/alien/mine)
|
||||
docking_targets["Alien"] = list(null, null)
|
||||
|
||||
// Public shuttles.
|
||||
locations["Engineering"] = 1
|
||||
@@ -49,18 +57,21 @@ var/global/datum/shuttle_controller/shuttles
|
||||
moving["Engineering"] = 0
|
||||
areas_offsite["Engineering"] = locate(/area/shuttle/constructionsite/site)
|
||||
areas_station["Engineering"] = locate(/area/shuttle/constructionsite/station)
|
||||
docking_targets["Engineering"] = list(null, null)
|
||||
|
||||
locations["Mining"] = 0
|
||||
delays["Mining"] = 10
|
||||
moving["Mining"] = 0
|
||||
areas_offsite["Mining"] = locate(/area/shuttle/mining/outpost)
|
||||
areas_station["Mining"] = locate(/area/shuttle/mining/station)
|
||||
docking_targets["Mining"] = list(null, null)
|
||||
|
||||
locations["Research"] = 0
|
||||
delays["Research"] = 10
|
||||
moving["Research"] = 0
|
||||
areas_offsite["Research"] = locate(/area/shuttle/research/outpost)
|
||||
areas_station["Research"] = locate(/area/shuttle/research/station)
|
||||
docking_targets["Research"] = list("research_dock_airlock", "research_dock_airlock")
|
||||
|
||||
//Vox Shuttle.
|
||||
var/datum/multi_shuttle/VS = new
|
||||
@@ -203,9 +214,20 @@ var/global/datum/shuttle_controller/shuttles
|
||||
req_access = list(access_engine)
|
||||
circuit = "/obj/item/weapon/circuitboard/engineering_shuttle"
|
||||
|
||||
//for mapping
|
||||
var/shuttle_tag // Used to coordinate data in shuttle controller.
|
||||
var/docking_controller_tag //tag of the controller used to coordinate docking
|
||||
|
||||
var/datum/computer/file/embedded_program/docking/docking_controller //the controller itself
|
||||
var/hacked = 0 // Has been emagged, no access restrictions.
|
||||
|
||||
/obj/machinery/computer/shuttle_control/initialize()
|
||||
//search for our controller, if we have one.
|
||||
if (docking_controller_tag)
|
||||
for (var/obj/machinery/embedded_controller/radio/C in machines) //only radio controllers are supported, for now...
|
||||
if (C.id_tag == docking_controller_tag && istype(C.program, /datum/computer/file/embedded_program/docking))
|
||||
docking_controller = C.program
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attack_hand(user as mob)
|
||||
|
||||
if(..(user))
|
||||
@@ -250,3 +272,15 @@ var/global/datum/shuttle_controller/shuttles
|
||||
|
||||
/obj/machinery/computer/shuttle_control/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("[Proj] ricochets off [src]!")
|
||||
|
||||
//makes all shuttles docked to something at round start go into the docked state
|
||||
/proc/setup_shuttle_docks()
|
||||
var/list/setup_complete = list() //so we dont setup the same shuttle repeatedly
|
||||
|
||||
for (var/obj/machinery/computer/shuttle_control/S in machines)
|
||||
var/location = shuttles.locations[S.shuttle_tag]
|
||||
var/dock_target = shuttles.docking_targets[S.shuttle_tag][location+1] //damned byond is 1-indexed - don't forget
|
||||
|
||||
if (!(S.shuttle_tag in setup_complete) && S.docking_controller && dock_target)
|
||||
S.docking_controller.initiate_docking(dock_target)
|
||||
setup_complete += S.shuttle_tag
|
||||
|
||||
@@ -1,49 +1,36 @@
|
||||
<div class="item" style="padding-top: 10px">
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Docking Port Status:
|
||||
Chamber Pressure:
|
||||
</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="dark" style="font-weight: bold">UNDOCKED</span>
|
||||
{{else}}
|
||||
<span class="bad">UNDOCKED-OVERRIDE ENABLED</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="bad">ERROR</span>
|
||||
{{/if}}
|
||||
{{:~displayBar(chamber_pressure, 0, 200, chamber_pressure < 80 || chamber_pressure > 120 ? 'bad' : chamber_pressure < 95 || chamber_pressure > 110 ? 'average' : 'good')}}
|
||||
<div class="statusValue">
|
||||
{{:chamber_pressure}} kPa
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="padding-top: 10px">
|
||||
<div class="item">
|
||||
<div class="itemContent" style="width: 100%">
|
||||
{{:~link('Cycle to Exterior', 'arrowthickstop-1-w', {'command' : 'cycle_ext'}, processing ? 'disabled' : null)}}
|
||||
{{:~link('Cycle to Interior', 'arrowthickstop-1-e', {'command' : 'cycle_int'}, processing ? 'disabled' : null)}}
|
||||
</div>
|
||||
<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)}}
|
||||
{{if interior_status.state == "open"}}
|
||||
{{:~link('Force exterior door', 'alert', {'command' : 'force_ext'}, null, 'redBackground')}}
|
||||
{{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('Force exterior door', 'alert', {'command' : 'force_ext'}, null, processing ? 'yellowBackground' : null)}}
|
||||
{{/if}}
|
||||
{{if exterior_status.state == "open"}}
|
||||
{{:~link('Force interior door', 'alert', {'command' : 'force_int'}, null, 'redBackground')}}
|
||||
{{else}}
|
||||
{{:~link('Force interior door', 'alert', {'command' : 'force_int'}, null, processing ? 'yellowBackground' : null)}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" style="padding-top: 10px; width: 100%">
|
||||
{{:~link('Abort', 'cancel', {'command' : 'abort'}, processing ? null : 'disabled', processing ? 'redBackground' : null)}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<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="dark" style="font-weight: bold">UNDOCKED</span>
|
||||
{{else}}
|
||||
<span class="bad">UNDOCKED-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="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)}}
|
||||
{{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')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user