[READY] DRAMATIC SHUTTLES!! You can now fly around the shuttle (#71906)

You can move around shuttles during transport now! Instead of them
teleporting you instantly into deepspace, you can move around somewhat
depending on your space-mobility and grip-strength.


![image](https://user-images.githubusercontent.com/7501474/206866132-3fae024c-a8a2-4f4a-b4b8-37c96a254498.png)

**Please watch the demonstration aswell, it should answer most
questions:**
https://www.youtube.com/watch?v=Os77qDOVSXE

Interactions:
- Being within armsreach of a wall or solid object means you 'cling',
where the shuttle pull is very weak and you can basically run around the
shutt;e (but dont fuck up or you're gone)
- Being in range of nothing gives you a very heavy pull, you can barely
resist if you have a decent jetpack
- Objects are instantly power-yeeted
- Being pulled or riding something excempts you from hyperspace pull
- Touching a space tile while being on hyperspace dumps you in
deepspace, you either go back to the shuttle or enjoy deepspace
- On shuttle hyperspace tiles are a lot less dangerous, and will instead
launch and freeze you instead of teleporting you into deepspace
- In-case it wasn't obvious, you can rest outside the shuttle as long as
something is blocking your path. I think it's funny but I might nerf it

🆑
add: You can now fly around the shuttle during transit! Woohoo! You can
either cling to the side or grab a jetpack and try and keep up with the
shuttle! Carps can move around freely in hyperspace
qol: Increased shuttle hyperspace size from 8 tiles to 16
/🆑

- [x] Find a way to detect when a shuttle arrives and do something with
the shit left in hyperspace

Things I will do in another PR: 
- Engines spit fire and hurt (almost finished but I want to keep this
small)
- Random shuttle events. You might run into dust meteors or migrating
carps OR A CHANGELING INFILTRATOR
- Hyperspace turfs on the shuttle pull you under the shuttle

### Why it's good for the game
It's so much more immersive than being instantly teleported into
deepspace. It gives you a chance to recover if you get spaced or for
daredevils to look cool

It's also just very cool idk
This commit is contained in:
Time-Green
2023-01-03 11:10:56 -08:00
committed by GitHub
parent 9870f54e79
commit bf73344399
16 changed files with 263 additions and 41 deletions
@@ -0,0 +1,6 @@
///This subsystem handles the hyperspace shuttle pull movement loops
MOVEMENT_SUBSYSTEM_DEF(hyperspace_drift)
name = "Hyperspace Drift"
priority = FIRE_PRIORITY_HYPERSPACE_DRIFT
flags = SS_NO_INIT|SS_TICKER
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
@@ -104,12 +104,12 @@ SUBSYSTEM_DEF(movement)
smash_bucket(bucket_time = loop.timer) // We can't pass an index in for context because we don't know our position
/datum/controller/subsystem/movement/proc/add_loop(datum/move_loop/add)
add.start_loop()
add.loop_started()
if(QDELETED(add))
return
queue_loop(add)
/datum/controller/subsystem/movement/proc/remove_loop(datum/move_loop/remove)
dequeue_loop(remove)
remove.stop_loop()
remove.loop_stopped()
@@ -25,6 +25,8 @@
var/timer = 0
///Is this loop running or not
var/running = FALSE
///Track if we're currently paused
var/paused = FALSE
/datum/move_loop/New(datum/movement_packet/owner, datum/controller/subsystem/movement/controller, atom/moving, priority, flags, datum/extra_info)
src.owner = owner
@@ -51,7 +53,8 @@
return TRUE
return FALSE
/datum/move_loop/proc/start_loop()
///Called when a loop is starting by a movement subsystem
/datum/move_loop/proc/loop_started()
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_MOVELOOP_START)
running = TRUE
@@ -62,7 +65,8 @@
return
timer = world.time + delay
/datum/move_loop/proc/stop_loop()
///Called when a loop is stopped, doesn't stop the loop itself
/datum/move_loop/proc/loop_stopped()
SHOULD_CALL_PARENT(TRUE)
running = FALSE
SEND_SIGNAL(src, COMSIG_MOVELOOP_STOP)
@@ -126,6 +130,25 @@
/datum/move_loop/proc/move()
return FALSE
///Pause our loop untill restarted with resume_loop()
/datum/move_loop/proc/pause_loop()
if(!controller || !running || paused) //we dead
return
//Dequeue us from our current bucket
controller.dequeue_loop(src)
paused = TRUE
///Resume our loop after being paused by pause_loop()
/datum/move_loop/proc/resume_loop()
if(!controller || !running || !paused)
return
controller.queue_loop(src)
timer = world.time
paused = FALSE
///Removes the atom from some movement subsystem. Defaults to SSmovement
/datum/controller/subsystem/move_manager/proc/stop_looping(atom/movable/moving, datum/controller/subsystem/movement/subsystem = SSmovement)
var/datum/movement_packet/our_info = moving.move_packet
@@ -168,7 +191,7 @@
/datum/move_loop/move/move()
var/atom/old_loc = moving.loc
moving.Move(get_step(moving, direction), direction)
moving.Move(get_step(moving, direction), direction, FALSE, !(flags & MOVEMENT_LOOP_NO_DIR_UPDATE))
// We cannot rely on the return value of Move(), we care about teleports and it doesn't
// Moving also can be null on occasion, if the move deleted it and therefor us
return old_loc != moving?.loc
@@ -376,7 +399,7 @@
return TRUE
return FALSE
/datum/move_loop/has_target/jps/start_loop()
/datum/move_loop/has_target/jps/loop_started()
. = ..()
INVOKE_ASYNC(src, PROC_REF(recalculate_path))