+/* check opponent position */
+void check_opponent(void)
+{
+ int16_t x, y;
+ uint8_t i, j;
+
+ if (get_opponent_xy(&x, &y) < 0)
+ return;
+
+ /* check for oranges after 5 seconds */
+ if (time_get_s() > 5) {
+ if (mainboard.our_color == I2C_COLOR_YELLOW) {
+ if (y < 500 && x < 500)
+ strat_db.our_oranges_count = 0;
+ if (y < 500 && x > AREA_X - 500)
+ strat_db.opp_oranges_count = 0;
+ }
+ else {
+ if (y > AREA_Y - 500 && x < 500)
+ strat_db.our_oranges_count = 0;
+ if (y > AREA_Y - 500 && x > AREA_X - 500)
+ strat_db.opp_oranges_count = 0;
+ }
+ }
+
+ /* malus for some tomatoes and cobs, visited by opponent */
+ if (xycoord_to_ijcoord(&x, &y, &i, &j) < 0)
+ return;
+
+ strat_db.wp_table[i][j].opp_visited = 1;
+}
+