def testSaveDecision(player): ball = player.brain.ball if goalTran.shouldSave(player): return player.goNow('goalieSave') return player.stay()
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()
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()
def goalieSave(player): #going to want it to get in a squat to prepare at somepoint in here brain = player.brain if player.firstFrame(): player.isSaving = True player.isChasing = False brain.motion.stopHeadMoves() player.stopWalking() brain.tracker.trackBall() if helper.shouldSave(player): return player.goNow('goaliePickSave') return player.stay()