Files
VOREStation/code/modules/shuttles/shuttle_ferry.dm
Leshana c837078105 Replaced "area" shuttles with "landmark" shuttles.
Largely ported from the work done at Baystation in https://github.com/Baystation12/Baystation12/pull/17460 and later commits.

 - Shuttles no longer require a separate area for each location they jump to.
   Instead destinations are indicated by landmark objects, which are not necessarily exclusive to that shuttle.
   This means that more than one shuttle could use the same docking port (not at the same time of course).
 - Enhanced shuttle control computers to use nanoui if they didn't.
 - Organizes shuttle datum code a bit better so there is less re-inventing the wheel in subtypes.
 - Allows the possibility of shuttles (or destinations) that start on late-loaded maps.
 - Deprecate the "extra" shuttle areas that are no longer needed and update shuttle areas in unit tests

This all required a bit of infrastructure improvements.

 - ChangeArea proc, for changing the area of a turf.
 - Fixed lighting overlays actually being able to be destroyed.
 - Added a few utility macros and procs.
 - Added "turf translation" procs which are like move_contents_to but more flexible.
2020-03-05 10:29:08 -05:00

51 lines
2.0 KiB
Plaintext

#define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up.
/datum/shuttle/autodock/ferry
var/location = FERRY_LOCATION_STATION //0 = at area_station, 1 = at area_offsite
var/direction = FERRY_GOING_TO_STATION //0 = going to station, 1 = going to offsite.
var/always_process = FALSE // TODO -why should this exist?
var/obj/effect/shuttle_landmark/landmark_station //This variable is type-abused initially: specify the landmark_tag, not the actual landmark.
var/obj/effect/shuttle_landmark/landmark_offsite //This variable is type-abused initially: specify the landmark_tag, not the actual landmark.
category = /datum/shuttle/autodock/ferry
/datum/shuttle/autodock/ferry/New(var/_name)
if(landmark_station)
landmark_station = SSshuttles.get_landmark(landmark_station)
if(landmark_offsite)
landmark_offsite = SSshuttles.get_landmark(landmark_offsite)
..(_name, get_location_waypoint(location))
next_location = get_location_waypoint(!location)
//Gets the shuttle landmark associated with the given location (defaults to current location)
/datum/shuttle/autodock/ferry/proc/get_location_waypoint(location_id = null)
if (isnull(location_id))
location_id = location
if (location_id == FERRY_LOCATION_STATION)
return landmark_station
return landmark_offsite
/datum/shuttle/autodock/ferry/short_jump(var/destination)
direction = !location // Heading away from where we currently are
. = ..()
/datum/shuttle/autodock/ferry/long_jump(var/destination, var/obj/effect/shuttle_landmark/interim, var/travel_time)
direction = !location // Heading away from where we currently are
. = ..()
/datum/shuttle/autodock/ferry/perform_shuttle_move()
..()
if (current_location == landmark_station) location = FERRY_LOCATION_STATION
if (current_location == landmark_offsite) location = FERRY_LOCATION_OFFSITE
// Once we have arrived where we are going, plot a course back!
/datum/shuttle/autodock/ferry/process_arrived()
..()
next_location = get_location_waypoint(!location)