def generate(self):
        self.notify.info('generate')
        self.notify.info('start factory %s %s creation, frame=%s' % (self.factoryId, self.doId, globalClock.getFrameCount()))
        if __dev__:
            simbase.factory = self
        self.notify.info('loading spec')
        specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
        factorySpec = LevelSpec.LevelSpec(specModule)
        if __dev__:
            self.notify.info('creating entity type registry')
            typeReg = self.getEntityTypeReg()
            factorySpec.setEntityTypeReg(typeReg)
        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec)
        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI, DistributedBattleFactoryAI.DistributedBattleFactoryAI, cogSpecModule.CogData, cogSpecModule.ReserveCogData, cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        messenger.send('plannerCreated-' + str(self.doId))
        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()
        scenario = 0
        for avId in self.avIdList:
            self.air.writeServerEvent('factory-entered', avId=avId, factoryId=self.factoryId, entranceId=self.entranceId, scenario=scenario, avIds=self.avIdList)

        self.notify.info('finish factory %s %s creation' % (self.factoryId, self.doId))
Ejemplo n.º 2
0
    def generate(self):
        self.notify.info('generate')
        self.notify.info(
            'start factory %s %s creation, frame=%s' %
            (self.factoryId, self.doId, globalClock.getFrameCount()))
        self.notify.info('loading spec')
        specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
        factorySpec = LevelSpec.LevelSpec(specModule)
        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec)
        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI,
            DistributedBattleFactoryAI.DistributedBattleFactoryAI,
            cogSpecModule.CogData, cogSpecModule.ReserveCogData,
            cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        messenger.send('plannerCreated-' + str(self.doId))
        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()
        scenario = 0
        description = '%s|%s|%s|%s' % (self.factoryId, self.entranceId,
                                       scenario, self.avIdList)
        for avId in self.avIdList:
            self.air.writeServerEvent('factoryEntered', avId, description)

        self.notify.info('finish factory %s %s creation' %
                         (self.factoryId, self.doId))
Ejemplo n.º 3
0
    def generate(self):
        self.notify.info('generate')

        self.notify.info(
            'start factory %s %s creation, frame=%s' %
            (self.factoryId, self.doId, globalClock.getFrameCount()))

        if __dev__:
            simbase.factory = self

        # create our spec
        self.notify.info('loading spec')
        specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
        factorySpec = LevelSpec.LevelSpec(specModule)

        if __dev__:
            # create a factory EntityTypeRegistry and hand it to the spec
            self.notify.info('creating entity type registry')
            typeReg = self.getEntityTypeReg()
            factorySpec.setEntityTypeReg(typeReg)

        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec)

        # TODO: convert suits into Entities
        # create the suits
        # Until they are converted to entities, it's important that
        # the suits are created in the levelZone.

        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI,
            DistributedBattleFactoryAI.DistributedBattleFactoryAI,
            cogSpecModule.CogData, cogSpecModule.ReserveCogData,
            cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        # alert battle blockers that planner has been created
        messenger.send("plannerCreated-" + str(self.doId))

        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()

        # log that toons entered the factory
        scenario = 0  # placeholder until we have real scenarios
        description = '%s|%s|%s|%s' % (self.factoryId, self.entranceId,
                                       scenario, self.avIdList)
        for avId in self.avIdList:
            self.air.writeServerEvent('factoryEntered', avId, description)

        self.notify.info('finish factory %s %s creation' %
                         (self.factoryId, self.doId))
Ejemplo n.º 4
0
    def generate(self):
        self.notify.info('generate')
        self.notify.info(
            'start factory %s %s creation, frame=%s' %
            (self.factoryId, self.doId, globalClock.getFrameCount()))
        if __dev__:
            simbase.factory = self
        self.notify.info('loading spec')
        specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
        factorySpec = LevelSpec.LevelSpec(specModule)
        if __dev__:
            self.notify.info('creating entity type registry')
            typeReg = self.getEntityTypeReg()
            factorySpec.setEntityTypeReg(typeReg)
        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec)
        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
        if self.getFactoryId() == ToontownGlobals.SwagFactoryInt:
            self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
                self.air, self,
                DistributedFactorySuitAI.DistributedFactorySuitAI,
                DistributedBattleSwagtoryAI.DistributedBattleSwagtoryAI,
                cogSpecModule.CogData, cogSpecModule.ReserveCogData,
                cogSpecModule.BattleCells)
        else:
            self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
                self.air, self,
                DistributedFactorySuitAI.DistributedFactorySuitAI,
                DistributedBattleFactoryAI.DistributedBattleFactoryAI,
                cogSpecModule.CogData, cogSpecModule.ReserveCogData,
                cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        messenger.send('plannerCreated-' + str(self.doId))
        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()
        scenario = 0
        for avId in self.avIdList:
            self.air.writeServerEvent('factory-entered',
                                      avId=avId,
                                      factoryId=self.factoryId,
                                      entranceId=self.entranceId,
                                      scenario=scenario,
                                      avIds=self.avIdList)

        self.notify.info('finish factory %s %s creation' %
                         (self.factoryId, self.doId))
Ejemplo n.º 5
0
    def startFloor(self):
        self.notify.info('loading spec')
        self.factorySpec = LevelSpec.LevelSpec(self.spec)
        if __dev__:
            self.notify.info('creating entity type registry')
            typeReg = self.getEntityTypeReg()
            self.factorySpec.setEntityTypeReg(typeReg)

        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, self.factorySpec)
        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.lawOfficeId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI,
            DistributedBattleFactoryAI.DistributedBattleFactoryAI,
            cogSpecModule.CogData, cogSpecModule.ReserveCogData,
            cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        messenger.send('plannerCreated-' + str(self.doId))
        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()
        scenario = 0
        description = '%s|%s|%s|%s' % (self.lawOfficeId, self.entranceId,
                                       scenario, self.avIdList)
        for avId in self.avIdList:
            self.air.writeServerEvent('DAOffice Entered', avId, description)

        self.notify.info('finish factory %s %s creation' %
                         (self.lawOfficeId, self.doId))
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
     factorySpec = LevelSpec.LevelSpec(specModule)
     #if __dev__:
     #    typeReg = self.getEntityTypeReg()
     #    factorySpec.setEntityTypeReg(typeReg)
     DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
 def levelAnnounceGenerate(self):
     self.notify.debug("levelAnnounceGenerate")
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = FactorySpecs.getFactorySpecModule(self.lawOfficeId)
     factorySpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         typeReg = self.getEntityTypeReg()
         factorySpec.setEntityTypeReg(typeReg)
     DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
     factorySpec = LevelSpec.LevelSpec(specModule)
     if __dev__:
         typeReg = self.getEntityTypeReg()
         factorySpec.setEntityTypeReg(typeReg)
     DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
Ejemplo n.º 9
0
    def levelAnnounceGenerate(self):
        self.notify.debug('levelAnnounceGenerate')
        DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)

        # create our spec
        # NOTE: in dev, the AI will probably send us another spec to use
        specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
        factorySpec = LevelSpec.LevelSpec(specModule)
        if __dev__:
            # give the spec a factory EntityTypeRegistry.
            typeReg = self.getEntityTypeReg()
            factorySpec.setEntityTypeReg(typeReg)
        
        DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
Ejemplo n.º 10
0
    def levelAnnounceGenerate(self):
        #print("LEVEL ANNOUNCE GENERATE")
        self.notify.debug('levelAnnounceGenerate')
        #import pdb; pdb.set_trace() # toon detached by here
        DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)

        # create our spec
        # NOTE: in dev, the AI will probably send us another spec to use
        specModule = FactorySpecs.getFactorySpecModule(self.lawOfficeId)
        factorySpec = LevelSpec.LevelSpec(specModule)
        if __dev__:
            # give the spec a factory EntityTypeRegistry.
            typeReg = self.getEntityTypeReg()
            factorySpec.setEntityTypeReg(typeReg)
        
        DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
 def startFloor(self):
     self.notify.info('loading spec')
     self.factorySpec = LevelSpec.LevelSpec(self.spec)
     self.notify.info('creating entities')
     DistributedLevelAI.DistributedLevelAI.generate(self, self.factorySpec)
     self.notify.info('creating cogs')
     cogSpecModule = FactorySpecs.getCogSpecModule(self.lawOfficeId)
     self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI, DistributedBattleFactoryAI.DistributedBattleFactoryAI, cogSpecModule.CogData, cogSpecModule.ReserveCogData, cogSpecModule.BattleCells)
     suitHandles = self.planner.genSuits()
     messenger.send('plannerCreated-' + str(self.doId))
     self.suits = suitHandles['activeSuits']
     self.reserveSuits = suitHandles['reserveSuits']
     self.d_setSuits()
     scenario = 0
     description = '%s|%s|%s|%s' % (self.lawOfficeId, self.entranceId, scenario, self.avIdList)
     for avId in self.avIdList:
         self.air.writeServerEvent('DAOffice Entered', avId, description)
     self.notify.info('finish factory %s %s creation' % (self.lawOfficeId, self.doId))
Ejemplo n.º 12
0
    def startFloor(self):

        if __debug__:
            simbase.factory = self

        # create our spec
        self.notify.info('loading spec')
        self.factorySpec = LevelSpec.LevelSpec(self.spec)

        if __dev__:
            # create a factory EntityTypeRegistry and hand it to the spec
            self.notify.info('creating entity type registry')
            typeReg = self.getEntityTypeReg()
            self.factorySpec.setEntityTypeReg(typeReg)

        self.notify.info('creating entities')
        DistributedLevelAI.DistributedLevelAI.generate(self, self.factorySpec)

        self.notify.info('creating cogs')
        cogSpecModule = FactorySpecs.getCogSpecModule(self.lawOfficeId)
        self.planner = LevelSuitPlannerAI.LevelSuitPlannerAI(
            self.air, self, DistributedFactorySuitAI.DistributedFactorySuitAI,
            DistributedBattleFactoryAI.DistributedBattleFactoryAI,
            cogSpecModule.CogData, cogSpecModule.ReserveCogData,
            cogSpecModule.BattleCells)
        suitHandles = self.planner.genSuits()
        # alert battle blockers that planner has been created
        messenger.send("plannerCreated-" + str(self.doId))

        self.suits = suitHandles['activeSuits']
        self.reserveSuits = suitHandles['reserveSuits']
        self.d_setSuits()

        # log that toons entered the factory
        scenario = 0  # placeholder until we have real scenarios
        description = '%s|%s|%s|%s' % (self.lawOfficeId, self.entranceId,
                                       scenario, self.avIdList)
        for avId in self.avIdList:
            self.air.writeServerEvent('DAOffice Entered', avId, description)

        self.notify.info('finish factory %s %s creation' %
                         (self.lawOfficeId, self.doId))
 def getReserveCogSpec(self, cogId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
     return cogSpecModule.ReserveCogData[cogId]
 def getBattleCellSpec(self, battleCellId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
     return cogSpecModule.BattleCells[battleCellId]
 def getReserveCogSpec(self, cogId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
     return cogSpecModule.ReserveCogData[cogId]
 def getCogSpec(self, cogId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.lawOfficeId)
     return cogSpecModule.CogData[cogId]
 def getBattleCellSpec(self, battleCellId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.factoryId)
     return cogSpecModule.BattleCells[battleCellId]
Ejemplo n.º 18
0
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = FactorySpecs.getFactorySpecModule(self.lawOfficeId)
     factorySpec = LevelSpec.LevelSpec(specModule)
     DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
 def levelAnnounceGenerate(self):
     self.notify.debug('levelAnnounceGenerate')
     DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
     specModule = FactorySpecs.getFactorySpecModule(self.factoryId)
     factorySpec = LevelSpec.LevelSpec(specModule)
     DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec)
 def getCogSpec(self, cogId):
     cogSpecModule = FactorySpecs.getCogSpecModule(self.lawOfficeId)
     return cogSpecModule.CogData[cogId]