def announceGenerate(self): DistributedEntity.announceGenerate(self) self.barrelRoot = self.attachNewNode('barrelRoot') barrel = self.getModelNP() barrel.setScale(self.barrelScale) barrel.reparentTo(self.barrelRoot) barrel.setHpr(180, 0, 0) lblBg = barrel.find('**/gagLabelDCS') lblBg.setColor(0.15, 0.15, 0.1) self.gagNode = barrel.attachNewNode('gagNode') self.gagNode.setPosHpr(0.0, -2.62, 4.0, 0, 0, 0) self.gagNode.setColorScale(0.7, 0.7, 0.6, 1) self.gagModel = loader.loadModel('phase_4/models/props/icecream.bam') self.gagModel.reparentTo(self.gagNode) self.gagModel.find('**/p1_2').clearBillboard() self.gagModel.setScale(0.6) self.gagModel.setPos(0, -0.1, -0.1 - 0.6) self.addSound( 'empty', 'phase_4/audio/sfx/MG_sfx_travel_game_square_no_vote_1.ogg') self.addSound('giveLaff', 'phase_4/audio/sfx/SZ_DD_treasure.ogg') self.addSound('start', 'phase_4/audio/sfx/MG_pairing_match.ogg') UseableObject.load(self)
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.elev = Elevator( base.bspLoader.getEntityValueInt(self.entnum, "type")) self.elev.elevatorMdl.setPos(self.cEntity.getOrigin()) self.elev.elevatorMdl.setHpr(self.cEntity.getAngles()) DistributedElevator.announceGenerate(self)
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.getModelNP().find("**/shaft").setSy(self.height / 16.0) self.optimizeModel() self.enableModelCollisions() if self.scale.length() >= 5: self.addSound("stomp", self.BigStompSoundPath) else: self.addSound("stomp", self.SmallStompSoundPath) self.addSound("raise", self.RaiseSoundPath)
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.addSound("press", "sound/buttons/blip1.wav") self.addSound("denied", "sound/buttons/button2.wav") self.addSound("access", "sound/buttons/button3.wav") PhysicsUtils.makeBulletCollFromPandaColl(self.getModelNP()) for np in self.getModelNP().findAllMatches("**/trigger_*"): btn = KeypadButton(self, np) self.buttons.append(btn) self.setEffect(LightingOriginEffect.make((0, 0.1, 0)))
def announceGenerate(self): DistributedEntity.announceGenerate(self) DistributedNode.announceGenerate(self) self.build() # Build collisions self.collSphere = BulletCylinderShape(self.radius, self.height, ZUp) self.collNode = BulletRigidBodyNode(self.uniqueName('barrelSphere')) self.collNode.setKinematic(True) self.collNode.addShape(self.collSphere, TransformState.makePos(Point3(0, 0, self.height / 2))) self.collNode.setIntoCollideMask(WallGroup) self.collNodePath = self.attachNewNode(self.collNode) base.physicsWorld.attach(self.collNodePath.node()) self.accept('enter' + self.collNodePath.getName(), self.__handleCollision) self.reparentTo(render)
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.addSound("pickup", "sound/items/jellybean_pickup.ogg") import random color = random.choice(self.Colors) self.getModelNP().setColorScale(color, 1) from direct.interval.IntervalGlobal import LerpHprInterval self.rot = LerpHprInterval(self.getModelNP(), 1.0, (360, 0, 0), (0, 0, 0)) self.rot.loop() from src.coginvasion.globals import CIGlobals from panda3d.bullet import BulletSphereShape, BulletGhostNode sph = BulletSphereShape(0.5) body = BulletGhostNode(self.uniqueName('jellybean-trigger')) body.addShape(sph) body.setIntoCollideMask(CIGlobals.EventGroup) self.setupPhysics(body, True) self.acceptOnce('enter' + self.uniqueName('jellybean-trigger'), self.__enterJellybeanTrigger)
def announceGenerate(self): DistributedEntity.announceGenerate(self) cm = CardMaker('emblemCard') cm.setFrame(-0.5, 0.5, 0, 1) cm.setHasUvs(True) cm.setUvRange((0, 0), (1, 1)) self.emblem = self.attachNewNode(cm.generate()) self.emblem.setAttrib(BloomAttrib.make(False)) self.emblem.setBSPMaterial('phase_5/maps/quest_scroll_emblem.mat', 1) self.emblem.setBillboardAxis() self.emblem.setTransparency(True) self.emblem.setScale(2) self.emblemFloat = Sequence( LerpPosInterval(self.emblem, 1.0, (0, 0, 0.5), (0, 0, 0), blendType='easeInOut'), LerpPosInterval(self.emblem, 1.0, (0, 0, 0), (0, 0, 0.5), blendType='easeInOut')) self.emblemFloat.loop() self.setupPhysics() self.reparentTo(render)
def announceGenerate(self): DistributedEntity.announceGenerate(self) if self.soundHasWildcard(): from panda3d.core import VirtualFileSystem, Filename fsnd = Filename.fromOsSpecific(self.sndFile) vfs = VirtualFileSystem.getGlobalPtr() flist = vfs.scanDirectory(fsnd.getDirname()) soundFiles = [] for f in flist.getFiles(): if fnmatch.fnmatch(f.getFilename().getBasename(), fsnd.getBasename()): soundFiles.append(f.getFilename()) self.numWildcardSounds = len(soundFiles) for i in range(self.numWildcardSounds): soundfname = soundFiles[i] self.addSound("sound{0}".format(i), soundfname.getFullpath(), not self.hasSpawnFlags(self.SF_PlayEverywhere)) else: self.addSound("sound", self.sndFile, not self.hasSpawnFlags(self.SF_PlayEverywhere)) # Now that we have the sounds, reset the state in case we are currently playing self.setEntityState(self.entState)
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.startSmooth()
def announceGenerate(self): DistributedEntity.announceGenerate(self) self.reparentTo(render) self.accept("enter" + self.collNode.getName(), self.__handleTouchSphere)
def announceGenerate(self): DistributedEntity.announceGenerate(self) UseableObject.load(self, self.uniqueName('gagPickup')) self.reparentTo(render) self.accept("enter" + self.bodyNP.getName(), self.__handleTouch)
def announceGenerate(self): DistributedEntity.announceGenerate(self) AvatarShared.announceGenerate(self) self.setPythonTag('avatar', self.doId) self.setParent(CIGlobals.SPHidden) self.loadAvatar()