Exemple #1
0
    def createZones(self):
        """
        Spawn safezone objects, streets, doors, NPCs, etc.
        """
        start = time.clock()

        def clearQueue():
            '''So the TCP window doesn't fill up and we get the axe'''
            while self.readerPollOnce():
                pass

        self.hoods.append(TTHoodAI.TTHoodAI(self))
        clearQueue()
        self.hoods.append(DDHoodAI.DDHoodAI(self))
        clearQueue()
        self.hoods.append(DGHoodAI.DGHoodAI(self))
        clearQueue()
        self.hoods.append(BRHoodAI.BRHoodAI(self))
        clearQueue()
        self.hoods.append(MMHoodAI.MMHoodAI(self))
        clearQueue()
        self.hoods.append(DLHoodAI.DLHoodAI(self))
        clearQueue()
        self.hoods.append(GSHoodAI.GSHoodAI(self))
        clearQueue()
        self.hoods.append(OZHoodAI.OZHoodAI(self))
        clearQueue()
        self.hoods.append(GZHoodAI.GZHoodAI(self))
        clearQueue()

        if config.GetBool('want-toonfest', False):
            self.hoods.append(TFHoodAI.TFHoodAI(self))
            clearQueue()

        if config.GetBool('want-sbhq', True):
            self.hoods.append(SellbotHQAI.SellbotHQAI(self))
            clearQueue()

        if config.GetBool('want-cbhq', True):
            self.hoods.append(CashbotHQAI.CashbotHQAI(self))
            clearQueue()

        if config.GetBool('want-lbhq', True):
            self.hoods.append(LawbotHQAI.LawbotHQAI(self))
            clearQueue()

        if config.GetBool('want-bbhq', True):
            self.hoods.append(BossbotHQAI.BossbotHQAI(self))
            clearQueue()

        for sp in self.suitPlanners.values():
            sp.assignInitialSuitBuildings()
 def createCogHeadquarters(self):
     if self.config.GetBool('want-sellbot-headquarters', True):
         self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
         self.cogHeadquarters.append(SellbotHQAI.SellbotHQAI(self))
     if self.config.GetBool('want-cashbot-headquarters', True):
         self.mintMgr = MintManagerAI.MintManagerAI(self)
         self.cogHeadquarters.append(CashbotHQAI.CashbotHQAI(self))
     if self.config.GetBool('want-lawbot-headquarters', True):
         self.lawOfficeMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
         self.cogHeadquarters.append(LawbotHQAI.LawbotHQAI(self))
     if self.config.GetBool('want-bossbot-headquarters', True):
         self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(
             self)
         self.cogHeadquarters.append(BossbotHQAI.BossbotHQAI(self))
Exemple #3
0
 def createCogHeadquarters(self):
     NPCToons.generateZone2NpcDict()
     if self.config.GetBool('want-sellbot-headquarters', True):
         self.factoryMgr = FactoryManagerAI.FactoryManagerAI(self)
         self.cogHeadquarters.append(SellbotHQAI.SellbotHQAI(self))
     if self.config.GetBool('want-cashbot-headquarters', True):
         self.mintMgr = MintManagerAI.MintManagerAI(self)
         self.cogHeadquarters.append(CashbotHQAI.CashbotHQAI(self))
     if self.config.GetBool('want-lawbot-headquarters', True):
         self.lawOfficeMgr = LawOfficeManagerAI.LawOfficeManagerAI(self)
         self.cogHeadquarters.append(LawbotHQAI.LawbotHQAI(self))
     if self.config.GetBool('want-bossbot-headquarters', True):
         self.countryClubMgr = CountryClubManagerAI.CountryClubManagerAI(self)
         self.cogHeadquarters.append(BossbotHQAI.BossbotHQAI(self))
     if self.config.GetBool('want-bdhq', True):
         self.boardofficeMgr = BoardOfficeManagerAI.BoardOfficeManagerAI(self)
         self.cogHeadquarters.append(BoardbotHQAI.BoardbotHQAI(self))
    def createZones(self):
        """
        Spawn safezone objects, streets, doors, NPCs, etc.
        """
        self.hoods.append(TTHoodAI.TTHoodAI(self))
        self.hoods.append(DDHoodAI.DDHoodAI(self))
        #self.hoods.append(DGHoodAI.DGHoodAI(self))
        self.hoods.append(BRHoodAI.BRHoodAI(self))
        self.hoods.append(MMHoodAI.MMHoodAI(self))
        self.hoods.append(DLHoodAI.DLHoodAI(self))
        self.hoods.append(GSHoodAI.GSHoodAI(self))
        self.hoods.append(OZHoodAI.OZHoodAI(self))
        self.hoods.append(GZHoodAI.GZHoodAI(self))
        self.hoods.append(SellbotHQAI.SellbotHQAI(self))
        self.hoods.append(CashbotHQAI.CashbotHQAI(self))
        self.hoods.append(LawbotHQAI.LawbotHQAI(self))
        self.hoods.append(BossbotHQAI.BossbotHQAI(self))

        # Calculate time until next hour.
        thetime = time.time() % 3600
        if thetime < 60: # If the AI was started less than a minute after the previous full hour.
            taskMgr.doMethodLater(1, self.startFireworks, 'fireworks-taskmgr-hourly')
        else:
            taskMgr.doMethodLater(3600-thetime, self.startFireworks, 'fireworks-taskmgr-hourly')
Exemple #5
0
    def createZones(self):
        """
        Spawn safezone objects, streets, doors, NPCs, etc.
        """
        start = time.clock()

        def clearQueue():
            '''So the TCP window doesn't fill up and we get the axe'''
            while self.readerPollOnce():
                pass

        self.notify.info('Creating TTC (Toontown Central) ')
        self.hoods.append(TTHoodAI.TTHoodAI(self))
        clearQueue()
        self.notify.info('Creating DD (Donalds Dock)')
        self.hoods.append(DDHoodAI.DDHoodAI(self))
        clearQueue()
        self.notify.info('Creating DG (Daisy Gardens) ')
        self.hoods.append(DGHoodAI.DGHoodAI(self))
        clearQueue()
        self.notify.info('Creating BR (The Brrrgh) ')
        self.hoods.append(BRHoodAI.BRHoodAI(self))
        clearQueue()
        self.notify.info('Creating MML (Minnie Melody Land) ')
        self.hoods.append(MMHoodAI.MMHoodAI(self))
        clearQueue()
        self.notify.info('Creating DDL (Donalds Dream Land) ')
        self.hoods.append(DLHoodAI.DLHoodAI(self))
        clearQueue()
        self.notify.info('Creating GS (SpeedWay) ')
        self.hoods.append(GSHoodAI.GSHoodAI(self))
        clearQueue()
        self.notify.info('Creating OZ (Outdoor Zone)')
        self.hoods.append(OZHoodAI.OZHoodAI(self))
        clearQueue()
        self.notify.info('Creating GZ (Golf Zone) ')
        self.hoods.append(GZHoodAI.GZHoodAI(self))
        clearQueue()
        self.notify.info('Creating TF (Toonfest) ')
        self.hoods.append(TFHoodAI.TFHoodAI(self))
        clearQueue()

        if config.GetBool('want-sbhq', True):
            self.notify.info('Creating SBHQ (Sellbot HQ) ')
            self.hoods.append(SellbotHQAI.SellbotHQAI(self))
            clearQueue()

        if config.GetBool('want-cbhq', True):
            self.notify.info('Creating CBHQ (Cashbot HQ) ')
            self.hoods.append(CashbotHQAI.CashbotHQAI(self))
            clearQueue()

        if config.GetBool('want-lbhq', True):
            self.notify.info('Creating LBHQ (Lawbot HQ) ')
            self.hoods.append(LawbotHQAI.LawbotHQAI(self))
            clearQueue()

        if config.GetBool('want-bbhq', True):
            self.notify.info('Creating BBHQ (Bossbot HQ) ')
            self.hoods.append(BossbotHQAI.BossbotHQAI(self))
            clearQueue()

        for sp in self.suitPlanners.values():
            sp.assignInitialSuitBuildings()