Link do najnowszej wersji: Zarejestruj/Zaloguj się, aby zobaczyć link.
Ai wykonane przez eplipswich
int face_distance()
// distance to target, positive when faced towards it
// 80 pixels may be considered as a maximum distance allowing close combat
{
return ( self.x - target.x ) * ( 2 * ( self.facing ? 1 : 0 ) - 1 );
}
bool dist_between( int min, int max )
// checks whether distance to target is within bounds
{
return ( ( face_distance() < max ) && ( face_distance() > min ) );
}
bool z_axis_dist( int dist )
{
return ( abs( self.z - target.z ) <= dist ) ? true : false;
}
bool same_z_axis()
// checks whether our character is on the same z axis as the opponent
{
return ( abs( self.z - target.z ) <= 8 ) ? true : false;
}
int ego()
{
if( dist_between(150,200) && same_z_axis() && ( self.mp >= 200 ) && ( target.state != 14 ))
{
if( self.facing )
{
DlJ();
}
else
{
DrJ();
}
return 0;
}
if( dist_between(150,200) && ( self.mp >= 200 ) )
{
DuJ();
return 0;
}
if( dist_between(100,180) && same_z_axis() && ( self.mp >= 80 ) )
{
if( self.facing )
{
DlA();
}
else
{
DrA();
}
return 0;
}
if( dist_between(180,275) && ( self.mp >= 75 ) && ( target.state != 14 ))
{
DdJ();
return 0;
}
return 0;
} |