Merge branch 'master' into upstream-merge-31176
This commit is contained in:
@@ -8,8 +8,9 @@
|
||||
var/shuttlePortId = ""
|
||||
var/shuttlePortName = ""
|
||||
var/list/jumpto_ports = list() //hashset of ports to jump to and ignore for collision purposes
|
||||
var/list/blacklisted_turfs
|
||||
var/obj/docking_port/stationary/my_port
|
||||
var/list/blacklisted_turfs //turfs we cannot go on, by default, any turf covered by a docking port that we did not place and cannot jump to
|
||||
var/obj/docking_port/stationary/my_port //the custom docking port placed by this console
|
||||
var/obj/docking_port/mobile/shuttle_port //the mobile docking port of the connected shuttle
|
||||
var/view_range = 7
|
||||
var/x_offset = 0
|
||||
var/y_offset = 0
|
||||
@@ -31,29 +32,30 @@
|
||||
actions += place_action
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/CreateEye()
|
||||
var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId)
|
||||
if(QDELETED(M))
|
||||
shuttle_port = SSshuttle.getShuttle(shuttleId)
|
||||
if(QDELETED(shuttle_port))
|
||||
shuttle_port = null
|
||||
return
|
||||
|
||||
eyeobj = new /mob/camera/aiEye/remote/shuttle_docker()
|
||||
var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj
|
||||
the_eye.origin = src
|
||||
the_eye.dir = M.dir
|
||||
var/area/A = get_area(M)
|
||||
if(QDELETED(A))
|
||||
return
|
||||
var/turf/origin = locate(M.x + x_offset, M.y + y_offset, M.z)
|
||||
for(var/turf/T in A)
|
||||
if(T.z != origin.z)
|
||||
continue
|
||||
var/image/I = image('icons/effects/alphacolors.dmi', origin, "red")
|
||||
I.layer = ABOVE_NORMAL_TURF_LAYER
|
||||
I.plane = 0
|
||||
I.mouse_opacity = 0
|
||||
var/x_off = T.x - origin.x
|
||||
var/y_off = T.y - origin.y
|
||||
I.pixel_x = x_off * 32
|
||||
I.pixel_y = y_off * 32
|
||||
the_eye.placement_images[I] = list(x_off, y_off)
|
||||
the_eye.dir = 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
|
||||
for(var/turf/T in A)
|
||||
if(T.z != origin.z)
|
||||
continue
|
||||
var/image/I = image('icons/effects/alphacolors.dmi', origin, "red")
|
||||
I.layer = ABOVE_NORMAL_TURF_LAYER
|
||||
I.plane = 0
|
||||
I.mouse_opacity = 0
|
||||
var/x_off = T.x - origin.x
|
||||
var/y_off = T.y - origin.y
|
||||
I.pixel_x = x_off * 32
|
||||
I.pixel_y = y_off * 32
|
||||
the_eye.placement_images[I] = list(x_off, y_off)
|
||||
generateBlacklistedTurfs()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/give_eye_control(mob/user)
|
||||
@@ -77,7 +79,7 @@
|
||||
return FALSE
|
||||
var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj
|
||||
if(!my_port)
|
||||
my_port = new /obj/docking_port/stationary
|
||||
my_port = new /obj/docking_port/stationary()
|
||||
my_port.name = shuttlePortName
|
||||
my_port.id = shuttlePortId
|
||||
var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId)
|
||||
@@ -124,7 +126,7 @@
|
||||
checkLandingSpot()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/checkLandingTurf(turf/T)
|
||||
return T && (!blacklisted_turfs || !blacklisted_turfs[T]) && (!space_turfs_only || isspaceturf(T))
|
||||
return T && (shuttle_port.shuttle_areas[T.loc] || (!blacklisted_turfs || !blacklisted_turfs[T]) && (!space_turfs_only || isspaceturf(T)) ) && (T.x > 1 && T.y > 1 && T.x < world.maxx && T.y < world.maxy)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/generateBlacklistedTurfs()
|
||||
blacklisted_turfs = list()
|
||||
|
||||
@@ -44,37 +44,46 @@ All ShuttleMove procs go here
|
||||
return move_mode
|
||||
|
||||
// Called on the old turf to move the turf data
|
||||
/turf/proc/onShuttleMove(turf/newT, turf_type, baseturf_type, rotation, list/movement_force, move_dir)
|
||||
/turf/proc/onShuttleMove(turf/newT, list/movement_force, move_dir)
|
||||
if(newT == src) // In case of in place shuttle rotation shenanigans.
|
||||
return
|
||||
|
||||
//Destination turf changes
|
||||
var/destination_turf_type = newT.type
|
||||
copyTurf(newT)
|
||||
newT = copyTurf(newT)
|
||||
newT.baseturf = destination_turf_type
|
||||
|
||||
//Air stuff
|
||||
newT.blocks_air = TRUE
|
||||
newT.air_update_turf(TRUE)
|
||||
blocks_air = TRUE
|
||||
air_update_turf(TRUE)
|
||||
if(isopenturf(newT))
|
||||
var/turf/open/new_open = newT
|
||||
new_open.copy_air_with_tile(src)
|
||||
|
||||
//Source turf changes
|
||||
ChangeTurf(turf_type, baseturf_type, FALSE, TRUE)
|
||||
|
||||
return TRUE
|
||||
|
||||
// Called on the new turf after everything has been moved
|
||||
/turf/proc/afterShuttleMove(turf/oldT)
|
||||
/turf/proc/afterShuttleMove(turf/oldT, turf_type, baseturf_type, rotation)
|
||||
//Dealing with the turf we left behind
|
||||
oldT.TransferComponents(src)
|
||||
oldT.ChangeTurf(turf_type, baseturf_type, FALSE, TRUE)
|
||||
|
||||
// Rotate and let the air move again
|
||||
if(rotation)
|
||||
shuttleRotate(rotation) //see shuttle_rotate.dm
|
||||
|
||||
return TRUE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Called on every atom in shuttle turf contents before anything has been moved
|
||||
// returns the new move_mode (based on the old)
|
||||
// WARNING: Do not leave turf contents in beforeShuttleMove or dock() will runtime
|
||||
/atom/movable/proc/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
return move_mode
|
||||
|
||||
// Called on atoms to move the atom to the new location
|
||||
/atom/movable/proc/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/atom/movable/proc/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
if(newT == oldT) // In case of in place shuttle rotation shenanigans.
|
||||
return
|
||||
|
||||
@@ -82,17 +91,18 @@ All ShuttleMove procs go here
|
||||
if(loc != oldT)
|
||||
return
|
||||
|
||||
if(rotation)
|
||||
shuttleRotate(rotation) //see shuttle_rotate.dm
|
||||
loc = newT
|
||||
if(length(client_mobs_in_contents))
|
||||
update_parallax_contents()
|
||||
return TRUE
|
||||
|
||||
// Called on atoms after everything has been moved
|
||||
/atom/movable/proc/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/atom/movable/proc/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
if(light)
|
||||
update_light()
|
||||
if(rotation)
|
||||
shuttleRotate(rotation)
|
||||
|
||||
update_parallax_contents()
|
||||
|
||||
return TRUE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -123,22 +133,12 @@ All ShuttleMove procs go here
|
||||
return TRUE
|
||||
|
||||
// Called on areas after everything has been moved
|
||||
/area/proc/afterShuttleMove()
|
||||
/area/proc/afterShuttleMove(new_parallax_dir)
|
||||
parallax_movedir = new_parallax_dir
|
||||
return TRUE
|
||||
|
||||
/************************************Turf move procs************************************/
|
||||
|
||||
/turf/open/afterShuttleMove(turf/oldT) //Recalculates SSair stuff for turfs on both sides
|
||||
. = ..()
|
||||
SSair.remove_from_active(src)
|
||||
SSair.remove_from_active(oldT)
|
||||
|
||||
src.CalculateAdjacentTurfs()
|
||||
oldT.CalculateAdjacentTurfs()
|
||||
|
||||
SSair.add_to_active(src, TRUE)
|
||||
SSair.add_to_active(oldT, TRUE)
|
||||
|
||||
/************************************Area move procs************************************/
|
||||
|
||||
/************************************Machinery move procs************************************/
|
||||
@@ -151,7 +151,7 @@ All ShuttleMove procs go here
|
||||
A.air_tight = TRUE
|
||||
INVOKE_ASYNC(A, /obj/machinery/door/.proc/close)
|
||||
|
||||
/obj/machinery/door/airlock/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/door/airlock/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
shuttledocked = 1
|
||||
for(var/obj/machinery/door/airlock/A in range(1, src))
|
||||
@@ -159,14 +159,15 @@ All ShuttleMove procs go here
|
||||
|
||||
/obj/machinery/camera/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
. = ..()
|
||||
GLOB.cameranet.removeCamera(src)
|
||||
. |= MOVE_CONTENTS
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
GLOB.cameranet.removeCamera(src)
|
||||
|
||||
/obj/machinery/camera/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/camera/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
GLOB.cameranet.addCamera(src)
|
||||
|
||||
/obj/machinery/telecomms/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/telecomms/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
listening_level = z // Update listening Z, just in case you have telecomm relay on a shuttle
|
||||
|
||||
@@ -174,12 +175,12 @@ All ShuttleMove procs go here
|
||||
. = ..()
|
||||
recharging_turf = get_step(loc, dir)
|
||||
|
||||
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if(pipe_vision_img)
|
||||
pipe_vision_img.loc = loc
|
||||
|
||||
/obj/machinery/computer/auxillary_base/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/computer/auxillary_base/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if(z == ZLEVEL_MINING) //Avoids double logging and landing on other Z-levels due to badminnery
|
||||
SSblackbox.add_details("colonies_dropped", "[x]|[y]|[z]") //Number of times a base has been dropped!
|
||||
@@ -189,7 +190,7 @@ All ShuttleMove procs go here
|
||||
on = FALSE
|
||||
update_list()
|
||||
|
||||
/obj/machinery/gravity_generator/main/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/gravity_generator/main/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if(charge_count != 0 && charging_state != POWER_UP)
|
||||
on = TRUE
|
||||
@@ -197,9 +198,10 @@ All ShuttleMove procs go here
|
||||
|
||||
/obj/machinery/thruster/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
. = ..()
|
||||
. |= MOVE_CONTENTS
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
|
||||
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/missing_nodes = FALSE
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
@@ -228,7 +230,7 @@ All ShuttleMove procs go here
|
||||
// atmosinit() calls update_icon(), so we don't need to call it
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/atmospherics/pipe/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/turf/T = loc
|
||||
hide(T.intact)
|
||||
@@ -238,7 +240,7 @@ All ShuttleMove procs go here
|
||||
GLOB.navbeacons["[z]"] -= src
|
||||
GLOB.deliverybeacons -= src
|
||||
|
||||
/obj/machinery/navbeacon/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/navbeacon/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/turf/T = loc
|
||||
hide(T.intact)
|
||||
@@ -250,7 +252,7 @@ All ShuttleMove procs go here
|
||||
GLOB.deliverybeacons += src
|
||||
GLOB.deliverybeacontags += location
|
||||
|
||||
/obj/machinery/power/terminal/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/machinery/power/terminal/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/turf/T = src.loc
|
||||
if(level==1)
|
||||
@@ -258,19 +260,19 @@ All ShuttleMove procs go here
|
||||
|
||||
/************************************Item move procs************************************/
|
||||
|
||||
/obj/item/storage/pod/afterShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/obj/item/storage/pod/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
unlocked = TRUE
|
||||
// If the pod was launched, the storage will always open.
|
||||
|
||||
/************************************Mob move procs************************************/
|
||||
|
||||
/mob/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/mob/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
if(!move_on_shuttle)
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/mob/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/mob/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if(client && movement_force)
|
||||
var/shake_force = max(movement_force["THROW"], movement_force["KNOCKDOWN"])
|
||||
@@ -278,7 +280,7 @@ All ShuttleMove procs go here
|
||||
shake_force *= 0.25
|
||||
shake_camera(src, shake_force, 1)
|
||||
|
||||
/mob/living/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/mob/living/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
if(movement_force && !buckled)
|
||||
if(movement_force["THROW"])
|
||||
@@ -290,7 +292,7 @@ All ShuttleMove procs go here
|
||||
if(movement_force["KNOCKDOWN"])
|
||||
Knockdown(movement_force["KNOCKDOWN"])
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/mob/living/simple_animal/hostile/megafauna/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
. = ..()
|
||||
message_admins("Megafauna [src] [ADMIN_FLW(src)] moved via shuttle from [ADMIN_COORDJMP(oldT)] to [ADMIN_COORDJMP(loc)]")
|
||||
|
||||
@@ -298,17 +300,19 @@ All ShuttleMove procs go here
|
||||
|
||||
/obj/structure/grille/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
. = ..()
|
||||
. |= MOVE_CONTENTS
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
|
||||
/obj/structure/lattice/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
. = ..()
|
||||
. |= MOVE_CONTENTS
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
|
||||
/obj/structure/disposalpipe/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/structure/disposalpipe/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
update()
|
||||
|
||||
/obj/structure/cable/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||
/obj/structure/cable/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
. = ..()
|
||||
var/turf/T = loc
|
||||
if(level==1)
|
||||
@@ -316,26 +320,26 @@ All ShuttleMove procs go here
|
||||
|
||||
/obj/structure/shuttle/beforeShuttleMove(turf/newT, rotation, move_mode)
|
||||
. = ..()
|
||||
. |= MOVE_CONTENTS
|
||||
if(. & MOVE_AREA)
|
||||
. |= MOVE_CONTENTS
|
||||
|
||||
|
||||
/************************************Misc move procs************************************/
|
||||
|
||||
/atom/movable/lighting_object/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/atom/movable/lighting_object/onShuttleMove()
|
||||
return FALSE
|
||||
|
||||
/atom/movable/light/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/atom/movable/light/onShuttleMove()
|
||||
return FALSE
|
||||
|
||||
/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
if(old_dock == src) //Don't move the dock we're leaving
|
||||
/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
if(!moving_dock.can_move_docking_ports || old_dock == src)
|
||||
return FALSE
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
id = "mining_public" //It will not move with the base, but will become enabled as a docking point.
|
||||
|
||||
/obj/effect/abstract/proximity_checker/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock)
|
||||
/obj/effect/abstract/proximity_checker/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
|
||||
//timer so it only happens once
|
||||
addtimer(CALLBACK(monitor, /datum/proximity_monitor/proc/SetRange, monitor.current_range, TRUE), 0, TIMER_UNIQUE)
|
||||
|
||||
@@ -179,7 +179,8 @@
|
||||
|
||||
/obj/docking_port/proc/getDockedId()
|
||||
var/obj/docking_port/P = get_docked()
|
||||
if(P) return P.id
|
||||
if(P)
|
||||
return P.id
|
||||
|
||||
/obj/docking_port/stationary
|
||||
name = "dock"
|
||||
@@ -192,7 +193,7 @@
|
||||
|
||||
var/last_dock_time
|
||||
|
||||
/obj/docking_port/stationary/Initialize()
|
||||
/obj/docking_port/stationary/Initialize(mapload)
|
||||
. = ..()
|
||||
SSshuttle.stationary += src
|
||||
if(!id)
|
||||
@@ -201,6 +202,10 @@
|
||||
name = "dock[SSshuttle.stationary.len]"
|
||||
baseturf_cache = typecacheof(baseturf_type)
|
||||
|
||||
if(mapload)
|
||||
for(var/turf/T in return_turfs())
|
||||
T.flags_1 |= NO_RUINS_1
|
||||
|
||||
#ifdef DOCKING_PORT_HIGHLIGHT
|
||||
highlight("#f00")
|
||||
#endif
|
||||
@@ -279,6 +284,7 @@
|
||||
var/engine_coeff = 1 //current engine coeff
|
||||
var/current_engines = 0 //current engine power
|
||||
var/initial_engines = 0 //initial engine power
|
||||
var/can_move_docking_ports = FALSE //if this shuttle can move docking ports other than the one it is docked at
|
||||
|
||||
/obj/docking_port/mobile/proc/register()
|
||||
SSshuttle.mobile += src
|
||||
@@ -410,7 +416,8 @@
|
||||
mode = SHUTTLE_RECALL
|
||||
|
||||
/obj/docking_port/mobile/proc/enterTransit()
|
||||
if(SSshuttle.lockdown && (z in GLOB.station_z_levels)) //emp went off, no escape
|
||||
if((SSshuttle.lockdown && (z in GLOB.station_z_levels)) || !canMove()) //emp went off, no escape
|
||||
mode = SHUTTLE_IDLE
|
||||
return
|
||||
previous = null
|
||||
// if(!destination)
|
||||
@@ -507,9 +514,17 @@
|
||||
return DOCKING_IMMOBILIZED
|
||||
|
||||
var/obj/docking_port/stationary/old_dock = get_docked()
|
||||
var/underlying_turf_type = /turf/open/space //The turf that gets placed under where the shuttle moved from
|
||||
var/underlying_baseturf_type = /turf/open/space //The baseturf that the gets assigned to the turf_type above
|
||||
var/underlying_area_type = /area/space //The area that gets placed under where the shuttle moved from
|
||||
|
||||
// The turf that gets placed under where the shuttle moved from
|
||||
var/underlying_turf_type = /turf/open/space
|
||||
|
||||
// The baseturf that the gets assigned to the turf_type above
|
||||
var/underlying_baseturf_type = /turf/open/space
|
||||
|
||||
// The area that gets placed under where the shuttle moved from
|
||||
var/underlying_area_type = /area/space
|
||||
|
||||
// The baseturf cache is a typecache of what counts as a baseturf to be left behind
|
||||
var/list/baseturf_cache
|
||||
if(old_dock) //Dock overwrites
|
||||
if(old_dock.turf_type)
|
||||
@@ -521,7 +536,6 @@
|
||||
if(old_dock.baseturf_cache)
|
||||
baseturf_cache = old_dock.baseturf_cache
|
||||
if(!baseturf_cache)
|
||||
//Don't want to call this needlessly
|
||||
baseturf_cache = typecacheof(underlying_baseturf_type)
|
||||
|
||||
/**************************************************************************************************************
|
||||
@@ -534,6 +548,8 @@
|
||||
var/list/new_turfs = return_ordered_turfs(new_dock.x, new_dock.y, new_dock.z, new_dock.dir)
|
||||
/**************************************************************************************************************/
|
||||
|
||||
// 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 = locate(underlying_area_type) in GLOB.sortedAreas
|
||||
if(!underlying_old_area)
|
||||
underlying_old_area = new underlying_area_type(null)
|
||||
@@ -556,19 +572,22 @@
|
||||
CHECK_TICK
|
||||
|
||||
/****************************************All beforeShuttleMove procs*****************************************/
|
||||
var/index = 0
|
||||
for(var/place in old_turfs)
|
||||
index++
|
||||
var/turf/oldT = place
|
||||
var/turf/newT = new_turfs[index]
|
||||
if(!newT || !oldT)
|
||||
continue
|
||||
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
CHECK_TICK
|
||||
var/turf/oldT = old_turfs[i]
|
||||
var/turf/newT = new_turfs[i]
|
||||
if(!newT)
|
||||
return DOCKING_NULL_DESTINATION
|
||||
if(!oldT)
|
||||
return DOCKING_NULL_SOURCE
|
||||
|
||||
var/area/old_area = oldT.loc
|
||||
var/move_mode = old_area.beforeShuttleMove(shuttle_areas) //areas
|
||||
|
||||
for(var/i in 1 to oldT.contents.len)
|
||||
var/atom/movable/moving_atom = oldT.contents[i]
|
||||
var/list/old_contents = oldT.contents
|
||||
for(var/k in 1 to old_contents.len)
|
||||
var/atom/movable/moving_atom = old_contents[k]
|
||||
if(moving_atom.loc != oldT) //fix for multi-tile objects
|
||||
continue
|
||||
move_mode = moving_atom.beforeShuttleMove(newT, rotation, move_mode) //atoms
|
||||
@@ -579,60 +598,68 @@
|
||||
if(move_mode & MOVE_AREA)
|
||||
areas_to_move[old_area] = TRUE
|
||||
|
||||
old_turfs[place] = move_mode
|
||||
CHECK_TICK
|
||||
old_turfs[oldT] = move_mode
|
||||
|
||||
/*******************************************All onShuttleMove procs******************************************/
|
||||
|
||||
index = 0
|
||||
for(var/place in old_turfs)
|
||||
index++
|
||||
var/turf/oldT = place
|
||||
var/turf/newT = new_turfs[index]
|
||||
var/move_mode = old_turfs[place]
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
var/turf/oldT = old_turfs[i]
|
||||
var/turf/newT = new_turfs[i]
|
||||
var/move_mode = old_turfs[oldT]
|
||||
if(move_mode & MOVE_CONTENTS)
|
||||
for(var/thing in oldT)
|
||||
var/atom/movable/moving_atom = thing
|
||||
for(var/k in oldT)
|
||||
var/atom/movable/moving_atom = k
|
||||
if(moving_atom.loc != oldT) //fix for multi-tile objects
|
||||
continue
|
||||
moving_atom.onShuttleMove(newT, oldT, rotation, movement_force, movement_direction, old_dock)//atoms
|
||||
moving_atom.onShuttleMove(newT, oldT, movement_force, movement_direction, old_dock, src) //atoms
|
||||
moved_atoms += moving_atom
|
||||
|
||||
if(move_mode & MOVE_TURF)
|
||||
oldT.onShuttleMove(newT, underlying_turf_type, underlying_baseturf_type, rotation, movement_force, movement_direction)//turfs
|
||||
oldT.onShuttleMove(newT, movement_force, movement_direction) //turfs
|
||||
|
||||
if(move_mode & MOVE_AREA)
|
||||
var/area/shuttle_area = oldT.loc
|
||||
shuttle_area.onShuttleMove(oldT, newT, underlying_old_area) //areas
|
||||
|
||||
/******************************************All afterShuttleMove procs****************************************/
|
||||
|
||||
index = 0
|
||||
for(var/thing in old_turfs)
|
||||
index++
|
||||
var/turf/oldT = thing
|
||||
var/turf/newT = new_turfs[index]
|
||||
newT.afterShuttleMove(oldT) //turfs
|
||||
CHECK_TICK
|
||||
|
||||
for(var/i in 1 to moved_atoms.len)
|
||||
var/atom/movable/moved_object = moved_atoms[i]
|
||||
moved_object.afterShuttleMove(movement_force, dir, preferred_direction, movement_direction) //atoms
|
||||
CHECK_TICK
|
||||
|
||||
underlying_old_area.afterShuttleMove()
|
||||
|
||||
for(var/thing in areas_to_move)
|
||||
var/area/internal_area = thing
|
||||
internal_area.afterShuttleMove() //areas
|
||||
CHECK_TICK
|
||||
|
||||
// Parallax handling
|
||||
// This needs to be done before the atom after move
|
||||
var/new_parallax_dir = FALSE
|
||||
if(istype(new_dock, /obj/docking_port/stationary/transit))
|
||||
new_parallax_dir = preferred_direction
|
||||
for(var/i in shuttle_areas)
|
||||
var/area/place = i
|
||||
place.parallax_movedir = new_parallax_dir
|
||||
for(var/i in 1 to areas_to_move.len)
|
||||
CHECK_TICK
|
||||
var/area/internal_area = areas_to_move[i]
|
||||
internal_area.afterShuttleMove(new_parallax_dir) //areas
|
||||
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
CHECK_TICK
|
||||
if(!(old_turfs[old_turfs[i]] & MOVE_TURF))
|
||||
continue
|
||||
var/turf/oldT = old_turfs[i]
|
||||
var/turf/newT = new_turfs[i]
|
||||
newT.afterShuttleMove(oldT, underlying_turf_type, underlying_baseturf_type, rotation) //turfs
|
||||
|
||||
for(var/i in 1 to moved_atoms.len)
|
||||
CHECK_TICK
|
||||
var/atom/movable/moved_object = moved_atoms[i]
|
||||
moved_object.afterShuttleMove(movement_force, dir, preferred_direction, movement_direction, rotation)//atoms
|
||||
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
CHECK_TICK
|
||||
// Objects can block air so either turf or content changes means an air update is needed
|
||||
if(!(old_turfs[old_turfs[i]] & MOVE_CONTENTS | MOVE_TURF))
|
||||
continue
|
||||
var/turf/oldT = old_turfs[i]
|
||||
var/turf/newT = new_turfs[i]
|
||||
oldT.blocks_air = initial(oldT.blocks_air)
|
||||
oldT.air_update_turf(TRUE)
|
||||
newT.blocks_air = initial(newT.blocks_air)
|
||||
newT.air_update_turf(TRUE)
|
||||
|
||||
check_poddoors()
|
||||
new_dock.last_dock_time = world.time
|
||||
setDir(new_dock.dir)
|
||||
@@ -668,7 +695,14 @@
|
||||
// then try again
|
||||
switch(mode)
|
||||
if(SHUTTLE_CALL)
|
||||
if(dock(destination, preferred_direction) != DOCKING_SUCCESS)
|
||||
var/error = dock(destination, preferred_direction)
|
||||
if(error && error & (DOCKING_NULL_DESTINATION | DOCKING_NULL_SOURCE))
|
||||
var/msg = "A mobile dock in transit exited dock() with an error. This is most likely a mapping problem: Error: [error], ([src]) ([previous])"
|
||||
WARNING(msg)
|
||||
message_admins(msg)
|
||||
mode = SHUTTLE_IDLE
|
||||
return
|
||||
else if(error)
|
||||
setTimer(20)
|
||||
return
|
||||
if(SHUTTLE_RECALL)
|
||||
|
||||
@@ -6,50 +6,55 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
|
||||
/************************************Base proc************************************/
|
||||
|
||||
/atom/proc/shuttleRotate(rotation)
|
||||
//rotate our direction
|
||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||
/atom/proc/shuttleRotate(rotation, params=ROTATE_DIR|ROTATE_SMOOTH|ROTATE_OFFSET)
|
||||
if(params & ROTATE_DIR)
|
||||
//rotate our direction
|
||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||
|
||||
//resmooth if need be.
|
||||
if(smooth)
|
||||
if(smooth && (params & ROTATE_SMOOTH))
|
||||
queue_smooth(src)
|
||||
|
||||
//rotate the pixel offsets too.
|
||||
if (pixel_x || pixel_y)
|
||||
if (rotation < 0)
|
||||
if((pixel_x || pixel_y) && (params & ROTATE_OFFSET))
|
||||
if(rotation < 0)
|
||||
rotation += 360
|
||||
for (var/turntimes=rotation/90;turntimes>0;turntimes--)
|
||||
for(var/turntimes=rotation/90;turntimes>0;turntimes--)
|
||||
var/oldPX = pixel_x
|
||||
var/oldPY = pixel_y
|
||||
pixel_x = oldPY
|
||||
pixel_y = (oldPX*(-1))
|
||||
|
||||
SendSignal(COMSIG_ATOM_ROTATE, rotation, params)
|
||||
|
||||
/************************************Turf rotate procs************************************/
|
||||
|
||||
/turf/closed/mineral/shuttleRotate(rotation)
|
||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||
queue_smooth(src)
|
||||
/turf/closed/mineral/shuttleRotate(rotation, params)
|
||||
params &= ~ROTATE_OFFSET
|
||||
return ..()
|
||||
|
||||
/************************************Mob rotate procs************************************/
|
||||
|
||||
//override to avoid rotating pixel_xy on mobs
|
||||
/mob/shuttleRotate(rotation)
|
||||
/mob/shuttleRotate(rotation, params)
|
||||
params = NONE
|
||||
. = ..()
|
||||
if(!buckled)
|
||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||
|
||||
/mob/dead/observer/shuttleRotate(rotation)
|
||||
/mob/dead/observer/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/************************************Structure rotate procs************************************/
|
||||
|
||||
/obj/structure/door_assembly/door_assembly_pod/shuttleRotate(rotation)
|
||||
/obj/structure/door_assembly/door_assembly_pod/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
expected_dir = angle2dir(rotation+dir2angle(dir))
|
||||
|
||||
/obj/structure/cable/shuttleRotate(rotation)
|
||||
//..() is not called because wires are not supposed to have a non-default direction
|
||||
//Rotate connections
|
||||
/obj/structure/cable/shuttleRotate(rotation, params)
|
||||
params &= ~ROTATE_DIR
|
||||
. = ..()
|
||||
if(d1)
|
||||
d1 = angle2dir(rotation+dir2angle(d1))
|
||||
if(d2)
|
||||
@@ -63,7 +68,7 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
update_icon()
|
||||
|
||||
//Fixes dpdir on shuttle rotation
|
||||
/obj/structure/disposalpipe/shuttleRotate(rotation)
|
||||
/obj/structure/disposalpipe/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
var/new_dpdir = 0
|
||||
for(var/D in GLOB.cardinals)
|
||||
@@ -71,16 +76,17 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
new_dpdir = new_dpdir | angle2dir(rotation+dir2angle(D))
|
||||
dpdir = new_dpdir
|
||||
|
||||
/obj/structure/table/wood/bar/shuttleRotate(rotation)
|
||||
/obj/structure/table/wood/bar/shuttleRotate(rotation, params)
|
||||
. = ..()
|
||||
boot_dir = angle2dir(rotation + dir2angle(boot_dir))
|
||||
|
||||
/obj/structure/alien/weeds/shuttleRotate(rotation)
|
||||
return
|
||||
/obj/structure/alien/weeds/shuttleRotate(rotation, params)
|
||||
params &= ~ROTATE_OFFSET
|
||||
return ..()
|
||||
|
||||
/************************************Machine rotate procs************************************/
|
||||
|
||||
/obj/machinery/atmospherics/shuttleRotate(rotation)
|
||||
/obj/machinery/atmospherics/shuttleRotate(rotation, params)
|
||||
var/list/real_node_connect = getNodeConnects()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
real_node_connect[I] = angle2dir(rotation+dir2angle(real_node_connect[I]))
|
||||
@@ -95,13 +101,15 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
nodes[new_pos] = nodes_copy[I]
|
||||
|
||||
//prevents shuttles attempting to rotate this since it messes up sprites
|
||||
/obj/machinery/gateway/shuttleRotate()
|
||||
return
|
||||
/obj/machinery/gateway/shuttleRotate(rotation, params)
|
||||
params = NONE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/airlock/survival_pod/shuttleRotate(rotation)
|
||||
/obj/machinery/door/airlock/survival_pod/shuttleRotate(rotation, params)
|
||||
expected_dir = angle2dir(rotation+dir2angle(dir))
|
||||
return ..()
|
||||
|
||||
//prevents shuttles attempting to rotate this since it messes up sprites
|
||||
/obj/machinery/gravity_generator/shuttleRotate()
|
||||
return
|
||||
/obj/machinery/gravity_generator/shuttleRotate(rotation, params)
|
||||
params = NONE
|
||||
return ..()
|
||||
Reference in New Issue
Block a user