Esempio n. 1
0
    def destroy(self):
        if self.card:
            self.card.removeNode()
            self.card = None

        EffectController.destroy(self)
        PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.target = None
     self.initialVelocity = Vec3(1, 1, 1)
     self.targetOffset = Vec3(0, 0, 0)
     self.duration = 3.0
     self.wantTrail = 1
     self.particleEffect = None
     self.motion_color = [
         Vec4(0.5, 0.59999999999999998, 0.80000000000000004, 1.0),
         Vec4(0.5, 0.59999999999999998, 0.80000000000000004, 1.0),
     ]
     vertex_list = [Vec4(0.0, 1.0, 0.0, 1.0), Vec4(0.0, -1.0, 0.0, 1.0)]
     self.motion_trail = PolyTrail.PolyTrail(None, vertex_list, self.motion_color, 1.5)
     self.motion_trail.reparentTo(self)
     vertex_list = [Vec4(1.0, 0.0, 0.0, 1.0), Vec4(-1.0, 0.0, 0.0, 1.0)]
     self.motion_trail2 = PolyTrail.PolyTrail(None, vertex_list, self.motion_color, 1.5)
     self.motion_trail2.reparentTo(self)
     self.motion_trail.node().setAttrib(
         ColorBlendAttrib.make(
             ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor, ColorBlendAttrib.OOneMinusIncomingAlpha
         )
     )
     self.motion_trail2.node().setAttrib(
         ColorBlendAttrib.make(
             ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor, ColorBlendAttrib.OOneMinusIncomingAlpha
         )
     )
Esempio n. 3
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('phase_4/models/props/tt_m_efx_ext_fireworkCards')
     self.card = model.find('**/tt_t_efx_ext_particleStars')
     self.cardScale = 64.0
     self.setDepthWrite(0)
     self.setColorScaleOff()
     self.setLightOff()
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect('StarBurst')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-0')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -25.0), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.04)
     self.p0.setLitterSize(64)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.25)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.getColorInterpolationManager().addLinear(0.0, 0.1, Vec4(0, 0, 0, 0), self.effectColor, 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectColor(self.effectColor)
Esempio n. 4
0
 def destroy(self):
     if self.disturb:
         self.disturb.pause()
         self.disturb = None
     
     EffectController.destroy(self)
     PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('phase_4/models/props/tt_m_efx_ext_particleCards')
     self.card = model.find('**/tt_t_efx_ext_particleStars')
     self.cardScale = 64.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.effectScale = 1.0
     self.lifespan = 2.0
     if not SparksTrailLong.particleDummy:
         SparksTrailLong.particleDummy = render.attachNewNode(ModelNode('SparksTrailLongParticleDummy'))
         SparksTrailLong.particleDummy.setDepthWrite(0)
     self.f = ParticleEffect.ParticleEffect('SparksTrailLong')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('PointEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -2.0), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.02)
     self.p0.setLitterSize(1)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(0)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(self.lifespan)
     self.p0.factory.setLifespanSpread(0.1)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(90.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(25.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -2.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.useRay = 0
     self.useSpark = 1
     self.rayAngle = 0.0
     self.rayFlareValue = 0.34999999999999998
     self.setColorScaleOff()
     self.startCol = Vec4(1.0, 1.0, 1.0, 1)
     self.fadeTime = 0.59999999999999998
     self.startScale = 2.0
     self.splatScale = 10.0
     self.flashDummy = self.attachNewNode('FlashDummy')
     self.flashDummy.reparentTo(self)
     self.flashDummy.hide()
     self.flashDummy.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
     self.flash = loader.loadModel('models/effects/combat_hit_spark')
     self.flash.setDepthWrite(0)
     self.flash.setFogOff()
     self.flash.setLightOff()
     self.flash.setScale(self.splatScale)
     self.flash.reparentTo(self.flashDummy)
     self.flash.setBillboardPointEye(1.0)
     self.spark = loader.loadModel('models/effects/hitSplats')
     self.spark.reparentTo(self.flash)
     flash2 = loader.loadModel('models/effects/hitSplats')
     flash2.reparentTo(self.spark)
     self.slashRay = loader.loadModel('models/effects/hitSplats')
     self.slashRay.setDepthWrite(0)
     self.slashRay.setFogOff()
     self.slashRay.setLightOff()
     self.slashRay.setScale(self.splatScale)
     self.slashRay.reparentTo(self.flashDummy)
     self.slashRay.setTwoSided(1)
Esempio n. 7
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleRockShower')
     self.speed = 20.0
     if not ThrowDirt.particleDummy:
         ThrowDirt.particleDummy = render.attachNewNode(ModelNode('ThrowDirtParticleDummy'))
         ThrowDirt.particleDummy.setDepthWrite(0)
         ThrowDirt.particleDummy.setLightOff()
         ThrowDirt.particleDummy.setColorScaleOff()
         ThrowDirt.particleDummy.setFogOff()
     
     self.f = ParticleEffect.ParticleEffect('ThrowDirt')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.f.addParticles(self.p0)
     self.f0 = ForceGroup.ForceGroup('Grav')
     force0 = LinearVectorForce(Vec3(0.0, -1.0, -20.0), 1.0, 1)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     self.f0.addForce(force0)
     self.f.addForceGroup(self.f0)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.02)
     self.p0.setLitterSize(1)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.0)
     self.p0.factory.setLifespanSpread(1.0)
     self.p0.factory.setMassBase(0.40000000000000002)
     self.p0.factory.setMassSpread(0.34999999999999998)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(0.29999999999999999, 0.20000000000000001, 0, 1))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setInitialXScale(0.0040000000000000001 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.0080000000000000002 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.0040000000000000001 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.0080000000000000002 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(1.5)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 10.0, 20.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(1.0)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleSmoke')
     self.speed = 20.0
     self.radius = 7.0
     self.spriteScale = 1.0
     if not SmokePillar.particleDummy:
         SmokePillar.particleDummy = render.attachNewNode(ModelNode('SmokePillarParticleDummy'))
         SmokePillar.particleDummy.setDepthWrite(0)
         SmokePillar.particleDummy.setLightOff()
     
     self.f = ParticleEffect.ParticleEffect('SmokePillar')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -40.0), 1.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
Esempio n. 9
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.setColorScaleOff()
     self.startCol = Vec4(0.5, 0.5, 0.5, 1)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleDot')
     if not PistolFlame.particleDummy:
         PistolFlame.particleDummy = render.attachNewNode(ModelNode('FireParticleDummy'))
         PistolFlame.particleDummy.setDepthWrite(0)
         PistolFlame.particleDummy.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
         PistolFlame.particleDummy.setFogOff()
     
     self.flash = loader.loadModel('models/effects/lanternGlow')
     self.flash.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
     self.flash.setDepthWrite(0)
     self.flash.setFogOff()
     self.flash.setColorScale(self.startCol)
     self.flash.setBillboardPointEye(0.20000000000000001)
     self.flash.setBin('fixed', 120)
     self.flash.setScale(25)
     self.flash.reparentTo(self)
     self.flash.hide()
     self.f = ParticleEffect.ParticleEffect('PistolFlame')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('frict')
     force0 = LinearFrictionForce(1.0, 10.0, 1.0)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
 def destroy(self):
     if self.fireSfxIval:
         self.fireSfxIval.pause()
         self.fireSfxIval = None
     
     EffectController.destroy(self)
     PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.effectModel = loader.loadModel('models/effects/soulspiral')
     self.effectModel2 = loader.loadModel('models/effects/soulspiral')
     self.effectModel3 = loader.loadModel('models/effects/soulspiral')
     self.effectModel4 = loader.loadModel('models/effects/soulspiral')
     self.effectModel.setColorScaleOff()
     self.effectModel2.setColorScaleOff()
     self.effectModel.reparentTo(self)
     self.effectModel2.reparentTo(self)
     self.effectModel3.reparentTo(self.effectModel)
     self.effectModel4.reparentTo(self.effectModel2)
     self.effectModel.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
     self.effectModel2.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
     self.effectModel.setScale(0.20000000000000001, 0.20000000000000001, 0.20000000000000001)
     self.effectModel2.setTwoSided(1)
     self.effectModel2.setScale(0.16, 0.16, 0.17999999999999999)
     self.effectModel2.setH(25)
     self.setDepthWrite(0)
     self.setLightOff()
     self.setColorScaleOff()
     self.effectColor = Vec4(1, 1, 1, 1)
     texture = self.effectModel.findAllTextures()[0]
     texture.setBorderColor(VBase4(0.0, 0.0, 0.0, 0.0))
     texture.setWrapU(Texture.WMBorderColor)
     texture.setWrapV(Texture.WMBorderColor)
Esempio n. 12
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleFlameSmoke')
     self.speed = 20.0
     if not ExplosionCloud.particleDummy:
         ExplosionCloud.particleDummy = render.attachNewNode(ModelNode('ExplosionCloudParticleDummy'))
         ExplosionCloud.particleDummy.setDepthWrite(0)
         ExplosionCloud.particleDummy.setLightOff()
         ExplosionCloud.particleDummy.setColorScaleOff()
         ExplosionCloud.particleDummy.setFogOff()
     
     self.f = ParticleEffect.ParticleEffect('ExplosionCloud')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Noise')
     force0 = LinearNoiseForce(0.5, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
Esempio n. 13
0
 def destroy(self):
     self.stop()
     del self.track
     del self.playProjectile
     self.removeNode()
     self.ignore(self.weaponHitEvent)
     PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleGreenBlood')
     if not self.splashSfx:
         for audio in self.SfxNames:
             self.splashSfx.append(loadSfx(audio))
         
     
     if not GreenBlood.particleDummy:
         GreenBlood.particleDummy = render.attachNewNode(ModelNode('GreenBloodParticleDummy'))
         GreenBlood.particleDummy.setDepthWrite(0)
     
     self.f = ParticleEffect.ParticleEffect('GreenBlood')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -20.0), 1.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
Esempio n. 15
0
 def destroy(self):
     if self.loopEffect:
         self.loopEffect.finish()
         self.loopEffect = None
     
     EffectController.destroy(self)
     PooledEffect.destroy(self)
Esempio n. 16
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleSpark')
     if not Sparks.particleDummy:
         Sparks.particleDummy = render.attachNewNode(ModelNode('SparksParticleDummy'))
         Sparks.particleDummy.setDepthWrite(0)
         Sparks.particleDummy.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
         Sparks.particleDummy.setFogOff()
         Sparks.particleDummy.setLightOff()
         Sparks.particleDummy.setBin('fixed', 120)
     
     self.f = ParticleEffect.ParticleEffect('Sparks')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('RingEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -6.5), 2.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     if not self.soundFx:
         for audio in self.soundFxNames:
             self.soundFx.append(loadSfx(audio))
         
     
     self.fadeTime = 0.14000000000000001
     self.waitTime = 0.20000000000000001
     self.startScale = 1.0
     self.endScale = 1.01
     self.fadeColor = Vec4(1.0, 1.0, 1.0, 1.0)
     self.flashDummy = self.attachNewNode('FlashDummy')
     self.flashDummy.setBillboardPointEye()
     self.flashDummy.setDepthWrite(0)
     self.flashDummy.setColorScaleOff()
     self.flashDummy.setFogOff()
     self.flashDummy.setLightOff()
     self.flashDummy.reparentTo(self)
     self.flashDummy.setScale(self.startScale)
     self.flashDummy.hide()
     self.flashDummy.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne))
     self.flasha = loader.loadModel('models/effects/lightning_strike')
     self.flasha.reparentTo(self.flashDummy)
     self.flashb = loader.loadModel('models/effects/lightning_strike')
     self.flashb.reparentTo(self.flasha)
Esempio n. 18
0
 def __init__(self):
     PooledEffect.__init__(self)
     self.collSphereRadius = 2.0
     self.startPos = Vec3(0, 0, 0)
     self.transNode = self.attachNewNode("trans")
     self.track = None
     self.playRotate = None
     filePrefix = DebrisDict.get(str(random.randint(0, 3)))
     self.debris = loader.loadModel(filePrefix)
     self.debris.reparentTo(self.transNode)
     self.debris.setScale(0.5)
     self.debris.setColorScale(0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1.0)
     self.weaponHitEvent = "weaponHit" + str(id(self))
     self.accept(self.weaponHitEvent, self.weaponHitObject)
     self.collSphere = CollisionSphere(0, 0, 0, self.collSphereRadius)
     self.cnode = CollisionNode("collSphere")
     self.cnode.addSolid(self.collSphere)
     self.collision = self.transNode.attachNewNode(self.cnode)
     self.cnode.setFromCollideMask(PiratesGlobals.TargetBitmask)
     self.cnode.setIntoCollideMask(BitMask32.allOff())
     self.collHandler = CollisionHandlerEvent()
     self.collHandler.addInPattern(self.weaponHitEvent)
     self.radiusDist = 50
     self.minHeight = 100
     self.maxHeight = 140
     self.velocityX = 0
     self.velocityY = 0
Esempio n. 19
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.objects = []
     self.objIvals = Parallel()
     self.effectScale = 1.0
     self.effectDummy = self.attachNewNode("effectDummy")
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/pir_t_efx_msc_lavaSplash')
     self.radius = 8.0
     self.effectScale = 1.0
     if not Explosion.particleDummy:
         Explosion.particleDummy = render.attachNewNode(ModelNode('ExplosionParticleDummy'))
         Explosion.particleDummy.setDepthWrite(0)
         Explosion.particleDummy.setLightOff()
         Explosion.particleDummy.setFogOff()
         Explosion.particleDummy.setColorScaleOff()
         Explosion.particleDummy.setBin('fixed', 120)
     
     self.f = ParticleEffect.ParticleEffect('Explosion')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(16)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.0)
     self.p0.factory.setLifespanSpread(0.25)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(180.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(20.0)
     self.p0.factory.setAngularVelocitySpread(5.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OOneMinusFbufferAlpha, ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(2.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 5.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectRadius(self.radius)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel("models/effects/particleMaps")
     self.card = model.find("**/particleDarkSmoke")
     self.setDepthWrite(0)
     self.setLightOff()
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect("VoodooGlow")
     self.f.reparentTo(self)
     self.p0 = Particles.Particles("particles-1")
     self.p0.setFactory("ZSpinParticleFactory")
     self.p0.setRenderer("SpriteParticleRenderer")
     self.p0.setEmitter("PointEmitter")
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(0.20000000000000001)
     self.p0.factory.setLifespanSpread(0.10000000000000001)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setColorBlendMode(
         ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne
     )
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(1.0, 1.0, 1.0, 1.0), Vec4(0.5, 0.20000000000000001, 1.0, 0.40000000000000002), 1
     )
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setInitialXScale(0.002 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.02 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.002 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.029999999999999999 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(0.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
Esempio n. 22
0
 def destroy(self):
     self.stop()
     if self.track:
         self.track = None
     
     self.removeNode()
     EffectController.destroy(self)
     PooledEffect.destroy(self)
    def destroy(self):
        self.stopAnimate()
        self.wake.removeNode()
        self.bowWave.removeNode()
        if self.shadow != None:
            self.shadow.removeNode()

        PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleEvilSmoke')
     self.effectScale = 1.0
     if not self.particleDummy:
         self.particleDummy = render.attachNewNode(ModelNode('selfParticleDummy'))
         self.particleDummy.setDepthWrite(0)
         self.particleDummy.setColorScaleOff()
         self.particleDummy.setLightOff()
         self.particleDummy.setFogOff()
         self.particleDummy.hide(OTPRender.ShadowCameraBitmask)
     
     self.f = ParticleEffect.ParticleEffect('VoodooPestilence')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     self.f.setP(90.0)
     self.p0.setPoolSize(256)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(3)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(0)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.2)
     self.p0.factory.setLifespanSpread(0.20000000000000001)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(300.0)
     self.p0.factory.setAngularVelocitySpread(25.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OOneMinusFbufferAlpha, ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p0.renderer.getColorInterpolationManager().addLinear(0.0, 1.0, Vec4(1.0, 1.0, 1.0, 1.0), Vec4(0.10000000000000001, 0.20000000000000001, 0.10000000000000001, 0.5), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(0.29999999999999999)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -0.45000000000000001))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(0.01)
Esempio n. 25
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     if not DarkAura.particleDummy:
         DarkAura.particleDummy = render.attachNewNode(ModelNode('DarkAuraParticleDummy'))
         DarkAura.particleDummy.setDepthWrite(0)
         DarkAura.particleDummy.setFogOff()
         DarkAura.particleDummy.setBin('fixed', 120)
     
     model = loader.loadModel('models/effects/darkglow')
     self.card = model.find('**/effectDarkGlow2')
     self.f = ParticleEffect.ParticleEffect('DarkAura')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Noise')
     force0 = LinearNoiseForce(0.10000000000000001, 0)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.20000000000000001)
     self.p0.setLitterSize(3)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.5)
     self.p0.factory.setLifespanSpread(0.0)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.80000000000000004)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(0.29999999999999999)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setInitialXScale(0.01 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.001 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.01 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.001 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor, ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(0.20000000000000001)
     self.p0.emitter.setAmplitudeSpread(0.10000000000000001)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.10000000000000001))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(0.80000000000000004)
Esempio n. 26
0
 def __init__(self, effectParent = None):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     if effectParent:
         self.reparentTo(effectParent)
     
     self.duration = 10.0
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleFire2')
     self.setDepthWrite(0)
     self.setFogOff()
     self.setLightOff()
     self.setColorScaleOff()
     self.setBin('fixed', 60)
     self.f = ParticleEffect.ParticleEffect('ShipFire')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('LineEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(48)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.setFloorZ(-1.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.setLifespanBase(0.75)
     self.p0.factory.setLifespanSpread(0.25)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(350.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 0.90000000000000002, 0.90000000000000002, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p0.renderer.getColorInterpolationManager().addLinear(0.0, 1.0, Vec4(1.0, 0.59999999999999998, 0.20000000000000001, 1.0), Vec4(0.5, 0.20000000000000001, 0.20000000000000001, 0.5), 1)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-0.75)
     self.p0.emitter.setAmplitudeSpread(0.25)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 10.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(1.0)
Esempio n. 27
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleSmoke')
     self.transparency = 0.25
     self.setDepthWrite(0)
     self.setFogOff()
     self.setLightOff()
     self.setColorScaleOff()
     self.effectScale = 0.59999999999999998
     self.duration = 1.0
     self.f = ParticleEffect.ParticleEffect('GhostAura')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('BoxEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(48)
     self.p0.setBirthRate(0.074999999999999997)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.setFloorZ(-1.0)
     self.p0.factory.setLifespanBase(1.1000000000000001)
     self.p0.factory.setLifespanSpread(0.25)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(0.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(0.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(50.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-0.5)
     self.p0.emitter.setAmplitudeSpread(0.17999999999999999)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 5.0))
     self.p0.emitter.setMinBound(Point3(-1.0, -1.0, -0.5))
     self.p0.emitter.setMaxBound(Point3(1.0, 1.0, 7.0))
     self.setEffectScale(1.0)
    def __init__(self):
        PooledEffect.__init__(self)
        self.taskName = None
        self.u = 0.0
        self.pastForwardVelocity = []
        self.pastRotationalVelocity = []
        self.wake = Actor.Actor('models/sea/wake_zero', {
            'still': 'models/sea/wake_still' })
        self.wake.hide(OTPRender.MainCameraBitmask)
        self.wake.showThrough(OTPRender.EnviroCameraBitmask)
        self.bend = self.wake.controlJoint(None, 'modelRoot', 'def_wake_2')
        self.wake.controlJoint(self.bend, 'modelRoot', 'def_wake_3')
        self.wake.controlJoint(self.bend, 'modelRoot', 'def_wake_4')
        self.wake.loop('still')
        self.bowWave = NodePath('bowWave')
        if hasattr(base, 'pe'):
            spn = SeaPatchNode('spn', base.pe.seaPatch.patch)
        else:
            spn = SeaPatchNode('spn', base.cr.activeWorld.getWater().patch)
        spn.setWantColor(0)
        spn.setWantUv(0)
        spn.setWantNormal(0)
        spn.setWantReflect(0)
        self.spNP = self.wake.getGeomNode().getChild(0).attachNewNode(spn)
        self.wake.find('**/wake1').reparentTo(self.spNP)
        self.wake.find('**/wake2').reparentTo(self.spNP)
        spn.collectGeometry()
        self.use_water_bin = True
        self.use_depth_offset = False
        if self.use_water_bin:
            self.spNP.setBin('water', 9)
            if self.use_depth_offset:
                depth_offset = DepthOffsetAttrib.make(5)
                self.spNP.setAttrib(depth_offset)

        else:
            self.wake.setBin('ground', -7)
            self.bowWave.setBin('fixed', 0)
            self.spNP.setBin('ground', -5)
        if self.use_depth_offset:
            pass
        1
        self.spNP.setDepthTest(0)
        self.wake.setAttrib(ColorWriteAttrib.make(ColorWriteAttrib.CRed | ColorWriteAttrib.CGreen | ColorWriteAttrib.CBlue))
        if hasattr(base, 'pe'):
            spn.setEffect(CompassEffect.make(base.pe.seaPatch.patchNP, CompassEffect.PZ))
        else:
            spn.setEffect(CompassEffect.make(base.cr.activeWorld.getWater().patchNP, CompassEffect.PZ))
        if self.use_water_bin:
            mask = 0xFFFFFFFFL
            stencil = StencilAttrib.make(1, StencilAttrib.SCFEqual, StencilAttrib.SOKeep, StencilAttrib.SOKeep, StencilAttrib.SOKeep, 1, mask, mask)
            self.spNP.setAttrib(stencil)
            if not base.useStencils:
                self.spNP.hide()


        self.shadow = None
Esempio n. 29
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.card = loader.loadModel('phase_4/models/props/icecream')
     self.cardScale = 18.0
     self.setDepthWrite(0)
     self.setColorScaleOff()
     self.setLightOff()
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect('IceCream')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-0')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -0.25), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.040000000000000001)
     self.p0.setLitterSize(64)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(3.25)
     self.p0.factory.setLifespanSpread(1.0)
     self.p0.factory.setMassBase(0.5)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(100.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(2)
     self.p0.renderer.setYScaleFlag(2)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectColor(self.effectColor)
Esempio n. 30
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.numTrails = 5
     self.trails = []
     self.trailEffects = []
     self.trailIval = Parallel()
Esempio n. 31
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
Esempio n. 32
0
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleWhiteSmoke')
        self.speed = 20.0
        self.radius = 8.0
        if not SmokeBomb.particleDummy:
            SmokeBomb.particleDummy = render.attachNewNode(
                ModelNode('SmokeBombParticleDummy'))
            SmokeBomb.particleDummy.setDepthWrite(0)
            SmokeBomb.particleDummy.setLightOff()
            SmokeBomb.particleDummy.setFogOff()
            SmokeBomb.particleDummy.setBin('fixed', 120)

        self.f = ParticleEffect.ParticleEffect('SmokeBomb')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('PointParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereSurfaceEmitter')
        self.f.addParticles(self.p0)
        f0 = ForceGroup.ForceGroup('Gravity')
        force0 = LinearVectorForce(Vec3(0.0, 0.0, -15.0), 1.0, 0)
        force0.setVectorMasks(1, 1, 1)
        force0.setActive(1)
        f0.addForce(force0)
        self.f.addForceGroup(f0)
        f1 = ForceGroup.ForceGroup('Noise')
        force1 = LinearNoiseForce(0.5, 0)
        force1.setVectorMasks(1, 1, 1)
        force1.setActive(1)
        f1.addForce(force1)
        self.f.addForceGroup(f1)
        self.p0.setPoolSize(128)
        self.p0.setBirthRate(0.01)
        self.p0.setLitterSize(5)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(2.5)
        self.p0.factory.setLifespanSpread(0.5)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(
            Vec4(0.80000000000000004, 0.80000000000000004, 0.80000000000000004,
                 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(0)
        self.p0.renderer.setInitialXScale(0.050000000000000003 *
                                          self.cardScale)
        self.p0.renderer.setFinalXScale(0.25 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.10000000000000001 * self.cardScale)
        self.p0.renderer.setFinalYScale(0.20000000000000001 * self.cardScale)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.setColorBlendMode(
            ColorBlendAttrib.MAdd, ColorBlendAttrib.OOneMinusFbufferAlpha,
            ColorBlendAttrib.OOneMinusIncomingAlpha)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 0.80000000000000004, Vec4(0.75, 0.75, 0.75, 1.0),
            Vec4(0.40000000000000002, 0.40000000000000002, 0.20000000000000001,
                 0.5), 1)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.80000000000000004, 1.0,
            Vec4(0.40000000000000002, 0.40000000000000002, 0.20000000000000001,
                 0.5), Vec4(0.0, 0.0, 0.0, 0.0), 1)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(10.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 4.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadius(8.0)
Esempio n. 33
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/effectSoftGlow')
     self.card2 = model.find('**/particleFire')
     self.speed = 20.0
     self.setDepthWrite(0)
     self.setLightOff()
     self.f = ParticleEffect.ParticleEffect('HellFire')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('RingEmitter')
     self.p1 = Particles.Particles('particles-2')
     self.p1.setFactory('ZSpinParticleFactory')
     self.p1.setRenderer('SpriteParticleRenderer')
     self.p1.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     self.f.addParticles(self.p1)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.029999999999999999)
     self.p0.setLitterSize(16)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.5)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setInitialXScale(0.014999999999999999 *
                                       self.cardScale)
     self.p0.renderer.setFinalXScale(0.029999999999999999 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.014999999999999999 *
                                       self.cardScale)
     self.p0.renderer.setFinalYScale(0.029999999999999999 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(
         ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor,
         ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(1.0, 0.34999999999999998, 0.0, 1.0),
         Vec4(0.0, 0.0, 0.0, 0.0), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(10.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -4.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(0.5)
     self.p1.setPoolSize(128)
     self.p1.setBirthRate(0.20000000000000001)
     self.p1.setLitterSize(1)
     self.p1.setLitterSpread(0)
     self.p1.setSystemLifespan(0.0)
     self.p1.setLocalVelocityFlag(1)
     self.p1.setSystemGrowsOlderFlag(0)
     self.p1.factory.setLifespanBase(1.2)
     self.p1.factory.setLifespanSpread(0.5)
     self.p1.factory.setMassBase(1.0)
     self.p1.factory.setMassSpread(0.20000000000000001)
     self.p1.factory.setTerminalVelocityBase(400.0)
     self.p1.factory.setTerminalVelocitySpread(0.0)
     self.p1.factory.setInitialAngle(0.0)
     self.p1.factory.setInitialAngleSpread(20.0)
     self.p1.factory.enableAngularVelocity(1)
     self.p1.factory.setAngularVelocity(0.0)
     self.p1.factory.setAngularVelocitySpread(0.0)
     self.p1.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p1.renderer.setUserAlpha(1.0)
     self.p1.renderer.setFromNode(self.card2)
     self.p1.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p1.renderer.setXScaleFlag(1)
     self.p1.renderer.setYScaleFlag(1)
     self.p1.renderer.setAnimAngleFlag(1)
     self.p1.renderer.setInitialXScale(0.02 * self.cardScale)
     self.p1.renderer.setInitialYScale(0.02 * self.cardScale)
     self.p1.renderer.setFinalXScale(0.001 * self.cardScale)
     self.p1.renderer.setFinalYScale(0.001 * self.cardScale)
     self.p1.renderer.setNonanimatedTheta(0.0)
     self.p1.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPNOBLEND)
     self.p1.renderer.setAlphaDisable(0)
     self.p1.renderer.setColorBlendMode(
         ColorBlendAttrib.MAdd, ColorBlendAttrib.OOneMinusFbufferAlpha,
         ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p1.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(1.0, 1.0, 1.0, 1.0), Vec4(0, 0, 0, 1.0), 1)
     self.p1.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p1.emitter.setAmplitude(1.5)
     self.p1.emitter.setAmplitudeSpread(0.5)
     self.p1.emitter.setOffsetForce(Vec3(0.0, 0.0, 10.0))
     self.p1.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p1.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p1.emitter.setRadius(0.5)
Esempio n. 34
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel(
         'phase_4/models/props/tt_m_efx_ext_fireworkCards')
     self.card = model.find('**/tt_t_efx_ext_particleStars')
     self.cardScale = 64.0
     self.setDepthWrite(0)
     self.setColorScaleOff()
     self.setLightOff()
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect('StarBurst')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-0')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -25.0), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.04)
     self.p0.setLitterSize(64)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.25)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(360.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 0.1, Vec4(0, 0, 0, 0), self.effectColor, 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectColor(self.effectColor)
Esempio n. 35
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleFire2')
     self.setDepthWrite(0)
     self.setFogOff()
     self.setLightOff()
     self.setColorScaleOff()
     self.effectScale = 1.0
     self.duration = 0.0
     self.f = ParticleEffect.ParticleEffect('Flame')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(6)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.setFloorZ(-1.0)
     self.p0.factory.setLifespanBase(0.75)
     self.p0.factory.setLifespanSpread(0.25)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(0.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(350.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(1.0, 0.59999999999999998, 0.20000000000000001, 1.0),
         Vec4(0.59999999999999998, 0.20000000000000001, 0.20000000000000001,
              0.5), 1)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-0.75)
     self.p0.emitter.setAmplitudeSpread(0.25)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 15.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(5.0)
Esempio n. 36
0
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleFlameSmoke')
        self.speed = 20.0
        if not FireballHit.particleDummy:
            FireballHit.particleDummy = render.attachNewNode(
                ModelNode('FireballHitParticleDummy'))
            FireballHit.particleDummy.setDepthWrite(0)
            FireballHit.particleDummy.setLightOff()
            FireballHit.particleDummy.setColorScaleOff()

        self.f = ParticleEffect.ParticleEffect('FireballHit')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('PointParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereSurfaceEmitter')
        self.f.addParticles(self.p0)
        self.p0.setPoolSize(128)
        self.p0.setBirthRate(0.029999999999999999)
        self.p0.setLitterSize(6)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(1.25)
        self.p0.factory.setLifespanSpread(0.25)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(1)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1, 1, 1, 1))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(0)
        self.p0.renderer.setInitialXScale(0.01 * self.cardScale)
        self.p0.renderer.setFinalXScale(0.01 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.014999999999999999 *
                                          self.cardScale)
        self.p0.renderer.setFinalYScale(0.014999999999999999 * self.cardScale)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.setColorBlendMode(
            ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor,
            ColorBlendAttrib.OOneMinusIncomingAlpha)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0,
            Vec4(0.80000000000000004, 0.65000000000000002, 0.65000000000000002,
                 0.5), Vec4(0.0, 0.0, 0.0, 0.0), 1)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(1.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadius(2.0)
Esempio n. 37
0
 def destroy(self):
     self.icon.detachNode()
     self.icon = None
     EffectController.destroy(self)
     PooledEffect.destroy(self)
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel(
         'phase_4/models/props/tt_m_efx_ext_fireworkCards')
     self.card = model.find('**/tt_t_efx_ext_particleSpark_soft')
     self.cardScale = 16.0
     self.setDepthWrite(0)
     self.setColorScaleOff()
     self.setLightOff()
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect('NoiseSparkles')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-2')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, 10.0), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     f1 = ForceGroup.ForceGroup('Noise')
     self.noiseForce = LinearNoiseForce(10.0, 0.0)
     self.noiseForce.setVectorMasks(1, 1, 1)
     self.noiseForce.setActive(0)
     f1.addForce(self.noiseForce)
     self.f.addForceGroup(f1)
     self.p0.setPoolSize(150)
     self.p0.setBirthRate(0.02)
     self.p0.setLitterSize(50)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.0)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAUSER)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectColor(self.effectColor)
Esempio n. 39
0
 def __init__(self, parent=None):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     if parent is not None:
         self.reparentTo(parent)
     self._accelerateTime = 0
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleBlackSmoke')
     if not BlackSmoke.particleDummy:
         BlackSmoke.particleDummy = base.effectsRoot.attachNewNode(
             ModelNode('BlackSmokeParticleDummy'))
         BlackSmoke.particleDummy.setDepthWrite(0)
         BlackSmoke.particleDummy.setColorScaleOff()
         BlackSmoke.particleDummy.setLightOff()
     self.duration = 10.0
     self.f = ParticleEffect.ParticleEffect('BlackSmoke')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.25)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.setFloorZ(-5.0)
     self.p0.factory.setLifespanBase(2.5)
     self.p0.factory.setLifespanSpread(1.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.2)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(30.0)
     self.p0.factory.enableAngularVelocity(0)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(0.8)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setInitialXScale(0.13 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.13 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.4 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.4 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPNOBLEND)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETCUSTOM)
     self.p0.emitter.setAmplitude(3.0)
     self.p0.emitter.setAmplitudeSpread(1.5)
     self.p0.emitter.setOffsetForce(Vec3(2.0, 2.0, 25.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 1.0))
     self.p0.emitter.setRadius(4.0)
     return
Esempio n. 40
0
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleCards')
        self.card = model.find('**/particleStars')
        self.cardScale = 64.0
        self.effectColor = Vec4(1, 1, 1, 1)
        self.effectScale = 1.0
        self.lifespan = 2.0
        if not SparksTrailLong.particleDummy:
            SparksTrailLong.particleDummy = render.attachNewNode(
                ModelNode('SparksTrailLongParticleDummy'))
            SparksTrailLong.particleDummy.setDepthWrite(0)

        self.f = ParticleEffect.ParticleEffect('SparksTrailLong')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('ZSpinParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('PointEmitter')
        self.f.addParticles(self.p0)
        f0 = ForceGroup.ForceGroup('Gravity')
        force0 = LinearVectorForce(Vec3(0.0, 0.0, -5.0), 1.0, 0)
        force0.setVectorMasks(1, 1, 1)
        force0.setActive(1)
        f0.addForce(force0)
        self.f.addForceGroup(f0)
        self.p0.setPoolSize(128)
        self.p0.setBirthRate(0.02)
        self.p0.setLitterSize(1)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(0)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(self.lifespan)
        self.p0.factory.setLifespanSpread(0.10000000000000001)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.factory.setInitialAngle(0.0)
        self.p0.factory.setInitialAngleSpread(90.0)
        self.p0.factory.enableAngularVelocity(1)
        self.p0.factory.setAngularVelocity(0.0)
        self.p0.factory.setAngularVelocitySpread(25.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                           ColorBlendAttrib.OIncomingAlpha,
                                           ColorBlendAttrib.OOne)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -2.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.setEffectScale(self.effectScale)
Esempio n. 41
0
 def __init__(self, parent=None):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     if parent is not None:
         self.reparentTo(parent)
     if not JRTeleportEffect.particleDummy:
         JRTeleportEffect.particleDummy = render.attachNewNode(ModelNode('JRTeleportEffectParticleDummy'))
         JRTeleportEffect.particleDummy.setColorScaleOff()
         JRTeleportEffect.particleDummy.setLightOff()
         JRTeleportEffect.particleDummy.setFogOff()
         JRTeleportEffect.particleDummy.setDepthWrite(0)
         JRTeleportEffect.particleDummy.setBin('fixed', 40)
     self.effectScale = 1.0
     self.duration = 3.0
     self.radius = 1.0
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleEvilSmoke')
     self.card2 = model.find('**/particleWhiteSmoke')
     self.f = ParticleEffect.ParticleEffect('JRTeleportEffect')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.p1 = Particles.Particles('particles-2')
     self.p1.setFactory('ZSpinParticleFactory')
     self.p1.setRenderer('SpriteParticleRenderer')
     self.p1.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     self.f.addParticles(self.p1)
     f1 = ForceGroup.ForceGroup('Noise')
     force1 = LinearNoiseForce(0.5, 0)
     force1.setVectorMasks(0, 1, 1)
     force1.setActive(1)
     f1.addForce(force1)
     self.f.addForceGroup(f1)
     self.p0.setPoolSize(256)
     self.p0.setBirthRate(0.05)
     self.p0.setLitterSize(24)
     self.p0.setLitterSpread(8)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.25)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(4.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(90.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(500.0)
     self.p0.factory.setAngularVelocitySpread(100.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p0.renderer.getColorInterpolationManager().addLinear(0.0, 0.6, Vec4(1.0, 1.0, 0.2, 1.0), Vec4(0.8, 0.6, 0.25, 0.75), 1)
     self.p0.renderer.getColorInterpolationManager().addLinear(0.6, 1.0, Vec4(0.8, 0.6, 0.25, 0.75), Vec4(0.5, 0.25, 0.0, 0.0), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, -5.0))
     self.p1.setPoolSize(150)
     self.p1.setBirthRate(0.01)
     self.p1.setLitterSize(3)
     self.p1.setLitterSpread(0)
     self.p1.setSystemLifespan(0.0)
     self.p1.setLocalVelocityFlag(1)
     self.p1.setSystemGrowsOlderFlag(0)
     self.p1.factory.setLifespanBase(1.0)
     self.p1.factory.setLifespanSpread(0.0)
     self.p1.factory.setMassBase(1.0)
     self.p1.factory.setMassSpread(0.0)
     self.p1.factory.setTerminalVelocityBase(400.0)
     self.p1.factory.setTerminalVelocitySpread(0.0)
     self.p1.factory.setInitialAngle(0.0)
     self.p1.factory.setInitialAngleSpread(45.0)
     self.p1.factory.enableAngularVelocity(0)
     self.p1.factory.setFinalAngle(360.0)
     self.p1.factory.setFinalAngleSpread(0.0)
     self.p1.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p1.renderer.setUserAlpha(1.0)
     self.p1.renderer.setFromNode(self.card2)
     self.p1.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p1.renderer.setXScaleFlag(1)
     self.p1.renderer.setYScaleFlag(1)
     self.p1.renderer.setAnimAngleFlag(1)
     self.p1.renderer.setNonanimatedTheta(0.0)
     self.p1.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPBLENDLINEAR)
     self.p1.renderer.setAlphaDisable(0)
     self.p1.renderer.setColorBlendMode(ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingAlpha, ColorBlendAttrib.OOne)
     self.p1.renderer.getColorInterpolationManager().addLinear(0.0, 0.5, Vec4(1.0, 1.0, 0.2, 1.0), Vec4(0.8, 0.6, 0.25, 0.75), 1)
     self.p1.renderer.getColorInterpolationManager().addLinear(0.5, 1.0, Vec4(0.8, 0.6, 0.25, 0.75), Vec4(0.5, 0.25, 0.0, 0.5), 1)
     self.p1.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p1.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p1.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     return
Esempio n. 42
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleFire2')
     if not self.burningSfx:
         self.burningSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)
     self.fireSfxIval = None
     if not BlueFlame.particleDummy:
         BlueFlame.particleDummy = render.attachNewNode(
             ModelNode('BurpEffectParticleDummy'))
         BlueFlame.particleDummy.setDepthWrite(0)
         BlueFlame.particleDummy.setFogOff()
         BlueFlame.particleDummy.setLightOff()
         BlueFlame.particleDummy.setColorScaleOff()
         BlueFlame.particleDummy.setTwoSided(1)
     self.f = ParticleEffect.ParticleEffect('FlamingSkull')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.2)
     self.p0.setLitterSize(1)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(0)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.2)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.2)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(20.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(0.0)
     self.p0.factory.setAngularVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setInitialXScale(0.0018 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.0018 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.0001 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.0001 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(0.2, 0.6, 1.0, 1.0), Vec4(0.2, 0.2, 0.6, 0.5), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-0.75)
     self.p0.emitter.setAmplitudeSpread(0.5)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 4.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(0.5)
     return
Esempio n. 43
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.placeHolder = self.attachNewNode('grapeShotDummy')
     self.roundshots = []
     self.time = 2.0
Esempio n. 44
0
 def destroy(self):
     EffectController.destroy(self)
     PooledEffect.destroy(self)
Esempio n. 45
0
    def __init__(self, parent=None):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        if parent is not None:
            self.reparentTo(parent)

        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleWhiteSmoke')
        self.setDepthWrite(0)
        self.setColorScaleOff()
        self.setLightOff()
        self.setBin('fixed', 75)
        self.f = ParticleEffect.ParticleEffect('MysticSmoke')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-2')
        self.p0.setFactory('PointParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('RingEmitter')
        self.f.addParticles(self.p0)
        f0 = ForceGroup.ForceGroup('Gravity')
        force0 = LinearVectorForce(Vec3(0.0, 0.0, -8.0), 1.0, 0)
        force0.setVectorMasks(1, 1, 1)
        force0.setActive(1)
        f0.addForce(force0)
        self.f.addForceGroup(f0)
        self.p0.setPoolSize(128)
        self.p0.setBirthRate(0.01)
        self.p0.setLitterSize(1)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(1.8)
        self.p0.factory.setLifespanSpread(0.20000000000000001)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.20000000000000001)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(0.5)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(0)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setInitialXScale(0.025000000000000001 *
                                          self.cardScale)
        self.p0.renderer.setFinalXScale(0.10000000000000001 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.025000000000000001 *
                                          self.cardScale)
        self.p0.renderer.setFinalYScale(0.10000000000000001 * self.cardScale)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0, Vec4(0.5, 0.59999999999999998, 0.14999999999999999, 1.0),
            Vec4(0.59999999999999998, 0.75, 0.0, 0.0), 1)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETCUSTOM)
        self.p0.emitter.setAmplitude(5.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 5.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 10.0))
        self.p0.emitter.setRadius(2.0)
        self.p0.emitter.setRadiusSpread(0.0)
Esempio n. 46
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/fireworkCards')
     self.card = model.find('**/pir_t_efx_msc_particleSpark_soft')
     self.cardScale = 10.0
     self.effectModel = model.find('**/pir_t_efx_msc_particleStars')
     self.effectModel.reparentTo(self)
     self.effectModel.setColorScale(0, 0, 0, 0)
     self.setAttrib(
         ColorBlendAttrib.make(ColorBlendAttrib.MAdd,
                               ColorBlendAttrib.OIncomingAlpha,
                               ColorBlendAttrib.OOne))
     self.setBillboardPointWorld()
     self.setDepthWrite(0)
     self.setLightOff()
     self.setFogOff()
     self.effectScale = 1.0
     self.effectColor = Vec4(1, 1, 1, 1)
     self.f = ParticleEffect.ParticleEffect('FireStormRingEffect')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-2')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('RingEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('Gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -15.0), 1.0, 0)
     force0.setVectorMasks(1, 1, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     f1 = ForceGroup.ForceGroup('Noise')
     force1 = LinearNoiseForce(2.5, 0.0)
     force1.setVectorMasks(1, 1, 1)
     force1.setActive(1)
     f1.addForce(force1)
     self.f.addForceGroup(f1)
     self.p0.setPoolSize(60)
     self.p0.setBirthRate(0.1)
     self.p0.setLitterSize(60)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.0)
     self.p0.factory.setLifespanSpread(0.2)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setUniformEmission(60)
     self.setEffectScale(self.effectScale)
     self.setEffectColor(self.effectColor)
Esempio n. 47
0
 def __init__(self):
     PooledEffect.__init__(self)
     self.taskName = None
     self.u = 0.0
     self.pastForwardVelocity = []
     self.pastRotationalVelocity = []
     self.wake = Actor.Actor('models/sea/wake_zero',
                             {'still': 'models/sea/wake_still'})
     self.wake.hide(OTPRender.MainCameraBitmask)
     self.wake.showThrough(OTPRender.EnviroCameraBitmask)
     self.bend = self.wake.controlJoint(None, 'modelRoot', 'def_wake_2')
     self.wake.controlJoint(self.bend, 'modelRoot', 'def_wake_3')
     self.wake.controlJoint(self.bend, 'modelRoot', 'def_wake_4')
     self.wake.loop('still')
     self.bowWave = NodePath('bowWave')
     if hasattr(base, 'pe'):
         spn = SeaPatchNode('spn', base.pe.seaPatch.patch)
     else:
         spn = SeaPatchNode('spn', base.cr.activeWorld.getWater().patch)
     spn.setWantColor(0)
     spn.setWantUv(0)
     spn.setWantNormal(0)
     spn.setWantReflect(0)
     self.spNP = self.wake.getGeomNode().getChild(0).attachNewNode(spn)
     self.wake.find('**/wake1').reparentTo(self.spNP)
     self.wake.find('**/wake2').reparentTo(self.spNP)
     spn.collectGeometry()
     self.use_water_bin = True
     self.use_depth_offset = False
     if self.use_water_bin:
         self.spNP.setBin('water', 9)
         if self.use_depth_offset:
             depth_offset = DepthOffsetAttrib.make(5)
             self.spNP.setAttrib(depth_offset)
     else:
         self.wake.setBin('ground', -7)
         self.bowWave.setBin('fixed', 0)
         self.spNP.setBin('ground', -5)
     if self.use_depth_offset:
         pass
     else:
         self.spNP.setDepthTest(0)
     self.wake.setAttrib(
         ColorWriteAttrib.make(ColorWriteAttrib.CRed
                               | ColorWriteAttrib.CGreen
                               | ColorWriteAttrib.CBlue))
     if hasattr(base, 'pe'):
         spn.setEffect(
             CompassEffect.make(base.pe.seaPatch.patchNP, CompassEffect.PZ))
     else:
         spn.setEffect(
             CompassEffect.make(base.cr.activeWorld.getWater().patchNP,
                                CompassEffect.PZ))
     if self.use_water_bin:
         mask = 4294967295L
         stencil = StencilAttrib.make(1, StencilAttrib.SCFEqual,
                                      StencilAttrib.SOKeep,
                                      StencilAttrib.SOKeep,
                                      StencilAttrib.SOKeep, 1, mask, mask)
         self.spNP.setAttrib(stencil)
         if not base.useStencils:
             self.spNP.hide()
     self.shadow = None
     return
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleDarkSmoke')
        if not VoodooSouls.particleDummy:
            VoodooSouls.particleDummy = render.attachNewNode(
                ModelNode('VoodooSoulsParticleDummy'))
            VoodooSouls.particleDummy.setDepthWrite(0)
            VoodooSouls.particleDummy.setColorScaleOff()
            VoodooSouls.particleDummy.setLightOff()

        self.effectColor = Vec4(1, 1, 1, 1)
        self.f = ParticleEffect.ParticleEffect('VoodooSouls')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('ZSpinParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereVolumeEmitter')
        self.f.addParticles(self.p0)
        self.p0.setPoolSize(512)
        self.p0.setBirthRate(0.02)
        self.p0.setLitterSize(4)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(1.0)
        self.p0.factory.setLifespanSpread(0.25)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.factory.setInitialAngle(0.0)
        self.p0.factory.setInitialAngleSpread(90.0)
        self.p0.factory.enableAngularVelocity(1)
        self.p0.factory.setFinalAngle(900.0)
        self.p0.factory.setFinalAngleSpread(0.0)
        self.p0.factory.setAngularVelocity(300.0)
        self.p0.factory.setAngularVelocitySpread(100.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                           ColorBlendAttrib.OIncomingAlpha,
                                           ColorBlendAttrib.OOne)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 0.25, Vec4(1.0, 1.0, 1.0, 0.0), Vec4(1.0, 1.0, 1.0, 0.5), 1)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.25, 1.0, Vec4(1.0, 1.0, 1.0, 0.5),
            Vec4(0.5, 0.20000000000000001, 1.0, 0.0), 1)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setInitialXScale(0.001 * self.cardScale)
        self.p0.renderer.setFinalXScale(0.02 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.001 * self.cardScale)
        self.p0.renderer.setFinalYScale(0.02 * self.cardScale)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(4.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -3.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadius(1.0)
Esempio n. 49
0
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleSmoke')
        self.effectScale = 1.0
        if not ToxinEffect.particleDummy:
            ToxinEffect.particleDummy = render.attachNewNode(
                ModelNode('ToxinParticleDummy'))
            ToxinEffect.particleDummy.setDepthWrite(0)
            ToxinEffect.particleDummy.setLightOff()

        self.setDepthWrite(0)
        self.setLightOff()
        self.f = ParticleEffect.ParticleEffect('ToxinEffect')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('ZSpinParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereSurfaceEmitter')
        self.f.addParticles(self.p0)
        f0 = ForceGroup.ForceGroup('Gravity')
        force0 = LinearVectorForce(Vec3(0.0, 0.0, -2.0), 1.0, 0)
        force0.setVectorMasks(1, 1, 1)
        force0.setActive(1)
        f0.addForce(force0)
        self.f.addForceGroup(f0)
        f1 = ForceGroup.ForceGroup('Noise')
        force1 = LinearNoiseForce(0.10000000000000001, 0)
        force1.setVectorMasks(1, 1, 1)
        force1.setActive(1)
        f1.addForce(force1)
        self.f.addForceGroup(f1)
        self.p0.setPoolSize(32)
        self.p0.setBirthRate(0.20000000000000001)
        self.p0.setLitterSize(1)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(0)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(1.5)
        self.p0.factory.setLifespanSpread(0.25)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.factory.setInitialAngle(0.0)
        self.p0.factory.setInitialAngleSpread(360.0)
        self.p0.factory.enableAngularVelocity(1)
        self.p0.factory.setAngularVelocity(50.0)
        self.p0.factory.setAngularVelocitySpread(25.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0, Vec4(0.80000000000000004, 0.59999999999999998, 1, 1),
            Vec4(0.20000000000000001, 0.10000000000000001, 0.25, 0.5), 1)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(1.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0, -0.5, 1.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
Esempio n. 50
0
 def destroy(self):
     self.glow.removeNode()
     EffectController.destroy(self)
     PooledEffect.destroy(self)
Esempio n. 51
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/pir_t_efx_msc_lavaSplash')
     self.radius = 8.0
     self.effectScale = 1.0
     if not Explosion.particleDummy:
         Explosion.particleDummy = render.attachNewNode(
             ModelNode('ExplosionParticleDummy'))
         Explosion.particleDummy.setDepthWrite(0)
         Explosion.particleDummy.setLightOff()
         Explosion.particleDummy.setFogOff()
         Explosion.particleDummy.setColorScaleOff()
         Explosion.particleDummy.setBin('fixed', 120)
     self.f = ParticleEffect.ParticleEffect('Explosion')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     self.p0.setPoolSize(16)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(2)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(1.0)
     self.p0.factory.setLifespanSpread(0.25)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(180.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(20.0)
     self.p0.factory.setAngularVelocitySpread(5.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(
         ColorBlendAttrib.MAdd, ColorBlendAttrib.OOneMinusFbufferAlpha,
         ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(2.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 5.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.setEffectScale(self.effectScale)
     self.setEffectRadius(self.radius)
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        self.modelParent = self.attachNewNode('ModelParent')
        model = loader.loadModel('models/effects/particleCards')
        self.effectModel = model.find('**/particleWhiteGlow')
        self.effectModel.reparentTo(self.modelParent)
        model = loader.loadModel('models/effects/particleCards')
        self.effectModel2 = model.find('**/particleWhiteGlow')
        self.effectModel2.reparentTo(self.modelParent)
        self.modelParent.setBillboardAxis(0)
        self.modelParent.setBillboardPointWorld()
        self.modelParent.setScale(1.3999999999999999)
        self.modelParent.setColorScale(0, 0, 0, 1.0)
        self.modelParent.setBin('fixed', 0)
        self.effectActor = Actor.Actor(
            'models/effects/mopath_none',
            {'spin': 'models/effects/mopath_spiral'})
        self.effectActor.setPlayRate(-1.6000000000000001, 'spin')
        self.effectActor.reparentTo(self)
        self.effectActor.setH(-90)
        self.effectActor.setPos(-0.59999999999999998, -0.20000000000000001, 0)
        self.effectActor.setScale(1, 1.2, 1)
        self.effectActor.setBin('fixed', 2)
        self.joint = self.effectActor.find('**/joint1')
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleEvilSmoke')
        if not self.particleDummy:
            self.particleDummy = render.attachNewNode(
                ModelNode('FlamingSkullParticleDummy'))
            self.particleDummy.setBin('fixed', 1)

        self.setDepthWrite(0)
        self.setFogOff()
        self.setLightOff()
        self.setColorScaleOff()
        self.hide(OTPRender.ShadowCameraBitmask)
        self.f = ParticleEffect.ParticleEffect('BlackspotCurseSword')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('ZSpinParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereVolumeEmitter')
        self.f.addParticles(self.p0)
        self.p0.setPoolSize(64)
        self.p0.setBirthRate(0.20000000000000001)
        self.p0.setLitterSize(1)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(1.2)
        self.p0.factory.setLifespanSpread(0.5)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.20000000000000001)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.factory.setInitialAngle(0.0)
        self.p0.factory.setInitialAngleSpread(90.0)
        self.p0.factory.enableAngularVelocity(1)
        self.p0.factory.setAngularVelocity(0.0)
        self.p0.factory.setAngularVelocitySpread(20.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setInitialXScale(0.001 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.0011999999999999999 *
                                          self.cardScale)
        self.p0.renderer.setFinalXScale(0.00029999999999999997 *
                                        self.cardScale)
        self.p0.renderer.setFinalYScale(0.00029999999999999997 *
                                        self.cardScale)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0, Vec4(0.5, 0.5, 0.5, 1.0), Vec4(0, 0, 0, 1.0), 1)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(-0.25)
        self.p0.emitter.setAmplitudeSpread(0.5)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 0.5))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadius(0.40000000000000002)
        self.f2 = ParticleEffect.ParticleEffect('BlackspotPestilence')
        self.f2.reparentTo(self)
        self.p1 = Particles.Particles('particles-1')
        self.p1.setFactory('ZSpinParticleFactory')
        self.p1.setRenderer('SpriteParticleRenderer')
        self.p1.setEmitter('SphereVolumeEmitter')
        self.f2.addParticles(self.p1)
        self.p1.setPoolSize(128)
        self.p1.setBirthRate(0.01)
        self.p1.setLitterSize(2)
        self.p1.setLitterSpread(0)
        self.p1.setSystemLifespan(0.0)
        self.p1.setLocalVelocityFlag(0)
        self.p1.setSystemGrowsOlderFlag(0)
        self.p1.factory.setLifespanBase(1.0)
        self.p1.factory.setLifespanSpread(0.20000000000000001)
        self.p1.factory.setMassBase(1.0)
        self.p1.factory.setMassSpread(0.0)
        self.p1.factory.setTerminalVelocityBase(400.0)
        self.p1.factory.setTerminalVelocitySpread(0.0)
        self.p1.factory.setInitialAngle(0.0)
        self.p1.factory.setInitialAngleSpread(360.0)
        self.p1.factory.enableAngularVelocity(1)
        self.p1.factory.setAngularVelocity(300.0)
        self.p1.factory.setAngularVelocitySpread(25.0)
        self.p1.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
        self.p1.renderer.setUserAlpha(1.0)
        self.p1.renderer.setFromNode(self.card)
        self.p1.renderer.setXScaleFlag(1)
        self.p1.renderer.setYScaleFlag(1)
        self.p1.renderer.setAnimAngleFlag(1)
        self.p1.renderer.setNonanimatedTheta(0.0)
        self.p1.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p1.renderer.setAlphaDisable(0)
        self.p1.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0, Vec4(0.5, 0.5, 0.5, 1.0), Vec4(0, 0, 0, 1.0), 1)
        self.p1.renderer.setInitialXScale(0.001 * self.cardScale2)
        self.p1.renderer.setFinalXScale(0.0001 * self.cardScale2)
        self.p1.renderer.setInitialYScale(0.001 * self.cardScale2)
        self.p1.renderer.setFinalYScale(0.0001 * self.cardScale2)
        self.p1.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p1.emitter.setAmplitude(0.20000000000000001)
        self.p1.emitter.setAmplitudeSpread(0.5)
        self.p1.emitter.setOffsetForce(Vec3(0.0, 0.0, -0.45000000000000001))
        self.p1.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p1.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p1.emitter.setRadius(0.01)
Esempio n. 53
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleRockShower')
     self.setDepthWrite(0)
     self.f = ParticleEffect.ParticleEffect('WoodShards')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('ZSpinParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereVolumeEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('frict')
     force0 = LinearFrictionForce(1, 3.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     f1 = ForceGroup.ForceGroup('gravity')
     force1 = LinearVectorForce(Vec3(0.0, 0.0, -40.0), 1.0, 1)
     force1.setActive(1)
     f1.addForce(force1)
     self.f.addForceGroup(f1)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.03)
     self.p0.setLitterSize(1)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.0)
     self.p0.factory.setLifespanSpread(0)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.95)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.factory.setInitialAngle(0.0)
     self.p0.factory.setInitialAngleSpread(180.0)
     self.p0.factory.enableAngularVelocity(1)
     self.p0.factory.setAngularVelocity(5.0)
     self.p0.factory.setAngularVelocitySpread(5.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(0.3, 0.2, 0, 1))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setInitialXScale(0.015 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.04 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.015 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.04 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPNOBLEND)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(2.0)
     self.p0.emitter.setAmplitudeSpread(2.0)
     self.p0.emitter.setOffsetForce(Vec3(5.0, 100.0, 30.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(0.5)
Esempio n. 54
0
 def destroy(self):
     EffectController.destroy(self)
     PooledEffect.destroy(self)
     self.adjustIval = None
     return
Esempio n. 55
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.setDepthWrite(0)
     self.setLightOff()
     self.effectColor = Vec4(1, 1, 1, 1)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleWhiteSteam')
     self.card2 = model.find('**/particleDarkSmoke')
     self.f = ParticleEffect.ParticleEffect('VoodooExplosion')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.p1 = Particles.Particles('particles-2')
     self.p1.setFactory('ZSpinParticleFactory')
     self.p1.setRenderer('SpriteParticleRenderer')
     self.p1.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     self.f.addParticles(self.p1)
     f0 = ForceGroup.ForceGroup('gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, -20.0), 1.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     f1 = ForceGroup.ForceGroup('Noise')
     force1 = LinearNoiseForce(2.0, 0)
     force1.setVectorMasks(0, 0, 1)
     force1.setActive(1)
     f1.addForce(force1)
     self.f.addForceGroup(f0)
     self.f.addForceGroup(f1)
     self.p0.setPoolSize(8)
     self.p0.setBirthRate(0.10000000000000001)
     self.p0.setLitterSize(8)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(3.5)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.25)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(0.34999999999999998)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(1)
     self.p0.renderer.setInitialXScale(0.01 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.40000000000000002 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.01 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.40000000000000002 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(0.0, 0.0, 0.0, 1.0),
         Vec4(0.20000000000000001, 0.10000000000000001, 0.59999999999999998,
              0.40000000000000002), 1)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETCUSTOM)
     self.p0.emitter.setAmplitude(1.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 10.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 1.0))
     self.p0.emitter.setRadius(0.75)
     self.p0.emitter.setOuterAngle(90.0)
     self.p0.emitter.setInnerAngle(0.0)
     self.p0.emitter.setOuterMagnitude(8.0)
     self.p0.emitter.setInnerMagnitude(0.0)
     self.p0.emitter.setCubicLerping(0)
     self.p1.setPoolSize(128)
     self.p1.setBirthRate(0.01)
     self.p1.setLitterSize(128)
     self.p1.setLitterSpread(0)
     self.p1.setSystemLifespan(0.0)
     self.p1.setLocalVelocityFlag(1)
     self.p1.setSystemGrowsOlderFlag(0)
     self.p1.factory.setLifespanBase(1.5)
     self.p1.factory.setLifespanSpread(0.75)
     self.p1.factory.setMassBase(4.0)
     self.p1.factory.setMassSpread(0.0)
     self.p1.factory.setTerminalVelocityBase(400.0)
     self.p1.factory.setTerminalVelocitySpread(0.0)
     self.p1.factory.setInitialAngle(0.0)
     self.p1.factory.setInitialAngleSpread(90.0)
     self.p1.factory.enableAngularVelocity(1)
     self.p1.factory.setAngularVelocity(500.0)
     self.p1.factory.setAngularVelocitySpread(100.0)
     self.p1.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p1.renderer.setUserAlpha(0.20000000000000001)
     self.p1.renderer.setFromNode(self.card2)
     self.p1.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p1.renderer.setXScaleFlag(1)
     self.p1.renderer.setYScaleFlag(1)
     self.p1.renderer.setAnimAngleFlag(1)
     self.p1.renderer.setInitialXScale(0.0030000000000000001 *
                                       self.cardScale)
     self.p1.renderer.setFinalXScale(0.025000000000000001 * self.cardScale)
     self.p1.renderer.setInitialYScale(0.0030000000000000001 *
                                       self.cardScale)
     self.p1.renderer.setFinalYScale(0.040000000000000001 * self.cardScale)
     self.p1.renderer.setNonanimatedTheta(0.0)
     self.p1.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p1.renderer.setAlphaDisable(0)
     self.p1.renderer.setColorBlendMode(
         ColorBlendAttrib.MAdd, ColorBlendAttrib.OIncomingColor,
         ColorBlendAttrib.OOneMinusIncomingAlpha)
     self.p1.renderer.getColorInterpolationManager().addLinear(
         0.0, 1.0, Vec4(1.0, 1.0, 1.0, 0.20000000000000001),
         Vec4(0.75, 0.59999999999999998, 1.0, 0), 1)
     self.p1.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p1.emitter.setAmplitude(1.0)
     self.p1.emitter.setAmplitudeSpread(0.0)
     self.p1.emitter.setOffsetForce(Vec3(0.0, 0.0, 5))
     self.p1.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p1.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p1.emitter.setRadius(0.10000000000000001)
Esempio n. 56
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleGlowBlue')
     self.faceCard = model.find('**/effectFury')
     self.faceCard.reparentTo(self)
     self.faceCard.setDepthWrite(0)
     self.faceCard.setLightOff()
     self.faceCard.setColorScale(0.0, 0.0, 0.0, 1.0)
     self.faceCard.setBillboardPointEye(3.0)
     self.faceCard.setScale(5.0)
     self.faceCard.setBin('fixed', 10)
     if not FuryTrail.particleDummy:
         FuryTrail.particleDummy = render.attachNewNode(
             ModelNode('FuryTrailParticleDummy'))
         FuryTrail.particleDummy.setDepthWrite(0)
         FuryTrail.particleDummy.setLightOff()
         FuryTrail.particleDummy.setBin('fixed', 0)
     self.f = ParticleEffect.ParticleEffect('FuryTrail')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('noise')
     force0 = LinearNoiseForce(1.5, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(32)
     self.p0.setBirthRate(0.01)
     self.p0.setLitterSize(1)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(0.3)
     self.p0.factory.setLifespanSpread(0.0)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.2)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setInitialXScale(0.13 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.13 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.05 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.05 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPNOBLEND)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-2.0)
     self.p0.emitter.setAmplitudeSpread(0.5)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 10.0))
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(1.0)
Esempio n. 57
0
    def __init__(self, effectParent=None):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        if effectParent:
            self.reparentTo(effectParent)

        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleFire2')
        if not self.burningSfx:
            self.burningSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)

        self.fireSfxIval = None
        if not Fire.particleDummy:
            Fire.particleDummy = base.effectsRoot.attachNewNode(
                ModelNode('FireParticleDummy'))
            Fire.particleDummy.setDepthWrite(0)
            Fire.particleDummy.setFogOff()
            Fire.particleDummy.setLightOff()
            Fire.particleDummy.setColorScaleOff()
            Fire.particleDummy.setBin('fixed', 60)

        self.duration = 10.0
        self.effectScale = 1.0
        self.f = ParticleEffect.ParticleEffect('Fire')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setPoolSize(96)
        self.p0.setBirthRate(0.01)
        self.p0.setLitterSize(4)
        self.p0.setFactory('ZSpinParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('DiscEmitter')
        self.f.addParticles(self.p0)
        self.p0.setPoolSize(96)
        self.p0.setBirthRate(0.01)
        self.p0.setLitterSize(4)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(1)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.setFloorZ(-1.0)
        self.p0.factory.setInitialAngle(0.0)
        self.p0.factory.setInitialAngleSpread(360.0)
        self.p0.factory.setLifespanBase(0.75)
        self.p0.factory.setLifespanSpread(0.25)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
        self.p0.renderer.setUserAlpha(1.0)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(
            BaseParticleRenderer.PPBLENDLINEAR)
        self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                           ColorBlendAttrib.OIncomingAlpha,
                                           ColorBlendAttrib.OOne)
        self.p0.renderer.getColorInterpolationManager().addLinear(
            0.0, 1.0, Vec4(1.0, 0.59999999999999998, 0.20000000000000001, 1.0),
            Vec4(0.5, 0.20000000000000001, 0.20000000000000001, 0.5), 1)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(-0.75)
        self.p0.emitter.setAmplitudeSpread(0.25)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 15.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.setScale(VBase3(self.effectScale, 1, 1))
Esempio n. 58
0
    def __init__(self):
        PooledEffect.__init__(self)
        EffectController.__init__(self)
        model = loader.loadModel('models/effects/particleMaps')
        self.card = model.find('**/particleGroundFog')
        if not BurpEffect.particleDummy:
            BurpEffect.particleDummy = render.attachNewNode(
                ModelNode('BurpEffectParticleDummy'))
            BurpEffect.particleDummy.setDepthWrite(0)
            BurpEffect.particleDummy.setFogOff()
            BurpEffect.particleDummy.setLightOff()
            BurpEffect.particleDummy.setColorScaleOff()
            BurpEffect.particleDummy.setTwoSided(1)

        self.icon = loader.loadModel('models/effects/skull')
        self.icon.setBillboardAxis(0.0)
        self.icon.setDepthWrite(0)
        self.icon.setFogOff()
        self.icon.setLightOff()
        self.icon.setColorScaleOff()
        self.icon.reparentTo(self)
        self.icon.setPos(self, 0, 0, -0.29999999999999999)
        self.icon.setBin('fixed', 65)
        self.icon.hide(OTPRender.ShadowCameraBitmask)
        self.f = ParticleEffect.ParticleEffect('BurpEffect')
        self.f.reparentTo(self)
        self.p0 = Particles.Particles('particles-1')
        self.p0.setFactory('PointParticleFactory')
        self.p0.setRenderer('SpriteParticleRenderer')
        self.p0.setEmitter('SphereSurfaceEmitter')
        self.f.addParticles(self.p0)
        f0 = ForceGroup.ForceGroup('gravity')
        force0 = LinearVectorForce(Vec3(0.0, 0.0, 0.5), 1.0, 0)
        force0.setVectorMasks(1, 1, 1)
        force0.setActive(1)
        f0.addForce(force0)
        force1 = LinearJitterForce(1.0, 0)
        force1.setVectorMasks(1, 1, 1)
        force1.setActive(1)
        f0.addForce(force1)
        self.f.addForceGroup(f0)
        self.p0.setPoolSize(128)
        self.p0.setBirthRate(0.10000000000000001)
        self.p0.setLitterSize(9)
        self.p0.setLitterSpread(0)
        self.p0.setSystemLifespan(0.0)
        self.p0.setLocalVelocityFlag(0)
        self.p0.setSystemGrowsOlderFlag(0)
        self.p0.factory.setLifespanBase(6.0)
        self.p0.factory.setLifespanSpread(0.10000000000000001)
        self.p0.factory.setMassBase(1.0)
        self.p0.factory.setMassSpread(0.0)
        self.p0.factory.setTerminalVelocityBase(400.0)
        self.p0.factory.setTerminalVelocitySpread(0.0)
        self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
        self.p0.renderer.setUserAlpha(0.20000000000000001)
        self.p0.renderer.setFromNode(self.card)
        self.p0.renderer.setColor(Vec4(1.0, 1.0, 0.0, 1.0))
        self.p0.renderer.setXScaleFlag(1)
        self.p0.renderer.setYScaleFlag(1)
        self.p0.renderer.setAnimAngleFlag(1)
        self.p0.renderer.setInitialXScale(0.001 * self.cardScale)
        self.p0.renderer.setInitialYScale(0.001 * self.cardScale)
        self.p0.renderer.setFinalXScale(0.02 * self.cardScale)
        self.p0.renderer.setFinalYScale(0.02 * self.cardScale)
        self.p0.renderer.setNonanimatedTheta(0.0)
        self.p0.renderer.setAlphaBlendMethod(BaseParticleRenderer.PPNOBLEND)
        self.p0.renderer.setAlphaDisable(0)
        self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
        self.p0.emitter.setAmplitude(1.0)
        self.p0.emitter.setAmplitudeSpread(0.0)
        self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -1.0))
        self.p0.emitter.setExplicitLaunchVector(Vec3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
        self.p0.emitter.setRadius(0.25)
Esempio n. 59
0
 def __init__(self):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleWhiteSmoke')
     self.speed = 20.0
     if not CleanseBlast.particleDummy:
         CleanseBlast.particleDummy = render.attachNewNode(
             ModelNode('CleanseParticleDummy'))
         CleanseBlast.particleDummy.setDepthWrite(0)
         CleanseBlast.particleDummy.setLightOff()
     self.setDepthWrite(0)
     self.setLightOff()
     self.f = ParticleEffect.ParticleEffect('CleanseBlast')
     self.f.reparentTo(self)
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('SphereSurfaceEmitter')
     self.f.addParticles(self.p0)
     f0 = ForceGroup.ForceGroup('gravity')
     force0 = LinearVectorForce(Vec3(0.0, 0.0, 7.0), 1.0, 1)
     force0.setActive(1)
     f0.addForce(force0)
     self.f.addForceGroup(f0)
     self.p0.setPoolSize(24)
     self.p0.setBirthRate(0.03)
     self.p0.setLitterSize(3)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.75)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p0.renderer.setUserAlpha(1.0)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1, 1, 1, 0.8))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setInitialXScale(0.016 * self.cardScale)
     self.p0.renderer.setFinalXScale(0.012 * self.cardScale)
     self.p0.renderer.setInitialYScale(0.012 * self.cardScale)
     self.p0.renderer.setFinalYScale(0.02 * self.cardScale)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.setColorBlendMode(ColorBlendAttrib.MAdd,
                                        ColorBlendAttrib.OIncomingAlpha,
                                        ColorBlendAttrib.OOne)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.5, 1.0, Vec4(1, 1, 1, 1), Vec4(1, 0.9, 0.5, 1), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(-1.8)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, -1.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p0.emitter.setRadius(3.0)
Esempio n. 60
0
 def __init__(self, parent=None):
     PooledEffect.__init__(self)
     EffectController.__init__(self)
     self.setDepthWrite(0)
     self.setLightOff()
     self.setBin('fixed', 50)
     self.effectScale = 1.0
     self.f = ParticleEffect.ParticleEffect('ShipSinkSplashes')
     self.f.reparentTo(self)
     model = loader.loadModel('models/effects/particleMaps')
     self.card = model.find('**/particleWhiteSteam')
     self.card2 = model.find('**/particleSplash')
     self.p0 = Particles.Particles('particles-1')
     self.p0.setFactory('PointParticleFactory')
     self.p0.setRenderer('SpriteParticleRenderer')
     self.p0.setEmitter('DiscEmitter')
     self.p1 = Particles.Particles('particles-2')
     self.p1.setFactory('PointParticleFactory')
     self.p1.setRenderer('SpriteParticleRenderer')
     self.p1.setEmitter('DiscEmitter')
     self.f.addParticles(self.p1)
     self.p0.setPoolSize(128)
     self.p0.setBirthRate(0.15)
     self.p0.setLitterSize(10)
     self.p0.setLitterSpread(0)
     self.p0.setSystemLifespan(0.0)
     self.p0.setLocalVelocityFlag(1)
     self.p0.setSystemGrowsOlderFlag(0)
     self.p0.factory.setLifespanBase(2.5)
     self.p0.factory.setLifespanSpread(0.5)
     self.p0.factory.setMassBase(1.0)
     self.p0.factory.setMassSpread(0.0)
     self.p0.factory.setTerminalVelocityBase(400.0)
     self.p0.factory.setTerminalVelocitySpread(0.0)
     self.p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAINOUT)
     self.p0.renderer.setUserAlpha(0.5)
     self.p0.renderer.setFromNode(self.card)
     self.p0.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p0.renderer.setXScaleFlag(1)
     self.p0.renderer.setYScaleFlag(1)
     self.p0.renderer.setAnimAngleFlag(0)
     self.p0.renderer.setNonanimatedTheta(0.0)
     self.p0.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p0.renderer.setAlphaDisable(0)
     self.p0.renderer.getColorInterpolationManager().addLinear(
         0.25, 1.0, Vec4(1.0, 1.0, 1.0, 1.0), Vec4(1.0, 1.0, 1.0, 0.0), 1)
     self.p0.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p0.emitter.setAmplitude(1.0)
     self.p0.emitter.setAmplitudeSpread(0.0)
     self.p0.emitter.setOffsetForce(Vec3(0.0, -2.0, 10.0))
     self.p0.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p0.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))
     self.p1.setPoolSize(128)
     self.p1.setBirthRate(0.01)
     self.p1.setLitterSize(3)
     self.p1.setLitterSpread(1)
     self.p1.setSystemLifespan(0.0)
     self.p1.setLocalVelocityFlag(1)
     self.p1.setSystemGrowsOlderFlag(0)
     self.p1.setFloorZ(-50)
     self.p1.factory.setLifespanBase(0.5)
     self.p1.factory.setLifespanSpread(0.15)
     self.p1.factory.setMassBase(1.0)
     self.p1.factory.setMassSpread(0.0)
     self.p1.factory.setTerminalVelocityBase(400.0)
     self.p1.factory.setTerminalVelocitySpread(0.0)
     self.p1.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
     self.p1.renderer.setUserAlpha(0.25)
     self.p1.renderer.setFromNode(self.card2)
     self.p1.renderer.setColor(Vec4(1.0, 1.0, 1.0, 1.0))
     self.p1.renderer.setXScaleFlag(1)
     self.p1.renderer.setYScaleFlag(1)
     self.p1.renderer.setAnimAngleFlag(0)
     self.p1.renderer.setNonanimatedTheta(0.0)
     self.p1.renderer.setAlphaBlendMethod(
         BaseParticleRenderer.PPBLENDLINEAR)
     self.p1.renderer.setAlphaDisable(0)
     self.p1.emitter.setEmissionType(BaseParticleEmitter.ETRADIATE)
     self.p1.emitter.setAmplitude(0.0)
     self.p1.emitter.setAmplitudeSpread(0.5)
     self.p1.emitter.setExplicitLaunchVector(Vec3(1.0, 0.0, 0.0))
     self.p1.emitter.setRadiateOrigin(Point3(0.0, 0.0, 0.0))