From 19fab849c008fc2b984370106622799fe61c150c Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Sun, 20 Dec 2015 11:09:21 -0800 Subject: [PATCH 1/2] Smooth pixel screens shakes! --- code/modules/mob/mob_helpers.dm | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 6041daadc2e..d25c59d964e 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -187,20 +187,26 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/shake_camera(mob/M, duration, strength=1) - spawn(0) - if(!M || !M.client || M.shakecamera) - return - var/oldeye=M.client.eye - var/x - M.shakecamera = 1 - for(x=0; x Date: Tue, 22 Dec 2015 02:04:39 -0800 Subject: [PATCH 2/2] improves pixel screen shakes --- code/modules/mob/mob_defines.dm | 1 - code/modules/mob/mob_helpers.dm | 21 ++++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 43a04102eff..22ee049a77b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -78,7 +78,6 @@ var/stunned = 0 var/weakened = 0 var/losebreath = 0//Carbon - var/shakecamera = 0 var/a_intent = "help"//Living var/m_intent = "run"//Living var/lastKnownIP = null diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d25c59d964e..dad3f016757 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -187,26 +187,21 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/shake_camera(mob/M, duration, strength=1) - set waitfor = 0 - if(!M || !M.client || M.shakecamera) + if(!M || !M.client || duration <= 0) return - M.shakecamera = 1 var/client/C = M.client var/oldx = C.pixel_x var/oldy = C.pixel_y - var/max = (strength+1)*world.icon_size - var/min = 0-((strength+1)*world.icon_size) + var/max = strength*world.icon_size + var/min = -(strength*world.icon_size) - for(var/i=0, i