repositories
/
fp1415-soccerfun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
11c4f7b
)
Don't gain after kick
author
Mart Lubbers
<mart@martlubbers.net>
Mon, 22 Jun 2015 07:38:03 +0000
(09:38 +0200)
committer
Mart Lubbers
<mart@martlubbers.net>
Mon, 22 Jun 2015 07:38:03 +0000
(09:38 +0200)
src/Team_MartLubbers.icl
patch
|
blob
|
history
diff --git
a/src/Team_MartLubbers.icl
b/src/Team_MartLubbers.icl
index
9a18f19
..
9537ed1
100644
(file)
--- a/
src/Team_MartLubbers.icl
+++ b/
src/Team_MartLubbers.icl
@@
-83,8
+83,8
@@
mind field (x=:{referee,football,others,me}, mm=:{home,origpos})
// Keeper
\r
| me.playerID.playerNr == 1
\r
| i_have_ball = kick closest_free_teammate (x, mm)
\r
// 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
| ball_their_half = halt (x, mm)
\r
| ball_within_16
\r
| we_have_ball = stayInGoal (x, mm)
\r
@@
-115,7
+115,7
@@
mind field (x=:{referee,football,others,me}, mm=:{home,origpos})
| otherwise
\r
| i_have_ball = moveForward i (x, mm)
\r
| ballIsFree football
\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
| 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
@@
-128,13
+128,13
@@
mind field (x=:{referee,football,others,me}, mm=:{home,origpos})
| otherwise = \(_,mm).(GainBall, mm)
\r
| ball_in_reach maxGainReach = \(_,mm).(GainBall, mm)
\r
| isClosest us me ballPos.pxy = fix ballPos.pxy prec
\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
\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
closest_free_teammate
\r
| length players_closer_to_goal > 0 = (closest players_closer_to_goal me.pos).pos
\r
| otherwise = their_goal
\r
@@
-143,6
+143,7
@@
mind field (x=:{referee,football,others,me}, mm=:{home,origpos})
player_within_16 p = inPenaltyArea field home p.pos
\r
ball_within_16 = inPenaltyArea field home ballPos.pxy
\r
\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
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