当前位置: 首页>>代码示例>>Python>>正文


Python BattleParticles.loadParticleFile方法代码示例

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


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

示例1: createSnow

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
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,代码行数:10,代码来源:SZUtil.py

示例2: __init__

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 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,代码行数:19,代码来源:RocketExplosion.py

示例3: __init__

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 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,代码行数:12,代码来源:Sparks.py

示例4: load

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 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,代码行数:12,代码来源:BRSafeZoneLoader.py

示例5: load

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 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,代码行数:13,代码来源:BRSafeZoneLoader.py

示例6: load

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 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,代码行数:15,代码来源:BRTownLoader.py

示例7: enter

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
    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,代码行数:51,代码来源:Playground.py

示例8: getAnim

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
 def getAnim(self, anim):
     ival = None
     if anim == None:
         partName = None
         if self.happy:
             animName = 'Ff_neutral'
         else:
             animName = 'Fb_neutral'
         if self.raised:
             ival = ActorInterval(self, animName)
         else:
             ival = Parallel(ActorInterval(self, animName, partName=['torso', 'head']), ActorInterval(self, 'Fb_downNeutral', partName='legs'))
         if not self.forward:
             ival = Sequence(Func(self.reverseBody), ival, Func(self.forwardBody))
     elif anim == 'down2Up':
         ival = Parallel(SoundInterval(self.upSfx, node=self), self.getAngryActorInterval('Fb_down2Up'))
         self.raised = 1
     elif anim == 'up2Down':
         ival = Parallel(SoundInterval(self.downSfx, node=self), self.getAngryActorInterval('Fb_down2Up', playRate=-1))
         self.raised = 0
     elif anim == 'throw':
         self.doAnimate(None, raised=1, happy=0, queueNeutral=0)
         ival = Parallel(Sequence(SoundInterval(self.throwSfx, node=self), duration=0), self.getAngryActorInterval('Fb_UpThrow'))
     elif anim == 'hit':
         if self.raised:
             self.raised = 0
             ival = self.getAngryActorInterval('Fb_firstHit')
         else:
             ival = self.getAngryActorInterval('Fb_downHit')
         ival = Parallel(SoundInterval(self.reelSfx, node=self), ival)
     elif anim == 'ltSwing' or anim == 'rtSwing':
         self.doAnimate(None, raised=0, happy=0, queueNeutral=0)
         if anim == 'ltSwing':
             ival = Sequence(Track((0, self.getAngryActorInterval('Fb_downLtSwing')), (0.9, SoundInterval(self.swingSfx, node=self)), (1, Func(self.bubbleL.unstash))), Func(self.bubbleL.stash))
         else:
             ival = Sequence(Track((0, self.getAngryActorInterval('Fb_downRtSwing')), (0.9, SoundInterval(self.swingSfx, node=self)), (1, Func(self.bubbleR.unstash))), Func(self.bubbleR.stash))
     elif anim == 'frontAttack':
         self.doAnimate(None, raised=1, happy=0, queueNeutral=0)
         pe = BattleParticles.loadParticleFile('bossCogFrontAttack.ptf')
         ival = Sequence(Func(self.reverseHead), ActorInterval(self, 'Bb2Ff_spin'), Func(self.forwardHead))
         if self.forward:
             ival = Sequence(Func(self.reverseBody), ParallelEndTogether(ival, self.pelvis.hprInterval(0.5, self.pelvisForwardHpr, blendType='easeInOut')))
         ival = Sequence(Track((0, ival), (0, SoundInterval(self.spinSfx, node=self)), (0.9, Parallel(SoundInterval(self.rainGearsSfx, node=self), ParticleInterval(pe, self.frontAttack, worldRelative=0, duration=1.5, cleanup=True), duration=0)), (1.9, Func(self.bubbleF.unstash))), Func(self.bubbleF.stash))
         self.forward = 1
         self.happy = 0
         self.raised = 1
     elif anim == 'areaAttack':
         if self.twoFaced:
             self.doAnimate(None, raised=1, happy=0, queueNeutral=0)
         else:
             self.doAnimate(None, raised=1, happy=1, queueNeutral=1)
         ival = Parallel(ActorInterval(self, 'Fb_jump'), Sequence(SoundInterval(self.swishSfx, duration=1.1, node=self), SoundInterval(self.boomSfx, duration=1.9)), Sequence(Wait(1.21), Func(self.announceAreaAttack)))
         if self.twoFaced:
             self.happy = 0
         else:
             self.happy = 1
         self.raised = 1
     elif anim == 'Fb_fall':
         ival = Parallel(ActorInterval(self, 'Fb_fall'), Sequence(SoundInterval(self.reelSfx, node=self), SoundInterval(self.deathSfx)))
     elif isinstance(anim, types.StringType):
         ival = ActorInterval(self, anim)
     else:
         ival = anim
     return ival
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:66,代码来源:BossCog.py

示例9: doEffect

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
def doEffect(textId, speakingToon, nearbyToons):
    menuIndex, _ = decodeId(textId)
    itemValue = getItemValue(textId)
    if menuIndex == RESISTANCE_TOONUP:
        effect = BattleParticles.loadParticleFile('resistanceEffectSparkle.ptf')
        fadeColor = VBase4(1, 0.5, 1, 1)
    elif menuIndex == RESISTANCE_MONEY:
        effect = BattleParticles.loadParticleFile('resistanceEffectBean.ptf')
        bean = loader.loadModel('phase_4/models/props/jellybean4.bam')
        bean = bean.find('**/jellybean')
        colors = {
            'particles-1': (1, 1, 0, 1),
            'particles-2': (1, 0, 0, 1),
            'particles-3': (0, 1, 0, 1),
            'particles-4': (0, 0, 1, 1),
            'particles-5': (1, 0, 1, 1)
        }
        for name, color in colors.items():
            node = bean.copyTo(NodePath())
            node.setColorScale(*color)
            p = effect.getParticlesNamed(name)
            p.renderer.setGeomNode(node.node())
        fadeColor = VBase4(0, 1, 0, 1)
    elif menuIndex == RESISTANCE_RESTOCK:
        effect = BattleParticles.loadParticleFile('resistanceEffectSprite.ptf')
        invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
        invModel.setScale(4)
        invModel.flattenLight()
        icons = []
        if itemValue != -1:
            for item in xrange(6):
                iconName = ToontownBattleGlobals.AvPropsNew[itemValue][item]
                icons.append(invModel.find('**/%s' % iconName))
        else:
            tracks = range(7)
            random.shuffle(tracks)
            for i in xrange(6):
                track = tracks[i]
                item = random.randint(0, 5)
                iconName = ToontownBattleGlobals.AvPropsNew[track][item]
                icons.append(invModel.find('**/%s' % iconName))
        iconDict = {
            'particles-1': icons[0],
            'particles-2': icons[1],
            'particles-3': icons[2],
            'particles-4': icons[3],
            'particles-5': icons[4],
            'particles-6': icons[5]
        }
        for name, icon in iconDict.items():
            p = effect.getParticlesNamed(name)
            p.renderer.setFromNode(icon)
        fadeColor = VBase4(0, 0, 1, 1)
    elif menuIndex == RESISTANCE_DANCE:
        effect = BattleParticles.loadParticleFile('resistanceEffectSparkle.ptf')
        fadeColor = VBase4(1, 0.5, 1, 1)
        for toonId in nearbyToons:
            toon = base.cr.doId2do.get(toonId)
            if toon and (not toon.ghostMode):
                toon.setAnimState('victory')
    elif menuIndex == RESISTANCE_CHEESY:
        effect = BattleParticles.loadParticleFile('resistanceEffectSparkle.ptf')
        fadeColor = VBase4(1, 0.5, 1, 1)
    else:
        return
    recolorToons = Parallel()
    for toonId in nearbyToons:
        toon = base.cr.doId2do.get(toonId)
        if toon and (not toon.ghostMode):
            i = Sequence(
                toon.doToonColorScale(fadeColor, 0.3),
                toon.doToonColorScale(toon.defaultColorScale, 0.3),
                Func(toon.restoreDefaultColorScale)
            )
            recolorToons.append(i)
    i = Parallel(
        ParticleInterval(effect, speakingToon, worldRelative=0, duration=3, cleanup=True),
        Sequence(Wait(0.2), recolorToons),
        autoFinish=1
    )
    i.start()
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:83,代码来源:ResistanceChat.py

示例10: enter

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
    def enter(self, requestStatus, visibilityFlag = 1, arrowsOn = 1):
        teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus,))
        self._ttfToken = None
        self.fsm.enterInitialState()
        base.playMusic(self.loader.music, looping=1, volume=0.8)
        self.loader.geom.reparentTo(render)
        if visibilityFlag:
            self.visibilityOn()
        base.localAvatar.setGeom(self.loader.geom)
        base.localAvatar.setOnLevelGround(1)
        self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH)
        NametagGlobals.setMasterArrowsOn(arrowsOn)

        def __lightDecorationOn__():
            geom = base.cr.playGame.getPlace().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(1)

        newsManager = base.cr.newsManager
        if newsManager:
            holidayIds = base.cr.newsManager.getDecorationHolidayId()
            #Halloween Event
            if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds) 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))
                lightsOff.start()
            else:
                self.loader.hood.startSky()
                lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
                lightsOn.start()
            #Christmas Event
            if (ToontownGlobals.WINTER_DECORATIONS in holidayIds or ToontownGlobals.WACKY_WINTER_DECORATIONS in holidayIds) 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)
                #2 and 3 are only for the blizzard event and should be removed
                self.snowEvent2 = BattleParticles.loadParticleFile('snowdisk.ptf')
                self.snowEvent2.setPos(0, 10, 10)
                self.snowEvent3 = BattleParticles.loadParticleFile('snowdisk.ptf')
                self.snowEvent3.setPos(0, 20, 5)
                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)
                #2 and 3 are only for the blizzard event and should be removed
                self.snowEvent2.start(camera, self.snowEventRender)
                self.snowEvent3.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()
        else:
            self.loader.hood.startSky()
            lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
            lightsOn.start()
        self.accept('doorDoneEvent', self.handleDoorDoneEvent)
        self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
        
        # add street branch interest
        self.branchInterest = base.cr.addInterest(localAvatar.defaultShard, ZoneUtil.getBranchZone(requestStatus['zoneId']), "")
        
        self.enterZone(requestStatus['zoneId'])
        
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList, self.zoneId)
        self.fsm.request(requestStatus['how'], [requestStatus])
        self.replaceStreetSignTextures()
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:74,代码来源:Street.py

示例11: enter

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
    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)

        newsManager = base.cr.newsManager
        if newsManager:
            holidayIds = base.cr.newsManager.getDecorationHolidayId()
            #Halloween Event
            if (ToontownGlobals.HALLOWEEN_COSTUMES in holidayIds or ToontownGlobals.SPOOKY_COSTUMES in holidayIds) 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()
            else:
                self.loader.hood.startSky()
                lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
                lightsOn.start()
            #Christmas Event
            if (ToontownGlobals.WINTER_DECORATIONS in holidayIds or ToontownGlobals.WACKY_WINTER_DECORATIONS in holidayIds) 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)
                #2 and 3 are only for the blizzard event and should be removed
                self.snowEvent2 = BattleParticles.loadParticleFile('snowdisk.ptf')
                self.snowEvent2.setPos(0, 10, 10)
                self.snowEvent3 = BattleParticles.loadParticleFile('snowdisk.ptf')
                self.snowEvent3.setPos(0, 20, 5)
                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)
                #2 and 3 are only for the blizzard event and should be removed
                self.snowEvent2.start(camera, self.snowEventRender)
                self.snowEvent3.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()
        else:
            self.loader.hood.startSky()
            lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
            lightsOn.start()
        NametagGlobals.setWant2dNametags(True)
        self.zoneId = requestStatus['zoneId']
        self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList, self.zoneId)
        how = requestStatus['how']
        if how == 'teleportIn':
            how = 'deathAck'
        self.fsm.request(how, [requestStatus])
开发者ID:nate97,项目名称:src,代码行数:69,代码来源:Playground.py

示例12: doEffect

# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import loadParticleFile [as 别名]
def doEffect(textId, speakingToon, nearbyToons):
    (menuIndex, itemIndex) = decodeId(textId)
    itemValue = getItemValue(textId)
    if menuIndex == RESISTANCE_TOONUP:
        effect = BattleParticles.loadParticleFile("resistanceEffectSparkle.ptf")
        fadeColor = VBase4(1, 0.5, 1, 1)
    elif menuIndex == RESISTANCE_MONEY:
        effect = BattleParticles.loadParticleFile("resistanceEffectBean.ptf")
        bean = loader.loadModel("phase_4/models/props/jellybean4.bam")
        bean = bean.find("**/jellybean")
        colors = {
            "particles-1": (1, 1, 0, 1),
            "particles-2": (1, 0, 0, 1),
            "particles-3": (0, 1, 0, 1),
            "particles-4": (0, 0, 1, 1),
            "particles-5": (1, 0, 1, 1),
        }
        for (name, color) in colors.items():
            node = bean.copyTo(NodePath())
            node.setColorScale(*color)
            p = effect.getParticlesNamed(name)
            p.renderer.setGeomNode(node.node())

        fadeColor = VBase4(0, 1, 0, 1)
    elif menuIndex == RESISTANCE_RESTOCK:
        effect = BattleParticles.loadParticleFile("resistanceEffectSprite.ptf")
        invModel = loader.loadModel("phase_3.5/models/gui/inventory_icons")
        invModel.setScale(4)
        invModel.flattenLight()
        icons = []
        if itemValue != -1:
            for item in range(6):
                iconName = ToontownBattleGlobals.AvPropsNew[itemValue][item]
                icons.append(invModel.find("**/%s" % iconName))

        else:
            tracks = range(7)
            random.shuffle(tracks)
            for i in range(6):
                track = tracks[i]
                item = random.randint(0, 5)
                iconName = ToontownBattleGlobals.AvPropsNew[track][item]
                icons.append(invModel.find("**/%s" % iconName))

        iconDict = {
            "particles-1": icons[0],
            "particles-2": icons[1],
            "particles-3": icons[2],
            "particles-4": icons[3],
            "particles-5": icons[4],
            "particles-6": icons[5],
        }
        for (name, icon) in iconDict.items():
            p = effect.getParticlesNamed(name)
            p.renderer.setFromNode(icon)

        fadeColor = VBase4(0, 0, 1, 1)
    else:
        return None
    recolorToons = Parallel()
    for toonId in nearbyToons:
        toon = base.cr.doId2do.get(toonId)
        if toon and not (toon.ghostMode):
            i = Sequence(
                toon.doToonColorScale(fadeColor, 0.29999999999999999),
                toon.doToonColorScale(toon.defaultColorScale, 0.29999999999999999),
                Func(toon.restoreDefaultColorScale),
            )
            recolorToons.append(i)
            continue

    i = Parallel(
        ParticleInterval(effect, speakingToon, worldRelative=0, duration=3, cleanup=True),
        Sequence(Wait(0.20000000000000001), recolorToons),
        autoFinish=1,
    )
    i.start()
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:79,代码来源:ResistanceChat.py


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