Files
Aurora.3/code/modules/shuttles/shuttle_ferry.dm
Matt Atlas 2e5fdf970c Landmark Shuttles (#8512)
The lifeless live again. Or in this case, what never actually lived here.

Ports Baystation12/Baystation12#17460 probably for real this time. What this allows us to do is create shuttles on runtime and make shuttles easier by just making landmarks and a shuttle instead of areas and shuttles. Also allows runtime landmark creation via flares or whatever AND allows shuttles to use different landmarks at will.

I removed most of the overmap stuff, I think. It shouldn't be hard to slam it in whenever we need to.

Changes:

    "Shuttle code has been completely reworked."
    "Shuttles can now be modified to have more than one destination."
    "Shuttles now have a takeoff sound."
    "You can now throw mobs against walls to damage them. A lot."
    "You now need a neckgrab to throw mobs."
    "BEING UNBUCKLED DURING SHUTTLE LAUNCH IS DANGEROUS! Don't do it."
    "Adminghosts can now interact with all shuttles."
2020-04-05 21:15:31 +03:00

48 lines
1.6 KiB
Plaintext

/datum/shuttle/autodock/ferry
var/location = 0 //0 = at area_station, 1 = at area_offsite
var/direction = 0 //0 = going to station, 1 = going to offsite.
var/obj/effect/shuttle_landmark/waypoint_station //This variable is type-abused initially: specify the landmark_tag, not the actual landmark.
var/obj/effect/shuttle_landmark/waypoint_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(_name)
if(waypoint_station)
waypoint_station = SSshuttle.get_landmark(waypoint_station)
if(waypoint_offsite)
waypoint_offsite = SSshuttle.get_landmark(waypoint_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)
return waypoint_station
return waypoint_offsite
/datum/shuttle/autodock/ferry/short_jump(var/destination)
direction = !location
..()
/datum/shuttle/autodock/ferry/long_jump(var/obj/effect/shuttle_landmark/destination, var/obj/effect/shuttle_landmark/interim, var/travel_time)
direction = !location
..()
/datum/shuttle/autodock/ferry/shuttle_moved()
..()
if (next_location == waypoint_station) location = 0
if (next_location == waypoint_offsite) location = 1
/datum/shuttle/autodock/ferry/process_arrived()
..()
next_location = get_location_waypoint(!location)