def createMintBoardingParty(self): mintIdList = [] for mintElevator in self.mintElevators: mintIdList.append(mintElevator.doId) self.mintBoardingParty = DistributedBoardingPartyAI( self.air, mintIdList, 4) self.mintBoardingParty.generateWithRequired(self.zoneId)
def createCourseBoardingParty(self): cogKartIdList = [] for cogKart in self.cogKarts: cogKartIdList.append(cogKart.doId) self.courseBoardingParty = DistributedBoardingPartyAI( self.air, cogKartIdList, 4) self.courseBoardingParty.generateWithRequired(self.zoneId)
def createOfficeBoardingParty(self): lawOfficeIdList = [] for lawOfficeElevator in self.lawOfficeElevators: lawOfficeIdList.append(lawOfficeElevator.doId) self.officeBoardingParty = DistributedBoardingPartyAI( self.air, lawOfficeIdList, 4) self.officeBoardingParty.generateWithRequired(ToontownGlobals.LawbotOfficeExt)
def createBoardOfficeBoardingParty(self): boardofficeIdList = [] for boardofficeElevator in self.boardofficeElevators: boardofficeIdList.append(boardofficeElevator.doId) self.boardofficeBoardingParty = DistributedBoardingPartyAI( self.air, boardofficeIdList, 4) self.boardofficeBoardingParty.generateWithRequired(self.zoneId)
def createFactoryBoardingParty(self): factoryIdList = [] for factoryElevator in self.factoryElevators: factoryIdList.append(factoryElevator.doId) self.factoryBoardingParty = DistributedBoardingPartyAI( self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired( ToontownGlobals.SellbotFactoryExt)
def createBoardingParty(self): elevatorList = [self.lobbyElevator.doId] if self.brutalElevator is not None: elevatorList.append(self.brutalElevator.doId) self.boardingParty = DistributedBoardingPartyAI( self.air, elevatorList, 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)
class CashbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.CashbotHQ, ToontownGlobals.CashbotLobby, FADoorCodes.CB_DISGUISE_INCOMPLETE, DistributedCFOElevatorAI.DistributedCFOElevatorAI, DistributedCashbotBossAI.DistributedCashbotBossAI, DistributedBrutalCFOElevatorAI.DistributedBrutalCFOElevatorAI, DistributedBrutalCashbotBossAI.DistributedBrutalCashbotBossAI) self.mintElevators = [] self.mintBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createMintElevators() if simbase.config.GetBool('want-boarding-groups', True): self.createMintBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def createMintElevators(self): destZones = (ToontownGlobals.CashbotMintIntA, ToontownGlobals.CashbotMintIntB, ToontownGlobals.CashbotMintIntC) mins = ToontownGlobals.FactoryLaffMinimums[1] for i in xrange(len(destZones)): mintElevator = DistributedMintElevatorExtAI(self.air, self.air.mintMgr, destZones[i], antiShuffle=0, minLaff=mins[i]) mintElevator.generateWithRequired(self.zoneId) self.mintElevators.append(mintElevator) def createMintBoardingParty(self): mintIdList = [] for mintElevator in self.mintElevators: mintIdList.append(mintElevator.doId) self.mintBoardingParty = DistributedBoardingPartyAI( self.air, mintIdList, 4) self.mintBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class BossbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.BossbotHQ, ToontownGlobals.BossbotLobby, FADoorCodes.BB_DISGUISE_INCOMPLETE, DistributedBBElevatorAI.DistributedBBElevatorAI, DistributedBossbotBossAI.DistributedBossbotBossAI) self.cogKarts = [] self.courseBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createCogKarts() if simbase.config.GetBool('want-boarding-groups', True): self.createCourseBoardingParty() #if simbase.config.GetBool('want-suit-planners', True): #self.createSuitPlanners() def createCogKarts(self): posList = ( (154.762, 37.169, 0), (141.403, -81.887, 0), (-48.44, 15.308, 0) ) hprList = ((110.815, 0, 0), (61.231, 0, 0), (-105.481, 0, 0)) mins = ToontownGlobals.FactoryLaffMinimums[3] for cogCourse in xrange(len(posList)): pos = posList[cogCourse] hpr = hprList[cogCourse] cogKart = DistributedCogKartAI.DistributedCogKartAI( self.air, cogCourse, pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2], self.air.countryClubMgr, minLaff=mins[cogCourse]) cogKart.generateWithRequired(self.zoneId) self.cogKarts.append(cogKart) def createCourseBoardingParty(self): cogKartIdList = [] for cogKart in self.cogKarts: cogKartIdList.append(cogKart.doId) self.courseBoardingParty = DistributedBoardingPartyAI(self.air, cogKartIdList, 4) self.courseBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class CashbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.CashbotHQ, ToontownGlobals.CashbotLobby, FADoorCodes.CB_DISGUISE_INCOMPLETE, DistributedCFOElevatorAI.DistributedCFOElevatorAI, DistributedCashbotBossAI.DistributedCashbotBossAI, DistributedBrutalCFOElevatorAI.DistributedBrutalCFOElevatorAI, DistributedBrutalCashbotBossAI.DistributedBrutalCashbotBossAI) self.mintElevators = [] self.mintBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createMintElevators() if simbase.config.GetBool('want-boarding-groups', True): self.createMintBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def createMintElevators(self): destZones = ( ToontownGlobals.CashbotMintIntA, ToontownGlobals.CashbotMintIntB, ToontownGlobals.CashbotMintIntC ) mins = ToontownGlobals.FactoryLaffMinimums[1] for i in xrange(len(destZones)): mintElevator = DistributedMintElevatorExtAI( self.air, self.air.mintMgr, destZones[i], antiShuffle=0, minLaff=mins[i]) mintElevator.generateWithRequired(self.zoneId) self.mintElevators.append(mintElevator) def createMintBoardingParty(self): mintIdList = [] for mintElevator in self.mintElevators: mintIdList.append(mintElevator.doId) self.mintBoardingParty = DistributedBoardingPartyAI(self.air, mintIdList, 4) self.mintBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class BossbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.BossbotHQ, ToontownGlobals.BossbotLobby, FADoorCodes.BB_DISGUISE_INCOMPLETE, DistributedBBElevatorAI.DistributedBBElevatorAI, DistributedBossbotBossAI.DistributedBossbotBossAI) self.cogKarts = [] self.courseBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createCogKarts() if simbase.config.GetBool('want-boarding-groups', True): self.createCourseBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def createCogKarts(self): posList = ( (154.762, 37.169, 0), (141.403, -81.887, 0), (-48.44, 15.308, 0) ) hprList = ((110.815, 0, 0), (61.231, 0, 0), (-105.481, 0, 0)) for cogCourse in xrange(len(posList)): pos = posList[cogCourse] hpr = hprList[cogCourse] cogKart = DistributedCogKartAI.DistributedCogKartAI( self.air, cogCourse, pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2], self.air.countryClubMgr) cogKart.generateWithRequired(self.zoneId) self.cogKarts.append(cogKart) def createCourseBoardingParty(self): cogKartIdList = [] for cogKart in self.cogKarts: cogKartIdList.append(cogKart.doId) self.courseBoardingParty = DistributedBoardingPartyAI(self.air, cogKartIdList, 4) self.courseBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class BoardbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__(self, air, ToontownGlobals.BoardbotHQ, ToontownGlobals.BoardbotLobby, FADoorCodes.BD_DISGUISE_INCOMPLETE, DistributedCMElevatorAI.DistributedCMElevatorAI, DistributedBoardbotBossAI.DistributedBoardbotBossAI) self.boardofficeElevators = [] self.boardofficeBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createBoardOfficeElevators() self.makeCogHQDoor(ToontownGlobals.BoardbotOfficeLobby, 0, 0) self.makeCogHQDoor(ToontownGlobals.BoardbotOfficeLobby, 0, 1) if simbase.config.GetBool('want-boarding-groups', True): self.createBoardOfficeBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() self.event = DistributedBetaEventAI.DistributedBetaEventAI(self.air) self.event.generateWithRequired(self.zoneId) self.event.start() def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock = 0): if destinationZone == self.lobbyZoneId: extDoorIndex = 2 return CogHQAI.CogHQAI.makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=lock) def createBoardOfficeElevators(self): destZones = (ToontownGlobals.BoardOfficeIntA, ToontownGlobals.BoardOfficeIntB, ToontownGlobals.BoardOfficeIntC) mins = ToontownGlobals.FactoryLaffMinimums[1] for i in xrange(len(destZones)): boardofficeElevator = DistributedBoardOfficeElevatorExtAI(self.air, self.air.boardofficeMgr, destZones[i], antiShuffle=0, minLaff=mins[i]) boardofficeElevator.generateWithRequired(ToontownGlobals.BoardbotOfficeLobby) self.boardofficeElevators.append(boardofficeElevator) def createBoardOfficeBoardingParty(self): boardofficeIdList = [] for boardofficeElevator in self.boardofficeElevators: boardofficeIdList.append(boardofficeElevator.doId) self.boardofficeBoardingParty = DistributedBoardingPartyAI(self.air, boardofficeIdList, 4) self.boardofficeBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
def createBoardingParty(self): elevatorList = [self.lobbyElevator.doId] if self.DeadlyElevator is not None: elevatorList.append(self.DeadlyElevator.doId) self.boardingParty = DistributedBoardingPartyAI(self.air, elevatorList, 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)
class CogHQAI: notify = directNotify.newCategory('CogHQAI') notify.setInfo(True) def __init__( self, air, zoneId, lobbyZoneId, lobbyFADoorCode, lobbyElevatorCtor, bossCtor, DeadlyElevatorCtor=None, DeadlyBossCtor=None): self.air = air self.zoneId = zoneId self.lobbyZoneId = lobbyZoneId self.lobbyFADoorCode = lobbyFADoorCode self.lobbyElevatorCtor = lobbyElevatorCtor self.bossCtor = bossCtor self.DeadlyElevatorCtor = DeadlyElevatorCtor self.DeadlyBossCtor = DeadlyBossCtor self.lobbyMgr = None self.lobbyElevator = None self.DeadlyElevator = None self.boardingParty = None self.notify.info('Creating objects... ' + self.getLocationName(zoneId)) def getLocationName(self, zoneId): lookupTable = ToontownGlobals.hoodNameMap if (zoneId % 1000) != 0: lookupTable = TTLocalizer.GlobalStreetNames name = lookupTable.get(zoneId, '') if isinstance(name, str): return name return name[2] def startup(self): self.createLobbyManager() self.createLobbyElevator() self.extDoor = self.makeCogHQDoor(self.lobbyZoneId, 0, 0, self.lobbyFADoorCode) if simbase.config.GetBool('want-boarding-groups', True): self.createBoardingParty() self.npcs = NPCToons.createNpcsInZone(self.air, self.zoneId) def shutdown(self): for npc in self.npcs: npc.requestDelete() del self.npcs def createLobbyManager(self): self.lobbyMgr = LobbyManagerAI.LobbyManagerAI(self.air, self.bossCtor, self.DeadlyBossCtor) self.lobbyMgr.generateWithRequired(self.lobbyZoneId) def createLobbyElevator(self): self.lobbyElevator = self.lobbyElevatorCtor( self.air, self.lobbyMgr, self.lobbyZoneId) self.lobbyElevator.generateWithRequired(self.lobbyZoneId) if self.DeadlyElevatorCtor is not None: self.DeadlyElevator = self.DeadlyElevatorCtor( self.air, self.lobbyMgr, self.lobbyZoneId) self.DeadlyElevator.generateWithRequired(self.lobbyZoneId) def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=0): intDoor = DistributedCogHQDoorAI.DistributedCogHQDoorAI( self.air, 0, DoorTypes.INT_COGHQ, self.zoneId, doorIndex=intDoorIndex, lockValue=lock) intDoor.zoneId = destinationZone extDoor = DistributedCogHQDoorAI.DistributedCogHQDoorAI( self.air, 0, DoorTypes.EXT_COGHQ, destinationZone, doorIndex=extDoorIndex, lockValue=lock) extDoor.setOtherDoor(intDoor) intDoor.setOtherDoor(extDoor) intDoor.generateWithRequired(destinationZone) intDoor.sendUpdate('setDoorIndex', [intDoor.getDoorIndex()]) extDoor.generateWithRequired(self.zoneId) extDoor.sendUpdate('setDoorIndex', [extDoor.getDoorIndex()]) return extDoor def createBoardingParty(self): elevatorList = [self.lobbyElevator.doId] if self.DeadlyElevator is not None: elevatorList.append(self.DeadlyElevator.doId) self.boardingParty = DistributedBoardingPartyAI(self.air, elevatorList, 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)
def createBoardingParty(self): self.boardingParty = DistributedBoardingPartyAI( self.air, [self.lobbyElevator.doId], 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)
class CogHQAI: notify = directNotify.newCategory('CogHQAI') notify.setInfo(True) def __init__(self, air, zoneId, lobbyZoneId, lobbyFADoorCode, lobbyElevatorCtor, bossCtor): self.air = air self.zoneId = zoneId self.lobbyZoneId = lobbyZoneId self.lobbyFADoorCode = lobbyFADoorCode self.lobbyElevatorCtor = lobbyElevatorCtor self.bossCtor = bossCtor self.lobbyMgr = None self.lobbyElevator = None self.boardingParty = None self.notify.info('Creating objects... ' + self.getLocationName(zoneId)) def getLocationName(self, zoneId): lookupTable = ToontownGlobals.hoodNameMap if (zoneId % 1000) != 0: lookupTable = TTLocalizer.GlobalStreetNames name = lookupTable.get(zoneId, '') if isinstance(name, str): return name return name[2] def startup(self): self.createLobbyManager() self.createLobbyElevator() self.extDoor = self.makeCogHQDoor(self.lobbyZoneId, 0, 0, self.lobbyFADoorCode) if simbase.config.GetBool('want-boarding-groups', True): self.createBoardingParty() def createLobbyManager(self): self.lobbyMgr = LobbyManagerAI.LobbyManagerAI(self.air, self.bossCtor) self.lobbyMgr.generateWithRequired(self.lobbyZoneId) def createLobbyElevator(self): self.lobbyElevator = self.lobbyElevatorCtor(self.air, self.lobbyMgr, self.lobbyZoneId, antiShuffle=1) self.lobbyElevator.generateWithRequired(self.lobbyZoneId) def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=0): intDoor = DistributedCogHQDoorAI.DistributedCogHQDoorAI( self.air, 0, DoorTypes.INT_COGHQ, self.zoneId, doorIndex=intDoorIndex, lockValue=lock) intDoor.zoneId = destinationZone extDoor = DistributedCogHQDoorAI.DistributedCogHQDoorAI( self.air, 0, DoorTypes.EXT_COGHQ, destinationZone, doorIndex=extDoorIndex, lockValue=lock) extDoor.setOtherDoor(intDoor) intDoor.setOtherDoor(extDoor) intDoor.generateWithRequired(destinationZone) intDoor.sendUpdate('setDoorIndex', [intDoor.getDoorIndex()]) extDoor.generateWithRequired(self.zoneId) extDoor.sendUpdate('setDoorIndex', [extDoor.getDoorIndex()]) return extDoor def createBoardingParty(self): self.boardingParty = DistributedBoardingPartyAI( self.air, [self.lobbyElevator.doId], 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)
def createFactoryBoardingParty(self): factoryIdList = [] for factoryElevator in self.factoryElevators: factoryIdList.append(factoryElevator.doId) self.factoryBoardingParty = DistributedBoardingPartyAI(self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired(ToontownGlobals.SellbotFactoryExt)
class SellbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.SellbotHQ, ToontownGlobals.SellbotLobby, FADoorCodes.SB_DISGUISE_INCOMPLETE, DistributedVPElevatorAI.DistributedVPElevatorAI, DistributedSellbotBossAI.DistributedSellbotBossAI) self.factoryElevators = [] self.factoryBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.cogHQDoors = [self.extDoor] for i in xrange(3): extDoor = self.makeCogHQDoor(self.lobbyZoneId, 0, i + 1, self.lobbyFADoorCode) self.cogHQDoors.append(extDoor) self.createFactoryElevators() if simbase.config.GetBool('want-boarding-groups', True): self.createFactoryBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() for sp in self.suitPlanners: if sp.zoneId == self.zoneId: sp.cogHQDoors = self.cogHQDoors def createFactoryElevators(self): for i in xrange(2): factoryElevator = DistributedFactoryElevatorExtAI( self.air, self.air.factoryMgr, ToontownGlobals.SellbotFactoryInt, i) factoryElevator.generateWithRequired( ToontownGlobals.SellbotFactoryExt) self.factoryElevators.append(factoryElevator) def createFactoryBoardingParty(self): factoryIdList = [] for factoryElevator in self.factoryElevators: factoryIdList.append(factoryElevator.doId) self.factoryBoardingParty = DistributedBoardingPartyAI( self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired( ToontownGlobals.SellbotFactoryExt) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, ToontownGlobals.SellbotFactoryExt) suitPlanner.generateWithRequired(ToontownGlobals.SellbotFactoryExt) suitPlanner.d_setZoneId(ToontownGlobals.SellbotFactoryExt) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[ToontownGlobals.SellbotFactoryExt] = suitPlanner
class LawbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.LawbotHQ, ToontownGlobals.LawbotLobby, FADoorCodes.LB_DISGUISE_INCOMPLETE, DistributedCJElevatorAI.DistributedCJElevatorAI, DistributedLawbotBossAI.DistributedLawbotBossAI) self.lawOfficeElevators = [] self.officeBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createLawOfficeElevators() self.makeCogHQDoor(ToontownGlobals.LawbotOfficeExt, 0, 0) if simbase.config.GetBool('want-boarding-groups', True): self.createOfficeBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=0): # For Lawbot HQ, the lobby door index is 1, even though that index # should be for the Lawbot office exterior door. if destinationZone == self.lobbyZoneId: extDoorIndex = 1 elif destinationZone == ToontownGlobals.LawbotOfficeExt: extDoorIndex = 0 return CogHQAI.CogHQAI.makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=lock) def createLawOfficeElevators(self): destZones = (ToontownGlobals.LawbotStageIntA, ToontownGlobals.LawbotStageIntB, ToontownGlobals.LawbotStageIntC, ToontownGlobals.LawbotStageIntD) for i in xrange(len(destZones)): lawOfficeElevator = DistributedLawOfficeElevatorExtAI( self.air, self.air.lawOfficeMgr, destZones[i], i) lawOfficeElevator.generateWithRequired( ToontownGlobals.LawbotOfficeExt) self.lawOfficeElevators.append(lawOfficeElevator) def createOfficeBoardingParty(self): lawOfficeIdList = [] for lawOfficeElevator in self.lawOfficeElevators: lawOfficeIdList.append(lawOfficeElevator.doId) self.officeBoardingParty = DistributedBoardingPartyAI( self.air, lawOfficeIdList, 4) self.officeBoardingParty.generateWithRequired( ToontownGlobals.LawbotOfficeExt) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class LawbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.LawbotHQ, ToontownGlobals.LawbotLobby, FADoorCodes.LB_DISGUISE_INCOMPLETE, DistributedCJElevatorAI.DistributedCJElevatorAI, DistributedLawbotBossAI.DistributedLawbotBossAI) self.lawOfficeElevators = [] self.officeBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createLawOfficeElevators() self.makeCogHQDoor(ToontownGlobals.LawbotOfficeExt, 0, 0) if simbase.config.GetBool('want-boarding-groups', True): self.createOfficeBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def makeCogHQDoor(self, destinationZone, intDoorIndex, extDoorIndex, lock=0): # For Lawbot HQ, the lobby door index is 1, even though that index # should be for the Lawbot office exterior door. if destinationZone == self.lobbyZoneId: extDoorIndex = 1 elif destinationZone == ToontownGlobals.LawbotOfficeExt: extDoorIndex = 0 return CogHQAI.CogHQAI.makeCogHQDoor( self, destinationZone, intDoorIndex, extDoorIndex, lock=lock) def createLawOfficeElevators(self): destZones = ( ToontownGlobals.LawbotStageIntA, ToontownGlobals.LawbotStageIntB, ToontownGlobals.LawbotStageIntC, ToontownGlobals.LawbotStageIntD ) mins = ToontownGlobals.FactoryLaffMinimums[2] for i in xrange(len(destZones)): lawOfficeElevator = DistributedLawOfficeElevatorExtAI( self.air, self.air.lawOfficeMgr, destZones[i], i, antiShuffle=0, minLaff=mins[i]) lawOfficeElevator.generateWithRequired( ToontownGlobals.LawbotOfficeExt) self.lawOfficeElevators.append(lawOfficeElevator) def createOfficeBoardingParty(self): lawOfficeIdList = [] for lawOfficeElevator in self.lawOfficeElevators: lawOfficeIdList.append(lawOfficeElevator.doId) self.officeBoardingParty = DistributedBoardingPartyAI( self.air, lawOfficeIdList, 4) self.officeBoardingParty.generateWithRequired(ToontownGlobals.LawbotOfficeExt) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
def createMintBoardingParty(self): mintIdList = [] for mintElevator in self.mintElevators: mintIdList.append(mintElevator.doId) self.mintBoardingParty = DistributedBoardingPartyAI(self.air, mintIdList, 4) self.mintBoardingParty.generateWithRequired(self.zoneId)
class BossbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.BossbotHQ, ToontownGlobals.BossbotLobby, FADoorCodes.BB_DISGUISE_INCOMPLETE, DistributedBBElevatorAI.DistributedBBElevatorAI, DistributedBossbotBossAI.DistributedBossbotBossAI) self.cogKarts = [] self.courseBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) self.createCogKarts() if simbase.config.GetBool('want-boarding-groups', True): self.createCourseBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() def createCogKarts(self): posList = ((-26.5658, 237.459, 0), (132.197, 227.845, 0), (-28.725, -235.706, 0)) hprList = ((-159, 0, 0), (172, 0, 0), (-21, 0, 0)) mins = ToontownGlobals.FactoryLaffMinimums[3] for cogCourse in xrange(len(posList)): pos = posList[cogCourse] hpr = hprList[cogCourse] cogKart = DistributedCogKartAI.DistributedCogKartAI( self.air, cogCourse, pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2], self.air.countryClubMgr, minLaff=mins[cogCourse]) cogKart.generateWithRequired(self.zoneId) self.cogKarts.append(cogKart) def createCourseBoardingParty(self): cogKartIdList = [] for cogKart in self.cogKarts: cogKartIdList.append(cogKart.doId) self.courseBoardingParty = DistributedBoardingPartyAI( self.air, cogKartIdList, 4) self.courseBoardingParty.generateWithRequired(self.zoneId) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner
class SellbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.SellbotHQ, ToontownGlobals.SellbotLobby, FADoorCodes.SB_DISGUISE_INCOMPLETE, DistributedVPElevatorAI.DistributedVPElevatorAI, DistributedSellbotBossAI.DistributedSellbotBossAI) self.factoryElevators = [] self.factoryBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) # Sellbot HQ has not just one, but four lobby doors: self.cogHQDoors = [self.extDoor] for i in xrange(3): # CogHQAI already created one of the doors for us. extDoor = self.makeCogHQDoor(self.lobbyZoneId, 0, i + 1, self.lobbyFADoorCode) self.cogHQDoors.append(extDoor) self.createFactoryElevators() if simbase.config.GetBool('want-boarding-groups', True): self.createFactoryBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() # Our suit planner needs the Cog HQ doors as well: for sp in self.suitPlanners: if sp.zoneId == self.zoneId: sp.cogHQDoors = self.cogHQDoors def createFactoryElevators(self): # We only have two factory elevators: the front, and side elevators. for i in xrange(2): factoryElevator = DistributedFactoryElevatorExtAI( self.air, self.air.factoryMgr, ToontownGlobals.SellbotFactoryInt, i) factoryElevator.generateWithRequired( ToontownGlobals.SellbotFactoryExt) self.factoryElevators.append(factoryElevator) if simbase.config.GetBool('want-megacorp', True): factoryElevator = DistributedFactoryElevatorExtAI( self.air, self.air.factoryMgr, ToontownGlobals.SellbotMegaCorpInt, 2) factoryElevator.generateWithRequired( ToontownGlobals.SellbotFactoryExt) self.factoryElevators.append(factoryElevator) def createFactoryBoardingParty(self): factoryIdList = [elevator.doId for elevator in self.factoryElevators] self.factoryBoardingParty = DistributedBoardingPartyAI( self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired( ToontownGlobals.SellbotFactoryExt) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI( self.air, ToontownGlobals.SellbotFactoryExt) suitPlanner.generateWithRequired(ToontownGlobals.SellbotFactoryExt) suitPlanner.d_setZoneId(ToontownGlobals.SellbotFactoryExt) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[ToontownGlobals.SellbotFactoryExt] = suitPlanner
class SellbotHQAI(CogHQAI.CogHQAI): def __init__(self, air): CogHQAI.CogHQAI.__init__( self, air, ToontownGlobals.SellbotHQ, ToontownGlobals.SellbotLobby, FADoorCodes.SB_DISGUISE_INCOMPLETE, DistributedVPElevatorAI.DistributedVPElevatorAI, DistributedSellbotBossAI.DistributedSellbotBossAI) self.factoryElevators = [] self.factoryBoardingParty = None self.suitPlanners = [] self.startup() def startup(self): CogHQAI.CogHQAI.startup(self) # Sellbot HQ has not just one, but four lobby doors: self.cogHQDoors = [self.extDoor] for i in xrange(3): # CogHQAI already created one of the doors for us. extDoor = self.makeCogHQDoor(self.lobbyZoneId, 0, i + 1, self.lobbyFADoorCode) self.cogHQDoors.append(extDoor) self.createFactoryElevators() if simbase.config.GetBool('want-boarding-groups', True): self.createFactoryBoardingParty() if simbase.config.GetBool('want-suit-planners', True): self.createSuitPlanners() # Our suit planner needs the Cog HQ doors as well: for sp in self.suitPlanners: if sp.zoneId == self.zoneId: sp.cogHQDoors = self.cogHQDoors def createFactoryElevators(self): # We only have two factory elevators: the front, and side elevators. for i in xrange(2): factoryElevator = DistributedFactoryElevatorExtAI( self.air, self.air.factoryMgr, ToontownGlobals.SellbotFactoryInt, i) factoryElevator.generateWithRequired(ToontownGlobals.SellbotFactoryExt) self.factoryElevators.append(factoryElevator) def createFactoryBoardingParty(self): factoryIdList = [] for factoryElevator in self.factoryElevators: factoryIdList.append(factoryElevator.doId) self.factoryBoardingParty = DistributedBoardingPartyAI(self.air, factoryIdList, 4) self.factoryBoardingParty.generateWithRequired(ToontownGlobals.SellbotFactoryExt) def createSuitPlanners(self): suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, self.zoneId) suitPlanner.generateWithRequired(self.zoneId) suitPlanner.d_setZoneId(self.zoneId) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[self.zoneId] = suitPlanner suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, ToontownGlobals.SellbotFactoryExt) suitPlanner.generateWithRequired(ToontownGlobals.SellbotFactoryExt) suitPlanner.d_setZoneId(ToontownGlobals.SellbotFactoryExt) suitPlanner.initTasks() self.suitPlanners.append(suitPlanner) self.air.suitPlanners[ToontownGlobals.SellbotFactoryExt] = suitPlanner
def createCourseBoardingParty(self): cogKartIdList = [] for cogKart in self.cogKarts: cogKartIdList.append(cogKart.doId) self.courseBoardingParty = DistributedBoardingPartyAI(self.air, cogKartIdList, 4) self.courseBoardingParty.generateWithRequired(self.zoneId)
def createBoardingParty(self): self.boardingParty = DistributedBoardingPartyAI(self.air, [self.lobbyElevator.doId], 8) self.boardingParty.generateWithRequired(self.lobbyZoneId)