mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Merge pull request #11158 from Fox-McCloud/delayed-gibbing
Makes Delayed Gibbing a Proc
This commit is contained in:
@@ -96,3 +96,9 @@
|
||||
|
||||
// u no we dead
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/delayed_gib()
|
||||
visible_message("<span class='danger'><b>[src]</b> starts convulsing violently!</span>", "You feel as if your body is tearing itself apart!")
|
||||
Weaken(15)
|
||||
do_jitter_animation(1000, -1)
|
||||
addtimer(CALLBACK(src, .proc/gib), rand(20, 100))
|
||||
@@ -786,11 +786,11 @@
|
||||
..()
|
||||
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
|
||||
|
||||
/mob/living/proc/do_jitter_animation(jitteriness)
|
||||
/mob/living/proc/do_jitter_animation(jitteriness, loop_amount = 6)
|
||||
var/amplitude = min(4, (jitteriness/100) + 1)
|
||||
var/pixel_x_diff = rand(-amplitude, amplitude)
|
||||
var/pixel_y_diff = rand(-amplitude/3, amplitude/3)
|
||||
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6)
|
||||
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = loop_amount)
|
||||
animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y) , time = 2)
|
||||
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user