mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 02:24:11 +01:00
26dbd3fb61
## About The Pull Request Makes the parent organizational type for directional paths abstract. <img width="421" height="524" alt="image" src="https://github.com/user-attachments/assets/29a98a46-15cb-4932-b4e6-b9f0d5a1493a" /> ## Why It's Good For The Game These are not really intended to be spawned or mapped and its mostly an organizational type. ## Changelog N/A, SHOULD be non player-facing
73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
// Byond direction defines, because I want to put them somewhere.
|
|
// #define NORTH 1
|
|
// #define SOUTH 2
|
|
// #define EAST 4
|
|
// #define WEST 8
|
|
|
|
/// North direction as a string "[1]"
|
|
#define TEXT_NORTH "[NORTH]"
|
|
/// South direction as a string "[2]"
|
|
#define TEXT_SOUTH "[SOUTH]"
|
|
/// East direction as a string "[4]"
|
|
#define TEXT_EAST "[EAST]"
|
|
/// West direction as a string "[8]"
|
|
#define TEXT_WEST "[WEST]"
|
|
|
|
//dir macros
|
|
///Returns true if the dir is diagonal, false otherwise
|
|
#define ISDIAGONALDIR(d) (d&(d-1))
|
|
///True if the dir is north or south, false therwise
|
|
#define NSCOMPONENT(d) (d&(NORTH|SOUTH))
|
|
///True if the dir is east/west, false otherwise
|
|
#define EWCOMPONENT(d) (d&(EAST|WEST))
|
|
///Flips the dir for north/south directions
|
|
#define NSDIRFLIP(d) (d^(NORTH|SOUTH))
|
|
///Flips the dir for east/west directions
|
|
#define EWDIRFLIP(d) (d^(EAST|WEST))
|
|
|
|
/// Inverse direction, taking into account UP|DOWN if necessary.
|
|
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
|
|
|
|
/// Create directional subtypes for a path to simplify mapping.
|
|
#define MAPPING_DIRECTIONAL_HELPERS(path, offset) ##path/directional {\
|
|
abstract_type = ##path/directional; \
|
|
} \
|
|
##path/directional/north {\
|
|
dir = NORTH; \
|
|
pixel_y = offset; \
|
|
} \
|
|
##path/directional/south {\
|
|
dir = SOUTH; \
|
|
pixel_y = -offset; \
|
|
} \
|
|
##path/directional/east {\
|
|
dir = EAST; \
|
|
pixel_x = offset; \
|
|
} \
|
|
##path/directional/west {\
|
|
dir = WEST; \
|
|
pixel_x = -offset; \
|
|
}
|
|
|
|
/// Create diagonal subtypes for a path to simplify mapping.
|
|
#define MAPPING_DIAGONAL_HELPERS(path, offset) ##path/directional/northeast {\
|
|
dir = NORTHEAST; \
|
|
pixel_x = offset; \
|
|
pixel_y = offset; \
|
|
} \
|
|
##path/directional/northwest {\
|
|
dir = NORTHWEST; \
|
|
pixel_x = -offset; \
|
|
pixel_y = offset; \
|
|
} \
|
|
##path/directional/southeast {\
|
|
dir = SOUTHEAST; \
|
|
pixel_x = offset; \
|
|
pixel_y = -offset; \
|
|
} \
|
|
##path/directional/southwest {\
|
|
dir = SOUTHWEST; \
|
|
pixel_x = -offset; \
|
|
pixel_y = -offset; \
|
|
}
|