Skip to content

Commit

Permalink
Pixelshifting 2: Electric Boogaloo (Alanii#366)
Browse files Browse the repository at this point in the history
* pixel shift phase 1

* gotovorestation

* i'm a fucking retard

* undoes my fucky wuckies
  • Loading branch information
Takykardi authored Dec 6, 2020
1 parent b325c89 commit 3c470c2
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/datums/movement/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
mob.last_quick_move_time = world.time
mob.adjust_stamina(-(mob.get_stamina_used_per_step() * (1+mob.encumbrance())))
mob.handle_embedded_and_stomach_objects()

mob.moving = 0

/datum/movement_handler/mob/movement/MayMove(var/mob/mover)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ default behaviour is:
if (buckled)
return

if(is_shifted)
is_shifted = FALSE
pixel_x = default_pixel_x
pixel_y = default_pixel_y

if(get_dist(src, pulling) > 1)
stop_pulling()

Expand Down
35 changes: 35 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,41 @@
set hidden = 1
set_face_dir(client.client_dir(WEST))

/mob/proc/can_shift()
return !(incapacitated() || buckled || grabbed_by.len)

/mob/verb/shiftnorth()
set hidden = TRUE
if(!canface() || !can_shift())
return FALSE
if(pixel_y <= 16)
pixel_y++
is_shifted = TRUE

/mob/verb/shiftsouth()
set hidden = TRUE
if(!canface() || !can_shift())
return FALSE
if(pixel_y >= -8)
pixel_y--
is_shifted = TRUE

/mob/verb/shiftwest()
set hidden = TRUE
if(!canface() || !can_shift())
return FALSE
if(pixel_x >= -8)
pixel_x--
is_shifted = TRUE

/mob/verb/shifteast()
set hidden = TRUE
if(!canface() || !can_shift())
return FALSE
if(pixel_x <= 8)
pixel_x++
is_shifted = TRUE

/mob/proc/adjustEarDamage()
return

Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
var/confused = 0 //Carbon
var/sleeping = 0 //Carbon
var/resting = 0 //Carbon
var/is_shifted = FALSE
var/lying = 0
var/lying_prev = 0

Expand Down
42 changes: 42 additions & 0 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ macro "borghotkeymode"
elem
name = "CTRL+West"
command = "westface"
elem
name = "CTRL+SHIFT+West"
command = "shiftwest"
elem
name = "West+REP"
command = ".moveleft"
Expand All @@ -32,6 +35,9 @@ macro "borghotkeymode"
elem
name = "CTRL+North"
command = "northface"
elem
name = "CTRL+SHIFT+North"
command = "shiftnorth"
elem
name = "North+REP"
command = ".moveup"
Expand All @@ -41,6 +47,9 @@ macro "borghotkeymode"
elem
name = "CTRL+East"
command = "eastface"
elem
name = "CTRL+SHIFT+East"
command = "shifteast"
elem
name = "East+REP"
command = ".moveright"
Expand All @@ -50,6 +59,9 @@ macro "borghotkeymode"
elem
name = "CTRL+South"
command = "southface"
elem
name = "CTRL+SHIFT+South"
command = "shiftsouth"
elem
name = "ALT+A"
command = "westfaceperm"
Expand Down Expand Up @@ -277,6 +289,9 @@ macro "macro"
elem
name = "CTRL+West"
command = "westface"
elem
name = "CTRL+SHIFT+West"
command = "shiftwest"
elem
name = "West+REP"
command = ".moveleft"
Expand All @@ -286,6 +301,9 @@ macro "macro"
elem
name = "CTRL+North"
command = "northface"
elem
name = "CTRL+SHIFT+North"
command = "shiftnorth"
elem
name = "North+REP"
command = ".moveup"
Expand All @@ -295,6 +313,9 @@ macro "macro"
elem
name = "CTRL+East"
command = "eastface"
elem
name = "CTRL+SHIFT+East"
command = "shifteast"
elem
name = "East+REP"
command = ".moveright"
Expand All @@ -304,6 +325,9 @@ macro "macro"
elem
name = "CTRL+South"
command = "southface"
elem
name = "CTRL+SHIFT+South"
command = "shiftsouth"
elem
name = "South+REP"
command = ".movedown"
Expand Down Expand Up @@ -453,6 +477,9 @@ macro "hotkeymode"
elem
name = "CTRL+West"
command = "westface"
elem
name = "CTRL+SHIFT+West"
command = "shiftwest"
elem
name = "West+REP"
command = ".moveleft"
Expand All @@ -462,6 +489,9 @@ macro "hotkeymode"
elem
name = "CTRL+North"
command = "northface"
elem
name = "CTRL+SHIFT+North"
command = "shiftnorth"
elem
name = "North+REP"
command = ".moveup"
Expand All @@ -471,6 +501,9 @@ macro "hotkeymode"
elem
name = "CTRL+East"
command = "eastface"
elem
name = "CTRL+SHIFT+East"
command = "shifteast"
elem
name = "East+REP"
command = ".moveright"
Expand All @@ -480,6 +513,9 @@ macro "hotkeymode"
elem
name = "CTRL+South"
command = "southface"
elem
name = "CTRL+SHIFT+South"
command = "shiftsouth"s
elem
name = "ALT+A"
command = "westfaceperm"
Expand Down Expand Up @@ -743,6 +779,9 @@ macro "borgmacro"
elem
name = "CTRL+East"
command = "eastface"
elem
name = "CTRL+SHIFT+West"
command = "shiftwest"
elem
name = "East+REP"
command = ".moveright"
Expand All @@ -752,6 +791,9 @@ macro "borgmacro"
elem
name = "CTRL+South"
command = "southface"
elem
name = "CTRL+SHIFT+South"
command = "shiftsouth"
elem
name = "South+REP"
command = ".movedown"
Expand Down

0 comments on commit 3c470c2

Please sign in to comment.