SSInput and Diagonal Movement

This commit is contained in:
Chompstation Bot
2021-07-07 18:35:44 +00:00
parent 7e10238662
commit 1513fbe0cb
20 changed files with 4445 additions and 113 deletions

View File

@@ -96,6 +96,19 @@
if ("SOUTHEAST") return 6
if ("SOUTHWEST") return 10
// Turns a direction into text showing all bits set
/proc/dirs2text(direction)
if(!direction)
return ""
var/list/dirs = list()
if(direction & NORTH) dirs += "NORTH"
if(direction & SOUTH) dirs += "SOUTH"
if(direction & EAST) dirs += "EAST"
if(direction & WEST) dirs += "WEST"
if(direction & UP) dirs += "UP"
if(direction & DOWN) dirs += "DOWN"
return dirs.Join(" ")
// Converts an angle (degrees) into an ss13 direction
/proc/angle2dir(var/degree)
degree = (degree + 22.5) % 365 // 22.5 = 45 / 2