Ejemplo n.º 1
0
 def load(self):
     DistributedEntity.load(self)
     self.powerUpSound = base.loadSfxOnNode("phase_14/audio/sfx/sewer_generator_windup.ogg", self.cEntity.getModelNp())
     self.powerDownSound = base.loadSfxOnNode("phase_14/audio/sfx/sewer_generator_winddown.ogg", self.cEntity.getModelNp())
     self.runSound = base.loadSfxOnNode("phase_14/audio/sfx/sewer_generator_hum.ogg", self.cEntity.getModelNp())
     self.runSound.setLoop(True)
     base.materialData.update(PhysicsUtils.makeBulletCollFromGeoms(self.cEntity.getModelNp()))
    def __init__(self, baseChannel, stateServerChannel):
        CogInvasionInternalRepository.__init__(
            self,
            baseChannel,
            stateServerChannel, [
                'resources/phase_3/etc/direct.dc',
                'resources/phase_3/etc/toon.dc'
            ],
            dcSuffix='AI')
        self.notify.setInfo(True)
        self.district = None
        self.zoneAllocator = UniqueIdAllocator(ZoneUtil.DynamicZonesBegin,
                                               ZoneUtil.DynamicZonesEnd)
        self.zoneDataStore = AIZoneDataStore()
        self.hoods = {}
        self.dnaStoreMap = {}
        self.dnaDataMap = {}
        self.districtNameMgr = self.generateGlobalObject(
            DO_ID_DISTRICT_NAME_MANAGER, 'DistrictNameManager')
        self.holidayMgr = self.generateGlobalObject(DO_ID_HOLIDAY_MANAGER,
                                                    'HolidayManager')
        self.uin = self.generateGlobalObject(DO_ID_UNIQUE_INTEREST_NOTIFIER,
                                             'UniqueInterestNotifier')
        self.csm = self.generateGlobalObject(DO_ID_CLIENT_SERVICES_MANAGER,
                                             'ClientServicesManager')
        self.statsMgr = self.generateGlobalObject(DO_ID_STATS_MANAGER,
                                                  'StatsManager')

        # Anything that is a DistributedAvatarAI (Toons, Suits, etc).
        # This is a per-zone list of avatars.
        self.avatars = {}
        self.numAvatars = 0

        self.battleZones = {}

        if DO_SIMULATION:
            self.zonePhysics = {}
            self.bspLoader = BSPLoader()
            self.bspLoader.setAi(True)
            self.bspLoader.setMaterialsFile("phase_14/etc/materials.txt")
            #self.bspLoader.setTextureContentsFile("phase_14/etc/texturecontents.txt")
            #self.bspLoader.setServerEntityDispatcher(self)
            self.bspLoader.read(
                "phase_14/etc/sewer_entrance_room_indoors/sewer_entrance_room_indoors.bsp"
            )
            PhysicsUtils.makeBulletCollFromGeoms(self.bspLoader.getResult(),
                                                 enableNow=False)
Ejemplo n.º 3
0
    def load(self):
        DistributedEntity.load(self)

        self.axis = base.bspLoader.getEntityValueVector(self.entnum, "axis")
        self.speed = base.bspLoader.getEntityValueFloat(self.entnum, "speed")
        self.timeToFull = base.bspLoader.getEntityValueFloat(self.entnum, "timeToFull")

        base.materialData.update(PhysicsUtils.makeBulletCollFromGeoms(self.cEntity.getModelNp()))