Exemplo n.º 1
0
def shootBallFar(player):
    """
    From 3 point range!
    """
    my = player.brain.my
    shotAimPoint = helpers.getShotFarAimPoint(player)
    bearingToGoal = my.getRelativeBearing(shotAimPoint)
    if constants.DEBUG_KICKS: print "bearing to goal is ", bearingToGoal
    if constants.SHOOT_BALL_FAR_SIDE_KICK_ANGLE > abs(bearingToGoal) > \
            constants.SHOOT_BALL_FAR_LOC_ALIGN_ANGLE and \
            not player.hasAlignedOnce:
        player.angleToAlign = bearingToGoal
        player.bigKick = True
        return player.goNow('alignOnBallStraightKick')
    elif bearingToGoal > constants.SHOOT_BALL_SIDE_KICK_ANGLE:
        return player.goNow('kickBallLeft')
    elif bearingToGoal < -constants.SHOOT_BALL_SIDE_KICK_ANGLE:
        return player.goNow('kickBallRight')
    else :
        player.bigKick = True
        return player.goNow('kickBallStraight')