mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Merge pull request #13881 from VOREStation/upstream-merge-8199
[MIRROR] Ports Diagonal Movement [READY FOR MERGE]
This commit is contained in:
@@ -98,12 +98,18 @@
|
|||||||
if(!direction)
|
if(!direction)
|
||||||
return ""
|
return ""
|
||||||
var/list/dirs = list()
|
var/list/dirs = list()
|
||||||
if(direction & NORTH) dirs += "NORTH"
|
if(direction & NORTH)
|
||||||
if(direction & SOUTH) dirs += "SOUTH"
|
dirs += "NORTH"
|
||||||
if(direction & EAST) dirs += "EAST"
|
if(direction & SOUTH)
|
||||||
if(direction & WEST) dirs += "WEST"
|
dirs += "SOUTH"
|
||||||
if(direction & UP) dirs += "UP"
|
if(direction & EAST)
|
||||||
if(direction & DOWN) dirs += "DOWN"
|
dirs += "EAST"
|
||||||
|
if(direction & WEST)
|
||||||
|
dirs += "WEST"
|
||||||
|
if(direction & UP)
|
||||||
|
dirs += "UP"
|
||||||
|
if(direction & DOWN)
|
||||||
|
dirs += "DOWN"
|
||||||
return dirs.Join(" ")
|
return dirs.Join(" ")
|
||||||
|
|
||||||
// Converts an angle (degrees) into an ss13 direction
|
// Converts an angle (degrees) into an ss13 direction
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ var/list/reverse_dir = list( // reverse_dir[dir] = reverse of dir
|
|||||||
41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21,
|
41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21,
|
||||||
23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63
|
23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63
|
||||||
)
|
)
|
||||||
|
var/global/const/SQRT_TWO = 1.41421356237
|
||||||
|
|
||||||
var/datum/configuration/config = null
|
var/datum/configuration/config = null
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
// Set a client's focus to an object and override these procs on that object to let it handle keypresses
|
// Set a client's focus to an object and override these procs on that object to let it handle keypresses
|
||||||
|
|
||||||
/datum/proc/key_down(key, client/user) // Called when a key is pressed down initially
|
/// Called when a key is pressed down initially
|
||||||
|
/datum/proc/key_down(key, client/user)
|
||||||
return
|
return
|
||||||
/datum/proc/key_up(key, client/user) // Called when a key is released
|
|
||||||
|
/// Called when a key is released
|
||||||
|
/datum/proc/key_up(key, client/user)
|
||||||
return
|
return
|
||||||
/datum/proc/keyLoop(client/user) // Called once every server tick
|
|
||||||
|
/// Called once every server tick
|
||||||
|
/datum/proc/keyLoop(client/user)
|
||||||
set waitfor = FALSE
|
set waitfor = FALSE
|
||||||
return
|
return
|
||||||
|
|
||||||
/// Set mob's focus
|
/// Set mob's focus. TODO: Decide if required.
|
||||||
/// TODO - Do we even need this concept?
|
|
||||||
/mob/proc/set_focus(datum/new_focus)
|
/mob/proc/set_focus(datum/new_focus)
|
||||||
if(focus == new_focus)
|
if(focus == new_focus)
|
||||||
return
|
return
|
||||||
@@ -20,15 +24,26 @@
|
|||||||
if(!keys)
|
if(!keys)
|
||||||
return ""
|
return ""
|
||||||
var/list/out = list()
|
var/list/out = list()
|
||||||
if(keys & NORTH_KEY) out += "NORTH"
|
if(keys & NORTH_KEY)
|
||||||
if(keys & SOUTH_KEY) out += "SOUTH"
|
out += "NORTH"
|
||||||
if(keys & EAST_KEY) out += "EAST"
|
if(keys & SOUTH_KEY)
|
||||||
if(keys & WEST_KEY) out += "WEST"
|
out += "SOUTH"
|
||||||
if(keys & W_KEY) out += "W"
|
if(keys & EAST_KEY)
|
||||||
if(keys & A_KEY) out += "A"
|
out += "EAST"
|
||||||
if(keys & S_KEY) out += "S"
|
if(keys & WEST_KEY)
|
||||||
if(keys & D_KEY) out += "D"
|
out += "WEST"
|
||||||
if(keys & CTRL_KEY) out += "CTRL"
|
if(keys & W_KEY)
|
||||||
if(keys & SHIFT_KEY) out += "SHIFT"
|
out += "W"
|
||||||
if(keys & ALT_KEY) out += "ALT"
|
if(keys & A_KEY)
|
||||||
|
out += "A"
|
||||||
|
if(keys & S_KEY)
|
||||||
|
out += "S"
|
||||||
|
if(keys & D_KEY)
|
||||||
|
out += "D"
|
||||||
|
if(keys & CTRL_KEY)
|
||||||
|
out += "CTRL"
|
||||||
|
if(keys & SHIFT_KEY)
|
||||||
|
out += "SHIFT"
|
||||||
|
if(keys & ALT_KEY)
|
||||||
|
out += "ALT"
|
||||||
return out.Join(" ")
|
return out.Join(" ")
|
||||||
|
|||||||
@@ -233,4 +233,4 @@
|
|||||||
|
|
||||||
var/list/progressbars = null //VOREStation Edit
|
var/list/progressbars = null //VOREStation Edit
|
||||||
|
|
||||||
var/datum/focus //What receives our keyboard inputs. src by default // VOREStation Add - Key Handling
|
var/datum/focus //What receives our keyboard inputs. src by default
|
||||||
|
|||||||
@@ -159,8 +159,8 @@
|
|||||||
|
|
||||||
// We're still cooling down from the last move
|
// We're still cooling down from the last move
|
||||||
if(!my_mob.checkMoveCooldown())
|
if(!my_mob.checkMoveCooldown())
|
||||||
return
|
|
||||||
DEBUG_INPUT("--------")
|
DEBUG_INPUT("--------")
|
||||||
|
return
|
||||||
next_move_dir_add = 0 // This one I *think* exists so you can tap move and it will move even if delay isn't quite up.
|
next_move_dir_add = 0 // This one I *think* exists so you can tap move and it will move even if delay isn't quite up.
|
||||||
next_move_dir_sub = 0 // I'm not really sure why next_move_dir_sub even exists.
|
next_move_dir_sub = 0 // I'm not really sure why next_move_dir_sub even exists.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user