module things, jfc
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
callTime = INFINITY
|
||||
ignitionTime = 50
|
||||
|
||||
movement_force = list("KNOCKDOWN" = 3, "THROW" = 0)
|
||||
|
||||
var/sound_played
|
||||
var/damaged //too damaged to undock?
|
||||
var/list/areas //areas in our shuttle
|
||||
@@ -18,6 +20,7 @@
|
||||
var/obj/machinery/requests_console/console
|
||||
var/force_depart = FALSE
|
||||
var/perma_docked = FALSE //highlander with RESPAWN??? OH GOD!!!
|
||||
var/obj/docking_port/stationary/target_dock // for badminry
|
||||
|
||||
/obj/docking_port/mobile/arrivals/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -175,7 +178,10 @@
|
||||
if(mode == SHUTTLE_IDLE)
|
||||
if(console)
|
||||
console.say(pickingup ? "Departing immediately for new employee pickup." : "Shuttle departing.")
|
||||
request(SSshuttle.getDock("arrivals_stationary")) //we will intentionally never return SHUTTLE_ALREADY_DOCKED
|
||||
var/obj/docking_port/stationary/target = target_dock
|
||||
if(QDELETED(target))
|
||||
target = SSshuttle.getDock("arrivals_stationary")
|
||||
request(target) //we will intentionally never return SHUTTLE_ALREADY_DOCKED
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/RequireUndocked(mob/user)
|
||||
if(mode == SHUTTLE_CALL || damaged)
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
/obj/docking_port/mobile/assault_pod
|
||||
name = "assault pod"
|
||||
id = "steel_rain"
|
||||
timid = FALSE
|
||||
dwidth = 3
|
||||
width = 7
|
||||
height = 7
|
||||
|
||||
/obj/docking_port/mobile/assault_pod/request()
|
||||
/obj/docking_port/mobile/assault_pod/request(obj/docking_port/stationary/S)
|
||||
if(!(z in SSmapping.levels_by_trait(ZTRAIT_STATION))) //No launching pods that have already launched
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -69,3 +69,6 @@
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You fried the consoles ID checking system.</span>")
|
||||
|
||||
/obj/machinery/computer/shuttle/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
@@ -1,4 +1,4 @@
|
||||
//this is the main proc. It instantly moves our mobile port to stationary port new_dock
|
||||
/// This is the main proc. It instantly moves our mobile port to stationary port `new_dock`.
|
||||
/obj/docking_port/mobile/proc/initiate_docking(obj/docking_port/stationary/new_dock, movement_direction, force=FALSE)
|
||||
// Crashing this ship with NO SURVIVORS
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
if(!force)
|
||||
if(!check_dock(new_dock))
|
||||
remove_ripples()
|
||||
return DOCKING_BLOCKED
|
||||
if(!canMove())
|
||||
remove_ripples()
|
||||
return DOCKING_IMMOBILIZED
|
||||
|
||||
var/obj/docking_port/stationary/old_dock = get_docked()
|
||||
@@ -32,12 +34,7 @@
|
||||
|
||||
// The underlying old area is the area assumed to be under the shuttle's starting location
|
||||
// If it no longer/has never existed it will be created
|
||||
var/area/underlying_old_area
|
||||
for(var/i in GLOB.sortedAreas) // Locate grabs subtypes and we want a particular type
|
||||
var/area/place = i
|
||||
if(place.type == underlying_area_type)
|
||||
underlying_old_area = place
|
||||
break
|
||||
var/area/underlying_old_area = GLOB.areas_by_type[underlying_area_type]
|
||||
if(!underlying_old_area)
|
||||
underlying_old_area = new underlying_area_type(null)
|
||||
|
||||
@@ -54,10 +51,9 @@
|
||||
var/list/moved_atoms = list() //Everything not a turf that gets moved in the shuttle
|
||||
var/list/areas_to_move = list() //unique assoc list of areas on turfs being moved
|
||||
|
||||
remove_ripples()
|
||||
|
||||
. = preflight_check(old_turfs, new_turfs, areas_to_move, rotation)
|
||||
if(.)
|
||||
remove_ripples()
|
||||
return
|
||||
|
||||
/*******************************************Hiding turfs if necessary*******************************************/
|
||||
@@ -75,10 +71,15 @@
|
||||
|
||||
if(!force)
|
||||
if(!check_dock(new_dock))
|
||||
remove_ripples()
|
||||
return DOCKING_BLOCKED
|
||||
if(!canMove())
|
||||
remove_ripples()
|
||||
return DOCKING_IMMOBILIZED
|
||||
|
||||
// Moving to the new location will trample the ripples there at the exact
|
||||
// same time any mobs there are trampled, to avoid any discrepancy where
|
||||
// the ripples go away before it is safe.
|
||||
takeoff(old_turfs, new_turfs, moved_atoms, rotation, movement_direction, old_dock, underlying_old_area)
|
||||
|
||||
CHECK_TICK
|
||||
@@ -97,6 +98,8 @@
|
||||
new_dock.last_dock_time = world.time
|
||||
setDir(new_dock.dir)
|
||||
|
||||
// remove any stragglers just in case, and clear the list
|
||||
remove_ripples()
|
||||
return DOCKING_SUCCESS
|
||||
|
||||
/obj/docking_port/mobile/proc/preflight_check(list/old_turfs, list/new_turfs, list/areas_to_move, rotation)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/obj/docking_port/mobile/elevator
|
||||
name = "elevator"
|
||||
id = "elevator"
|
||||
timid = FALSE
|
||||
dwidth = 3
|
||||
width = 7
|
||||
height = 7
|
||||
movement_force = list("KNOCKDOWN" = 0, "THROW" = 0)
|
||||
|
||||
/obj/docking_port/mobile/elevator/request(obj/docking_port/stationary/S) //No transit, no ignition, just a simple up/down platform
|
||||
initiate_docking(S, TRUE)
|
||||
initiate_docking(S, force=TRUE)
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
|
||||
/obj/docking_port/mobile/emergency/proc/is_hijacked()
|
||||
var/has_people = FALSE
|
||||
|
||||
var/hijacker_present = FALSE
|
||||
for(var/mob/living/player in GLOB.player_list)
|
||||
if(player.mind)
|
||||
if(player.stat != DEAD)
|
||||
@@ -258,10 +258,23 @@
|
||||
if(shuttle_areas[get_area(player)])
|
||||
has_people = TRUE
|
||||
var/location = get_turf(player.mind.current)
|
||||
if(!(player.mind.has_antag_datum(/datum/antagonist)) && !istype(location, /turf/open/floor/plasteel/shuttle/red) && !istype(location, /turf/open/floor/mineral/plastitanium/brig))
|
||||
//Non-antag present. Can't hijack.
|
||||
if(!(player.mind.has_antag_datum(/datum/antagonist)) && !istype(location, /turf/open/floor/plasteel/shuttle/red) && !istype(location, /turf/open/floor/mineral/plastitanium/red/brig))
|
||||
return FALSE
|
||||
//Antag present, doesn't stop but let's see if we actually want to hijack
|
||||
var/prevent = FALSE
|
||||
for(var/datum/antagonist/A in player.mind.antag_datums)
|
||||
if(A.can_hijack == HIJACK_HIJACKER)
|
||||
hijacker_present = TRUE
|
||||
prevent = FALSE
|
||||
break //If we have both prevent and hijacker antags assume we want to hijack.
|
||||
else if(A.can_hijack == HIJACK_PREVENT)
|
||||
prevent = TRUE
|
||||
if(prevent)
|
||||
return FALSE
|
||||
|
||||
return has_people
|
||||
|
||||
return has_people && hijacker_present
|
||||
|
||||
/obj/docking_port/mobile/emergency/proc/ShuttleDBStuff()
|
||||
set waitfor = FALSE
|
||||
@@ -409,17 +422,16 @@
|
||||
/obj/docking_port/mobile/pod
|
||||
name = "escape pod"
|
||||
id = "pod"
|
||||
timid = FALSE
|
||||
dwidth = 1
|
||||
width = 3
|
||||
height = 4
|
||||
launch_status = UNLAUNCHED
|
||||
|
||||
/obj/docking_port/mobile/pod/request()
|
||||
var/obj/machinery/computer/shuttle/S = getControlConsole()
|
||||
if(!istype(S, /obj/machinery/computer/shuttle/pod))
|
||||
/obj/docking_port/mobile/pod/request(obj/docking_port/stationary/S)
|
||||
var/obj/machinery/computer/shuttle/C = getControlConsole()
|
||||
if(!istype(C, /obj/machinery/computer/shuttle/pod))
|
||||
return ..()
|
||||
if(GLOB.security_level >= SEC_LEVEL_RED || (S && (S.obj_flags & EMAGGED)))
|
||||
if(GLOB.security_level >= SEC_LEVEL_RED || (C && (C.obj_flags & EMAGGED)))
|
||||
if(launch_status == UNLAUNCHED)
|
||||
launch_status = EARLY_LAUNCHED
|
||||
return ..()
|
||||
@@ -427,33 +439,12 @@
|
||||
to_chat(usr, "<span class='warning'>Escape pods will only launch during \"Code Red\" security alert.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/docking_port/mobile/pod/Initialize()
|
||||
. = ..()
|
||||
var/static/i = 1
|
||||
if(id == initial(id))
|
||||
id = "[initial(id)][i]"
|
||||
if(name == initial(name))
|
||||
name = "[initial(name)] [i]"
|
||||
|
||||
for(var/k in shuttle_areas)
|
||||
var/area/place = k
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod_comp in place)
|
||||
if(pod_comp.shuttleId == initial(pod_comp.shuttleId))
|
||||
pod_comp.shuttleId = id
|
||||
if(pod_comp.possible_destinations == initial(pod_comp.possible_destinations))
|
||||
pod_comp.possible_destinations = "pod_lavaland[i]"
|
||||
|
||||
i++
|
||||
|
||||
|
||||
|
||||
/obj/docking_port/mobile/pod/cancel()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle/pod
|
||||
name = "pod control computer"
|
||||
admin_controlled = 1
|
||||
shuttleId = "pod"
|
||||
possible_destinations = "pod_asteroid"
|
||||
icon = 'icons/obj/terminals.dmi'
|
||||
icon_state = "dorm_available"
|
||||
@@ -470,6 +461,11 @@
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='warning'>You fry the pod's alert level checking system.</span>")
|
||||
|
||||
/obj/machinery/computer/shuttle/pod/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
. = ..()
|
||||
if(possible_destinations == initial(possible_destinations) || override)
|
||||
possible_destinations = "pod_lavaland[idnum]"
|
||||
|
||||
/obj/docking_port/stationary/random
|
||||
name = "escape pod"
|
||||
id = "pod"
|
||||
@@ -575,6 +571,10 @@
|
||||
SSshuttle.emergency = current_emergency
|
||||
SSshuttle.backup_shuttle = src
|
||||
|
||||
/obj/docking_port/mobile/emergency/shuttle_build/register()
|
||||
. = ..()
|
||||
initiate_docking(SSshuttle.getDock("emergency_home"))
|
||||
|
||||
#undef TIME_LEFT
|
||||
#undef ENGINES_START_TIME
|
||||
#undef ENGINES_STARTED
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
add_overlay(hologram_projection)
|
||||
add_overlay(hologram_ship)
|
||||
|
||||
/obj/machinery/shuttle_manipulator/can_interact(mob/user)
|
||||
// Only admins can use this, but they can use it from anywhere
|
||||
return user.client && check_rights_for(user.client, R_ADMIN)
|
||||
|
||||
/obj/machinery/shuttle_manipulator/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
@@ -107,17 +111,23 @@
|
||||
data["shuttles"] = list()
|
||||
for(var/i in SSshuttle.mobile)
|
||||
var/obj/docking_port/mobile/M = i
|
||||
var/timeleft = M.timeLeft(1)
|
||||
var/list/L = list()
|
||||
L["name"] = M.name
|
||||
L["id"] = M.id
|
||||
L["timer"] = M.timer
|
||||
L["timeleft"] = M.getTimerStr()
|
||||
var/can_fast_travel = FALSE
|
||||
if(M.timer && M.timeLeft() >= 50)
|
||||
can_fast_travel = TRUE
|
||||
L["can_fast_travel"] = can_fast_travel
|
||||
L["mode"] = capitalize(shuttlemode2str(M.mode))
|
||||
L["status"] = M.getStatusText()
|
||||
if (timeleft > 1 HOURS)
|
||||
L["timeleft"] = "Infinity"
|
||||
L["can_fast_travel"] = M.timer && timeleft >= 50
|
||||
L["can_fly"] = TRUE
|
||||
if(istype(M, /obj/docking_port/mobile/emergency))
|
||||
L["can_fly"] = FALSE
|
||||
else if(!M.destination)
|
||||
L["can_fast_travel"] = FALSE
|
||||
if (M.mode != SHUTTLE_IDLE)
|
||||
L["mode"] = capitalize(shuttlemode2str(M.mode))
|
||||
L["status"] = M.getDbgStatusText()
|
||||
if(M == existing_shuttle)
|
||||
data["existing_shuttle"] = L
|
||||
|
||||
@@ -149,10 +159,19 @@
|
||||
user.forceMove(get_turf(M))
|
||||
. = TRUE
|
||||
break
|
||||
|
||||
if("fly")
|
||||
for(var/i in SSshuttle.mobile)
|
||||
var/obj/docking_port/mobile/M = i
|
||||
if(M.id == params["id"])
|
||||
. = TRUE
|
||||
M.admin_fly_shuttle(user)
|
||||
break
|
||||
|
||||
if("fast_travel")
|
||||
for(var/i in SSshuttle.mobile)
|
||||
var/obj/docking_port/mobile/M = i
|
||||
if(M.id == params["id"] && M.timer && M.timeLeft() >= 50)
|
||||
if(M.id == params["id"] && M.timer && M.timeLeft(1) >= 50)
|
||||
M.setTimer(50)
|
||||
. = TRUE
|
||||
message_admins("[key_name_admin(usr)] fast travelled [M]")
|
||||
@@ -194,7 +213,8 @@
|
||||
preview_template = null
|
||||
|
||||
if(!preview_shuttle)
|
||||
load_template(loading_template)
|
||||
if(load_template(loading_template))
|
||||
preview_shuttle.linkup(loading_template, destination_port)
|
||||
preview_template = loading_template
|
||||
|
||||
// get the existing shuttle information, if any
|
||||
@@ -210,8 +230,7 @@
|
||||
D = existing_shuttle.get_docked()
|
||||
|
||||
if(!D)
|
||||
var/m = "No dock found for preview shuttle ([preview_template.name]), aborting."
|
||||
throw EXCEPTION(m)
|
||||
CRASH("No dock found for preview shuttle ([preview_template.name]), aborting.")
|
||||
|
||||
var/result = preview_shuttle.canDock(D)
|
||||
// truthy value means that it cannot dock for some reason
|
||||
@@ -228,7 +247,7 @@
|
||||
preview_shuttle.movement_force = list("KNOCKDOWN" = 0, "THROW" = 0)
|
||||
preview_shuttle.initiate_docking(D)
|
||||
preview_shuttle.movement_force = force_memory
|
||||
|
||||
|
||||
. = preview_shuttle
|
||||
|
||||
// Shuttle state involves a mode and a timer based on world.time, so
|
||||
@@ -245,11 +264,11 @@
|
||||
existing_shuttle = null
|
||||
selected = null
|
||||
|
||||
/obj/machinery/shuttle_manipulator/proc/load_template(
|
||||
datum/map_template/shuttle/S)
|
||||
/obj/machinery/shuttle_manipulator/proc/load_template(datum/map_template/shuttle/S)
|
||||
. = FALSE
|
||||
// load shuttle template, centred at shuttle import landmark,
|
||||
var/turf/landmark_turf = get_turf(locate(/obj/effect/landmark/shuttle_import) in GLOB.landmarks_list)
|
||||
S.load(landmark_turf, centered = TRUE)
|
||||
S.load(landmark_turf, centered = TRUE, register = FALSE)
|
||||
|
||||
var/affected = S.get_affected_turfs(landmark_turf, centered=TRUE)
|
||||
|
||||
@@ -262,18 +281,10 @@
|
||||
for(var/T in affected)
|
||||
for(var/obj/docking_port/P in T)
|
||||
if(istype(P, /obj/docking_port/mobile))
|
||||
var/obj/docking_port/mobile/M = P
|
||||
found++
|
||||
if(found > 1)
|
||||
qdel(P, force=TRUE)
|
||||
log_world("Map warning: Shuttle Template [S.mappath] has multiple mobile docking ports.")
|
||||
else if(!M.timid)
|
||||
// The shuttle template we loaded isn't "timid" which means
|
||||
// it's already registered with the shuttles subsystem.
|
||||
// This is a bad thing.
|
||||
stack_trace("Template [S] is non-timid! Unloading.")
|
||||
M.jumpToNullSpace()
|
||||
return
|
||||
else
|
||||
preview_shuttle = P
|
||||
if(istype(P, /obj/docking_port/stationary))
|
||||
@@ -289,8 +300,74 @@
|
||||
return
|
||||
//Everything fine
|
||||
S.on_bought()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/shuttle_manipulator/proc/unload_preview()
|
||||
if(preview_shuttle)
|
||||
preview_shuttle.jumpToNullSpace()
|
||||
preview_shuttle = null
|
||||
|
||||
/obj/docking_port/mobile/proc/admin_fly_shuttle(mob/user)
|
||||
var/list/options = list()
|
||||
|
||||
for(var/port in SSshuttle.stationary)
|
||||
if (istype(port, /obj/docking_port/stationary/transit))
|
||||
continue // please don't do this
|
||||
var/obj/docking_port/stationary/S = port
|
||||
if (canDock(S) == SHUTTLE_CAN_DOCK)
|
||||
options[S.name || S.id] = S
|
||||
|
||||
options += "--------"
|
||||
options += "Infinite Transit"
|
||||
options += "Delete Shuttle"
|
||||
options += "Into The Sunset (delete & greentext 'escape')"
|
||||
|
||||
var/selection = input(user, "Select where to fly [name || id]:", "Fly Shuttle") as null|anything in options
|
||||
if(!selection)
|
||||
return
|
||||
|
||||
switch(selection)
|
||||
if("Infinite Transit")
|
||||
destination = null
|
||||
mode = SHUTTLE_IGNITING
|
||||
setTimer(ignitionTime)
|
||||
|
||||
if("Delete Shuttle")
|
||||
if(alert(user, "Really delete [name || id]?", "Delete Shuttle", "Cancel", "Really!") != "Really!")
|
||||
return
|
||||
jumpToNullSpace()
|
||||
|
||||
if("Into The Sunset (delete & greentext 'escape')")
|
||||
if(alert(user, "Really delete [name || id] and greentext escape objectives?", "Delete Shuttle", "Cancel", "Really!") != "Really!")
|
||||
return
|
||||
intoTheSunset()
|
||||
|
||||
else
|
||||
if(options[selection])
|
||||
request(options[selection])
|
||||
|
||||
/obj/docking_port/mobile/emergency/admin_fly_shuttle(mob/user)
|
||||
return // use the existing verbs for this
|
||||
|
||||
/obj/docking_port/mobile/arrivals/admin_fly_shuttle(mob/user)
|
||||
switch(alert(user, "Would you like to fly the arrivals shuttle once or change its destination?", "Fly Shuttle", "Fly", "Retarget", "Cancel"))
|
||||
if("Cancel")
|
||||
return
|
||||
if("Fly")
|
||||
return ..()
|
||||
|
||||
var/list/options = list()
|
||||
|
||||
for(var/port in SSshuttle.stationary)
|
||||
if (istype(port, /obj/docking_port/stationary/transit))
|
||||
continue // please don't do this
|
||||
var/obj/docking_port/stationary/S = port
|
||||
if (canDock(S) == SHUTTLE_CAN_DOCK)
|
||||
options[S.name || S.id] = S
|
||||
|
||||
var/selection = input(user, "Select the new arrivals destination:", "Fly Shuttle") as null|anything in options
|
||||
if(!selection)
|
||||
return
|
||||
target_dock = options[selection]
|
||||
if(!QDELETED(target_dock))
|
||||
destination = target_dock
|
||||
|
||||
@@ -57,10 +57,9 @@
|
||||
shuttle_port = null
|
||||
return
|
||||
|
||||
eyeobj = new /mob/camera/aiEye/remote/shuttle_docker()
|
||||
eyeobj = new /mob/camera/aiEye/remote/shuttle_docker(null, src)
|
||||
var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj
|
||||
the_eye.origin = src
|
||||
the_eye.dir = shuttle_port.dir
|
||||
the_eye.setDir(shuttle_port.dir)
|
||||
var/turf/origin = locate(shuttle_port.x + x_offset, shuttle_port.y + y_offset, shuttle_port.z)
|
||||
for(var/V in shuttle_port.shuttle_areas)
|
||||
var/area/A = V
|
||||
@@ -73,7 +72,7 @@
|
||||
I.loc = locate(origin.x + x_off, origin.y + y_off, origin.z) //we have to set this after creating the image because it might be null, and images created in nullspace are immutable.
|
||||
I.layer = ABOVE_NORMAL_TURF_LAYER
|
||||
I.plane = 0
|
||||
I.mouse_opacity = 0
|
||||
I.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
the_eye.placement_images[I] = list(x_off, y_off)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/give_eye_control(mob/user)
|
||||
@@ -137,7 +136,7 @@
|
||||
my_port.dheight = shuttle_port.dheight
|
||||
my_port.dwidth = shuttle_port.dwidth
|
||||
my_port.hidden = shuttle_port.hidden
|
||||
my_port.dir = the_eye.dir
|
||||
my_port.setDir(the_eye.dir)
|
||||
my_port.forceMove(locate(eyeobj.x - x_offset, eyeobj.y - y_offset, eyeobj.z))
|
||||
if(current_user.client)
|
||||
current_user.client.images -= the_eye.placed_images
|
||||
@@ -166,7 +165,7 @@
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/rotateLandingSpot()
|
||||
var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj
|
||||
var/list/image_cache = the_eye.placement_images
|
||||
the_eye.dir = turn(the_eye.dir, -90)
|
||||
the_eye.setDir(turn(the_eye.dir, -90))
|
||||
for(var/i in 1 to image_cache.len)
|
||||
var/image/pic = image_cache[i]
|
||||
var/list/coords = image_cache[pic]
|
||||
@@ -247,12 +246,23 @@
|
||||
current_user.client.images -= remove_images
|
||||
current_user.client.images += add_images
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
shuttlePortId = "[port.id]_custom"
|
||||
if(dock)
|
||||
jumpto_ports += dock.id
|
||||
|
||||
/mob/camera/aiEye/remote/shuttle_docker
|
||||
visible_icon = FALSE
|
||||
use_static = FALSE
|
||||
use_static = USE_STATIC_NONE
|
||||
var/list/placement_images = list()
|
||||
var/list/placed_images = list()
|
||||
|
||||
/mob/camera/aiEye/remote/shuttle_docker/Initialize(mapload, obj/machinery/computer/camera_advanced/origin)
|
||||
src.origin = origin
|
||||
return ..()
|
||||
|
||||
/mob/camera/aiEye/remote/shuttle_docker/setLoc(T)
|
||||
..()
|
||||
var/obj/machinery/computer/camera_advanced/shuttle_docker/console = origin
|
||||
|
||||
@@ -183,10 +183,12 @@ All ShuttleMove procs go here
|
||||
|
||||
/obj/machinery/door/airlock/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/current_area = get_area(src)
|
||||
for(var/obj/machinery/door/airlock/A in orange(1, src)) // does not include src
|
||||
// Cycle linking is only disabled if we are actually adjacent to another airlock
|
||||
shuttledocked = TRUE
|
||||
A.shuttledocked = TRUE
|
||||
if(get_area(A) != current_area) // does not include double-wide airlocks unless actually docked
|
||||
// Cycle linking is only disabled if we are actually adjacent to another airlock
|
||||
shuttledocked = TRUE
|
||||
A.shuttledocked = TRUE
|
||||
|
||||
/obj/machinery/camera/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock)
|
||||
. = ..()
|
||||
|
||||
@@ -253,11 +253,6 @@
|
||||
|
||||
var/list/movement_force = list("KNOCKDOWN" = 3, "THROW" = 2)
|
||||
|
||||
// A timid shuttle will not register itself with the shuttle subsystem
|
||||
// All shuttle templates MUST be timid, imports will fail if they're not
|
||||
// Shuttle defined already on the map MUST NOT be timid, or they won't work
|
||||
var/timid = TRUE
|
||||
|
||||
var/list/ripples = list()
|
||||
var/engine_coeff = 1 //current engine coeff
|
||||
var/current_engines = 0 //current engine power
|
||||
@@ -280,8 +275,6 @@
|
||||
|
||||
/obj/docking_port/mobile/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!timid)
|
||||
register()
|
||||
|
||||
if(!id)
|
||||
id = "[SSshuttle.mobile.len]"
|
||||
@@ -303,6 +296,25 @@
|
||||
highlight("#0f0")
|
||||
#endif
|
||||
|
||||
// Called after the shuttle is loaded from template
|
||||
/obj/docking_port/mobile/proc/linkup(datum/map_template/shuttle/template, obj/docking_port/stationary/dock)
|
||||
var/list/static/shuttle_id = list()
|
||||
var/idnum = ++shuttle_id[template]
|
||||
if(idnum > 1)
|
||||
if(id == initial(id))
|
||||
id = "[id][idnum]"
|
||||
if(name == initial(name))
|
||||
name = "[name] [idnum]"
|
||||
for(var/i in shuttle_areas)
|
||||
var/area/place = i
|
||||
for(var/obj/machinery/computer/shuttle/comp in place)
|
||||
comp.connect_to_shuttle(src, dock, idnum)
|
||||
for(var/obj/machinery/computer/camera_advanced/shuttle_docker/comp in place)
|
||||
comp.connect_to_shuttle(src, dock, idnum)
|
||||
for(var/obj/machinery/status_display/shuttle/sd in place)
|
||||
sd.connect_to_shuttle(src, dock, idnum)
|
||||
|
||||
|
||||
//this is a hook for custom behaviour. Maybe at some point we could add checks to see if engines are intact
|
||||
/obj/docking_port/mobile/proc/canMove()
|
||||
return TRUE
|
||||
@@ -399,8 +411,9 @@
|
||||
mode = SHUTTLE_IDLE
|
||||
return
|
||||
previous = null
|
||||
// if(!destination)
|
||||
// return
|
||||
if(!destination)
|
||||
// sent to transit with no destination -> unlimited timer
|
||||
timer = INFINITY
|
||||
var/obj/docking_port/stationary/S0 = get_docked()
|
||||
var/obj/docking_port/stationary/S1 = assigned_transit
|
||||
if(S1)
|
||||
@@ -425,12 +438,7 @@
|
||||
|
||||
var/list/old_turfs = return_ordered_turfs(x, y, z, dir)
|
||||
|
||||
var/area/underlying_area
|
||||
for(var/i in GLOB.sortedAreas)
|
||||
var/area/place = i
|
||||
if(place.type == underlying_area_type)
|
||||
underlying_area = place
|
||||
break
|
||||
var/area/underlying_area = GLOB.areas_by_type[underlying_area_type]
|
||||
if(!underlying_area)
|
||||
underlying_area = new underlying_area_type(null)
|
||||
|
||||
@@ -452,6 +460,22 @@
|
||||
|
||||
qdel(src, force=TRUE)
|
||||
|
||||
/obj/docking_port/mobile/proc/intoTheSunset()
|
||||
// Loop over mobs
|
||||
for(var/t in return_turfs())
|
||||
var/turf/T = t
|
||||
for(var/mob/living/M in T.GetAllContents())
|
||||
// If they have a mind and they're not in the brig, they escaped
|
||||
if(M.mind && !istype(t, /turf/open/floor/plasteel/shuttle/red) && !istype(t, /turf/open/floor/mineral/plastitanium/red/brig))
|
||||
M.mind.force_escaped = TRUE
|
||||
// Ghostize them and put them in nullspace stasis (for stat & possession checks)
|
||||
M.notransform = TRUE
|
||||
M.ghostize(FALSE)
|
||||
M.moveToNullspace()
|
||||
|
||||
// Now that mobs are stowed, delete the shuttle
|
||||
jumpToNullSpace()
|
||||
|
||||
/obj/docking_port/mobile/proc/create_ripples(obj/docking_port/stationary/S1, animate_time)
|
||||
var/list/turfs = ripple_area(S1)
|
||||
for(var/t in turfs)
|
||||
@@ -630,7 +654,9 @@
|
||||
return "--:--"
|
||||
|
||||
var/timeleft = timeLeft()
|
||||
if(timeleft > 0)
|
||||
if(timeleft > 1 HOURS)
|
||||
return "--:--"
|
||||
else if(timeleft > 0)
|
||||
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
|
||||
else
|
||||
return "00:00"
|
||||
@@ -638,6 +664,23 @@
|
||||
|
||||
/obj/docking_port/mobile/proc/getStatusText()
|
||||
var/obj/docking_port/stationary/dockedAt = get_docked()
|
||||
|
||||
if(istype(dockedAt, /obj/docking_port/stationary/transit))
|
||||
if (timeLeft() > 1 HOURS)
|
||||
return "hyperspace"
|
||||
else
|
||||
var/obj/docking_port/stationary/dst
|
||||
if(mode == SHUTTLE_RECALL)
|
||||
dst = previous
|
||||
else
|
||||
dst = destination
|
||||
. = "transit towards [dst?.name || "unknown location"] ([getTimerStr()])"
|
||||
else
|
||||
return dockedAt?.name || "unknown"
|
||||
|
||||
|
||||
/obj/docking_port/mobile/proc/getDbgStatusText()
|
||||
var/obj/docking_port/stationary/dockedAt = get_docked()
|
||||
. = (dockedAt && dockedAt.name) ? dockedAt.name : "unknown"
|
||||
if(istype(dockedAt, /obj/docking_port/stationary/transit))
|
||||
var/obj/docking_port/stationary/dst
|
||||
@@ -645,7 +688,14 @@
|
||||
dst = previous
|
||||
else
|
||||
dst = destination
|
||||
. += " towards [dst ? dst.name : "unknown location"] ([timeLeft(600)] minutes)"
|
||||
if(dst)
|
||||
. = "(transit to) [dst.name || dst.id]"
|
||||
else
|
||||
. = "(transit to) nowhere"
|
||||
else if(dockedAt)
|
||||
. = dockedAt.name || dockedAt.id
|
||||
else
|
||||
. = "unknown"
|
||||
|
||||
|
||||
// attempts to locate /obj/machinery/computer/shuttle with matching ID inside the shuttle
|
||||
|
||||
@@ -106,11 +106,13 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
|
||||
/obj/machinery/door/airlock/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
if(cyclelinkeddir)
|
||||
if(cyclelinkeddir && (params & ROTATE_DIR))
|
||||
cyclelinkeddir = angle2dir(rotation+dir2angle(cyclelinkeddir))
|
||||
cyclelinkairlock()
|
||||
// If we update the linked airlock here, the partner airlock might
|
||||
// not be present yet, so don't do that. Just assume we're still
|
||||
// partnered with the same airlock as before.
|
||||
|
||||
/obj/machinery/porta_turret/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
if(wall_turret_direction && (params & ROTATE_DIR))
|
||||
wall_turret_direction = turn(wall_turret_direction,rotation)
|
||||
wall_turret_direction = turn(wall_turret_direction,rotation)
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
|
||||
#define LUXURY_MESSAGE_COOLDOWN 100
|
||||
/obj/effect/forcefield/luxury_shuttle/CollidedWith(atom/movable/AM)
|
||||
/obj/effect/forcefield/luxury_shuttle/Bumped(atom/movable/AM)
|
||||
if(!isliving(AM))
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
/obj/item/disk/nuclear,
|
||||
/obj/machinery/nuclearbomb,
|
||||
/obj/item/beacon,
|
||||
/obj/singularity,
|
||||
/obj/singularity/narsie,
|
||||
/obj/singularity/wizard,
|
||||
/obj/machinery/teleport/station,
|
||||
/obj/machinery/teleport/hub,
|
||||
/obj/machinery/quantumpad,
|
||||
@@ -22,7 +23,8 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
/obj/item/projectile/beam/wormhole,
|
||||
/obj/effect/portal,
|
||||
/obj/item/shared_storage,
|
||||
/obj/structure/extraction_point
|
||||
/obj/structure/extraction_point,
|
||||
/obj/machinery/syndicatebomb
|
||||
)))
|
||||
|
||||
/obj/docking_port/mobile/supply
|
||||
@@ -37,9 +39,9 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
height = 7
|
||||
movement_force = list("KNOCKDOWN" = 0, "THROW" = 0)
|
||||
|
||||
// When TRUE, these vars allow exporting emagged/contraband items, and add some special interactions to existing exports.
|
||||
var/contraband = FALSE
|
||||
var/emagged = FALSE
|
||||
|
||||
//Export categories for this run, this is set by console sending the shuttle.
|
||||
var/export_categories = EXPORT_CARGO
|
||||
|
||||
/obj/docking_port/mobile/supply/register()
|
||||
. = ..()
|
||||
@@ -60,7 +62,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/docking_port/mobile/supply/request()
|
||||
/obj/docking_port/mobile/supply/request(obj/docking_port/stationary/S)
|
||||
if(mode != SHUTTLE_IDLE)
|
||||
return 2
|
||||
return ..()
|
||||
@@ -116,7 +118,8 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
|
||||
var/msg = ""
|
||||
var/matched_bounty = FALSE
|
||||
var/sold_atoms = ""
|
||||
|
||||
var/datum/export_report/ex = new
|
||||
|
||||
for(var/place in shuttle_areas)
|
||||
var/area/shuttle/shuttle_area = place
|
||||
@@ -126,23 +129,21 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
|
||||
if(bounty_ship_item_and_contents(AM, dry_run = FALSE))
|
||||
matched_bounty = TRUE
|
||||
if(!AM.anchored || istype(AM, /obj/mecha))
|
||||
sold_atoms += export_item_and_contents(AM, contraband, emagged, dry_run = FALSE)
|
||||
export_item_and_contents(AM, export_categories , dry_run = FALSE, external_report = ex)
|
||||
|
||||
if(sold_atoms)
|
||||
sold_atoms += "."
|
||||
if(ex.exported_atoms)
|
||||
ex.exported_atoms += "." //ugh
|
||||
|
||||
if(matched_bounty)
|
||||
msg += "Bounty items received. An update has been sent to all bounty consoles. "
|
||||
|
||||
for(var/a in GLOB.exports_list)
|
||||
var/datum/export/E = a
|
||||
var/export_text = E.total_printout()
|
||||
for(var/datum/export/E in ex.total_amount)
|
||||
var/export_text = E.total_printout(ex)
|
||||
if(!export_text)
|
||||
continue
|
||||
|
||||
msg += export_text + "\n"
|
||||
SSshuttle.points += E.total_cost
|
||||
E.export_end()
|
||||
SSshuttle.points += ex.total_value[E]
|
||||
|
||||
SSshuttle.centcom_message = msg
|
||||
investigate_log("Shuttle contents sold for [SSshuttle.points - presale_points] credits. Contents: [sold_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO)
|
||||
investigate_log("Shuttle contents sold for [SSshuttle.points - presale_points] credits. Contents: [ex.exported_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO)
|
||||
|
||||
@@ -5,11 +5,24 @@
|
||||
shuttleId = "whiteship"
|
||||
possible_destinations = "whiteship_away;whiteship_home;whiteship_z4;whiteship_lavaland;whiteship_custom"
|
||||
|
||||
/obj/machinery/computer/shuttle/white_ship/pod
|
||||
name = "Salvage Pod Console"
|
||||
desc = "Used to control the Salvage Pod."
|
||||
circuit = /obj/item/circuitboard/computer/white_ship/pod
|
||||
shuttleId = "whiteship_pod"
|
||||
possible_destinations = "whiteship_pod_home;whiteship_pod_custom"
|
||||
|
||||
/obj/machinery/computer/shuttle/white_ship/pod/recall
|
||||
name = "Salvage Pod Recall Console"
|
||||
desc = "Used to recall the Salvage Pod."
|
||||
circuit = /obj/item/circuitboard/computer/white_ship/pod/recall
|
||||
possible_destinations = "whiteship_pod_home"
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship
|
||||
name = "White Ship Navigation Computer"
|
||||
desc = "Used to designate a precise transit location for the White Ship."
|
||||
shuttleId = "whiteship"
|
||||
lock_override = CAMERA_LOCK_STATION
|
||||
lock_override = NONE
|
||||
shuttlePortId = "whiteship_custom"
|
||||
shuttlePortName = "Custom Location"
|
||||
jumpto_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1)
|
||||
@@ -18,6 +31,18 @@
|
||||
y_offset = -10
|
||||
designate_time = 100
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship/pod
|
||||
name = "Salvage Pod Navigation Computer"
|
||||
desc = "Used to designate a precise transit location for the Salvage Pod."
|
||||
shuttleId = "whiteship_pod"
|
||||
shuttlePortId = "whiteship_pod_custom"
|
||||
shuttlePortName = "Custom Location"
|
||||
jumpto_ports = list("whiteship_pod_home" = 1)
|
||||
view_range = 7
|
||||
x_offset = -2
|
||||
y_offset = 0
|
||||
designate_time = 0
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship/Initialize()
|
||||
. = ..()
|
||||
GLOB.jam_on_wardec += src
|
||||
@@ -25,3 +50,9 @@
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship/Destroy()
|
||||
GLOB.jam_on_wardec -= src
|
||||
return ..()
|
||||
|
||||
/obj/effect/spawner/lootdrop/whiteship_cere_ripley
|
||||
name = "25% mech 75% wreckage ripley spawner"
|
||||
loot = list(/obj/mecha/working/ripley/mining = 1,
|
||||
/obj/structure/mecha_wreckage/ripley = 5)
|
||||
lootdoubles = FALSE
|
||||
|
||||
Reference in New Issue
Block a user