예제 #1
0
 def generate(self):
     if base.cr.catalogManager != None:
         base.cr.catalogManager.delete()
     base.cr.catalogManager = self
     DistributedObject.generate(self)
     if hasattr(base.localAvatar, 'catalogScheduleNextTime') and base.localAvatar.catalogScheduleNextTime == 0:
         self.d_startCatalog()
 def generate(self):
     DistributedObject.generate(self)
     self.loader = self.cr.playGame.hood.loader
     self.np = NodePath('Pillow')
     self.np.reparentTo(render)
     for point in DistributedPillow.polygons:
         orderedPoints = []
         for index in point:
             orderedPoints.append(DistributedPillow.points[index])
         self.floorpolys.append(CollisionPolygon(*orderedPoints))
     for n, p in enumerate(self.floorpolys):
         polyNode = CollisionNode("FloorPoly-%d" % n)
         polyNode.addSolid(p)
         polyNode.setFromCollideMask(OTPGlobals.FloorBitmask)
         polyNodePath = self.np.attachNewNode(polyNode)
         self.npaths.append(polyNodePath)
         self.accept("enterFloorPoly-%d" % n, self.gravityHigh)
         self.accept("enterdonalds_dreamland", self.gravityLow)
     for wall in DistributedPillow.walls:
         ab = DistributedPillow.points[wall[0]]
         bb = DistributedPillow.points[wall[1]]
         cb = Point3(bb.getX(), bb.getY(), bb.getZ() + 20)
         db = Point3(ab.getX(), ab.getY(), ab.getZ() + 20)
         self.wallpolys.append(CollisionPolygon(ab, bb, cb, db))
     for n, p in enumerate(self.wallpolys):
         polyNode = CollisionNode("WallPoly-%d" % n)
         polyNode.addSolid(p)
         polyNode.setFromCollideMask(OTPGlobals.FloorBitmask)
         polyNodePath = self.np.attachNewNode(polyNode)
         self.npaths.append(polyNodePath)
예제 #3
0
 def generate(self):
     DistributedObject.generate(self)
     self.soundFogHorn = base.loadSfx(self.fogHorn)
     self.soundShipBell = base.loadSfx(self.shipBell)
     self.soundWaterLap = base.loadSfx(self.waterLap)
     self.soundDockCreak = base.loadSfx(self.dockCreak)
     self.boat = self.cr.playGame.hood.loader.geom.find('**/' + self.boatPath)
     self.generated()
예제 #4
0
 def generate(self):
     if base.cr.catalogManager != None:
         base.cr.catalogManager.delete()
     base.cr.catalogManager = self
     DistributedObject.generate(self)
     if hasattr(base.localAvatar, 'catalogScheduleNextTime'
                ) and base.localAvatar.catalogScheduleNextTime == 0:
         self.d_startCatalog()
예제 #5
0
 def generate(self):
     self._announcerInterest = None
     self._siegeTeam = 0
     self._siegeTeamUpdater = FunctionCall(self._setSiegeTeam, localAvatar._siegeTeamSV)
     self._siegeTeamUpdater.pushCurrentState()
     DistributedObject.generate(self)
     self._pvpTeamJoinable = { }
     base.cr.distributedDistrict.siegeManager = self
예제 #6
0
    def generate(self):
        """
        Purpose: The generate Method handles the basic generation of the
        KartShopInterior object by generating the super class.

        Params: None
        Return: None
        """
        DistributedObject.generate(self)
예제 #7
0
 def generate(self):
     self._announcerInterest = None
     self._siegeTeam = 0
     self._siegeTeamUpdater = FunctionCall(self._setSiegeTeam,
                                           localAvatar._siegeTeamSV)
     self._siegeTeamUpdater.pushCurrentState()
     DistributedObject.generate(self)
     self._pvpTeamJoinable = {}
     base.cr.distributedDistrict.siegeManager = self
예제 #8
0
 def generate(self):
     DistributedObject.generate(self)
     self.soundFogHorn = base.loadSfx(self.fogHorn)
     self.soundShipBell = base.loadSfx(self.shipBell)
     self.soundWaterLap = base.loadSfx(self.waterLap)
     self.soundDockCreak = base.loadSfx(self.dockCreak)
     self.boat = self.cr.playGame.hood.loader.geom.find('**/' +
                                                        self.boatPath)
     self.generated()
    def generate(self):
        DistributedObject.generate(self)

        # Load the TV, and give it a nice idle animation.
        # This will probably be moved somewhere else once we get it into the scripted sequence
        self.tv = loader.loadModel('phase_4/models/events/election_tv')
        self.tv.reparentTo(render)
        self.tv.setPosHprScale(87.85, -0.25, 40.0, 270.0, 0.0, 0.0, 1.5, 1.5,
                               1.5)
        self.tv.hide()

        self.tvIdle = Sequence(
            self.tv.posInterval(2.5, (87.85, -0.25, 22.0),
                                blendType='easeInOut'),
            self.tv.posInterval(2.5, (87.85, -0.25, 21.0),
                                blendType='easeInOut'),
        )
        self.tvFlyIn = Sequence(
            Func(self.tv.show), Func(self.tv.setTransparency, 1),
            Parallel(
                self.tv.colorScaleInterval(1,
                                           colorScale=VBase4(1, 1, 1, 1),
                                           startColorScale=VBase4(1, 1, 1, 0)),
                self.tv.posInterval(4, (87.85, -0.25, 20.0),
                                    blendType='easeInOut')),
            Func(self.tv.setTransparency, 0),
            self.tv.posInterval(2, (87.85, -0.25, 21.0)),
            Func(self.tvIdle.loop))

        self.tvFlyOut = Sequence(
            Func(self.tv.setTransparency, 1),
            Parallel(
                self.tv.colorScaleInterval(1,
                                           colorScale=VBase4(1, 1, 1, 0),
                                           startColorScale=VBase4(1, 1, 1, 1)),
                self.tv.posInterval(4, (87.85, -0.25, 40.0))),
            Func(self.tv.hide))

        # Attach a Cog's propeller onto the TV. Foreshadowing!
        self.prop = BattleProps.globalPropPool.getProp('propeller')
        propJoint = self.tv.find('**/topSphere')
        self.prop.reparentTo(propJoint)
        self.prop.loop('propeller', fromFrame=0, toFrame=8)
        self.prop.setPos(0, 1, 2)
        self.prop.setScale(2.0, 1.5, 1.0)

        self.buffer = base.win.makeTextureBuffer("tv", 512, 256)
        self.buffer.setSort(-100)
        self.camera = base.makeCamera(self.buffer)
        self.camera.reparentTo(render)

        ts = self.tv.find('**/screen').findTextureStage('*')
        self.tv.find('**/screen').setTexture(ts, self.buffer.getTexture(), 1)
        self.tv.find('**/screen').setTexScale(ts, 1.2, 1.2)
        self.tv.find('**/screen').setTexOffset(ts, -0.09, -0.1)
        self.tv.find('**/screen').setTexHpr(ts, 1, 0, 0)
예제 #10
0
    def generate(self):
        # Called when the client loads
        self.notify.debug("BASE: generate")
        DistributedObject.generate(self)

        # listen for requests
        self.accept("deallocateZoneIdFromPlannedParty", self.deallocateZoneIdFromPlannedParty)

        # listen for the generate event, which will be thrown after the
        # required fields are filled in
        self.announceGenerateName = self.uniqueName("generate")
예제 #11
0
 def generate(self):
     DistributedObject.generate(self)
     self.soundFogHorn = base.loadSfx(self.fogHorn)
     self.soundShipBell = base.loadSfx(self.shipBell)
     self.soundWaterLap = base.loadSfx(self.waterLap)
     self.soundDockCreak = base.loadSfx(self.dockCreak)
     #try:
     #    self.boat = self.cr.playGame.hood.loader.geom.find('**/' + self.boatPath)
     #except:
     #        base.taskMgr.add(self.__pollBoat, self.uniqueName('__pollBoat'))
     #        return
     self.boat = self.cr.playGame.hood.loader.geom.find('**/' +
                                                        self.boatPath)
     self.generated()
    def generate(self):
        DistributedObject.generate(self)

        # Load the TV, and give it a nice idle animation.
        # This will probably be moved somewhere else once we get it into the scripted sequence
        self.tv = loader.loadModel('phase_4/models/events/election_tv')
        self.tv.reparentTo(render)
        self.tv.setPosHprScale(87.85, -0.25, 40.0, 270.0, 0.0, 0.0, 1.5, 1.5, 1.5)
        self.tv.hide()

        self.tvIdle = Sequence(
            self.tv.posInterval(2.5, (87.85, -0.25, 22.0), blendType='easeInOut'),
            self.tv.posInterval(2.5, (87.85, -0.25, 21.0), blendType='easeInOut'),
        )
        self.tvFlyIn = Sequence(
            Func(self.tv.show),
            Func(self.tv.setTransparency, 1),
            Parallel(self.tv.colorScaleInterval(1, colorScale=VBase4(1, 1, 1, 1), startColorScale=VBase4(1, 1, 1, 0)), self.tv.posInterval(4, (87.85, -0.25, 20.0), blendType='easeInOut')),
            Func(self.tv.setTransparency, 0),
            self.tv.posInterval(2, (87.85, -0.25, 21.0)),
            Func(self.tvIdle.loop)
        )

        # Attach a cog's propeller onto the TV. Foreshadowing!
        self.prop = BattleProps.globalPropPool.getProp('propeller')
        propJoint = self.tv.find('**/topSphere')
        self.prop.reparentTo(propJoint)
        self.prop.loop('propeller', fromFrame=0, toFrame=8)
        self.prop.setPos(0, 1, 2)
        self.prop.setScale(2.0, 1.5, 1.0)

        self.buffer = base.win.makeTextureBuffer("tv", 512, 256)
        self.buffer.setSort(-100)
        self.camera = base.makeCamera(self.buffer)
        self.camera.reparentTo(render)
                
        ts = self.tv.find('**/screen').findTextureStage('*')
        self.tv.find('**/screen').setTexture(ts, self.buffer.getTexture(), 1)
        self.tv.find('**/screen').setTexScale(ts, 1.2, 1.2)
        self.tv.find('**/screen').setTexOffset(ts, -0.09, -0.1)
        self.tv.find('**/screen').setTexHpr(ts, 1, 0, 0)
    def generate(self):
        DistributedObject.generate(self)
        self.soundFogHorn = base.audio3d.loadSfx(self.fogHorn)
        self.soundShipBell = base.audio3d.loadSfx(self.shipBell)
        self.soundWaterLap = base.audio3d.loadSfx(self.waterLap)
        self.soundDockCreak = base.audio3d.loadSfx(self.dockCreak)

        geom = self.cr.playGame.hood.loader.geom
        self.boatMdl = geom.find('**/*donalds_boat*')
        self.boat = geom.find("**/ddBoatRoot")
        self.boatMdl1 = geom.find("**/ddBoatMdl1")

        base.audio3d.attachSoundToObject(self.soundFogHorn, self.boat)
        base.audio3d.attachSoundToObject(self.soundShipBell, self.boat)
        base.audio3d.attachSoundToObject(self.soundWaterLap, self.boat)
        base.audio3d.attachSoundToObject(self.soundDockCreak, self.boat)

        self.soundWaterLap.setLoop(True)
        self.soundWaterLap.play()

        self.generated()
예제 #14
0
    def generate(self):
        DistributedObject.generate(self)

        self.accept('suitCreate', self.__handleSuitCreate)
        self.accept('suitDelete', self.__handleSuitDelete)
        base.localAvatar.setBattleZone(self)
        self.lastCameraIndex = base.localAvatar.smartCamera.cameraIndex
        # Change to over the shoulder mode
        #base.localAvatar.smartCamera.setCameraPositionByIndex(base.localAvatar.smartCamera.OTSIndex)
        base.localAvatar.battleControls = True

        from src.coginvasion.szboss import AmbientGeneric, FuncWater, Ropes, InfoPlayerRelocate, EnvLightGlow, EnvParticleSystem, PointSpotlight
        #base.bspLoader.linkEntityToClass("ambient_generic", AmbientGeneric.AmbientGeneric)
        base.bspLoader.linkEntityToClass("func_water", FuncWater.FuncWater)
        base.bspLoader.linkEntityToClass("rope_begin", Ropes.RopeBegin)
        base.bspLoader.linkEntityToClass("rope_keyframe", Ropes.RopeKeyframe)
        base.bspLoader.linkEntityToClass("info_player_relocate",
                                         InfoPlayerRelocate.InfoPlayerRelocate)
        base.bspLoader.linkEntityToClass("env_lightglow",
                                         EnvLightGlow.EnvLightGlow)
        base.bspLoader.linkEntityToClass("env_particlesystem",
                                         EnvParticleSystem.EnvParticleSystem)
        base.bspLoader.linkEntityToClass("point_spotlight",
                                         PointSpotlight.PointSpotlight)
 def generate(self):
     self.notify.debug('BASE: generate')
     DistributedObject.generate(self)
 def generate(self):
     self.notify.debug('BASE: generate')
     DistributedObject.generate(self)
예제 #17
0
 def generate(self):
     self.cr.gameStatManager = self
     DistributedObject.generate(self)
예제 #18
0
 def generate(self):
     self.cr.timeOfDayManager = self
     DistributedObject.generate(self)
 def generate(self):
     DistributedObject.generate(self)
     localAvatar.guiMgr.createSiegeStatus(self)
     self.accept("`", localAvatar.guiMgr.showSiegeStatus)
     self.accept("`-up", localAvatar.guiMgr.hideSiegeStatus)
예제 #20
0
 def generate(self):
     self.notify.debug('BASE: generate')
     DistributedObject.generate(self)
     self.accept('deallocateZoneIdFromPlannedParty',
                 self.deallocateZoneIdFromPlannedParty)
     self.announceGenerateName = self.uniqueName('generate')
예제 #21
0
 def generate(self):
     DistributedObject.generate(self)
     self.childInterest = None
     print('DistributedInterestOpener.generate')
 def generate(self):
     DistributedObject.generate(self)
 def generate(self):
     DistributedObject.generate(self)
     base.cr.PirateBandManager = self
예제 #24
0
 def generate(self):
     DistributedObject.generate(self)
     localAvatar.guiMgr.createSiegeStatus(self)
     self.accept('`', localAvatar.guiMgr.showSiegeStatus)
     self.accept('`-up', localAvatar.guiMgr.hideSiegeStatus)
예제 #25
0
 def generate(self):
     DistributedObject.generate(self)
     self.accept('deallocateZoneIdFromPlannedLobby',
                 self.deallocateZoneIdFromPlannedLobby)
예제 #26
0
 def generate(self):
     self.notify.debug('BASE: generate')
     DistributedObject.generate(self)
     self.accept('deallocateZoneIdFromPlannedParty', self.deallocateZoneIdFromPlannedParty)
     self.announceGenerateName = self.uniqueName('generate')
예제 #27
0
 def generate(self):
     DistributedObject.generate(self)
     self.mode = 'toon'
     self.townTopLevel = self.cr.playGame.hood.loader.geom
 def generate(self):
     DistributedObject.generate(self)
     base.cr.PirateBandManager = self
예제 #29
0
    def generate(self):
        DistributedObject.generate(self)
        self.accept('clock_error', self.handleClockError)

        if self.updateFreq > 0:
            self.startTask()
 def generate(self):
     self.cr.gameStatManager = self
     DistributedObject.generate(self)
 def generate(self):
     DistributedObject.generate(self)
예제 #32
0
 def generate(self):
     # Called when the client loads
     self.notify.debug("BASE: generate")
     DistributedObject.generate(self)
 def generate(self):
     self.cr.timeOfDayManager = self
     DistributedObject.generate(self)
 def generate(self):
     DistributedObject.generate(self)
     self.accept('deallocateZoneIdFromPlannedLobby', self.deallocateZoneIdFromPlannedLobby)