-/* opp_there = get_opponent_da(&opp_d, &opp_a); */
-/* if (opp_there && (opp_a < 215 && opp_a > 145) && opp_d < 600) */
-/* return 1; */
- return 0;
+int16_t distance_from_opponent(int16_t x, int16_t y)
+{
+ int16_t oppx, oppy;
+ if (get_opponent_xy(&oppx, &oppy) < 0)
+ return -1;
+ return distance_between(x, y, oppx, oppy);