mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Fix jetpacks and speedbikes (#28222)
* Fix jetpacks * All mobs LONG_GLIDE * Don't disturb the drift loop on Z level changes. * Fix speedbikes
This commit is contained in:
@@ -144,13 +144,7 @@
|
||||
|
||||
var/diagonal_factor = 1
|
||||
if(IS_DIR_DIAGONAL(direct))
|
||||
// For some reason, LONG_GLIDE mobs need to slow down here, but other mobs need to speed up.
|
||||
// I'd expect one or the other to change, not both.
|
||||
// If you can figure out why, please update this comment.
|
||||
if(mob.appearance_flags & LONG_GLIDE)
|
||||
diagonal_factor = sqrt(2)
|
||||
else
|
||||
diagonal_factor = 1 / sqrt(2)
|
||||
diagonal_factor = sqrt(2)
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * diagonal_factor)) // set it now in case of pulled objects
|
||||
|
||||
//If the move was recent, count using old_move_delay
|
||||
@@ -187,28 +181,21 @@
|
||||
|
||||
. = ..()
|
||||
|
||||
var/new_glide_size = 0
|
||||
// Only adjust for diagonal movement if the move was *actually* diagonal
|
||||
if(mob.loc == new_loc)
|
||||
// Similar to the glide size calculation above, LONG_GLIDE mobs need to slow down and other mobs speed up.
|
||||
// Unline before, we also want to calculate the new movement delay, which is increased for LONG_GLIDE mobs, and unchanged for other mobs.
|
||||
mob.last_movement = world.time
|
||||
if(IS_DIR_DIAGONAL(direct) && (mob.appearance_flags & LONG_GLIDE))
|
||||
if(IS_DIR_DIAGONAL(direct))
|
||||
add_delay *= sqrt(2)
|
||||
|
||||
if(visual_delay)
|
||||
new_glide_size = visual_delay
|
||||
else
|
||||
new_glide_size = DELAY_TO_GLIDE_SIZE(add_delay)
|
||||
|
||||
if(IS_DIR_DIAGONAL(direct) && !(mob.appearance_flags & LONG_GLIDE))
|
||||
new_glide_size *= sqrt(2)
|
||||
|
||||
mob.set_glide_size(new_glide_size)
|
||||
else if(visual_delay)
|
||||
mob.set_glide_size(visual_delay)
|
||||
var/new_glide_size = 0
|
||||
if(visual_delay)
|
||||
new_glide_size = visual_delay
|
||||
else
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay))
|
||||
new_glide_size = DELAY_TO_GLIDE_SIZE(add_delay)
|
||||
|
||||
mob.set_glide_size(new_glide_size)
|
||||
|
||||
move_delay += add_delay
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
density = TRUE
|
||||
layer = MOB_LAYER
|
||||
animate_movement = SLIDE_STEPS
|
||||
// We probably shouldn't ever be setting this. LONG_GLIDE makes diagonal movement faster, because you move at full speed on both axes. However, we have manual changes scatterd around that undo this, and re-establish euclidian movement. Yes, that's exactly as silly as it sounds.
|
||||
// Still, for the moment, we should at least make all mobs behave the same way that carbons do.
|
||||
appearance_flags = LONG_GLIDE
|
||||
pressure_resistance = 8
|
||||
throwforce = 10
|
||||
var/datum/mind/mind
|
||||
|
||||
Reference in New Issue
Block a user