本文整理汇总了Python中BattleParticles.createParticleEffect方法的典型用法代码示例。如果您正苦于以下问题:Python BattleParticles.createParticleEffect方法的具体用法?Python BattleParticles.createParticleEffect怎么用?Python BattleParticles.createParticleEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BattleParticles
的用法示例。
在下文中一共展示了BattleParticles.createParticleEffect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __doSprinkle
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __doSprinkle(attack, recipients, hp = 0):
toon = NPCToons.createLocalNPC(attack['npcId'])
if toon == None:
return
targets = attack[recipients]
level = 4
battle = attack['battle']
track = Sequence(teleportIn(attack, toon))
def face90(target, toon, battle):
vec = Point3(target.getPos(battle) - toon.getPos(battle))
vec.setZ(0)
temp = vec[0]
vec.setX(-vec[1])
vec.setY(temp)
targetPoint = Point3(toon.getPos(battle) + vec)
toon.headsUp(battle, targetPoint)
delay = 2.5
effectTrack = Sequence()
for target in targets:
sprayEffect = BattleParticles.createParticleEffect(file='pixieSpray')
dropEffect = BattleParticles.createParticleEffect(file='pixieDrop')
explodeEffect = BattleParticles.createParticleEffect(file='pixieExplode')
poofEffect = BattleParticles.createParticleEffect(file='pixiePoof')
wallEffect = BattleParticles.createParticleEffect(file='pixieWall')
mtrack = Parallel(__getPartTrack(sprayEffect, 1.5, 0.5, [sprayEffect, toon, 0]), __getPartTrack(dropEffect, 1.9, 2.0, [dropEffect, target, 0]), __getPartTrack(explodeEffect, 2.7, 1.0, [explodeEffect, toon, 0]), __getPartTrack(poofEffect, 3.4, 1.0, [poofEffect, target, 0]), __getPartTrack(wallEffect, 4.05, 1.2, [wallEffect, toon, 0]), __getSoundTrack(level, 2, duration=3.1, node=toon), Sequence(Func(face90, target, toon, battle), ActorInterval(toon, 'sprinkle-dust')), Sequence(Wait(delay), Func(__healToon, target, hp)))
effectTrack.append(mtrack)
track.append(effectTrack)
track.append(Func(toon.setHpr, Vec3(180.0, 0.0, 0.0)))
track.append(teleportOut(attack, toon))
return track
示例2: midairSuitExplodeTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def midairSuitExplodeTrack(suit, battle):
suitTrack = Sequence()
suitPos, suitHpr = battle.getActorPosHpr(suit)
suitPos.setZ(suitPos.getZ() + 17)
suitTrack.append(Wait(0.15))
suitTrack.append(Func(MovieUtil.avatarHide, suit))
deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg')
deathSoundTrack = Sequence(Wait(0.5), SoundInterval(deathSound, volume=0.8))
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(suitPos.getX(), suitPos.getY(), suitPos.getZ() + suit.height - 0.2)
smallGears.setPos(gearPoint)
singleGear.setPos(gearPoint)
smallGears.setDepthWrite(False)
singleGear.setDepthWrite(False)
smallGearExplosion.setPos(gearPoint)
bigGearExplosion.setPos(gearPoint)
smallGearExplosion.setDepthWrite(False)
bigGearExplosion.setDepthWrite(False)
explosionTrack = Sequence()
explosionTrack.append(MovieUtil.createKapowExplosionTrack(battle, explosionPoint=gearPoint))
gears1Track = Sequence(Wait(0.5), ParticleInterval(smallGears, battle, worldRelative=0, duration=1.0, cleanup=True), name='gears1Track')
gears2MTrack = Track(
(0.1, ParticleInterval(singleGear, battle, worldRelative=0, duration=0.4, cleanup=True)),
(0.5, ParticleInterval(smallGearExplosion, battle, worldRelative=0, duration=0.5, cleanup=True)),
(0.9, ParticleInterval(bigGearExplosion, battle, worldRelative=0, duration=2.0, cleanup=True)), name='gears2MTrack'
)
return Parallel(suitTrack, explosionTrack, deathSoundTrack, gears1Track, gears2MTrack, Wait(4.5))
示例3: __healSprinkle
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __healSprinkle(heal, hasInteractivePropHealBonus):
toon = heal['toon']
target = heal['target']['toon']
hp = heal['target']['hp']
ineffective = heal['sidestep']
level = heal['level']
track = Sequence(__runToHealSpot(heal))
sprayEffect = BattleParticles.createParticleEffect(file='pixieSpray')
dropEffect = BattleParticles.createParticleEffect(file='pixieDrop')
explodeEffect = BattleParticles.createParticleEffect(file='pixieExplode')
poofEffect = BattleParticles.createParticleEffect(file='pixiePoof')
wallEffect = BattleParticles.createParticleEffect(file='pixieWall')
def face90(toon = toon, target = target):
vec = Point3(target.getPos() - toon.getPos())
vec.setZ(0)
temp = vec[0]
vec.setX(-vec[1])
vec.setY(temp)
targetPoint = Point3(toon.getPos() + vec)
toon.headsUp(render, targetPoint)
delay = 2.5
mtrack = Parallel(__getPartTrack(sprayEffect, 1.5, 0.5, [sprayEffect, toon, 0]), __getPartTrack(dropEffect, 1.9, 2.0, [dropEffect, target, 0]), __getPartTrack(explodeEffect, 2.7, 1.0, [explodeEffect, toon, 0]), __getPartTrack(poofEffect, 3.4, 1.0, [poofEffect, target, 0]), __getPartTrack(wallEffect, 4.05, 1.2, [wallEffect, toon, 0]), __getSoundTrack(level, 2, duration=4.1, node=toon), Sequence(Func(face90), ActorInterval(toon, 'sprinkle-dust')), Sequence(Wait(delay), Func(__healToon, target, hp, ineffective, hasInteractivePropHealBonus)))
track.append(mtrack)
track.append(__returnToBase(heal))
track.append(Func(target.clearChat))
return track
示例4: __healSprinkle
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __healSprinkle(heal):
toon = heal['toon']
target = heal['target']['toon']
hp = heal['target']['hp']
ineffective = heal['sidestep']
level = heal['level']
ivals = __runToHealSpot(heal)
sprayEffect = BattleParticles.createParticleEffect(file = 'pixieSpray')
dropEffect = BattleParticles.createParticleEffect(file = 'pixieDrop')
explodeEffect = BattleParticles.createParticleEffect(file = 'pixieExplode')
poofEffect = BattleParticles.createParticleEffect(file = 'pixiePoof')
wallEffect = BattleParticles.createParticleEffect(file = 'pixieWall')
def face90(toon = toon, target = target):
vec = Point3(target.getPos() - toon.getPos())
vec.setZ(0)
temp = vec[0]
vec.setX(-vec[1])
vec.setY(temp)
targetPoint = Point3(toon.getPos() + vec)
toon.headsUp(render, targetPoint)
delay = 2.5
mtrack = MultiTrack([
__getPartTrack(sprayEffect, 1.5, 0.5, [
sprayEffect,
toon,
0]),
__getPartTrack(dropEffect, 1.8999999999999999, 2.0, [
dropEffect,
target,
0]),
__getPartTrack(explodeEffect, 2.7000000000000002, 1.0, [
explodeEffect,
toon,
0]),
__getPartTrack(poofEffect, 3.3999999999999999, 1.0, [
poofEffect,
target,
0]),
__getPartTrack(wallEffect, 4.0499999999999998, 1.2, [
wallEffect,
toon,
0]),
__getSoundTrack(level, 2, duration = 4.0999999999999996, node = toon),
Track([
FunctionInterval(face90),
ActorInterval(toon, 'sprinkle-dust')]),
Track([
(delay, FunctionInterval(__healToon, extraArgs = [
target,
hp,
ineffective]))])])
ivals.append(mtrack)
ivals += __returnToBase(heal)
ivals.append(FunctionInterval(target.clearChat))
return Track(ivals)
示例5: __createToonInterval
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __createToonInterval(sound, delay, toon, operaInstrument = None):
isNPC = 0
if sound.get('npc'):
isNPC = 1
battle = sound['battle']
hasLuredSuits = __hasLuredSuits(sound)
if not isNPC:
oldPos, oldHpr = battle.getActorPosHpr(toon)
newPos = Point3(oldPos)
newPos.setY(newPos.getY() - DISTANCE_TO_WALK_BACK)
retval = Sequence(Wait(delay))
if DISTANCE_TO_WALK_BACK and hasLuredSuits and not isNPC:
retval.append(Parallel(ActorInterval(toon, 'walk', startTime=1, duration=TIME_TO_WALK_BACK, endTime=0.0001), LerpPosInterval(toon, TIME_TO_WALK_BACK, newPos, other=battle)))
if operaInstrument:
sprayEffect = BattleParticles.createParticleEffect(file='soundWave')
sprayEffect.setDepthWrite(0)
sprayEffect.setDepthTest(0)
sprayEffect.setTwoSided(1)
I1 = 2.8
retval.append(ActorInterval(toon, 'sound', playRate=1.0, startTime=0.0, endTime=I1))
retval.append(Func(setPosFromOther, sprayEffect, operaInstrument, (0, 1.6, -0.18)))
retval.append(__getPartTrack(sprayEffect, 0.0, 6.0, [sprayEffect, toon, 0], softStop=-3.5))
retval.append(ActorInterval(toon, 'sound', playRate=1.0, startTime=I1))
else:
retval.append(ActorInterval(toon, 'sound'))
if DISTANCE_TO_WALK_BACK and hasLuredSuits and not isNPC:
retval.append(Parallel(ActorInterval(toon, 'walk', startTime=0.0001, duration=TIME_TO_WALK_BACK, endTime=1), LerpPosInterval(toon, TIME_TO_WALK_BACK, oldPos, other=battle)))
retval.append(Func(toon.loop, 'neutral'))
return retval
示例6: createSuitReviveTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def createSuitReviveTrack(suit, toon, battle, npcs = []):
suitTrack = Sequence()
suitPos, suitHpr = battle.getActorPosHpr(suit)
if hasattr(suit, 'battleTrapProp') and suit.battleTrapProp and suit.battleTrapProp.getName() == 'traintrack' and not suit.battleTrapProp.isHidden():
suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs))
deathSuit = suit.getLoseActor()
suitTrack.append(Func(notify.debug, 'before insertDeathSuit'))
suitTrack.append(Func(insertReviveSuit, suit, deathSuit, battle, suitPos, suitHpr))
suitTrack.append(Func(notify.debug, 'before actorInterval lose'))
suitTrack.append(ActorInterval(deathSuit, 'lose', duration=SUIT_LOSE_REVIVE_DURATION))
suitTrack.append(Func(notify.debug, 'before removeDeathSuit'))
suitTrack.append(Func(removeReviveSuit, suit, deathSuit, name='remove-death-suit'))
suitTrack.append(Func(notify.debug, 'after removeDeathSuit'))
suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.48, duration=0.1))
suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.58))
suitTrack.append(Func(suit.loop, 'neutral'))
suitTrack.append(Func(messenger.send, suit.uniqueName('hpChange')))
spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.ogg')
deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg')
deathSoundTrack = Sequence(Wait(0.8), SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2), SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8), SoundInterval(deathSound, volume=0.32))
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(suitPos.getX(), suitPos.getY(), suitPos.getZ() + suit.height - 0.2)
smallGears.setPos(gearPoint)
singleGear.setPos(gearPoint)
smallGears.setDepthWrite(False)
singleGear.setDepthWrite(False)
smallGearExplosion.setPos(gearPoint)
bigGearExplosion.setPos(gearPoint)
smallGearExplosion.setDepthWrite(False)
bigGearExplosion.setDepthWrite(False)
explosionTrack = Sequence()
explosionTrack.append(Wait(5.4))
explosionTrack.append(createKapowExplosionTrack(battle, explosionPoint=gearPoint))
gears1Track = Sequence(Wait(2.1), ParticleInterval(smallGears, battle, worldRelative=0, duration=4.3, cleanup=True), name='gears1Track')
gears2MTrack = Track((0.0, explosionTrack), (0.7, ParticleInterval(singleGear, battle, worldRelative=0, duration=5.7, cleanup=True)), (5.2, ParticleInterval(smallGearExplosion, battle, worldRelative=0, duration=1.2, cleanup=True)), (5.4, ParticleInterval(bigGearExplosion, battle, worldRelative=0, duration=1.0, cleanup=True)), name='gears2MTrack')
toonMTrack = Parallel(name='toonMTrack')
for mtoon in battle.toons:
toonMTrack.append(Sequence(Wait(1.0), ActorInterval(mtoon, 'duck'), ActorInterval(mtoon, 'duck', startTime=1.8), Func(mtoon.loop, 'neutral')))
for mtoon in npcs:
toonMTrack.append(Sequence(Wait(1.0), ActorInterval(mtoon, 'duck'), ActorInterval(mtoon, 'duck', startTime=1.8), Func(mtoon.loop, 'neutral')))
return Parallel(suitTrack, deathSoundTrack, gears1Track, gears2MTrack, toonMTrack)
示例7: __getSuitTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __getSuitTrack(sound, lastSoundThatHit, delay, hitCount, targets, totalDamage, hpbonus, toon, npcs):
tracks = Parallel()
attacks = 0
uberDelay = 0.0
isUber = 0
if sound['level'] >= ToontownBattleGlobals.UBER_GAG_LEVEL_INDEX:
uberDelay = 3.0
isUber = 1
for target in targets:
suit = target['suit']
if totalDamage > 0 and sound == lastSoundThatHit:
hp = target['hp']
died = target['died']
battle = sound['battle']
kbbonus = target['kbbonus']
suitTrack = Sequence()
showDamage = Func(suit.showHpText, -totalDamage, openEnded=0)
updateHealthBar = Func(suit.updateHealthBar, totalDamage)
if isUber:
breakEffect = BattleParticles.createParticleEffect(file='soundBreak')
breakEffect.setDepthWrite(0)
breakEffect.setDepthTest(0)
breakEffect.setTwoSided(1)
breakEffect.setBin('fixed', 10)
soundEffect = globalBattleSoundCache.getSound(hitSoundFiles[0])
suitTrack.append(Wait(delay + tSuitReact))
if isUber:
delayTime = random.random()
suitTrack.append(Wait(delayTime + 2.0))
suitTrack.append(Func(setPosFromOther, breakEffect, suit, Point3(0, 0.0, suit.getHeight() - 1.0)))
suitTrack.append(Parallel(showDamage, updateHealthBar, SoundInterval(soundEffect, node=suit), __getPartTrack(breakEffect, 0.0, 1.0, [breakEffect, suit, 0], softStop=-0.5)))
else:
suitTrack.append(showDamage)
suitTrack.append(updateHealthBar)
if hitCount == 1:
suitTrack.append(Parallel(ActorInterval(suit, 'squirt-small-react'), MovieUtil.createSuitStunInterval(suit, 0.5, 1.8)))
else:
suitTrack.append(ActorInterval(suit, 'squirt-small-react'))
if kbbonus == 0:
suitTrack.append(__createSuitResetPosTrack(suit, battle))
suitTrack.append(Func(battle.unlureSuit, suit))
bonusTrack = None
if hpbonus > 0:
bonusTrack = Sequence(Wait(delay + tSuitReact + delay + 0.75 + uberDelay), Func(suit.showHpText, -hpbonus, 1, openEnded=0))
suitTrack.append(Func(suit.loop, 'neutral'))
if bonusTrack == None:
tracks.append(suitTrack)
else:
tracks.append(Parallel(suitTrack, bonusTrack))
elif totalDamage <= 0:
tracks.append(Sequence(Wait(2.9), Func(MovieUtil.indicateMissed, suit, 1.0)))
return tracks
示例8: doFanfare
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def doFanfare(delay, toon, panel):
fanfareNode = toon.attachNewNode('fanfareNode')
partyBall = fanfareNode.attachNewNode('partyBall')
headparts = toon.getHeadParts()
pos = headparts[2].getPos(fanfareNode)
partyBallLeft = globalPropPool.getProp('partyBall')
partyBallLeft.reparentTo(partyBall)
partyBallLeft.setScale(0.80000000000000004)
partyBallLeft.setH(90)
partyBallLeft.setColorScale(1, 0, 0, 0)
partyBallRight = globalPropPool.getProp('partyBall')
partyBallRight.reparentTo(partyBall)
partyBallRight.setScale(0.80000000000000004)
partyBallRight.setH(-90)
partyBallRight.setColorScale(1, 1, 0, 0)
partyBall.setZ(pos.getZ() + 3.2000000000000002)
ballShake1 = Sequence(Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, 0, 0), hpr = Vec3(90, 10, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, 0, 0), hpr = Vec3(-90, -10, 0), blendType = 'easeInOut')), Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, 10, 0), hpr = Vec3(90, -10, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, -10, 0), hpr = Vec3(-90, 10, 0), blendType = 'easeInOut')), Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, -10, 0), hpr = Vec3(90, 0, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, 10, 0), hpr = Vec3(-90, 0, 0), blendType = 'easeInOut')))
ballShake2 = Sequence(Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, 0, 0), hpr = Vec3(90, -10, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, 0, 0), hpr = Vec3(-90, 10, 0), blendType = 'easeInOut')), Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, -10, 0), hpr = Vec3(90, 10, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, 10, 0), hpr = Vec3(-90, -10, 0), blendType = 'easeInOut')), Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, 10, 0), hpr = Vec3(90, 0, 0), blendType = 'easeInOut'), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, -10, 0), hpr = Vec3(-90, 0, 0), blendType = 'easeInOut')))
openBall = Parallel(LerpHprInterval(partyBallLeft, duration = 0.20000000000000001, startHpr = Vec3(90, 0, 0), hpr = Vec3(90, 30, 0)), LerpHprInterval(partyBallRight, duration = 0.20000000000000001, startHpr = Vec3(-90, 0, 0), hpr = Vec3(-90, 30, 0)))
confettiNode = fanfareNode.attachNewNode('confetti')
confettiNode.setScale(3)
confettiNode.setZ(pos.getZ() + 2.5)
def longshake(models, num, duration):
inShake = getScaleBlendIntervals(models, duration = duration, startScale = 0.23000000000000001, endScale = 0.20000000000000001, blendType = 'easeInOut')
outShake = getScaleBlendIntervals(models, duration = duration, startScale = 0.20000000000000001, endScale = 0.23000000000000001, blendType = 'easeInOut')
i = 1
seq = Sequence()
while i < num:
if i % 2 == 0:
seq.append(inShake)
else:
seq.append(outShake)
i += 1
return seq
def getScaleBlendIntervals(props, duration, startScale, endScale, blendType):
tracks = Parallel()
for prop in props:
tracks.append(LerpScaleInterval(prop, duration, endScale, startScale = startScale, blendType = blendType))
return tracks
trumpetNode = fanfareNode.attachNewNode('trumpetNode')
trumpet1 = globalPropPool.getProp('bugle')
trumpet2 = MovieUtil.copyProp(trumpet1)
trumpet1.reparentTo(trumpetNode)
trumpet1.setScale(0.20000000000000001)
trumpet1.setPos(2, 2, 1)
trumpet1.setHpr(120, 65, 0)
trumpet2.reparentTo(trumpetNode)
trumpet2.setScale(0.20000000000000001)
trumpet2.setPos(-2, 2, 1)
trumpet2.setHpr(-120, 65, 0)
trumpetNode.setTransparency(1)
trumpetNode.setColor(1, 1, 1, 0)
trumpturn1 = LerpHprInterval(trumpet1, duration = 4, startHpr = Vec3(80, 15, 0), hpr = Vec3(150, 40, 0))
trumpturn2 = LerpHprInterval(trumpet2, duration = 4, startHpr = Vec3(-80, 15, 0), hpr = Vec3(-150, 40, 0))
trumpetTurn = Parallel(trumpturn1, trumpturn2)
BattleParticles.loadParticles()
confettiBlue = BattleParticles.createParticleEffect('Confetti')
confettiBlue.reparentTo(confettiNode)
blue_p0 = confettiBlue.getParticlesNamed('particles-1')
blue_p0.renderer.getColorInterpolationManager().addConstant(0.0, 1.0, Vec4(0.0, 0.0, 1.0, 1.0), 1)
confettiYellow = BattleParticles.createParticleEffect('Confetti')
confettiYellow.reparentTo(confettiNode)
yellow_p0 = confettiYellow.getParticlesNamed('particles-1')
yellow_p0.renderer.getColorInterpolationManager().addConstant(0.0, 1.0, Vec4(1.0, 1.0, 0.0, 1.0), 1)
confettiRed = BattleParticles.createParticleEffect('Confetti')
confettiRed.reparentTo(confettiNode)
red_p0 = confettiRed.getParticlesNamed('particles-1')
red_p0.renderer.getColorInterpolationManager().addConstant(0.0, 1.0, Vec4(1.0, 0.0, 0.0, 1.0), 1)
trumpetsAppear = LerpColorInterval(trumpetNode, 0.29999999999999999, startColor = Vec4(1, 1, 0, 0), color = Vec4(1, 1, 0, 1))
trumpetsVanish = LerpColorInterval(trumpetNode, 0.29999999999999999, startColor = Vec4(1, 1, 0, 1), color = Vec4(1, 1, 0, 0))
crabHorn = globalBattleSoundCache.getSound('King_Crab.mp3')
drumroll = globalBattleSoundCache.getSound('SZ_MM_drumroll.mp3')
fanfare = globalBattleSoundCache.getSound('SZ_MM_fanfare.mp3')
crabHorn.setTime(1.5)
partyBall.setTransparency(1)
partyBall.setColorScale(1, 1, 1, 1)
ballAppear = Parallel(LerpColorScaleInterval(partyBallLeft, 0.29999999999999999, startColorScale = Vec4(1, 0, 0, 0), colorScale = Vec4(1, 0, 0, 1)), LerpColorScaleInterval(partyBallRight, 0.29999999999999999, startColorScale = Vec4(1, 1, 0, 0), colorScale = Vec4(1, 1, 0, 1)))
ballVanish = Parallel(LerpColorScaleInterval(partyBallLeft, 0.29999999999999999, startColorScale = Vec4(1, 0, 0, 1), colorScale = Vec4(1, 0, 0, 0)), LerpColorScaleInterval(partyBallRight, 0.29999999999999999, startColorScale = Vec4(1, 1, 0, 1), colorScale = Vec4(1, 1, 0, 0)))
play = Parallel(SoundInterval(crabHorn, startTime = 1.5, duration = 4.0, node = toon), Sequence(Wait(0.25), longshake([
trumpet1,
trumpet2], 3, 0.20000000000000001), Wait(0.5), longshake([
trumpet1,
trumpet2], 3, 0.20000000000000001), Wait(0.5), longshake([
trumpet1,
trumpet2], 9, 0.10000000000000001), longshake([
trumpet1,
trumpet2], 3, 0.20000000000000001)))
killParticles = Parallel(Func(blue_p0.setLitterSize, 0), Func(red_p0.setLitterSize, 0), Func(yellow_p0.setLitterSize, 0))
p = Parallel(ParticleInterval(confettiBlue, confettiNode, worldRelative = 0, duration = 3, cleanup = True), ParticleInterval(confettiRed, confettiNode, worldRelative = 0, duration = 3, cleanup = True), ParticleInterval(confettiYellow, confettiNode, worldRelative = 0, duration = 3, cleanup = True))
pOff = Parallel(Func(confettiBlue.remove), Func(confettiRed.remove), Func(confettiYellow.remove))
partInterval = Parallel(p, Sequence(Wait(1.7), killParticles, Wait(1.3), pOff, Func(p.finish)), Sequence(Wait(3), Parallel(ballVanish)))
seq1 = Parallel(Sequence(Wait(delay + 4.0999999999999996), SoundInterval(drumroll, node = toon), Wait(0.25), SoundInterval(fanfare, node = toon)), Sequence(Wait(delay), trumpetsAppear, Wait(3), ballAppear, Wait(0.5), ballShake1, Wait(0.10000000000000001), ballShake2, Wait(0.20000000000000001), Wait(0.10000000000000001), Parallel(openBall, partInterval), Func(fanfareNode.remove)))
seq = Parallel(seq1, Sequence(Wait(delay), Parallel(trumpetTurn, Sequence(Wait(0.5), play)), Wait(0.5), trumpetsVanish))
if panel != None:
return (seq, panel)
#.........这里部分代码省略.........
示例9: startSparksIval
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def startSparksIval(tntProp):
tip = tntProp.find('**/joint_attachEmitter')
sparks = BattleParticles.createParticleEffect(file='tnt')
return Func(sparks.start, tip)
示例10: createSuitDeathTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def createSuitDeathTrack(suit, toon, battle, npcs=[]):
suitTrack = Sequence()
suitPos, suitHpr = battle.getActorPosHpr(suit)
if (
hasattr(suit, "battleTrapProp")
and suit.battleTrapProp
and suit.battleTrapProp.getName() == "traintrack"
and not suit.battleTrapProp.isHidden()
):
suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs))
deathSuit = suit.getLoseActor()
suitTrack.append(Func(notify.debug, "before insertDeathSuit"))
suitTrack.append(Func(insertDeathSuit, suit, deathSuit, battle, suitPos, suitHpr))
suitTrack.append(Func(notify.debug, "before actorInterval lose"))
suitTrack.append(ActorInterval(deathSuit, "lose", duration=SUIT_LOSE_DURATION))
suitTrack.append(Func(notify.debug, "before removeDeathSuit"))
suitTrack.append(Func(removeDeathSuit, suit, deathSuit, name="remove-death-suit"))
suitTrack.append(Func(notify.debug, "after removeDeathSuit"))
spinningSound = base.loadSfx("phase_3.5/audio/sfx/Cog_Death.ogg")
deathSound = base.loadSfx("phase_3.5/audio/sfx/ENC_cogfall_apart.ogg")
deathSoundTrack = Sequence(
Wait(0.8),
SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2, node=deathSuit),
SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8, node=deathSuit),
SoundInterval(deathSound, volume=0.32, node=deathSuit),
)
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(suitPos.getX(), suitPos.getY(), suitPos.getZ() + suit.height - 0.2)
smallGears.setPos(gearPoint)
singleGear.setPos(gearPoint)
smallGears.setDepthWrite(False)
singleGear.setDepthWrite(False)
smallGearExplosion.setPos(gearPoint)
bigGearExplosion.setPos(gearPoint)
smallGearExplosion.setDepthWrite(False)
bigGearExplosion.setDepthWrite(False)
explosionTrack = Sequence()
explosionTrack.append(Wait(5.4))
explosionTrack.append(createKapowExplosionTrack(battle, explosionPoint=gearPoint))
gears1Track = Sequence(
Wait(2.1), ParticleInterval(smallGears, battle, worldRelative=0, duration=4.3, cleanup=True), name="gears1Track"
)
gears2MTrack = Track(
(0.0, explosionTrack),
(0.7, ParticleInterval(singleGear, battle, worldRelative=0, duration=5.7, cleanup=True)),
(5.2, ParticleInterval(smallGearExplosion, battle, worldRelative=0, duration=1.2, cleanup=True)),
(5.4, ParticleInterval(bigGearExplosion, battle, worldRelative=0, duration=1.0, cleanup=True)),
name="gears2MTrack",
)
toonMTrack = Parallel(name="toonMTrack")
for mtoon in battle.toons:
toonMTrack.append(
Sequence(
Wait(1.0),
ActorInterval(mtoon, "duck"),
ActorInterval(mtoon, "duck", startTime=1.8),
Func(mtoon.loop, "neutral"),
)
)
for mtoon in npcs:
toonMTrack.append(
Sequence(
Wait(1.0),
ActorInterval(mtoon, "duck"),
ActorInterval(mtoon, "duck", startTime=1.8),
Func(mtoon.loop, "neutral"),
)
)
return Parallel(suitTrack, deathSoundTrack, gears1Track, gears2MTrack, toonMTrack)
示例11: __createThrownTrapMultiTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
#.........这里部分代码省略.........
animTrack = ActorInterval(
thrownProp, propName, startTime=throwDelay + 0.9)
scaleTrack = LerpScaleInterval(
thrownProp, throwDuration, scale=MovieUtil.PNT3_ONE)
soundTrack = getSoundTrack('TL_marbles.ogg', delay=0.1, node=toon)
throwTrack.append(Wait(0.2))
throwTrack.append(
Parallel(
moveTrack,
animTrack,
scaleTrack,
soundTrack))
elif trapName == 'rake':
trapPoint, trapHpr = battle.getActorPosHpr(suit)
trapPoint.setY(MovieUtil.SUIT_TRAP_RAKE_DISTANCE)
throwDuration = 1.1
throwingTrack = createThrowingTrack(
thrownProp, trapPoint, duration=throwDuration, parent=suit)
hprTrack = LerpHprInterval(
thrownProp, throwDuration, hpr=VBase3(
63.43, -90.0, 63.43))
scaleTrack = LerpScaleInterval(
thrownProp, 0.9, scale=Point3(
0.7, 0.7, 0.7))
soundTrack = SoundInterval(globalBattleSoundCache.getSound(
'TL_rake_throw_only.ogg'), duration=1.1, node=suit)
throwTrack.append(Wait(0.2))
throwTrack.append(
Parallel(
throwingTrack,
hprTrack,
scaleTrack,
soundTrack))
else:
notify.warning(
'__createThrownTrapMultiTrack() - Incorrect trap: %s thrown from toon' %
trapName)
def placeTrap(trapProp, suit, battle=battle, trapName=trapName):
if not trapProp or trapProp.isEmpty():
return
trapProp.wrtReparentTo(suit)
trapProp.show()
if trapName == 'rake':
trapProp.setPos(0, MovieUtil.SUIT_TRAP_RAKE_DISTANCE, 0)
trapProp.setHpr(Point3(0, 270, 0))
trapProp.setScale(Point3(0.7, 0.7, 0.7))
rakeOffset = MovieUtil.getSuitRakeOffset(suit)
trapProp.setY(trapProp.getY() + rakeOffset)
elif trapName == 'banana':
trapProp.setHpr(0, 0, 0)
trapProp.setPos(0, MovieUtil.SUIT_TRAP_DISTANCE, -0.35)
trapProp.pose(trapName, trapProp.getNumFrames(trapName) - 1)
elif trapName == 'marbles':
trapProp.setHpr(Point3(94, 0, 0))
trapProp.setPos(0, MovieUtil.SUIT_TRAP_MARBLES_DISTANCE, 0)
trapProp.pose(trapName, trapProp.getNumFrames(trapName) - 1)
elif trapName == 'tnt':
trapProp.setHpr(0, 90, 0)
trapProp.setPos(0, MovieUtil.SUIT_TRAP_TNT_DISTANCE, 0.4)
else:
notify.warning(
'placeTrap() - Incorrect trap: %s placed on a suit' %
trapName)
dustNode = hidden.attachNewNode('DustNode')
def placeDustExplosion(
dustNode=dustNode,
thrownProp=thrownProp,
battle=battle):
dustNode.reparentTo(battle)
dustNode.setPos(thrownProp.getPos(battle))
if explode == 1:
throwTrack.append(Func(thrownProp.wrtReparentTo, hidden))
throwTrack.append(Func(placeDustExplosion))
throwTrack.append(
createCartoonExplosionTrack(
dustNode,
'dust',
explosionPoint=Point3(
0,
0,
0)))
throwTrack.append(Func(battle.removeTrap, suit))
else:
throwTrack.append(Func(placeTrap, trapProp, suit))
if trapName == 'tnt':
tip = trapProp.find('**/joint_attachEmitter')
sparks = BattleParticles.createParticleEffect(file='tnt')
trapProp.sparksEffect = sparks
throwTrack.append(Func(sparks.start, tip))
throwTrack.append(Func(MovieUtil.removeProps, propList))
toonTrack = Sequence(
Func(
toon.headsUp, battle, targetPos), ActorInterval(
toon, 'toss'), Func(
toon.loop, 'neutral'))
return Parallel(propTrack, throwTrack, toonTrack)
示例12: __doStormCloud
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __doStormCloud(squirt, delay, fShowStun):
toon = squirt['toon']
level = squirt['level']
hpbonus = squirt['hpbonus']
target = squirt['target']
suit = target['suit']
hp = target['hp']
kbbonus = target['kbbonus']
died = target['died']
revived = target['revived']
leftSuits = target['leftSuits']
rightSuits = target['rightSuits']
battle = squirt['battle']
suitPos = suit.getPos(battle)
origHpr = toon.getHpr(battle)
hitSuit = hp > 0
scale = sprayScales[level]
tButton = 0.0
dButtonScale = 0.5
dButtonHold = 3.0
tContact = 2.9
tSpray = 1
tSuitDodges = 1.8
tracks = Parallel()
soundTrack = __getSoundTrack(level, hitSuit, 2.3, toon)
soundTrack2 = __getSoundTrack(level, hitSuit, 4.6, toon)
tracks.append(soundTrack)
tracks.append(soundTrack2)
button = globalPropPool.getProp('button')
button2 = MovieUtil.copyProp(button)
buttons = [button, button2]
hands = toon.getLeftHands()
toonTrack = Sequence(Func(MovieUtil.showProps, buttons, hands), Func(toon.headsUp, battle, suitPos), ActorInterval(toon, 'pushbutton'), Func(MovieUtil.removeProps, buttons), Func(toon.loop, 'neutral'), Func(toon.setHpr, battle, origHpr))
tracks.append(toonTrack)
cloud = globalPropPool.getProp('stormcloud')
cloud2 = MovieUtil.copyProp(cloud)
BattleParticles.loadParticles()
trickleEffect = BattleParticles.createParticleEffect(file='trickleLiquidate')
rainEffect = BattleParticles.createParticleEffect(file='liquidate')
rainEffect2 = BattleParticles.createParticleEffect(file='liquidate')
rainEffect3 = BattleParticles.createParticleEffect(file='liquidate')
cloudHeight = suit.height + 3
cloudPosPoint = Point3(0, 0, cloudHeight)
scaleUpPoint = Point3(3, 3, 3)
rainEffects = [rainEffect, rainEffect2, rainEffect3]
rainDelay = 1
effectDelay = 0.3
if hp > 0:
cloudHold = 4.7
else:
cloudHold = 1.7
def getCloudTrack(cloud, suit, cloudPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, cloudHold, useEffect, battle = battle, trickleEffect = trickleEffect):
track = Sequence(Func(MovieUtil.showProp, cloud, suit, cloudPosPoint), Func(cloud.pose, 'stormcloud', 0), LerpScaleInterval(cloud, 1.5, scaleUpPoint, startScale=MovieUtil.PNT3_NEARZERO), Wait(rainDelay))
if useEffect == 1:
ptrack = Parallel()
delay = trickleDuration = cloudHold * 0.25
trickleTrack = Sequence(Func(battle.movie.needRestoreParticleEffect, trickleEffect), ParticleInterval(trickleEffect, cloud, worldRelative=0, duration=trickleDuration, cleanup=True), Func(battle.movie.clearRestoreParticleEffect, trickleEffect))
track.append(trickleTrack)
for i in range(0, 3):
dur = cloudHold - 2 * trickleDuration
ptrack.append(Sequence(Func(battle.movie.needRestoreParticleEffect, rainEffects[i]), Wait(delay), ParticleInterval(rainEffects[i], cloud, worldRelative=0, duration=dur, cleanup=True), Func(battle.movie.clearRestoreParticleEffect, rainEffects[i])))
delay += effectDelay
ptrack.append(Sequence(Wait(3 * effectDelay), ActorInterval(cloud, 'stormcloud', startTime=1, duration=cloudHold)))
track.append(ptrack)
else:
track.append(ActorInterval(cloud, 'stormcloud', startTime=1, duration=cloudHold))
track.append(LerpScaleInterval(cloud, 0.5, MovieUtil.PNT3_NEARZERO))
track.append(Func(MovieUtil.removeProp, cloud))
return track
tracks.append(getCloudTrack(cloud, suit, cloudPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, cloudHold, useEffect=1))
tracks.append(getCloudTrack(cloud2, suit, cloudPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, cloudHold, useEffect=0))
if hp > 0 or delay <= 0:
tracks.append(__getSuitTrack(suit, tContact, tSuitDodges, hp, hpbonus, kbbonus, 'soak', died, leftSuits, rightSuits, battle, toon, fShowStun, beforeStun=2.6, afterStun=2.3, revived=revived))
return tracks
示例13: __createThrownTrapMultiTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
#.........这里部分代码省略.........
Point3(94, 0, 0)]),
LerpPosInterval(thrownProp, flingDuration, pos = landPoint, other = suit),
LerpPosInterval(thrownProp, rollDuration, pos = throwPoint, other = suit)])
animTrack = Track([
ActorInterval(thrownProp, propName, startTime = throwDelay + 0.90000000000000002)])
scaleTrack = Track([
LerpScaleInterval(thrownProp, throwDuration, scale = MovieUtil.PNT3_ONE)])
soundTrack = getSoundTrack('TL_marbles.mp3', delay = 0.10000000000000001, node = toon)
throwIvals.append(WaitInterval(0.20000000000000001))
throwIvals.append(MultiTrack([
moveTrack,
animTrack,
scaleTrack,
soundTrack]))
elif trapName == 'rake':
(trapPoint, trapHpr) = battle.getActorPosHpr(suit)
trapPoint.setY(MovieUtil.SUIT_TRAP_RAKE_DISTANCE)
throwDuration = 1.1000000000000001
throwingTrack = Track(createThrowIvals(thrownProp, trapPoint, duration = throwDuration, parent = suit))
hprTrack = Track([
LerpHprInterval(thrownProp, throwDuration, hpr = Point3(180, 90, -180))])
scaleTrack = Track([
LerpScaleInterval(thrownProp, 0.90000000000000002, scale = Point3(0.69999999999999996, 0.69999999999999996, 0.69999999999999996))])
soundTrack = Track([
SoundInterval(globalBattleSoundCache.getSound('TL_rake_throw_only.mp3'), duration = 1.1000000000000001, node = suit)])
throwIvals.append(WaitInterval(0.20000000000000001))
throwIvals.append(MultiTrack([
throwingTrack,
hprTrack,
scaleTrack,
soundTrack]))
else:
notify.warning('__createThrownTrapMultiTrack() - Incorrect trap: %s thrown from toon' % trapName)
def placeTrap(trapProp, suit, battle = battle, trapName = trapName):
if not trapProp or trapProp.isEmpty():
return None
trapProp.wrtReparentTo(suit)
trapProp.show()
if trapName == 'rake':
trapProp.setPos(0, MovieUtil.SUIT_TRAP_RAKE_DISTANCE, 0)
trapProp.setHpr(Point3(0, 270, 0))
trapProp.setScale(Point3(0.69999999999999996, 0.69999999999999996, 0.69999999999999996))
rakeOffset = MovieUtil.getSuitRakeOffset(suit)
trapProp.setY(trapProp.getY() + rakeOffset)
elif trapName == 'banana':
trapProp.setHpr(0, 0, 0)
trapProp.setPos(0, MovieUtil.SUIT_TRAP_DISTANCE, -0.34999999999999998)
trapProp.pose(trapName, trapProp.getNumFrames(trapName) - 1)
elif trapName == 'marbles':
trapProp.setHpr(Point3(94, 0, 0))
trapProp.setPos(0, MovieUtil.SUIT_TRAP_MARBLES_DISTANCE, 0)
trapProp.pose(trapName, trapProp.getNumFrames(trapName) - 1)
elif trapName == 'tnt':
trapProp.setHpr(0, 90, 0)
trapProp.setPos(0, MovieUtil.SUIT_TRAP_TNT_DISTANCE, 0.40000000000000002)
else:
notify.warning('placeTrap() - Incorrect trap: %s placed on a suit' % trapName)
dustNode = hidden.attachNewNode('DustNode')
def placeDustExplosion(dustNode = dustNode, thrownProp = thrownProp, battle = battle):
dustNode.reparentTo(battle)
dustNode.setPos(thrownProp.getPos(battle))
if explode == 1:
throwIvals.append(FunctionInterval(thrownProp.wrtReparentTo, extraArgs = [
hidden]))
throwIvals.append(FunctionInterval(placeDustExplosion))
throwIvals.extend(createCartoonExplosionIvals(dustNode, 'dust', explosionPoint = Point3(0, 0, 0)))
throwIvals.append(FunctionInterval(battle.removeTrap, extraArgs = [
suit]))
else:
throwIvals.append(FunctionInterval(placeTrap, extraArgs = [
trapProp,
suit]))
if trapName == 'tnt':
tip = trapProp.find('**/joint-attachEmitter')
sparks = BattleParticles.createParticleEffect(file = 'tnt')
trapProp.sparksEffect = sparks
throwIvals.append(FunctionInterval(sparks.start, extraArgs = [
tip]))
throwIvals.append(FunctionInterval(MovieUtil.removeProps, extraArgs = [
propList]))
propTrack = Track(propIvals)
if trapName == 'tnt':
throwTrack = Track(throwIvals)
else:
throwTrack = Track(throwIvals)
toonTrack = Track([
FunctionInterval(toon.headsUp, extraArgs = [
battle,
targetPos]),
ActorInterval(toon, 'toss')])
return MultiTrack([
propTrack,
throwTrack,
toonTrack])
示例14: __doStormCloud
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def __doStormCloud(squirt, delay, fShowStun):
toon = squirt["toon"]
level = squirt["level"]
hpbonus = squirt["hpbonus"]
target = squirt["target"]
suit = target["suit"]
hp = target["hp"]
kbbonus = target["kbbonus"]
died = target["died"]
leftSuits = target["leftSuits"]
rightSuits = target["rightSuits"]
battle = squirt["battle"]
suitPos = suit.getPos(battle)
origHpr = toon.getHpr(battle)
hitSuit = hp > 0
scale = sprayScales[level]
tButton = 0.0
dButtonScale = 0.5
dButtonHold = 3.0
tContact = 2.8999999999999999
tSpray = 1
tSuitDodges = 1.8
tracks = []
soundTrack = __getSoundTrack(level, hitSuit, 2.2999999999999998, toon)
soundTrack2 = __getSoundTrack(level, hitSuit, 4.5999999999999996, toon)
tracks.append(soundTrack)
tracks.append(soundTrack2)
button = globalPropPool.getProp("button")
button2 = MovieUtil.copyProp(button)
buttons = [button, button2]
hands = toon.getLeftHands()
toonIvals = [
FunctionInterval(MovieUtil.showProps, extraArgs=[buttons, hands]),
FunctionInterval(toon.headsUp, extraArgs=[battle, suitPos]),
ActorInterval(toon, "pushbutton"),
FunctionInterval(MovieUtil.removeProps, extraArgs=[buttons]),
FunctionInterval(toon.loop, extraArgs=["neutral"]),
FunctionInterval(toon.setHpr, extraArgs=[battle, origHpr]),
]
tracks.append(Track(toonIvals))
cloud = globalPropPool.getProp("stormcloud")
cloud2 = MovieUtil.copyProp(cloud)
BattleParticles.loadParticles()
trickleEffect = BattleParticles.createParticleEffect(file="trickleLiquidate")
rainEffect = BattleParticles.createParticleEffect(file="liquidate")
rainEffect2 = BattleParticles.createParticleEffect(file="liquidate")
rainEffect3 = BattleParticles.createParticleEffect(file="liquidate")
cloudHeight = suit.height + 3
cloudPosPoint = Point3(0, 0, cloudHeight)
scaleUpPoint = Point3(3, 3, 3)
rainEffects = [rainEffect, rainEffect2, rainEffect3]
rainDelay = 1
effectDelay = 0.29999999999999999
if hp > 0:
cloudHold = 4.7000000000000002
else:
cloudHold = 1.7
def getCloudIvals(
cloud,
suit,
cloudPosPoint,
scaleUpPoint,
rainEffects,
rainDelay,
effectDelay,
cloudHold,
useEffect,
battle=battle,
trickleEffect=trickleEffect,
):
ivals = [
FunctionInterval(MovieUtil.showProp, extraArgs=[cloud, suit, cloudPosPoint]),
FunctionInterval(cloud.pose, extraArgs=["stormcloud", 0]),
LerpScaleInterval(cloud, 1.5, scaleUpPoint, startScale=MovieUtil.PNT3_NEARZERO),
WaitInterval(rainDelay),
]
if useEffect == 1:
pivals = []
delay = cloudHold * 0.25
trickleDuration = cloudHold * 0.25
trickleTrack = Track(
[
FunctionInterval(battle.movie.needRestoreParticleEffect, extraArgs=[trickleEffect]),
ParticleInterval(trickleEffect, cloud, worldRelative=0, duration=trickleDuration),
FunctionInterval(battle.movie.clearRestoreParticleEffect, extraArgs=[trickleEffect]),
]
)
ivals.append(trickleTrack)
for i in range(0, 3):
dur = cloudHold - 2 * trickleDuration
pivals.append(
Track(
[
FunctionInterval(battle.movie.needRestoreParticleEffect, extraArgs=[rainEffects[i]]),
WaitInterval(delay),
ParticleInterval(rainEffects[i], cloud, worldRelative=0, duration=dur),
FunctionInterval(battle.movie.clearRestoreParticleEffect, extraArgs=[rainEffects[i]]),
]
)
#.........这里部分代码省略.........
示例15: startSparksIval
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import createParticleEffect [as 别名]
def startSparksIval(tntProp):
tip = tntProp.find('**/joint-attachEmitter')
sparks = BattleParticles.createParticleEffect(file = 'tnt')
return FunctionInterval(sparks.start, extraArgs = [
tip])