mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-28 21:57:03 +01:00
tl;dr level collections that can easily be logically restructured/moved as necessary will eventually be used for radio and overmaps location resolution. this is the last part of https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/4841 that has not yet been integrated. this will be a draft for a while. --------- Co-authored-by: LetterN <24603524+LetterN@users.noreply.github.com>
73 lines
1.4 KiB
Plaintext
73 lines
1.4 KiB
Plaintext
GLOBAL_LIST_INIT(dmm_orientations, list(
|
|
TEXT_NORTH = new /datum/dmm_orientation/north,
|
|
TEXT_SOUTH = new /datum/dmm_orientation/south,
|
|
TEXT_EAST = new /datum/dmm_orientation/east,
|
|
TEXT_WEST = new /datum/dmm_orientation/west
|
|
))
|
|
|
|
/datum/dmm_orientation
|
|
var/orientation
|
|
var/invert_x
|
|
var/invert_y
|
|
var/swap_xy
|
|
var/xi
|
|
var/yi
|
|
var/turn_angle
|
|
|
|
/datum/dmm_orientation/proc/populate_context(datum/dmm_context/context)
|
|
context.loaded_orientation = orientation
|
|
context.loaded_orientation_invert_x = invert_x
|
|
context.loaded_orientation_invert_y = invert_y
|
|
context.loaded_orientation_swap_xy = swap_xy
|
|
context.loaded_orientation_xi = xi
|
|
context.loaded_orientation_yi = yi
|
|
context.loaded_orientation_turn_angle = round(SIMPLIFY_DEGREES(turn_angle), 90)
|
|
|
|
/datum/dmm_orientation/north
|
|
orientation = NORTH
|
|
invert_y = TRUE
|
|
invert_x = TRUE
|
|
swap_xy = FALSE
|
|
xi = -1
|
|
yi = 1
|
|
turn_angle = 180
|
|
|
|
/datum/dmm_orientation/south
|
|
orientation = SOUTH
|
|
invert_y = FALSE
|
|
invert_x = FALSE
|
|
swap_xy = FALSE
|
|
xi = 1
|
|
yi = -1
|
|
turn_angle = 0
|
|
|
|
/datum/dmm_orientation/east
|
|
orientation = EAST
|
|
invert_y = TRUE
|
|
invert_x = FALSE
|
|
swap_xy = TRUE
|
|
xi = 1
|
|
yi = 1
|
|
turn_angle = 90
|
|
|
|
/datum/dmm_orientation/west
|
|
orientation = WEST
|
|
invert_y = FALSE
|
|
invert_x = TRUE
|
|
swap_xy = TRUE
|
|
xi = -1
|
|
yi = -1
|
|
turn_angle = 270
|
|
|
|
// for looking up dir from south to turn angle
|
|
GLOBAL_REAL_LIST(dmm_orientation_turn) = list(
|
|
180, // north
|
|
0, // south
|
|
0,
|
|
90, // east
|
|
0,
|
|
0,
|
|
0,
|
|
270, // west
|
|
)
|