diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 0e9db05c48f..209e9abe4ae 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -231,7 +231,12 @@ Please contact me on #coderbus IRC. ~Carn x // Scale/translate/rotate and apply the transform. var/matrix/M = matrix() if(lying) - M.Turn(pick(90, -90)) + var/turn_angle = pick(-90, 90) + if(dir == WEST) + turn_angle = -90 + if(dir == EAST) + turn_angle = 90 + M.Turn(turn_angle) M.Scale(desired_scale_y, desired_scale_x) M.Translate(1, -6-default_pixel_z) else diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7b9be7946d2..377b6df36d9 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -501,9 +501,16 @@ default behaviour is: if(affecting_mob) affecting_mob.handle_grab_damage() -/mob/living/Move(a, b, flag) +/mob/living/Move(newloc, direct, flag) if (buckled) return + // Modpack edit - pixel shifting + if(shifting) + pixel_shift(direct) + return FALSE + else if(is_shifted) + unpixel_shift() + // end modpack edit . = ..() handle_grabs_after_move() if (s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much. diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f755dbc9d42..4e0603a00c0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -594,7 +594,7 @@ // facing verbs /mob/proc/canface() - return !incapacitated() + return !incapacitated(INCAPACITATION_UNRESISTING) // Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet. /mob/proc/can_stand_overridden() diff --git a/maps/modpack_testing/modpack_testing.dm b/maps/modpack_testing/modpack_testing.dm index 0fba6a622bd..d618a33a8e5 100644 --- a/maps/modpack_testing/modpack_testing.dm +++ b/maps/modpack_testing/modpack_testing.dm @@ -23,6 +23,7 @@ #include "../../mods/content/psionics/_psionics.dme" #include "../../mods/content/shards/_shards.dme" #include "../../mods/content/xenobiology/_xenobiology.dme" + #include "../../mods/content/pixel_shifting/_pixel_shifting.dme" #include "../../mods/mobs/dionaea/_dionaea.dme" #include "../../mods/mobs/borers/_borers.dme" diff --git a/maps/torch/torch.dm b/maps/torch/torch.dm index a6f8fd8cd44..7d973960598 100644 --- a/maps/torch/torch.dm +++ b/maps/torch/torch.dm @@ -18,6 +18,7 @@ #include "..\..\mods\content\genemodding\_genemodding.dme" #include "..\..\mods\content\hearthfoods\_hearthfoods.dme" #include "..\..\mods\content\shards\_shards.dme" + #include "..\..\mods\content\pixel_shifting\_pixel_shifting.dme" #include "..\..\mods\verbs\antighost\_subtle_antighost.dme" diff --git a/mods/content/pixel_shifting/_pixel_shifting.dme b/mods/content/pixel_shifting/_pixel_shifting.dme new file mode 100644 index 00000000000..6251f7cf367 --- /dev/null +++ b/mods/content/pixel_shifting/_pixel_shifting.dme @@ -0,0 +1,14 @@ +#ifndef MODPACK_PIXELSHIFTING +#define MODPACK_PIXELSHIFTING +#include "pixel_shifting.dm" +#include "keybindings\mob.dm" +#endif +// BEGIN_INTERNALS +// END_INTERNALS +// BEGIN_FILE_DIR +#define FILE_DIR . +// END_FILE_DIR +// BEGIN_PREFERENCES +// END_PREFERENCES +// BEGIN_INCLUDE +// END_INCLUDE diff --git a/mods/content/pixel_shifting/keybindings/mob.dm b/mods/content/pixel_shifting/keybindings/mob.dm new file mode 100644 index 00000000000..67b349ab618 --- /dev/null +++ b/mods/content/pixel_shifting/keybindings/mob.dm @@ -0,0 +1,15 @@ +/datum/keybinding/mob/pixel_shift + hotkey_keys = list("Alt") + name = "pixel_shifting" + full_name = "Pixel shift" + description = "Hold this down to pixel shift the icon of your current mob." + +/datum/keybinding/mob/pixel_shift/down(client/user) + var/mob/client_mob = user.mob + client_mob.shifting = TRUE + return TRUE + +/datum/keybinding/mob/pixel_shift/up(client/user) + var/mob/client_mob = user.mob + client_mob.shifting = FALSE + return TRUE diff --git a/mods/content/pixel_shifting/pixel_shifting.dm b/mods/content/pixel_shifting/pixel_shifting.dm new file mode 100644 index 00000000000..8cea0aab2c0 --- /dev/null +++ b/mods/content/pixel_shifting/pixel_shifting.dm @@ -0,0 +1,44 @@ +/mob + /// Wether the mob is currently pixel shifted or not + var/is_shifted + /// If the mob is currently pixel shifting + var/shifting + +/mob/proc/unpixel_shift() + return + +/mob/living/unpixel_shift() + if(is_shifted) + is_shifted = FALSE + pixel_x = initial(pixel_x) + pixel_y = initial(pixel_y) + +/mob/proc/pixel_shift(direction) + return + +/mob/living/pixel_shift(direction) + switch(direction) + if(NORTH) + if(!canface()) + return FALSE + if(pixel_y <= 16) + pixel_y++ + is_shifted = TRUE + if(EAST) + if(!canface()) + return FALSE + if(pixel_x <= 16) + pixel_x++ + is_shifted = TRUE + if(SOUTH) + if(!canface()) + return FALSE + if(pixel_y >= -16) + pixel_y-- + is_shifted = TRUE + if(WEST) + if(!canface()) + return FALSE + if(pixel_x >= -16) + pixel_x-- + is_shifted = TRUE