3 #include "../../clib/clib.h" 4 #include "../../clib/random.h" 6 #include "../poltype.h" 8 #include "../uobject.h" 19 {+1, +1}, {0, +1}, {-1, +1}, {-1, 0}, {-1, -1}};
24 std::array<int, 7>
adjustments = {{0, +1, -1, +2, -2, +3, -3}};
62 if ( src->
x < dst->
x )
64 if ( src->
y < dst->
y )
66 else if ( src->
y == dst->
y )
71 else if ( src->
x == dst->
x )
73 if ( src->
y < dst->
y )
75 else if ( src->
y > dst->
y )
80 if ( src->
y < dst->
y )
82 else if ( src->
y == dst->
y )
97 else if ( src->
y == to_y )
102 else if ( src->
x == to_x )
106 else if ( src->
y > to_y )
113 else if ( src->
y == to_y )
124 using namespace Core;
129 else if ( from_y == to_y )
134 else if ( from_x == to_x )
138 else if ( from_y > to_y )
145 else if ( from_y == to_y )
169 if ( stricmp( dir,
"N" ) == 0 )
171 else if ( stricmp( dir,
"S" ) == 0 )
173 else if ( stricmp( dir,
"E" ) == 0 )
175 else if ( stricmp( dir,
"W" ) == 0 )
177 else if ( stricmp( dir,
"NE" ) == 0 )
179 else if ( stricmp( dir,
"SE" ) == 0 )
181 else if ( stricmp( dir,
"SW" ) == 0 )
183 else if ( stricmp( dir,
"NW" ) == 0 )
Core::UFACING direction_away(const Character *src, Core::xcoord from_x, Core::ycoord from_y)
const char * FacingStr(Core::UFACING facing)
Core::UFACING GetRandomFacing()
Core::UFACING direction_toward(Core::xcoord from_x, Core::ycoord from_y, Core::xcoord to_x, Core::ycoord to_y)
virtual UObject * toplevel_owner()
std::array< int, 7 > adjustments
bool DecodeFacing(const char *dir, Core::UFACING &facing)