Skip to content

Commit

Permalink
Ports #6524 from PVP13 (#328)
Browse files Browse the repository at this point in the history
Co-authored-by: KoishiVibe <[email protected]>
  • Loading branch information
KoishiVibe and KoishiVibe committed Jul 18, 2024
1 parent 76771ee commit da7ce9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ var/global/list/limb_types_by_name = list(
message = replace_X.Replace(message, "CKTH")
return message

#define PIXELS_PER_STRENGTH_VAL 24
#define PIXELS_PER_STRENGTH_VAL 28

/proc/shake_camera(mob/M, steps = 1, strength = 1, time_per_step = 1)
if(!M?.client || (M.shakecamera > world.time))
Expand All @@ -260,10 +260,10 @@ var/global/list/limb_types_by_name = list(
var/old_X = M.client.pixel_x
var/old_y = M.client.pixel_y

animate(M.client, pixel_x = old_X + rand(-(strength), strength), pixel_y = old_y + rand(-(strength), strength), easing = JUMP_EASING, time = time_per_step, flags = ANIMATION_PARALLEL)
animate(M.client, pixel_x = old_X + rand(-(strength), strength), pixel_y = old_y + rand(-(strength), strength), easing = CUBIC_EASING | EASE_IN, time = time_per_step, flags = ANIMATION_PARALLEL)
var/i = 1
while(i < steps)
animate(pixel_x = old_X + rand(-(strength), strength), pixel_y = old_y + rand(-(strength), strength), easing = JUMP_EASING, time = time_per_step)
animate(pixel_x = old_X + rand(-(strength), strength), pixel_y = old_y + rand(-(strength), strength), easing = CUBIC_EASING | EASE_IN, time = time_per_step)
i++
animate(pixel_x = old_X, pixel_y = old_y,time = Clamp(Floor(strength/PIXELS_PER_STRENGTH_VAL),2,4))//ease it back

Expand Down

0 comments on commit da7ce9f

Please sign in to comment.