Beispiel #1
0
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     FSM.__init__(self, 'DGenerator')
     self.state = 0
     self.runSound = None
     self.powerDownSound = None
     self.powerUpSound = None
Beispiel #2
0
 def disable(self):
     self.request('Off')
     self.state = None
     self.runSound = None
     self.powerDownSound = None
     self.powerUpSound = None
     DistributedEntity.disable(self)
    def load(self):
        self.assign(self.cEntity.getModelNp())

        DistributedEntity.load(self)
        UseableObject.load(self)

        self.spawnflags = self.getEntityValueInt("spawnflags")
        self.moveDir = self.getEntityValueVector("movedir")
        self.speed = self.getEntityValueFloat("speed")
        self.wait = self.getEntityValueFloat("wait")

        movesnd = self.getEntityValue("movesnd")
        if len(movesnd) > 0:
            self.moveSound = base.audio3d.loadSfx(movesnd)
            self.moveSound.setLoop(bool(
                self.getEntityValueInt("loop_movesnd")))
            base.audio3d.attachSoundToObject(self.moveSound,
                                             self.cEntity.getModelNp())

        stopsnd = self.getEntityValue("stopsnd")
        if len(stopsnd) > 0:
            self.stopSound = base.audio3d.loadSfx(stopsnd)
            base.audio3d.attachSoundToObject(self.stopSound,
                                             self.cEntity.getModelNp())

        self.origin = self.getPos()
        self.cEntity.getModelBounds(self.mins, self.maxs)

        self.updateTask = taskMgr.add(self.__updateTask,
                                      self.uniqueName("updateTask"))
 def announceGenerate(self):
     DistributedEntity.announceGenerate(self)
     DistributedSuit.announceGenerate(self)
     self.reparentTo(render)
     self.show()
     self.ls()
     self.unstash()
Beispiel #5
0
    def load(self):
        DistributedEntity.load(self)

        self.sound = base.loadSfxOnNode(
            base.bspLoader.getEntityValue(self.entnum, "changeSound"), self)
        self.lightMdl = loader.loadModel(
            "phase_14/models/props/indicator_light.bam")
        self.lightMdl.find("**/__lightsrc__").setTransparency(1)
        self.lightMdl.reparentTo(self)
        #self.lightMdl.setBin("fixed", 0)
        self.lightGlow = loader.loadModel(
            "phase_14/models/props/light_glow.bam")
        self.lightGlow.reparentTo(self)
        self.lightGlow.setTwoSided(True)
        self.lightGlow.setDepthOffset(2)
        self.lightGlow.setY(1.5)
        self.lightGlow.setScale(1.3)
        #self.lightGlow.setBillboardPointEye()
        #self.lightGlow.setScale()

        self.reparentTo(render)
        self.setPos(self.cEntity.getOrigin())
        self.setHpr(self.cEntity.getAngles())

        self.setScale(base.bspLoader.getEntityValueFloat(self.entnum, "scale"))
Beispiel #6
0
    def __init__(self, cr):
        DistributedEntity.__init__(self, cr)
        self.lightMdl = None
        self.lightGlow = None
        self.soundFile = None
        self.lightColor = (1, 1, 0.75, 1.0)

        self.lightState = 0
 def disable(self):
     self.stopSmooth()
     taskMgr.remove(self.uniqueName("watchTarget"))
     if self.pathVisRoot:
         self.pathVisRoot.removeNode()
         self.pathVisRoot = None
     DistributedAvatar.disable(self)
     DistributedEntity.disable(self)
    def announceGenerate(self):
        DistributedEntity.announceGenerate(self)
        DistributedAvatar.announceGenerate(self)
        taskMgr.add(self.__watchTargetTask, self.uniqueName("watchTarget"))

        self.startSmooth()

        self.reparentTo(render)
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     FSM.__init__(self, 'func_rotating')
     self.state = 0
     self.axis = Vec3.up()
     self.timeToFull = 5.0
     self.speed = 50.0
     self.spinTrack = None
Beispiel #10
0
 def load(self):
     DistributedEntity.load(self)
     
     self.axis = self.getEntityValueVector("axis")
     self.speed = self.getEntityValueFloat("speed")
     self.timeToFull = self.getEntityValueFloat("timeToFull")
     
     base.materialData.update(PhysicsUtils.makeBulletCollFromGeoms(self.cEntity.getModelNp()))
    def announceGenerate(self):
        DistributedEntity.announceGenerate(self)
        DistributedToon.announceGenerate(self)
        self.activateSmoothing(True, False)
        self.startSmooth()

        self.reparentTo(render)

        self.setAnimState('Happy')
    def __init__(self, cr):
        DistributedEntity.__init__(self, cr)
        DistributedAvatar.__init__(self, cr)
        Goon.__init__(self)
        self.moveTrack = None

        self.pathVisRoot = render.attachNewNode('pathVisRoot')

        self._watchTarget = None
 def disable(self):
     self.request('Off')
     self.__cleanupSpin()
     self.state = None
     self.axis = None
     self.timeToFull = None
     self.speed = None
     self.spinTrack = None
     DistributedEntity.disable(self)
Beispiel #14
0
 def unload(self):
     DistributedEntity.unload(self)
     self.request('Off')
     self.moveIval = None
     self.origin = None
     self.mins = None
     self.maxs = None
     self.speed = None
     self.wait = None
     self.moveDir = None
     self.pressSound = None
     self.state = None
     self.removeNode()
Beispiel #15
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()))
Beispiel #16
0
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     UseableObject.__init__(self)
     FSM.__init__(self, 'button')
     self.state = 0
     self.moveDir = Vec3(0)
     self.speed = 0
     self.moveIval = None
     self.mins = Point3(0)
     self.maxs = Point3(0)
     self.origin = Point3(0)
     self.pressSound = None
     
     self.hasPhysGeom = False
     self.underneathSelf = True
    def __init__(self, cr):
        DistributedEntity.__init__(self, cr)
        UseableObject.__init__(self)
        FSM.__init__(self, 'FuncDoor')
        self.state = 0
        self.moveDir = Vec3(0)
        self.speed = 0
        self.wait = 0
        self.moveSound = None
        self.stopSound = None
        self.origin = Point3(0)
        self.spawnflags = 0
        self.moveIval = None
        self.mins = Point3(0)
        self.maxs = Point3(0)
        self.wasTouching = False

        self.hasPhysGeom = False
        self.underneathSelf = True
Beispiel #18
0
    def load(self):
        self.assign(self.cEntity.getModelNp())

        DistributedEntity.load(self)
        UseableObject.load(self)

        entnum = self.cEntity.getBspEntnum()
        loader = self.cEntity.getLoader()
        self.moveDir = self.getEntityValueVector("movedir")
        self.speed = self.getEntityValueFloat("speed")
        self.wait = self.getEntityValueFloat("wait")

        movesnd = self.getEntityValue("sounds")
        if len(movesnd) > 0:
            self.pressSound = base.audio3d.loadSfx(movesnd)
            base.audio3d.attachSoundToObject(self.pressSound, self.cEntity.getModelNp())

        self.origin = self.getPos()
        self.cEntity.getModelBounds(self.mins, self.maxs)
 def unload(self):
     DistributedEntity.unload(self)
     if self.updateTask:
         self.updateTask.remove()
         self.updateTask = None
     if self.moveIval:
         self.moveIval.finish()
         self.moveIval = None
     self.origin = None
     self.spawnflags = None
     self.isOpen = None
     self.moveDir = None
     self.speed = None
     self.wait = None
     self.moveSound = None
     self.stopSound = None
     self.mins = None
     self.maxs = None
     self.removeNode()
 def disable(self):
     self.endCutscene(False)
     if self.gui:
         self.gui.unload()
         self.gui = None
     DistributedEntity.disable(self)
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     self.cutsceneImpl = None
     self.gui = CutsceneGUI(barDur=1.0,
                            fov=CIGlobals.OriginalActionFov * 1.1)
Beispiel #22
0
 def unload(self):
     DistributedEntity.unload(self)
     if self.watchTask:
         self.watchTask.remove()
         self.watchTask = None
     self.wasInside = None
Beispiel #23
0
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     self.watchTask = None
     self.wasInside = False
Beispiel #24
0
 def load(self):
     DistributedEntity.load(self)
     self.watchTask = taskMgr.add(self._triggerTask,
                                  self.uniqueName("triggerTask"))
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     self.songName = ""
     self.volume = 1.0
     self.looping = False
 def delete(self):
     self.songName = None
     self.volume = None
     self.looping = None
     DistributedEntity.delete(self)
 def disable(self):
     DistributedEntity.disable(self)
     DistributedSuit.disable(self)
 def generate(self):
     DistributedEntity.generate(self)
     DistributedSuit.generate(self)
 def delete(self):
     DistributedEntity.delete(self)
     DistributedSuit.delete(self)
 def __init__(self, cr):
     DistributedEntity.__init__(self, cr)
     DistributedSuit.__init__(self, cr)