Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

After orbiting, decides if we should change which foot we kick with.

  • Loading branch information...
commit 1b90a5aa7c7257e19bf3ddd3369536e3a19c55f8 1 parent f67d8a7
@jzalinger jzalinger authored
View
33 src/man/noggin/kickDecider/HackKickInformation.py
@@ -370,6 +370,39 @@ def kickWithLeftFoot(self):
else:
return False
+ def checkKickingFoot(self, kick):
+ """
+ Takes a kick and decides which foot to use.
+ """
+ if kick == kicks.RIGHT_SIDE_KICK or \
+ kick == kicks.LEFT_SIDE_KICK:
+ # Side kicks can't change which foot they use.
+ return kick
+ elif kick == kicks.LEFT_SHORT_STRAIGHT_KICK or \
+ kick == kicks.RIGHT_SHORT_STRAIGHT_KICK:
+ if kickWithLeftFoot():
+ kick = kicks.LEFT_SHORT_STRAIGHT_KICK
+ else:
+ kick = kicks.RIGHT_SHORT_STRAIGHT_KICK
+ return kick
+ elif kick == kicks.LEFT_STRAIGHT_KICK or \
+ kick == kicks.RIGHT_STRAIGHT_KICK:
+ if kickWithLeftFoot():
+ kick = kicks.LEFT_STRAIGHT_KICK
+ else:
+ kick = kicks.RIGHT_STRAIGHT_KICK
+ return kick
+ elif kick == kicks.LEFT_SHORT_BACK_KICK or \
+ kick == kicks.RIGHT_SHORT_BACK_KICK:
+ if kickWithLeftFoot():
+ kick = kicks.LEFT_SHORT_BACK_KICK
+ else:
+ kick = kicks.RIGHT_SHORT_BACK_KICK
+ return kick
+ else:
+ # If the case was missed, just return the original kick.
+ return kick
+
def __str__(self):
s = ""
if self.farLeftPostBearing is not None:
View
1  src/man/noggin/players/ChaseBallStates.py
@@ -174,6 +174,7 @@ def orbitBall(player):
if player.kick == kicks.ORBIT_KICK_POSITION:
return player.goLater('prepareForKick')
else:
+ player.kick = prepareForKick.hackKick.checkKickingFoot(player.kick)
return player.goLater('positionForKick')
return player.stay()
Please sign in to comment.
Something went wrong with that request. Please try again.