本文整理汇总了Python中toontown.battle.BattleParticles.setEffectTexture方法的典型用法代码示例。如果您正苦于以下问题:Python BattleParticles.setEffectTexture方法的具体用法?Python BattleParticles.setEffectTexture怎么用?Python BattleParticles.setEffectTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.battle.BattleParticles
的用法示例。
在下文中一共展示了BattleParticles.setEffectTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeCrunchTrack
# 需要导入模块: from toontown.battle import BattleParticles [as 别名]
# 或者: from toontown.battle.BattleParticles import setEffectTexture [as 别名]
def makeCrunchTrack(self):
toonId = self.toon
toon = base.cr.doId2do.get(toonId)
if not toon:
return
self.virtualSuit.lookAt(toon)
if self.virtualSuit.style.body in ['a', 'b']:
throwDelay = 3
elif self.virtualSuit.style.body == 'c':
throwDelay = 2.3
else:
throwDelay = 2
numberNames = ['one',
'two',
'three',
'four',
'five',
'six']
BattleParticles.loadParticles()
numberSpill1 = BattleParticles.createParticleEffect(file='numberSpill')
numberSpill2 = BattleParticles.createParticleEffect(file='numberSpill')
spillTexture1 = random.choice(numberNames)
spillTexture2 = random.choice(numberNames)
BattleParticles.setEffectTexture(numberSpill1, 'audit-' + spillTexture1)
BattleParticles.setEffectTexture(numberSpill2, 'audit-' + spillTexture2)
numberSpillTrack1 = getPartTrack(numberSpill1, 1.1, 2.2, [numberSpill1, self.virtualSuit, 0])
numberSpillTrack2 = getPartTrack(numberSpill2, 1.5, 1.0, [numberSpill2, self.virtualSuit, 0])
numberSprayTracks = Parallel()
numOfNumbers = random.randint(5, 9)
for i in xrange(0, numOfNumbers - 1):
nextSpray = BattleParticles.createParticleEffect(file='numberSpray')
nextTexture = random.choice(numberNames)
BattleParticles.setEffectTexture(nextSpray, 'audit-' + nextTexture)
nextStartTime = random.random() * 0.6 + 3.03
nextDuration = random.random() * 0.4 + 1.4
nextSprayTrack = getPartTrack(nextSpray, nextStartTime, nextDuration, [nextSpray, self.virtualSuit, 0])
numberSprayTracks.append(nextSprayTrack)
def throwProp(prop):
if not self.virtualSuit:
return
toon = self.cr.doId2do.get(toonId)
if not toon:
self.cleanupProp(prop, False)
self.finishPropAttack()
return
self.virtualSuit.lookAt(toon)
prop.wrtReparentTo(render)
hitPos = toon.getPos() + Vec3(0, 0, 2.5)
distance = (prop.getPos() - hitPos).length()
speed = 50.0
throwSequence = Sequence(
prop.posInterval(distance / speed, hitPos),
Func(self.cleanupProp, prop, False)
)
throwSequence.start()
numberTracks = Parallel()
for i in xrange(0, numOfNumbers):
texture = random.choice(numberNames)
next = copyProp(BattleParticles.getParticle('audit-' + texture))
next.reparentTo(self.virtualSuit.getRightHand())
next.setScale(0.01, 0.01, 0.01)
next.setColor(Vec4(0.0, 0.0, 0.0, 1.0))
next.setPos(random.random() * 0.6 - 0.3, random.random() * 0.6 - 0.3, random.random() * 0.6 - 0.3)
next.setHpr(VBase3(-1.15, 86.58, -76.78))
# Make prop virtual:
next.setColorScale(1.0, 0.0, 0.0, 0.8)
next.setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd))
# Prop collisions:
colNode = CollisionNode(self.uniqueName('SuitAttack'))
colNode.setTag('damage', str(self.attackInfo[1]))
bounds = next.getBounds()
center = bounds.getCenter()
radius = bounds.getRadius()
sphere = CollisionSphere(center.getX(), center.getY(), center.getZ(), radius)
sphere.setTangible(0)
colNode.addSolid(sphere)
colNode.setIntoCollideMask(WallBitmask)
next.attachNewNode(colNode)
numberTrack = Sequence(
Wait(throwDelay),
Parallel(
LerpScaleInterval(next, 0.6, Point3(1.0, 1.0, 1.0)),
Func(throwProp, next),
),
#.........这里部分代码省略.........