// Keeper\r
| 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_in_reach maxCatchReach && not_previously_kicked = (CatchBall, mm)\r
+ | ball_in_reach maxKickReach && not_previously_kicked = 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\r
| i_have_ball = moveForward i (x, mm)\r
| ballIsFree football\r
- | ball_in_reach maxGainReach = (GainBall, mm)\r
+ | ball_in_reach maxGainReach && not_previously_kicked = (GainBall, mm)\r
| isClosest us me ballPos.pxy = fix ballPos.pxy prec (x, mm)\r
| otherwise = fix {px=ballPos.pxy.px + (m 10.0), py=origpos.py} prec (x, mm) \r
| we_have_ball = fix {px=ballPos.pxy.px + (m 10.0), py=origpos.py} prec (x, 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 (attract prec closest_free_player ballPos.pxy) prec\r
+ | otherwise = fix (attract (scale 3.0 prec) closest_free_player ballPos.pxy) prec\r
\r
moveForward :: Int -> FootballerAI m\r
moveForward i = kick closest_free_teammate\r
\r
stayInGoal = fix (attract goal_area_depth our_goal ballPos.pxy) prec\r
- closest_free_player = (closest them me.pos).pos // TODO\r
+ closest_free_player = (closest them me.pos).pos\r
closest_free_teammate\r
| length players_closer_to_goal > 0 = (closest players_closer_to_goal me.pos).pos\r
| otherwise = their_goal\r
player_within_16 p = inPenaltyArea field home p.pos\r
ball_within_16 = inPenaltyArea field home ballPos.pxy\r
\r
+ not_previously_kicked = if (isNothing me.effect) True (not (isKickedBall (fromJust me.effect)))\r
has_ball = filter (\x.ballIsGainedBy x.playerID football) others\r
we_have_ball = any (\x.sameClub me x) has_ball\r
they_have_ball = any (\x.not (sameClub me x)) has_ball\r