From 86baaf37101f8a396d28a9068f392d5436950eed Mon Sep 17 00:00:00 2001 From: monster860 Date: Fri, 6 Mar 2020 04:31:46 -0500 Subject: [PATCH 1/4] Pixel shifting for ERP --- code/modules/keybindings/bindings_mob.dm | 20 +++++++++++++---- code/modules/mob/mob.dm | 28 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/code/modules/keybindings/bindings_mob.dm b/code/modules/keybindings/bindings_mob.dm index 964ee65047..36b4775c34 100644 --- a/code/modules/keybindings/bindings_mob.dm +++ b/code/modules/keybindings/bindings_mob.dm @@ -61,16 +61,28 @@ if(client.keys_held["Ctrl"]) switch(SSinput.movement_keys[_key]) if(NORTH) - northface() + if(client.keys_held["Shift"]) + northshift() + else + northface() return if(SOUTH) - southface() + if(client.keys_held["Shift"]) + southshift() + else + southface() return if(WEST) - westface() + if(client.keys_held["Shift"]) + westshift() + else + westface() return if(EAST) - eastface() + if(client.keys_held["Shift"]) + eastshift() + else + eastface() return return ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a523c22d53..43f4b82add 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -706,6 +706,34 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY return TRUE +/mob/verb/eastshift() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x <= 16) + pixel_x++ + +/mob/verb/westshift() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x >= -16) + pixel_x-- + +/mob/verb/northshift() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y >= 16) + pixel_y++ + +/mob/verb/southshift() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y <= -16) + pixel_y-- + /mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check return FALSE From 4a108d7a9a4762e4daeb20333b1ca401170e1f24 Mon Sep 17 00:00:00 2001 From: monster860 Date: Fri, 6 Mar 2020 04:40:22 -0500 Subject: [PATCH 2/4] fixes oopsie --- code/modules/mob/mob.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 43f4b82add..baab7ead40 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -724,14 +724,14 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) set hidden = TRUE if(!canface()) return FALSE - if(pixel_y >= 16) + if(pixel_y <= 16) pixel_y++ /mob/verb/southshift() set hidden = TRUE if(!canface()) return FALSE - if(pixel_y <= -16) + if(pixel_y >= -16) pixel_y-- /mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check From c8535275cef034cb2639dff0c03b503a213d0ca1 Mon Sep 17 00:00:00 2001 From: monster860 Date: Fri, 6 Mar 2020 22:05:56 -0500 Subject: [PATCH 3/4] In case it wasn't shitcode enough, makes it reset on move --- code/modules/mob/living/living_movement.dm | 4 ++++ code/modules/mob/mob.dm | 4 ++++ code/modules/mob/mob_defines.dm | 1 + 3 files changed, 9 insertions(+) diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index f278d22891..410e5b28db 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -1,6 +1,10 @@ /mob/living/Moved() . = ..() update_turf_movespeed(loc) + if(is_shifted) + is_shifted = FALSE + pixel_x = get_standard_pixel_x_offset(lying) + pixel_y = get_standard_pixel_y_offset(lying) /mob/living/CanPass(atom/movable/mover, turf/target) if((mover.pass_flags & PASSMOB)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index baab7ead40..07a01fcd88 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -712,6 +712,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return FALSE if(pixel_x <= 16) pixel_x++ + is_shifted = TRUE /mob/verb/westshift() set hidden = TRUE @@ -719,6 +720,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return FALSE if(pixel_x >= -16) pixel_x-- + is_shifted = TRUE /mob/verb/northshift() set hidden = TRUE @@ -726,6 +728,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return FALSE if(pixel_y <= 16) pixel_y++ + is_shifted = TRUE /mob/verb/southshift() set hidden = TRUE @@ -733,6 +736,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return FALSE if(pixel_y >= -16) pixel_y-- + is_shifted = TRUE /mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check return FALSE diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 638a3aa0e2..a9f2c09998 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -38,6 +38,7 @@ var/resting = 0 //Carbon var/lying = 0 var/lying_prev = 0 + var/is_shifted = 0 //MOVEMENT SPEED var/list/movespeed_modification //Lazy list, see mob_movespeed.dm From aaf494c66b440ef4e683c9e7e635a8906defaad0 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Tue, 10 Mar 2020 17:37:39 +0100 Subject: [PATCH 4/4] Update code/modules/mob/mob_defines.dm Co-Authored-By: kevinz000 <2003111+kevinz000@users.noreply.github.com> --- code/modules/mob/mob_defines.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index a9f2c09998..f47acbe3c4 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -38,7 +38,7 @@ var/resting = 0 //Carbon var/lying = 0 var/lying_prev = 0 - var/is_shifted = 0 + var/is_shifted = FALSE //MOVEMENT SPEED var/list/movespeed_modification //Lazy list, see mob_movespeed.dm