本文整理汇总了Python中BattleParticles.loadParticles方法的典型用法代码示例。如果您正苦于以下问题:Python BattleParticles.loadParticles方法的具体用法?Python BattleParticles.loadParticles怎么用?Python BattleParticles.loadParticles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BattleParticles
的用法示例。
在下文中一共展示了BattleParticles.loadParticles方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: midairSuitExplodeTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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))
示例2: createSuitReviveTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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)
示例3: doFanfare
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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)
#.........这里部分代码省略.........
示例4: createSuitDeathTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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)
示例5: __doGeyser
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [as 别名]
def __doGeyser(squirt, delay, fShowStun, uberClone = 0):
toon = squirt['toon']
level = squirt['level']
hpbonus = squirt['hpbonus']
tracks = Parallel()
tButton = 0.0
dButtonScale = 0.5
dButtonHold = 3.0
tContact = 2.9
tSpray = 1
tSuitDodges = 1.8
button = globalPropPool.getProp('button')
button2 = MovieUtil.copyProp(button)
buttons = [button, button2]
hands = toon.getLeftHands()
battle = squirt['battle']
origHpr = toon.getHpr(battle)
suit = squirt['target'][0]['suit']
suitPos = suit.getPos(battle)
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)
for target in squirt['target']:
suit = target['suit']
hp = target['hp']
kbbonus = target['kbbonus']
died = target['died']
revived = target['revived']
leftSuits = target['leftSuits']
rightSuits = target['rightSuits']
suitPos = suit.getPos(battle)
hitSuit = hp > 0
scale = sprayScales[level]
soundTrack = __getSoundTrack(level, hitSuit, 1.8, toon)
delayTime = random.random()
tracks.append(Wait(delayTime))
tracks.append(soundTrack)
cloud = globalPropPool.getProp('geyser')
cloud2 = MovieUtil.copyProp(cloud)
BattleParticles.loadParticles()
geyserHeight = battle.getH()
geyserPosPoint = Point3(0, 0, geyserHeight)
scaleUpPoint = Point3(1.8, 1.8, 1.8)
rainEffects = []
rainDelay = 2.5
effectDelay = 0.3
if hp > 0:
geyserHold = 1.5
else:
geyserHold = 0.5
def getGeyserTrack(geyser, suit, geyserPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, geyserHold, useEffect, battle = battle):
geyserMound = MovieUtil.copyProp(geyser)
geyserRemoveM = geyserMound.findAllMatches('**/Splash*')
geyserRemoveM.addPathsFrom(geyserMound.findAllMatches('**/spout'))
for i in range(geyserRemoveM.getNumPaths()):
geyserRemoveM[i].removeNode()
geyserWater = MovieUtil.copyProp(geyser)
geyserRemoveW = geyserWater.findAllMatches('**/hole')
geyserRemoveW.addPathsFrom(geyserWater.findAllMatches('**/shadow'))
for i in range(geyserRemoveW.getNumPaths()):
geyserRemoveW[i].removeNode()
track = Sequence(Wait(rainDelay), Func(MovieUtil.showProp, geyserMound, battle, suit.getPos(battle)), Func(MovieUtil.showProp, geyserWater, battle, suit.getPos(battle)), LerpScaleInterval(geyserWater, 1.0, scaleUpPoint, startScale=MovieUtil.PNT3_NEARZERO), Wait(geyserHold * 0.5), LerpScaleInterval(geyserWater, 0.5, MovieUtil.PNT3_NEARZERO, startScale=scaleUpPoint))
track.append(LerpScaleInterval(geyserMound, 0.5, MovieUtil.PNT3_NEARZERO))
track.append(Func(MovieUtil.removeProp, geyserMound))
track.append(Func(MovieUtil.removeProp, geyserWater))
track.append(Func(MovieUtil.removeProp, geyser))
return track
if not uberClone:
tracks.append(Sequence(Wait(delayTime), getGeyserTrack(cloud, suit, geyserPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, geyserHold, useEffect=1)))
if hp > 0 or delay <= 0:
tracks.append(Sequence(Wait(delayTime), __getSuitTrack(suit, tContact, tSuitDodges, hp, hpbonus, kbbonus, 'soak', died, leftSuits, rightSuits, battle, toon, fShowStun, beforeStun=2.6, afterStun=2.3, geyser=1, uberRepeat=uberClone, revived=revived)))
return tracks
示例6: __doStormCloud
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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
示例7: __doStormCloud
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [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]]),
]
)
#.........这里部分代码省略.........
示例8: createSuitDeathTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [as 别名]
def createSuitDeathTrack(suit, toon, battle):
suitIvals = []
deathSuit = suit.getLoseActor()
(suitPos, suitHpr) = battle.getActorPosHpr(suit)
suitIvals.append(FunctionInterval(insertDeathSuit, extraArgs = [
suit,
deathSuit,
battle,
suitPos]))
suitIvals.append(ActorInterval(deathSuit, 'lose', duration = SUIT_LOSE_DURATION))
suitIvals.append(FunctionInterval(removeDeathSuit, name = 'remove-death-suit', extraArgs = [
suit,
deathSuit]))
suitTrack = Track(suitIvals)
spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.mp3')
deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.mp3')
deathSoundTrack = Track([
WaitInterval(0.80000000000000004),
SoundInterval(spinningSound, duration = 1.2, startTime = 1.5, volume = 0.20000000000000001, node = suit),
SoundInterval(spinningSound, duration = 3.0, startTime = 0.59999999999999998, volume = 0.90000000000000002, node = suit),
SoundInterval(deathSound, volume = 0.40000000000000002, node = suit)])
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.20000000000000001)
smallGears.setPos(gearPoint)
singleGear.setPos(gearPoint)
smallGearExplosion.setPos(gearPoint)
bigGearExplosion.setPos(gearPoint)
explosionIvals = []
explosionIvals.append(WaitInterval(5.4000000000000004))
explosionIvals.extend(createKapowExplosionIvals(battle, explosionPoint = gearPoint))
explosionTrack = Track(explosionIvals)
gears1Track = Track([
(2.1000000000000001, ParticleInterval(smallGears, battle, worldRelative = 0, duration = 4.2999999999999998))], name = 'gears1Track')
gears2MTrack = MultiTrack([
Track([
(0.69999999999999996, ParticleInterval(singleGear, battle, worldRelative = 0, duration = 5.7000000000000002))]),
Track([
(5.2000000000000002, ParticleInterval(smallGearExplosion, battle, worldRelative = 0, duration = 1.2))]),
Track([
(5.4000000000000004, ParticleInterval(bigGearExplosion, battle, worldRelative = 0, duration = 1.0))]),
explosionTrack], name = 'gears2MTrack')
toonTracks = []
for mtoon in battle.toons:
toonTracks.append(Track([
WaitInterval(1.0),
ActorInterval(mtoon, 'duck'),
ActorInterval(mtoon, 'duck', startTime = 1.8),
FunctionInterval(mtoon.loop, extraArgs = [
'neutral'])]))
toonMTrack = MultiTrack(toonTracks)
return MultiTrack([
suitTrack,
deathSoundTrack,
gears1Track,
gears2MTrack,
toonMTrack])
示例9: __getSoundTrack
# 需要导入模块: import BattleParticles [as 别名]
# 或者: from BattleParticles import loadParticles [as 别名]
hp = target['hp']
kbbonus = target['kbbonus']
died = target['died']
revived = target['revived']
leftSuits = target['leftSuits']
rightSuits = target['rightSuits']
suitPos = suit.getPos(battle)
hitSuit = hp > 0
scale = sprayScales[level]
soundTrack = __getSoundTrack(level, hitSuit, 1.8, toon)
delayTime = random.random()
tracks.append(Wait(delayTime))
tracks.append(soundTrack)
cloud = globalPropPool.getProp('geyser')
cloud2 = MovieUtil.copyProp(cloud)
BattleParticles.loadParticles()
geyserHeight = battle.getH()
geyserPosPoint = Point3(0, 0, geyserHeight)
scaleUpPoint = Point3(1.8, 1.8, 1.8)
rainEffects = []
rainDelay = 2.5
effectDelay = 0.3
if hp > 0:
geyserHold = 1.5
else:
geyserHold = 0.5
def getGeyserTrack(geyser, suit, geyserPosPoint, scaleUpPoint, rainEffects, rainDelay, effectDelay, geyserHold, useEffect, battle = battle):
geyserMound = MovieUtil.copyProp(geyser)
geyserRemoveM = geyserMound.findAllMatches('**/Splash*')
geyserRemoveM.addPathsFrom(geyserMound.findAllMatches('**/spout'))