Pixel Shifting for RP

Pixel Shifting for RP
This commit is contained in:
QuoteFox
2020-07-04 11:11:31 +01:00
parent 892d4064b6
commit faf0e4fae7
6 changed files with 53 additions and 4 deletions
+16 -4
View File
@@ -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 ..()
@@ -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/toggle_move_intent()
. = ..()
+1
View File
@@ -38,6 +38,7 @@
var/lying = 0
var/lying_prev = 0
var/canmove = 1
var/is_shifted = FALSE
//MOVEMENT SPEED
var/list/movespeed_modification //Lazy list, see mob_movespeed.dm
Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 1.1 KiB

+32
View File
@@ -23,3 +23,35 @@
var/turf/sourceturf = get_turf(src)
if(istype(speakturf) && istype(sourceturf) && !(speakturf in get_hear(5, sourceturf)))
. = "<citspan class='small'>[.]</citspan>" //Don't ask how the fuck this works. It just does.
/mob/verb/eastshift()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_x <= 16)
pixel_x++
is_shifted = TRUE
/mob/verb/westshift()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_x >= -16)
pixel_x--
is_shifted = TRUE
/mob/verb/northshift()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_y <= 16)
pixel_y++
is_shifted = TRUE
/mob/verb/southshift()
set hidden = TRUE
if(!canface())
return FALSE
if(pixel_y >= -16)
pixel_y--
is_shifted = TRUE