client prefs! per-gun recoil multipliers!

This commit is contained in:
Hatterhat
2022-08-05 16:00:19 -05:00
parent 2d405f7bc8
commit 959fa45d3c
4 changed files with 16 additions and 9 deletions

View File

@@ -254,16 +254,13 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(!M || !M.client)
return
var/client/C = M.client
var/client_screenshake = (C.prefs.recoil_screenshake * 0.01)
strength *= client_screenshake
var/recoil_x = -sin(angle)*4*strength + rand(-strength, strength)
var/recoil_y = -cos(angle)*4*strength + rand(-strength, strength)
animate(C, pixel_x=recoil_x, pixel_y=recoil_y, time=1, easing=SINE_EASING|EASE_OUT, flags=ANIMATION_PARALLEL|ANIMATION_RELATIVE)
addtimer(CALLBACK(GLOBAL_PROC, /proc/recoil_recover, M), 2)
/proc/recoil_recover(mob/M)
if(!M || !M.client)
return
var/client/C = M.client
animate(C, pixel_x=0, pixel_y=0, time=3, easing=SINE_EASING|EASE_IN)
animate(pixel_x=0, pixel_y=0, time=3, easing=SINE_EASING|EASE_IN) // according to bhjin this works on more recent byond versions
// if you havent updated uuh sucks to be you then
/proc/findname(msg)
if(!istext(msg))