Exemplo n.º 1
0
def goalieStateChoice(player):
    ball = player.brain.ball

    # for simplicity to start off with we just want the goalie to chase
    # the ball as long as it is close enough and it isnt dangerous

    if player.isChasing:
        if goalTran.shouldStopChase(player):
            return "goaliePosition"
        else:
            return player.currentState

    if player.isPositioning:
        if goalTran.outOfPosition(player):
            return player.currentState
        elif goalTran.shouldChase(player):
            return "goalieChase"

    return player.currentState
Exemplo n.º 2
0
def goaliePositionBallFar(player):

    nav = player.brain.nav
    player.brain.tracker.activeLoc()

    if helper.outOfPosition(player):
        player.goLater('goalieOutOfPosition')
    #elif not nav.atHeading(NogginConstants.OPP_GOAL_HEADING):
    #    return player.goLater('goalieSpinToPosition')
    elif helper.useLeftStrafeFarSpeed(player):
        helper.strafeLeftSpeed(player)
    elif helper.useRightStrafeFarSpeed(player):
        helper.strafeRightSpeed(player)
    else:
        player.stopWalking()

    #Don't switch out if we don't see the ball
    if helper.useClosePosition(player):
        return player.goLater('goaliePositionBallClose')
    return player.stay()