• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python battle.BattleParticles类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中toontown.battle.BattleParticles的典型用法代码示例。如果您正苦于以下问题:Python BattleParticles类的具体用法?Python BattleParticles怎么用?Python BattleParticles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BattleParticles类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: unload

 def unload(self):
     self.unloadBattleAnims()
     globalPropPool.unloadProps()
     globalBattleSoundCache.clear()
     BattleParticles.unloadParticles()
     self.parentFSMState.removeChild(self.fsm)
     del self.parentFSMState
     del self.fsm
     del self.streetClass
     self.landmarkBlocks.removeNode()
     del self.landmarkBlocks
     self.hood.dnaStore.resetSuitPoints()
     self.hood.dnaStore.resetBattleCells()
     del self.hood
     del self.nodeDict
     del self.zoneDict
     del self.fadeInDict
     del self.fadeOutDict
     del self.nodeList
     self.geom.removeNode()
     del self.geom
     self.townBattle.unload()
     self.townBattle.cleanup()
     del self.townBattle
     del self.battleMusic
     del self.music
     del self.activityMusic
     del self.holidayPropTransforms
     self.deleteAnimatedProps()
     cleanupDialog('globalDialog')
     ModelPool.garbageCollect()
     TexturePool.garbageCollect()
开发者ID:ToontownModder101,项目名称:Toontown-Offline-Squirting-Flower-Modded-,代码行数:32,代码来源:TownLoader.py


示例2: createGoonExplosion

def createGoonExplosion(parent, explosionPoint, scale):
    BattleParticles.loadParticles()
    deathNode = NodePath('goonDeath')
    deathNode.setPos(explosionPoint)
    explosion = createExplosionTrack(parent, deathNode, scale)
    smallGearExplosion = BattleParticles.createParticleEffect(
        'GearExplosion', numParticles=10)
    bigGearExplosion = BattleParticles.createParticleEffect(
        'WideGearExplosion', numParticles=30)
    deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg')
    return Parallel(
        explosion,
        SoundInterval(deathSound),
        ParticleInterval(
            smallGearExplosion,
            deathNode,
            worldRelative=0,
            duration=4.3,
            cleanup=True),
        ParticleInterval(
            bigGearExplosion,
            deathNode,
            worldRelative=0,
            duration=1.0,
            cleanup=True),
        name='gears2MTrack')
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:26,代码来源:GoonDeath.py


示例3: __init__

 def __init__(self, serialNum, maze, randomNumGen, difficulty, startTile, cogdoSuitType, walkAnimName = None):
     data = Globals.SuitData[cogdoSuitType]
     MazeSuit.__init__(self, serialNum, maze, randomNumGen, data['cellWalkPeriod'], difficulty, data['dnaName'], startTile=startTile, walkSameDirectionProb=Globals.SuitWalkSameDirectionProb, walkTurnAroundProb=Globals.SuitWalkTurnAroundProb, uniqueRandomNumGen=False, walkAnimName=walkAnimName)
     FSM.__init__(self, 'CogdoMazeSuit')
     CogdoMazeSplattable.__init__(self, self.suit, '%s-%i' % (Globals.SuitCollisionName, self.serialNum), 1.5)
     if data.has_key('scale'):
         self.suit.setScale(data['scale'])
     self.hp = data['hp']
     self.type = cogdoSuitType
     self.memos = data['memos']
     self.deathSuit = self.suit.getLoseActor()
     self.deathSuit.pose('lose', 0)
     BattleParticles.loadParticles()
     self._initSfx()
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:14,代码来源:CogdoMazeSuits.py


示例4: __init__

 def __init__(self, model, pos, serialNum, gameId, penalty = False):
     self.serialNum = serialNum
     self.penalty = penalty
     center = model.getBounds().getCenter()
     center = Point3(0, 0, 0)
     self.nodePath = model.copyTo(render)
     self.nodePath.setPos(pos[0] - center[0], pos[1] - center[1], pos[2] - center[2])
     self.nodePath.setZ(0)
     self.notify.debug('newPos = %s' % self.nodePath.getPos())
     if self.penalty:
         self.sphereName = 'penaltySphere-%s-%s' % (gameId, self.serialNum)
     else:
         self.sphereName = 'treasureSphere-%s-%s' % (gameId, self.serialNum)
     self.collSphere = CollisionSphere(center[0], center[1], center[2], self.RADIUS)
     self.collSphere.setTangible(0)
     self.collNode = CollisionNode(self.sphereName)
     self.collNode.setIntoCollideMask(ToontownGlobals.PieBitmask)
     self.collNode.addSolid(self.collSphere)
     self.collNodePath = render.attachNewNode(self.collNode)
     self.collNodePath.setPos(pos[0] - center[0], pos[1] - center[1], pos[2] - center[2])
     self.collNodePath.hide()
     self.track = None
     if self.penalty:
         self.tip = self.nodePath.find('**/fusetip')
         sparks = BattleParticles.createParticleEffect(file = 'icetnt')
         self.sparksEffect = sparks
         sparks.start(self.tip)
         self.penaltyGrabSound = loader.loadSfx('phase_4/audio/sfx/MG_cannon_fire_alt.mp3')
         self.penaltyGrabSound.setVolume(0.75)
         kaboomAttachPoint = self.nodePath.attachNewNode('kaboomAttach')
         kaboomAttachPoint.setZ(3)
         self.kaboom = loader.loadModel('phase_4/models/minigames/ice_game_kaboom')
         self.kaboom.reparentTo(kaboomAttachPoint)
         self.kaboom.setScale(2.0)
         self.kaboom.setBillboardPointEye()
开发者ID:OldToontown,项目名称:OldToontown,代码行数:35,代码来源:IceTreasure.py


示例5: enterFinaleBrainstormAttack

    def enterFinaleBrainstormAttack(self, offset):
        if Vec3(base.localAvatar.getPos(self)).length() <= 40:
            # Currently, the cloud only forms over the local toon.
            # Preferably it would form over all toons in the area, but I'm not sure how to go about doing that.
            # That may not be good for performance either.
            braincloud = BattleProps.globalPropPool.getProp('stormcloud')
            braincloud.reparentTo(base.localAvatar)
            braincloud.setScale(0)
            braincloud.setZ(6)
            brainstorm = BattleParticles.createParticleEffect(name='BrainStorm')
            brainstorm.setDepthWrite(False)

            def __checkNearCloud(task):
                if Vec3(base.localAvatar.getPos(braincloud)).length() <= 5:
                    self.applyShakeAttack(base.localAvatar, SafezoneInvasionGlobals.FinaleSuitAttackDamage)

            self.finaleBrainstormSequence = Sequence(
                braincloud.scaleInterval(3, (3.5, 3.5, 2.5)),
                Parallel(
                    Func(base.playSfx, self.brainstormSfx),
                    Func(braincloud.wrtReparentTo, render),
                    ParticleInterval(brainstorm, braincloud, worldRelative=0, duration=4.3, cleanup=True)
                ),
                Wait(1),
                braincloud.scaleInterval(1, (0.0, 0.0, 0.0)),
            )
            taskMgr.doMethodLater(4, __checkNearCloud, 'CheckNearBraincloud')
            self.finaleBrainstormSequence.setT(offset)
            self.finaleBrainstormSequence.start()

        self.play('effort')
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:31,代码来源:DistributedInvasionSuit.py


示例6: createSnow

def createSnow(geom):
    snow = BattleParticles.loadParticleFile('snowdisk.ptf')
    snow.setPos(0, 0, 5)
    snowRender = geom.attachNewNode('snowRender')
    snowRender.setDepthWrite(0)
    snowRender.setBin('fixed', 1)

    return snow, snowRender
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:8,代码来源:SZUtil.py


示例7: __init__

 def __init__(self, parent, smokeParent):
     NodePath.__init__(self)
     notify = DirectNotifyGlobal.directNotify.newCategory('RocketExplosionParticles')
     self.effectNode = parent.attachNewNode('RocketExplosion')
     self.effectNode.setBin('fixed', 1)
     self.effectNode.setDepthWrite(1)
     self.smokeEffectNode = smokeParent.attachNewNode('RocketSmoke')
     self.smokeEffectNode.setBin('fixed', 1)
     self.smokeEffectNode.setDepthWrite(0)
     self.effect = BattleParticles.loadParticleFile('tt_p_efx_rocketLaunchFire.ptf')
     self.smokeEffect = BattleParticles.loadParticleFile('tt_p_efx_rocketLaunchSmoke.ptf')
     ren = self.effect.getParticlesNamed('particles-1').getRenderer()
     ren.setTextureFromNode('phase_4/models/props/tt_m_efx_fireball', '**/*')
     ren = self.smokeEffect.getParticlesNamed('particles-1').getRenderer()
     ren.setTextureFromNode('phase_4/models/props/tt_m_efx_smoke', '**/*')
     self.endSeq = None
     self.cleanupCompleted = 0
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:17,代码来源:RocketExplosion.py


示例8: setHillType

 def setHillType(self, type):
     if self.isUp:
         if (self.hillType == MoleFieldBase.HILL_MOLE or type == MoleFieldBase.HILL_BOMB or self.hillType == MoleFieldBase.HILL_BOMB) and type == MoleFieldBase.HILL_MOLE:
             return None
         
     self.hillType = type
     self.moleHead.remove()
     if type == MoleFieldBase.HILL_MOLE:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_norm')
         self.moleColNodePath.setScale(3.0)
         self.moleHead.setH(0)
         self.mole.setBillboardAxis(localAvatar, 0)
     
     if type == MoleFieldBase.HILL_BOMB or type == MoleFieldBase.HILL_COGWHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_cog')
         self.moleColNodePath.setScale(1.0)
         self.mole.setBillboardAxis(localAvatar, 0)
         if type == MoleFieldBase.HILL_COGWHACKED:
             self.doMoleDown()
             BattleParticles.loadParticles()
             singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles = 1)
             smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles = 10)
             bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles = 30)
             gears2MTrack = Track((0.0, ParticleInterval(singleGear, self.hill, worldRelative = 1, duration = 5.7000000000000002, cleanup = True)), (0.0, ParticleInterval(smallGearExplosion, self.hill, worldRelative = 0, duration = 1.2, cleanup = True)), (0.29999999999999999, ParticleInterval(bigGearExplosion, self.hill, worldRelative = 0, duration = 1.0, cleanup = True)), name = 'gears2MTrack')
             gears2MTrack.start()
             self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.23000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.28000000000000003)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.34999999999999998, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28000000000000003, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.31, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.32000000000000001, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.47999999999999998)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.28000000000000003, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.28999999999999998, 0.0)))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_BOMB))
             self.popIval.start()
         else:
             self.moleHead.setH(0)
     
     if type == MoleFieldBase.HILL_WHACKED:
         self.moleHead = loader.loadModel('phase_12/models/bossbotHQ/mole_hit')
         self.mole.setBillboardAxis(0)
         self.moleColNodePath.setScale(0.0)
         if self.popIval:
             self.popIval.finish()
         
         if self.downIval:
             self.downIval.finish()
         
         self.mole.setPos(0.0, 0.0, 0.0)
         self.popIval = Sequence(Parallel(Sequence(LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.14999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.12, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.13, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.14999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17999999999999999)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.16, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.11, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, -0.17999999999999999, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.17000000000000001)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(-0.17999999999999999, 0.0, 0.0)), LerpPosInterval(self.moleHead, 0.050000000000000003, Point3(0.0, 0.0, 0.0))), Sequence(LerpScaleInterval(self.moleHead, 0.5, 3.5), LerpScaleInterval(self.moleHead, 0.5, 1.0))), LerpPosInterval(self.mole, 0.5, Point3(0, 0, -2.5)), Func(self.setHillType, MoleFieldBase.HILL_MOLE))
         self.popIval.start()
     
     self.moleHead.reparentTo(self.mole)
开发者ID:OldToontown,项目名称:OldToontown,代码行数:45,代码来源:MoleHill.py


示例9: destroy

 def destroy(self):
     if self.isDestroyed:
         return None
     
     self.isDestroyed = True
     if hasattr(self.suit, 'prop') and self.suit.prop:
         self.suit.prop.stash()
     
     if self.propTrack:
         self.propTrack.finish()
         self.propTrack = None
     
     if self.suitSound:
         self.suitSound.stop()
         del self.suitSound
     
     if self.animTrack:
         self.animTrack.finish()
         self.animTrack = None
     
     if self.shotTrack != None:
         self.shotTrack.finish()
         self.shotTrack = None
     
     if self.deathTrack != None:
         self.deathTrack.finish()
         self.deathTrack = None
     
     if self.deathSuit:
         self.deathSuit.detachNode()
         self.suit.cleanupLoseActor()
         self.deathSuit = None
     
     if self.moveIval:
         self.moveIval.pause()
         del self.moveIval
     
     if self.suit:
         self.suit.delete()
         self.suit = None
     
     BattleParticles.unloadParticles()
     self.ignore(self.game.uniqueName('enter' + self.suitName))
     self.game = None
     self.enemyMgr = None
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:45,代码来源:TwoDEnemy.py


示例10: load

 def load(self):
     SafeZoneLoader.SafeZoneLoader.load(self)
     self.windSound = map(base.loader.loadSfx, ['phase_8/audio/sfx/SZ_TB_wind_1.ogg',
                                         'phase_8/audio/sfx/SZ_TB_wind_2.ogg',
                                         'phase_8/audio/sfx/SZ_TB_wind_3.ogg'])
     self.snow = BattleParticles.loadParticleFile('snowdisk.ptf')
     self.snow.setPos(0, 0, 5)
     self.snowRender = self.geom.attachNewNode('snowRender')
     self.snowRender.setDepthWrite(0)
     self.snowRender.setBin('fixed', 1)
开发者ID:nate97,项目名称:src,代码行数:10,代码来源:BRSafeZoneLoader.py


示例11: __init__

 def __init__(self, parent, renderParent):
     NodePath.__init__(self)
     notify = DirectNotifyGlobal.directNotify.newCategory('SparkParticles')
     self.renderParent = renderParent.attachNewNode('sparkRenderParent')
     self.renderParent.setBin('fixed', 0)
     self.renderParent.setDepthWrite(0)
     self.assign(parent.attachNewNode('sparks'))
     self.effect = BattleParticles.loadParticleFile('sparks.ptf')
     ren = self.effect.getParticlesNamed('particles-1').getRenderer()
     ren.setTextureFromNode('phase_6/models/karting/particleSpark', '**/*')
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:10,代码来源:Sparks.py


示例12: __init__

 def __init__(self, enemyMgr, index, suitAttribs):
     self.enemyMgr = enemyMgr
     self.game = self.enemyMgr.section.sectionMgr.game
     self.index = index
     self.moveIval = None
     self.propTrack = None
     self.animTrack = None
     self.shotTrack = None
     self.deathTrack = None
     self.deathSuit = None
     self.suitSound = None
     self.deleteMeCallback = None
     self.isMovingUpDown = False
     self.isMovingLeftRight = False
     self.showCollSpheres = False
     self.isDestroyed = False
     self.isGoingUp = False
     self.setupEnemy(suitAttribs)
     BattleParticles.loadParticles()
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:19,代码来源:TwoDEnemy.py


示例13: unload

 def unload(self):
     self.unloadBattleAnims()
     globalPropPool.unloadProps()
     globalBattleSoundCache.clear()
     BattleParticles.unloadParticles()
     self.parentFSMState.removeChild(self.fsm)
     del self.parentFSMState
     del self.fsm
     del self.streetClass
     self.landmarkBlocks.removeNode()
     del self.landmarkBlocks
     self.hood.dnaStore.resetSuitPoints()
     self.hood.dnaStore.resetBattleCells()
     del self.hood
     del self.nodeDict
     del self.zoneDict
     del self.nodeToZone
     del self.fadeInDict
     del self.fadeOutDict
     del self.nodeList
     self.geom.removeNode()
     del self.geom
     self.townBattle.unload()
     self.townBattle.cleanup()
     del self.townBattle
     del self.battleMusic
     del self.music
     del self.activityMusic
     del self.holidayPropTransforms
     self.deleteAnimatedProps()
     cleanupDialog('globalDialog')
     ModelPool.garbageCollect()
     TexturePool.garbageCollect()
     if base.config.GetBool('want-april-toons', 0):
         self.pianoDropSequence.finish()
         self.pianoDropSound.finish()
         del self.pianoDropSequence
         del self.pianoDropSound
         self.piano.removeNode()
         del self.pianoSfx
         del self.dropSfx
         del self.npc
开发者ID:gamerdave54321,项目名称:Toontown-House-Code,代码行数:42,代码来源:TownLoader.py


示例14: load

 def load(self):
     SafeZoneLoader.SafeZoneLoader.load(self)
     self.wind1Sound = base.loadSfx('phase_8/audio/sfx/SZ_TB_wind_1.mp3')
     self.wind2Sound = base.loadSfx('phase_8/audio/sfx/SZ_TB_wind_2.mp3')
     self.wind3Sound = base.loadSfx('phase_8/audio/sfx/SZ_TB_wind_3.mp3')
     self.snow = BattleParticles.loadParticleFile('snowdisk.ptf')
     self.snow.setPos(0, 0, 5)
     self.snowRender = self.geom.attachNewNode('snowRender')
     self.snowRender.setDepthWrite(0)
     self.snowRender.setBin('fixed', 1)
     self.snowFade = None
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:11,代码来源:BRSafeZoneLoader.py


示例15: doDeathTrack

    def doDeathTrack(self):

        def removeDeathSuit(suit, deathSuit):
            if not deathSuit.isEmpty():
                deathSuit.detachNode()
                suit.cleanupLoseActor()

        self.deathSuit.reparentTo(self.suit.getParent())
        self.deathSuit.setScale(self.suit.getScale())
        self.deathSuit.setPos(render, self.suit.getPos(render))
        self.deathSuit.setHpr(render, self.suit.getHpr(render))
        self.suit.hide()
        self.collNodePath.reparentTo(self.deathSuit)
        gearPoint = Point3(0, 0, self.suit.height / 2.0 + 2.0)
        smallGears = BattleParticles.createParticleEffect(file='gearExplosionSmall')
        singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles=1)
        smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles=10)
        bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles=30)
        smallGears.setPos(gearPoint)
        singleGear.setPos(gearPoint)
        smallGearExplosion.setPos(gearPoint)
        bigGearExplosion.setPos(gearPoint)
        smallGears.setDepthWrite(False)
        singleGear.setDepthWrite(False)
        smallGearExplosion.setDepthWrite(False)
        bigGearExplosion.setDepthWrite(False)
        suitTrack = Sequence(Func(self.collNodePath.stash), ActorInterval(self.deathSuit, 'lose', startFrame=80, endFrame=140), Func(removeDeathSuit, self.suit, self.deathSuit, name='remove-death-suit'))
        explosionTrack = Sequence(Wait(1.5), MovieUtil.createKapowExplosionTrack(self.deathSuit, explosionPoint=gearPoint))
        gears1Track = Sequence(ParticleInterval(smallGears, self.deathSuit, worldRelative=0, duration=4.3, cleanup=True), name='gears1Track')
        gears2MTrack = Track((0.0, explosionTrack), (0.7, ParticleInterval(singleGear, self.deathSuit, worldRelative=0, duration=5.7, cleanup=True)), (5.2, ParticleInterval(smallGearExplosion, self.deathSuit, worldRelative=0, duration=1.2, cleanup=True)), (5.4, ParticleInterval(bigGearExplosion, self.deathSuit, worldRelative=0, duration=1.0, cleanup=True)), name='gears2MTrack')

        def removeParticle(particle):
            if particle and hasattr(particle, 'renderParent'):
                particle.cleanup()
                del particle

        removeParticles = Sequence(Func(removeParticle, smallGears), Func(removeParticle, singleGear), Func(removeParticle, smallGearExplosion), Func(removeParticle, bigGearExplosion))
        self.deathTrack = Sequence(Parallel(suitTrack, gears2MTrack, gears1Track, self._deathSoundIval), removeParticles)
        self.deathTrack.start()
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:39,代码来源:CogdoMazeSuits.py


示例16: load

 def load(self, zoneId):
     TownLoader.TownLoader.load(self, zoneId)
     Suit.loadSuits(3)
     dnaFile = 'phase_8/dna/the_burrrgh_' + str(self.canonicalBranchZone) + '.pdna'
     self.createHood(dnaFile)
     self.windSound = map(base.loadSfx, ['phase_8/audio/sfx/SZ_TB_wind_1.ogg',
                                         'phase_8/audio/sfx/SZ_TB_wind_2.ogg',
                                         'phase_8/audio/sfx/SZ_TB_wind_3.ogg'])
     self.snow = BattleParticles.loadParticleFile('snowdisk.ptf')
     self.snow.setPos(0, 0, 5)
     self.snowRender = self.geom.attachNewNode('snowRender')
     self.snowRender.setDepthWrite(0)
     self.snowRender.setBin('fixed', 1)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:13,代码来源:BRTownLoader.py


示例17: enter

    def enter(self, requestStatus):
        self.fsm.enterInitialState()
        messenger.send('enterPlayground')
        self.accept('doorDoneEvent', self.handleDoorDoneEvent)
        self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
        base.playMusic(self.loader.music, looping=1, volume=0.8)
        self.loader.geom.reparentTo(render)

        for i in self.loader.nodeList:
            self.loader.enterAnimatedProps(i)

        self._telemLimiter = TLGatherAllAvs('Playground', RotationLimitToH)

        def __lightDecorationOn__():
            geom = base.cr.playGame.hood.loader.geom
            self.loader.hood.eventLights = geom.findAllMatches('**/*light*')
            self.loader.hood.eventLights += geom.findAllMatches('**/*lamp*')
            self.loader.hood.eventLights += geom.findAllMatches('**/prop_snow_tree*')
            self.loader.hood.eventLights += geom.findAllMatches('**/prop_tree*')
            self.loader.hood.eventLights += geom.findAllMatches('**/*christmas*')

            for light in self.loader.hood.eventLights:
                light.setColorScaleOff(0)

        if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile:
            lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky), Func(__lightDecorationOn__))
            lightsOff.start()
        elif base.cr.newsManager.isHolidayRunning(ToontownGlobals.CHRISTMAS) and self.loader.hood.snowySkyFile:
            lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.7, 0.7, 0.8, 1)), Func(self.loader.hood.startSnowySky), Func(__lightDecorationOn__))
            lightsOff.start()
            self.snowEvent = BattleParticles.loadParticleFile('snowdisk.ptf')
            self.snowEvent.setPos(0, 30, 10)
            self.snowEventRender = base.cr.playGame.hood.loader.geom.attachNewNode('snowRender')
            self.snowEventRender.setDepthWrite(2)
            self.snowEventRender.setBin('fixed', 1)
            self.snowEventFade = None
            self.snowEvent.start(camera, self.snowEventRender)
        else:
            self.loader.hood.startSky()
            lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
            lightsOn.start()

        NametagGlobals.setMasterArrowsOn(1)
        self.zoneId = requestStatus['zoneId']
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
        how = requestStatus['how']
        if how == 'teleportIn':
            how = 'deathAck'
        self.fsm.request(how, [requestStatus])
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:49,代码来源:Playground.py


示例18: makeSynergyTrack

    def makeSynergyTrack(self):
        particleEffect = BattleParticles.createParticleEffect('Synergy')
        waterfallEffect = BattleParticles.createParticleEffect(file='synergyWaterfall')
        soundTrack = Sequence(
            Wait(0.9),
            SoundInterval(self.synergySfx, node=self.virtualSuit)
        )
        track = Sequence(
            Parallel(
                ActorInterval(self.virtualSuit, 'magic3'),
                Track(
                    (0.0, Func(self.sayFaceoffTaunt)),
                    (0.1, ParticleInterval(waterfallEffect, self.virtualSuit, worldRelative=0, duration=1.9, cleanup=True)),
                    (0.2, ParticleInterval(particleEffect, self.virtualSuit, worldRelative=0, duration=1.9, cleanup=True)),
                    (0.5, Func(self.synergyColl.unstash)),
                ),
                soundTrack
            ),
            Func(self.synergyColl.stash),
            Func(self.virtualSuit.setHpr, 0, 0, 0),
            Func(self.virtualSuit.loop, 'walk', 0),
        )

        return track
开发者ID:NostalgicTTR,项目名称:Toontown-Infinite-2016-Leak,代码行数:24,代码来源:DistributedVirtualGoon.py


示例19: createExplosionTrack

    def createExplosionTrack(self):
        if self.explodeTrack and self.explodeTrack.isPlaying():
            self.explodeTrack.finish()
        # Our real actor is going to head back and get ready for the next time he is needed,
        # so we need to spawn a "LoseActor" in his place.
        loseActor = self.suit.getLoseActor()
        loseActor.reparentTo(render)
        spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.ogg')
        deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg')

        # Now for our main interval and soundtrack
        explosionInterval = ActorInterval(loseActor, 'lose', startFrame=0, endFrame=150)
        deathSoundTrack = Sequence(Wait(0.6), SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2, node=loseActor), SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8, node=loseActor), SoundInterval(deathSound, volume=0.32, node=loseActor))

        # Next, load the particle effects
        BattleParticles.loadParticles()
        smallGears = BattleParticles.createParticleEffect(file='gearExplosionSmall')
        singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles=1)
        smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles=10)
        bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles=30)
        gearPoint = Point3(loseActor.getX(), loseActor.getY(), loseActor.getZ())
        smallGears.setDepthWrite(False)
        singleGear.setDepthWrite(False)
        smallGearExplosion.setDepthWrite(False)
        bigGearExplosion.setDepthWrite(False)
        cleanupTrack = Track((6.5, Func(self.suit.cleanupLoseActor)))

        # Now for the big KAPOW
        def createKapowExplosionTrack(parent):
            explosionTrack = Sequence()
            explosion = loader.loadModel('phase_3.5/models/props/explosion')
            explosion.setBillboardPointEye()
            explosion.setDepthWrite(False)
            explosionPoint = Point3(0, 0, 4.1)
            explosionTrack.append(Func(explosion.reparentTo, parent))
            explosionTrack.append(Func(explosion.setPos, explosionPoint))
            explosionTrack.append(Func(explosion.setScale, 0.4))
            explosionTrack.append(Wait(0.6))
            explosionTrack.append(Func(explosion.removeNode))
            return explosionTrack
        explosionTrack = Sequence()
        explosionTrack.append(Wait(5.4))
        explosionTrack.append(createKapowExplosionTrack(loseActor))

        gears1Track = Sequence(Wait(2.0), ParticleInterval(smallGears, loseActor, worldRelative=0, duration=4.3, cleanup=True), name='gears1Track')
        gears2MTrack = Track((0.0, explosionTrack), (0.7, ParticleInterval(singleGear, loseActor, worldRelative=0, duration=5.7, cleanup=True)), (5.2, ParticleInterval(smallGearExplosion, loseActor, worldRelative=0, duration=1.2, cleanup=True)), (5.4, ParticleInterval(bigGearExplosion, loseActor, worldRelative=0, duration=1.0, cleanup=True)), name='gears2MTrack')

        # Let's tie it all together.
        self.explodeTrack = Sequence(Parallel(explosionInterval, deathSoundTrack, gears1Track, gears2MTrack, cleanupTrack))
        self.explodeTrack.start()
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:50,代码来源:CogThief.py


示例20: enterExplode

    def enterExplode(self, time):
        # Are we exploding?
        self.exploding = True

        # Lets create a specific actor for the explosion and load the explosion stuff
        loseActor = self.getLoseActor()
        loseActor.reparentTo(render)
        spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.ogg')
        deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg')

        # We're done with this guy
        self.stash()

        # Oh boy, time to load all of our explosion effects!
        explosionInterval = ActorInterval(loseActor, 'lose', startFrame=0, endFrame=150)
        deathSoundTrack = Sequence(Wait(0.6), SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2, node=loseActor), SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8, node=loseActor), SoundInterval(deathSound, volume=0.32, node=loseActor))
        
        # Load the particles for the explosion
        BattleParticles.loadParticles()
        smallGears = BattleParticles.createParticleEffect(file='gearExplosionSmall')
        singleGear = BattleParticles.createParticleEffect('GearExplosion', numParticles=1)
        smallGearExplosion = BattleParticles.createParticleEffect('GearExplosion', numParticles=10)
        bigGearExplosion = BattleParticles.createParticleEffect('BigGearExplosion', numParticles=30)
        gearPoint = Point3(loseActor.getX(), loseActor.getY(), loseActor.getZ())
        smallGears.setDepthWrite(False)
        singleGear.setDepthWrite(False)
        smallGearExplosion.setDepthWrite(False)
        bigGearExplosion.setDepthWrite(False)

        # Create the explosion track
        explosionTrack = Sequence()
        explosionTrack.append(Wait(5.4))
        explosionTrack.append(self.createKapowExplosionTrack(loseActor))

        gears1Track = Sequence(Wait(2.0), ParticleInterval(smallGears, loseActor, worldRelative=0, duration=4.3, cleanup=True), name='gears1Track')
        gears2MTrack = Track((0.0, explosionTrack), (0.7, ParticleInterval(singleGear, loseActor, worldRelative=0, duration=5.7, cleanup=True)), (5.2, ParticleInterval(smallGearExplosion, loseActor, worldRelative=0, duration=1.2, cleanup=True)), (5.4, ParticleInterval(bigGearExplosion, loseActor, worldRelative=0, duration=1.0, cleanup=True)), name='gears2MTrack')
        
        # Cleanup
        
        cleanupTrack = Track((6.5, Func(self.cleanupLoseActor))) # Better delete the poor guy when we're done

        # Blow the sucker up
        self.explodeTrack = Sequence(Parallel(explosionInterval, deathSoundTrack, gears1Track, gears2MTrack))
        self.explodeTrack.delayDelete = DelayDelete(self, 'cleanupExplode')
        self.explodeTrack.append(Func(self.explodeTrack.delayDelete.destroy))
        self.explodeTrack.start()
        self.explodeTrack.setT(time)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:47,代码来源:DistributedInvasionSuit.py



注:本文中的toontown.battle.BattleParticles类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python battle.SuitBattleGlobals类代码示例发布时间:2022-05-27
下一篇:
Python battle.BattleExperienceAI类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap