From 992d25ea081152faf9fe004bfc3369e493f641ad Mon Sep 17 00:00:00 2001 From: SandPoot Date: Tue, 21 Feb 2023 14:25:29 -0300 Subject: [PATCH] Revert "pixelshift + layering" This reverts commit 51818478c5f93e784dad916c188902e5f110d1ab. --- code/__SANDCODE/DEFINES/keybindings.dm | 1 - code/game/atoms.dm | 5 - code/modules/keybindings/keybind/movement.dm | 4 +- code/modules/mob/mob.dm | 4 +- code/modules/mob/mob_defines.dm | 2 - code/modules/mob/mob_movement.dm | 8 -- .../modules/mob/living/living_movement.dm | 2 - .../code/modules/pixel_shift/pixel_shift.dm | 101 ------------------ tgstation.dme | 2 - 9 files changed, 4 insertions(+), 125 deletions(-) delete mode 100644 code/__SANDCODE/DEFINES/keybindings.dm delete mode 100644 modular_sand/code/modules/pixel_shift/pixel_shift.dm diff --git a/code/__SANDCODE/DEFINES/keybindings.dm b/code/__SANDCODE/DEFINES/keybindings.dm deleted file mode 100644 index ac65f5acdb..0000000000 --- a/code/__SANDCODE/DEFINES/keybindings.dm +++ /dev/null @@ -1 +0,0 @@ -#define COMSIG_KB_MOB_PIXELSHIFT "keybinding_mob_pixelshift" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index ad7b29ebab..03338e9eaa 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -106,11 +106,6 @@ /// A luminescence-shifted value of the last color calculated for chatmessage overlays var/chat_color_darkened - // Use SET_BASE_PIXEL(x, y) to set these in typepath definitions, it'll handle pixel_x and y for you - ///Default pixel x shifting for the atom's icon. - var/base_pixel_x = 0 - ///Default pixel y shifting for the atom's icon. - var/base_pixel_y = 0 ///Used for changing icon states for different base sprites. var/base_icon_state diff --git a/code/modules/keybindings/keybind/movement.dm b/code/modules/keybindings/keybind/movement.dm index 4e14b69ae9..296b127cb4 100644 --- a/code/modules/keybindings/keybind/movement.dm +++ b/code/modules/keybindings/keybind/movement.dm @@ -74,7 +74,7 @@ var/mob/M = user.mob M.westface() return TRUE -/* + /datum/keybinding/mob/shift_north hotkey_keys = list("CtrlShiftW", "CtrlShiftNorth") name = "pixel_shift_north" @@ -122,7 +122,7 @@ var/mob/M = user.mob M.westshift() return TRUE -*/ + /datum/keybinding/living/hold_sprint hotkey_keys = list() classic_keys = list() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 8794f2f9a3..63021287e5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -669,7 +669,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) setDir(SOUTH) client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY return TRUE -/* + /mob/verb/eastshift() set hidden = TRUE if(!canface()) @@ -701,7 +701,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) if(pixel_y >= -32) 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 4f61a0260b..138a3b9662 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -54,8 +54,6 @@ var/resting = 0 //Carbon var/lying = 0 var/lying_prev = 0 - - /// Whether the mob is pixel shifted or not var/is_shifted = FALSE /// List of movement speed modifiers applying to this mob diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 83f7bbbd82..1da355a419 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -45,14 +45,6 @@ if(mob.force_moving) return FALSE - // Sandstorm Edit - if(mob.shifting) - mob.pixel_shift(direction) - return FALSE - else if(mob.is_shifted) - mob.unpixel_shift() - // - var/mob/living/L = mob //Already checked for isliving earlier if(L.incorporeal_move) //Move though walls Process_Incorpmove(direction) diff --git a/modular_sand/code/modules/mob/living/living_movement.dm b/modular_sand/code/modules/mob/living/living_movement.dm index 4a0464ef6b..bf9c5e2912 100644 --- a/modular_sand/code/modules/mob/living/living_movement.dm +++ b/modular_sand/code/modules/mob/living/living_movement.dm @@ -15,7 +15,6 @@ to_chat(src, span_warning("You cannot increase your layer priority any further.")) return - layer = clamp(layer, MOB_LAYER_SHIFT_MIN, MOB_LAYER_SHIFT_MAX) layer += MOB_LAYER_SHIFT_INCREMENT var/layer_priority = FLOOR((layer - MOB_LAYER) * 100, 1) // Just for text feedback to_chat(src, span_notice("Your layer priority is now [layer_priority].")) @@ -32,7 +31,6 @@ to_chat(src, span_warning("You cannot decrease your layer priority any further.")) return - layer = clamp(layer, MOB_LAYER_SHIFT_MIN, MOB_LAYER_SHIFT_MAX) layer -= MOB_LAYER_SHIFT_INCREMENT var/layer_priority = FLOOR((layer - MOB_LAYER) * 100, 1) // Just for text feedback to_chat(src, span_notice("Your layer priority is now [layer_priority].")) diff --git a/modular_sand/code/modules/pixel_shift/pixel_shift.dm b/modular_sand/code/modules/pixel_shift/pixel_shift.dm deleted file mode 100644 index 253ab050f3..0000000000 --- a/modular_sand/code/modules/pixel_shift/pixel_shift.dm +++ /dev/null @@ -1,101 +0,0 @@ -#define MAXIMUM_PIXEL_SHIFT 16 -#define PASSABLE_SHIFT_THRESHOLD 8 - -/mob - /// If we are in the shifting setting. - var/shifting = FALSE - - /// Takes the four cardinal direction defines. Any atoms moving into this atom's tile will be allowed to from the added directions. - var/passthroughable = NONE - -/datum/keybinding/mob/pixel_shift - hotkey_keys = list("B") - name = "pixel_shift" - full_name = "Pixel Shift" - description = "Shift your characters offset." - category = CATEGORY_MOVEMENT - keybind_signal = COMSIG_KB_MOB_PIXELSHIFT - -/datum/keybinding/mob/pixel_shift/down(client/user) - . = ..() - if(.) - return - var/mob/M = user.mob - M.shifting = TRUE - return TRUE - -/datum/keybinding/mob/pixel_shift/up(client/user) - . = ..() - if(.) - return - var/mob/M = user.mob - M.shifting = FALSE - return TRUE - -/mob/proc/unpixel_shift() - return - -/mob/living/unpixel_shift() - . = ..() - passthroughable = NONE - if(is_shifted) - is_shifted = FALSE - pixel_x = get_standard_pixel_x_offset() + base_pixel_x - client?.pixel_x = 0 - pixel_y = get_standard_pixel_y_offset() + base_pixel_y - client?.pixel_y = 0 - -/mob/proc/pixel_shift(direction) - return - -/mob/living/set_pull_offsets(mob/living/pull_target, grab_state) - pull_target.unpixel_shift() - return ..() - -/mob/living/reset_pull_offsets(mob/living/pull_target, override) - pull_target.unpixel_shift() - return ..() - -/mob/living/pixel_shift(direction) - passthroughable = NONE - // switch(direction) // diagonal pixel-shifting, rejoice - if(CHECK_BITFIELD(direction, NORTH)) - if(pixel_y <= MAXIMUM_PIXEL_SHIFT + base_pixel_y) - pixel_y++ - client?.pixel_y++ - is_shifted = TRUE - if(CHECK_BITFIELD(direction, EAST)) - if(pixel_x <= MAXIMUM_PIXEL_SHIFT + base_pixel_x) - pixel_x++ - client?.pixel_x++ - is_shifted = TRUE - if(CHECK_BITFIELD(direction, SOUTH)) - if(pixel_y >= -MAXIMUM_PIXEL_SHIFT + base_pixel_y) - pixel_y-- - client?.pixel_y-- - is_shifted = TRUE - if(CHECK_BITFIELD(direction, WEST)) - if(pixel_x >= -MAXIMUM_PIXEL_SHIFT + base_pixel_x) - pixel_x-- - client?.pixel_x-- - is_shifted = TRUE - - // Yes, I know this sets it to true for everything if more than one is matched. - // Movement doesn't check diagonals, and instead just checks EAST or WEST, depending on where you are for those. - if(pixel_y > PASSABLE_SHIFT_THRESHOLD) - passthroughable |= EAST | SOUTH | WEST - if(pixel_x > PASSABLE_SHIFT_THRESHOLD) - passthroughable |= NORTH | SOUTH | WEST - if(pixel_y < -PASSABLE_SHIFT_THRESHOLD) - passthroughable |= NORTH | EAST | WEST - if(pixel_x < -PASSABLE_SHIFT_THRESHOLD) - passthroughable |= NORTH | EAST | SOUTH - -/mob/living/CanAllowThrough(atom/movable/mover, turf/target) - // Make sure to not allow projectiles of any kind past where they normally wouldn't. - if(!istype(mover, /obj/item/projectile) && !mover.throwing && passthroughable & mover.dir) - return TRUE - return ..() - -#undef MAXIMUM_PIXEL_SHIFT -#undef PASSABLE_SHIFT_THRESHOLD diff --git a/tgstation.dme b/tgstation.dme index 4c22ae184f..c5e710ef84 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -237,7 +237,6 @@ #include "code\__HELPERS\sorts\TimSort.dm" #include "code\__SANDCODE\DEFINES\chat.dm" #include "code\__SANDCODE\DEFINES\DNA.dm" -#include "code\__SANDCODE\DEFINES\keybindings.dm" #include "code\__SANDCODE\DEFINES\language.dm" #include "code\__SANDCODE\DEFINES\lewd.dm" #include "code\__SANDCODE\DEFINES\loadout.dm" @@ -4192,7 +4191,6 @@ #include "modular_sand\code\modules\mob\living\simple_animal\hostile\mining_mobs\elites\legionnaire.dm" #include "modular_sand\code\modules\mob\living\simple_animal\hostile\mining_mobs\elites\pandora.dm" #include "modular_sand\code\modules\movespeed\modifiers\components.dm" -#include "modular_sand\code\modules\pixel_shift\pixel_shift.dm" #include "modular_sand\code\modules\power\cell.dm" #include "modular_sand\code\modules\power\lightning.dm" #include "modular_sand\code\modules\power\port_gen.dm"