mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Allows mult-shuttles to use docking controllers and adds docking to the merc shuttle
This commit is contained in:
@@ -225,6 +225,7 @@ var/global/datum/shuttle_controller/shuttle_controller
|
|||||||
//Nuke Ops shuttle.
|
//Nuke Ops shuttle.
|
||||||
var/datum/shuttle/multi_shuttle/MS = new/datum/shuttle/multi_shuttle()
|
var/datum/shuttle/multi_shuttle/MS = new/datum/shuttle/multi_shuttle()
|
||||||
MS.origin = locate(/area/syndicate_station/start)
|
MS.origin = locate(/area/syndicate_station/start)
|
||||||
|
MS.start_location = "Mercenary Base"
|
||||||
|
|
||||||
MS.destinations = list(
|
MS.destinations = list(
|
||||||
"Northwest of the station" = locate(/area/syndicate_station/northwest),
|
"Northwest of the station" = locate(/area/syndicate_station/northwest),
|
||||||
@@ -238,6 +239,12 @@ var/global/datum/shuttle_controller/shuttle_controller
|
|||||||
"Arrivals dock" = locate(/area/syndicate_station/arrivals_dock),
|
"Arrivals dock" = locate(/area/syndicate_station/arrivals_dock),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
MS.docking_controller_tag = "merc_shuttle"
|
||||||
|
MS.destination_dock_targets = list(
|
||||||
|
"Mercenary Base" = "merc_base",
|
||||||
|
"Arrivals dock" = "nuke_shuttle_dock_airlock",
|
||||||
|
)
|
||||||
|
|
||||||
MS.announcer = "NSV Icarus"
|
MS.announcer = "NSV Icarus"
|
||||||
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
||||||
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
|
||||||
|
|||||||
@@ -14,19 +14,45 @@
|
|||||||
|
|
||||||
var/area/interim
|
var/area/interim
|
||||||
var/area/last_departed
|
var/area/last_departed
|
||||||
|
var/start_location
|
||||||
|
var/last_location
|
||||||
var/list/destinations
|
var/list/destinations
|
||||||
|
var/list/destination_dock_controller_tags = list() //optional, in case the shuttle has multiple docking ports like the ERT shuttle (even though that isn't a multi_shuttle)
|
||||||
|
var/list/destination_dock_controllers = list()
|
||||||
|
var/list/destination_dock_targets = list()
|
||||||
var/area/origin
|
var/area/origin
|
||||||
var/return_warning = 0
|
var/return_warning = 0
|
||||||
|
|
||||||
/datum/shuttle/multi_shuttle/New()
|
/datum/shuttle/multi_shuttle/New()
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
/datum/shuttle/multi_shuttle/init_docking_controllers()
|
||||||
|
..()
|
||||||
|
for(var/destination in destinations)
|
||||||
|
var/controller_tag = destination_dock_controller_tags[destination]
|
||||||
|
if(!controller_tag)
|
||||||
|
destination_dock_controllers[destination] = docking_controller
|
||||||
|
else
|
||||||
|
var/datum/computer/file/embedded_program/docking/C = locate(controller_tag)
|
||||||
|
|
||||||
|
if(!istype(C))
|
||||||
|
world << "<span class='danger'>warning: shuttle with docking tag [controller_tag] could not find it's controller!</span>"
|
||||||
|
else
|
||||||
|
destination_dock_controllers[destination] = C
|
||||||
|
|
||||||
|
//might as well set this up here.
|
||||||
if(origin) last_departed = origin
|
if(origin) last_departed = origin
|
||||||
|
last_location = start_location
|
||||||
|
|
||||||
|
/datum/shuttle/multi_shuttle/current_dock_target()
|
||||||
|
return destination_dock_targets[last_location]
|
||||||
|
|
||||||
/datum/shuttle/multi_shuttle/move(var/area/origin, var/area/destination)
|
/datum/shuttle/multi_shuttle/move(var/area/origin, var/area/destination)
|
||||||
..()
|
..()
|
||||||
last_move = world.time
|
last_move = world.time
|
||||||
if (destination == src.origin)
|
if (destination == src.origin)
|
||||||
returned_home = 1
|
returned_home = 1
|
||||||
|
docking_controller = destination_dock_controllers[last_location]
|
||||||
|
|
||||||
/datum/shuttle/multi_shuttle/proc/announce_departure()
|
/datum/shuttle/multi_shuttle/proc/announce_departure()
|
||||||
|
|
||||||
@@ -74,8 +100,52 @@
|
|||||||
dat += "<b><A href='?src=\ref[src];move_multi=[1]'>Move ship</A></b><br>"
|
dat += "<b><A href='?src=\ref[src];move_multi=[1]'>Move ship</A></b><br>"
|
||||||
dat += "<b><A href='?src=\ref[src];start=[1]'>Return to base</A></b></center>"
|
dat += "<b><A href='?src=\ref[src];start=[1]'>Return to base</A></b></center>"
|
||||||
|
|
||||||
|
//Docking
|
||||||
|
dat += "<center><br><br>"
|
||||||
|
if(MS.skip_docking_checks())
|
||||||
|
dat += "Docking Status: <font color='grey'>Not in use.</font></center>"
|
||||||
|
else
|
||||||
|
var/override_en = MS.docking_controller.override_enabled
|
||||||
|
var/docking_status = MS.docking_controller.get_docking_status()
|
||||||
|
|
||||||
|
dat += "Docking Status: "
|
||||||
|
switch(docking_status)
|
||||||
|
if("undocked")
|
||||||
|
dat += "<font color='[override_en? "red" : "grey"]'>Undocked</font>"
|
||||||
|
if("docking")
|
||||||
|
dat += "<font color='[override_en? "red" : "amber"]'>Docking</font>"
|
||||||
|
if("undocking")
|
||||||
|
dat += "<font color='[override_en? "red" : "amber"]'>Undocking</font>"
|
||||||
|
if("docked")
|
||||||
|
dat += "<font color='[override_en? "red" : "green"]'>Docked</font>"
|
||||||
|
|
||||||
|
if(override_en) dat += " <font color='red'>(Override Enabled)</font>"
|
||||||
|
|
||||||
|
dat += ".<br>"
|
||||||
|
|
||||||
|
switch(docking_status)
|
||||||
|
if("undocked")
|
||||||
|
dat += "<b><A href='?src=\ref[src];dock_command=[1]'>Dock</A></b></center>"
|
||||||
|
if("docked")
|
||||||
|
dat += "<b><A href='?src=\ref[src];undock_command=[1]'>Undock</A></b></center>"
|
||||||
|
|
||||||
user << browse("[dat]", "window=[shuttle_tag]shuttlecontrol;size=300x600")
|
user << browse("[dat]", "window=[shuttle_tag]shuttlecontrol;size=300x600")
|
||||||
|
|
||||||
|
//check if we're undocked, give option to force launch
|
||||||
|
/obj/machinery/computer/shuttle_control/proc/check_docking(datum/shuttle/multi_shuttle/MS)
|
||||||
|
if(MS.skip_docking_checks() || MS.docking_controller.can_launch())
|
||||||
|
return 1
|
||||||
|
|
||||||
|
var/choice = alert("The shuttle is currently docked! Please undock before continuing.","Error","Cancel","Force Launch")
|
||||||
|
if(choice == "Cancel")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
choice = alert("Forcing a shuttle launch while docked may result in severe injury, death and/or damage to property. Are you sure you wish to continue?", "Force Launch", "Force Launch", "Cancel")
|
||||||
|
if(choice == "Cancel")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/multi/Topic(href, href_list)
|
/obj/machinery/computer/shuttle_control/multi/Topic(href, href_list)
|
||||||
if(..())
|
if(..())
|
||||||
return 1
|
return 1
|
||||||
@@ -92,12 +162,27 @@
|
|||||||
usr << "\blue [shuttle_tag] vessel is moving."
|
usr << "\blue [shuttle_tag] vessel is moving."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(href_list["start"])
|
if(href_list["dock_command"])
|
||||||
|
MS.dock()
|
||||||
|
return
|
||||||
|
|
||||||
|
if(href_list["undock_command"])
|
||||||
|
MS.undock()
|
||||||
|
return
|
||||||
|
|
||||||
|
if(href_list["start"])
|
||||||
if(MS.at_origin)
|
if(MS.at_origin)
|
||||||
usr << "\red You are already at your home base."
|
usr << "\red You are already at your home base."
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if((MS.last_move + MS.cooldown*10) > world.time)
|
||||||
|
usr << "\red The ship's drive is inoperable while the engines are charging."
|
||||||
|
return
|
||||||
|
|
||||||
|
if(!check_docking(MS))
|
||||||
|
updateUsrDialog()
|
||||||
|
return
|
||||||
|
|
||||||
if(!MS.return_warning)
|
if(!MS.return_warning)
|
||||||
usr << "\red Returning to your home base will end your mission. If you are sure, press the button again."
|
usr << "\red Returning to your home base will end your mission. If you are sure, press the button again."
|
||||||
//TODO: Actually end the mission.
|
//TODO: Actually end the mission.
|
||||||
@@ -106,6 +191,7 @@
|
|||||||
|
|
||||||
MS.long_jump(MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
MS.long_jump(MS.last_departed,MS.origin,MS.interim,MS.move_time)
|
||||||
MS.last_departed = MS.origin
|
MS.last_departed = MS.origin
|
||||||
|
MS.last_location = MS.start_location
|
||||||
MS.at_origin = 1
|
MS.at_origin = 1
|
||||||
|
|
||||||
if(href_list["toggle_cloak"])
|
if(href_list["toggle_cloak"])
|
||||||
@@ -118,6 +204,10 @@
|
|||||||
usr << "\red The ship's drive is inoperable while the engines are charging."
|
usr << "\red The ship's drive is inoperable while the engines are charging."
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if(!check_docking(MS))
|
||||||
|
updateUsrDialog()
|
||||||
|
return
|
||||||
|
|
||||||
var/choice = input("Select a destination.") as null|anything in MS.destinations
|
var/choice = input("Select a destination.") as null|anything in MS.destinations
|
||||||
if(!choice) return
|
if(!choice) return
|
||||||
|
|
||||||
@@ -131,6 +221,7 @@
|
|||||||
|
|
||||||
MS.long_jump(MS.last_departed, MS.destinations[choice], MS.interim, MS.move_time)
|
MS.long_jump(MS.last_departed, MS.destinations[choice], MS.interim, MS.move_time)
|
||||||
MS.last_departed = MS.destinations[choice]
|
MS.last_departed = MS.destinations[choice]
|
||||||
|
MS.last_location = choice
|
||||||
return
|
return
|
||||||
|
|
||||||
else if(choice == MS.origin)
|
else if(choice == MS.origin)
|
||||||
@@ -139,5 +230,6 @@
|
|||||||
|
|
||||||
MS.short_jump(MS.last_departed, MS.destinations[choice])
|
MS.short_jump(MS.last_departed, MS.destinations[choice])
|
||||||
MS.last_departed = MS.destinations[choice]
|
MS.last_departed = MS.destinations[choice]
|
||||||
|
MS.last_location = choice
|
||||||
|
|
||||||
updateUsrDialog()
|
updateUsrDialog()
|
||||||
|
|||||||
@@ -1934,7 +1934,7 @@
|
|||||||
"aLj" = (/obj/machinery/atmospherics/unary/vent_scrubber/on{dir = 4},/turf/simulated/floor/wood,/area/library)
|
"aLj" = (/obj/machinery/atmospherics/unary/vent_scrubber/on{dir = 4},/turf/simulated/floor/wood,/area/library)
|
||||||
"aLk" = (/obj/machinery/door/firedoor/border_only,/obj/machinery/door/airlock/glass_command{name = "E.V.A."; req_access_txt = "0"; req_one_access_txt = "1;11;18;24"},/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor{icon_state = "dark"},/area/hallway/primary/central_one)
|
"aLk" = (/obj/machinery/door/firedoor/border_only,/obj/machinery/door/airlock/glass_command{name = "E.V.A."; req_access_txt = "0"; req_one_access_txt = "1;11;18;24"},/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor{icon_state = "dark"},/area/hallway/primary/central_one)
|
||||||
"aLl" = (/obj/structure/table/woodentable,/obj/item/weapon/folder/yellow,/obj/item/weapon/pen,/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/turf/simulated/floor/wood,/area/library)
|
"aLl" = (/obj/structure/table/woodentable,/obj/item/weapon/folder/yellow,/obj/item/weapon/pen,/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/turf/simulated/floor/wood,/area/library)
|
||||||
"aLm" = (/obj/machinery/embedded_controller/radio/airlock/docking_port{frequency = 1380; id_tag = "nuke_shuttle_dock_airlock"; pixel_x = 0; pixel_y = 30; req_access_txt = "0"; req_one_access_txt = "13"; tag_airpump = "nuke_shuttle_dock_pump"; tag_chamber_sensor = "nuke_shuttle_dock_sensor"; tag_exterior_door = "nuke_shuttle_dock_outer"; tag_interior_door = "nuke_shuttle_dock_inner"},/obj/machinery/atmospherics/pipe/manifold/hidden{dir = 1; icon_state = "map"; tag = "icon-manifold-f (NORTH)"},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/entry/port)
|
"aLm" = (/obj/machinery/embedded_controller/radio/airlock/docking_port{frequency = 1331; id_tag = "nuke_shuttle_dock_airlock"; pixel_x = 0; pixel_y = 30; req_access_txt = "0"; req_one_access_txt = "13"; tag_airpump = "nuke_shuttle_dock_pump"; tag_chamber_sensor = "nuke_shuttle_dock_sensor"; tag_exterior_door = "nuke_shuttle_dock_outer"; tag_interior_door = "nuke_shuttle_dock_inner"},/obj/machinery/atmospherics/pipe/manifold/hidden{dir = 1; icon_state = "map"; tag = "icon-manifold-f (NORTH)"},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/entry/port)
|
||||||
"aLn" = (/turf/simulated/floor{icon_state = "neutral"; dir = 4},/area/hallway/primary/central_two)
|
"aLn" = (/turf/simulated/floor{icon_state = "neutral"; dir = 4},/area/hallway/primary/central_two)
|
||||||
"aLo" = (/obj/machinery/newscaster{pixel_x = 30},/obj/machinery/atmospherics/unary/vent_pump/on{dir = 8},/turf/simulated/floor/wood,/area/library)
|
"aLo" = (/obj/machinery/newscaster{pixel_x = 30},/obj/machinery/atmospherics/unary/vent_pump/on{dir = 8},/turf/simulated/floor/wood,/area/library)
|
||||||
"aLp" = (/obj/machinery/atmospherics/unary/vent_pump/on{dir = 4},/turf/simulated/floor{icon_state = "dark"},/area/chapel/office)
|
"aLp" = (/obj/machinery/atmospherics/unary/vent_pump/on{dir = 4},/turf/simulated/floor{icon_state = "dark"},/area/chapel/office)
|
||||||
|
|||||||
4563
maps/exodus-2.dmm
4563
maps/exodus-2.dmm
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user