Exemplo n.º 1
0
def goalieSave(player):

    brain = player.brain
    ball = brain.ball

    if player.firstFrame():
        player.stopWalking()
        brain.tracker.trackBallFixedPitch()
        player.isSaving = True

    if helper.shouldSave(player):
        brain.tracker.stopHeadMoves()
        brain.fallController.enableFallProtection(False)
        if TESTING:
            print "Saving because"
            print "Ball.relVelX is" + str(ball.loc.relVelX)
            print "And Ball.heat is" + str(ball.vis.heat)
            if helper.shouldSaveRight(player):
                return player.goNow('testSaveRight')
            elif helper.shouldSaveLeft(player):
                return player.goNow('testSaveLeft')
            else:
                return player.goNow('testSaveCenter')
        else:
            if helper.shouldSaveRight(player):
                return player.goNow('saveRight')
            if helper.shouldSaveLeft(player):
                return player.goNow('saveLeft')
            else:
                return player.goNow('saveCenter')

    return player.stay()
Exemplo n.º 2
0
def goalieSave(player):

    brain = player.brain
    ball = brain.ball

    if player.firstFrame():
        player.stopWalking()
        brain.tracker.trackBall()
        player.isSaving = True

    if helper.shouldSave(player):
        brain.tracker.stopHeadMoves()
        brain.fallController.enableFallProtection(False)
        if TESTING:
            print "Saving because"
            print "Ball.relVelX is" + str(ball.loc.relVelX)
            print "And Ball.heat is" + str(ball.vis.heat)
            if helper.shouldSaveRight(player):
                return player.goNow("testSaveRight")
            elif helper.shouldSaveLeft(player):
                return player.goNow("testSaveLeft")
            else:
                return player.goNow("testSaveCenter")
        else:
            if helper.shouldSaveRight(player):
                return player.goNow("saveRight")
            if helper.shouldSaveLeft(player):
                return player.goNow("saveLeft")
            else:
                return player.goNow("saveCenter")

    return player.stay()
Exemplo n.º 3
0
def goaliePickSave(player): 
    player.brain.fallController.enableFallProtection(False)

    if helper.shouldSaveRight(player):
        return player.goNow('saveRight')
    elif helper.shouldSaveLeft(player):
        return player.goNow('saveLeft')
    elif helper.shouldSaveCenter(player):
        return player.goNow('saveCenter')

    return player.stay()