| me.playerID.playerNr == 1\r
| i_have_ball = kick closest_free_teammate (x, mm)\r
| ball_in_reach maxCatchReach = (CatchBall, mm)\r
+ | ball_in_reach maxKickReach = kick closest_free_teammate (x, mm)\r
| ball_their_half = halt (x, mm)\r
| ball_within_16\r
| we_have_ball = stayInGoal (x, mm)\r
| otherwise = stayInGoal (x, mm)\r
// Defense\r
| me.playerID.playerNr > 7\r
- | ball_their_half = fix {origpos & px=origpos.px + (scale 0.5 ballPos.pxy.px)} prec (x, mm)\r
+ | ball_their_half\r
+ | i_have_ball = kick closest_free_teammate (x, mm)\r
+ | otherwise = fix {origpos & px=origpos.px + (scale 0.5 ballPos.pxy.px)} prec (x, mm)\r
| otherwise\r
// TODO I have the ball\r
| i_have_ball = moveForward i (x, mm)\r
obtainBall :: Int -> FootballerAI m\r
obtainBall i\r
| ball_in_reach maxTackleReach && length has_ball > 0\r
- | i<15 = \(_,mm).(Tackle (hd has_ball).playerID (ms 10.0), mm)\r
- | i < 50 = kick closest_free_teammate\r
+ | i < 15 = \(_,mm).(Tackle (hd has_ball).playerID (ms 10.0), mm)\r
| otherwise = \(_,mm).(GainBall, mm)\r
+ | ball_in_reach maxGainReach = \(_,mm).(GainBall, mm)\r
| isClosest us me ballPos.pxy = fix ballPos.pxy prec\r
- | otherwise = fix closest_free_player prec\r
+ | otherwise = fix (attract prec closest_free_player ballPos.pxy) prec\r
\r
moveForward :: Int -> FootballerAI m\r
- moveForward i = fix their_goal prec//TODO\r
+ moveForward i = kick closest_free_teammate\r
\r
stayInGoal = fix (attract goal_area_depth our_goal ballPos.pxy) prec\r
- closest_free_player = their_goal // TODO\r
- closest_free_teammate = their_goal // TODO\r
-\r
+ closest_free_player = (closest them me.pos).pos // TODO\r
+ closest_free_teammate\r
+ | length players_closer_to_goal > 0 = (closest players_closer_to_goal me.pos).pos\r
+ | otherwise = their_goal\r
+ \r
+ players_closer_to_goal = filter (\x.not (closerToHome home x.pos.px me.pos.px)) us\r
player_within_16 p = inPenaltyArea field home p.pos\r
ball_within_16 = inPenaltyArea field home ballPos.pxy\r
\r
--- /dev/null
+99
+,Æsir_W,MiniEffiesW,G'frincham0-W,G'frincham2-W,G'frincham4-W,G'frincham6-W,G'frincham8-W,G'frincham10-W
+x Æsir_W vs Æsir_E
+0 6 Æsir_W vs MiniEffiesE
+0 1 Æsir_W vs G'frincham0-E
+0 3 Æsir_W vs G'frincham2-E
+0 2 Æsir_W vs G'frincham4-E
+0 6 Æsir_W vs G'frincham6-E
+0 4 Æsir_W vs G'frincham8-E
+0 9 Æsir_W vs G'frincham10-E
+12 0 MiniEffiesW vs Æsir_E
+x MiniEffiesW vs MiniEffiesE
+3 0 MiniEffiesW vs G'frincham0-E
+3 5 MiniEffiesW vs G'frincham2-E
+0 8 MiniEffiesW vs G'frincham4-E
+0 8 MiniEffiesW vs G'frincham6-E
+1 10 MiniEffiesW vs G'frincham8-E
+0 9 MiniEffiesW vs G'frincham10-E
+0 0 G'frincham0-W vs Æsir_E
+0 2 G'frincham0-W vs MiniEffiesE
+x G'frincham0-W vs G'frincham0-E
+0 1 G'frincham0-W vs G'frincham2-E
+0 3 G'frincham0-W vs G'frincham4-E
+0 3 G'frincham0-W vs G'frincham6-E
+0 8 G'frincham0-W vs G'frincham8-E
+0 13 G'frincham0-W vs G'frincham10-E
+4 0 G'frincham2-W vs Æsir_E
+6 1 G'frincham2-W vs MiniEffiesE
+0 0 G'frincham2-W vs G'frincham0-E
+x G'frincham2-W vs G'frincham2-E
+0 3 G'frincham2-W vs G'frincham4-E
+0 3 G'frincham2-W vs G'frincham6-E
+0 8 G'frincham2-W vs G'frincham8-E
+0 8 G'frincham2-W vs G'frincham10-E
+8 0 G'frincham4-W vs Æsir_E
+5 0 G'frincham4-W vs MiniEffiesE
+2 0 G'frincham4-W vs G'frincham0-E
+2 0 G'frincham4-W vs G'frincham2-E
+x G'frincham4-W vs G'frincham4-E
+0 3 G'frincham4-W vs G'frincham6-E
+0 3 G'frincham4-W vs G'frincham8-E
+0 7 G'frincham4-W vs G'frincham10-E
+7 0 G'frincham6-W vs Æsir_E
+8 0 G'frincham6-W vs MiniEffiesE
+4 0 G'frincham6-W vs G'frincham0-E
+4 0 G'frincham6-W vs G'frincham2-E
+1 0 G'frincham6-W vs G'frincham4-E
+x G'frincham6-W vs G'frincham6-E
+0 4 G'frincham6-W vs G'frincham8-E
+0 3 G'frincham6-W vs G'frincham10-E
+7 0 G'frincham8-W vs Æsir_E
+x G'frincham8-W vs MiniEffiesE