Esempio n. 1
0
    def calcMinigames(self):
        numPlayers = len(self.avIdList)
        allowedGames = list(ToontownGlobals.MinigamePlayerMatrix[numPlayers])
        from toontown.minigame import MinigameCreatorAI
        allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(
            allowedGames)
        self.switchToMinigameDict = {}
        for switch in TravelGameGlobals.BoardLayouts[self.boardIndex].keys():
            if self.isLeaf(switch):
                if len(allowedGames) == 0:
                    allowedGames = list(
                        ToontownGlobals.MinigamePlayerMatrix[numPlayers])
                    allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(
                        allowedGames)
                minigame = random.choice(allowedGames)
                self.switchToMinigameDict[switch] = minigame
                allowedGames.remove(minigame)

        switches = []
        minigames = []
        for key in self.switchToMinigameDict.keys():
            switches.append(key)
            minigames.append(self.switchToMinigameDict[key])

        self.sendUpdate('setMinigames', [switches, minigames])
Esempio n. 2
0
    def calcMinigames(self):
        """
        set up which minigames are assigned to which switch
        """
        numPlayers = len(self.avIdList)
        allowedGames = list(ToontownGlobals.MinigamePlayerMatrix[numPlayers])
        from toontown.minigame import MinigameCreatorAI
        allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(allowedGames)
        #allowedGames = [1,2,13,14,15,16] # uncomment to see the newest icons
        self.switchToMinigameDict = {}
        for switch in list(TravelGameGlobals.BoardLayouts[self.boardIndex].keys()):
            if self.isLeaf(switch):
                if len(allowedGames) == 0:
                    #if we somehow don't have enough allowed games, just
                    #start reusing
                    allowedGames = list(ToontownGlobals.MinigamePlayerMatrix[numPlayers])
                    allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(allowedGames)
                minigame = random.choice(allowedGames)
                self.switchToMinigameDict[switch] = minigame
                allowedGames.remove(minigame)

        switches = []
        minigames = []
        for key in list(self.switchToMinigameDict.keys()):
            switches.append( key)
            minigames.append( self.switchToMinigameDict[key])

        self.sendUpdate("setMinigames", [switches, minigames])
    def calcMinigames(self):
        numPlayers = len(self.avIdList)
        allowedGames = list(ToontownGlobals.MinigamePlayerMatrix[numPlayers])
        from toontown.minigame import MinigameCreatorAI
        allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(allowedGames)
        self.switchToMinigameDict = {}
        for switch in TravelGameGlobals.BoardLayouts[self.boardIndex].keys():
            if self.isLeaf(switch):
                if len(allowedGames) == 0:
                    allowedGames = list(ToontownGlobals.MinigamePlayerMatrix[numPlayers])
                    allowedGames = MinigameCreatorAI.removeUnreleasedMinigames(allowedGames)
                minigame = random.choice(allowedGames)
                self.switchToMinigameDict[switch] = minigame
                allowedGames.remove(minigame)

        switches = []
        minigames = []
        for key in self.switchToMinigameDict.keys():
            switches.append(key)
            minigames.append(self.switchToMinigameDict[key])

        self.sendUpdate('setMinigames', [switches, minigames])