From d50c0e10f6be578d98c8e4892612af560a228bfd Mon Sep 17 00:00:00 2001 From: Emmett Gaines Date: Thu, 5 Oct 2017 03:30:32 -0400 Subject: [PATCH] Makes shuttle movement a bit smoother and faster --- code/modules/shuttle/on_move.dm | 22 +++++++++++----------- code/modules/shuttle/shuttle.dm | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index b527894d0a..2359a130cb 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -203,7 +203,7 @@ All ShuttleMove procs go here if(pipe_vision_img) pipe_vision_img.loc = loc -/obj/machinery/computer/auxillary_base/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/obj/machinery/computer/auxillary_base/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir) . = ..() 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! @@ -297,24 +297,25 @@ All ShuttleMove procs go here /************************************Item move procs************************************/ -/obj/item/storage/pod/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) +/obj/item/storage/pod/afterShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) + . = ..() unlocked = TRUE // If the pod was launched, the storage will always open. - return ..() /************************************Mob move procs************************************/ /mob/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) if(!move_on_shuttle) - return 0 - . = ..() - if(!.) return - if(client) + . = ..() + +/mob/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir) + . = ..() + if(client && movement_force) + var/shake_force = max(movement_force["THROW"], movement_force["KNOCKDOWN"]) if(buckled) - shake_camera(src, 2, 1) // turn it down a bit come on - else - shake_camera(src, 7, 1) + shake_force *= 0.25 + shake_camera(src, shake_force, 1) /mob/living/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir) . = ..() @@ -373,7 +374,6 @@ All ShuttleMove procs go here /obj/docking_port/stationary/public_mining_dock/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) id = "mining_public" //It will not move with the base, but will become enabled as a docking point. - return 0 /obj/effect/abstract/proximity_checker/onShuttleMove(turf/newT, turf/oldT, rotation, list/movement_force, move_dir, old_dock) //timer so it only happens once diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 99d707d289..88daa3a016 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -553,6 +553,8 @@ 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 + CHECK_TICK + /****************************************All beforeShuttleMove procs*****************************************/ var/index = 0 for(var/place in old_turfs) @@ -578,6 +580,7 @@ areas_to_move[old_area] = TRUE old_turfs[place] = move_mode + CHECK_TICK /*******************************************All onShuttleMove procs******************************************/ @@ -608,17 +611,32 @@ 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 +<<<<<<< HEAD +======= + // Parallax handling + 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 + CHECK_TICK + +>>>>>>> e16fd1b... Makes shuttle movement a bit smoother and faster (#31255) check_poddoors() new_dock.last_dock_time = world.time setDir(new_dock.dir)