Updates to tgstation commit 78e471d
This commit is contained in:
@@ -99,13 +99,7 @@
|
||||
|
||||
return DOCKING_SUCCESS
|
||||
|
||||
/obj/docking_port/mobile/proc/preflight_check(
|
||||
list/old_turfs,
|
||||
list/new_turfs,
|
||||
list/areas_to_move,
|
||||
rotation,
|
||||
)
|
||||
|
||||
/obj/docking_port/mobile/proc/preflight_check(list/old_turfs, list/new_turfs, list/areas_to_move, rotation)
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
CHECK_TICK
|
||||
var/turf/oldT = old_turfs[i]
|
||||
@@ -134,16 +128,7 @@
|
||||
|
||||
old_turfs[oldT] = move_mode
|
||||
|
||||
/obj/docking_port/mobile/proc/takeoff(
|
||||
list/old_turfs,
|
||||
list/new_turfs,
|
||||
list/moved_atoms,
|
||||
rotation,
|
||||
movement_direction,
|
||||
old_dock,
|
||||
area/underlying_old_area,
|
||||
)
|
||||
|
||||
/obj/docking_port/mobile/proc/takeoff(list/old_turfs, list/new_turfs, list/moved_atoms, rotation, movement_direction, old_dock, area/underlying_old_area)
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
var/turf/oldT = old_turfs[i]
|
||||
var/turf/newT = new_turfs[i]
|
||||
@@ -163,17 +148,7 @@
|
||||
var/area/shuttle_area = oldT.loc
|
||||
shuttle_area.onShuttleMove(oldT, newT, underlying_old_area) //areas
|
||||
|
||||
/obj/docking_port/mobile/proc/cleanup_runway(
|
||||
obj/docking_port/stationary/new_dock,
|
||||
list/old_turfs,
|
||||
list/new_turfs,
|
||||
list/areas_to_move,
|
||||
list/moved_atoms,
|
||||
rotation,
|
||||
movement_direction,
|
||||
area/underlying_old_area,
|
||||
)
|
||||
|
||||
/obj/docking_port/mobile/proc/cleanup_runway(obj/docking_port/stationary/new_dock, list/old_turfs, list/new_turfs, list/areas_to_move, list/moved_atoms, rotation, movement_direction, area/underlying_old_area)
|
||||
underlying_old_area.afterShuttleMove()
|
||||
|
||||
// Parallax handling
|
||||
@@ -202,14 +177,28 @@
|
||||
var/turf/oldT = moved_atoms[moved_object]
|
||||
moved_object.afterShuttleMove(oldT, movement_force, dir, preferred_direction, movement_direction, rotation)//atoms
|
||||
|
||||
// lateShuttleMove (There had better be a really good reason for additional stages beyond this)
|
||||
|
||||
underlying_old_area.lateShuttleMove()
|
||||
|
||||
for(var/i in 1 to areas_to_move.len)
|
||||
CHECK_TICK
|
||||
var/area/internal_area = areas_to_move[i]
|
||||
internal_area.lateShuttleMove()
|
||||
|
||||
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)
|
||||
newT.lateShuttleMove(oldT)
|
||||
|
||||
for(var/i in 1 to moved_atoms.len)
|
||||
CHECK_TICK
|
||||
var/atom/movable/moved_object = moved_atoms[i]
|
||||
if(QDELETED(moved_object))
|
||||
continue
|
||||
var/turf/oldT = moved_atoms[moved_object]
|
||||
moved_object.lateShuttleMove(oldT, movement_force, movement_direction)
|
||||
|
||||
|
||||
@@ -224,7 +224,11 @@
|
||||
if(existing_shuttle)
|
||||
existing_shuttle.jumpToNullSpace()
|
||||
|
||||
var/list/force_memory = preview_shuttle.movement_force
|
||||
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
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
if(jammed)
|
||||
to_chat(user, "<span class='warning'>The Syndicate is jamming the console!</span>")
|
||||
return
|
||||
if(!shuttle_port)
|
||||
to_chat(user,"<span class='warning'>Warning: Shuttle connection severed!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/GrantActions(mob/living/user)
|
||||
|
||||
@@ -53,7 +53,7 @@ All ShuttleMove procs go here
|
||||
if(!shuttle_boundary)
|
||||
CRASH("A turf queued to move via shuttle somehow had no skipover in baseturfs. [src]([type]):[loc]")
|
||||
var/depth = baseturfs.len - shuttle_boundary + 1
|
||||
newT.CopyOnTop(src, 1, depth)
|
||||
newT.CopyOnTop(src, 1, depth, TRUE)
|
||||
//Air stuff
|
||||
newT.blocks_air = TRUE
|
||||
newT.air_update_turf(TRUE)
|
||||
@@ -78,6 +78,13 @@ All ShuttleMove procs go here
|
||||
|
||||
return TRUE
|
||||
|
||||
/turf/proc/lateShuttleMove(turf/oldT)
|
||||
blocks_air = initial(blocks_air)
|
||||
air_update_turf(TRUE)
|
||||
oldT.blocks_air = initial(oldT.blocks_air)
|
||||
oldT.air_update_turf(TRUE)
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Called on every atom in shuttle turf contents before anything has been moved
|
||||
@@ -91,9 +98,8 @@ All ShuttleMove procs go here
|
||||
if(newT == oldT) // In case of in place shuttle rotation shenanigans.
|
||||
return
|
||||
|
||||
if(locs && locs.len > 1) // This is for multi tile objects
|
||||
if(loc != oldT)
|
||||
return
|
||||
if(loc != oldT) // This is for multi tile objects
|
||||
return
|
||||
|
||||
loc = newT
|
||||
|
||||
@@ -111,12 +117,22 @@ All ShuttleMove procs go here
|
||||
if(rotation)
|
||||
shuttleRotate(rotation)
|
||||
|
||||
|
||||
|
||||
update_parallax_contents()
|
||||
|
||||
return TRUE
|
||||
|
||||
/atom/movable/proc/lateShuttleMove(turf/oldT, list/movement_force, move_dir)
|
||||
if(!movement_force || anchored)
|
||||
return
|
||||
var/throw_force = movement_force["THROW"]
|
||||
if(!throw_force)
|
||||
return
|
||||
var/turf/target = get_edge_target_turf(src, move_dir)
|
||||
var/range = throw_force * 10
|
||||
range = CEILING(rand(range-(range*0.1), range+(range*0.1)), 10)/10
|
||||
var/speed = range/5
|
||||
throw_at(target, range, speed)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Called on areas before anything has been moved
|
||||
@@ -149,6 +165,9 @@ All ShuttleMove procs go here
|
||||
parallax_movedir = new_parallax_dir
|
||||
return TRUE
|
||||
|
||||
/area/proc/lateShuttleMove()
|
||||
return
|
||||
|
||||
/************************************Turf move procs************************************/
|
||||
|
||||
/************************************Area move procs************************************/
|
||||
@@ -288,17 +307,16 @@ All ShuttleMove procs go here
|
||||
shake_force *= 0.25
|
||||
shake_camera(src, shake_force, 1)
|
||||
|
||||
/mob/living/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
|
||||
/mob/living/lateShuttleMove(turf/oldT, list/movement_force, move_dir)
|
||||
if(buckled)
|
||||
return
|
||||
|
||||
. = ..()
|
||||
if(movement_force && !buckled)
|
||||
if(movement_force["THROW"])
|
||||
var/throw_dir = move_dir
|
||||
var/turf/target = get_edge_target_turf(src, throw_dir)
|
||||
var/range = movement_force["THROW"]
|
||||
var/speed = range/5
|
||||
src.throw_at(target, range, speed)
|
||||
if(movement_force["KNOCKDOWN"])
|
||||
Knockdown(movement_force["KNOCKDOWN"])
|
||||
|
||||
var/knockdown = movement_force["KNOCKDOWN"]
|
||||
if(knockdown)
|
||||
Knockdown(knockdown)
|
||||
|
||||
|
||||
/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)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user