xi has come to an end for now as v1.0

This commit is contained in:
xixu-me committed 2023-12-02 03:04:16 +08:00
1 parent cc19e58872
commit 71750360f5
1 file changed
-9
-9
View File
@@ -2406,17 +2406,13 @@ void CStrategySystem::Goalie() {
ball.oldPosition = ball.position;
xistart = false;
}
static int xit;
if (ball.position.x < hgoalie.position.x && Distance(ball.position, hgoalie.position) > 1) {
int xix = ball.position.x >= 873 && (ball.position.y <= 313 || ball.position.y >= 505) || ball.position.x >= 940 ? 965 : 950;
int xid = 8;
if (abs(ball.position.y - ball.oldPosition.y) > 2)
xid = 10;
int xiy = int(((ball.position.y - ball.oldPosition.y) * 1.0 / (ball.position.x - ball.oldPosition.x) * 1.0) * (xix - xid) + (ball.oldPosition.y - ((ball.position.y - ball.oldPosition.y) * 1.0 / (ball.position.x - ball.oldPosition.x) * 1.0) * ball.oldPosition.x) + 0.5);
if (Distance(ball.position, ball.oldPosition) < 1 || ball.position.x <= ball.oldPosition.x || xiy < 313 || xiy > 505) {
if (ball.position.x >= 927 && ball.position.y >= 247 && ball.position.y <= 577) {
if (ball.position.y < 313)
@@ -2428,25 +2424,20 @@ void CStrategySystem::Goalie() {
}
else
xiy = int((Distance(ball.position, CPoint(863, 313)) * 192 / (Distance(ball.position, CPoint(863, 313)) + Distance(ball.position, CPoint(863, 505)))) + 313.5);
if ((xit / 4) % 2)
xiy += 30;
else
xiy -= 30;
}
if (xiy < 313)
xiy = 313;
else if (xiy > 505)
xiy = 505;
Direction(HGOALIE, CPoint(xix, xiy));
}
else
Stop(HGOALIE);
xit++;
ball.oldPosition = ball.position;
}