Exemplo n.º 1
0
def sSpread(team):
    '''
    This is our standard strategy.  Based around the 2007 with changes for 
    the middie.
    '''
    # Game Ready Setup
    if team.brain.game.state == NogginConstants.GAME_READY:
        # team is kicking off
        return ['sSpread'] + Formations.fReady(team)

    # Game Playing Formations
    elif team.brain.game.state == NogginConstants.GAME_PLAYING:

        # Kickoff Formations
        if (team.brain.game.getTimeSincePlay() < 
            PBConstants.KICKOFF_FORMATION_TIME):
            # Kickoff play
            if PBConstants.KICKOFF_PLAY:
                return ['sSpread'] + Formations.fKickoffPlay(team)
            # Kickoff
            else:
                return ['sSpread'] + Formations.fKickoff(team)

        # Formation for ball in our goal box
        elif team.shouldUseDubD():
            return ['sSpread'] + Formations.fDubD(team)

        # ball hasn't been seen by me or teammates in a while
        elif (team.brain.timeSinceBallSeen() > 
              PBConstants.FINDER_TIME_THRESH and
              team.brain.game.getTimeSinceUnpenalized() > 
              PBConstants.FINDER_TIME_THRESH):
            return ['sSpread'] + Formations.fFinder(team)

    # Standard spread formation
    return ['sSpread'] + Formations.fSpread(team)