[MDB IGNORE] Shuttle engine code improvement and fixes (#69516)

* A lot of shuttle code improvements

* Makes use of ``as anything`` in many places
* Adds mapload to connect_to_shuttle()
* Renames many vars, including shuttle 'id' var to 'shuttle_id' and engine 'state' to 'engine_state'.
* Engines now weakref their attached ship, and disconnect when unwrenched from it.
* Removes check for force when deleting a mobile docking port, being deleted should still clear your stuff, regardless of being forced.

Because of all the above, I was able to remove a few pointless checks scattered around, like engine's alter_engine_power()

* better comment for port_id

* Fixes Cargo, Arrivals, and Pirate ships.

* Merge branch 'master' into shuttlecode-oh-no

* last few

* fixes the CI

* fixes

* Fixes infinite engines

* Revert "Merge branch 'master' into shuttlecode-oh-no"

This reverts commit 94eba37de9fe3f4a01dc40bb064771b764f379e3.

* trammies

* whiteship tram

* Makes use of ?. instead

apparently this is what weakrefs use, so 🤷

* i hate supernovaa41

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>

* removes lateinit that I never implemented

* adds _ref to weakref var name

* small change to weld time define

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
This commit is contained in:
John Willard
2022-09-07 11:43:54 -04:00
committed by GitHub
co-authored by Seth Scherer
parent 71ee13d168
commit 253613c1c3
84 changed files with 4332 additions and 4310 deletions
+10 -11
View File
@@ -106,7 +106,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
if(!M.check_dock(S, silent = TRUE))
continue
var/list/location_data = list(
id = S.id,
id = S.shuttle_id,
name = S.name
)
data["locations"] += list(location_data)
@@ -233,7 +233,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
var/area/A = get_area(T)
var/obj/docking_port/stationary/landing_zone = new /obj/docking_port/stationary(T)
landing_zone.id = "colony_drop([REF(src)])"
landing_zone.shuttle_id = "colony_drop([REF(src)])"
landing_zone.port_destinations = "colony_drop([REF(src)])"
landing_zone.name = "Landing Zone ([T.x], [T.y])"
landing_zone.dwidth = base_dock.dwidth
@@ -243,7 +243,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
landing_zone.setDir(base_dock.dir)
landing_zone.area_type = A.type
possible_destinations += "[landing_zone.id];"
possible_destinations += "[landing_zone.shuttle_id];"
//Serves as a nice mechanic to people get ready for the launch.
minor_announce("Auxiliary base landing zone coordinates locked in for [A]. Launch command now available!")
@@ -304,7 +304,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
/obj/docking_port/mobile/auxiliary_base
name = "auxiliary base"
id = "colony_drop"
shuttle_id = "colony_drop"
//Reminder to map-makers to set these values equal to the size of your base.
dheight = 4
dwidth = 4
@@ -320,7 +320,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
/obj/docking_port/stationary/public_mining_dock
name = "public mining base dock"
id = "disabled" //The Aux Base has to leave before this can be used as a dock.
shuttle_id = "disabled" //The Aux Base has to leave before this can be used as a dock.
//Should be checked on the map to ensure it matchs the mining shuttle dimensions.
dwidth = 3
width = 7
@@ -369,15 +369,15 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
to_chat(user, span_warning("The auxiliary base's console must be within [console_range] meters in order to interface."))
return
//Mining shuttles may not be created equal, so we find the map's shuttle dock and size accordingly.
//Mining shuttles may not be created equal, so we find the map's shuttle dock and size accordingly.
for(var/S in SSshuttle.stationary_docking_ports)
var/obj/docking_port/stationary/SM = S //SM is declared outside so it can be checked for null
if(SM.id == "mining_home" || SM.id == "mining_away")
if(SM.shuttle_id == "mining_home" || SM.shuttle_id == "mining_away")
var/area/A = get_area(landing_spot)
Mport = new(landing_spot)
Mport.id = "landing_zone_dock"
Mport.shuttle_id = "landing_zone_dock"
Mport.port_destinations = "landing_zone_dock"
Mport.name = "auxiliary base landing site"
Mport.dwidth = SM.dwidth
@@ -394,9 +394,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32)
var/obj/docking_port/mobile/mining_shuttle
var/list/landing_turfs = list() //List of turfs where the mining shuttle may land.
for(var/S in SSshuttle.mobile_docking_ports)
var/obj/docking_port/mobile/MS = S
if(MS.id != "mining")
for(var/obj/docking_port/mobile/MS as anything in SSshuttle.mobile_docking_ports)
if(MS.shuttle_id != "mining")
continue
mining_shuttle = MS
landing_turfs = mining_shuttle.return_ordered_turfs(x,y,z,dir)
@@ -29,7 +29,7 @@
/obj/docking_port/stationary/laborcamp_home
name = "SS13: Labor Shuttle Dock"
id = "laborcamp_home"
shuttle_id = "laborcamp_home"
roundstart_template = /datum/map_template/shuttle/labour/delta
width = 9
dwidth = 2
+2 -2
View File
@@ -124,7 +124,7 @@
/obj/docking_port/stationary/mining_home
name = "SS13: Mining Dock"
id = "mining_home"
shuttle_id = "mining_home"
roundstart_template = /datum/map_template/shuttle/mining/delta
width = 7
dwidth = 3
@@ -136,7 +136,7 @@
/obj/docking_port/stationary/mining_home/common
name = "SS13: Common Mining Dock"
id = "commonmining_home"
shuttle_id = "commonmining_home"
roundstart_template = /datum/map_template/shuttle/mining_common/meta
/obj/docking_port/stationary/mining_home/common/kilo