Ejemplo n.º 1
0
    def __init__(self, effectParent=None):
        NodePath.__init__(self, uniqueName('FeastFire'))
        self._fire = Fire()
        self._splats = FireSplats()
        self._sparks = FireSparks()
        self._smoke = HeavySmoke()
        self._feastSmoke = FeastSmoke()
        self.fireSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)
        self.fireSfxIval = None
        if self._fire:
            self._fire.reparentTo(self)
            self._fire.effectScale = 1.0

        if self._splats:
            self._splats.reparentTo(self)
            self._splats.effectScale = 1.0

        if self._sparks:
            self._sparks.reparentTo(self)
            self._sparks.setPos(0, 0, 3)

        if self._smoke:
            self._smoke.reparentTo(self)

        if self._feastSmoke:
            self._feastSmoke.reparentTo(self)
Ejemplo n.º 2
0
 def startBurning(self):
     if not self.postInvasionObjs:
         return
     parent = self.postInvasionObjs[0].getParent()
     builder = self.getParentObj().builder
     uid = parent.getNetTag('uid')
     visZone = parent.getNetTag('visZone')
     effectList = []
     if not self.fire_one:
         self.fire_one = Fire.getEffect(1)
     if self.fire_one:
         self.fire_one.reparentTo(parent)
         self.fire_one.setPos(-62, -15, 28)
         self.fire_one.setEffectScale(0.75)
         self.fire_one.setTag('uid', uid)
         self.fire_one.setTag('visZone', visZone)
         builder.registerEffect(self.fire_one)
         effectList.append(self.fire_one)
     if not self.fire_two:
         self.fire_two = Fire.getEffect(1)
     if self.fire_two:
         self.fire_two.reparentTo(parent)
         self.fire_two.setPos(-40, -15, 28)
         self.fire_two.setEffectScale(0.75)
         self.fire_two.setTag('uid', uid)
         self.fire_two.setTag('visZone', visZone)
         builder.registerEffect(self.fire_two)
         effectList.append(self.fire_two)
     if not self.fire_three:
         self.fire_three = Fire.getEffect(1)
     if self.fire_three:
         self.fire_three.reparentTo(parent)
         self.fire_three.setPos(60, -6, 35)
         self.fire_three.setEffectScale(1.5)
         self.fire_three.setTag('uid', uid)
         self.fire_three.setTag('visZone', visZone)
         builder.registerEffect(self.fire_three)
         effectList.append(self.fire_three)
     if not self.smoke_one:
         self.smoke_one = MansionSmoke.getEffect(1)
     if self.smoke_one:
         self.smoke_one.reparentTo(parent)
         self.smoke_one.setPos(-51, -4, 30)
         self.smoke_one.setEffectScale(1.0)
         self.smoke_one.setTag('uid', uid)
         self.smoke_one.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_one)
         effectList.append(self.smoke_one)
     if not self.smoke_two:
         self.smoke_two = MansionSmoke.getEffect(1)
     if self.smoke_one:
         self.smoke_two.reparentTo(parent)
         self.smoke_two.setPos(58, -4, 36)
         self.smoke_two.setEffectScale(1.0)
         self.smoke_two.setTag('uid', uid)
         self.smoke_two.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_two)
         effectList.append(self.smoke_two)
     builder.validateEffectSet(set(effectList))
 def startBurning(self):
     if not self.postInvasionObjs:
         return None
     
     parent = self.postInvasionObjs[0].getParent()
     builder = self.getParentObj().builder
     uid = parent.getNetTag('uid')
     visZone = parent.getNetTag('visZone')
     effectList = []
     if not self.fire_one:
         self.fire_one = Fire.getEffect(1)
     
     if self.fire_one:
         self.fire_one.reparentTo(parent)
         self.fire_one.setPos(6, -4, 15)
         self.fire_one.setEffectScale(1.1000000000000001)
         self.fire_one.setTag('uid', uid)
         self.fire_one.setTag('visZone', visZone)
         builder.registerEffect(self.fire_one)
         effectList.append(self.fire_one)
     
     if not self.smoke_one:
         self.smoke_one = MansionSmoke.getEffect(1)
     
     if self.smoke_one:
         self.smoke_one.reparentTo(parent)
         self.smoke_one.setPos(6, -6, 24)
         self.smoke_one.setEffectScale(0.5)
         self.smoke_one.setTag('uid', uid)
         self.smoke_one.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_one)
         effectList.append(self.smoke_one)
     
     builder.validateEffectSet(set(effectList))
 def startBurning(self):
     if not self.postInvasionObjs:
         return None
     
     parent = self.postInvasionObjs[0].getParent()
     builder = self.getParentObj().builder
     uid = parent.getNetTag('uid')
     visZone = parent.getNetTag('visZone')
     effectList = []
     if not self.fire_one:
         self.fire_one = Fire.getEffect(1)
     
     if self.fire_one:
         self.fire_one.reparentTo(parent)
         self.fire_one.setPos(6, -4, 15)
         self.fire_one.setEffectScale(1.1000000000000001)
         self.fire_one.setTag('uid', uid)
         self.fire_one.setTag('visZone', visZone)
         builder.registerEffect(self.fire_one)
         effectList.append(self.fire_one)
     
     if not self.smoke_one:
         self.smoke_one = MansionSmoke.getEffect(1)
     
     if self.smoke_one:
         self.smoke_one.reparentTo(parent)
         self.smoke_one.setPos(6, -6, 24)
         self.smoke_one.setEffectScale(0.5)
         self.smoke_one.setTag('uid', uid)
         self.smoke_one.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_one)
         effectList.append(self.smoke_one)
     
     builder.validateEffectSet(set(effectList))
Ejemplo n.º 5
0
 def __init__(self, effectParent = None):
     NodePath.__init__(self, uniqueName('FeastFire'))
     self._fire = Fire()
     self._splats = FireSplats()
     self._sparks = FireSparks()
     self._smoke = HeavySmoke()
     self._feastSmoke = FeastSmoke()
     self.fireSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)
     self.fireSfxIval = None
     if self._fire:
         self._fire.reparentTo(self)
         self._fire.effectScale = 1.0
     
     if self._splats:
         self._splats.reparentTo(self)
         self._splats.effectScale = 1.0
     
     if self._sparks:
         self._sparks.reparentTo(self)
         self._sparks.setPos(0, 0, 3)
     
     if self._smoke:
         self._smoke.reparentTo(self)
     
     if self._feastSmoke:
         self._feastSmoke.reparentTo(self)
Ejemplo n.º 6
0
 def enableEffect(self):
     if not self._fire:
         self._fire = Fire.getEffect()
     if self._fire:
         self._fire.enableEffect()
         self._fire.reparentTo(self)
     if not self._smoke:
         self._smoke = BlackSmoke.getEffect()
     if self._smoke:
         self._smoke.enableEffect()
         self._smoke.reparentTo(self)
 def enableEffect(self):
     if not self._fire:
         self._fire = Fire.getEffect()
     
     if self._fire:
         self._fire.enableEffect()
         self._fire.reparentTo(self)
     
     if not self._smoke:
         self._smoke = BlackSmoke.getEffect()
     
     if self._smoke:
         self._smoke.enableEffect()
         self._smoke.reparentTo(self)
 def startBurning(self):
     if not self.postInvasionObjs:
         return None
     
     base.wdf = self
     builder = self.getParentObj().builder
     effectList = []
     for id in OBJ_EFFECT_PARAMS:
         parent = self.getParentWithId(OBJ_EFFECT_PARAMS[id][0])
         uid = parent.getNetTag('uid')
         visZone = parent.getNetTag('visZone')
         if not self.fireEffects.has_key(id):
             self.fireEffects[id] = Fire.getEffect(1)
         
         if self.fireEffects[id]:
             fireEffect = self.fireEffects[id]
             fireEffect.reparentTo(parent)
             fireEffect.setPos(OBJ_EFFECT_PARAMS[id][1])
             fireEffect.setEffectScale(OBJ_EFFECT_PARAMS[id][2])
             fireEffect.setTag('uid', uid)
             fireEffect.setTag('visZone', visZone)
             builder.registerEffect(fireEffect)
             effectList.append(fireEffect)
         
         if not self.smokeEffects.has_key(id):
             self.smokeEffects[id] = MansionSmoke.getEffect(1)
         
         if self.smokeEffects[id]:
             smokeEffect = self.smokeEffects[id]
             smokeEffect.reparentTo(parent)
             smokeEffect.setPos(OBJ_EFFECT_PARAMS[id][3])
             smokeEffect.setEffectScale(OBJ_EFFECT_PARAMS[id][4])
             smokeEffect.setTag('uid', uid)
             smokeEffect.setTag('visZone', visZone)
             builder.registerEffect(smokeEffect)
             effectList.append(smokeEffect)
             continue
     
     if self.fireEffects[2]:
         self.fireEffects[2].p0.emitter.setRadius(3.0)
     
     if self.fireEffects[3]:
         self.fireEffects[3].p0.emitter.setRadius(2.0)
     
     builder.validateEffectSet(set(effectList))
    def startBurning(self):
        if not self.postInvasionObjs:
            return None

        base.wdf = self
        builder = self.getParentObj().builder
        effectList = []
        for id in OBJ_EFFECT_PARAMS:
            parent = self.getParentWithId(OBJ_EFFECT_PARAMS[id][0])
            uid = parent.getNetTag('uid')
            visZone = parent.getNetTag('visZone')
            if not self.fireEffects.has_key(id):
                self.fireEffects[id] = Fire.getEffect(1)

            if self.fireEffects[id]:
                fireEffect = self.fireEffects[id]
                fireEffect.reparentTo(parent)
                fireEffect.setPos(OBJ_EFFECT_PARAMS[id][1])
                fireEffect.setEffectScale(OBJ_EFFECT_PARAMS[id][2])
                fireEffect.setTag('uid', uid)
                fireEffect.setTag('visZone', visZone)
                builder.registerEffect(fireEffect)
                effectList.append(fireEffect)

            if not self.smokeEffects.has_key(id):
                self.smokeEffects[id] = MansionSmoke.getEffect(1)

            if self.smokeEffects[id]:
                smokeEffect = self.smokeEffects[id]
                smokeEffect.reparentTo(parent)
                smokeEffect.setPos(OBJ_EFFECT_PARAMS[id][3])
                smokeEffect.setEffectScale(OBJ_EFFECT_PARAMS[id][4])
                smokeEffect.setTag('uid', uid)
                smokeEffect.setTag('visZone', visZone)
                builder.registerEffect(smokeEffect)
                effectList.append(smokeEffect)
                continue

        if self.fireEffects[2]:
            self.fireEffects[2].p0.emitter.setRadius(3.0)

        if self.fireEffects[3]:
            self.fireEffects[3].p0.emitter.setRadius(2.0)

        builder.validateEffectSet(set(effectList))
Ejemplo n.º 10
0
 def __init__(self, parent=None):
     NodePath.__init__(self, uniqueName('Bonfire'))
     self._fire = Fire.getEffect()
     self._smoke = BlackSmoke.getEffect()
     if self._fire:
         self._fire.reparentTo(self)
         self._fire.effectScale = 1.0
     if self._smoke:
         self._smoke.reparentTo(self)
     if parent is not None:
         self.reparentTo(parent)
     self._sound = None
     if Bonfire.HackCount == 0:
         Bonfire.HackCount += 1
         self._hasSound = True
         self._sound = None
     else:
         self._hasSound = False
     return
 def __init__(self, parent = None):
     NodePath.__init__(self, uniqueName('Bonfire'))
     self._fire = Fire.getEffect()
     self._smoke = BlackSmoke.getEffect()
     if self._fire:
         self._fire.reparentTo(self)
         self._fire.effectScale = 1.0
     
     if self._smoke:
         self._smoke.reparentTo(self)
     
     if parent is not None:
         self.reparentTo(parent)
     
     self._sound = None
     if Bonfire.HackCount == 0:
         Bonfire.HackCount += 1
         self._hasSound = True
         self._sound = None
     else:
         self._hasSound = False
    def basicHitEffect(self, hitObject, pos, skillId, ammoSkillId):
        WeaponGlobals = WeaponGlobals
        import pirates.battle
        if self.cr:
            attacker = self.cr.doId2do.get(self.attackerId)
            aoeRadius = self.cr.battleMgr.getModifiedAttackAreaRadius(
                attacker, skillId, ammoSkillId)
        else:
            attacker = None
            aoeRadius = 0
        if attacker:
            pass
        unlimited = bool(attacker.isLocal())
        if config.GetBool('show-aoe-radius', 0):
            s = loader.loadModel('models/misc/smiley')
            s.reparentTo(render)
            s.setPos(hitObject, pos)
            s.setScale(aoeRadius)
            s.setTransparency(1)
            s.setColorScale(1.0, 0.5, 0.5, 0.40000000000000002)

        if ammoSkillId in [
                InventoryType.CannonRoundShot, InventoryType.CannonChainShot,
                InventoryType.CannonBullet, InventoryType.CannonSkull,
                InventoryType.CannonBarShot, InventoryType.CannonFury,
                InventoryType.CannonFirebrand,
                InventoryType.CannonFlamingSkull,
                InventoryType.CannonThunderbolt
        ]:
            hitSfxNames = [
                SoundGlobals.SFX_FX_WOOD_IMPACT_01,
                SoundGlobals.SFX_FX_WOOD_IMPACT_02,
                SoundGlobals.SFX_FX_WOOD_IMPACT_03,
                SoundGlobals.SFX_FX_WOOD_IMPACT_04,
                SoundGlobals.SFX_FX_WOOD_SHATTER_02,
                SoundGlobals.SFX_FX_WOOD_SHATTER_03
            ]
            sfx = loadSfx(random.choice(hitSfxNames))
            base.playSfx(sfx, node=hitObject, cutoff=1500)
            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsLow:
                explosionEffect = ExplosionFlip.getEffect(unlimited)
                if explosionEffect:
                    explosionEffect.reparentTo(base.effectsRoot)
                    explosionEffect.setPos(hitObject, pos)
                    explosionEffect.setScale(0.80000000000000004)
                    explosionEffect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                smokeCloudEffect = SimpleSmokeCloud.getEffect(unlimited)
                if smokeCloudEffect:
                    smokeCloudEffect.reparentTo(hitObject)
                    smokeCloudEffect.setPos(hitObject, pos)
                    smokeCloudEffect.setEffectScale(1.0)
                    smokeCloudEffect.play()

                if localAvatar.ship and hitObject == localAvatar.ship:
                    cameraShakerEffect = CameraShaker()
                    cameraShakerEffect.wrtReparentTo(hitObject)
                    cameraShakerEffect.setPos(hitObject, pos)
                    cameraShakerEffect.shakeSpeed = 0.040000000000000001
                    cameraShakerEffect.shakePower = 6.0
                    cameraShakerEffect.numShakes = 2
                    cameraShakerEffect.scalePower = 1
                    cameraShakerEffect.play(120.0)

        if ammoSkillId == InventoryType.CannonExplosive:
            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsLow:
                effect = Explosion.getEffect(unlimited)
                if effect:
                    effect.wrtReparentTo(hitObject)
                    effect.setPos(hitObject, pos)
                    effect.setEffectScale(1.0)
                    effect.setEffectRadius(aoeRadius / 3.0)
                    effect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                for i in range(2):
                    effect = FlamingDebris.getEffect(unlimited)
                    if effect:
                        effect.wrtReparentTo(base.effectsRoot)
                        effect.setPos(hitObject, pos)
                        effect.duration = 4
                        effect.velocityX = self.projVelocity[i][0]
                        effect.velocityY = self.projVelocity[i][1]
                        effect.play()
                        continue

                if localAvatar.ship and hitObject == localAvatar.ship:
                    cameraShakerEffect = CameraShaker()
                    cameraShakerEffect.wrtReparentTo(hitObject)
                    cameraShakerEffect.setPos(hitObject, pos)
                    cameraShakerEffect.shakeSpeed = 0.040000000000000001
                    cameraShakerEffect.shakePower = 6.0
                    cameraShakerEffect.numShakes = 2
                    cameraShakerEffect.scalePower = 1
                    cameraShakerEffect.play(300.0)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsHigh:
                effect = FlamingDebris.getEffect(unlimited)
                if effect:
                    effect.wrtReparentTo(base.effectsRoot)
                    effect.setPos(hitObject, pos)
                    effect.duration = 4
                    effect.velocityX = self.projVelocity[i][0]
                    effect.velocityY = self.projVelocity[i][1]
                    effect.play()

        if ammoSkillId == InventoryType.CannonThunderbolt:
            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsLow:
                effect = LightningStrike.getEffect(unlimited)
                if effect:
                    effect.wrtReparentTo(base.effectsRoot)
                    effect.setPos(hitObject, pos)
                    effect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                flashEffect = FlashEffect()
                flashEffect.wrtReparentTo(base.effectsRoot)
                flashEffect.setScale(600)
                flashEffect.setPos(hitObject, pos)
                flashEffect.effectColor = Vec4(0.5, 0.80000000000000004, 1, 1)
                flashEffect.fadeTime = 0.29999999999999999
                flashEffect.play()
                if localAvatar.ship and hitObject == localAvatar.ship:
                    cameraShakerEffect = CameraShaker()
                    cameraShakerEffect.wrtReparentTo(hitObject)
                    cameraShakerEffect.setPos(hitObject, pos)
                    cameraShakerEffect.shakeSpeed = 0.059999999999999998
                    cameraShakerEffect.shakePower = 4.0
                    cameraShakerEffect.numShakes = 2
                    cameraShakerEffect.scalePower = 1
                    cameraShakerEffect.play(300.0)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsHigh:
                shipSplintersAEffect = ShipSplintersA.getEffect(unlimited)
                if shipSplintersAEffect:
                    shipSplintersAEffect.wrtReparentTo(hitObject)
                    shipSplintersAEffect.setPos(hitObject, pos)
                    shipSplintersAEffect.play()

        elif ammoSkillId == InventoryType.CannonFury:
            flashEffect = FlashEffect()
            flashEffect.wrtReparentTo(base.effectsRoot)
            flashEffect.setScale(300)
            flashEffect.setPos(hitObject, pos)
            flashEffect.effectColor = Vec4(0.5, 0.80000000000000004, 1, 1)
            flashEffect.fadeTime = 0.25
            flashEffect.play()
        elif ammoSkillId == InventoryType.GrenadeExplosion:
            explosionEffect = ExplosionFlip.getEffect(unlimited)
            if explosionEffect:
                explosionEffect.reparentTo(base.effectsRoot)
                explosionEffect.setPos(hitObject, pos)
                explosionEffect.setScale(1.0)
                explosionEffect.play()
                self.playSfx(ammoSkillId, explosionEffect)

            smokeCloudEffect = SmokeCloud.getEffect(unlimited)
            if smokeCloudEffect:
                smokeCloudEffect.reparentTo(hitObject)
                smokeCloudEffect.setPos(hitObject, pos)
                smokeCloudEffect.setScale(1.0)
                smokeCloudEffect.spriteScale = 1.0
                smokeCloudEffect.radius = 7.0
                smokeCloudEffect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
                if shockwaveRingEffect:
                    shockwaveRingEffect.reparentTo(base.effectsRoot)
                    shockwaveRingEffect.setPos(hitObject, pos)
                    shockwaveRingEffect.size = aoeRadius * 4
                    shockwaveRingEffect.play()

                flashEffect = MuzzleFlash.getEffect(unlimited)
                if flashEffect:
                    flashEffect.reparentTo(base.effectsRoot)
                    flashEffect.flash.setScale(100)
                    flashEffect.setPos(hitObject, pos)
                    flashEffect.startCol = Vec4(0.69999999999999996,
                                                0.69999999999999996,
                                                0.69999999999999996, 1)
                    flashEffect.fadeTime = 0.20000000000000001
                    flashEffect.play()

                cameraShakerEffect = CameraShaker()
                cameraShakerEffect.reparentTo(hitObject)
                cameraShakerEffect.setPos(hitObject, pos)
                cameraShakerEffect.shakeSpeed = 0.040000000000000001
                cameraShakerEffect.shakePower = 6.0
                cameraShakerEffect.numShakes = 2
                cameraShakerEffect.scalePower = 1
                cameraShakerEffect.play(80.0)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsHigh:
                rockShower = SmallRockShower.getEffect(unlimited)
                if rockShower:
                    rockShower.reparentTo(hitObject)
                    rockShower.setPos(hitObject, pos)
                    rockShower.play()

        elif ammoSkillId == InventoryType.GrenadeShockBomb:
            explosionEffect = ExplosionFlip.getEffect(unlimited)
            if explosionEffect:
                explosionEffect.reparentTo(base.effectsRoot)
                explosionEffect.setPos(hitObject, pos)
                explosionEffect.setScale(1.0)
                explosionEffect.play()
                self.playSfx(ammoSkillId, explosionEffect)

            dustRingEffect = DustRing.getEffect(unlimited)
            if dustRingEffect:
                dustRingEffect.reparentTo(hitObject)
                dustRingEffect.setPos(hitObject, pos)
                dustRingEffect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
                if shockwaveRingEffect:
                    shockwaveRingEffect.reparentTo(base.effectsRoot)
                    shockwaveRingEffect.setPos(hitObject, pos)
                    shockwaveRingEffect.size = aoeRadius * 4
                    shockwaveRingEffect.play()

                flashEffect = MuzzleFlash.getEffect(unlimited)
                if flashEffect:
                    flashEffect.reparentTo(base.effectsRoot)
                    flashEffect.flash.setScale(100)
                    flashEffect.setPos(hitObject, pos)
                    flashEffect.startCol = Vec4(0.69999999999999996,
                                                0.69999999999999996,
                                                0.69999999999999996, 1)
                    flashEffect.fadeTime = 0.20000000000000001
                    flashEffect.play()

                cameraShakerEffect = CameraShaker()
                cameraShakerEffect.reparentTo(hitObject)
                cameraShakerEffect.setPos(hitObject, pos)
                cameraShakerEffect.shakeSpeed = 0.040000000000000001
                cameraShakerEffect.shakePower = 3.0
                cameraShakerEffect.numShakes = 2
                cameraShakerEffect.scalePower = 1
                cameraShakerEffect.play(80.0)

        elif ammoSkillId == InventoryType.GrenadeSiege:
            explosionEffect = ExplosionFlip.getEffect(unlimited)
            if explosionEffect:
                explosionEffect.reparentTo(base.effectsRoot)
                explosionEffect.setPos(hitObject, pos)
                explosionEffect.setScale(2.5)
                explosionEffect.play()
                self.playSfx(ammoSkillId, explosionEffect)

            smokePillarEffect = SmokePillar.getEffect(unlimited)
            if smokePillarEffect:
                smokePillarEffect.reparentTo(hitObject)
                smokePillarEffect.setPos(hitObject, pos)
                smokePillarEffect.setScale(1.0)
                smokePillarEffect.spriteScale = 1.0
                smokePillarEffect.radius = 7.0
                smokePillarEffect.play()

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                dustRingEffect = DustRing.getEffect(unlimited)
                if dustRingEffect:
                    dustRingEffect.reparentTo(hitObject)
                    dustRingEffect.setPos(hitObject, pos)
                    dustRingEffect.play()

                shockwaveRingEffect = ShockwaveRing.getEffect()
                if shockwaveRingEffect:
                    shockwaveRingEffect.reparentTo(base.effectsRoot)
                    shockwaveRingEffect.setPos(hitObject, pos)
                    shockwaveRingEffect.size = aoeRadius * 4
                    shockwaveRingEffect.play()

                cameraShakerEffect = CameraShaker()
                cameraShakerEffect.wrtReparentTo(hitObject)
                cameraShakerEffect.setPos(hitObject, pos)
                cameraShakerEffect.shakeSpeed = 0.059999999999999998
                cameraShakerEffect.shakePower = 4.0
                cameraShakerEffect.numShakes = 2
                cameraShakerEffect.scalePower = 1
                cameraShakerEffect.play(80.0)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsHigh:
                shipSplintersAEffect = ShipSplintersA.getEffect(unlimited)
                if shipSplintersAEffect:
                    shipSplintersAEffect.reparentTo(hitObject)
                    shipSplintersAEffect.setPos(hitObject, pos)
                    shipSplintersAEffect.play()

                for i in range(random.randint(3, 6)):
                    debrisEffect = RockDebris.getEffect(unlimited)
                    if debrisEffect:
                        debrisEffect.reparentTo(base.effectsRoot)
                        debrisEffect.setPos(hitObject, pos)
                        debrisEffect.offsetEndPlaneZFrom(hitObject.getZ())
                        debrisEffect.debris.setScale(0.80000000000000004)
                        debrisEffect.radiusDist = 30
                        debrisEffect.minHeight = 30
                        debrisEffect.maxHeight = 120
                        if debrisEffect.testTrajectory():
                            debrisEffect.play()
                        else:
                            debrisEffect.cleanUpEffect()
                    debrisEffect.testTrajectory()

                flashEffect = MuzzleFlash.getEffect(unlimited)
                if flashEffect:
                    flashEffect.reparentTo(base.effectsRoot)
                    flashEffect.flash.setScale(200)
                    flashEffect.setPos(hitObject, pos)
                    flashEffect.startCol = Vec4(0.69999999999999996,
                                                0.69999999999999996,
                                                0.69999999999999996, 1)
                    flashEffect.fadeTime = 0.20000000000000001
                    flashEffect.play()

        elif ammoSkillId == InventoryType.GrenadeFireBomb:
            fireEffect = Fire.getEffect(unlimited)
            if fireEffect:
                fireEffect.wrtReparentTo(base.effectsRoot)
                fireEffect.setPos(hitObject, pos + Vec3(0, 0, -1.5))
                fireEffect.setScale(Vec3(0.75, 0.75, 0.75))
                fireEffect.duration = 2.5
                fireEffect.play()

            flashEffect = MuzzleFlash.getEffect(unlimited)
            if flashEffect:
                flashEffect.wrtReparentTo(base.effectsRoot)
                flashEffect.flash.setScale(100)
                flashEffect.setPos(hitObject, pos)
                flashEffect.startCol = Vec4(0.69999999999999996,
                                            0.69999999999999996,
                                            0.69999999999999996, 1)
                flashEffect.fadeTime = 0.20000000000000001
                flashEffect.play()
                self.playSfx(ammoSkillId, flashEffect)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
                if shockwaveRingEffect:
                    shockwaveRingEffect.wrtReparentTo(base.effectsRoot)
                    shockwaveRingEffect.setPos(hitObject, pos)
                    shockwaveRingEffect.size = aoeRadius * 4
                    shockwaveRingEffect.play()

                cameraShakerEffect = CameraShaker()
                cameraShakerEffect.wrtReparentTo(hitObject)
                cameraShakerEffect.setPos(hitObject, pos)
                cameraShakerEffect.shakeSpeed = 0.040000000000000001
                cameraShakerEffect.shakePower = 2.0
                cameraShakerEffect.numShakes = 2
                cameraShakerEffect.scalePower = 1
                cameraShakerEffect.play(80.0)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsHigh:
                blackSmokeEffect = LightSmoke.getEffect(unlimited)
                if blackSmokeEffect:
                    blackSmokeEffect.wrtReparentTo(base.effectsRoot)
                    blackSmokeEffect.setPos(hitObject, pos)
                    blackSmokeEffect.duration = 4.0
                    blackSmokeEffect.play()

        elif ammoSkillId == InventoryType.GrenadeSmokeCloud:
            explosionEffect = ExplosionFlip.getEffect(unlimited)
            if explosionEffect:
                explosionEffect.reparentTo(base.effectsRoot)
                explosionEffect.setPos(hitObject, pos)
                explosionEffect.setScale(1.0)
                explosionEffect.play()
                self.playSfx(ammoSkillId, explosionEffect)

            smokeCloudEffect = SmokeBomb.getEffect(unlimited)
            if smokeCloudEffect:
                smokeCloudEffect.reparentTo(hitObject)
                smokeCloudEffect.setPos(hitObject, pos)
                smokeCloudEffect.radius = aoeRadius / 1.5
                smokeCloudEffect.play()
                self.playSfx(ammoSkillId, smokeCloudEffect)

            if base.options.getSpecialEffectsSetting(
            ) >= base.options.SpecialEffectsMedium:
                shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
                if shockwaveRingEffect:
                    shockwaveRingEffect.wrtReparentTo(base.effectsRoot)
                    shockwaveRingEffect.setPos(hitObject, pos)
                    shockwaveRingEffect.size = aoeRadius * 4
                    shockwaveRingEffect.play()

                cameraShakerEffect = CameraShaker()
                cameraShakerEffect.wrtReparentTo(hitObject)
                cameraShakerEffect.setPos(hitObject, pos)
                cameraShakerEffect.shakeSpeed = 0.040000000000000001
                cameraShakerEffect.shakePower = 2.0
                cameraShakerEffect.numShakes = 2
                cameraShakerEffect.scalePower = 1
                cameraShakerEffect.play(80.0)
Ejemplo n.º 13
0
class FeastFire(NodePath):
    def __init__(self, effectParent=None):
        NodePath.__init__(self, uniqueName('FeastFire'))
        self._fire = Fire()
        self._splats = FireSplats()
        self._sparks = FireSparks()
        self._smoke = HeavySmoke()
        self._feastSmoke = FeastSmoke()
        self.fireSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)
        self.fireSfxIval = None
        if self._fire:
            self._fire.reparentTo(self)
            self._fire.effectScale = 1.0
        if self._splats:
            self._splats.reparentTo(self)
            self._splats.effectScale = 1.0
        if self._sparks:
            self._sparks.reparentTo(self)
            self._sparks.setPos(0, 0, 3)
        if self._smoke:
            self._smoke.reparentTo(self)
        if self._feastSmoke:
            self._feastSmoke.reparentTo(self)
        return

    def setCustomSettings(self):
        if self._fire:
            self._fire.setScale(VBase3(1.5, 1, 1))
            self._fire.p0.factory.setLifespanBase(1.25)
            self._fire.p0.factory.setLifespanSpread(0.5)
            self._fire.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 15.0))
            self._fire.p0.emitter.setRadius(4.0)
        if self._splats:
            self._splats.setScale(VBase3(1.5, 1, 1))
            self._splats.p0.factory.setLifespanBase(1.3)
            self._splats.p0.factory.setLifespanSpread(0.5)
            self._splats.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 18.0))
            self._splats.p0.emitter.setRadius(4.0)
        if self._sparks:
            self._sparks.setScale(VBase3(1.25, 1, 1))
            self._sparks.p0.factory.setLifespanBase(1.5)
            self._sparks.p0.factory.setLifespanSpread(0.5)
            self._sparks.p0.emitter.setOffsetForce(Vec3(2.0, 2.0, 24.0))
            self._sparks.p0.emitter.setRadius(6.0)
        if self._smoke:
            self._smoke.setScale(VBase3(1.25, 1, 1))
            self._smoke.p0.emitter.setOffsetForce(Vec3(2.0, 2.0, 30.0))
            self._smoke.p0.emitter.setRadius(5.0)

    def startMainEffects(self):
        effectSetting = base.options.getSpecialEffectsSetting()
        if self._fire:
            self._fire.enable()
        if self._splats and effectSetting >= base.options.SpecialEffectsHigh:
            self._splats.enable()
        if self._sparks and effectSetting >= base.options.SpecialEffectsMedium:
            self._sparks.enable()
        if self._smoke:
            self._smoke.enable()
        if self.fireSfx:
            self.fireSfxIval = SoundInterval(self.fireSfx,
                                             node=self,
                                             seamlessLoop=False)
            self.fireSfxIval.loop()

    def stopMainEffects(self):
        if self._fire:
            self._fire.disable()
        if self._splats:
            self._splats.disable()
        if self._sparks:
            self._sparks.disable()
        if self._smoke:
            self._smoke.disable()
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        return

    def startFarEffects(self):
        if self._feastSmoke:
            self._feastSmoke.enable()
            self._feastSmoke.accelerate()

    def stopFarEffects(self):
        if self._feastSmoke:
            self._feastSmoke.disable()

    def stopLoop(self):
        if self._fire:
            self._fire.disable()
        if self._splats:
            self._splats.disable()
        if self._sparks:
            self._sparks.disable()
        if self._smoke:
            self._smoke.disable()
        if self._feastSmoke:
            self._feastSmoke.disable()
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        return

    def destroy(self):
        if self._fire:
            self._fire.destroy()
        if self._splats:
            self._splats.destroy()
        if self._sparks:
            self._sparks.destroy()
        if self._smoke:
            self._smoke.destroy()
        if self._feastSmoke:
            self._feastSmoke.destroy()
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        del self._fire
        del self._splats
        del self._sparks
        del self._smoke
        del self._feastSmoke
        del self.fireSfx
        return
Ejemplo n.º 14
0
 def basicHitEffect(self, hitObject, pos, skillId, ammoSkillId):
     WeaponGlobals = WeaponGlobals
     import pirates.battle
     if self.cr:
         attacker = self.cr.doId2do.get(self.attackerId)
         aoeRadius = self.cr.battleMgr.getModifiedAttackAreaRadius(attacker, skillId, ammoSkillId)
     else:
         attacker = None
         aoeRadius = 0
     if attacker:
         pass
     unlimited = bool(attacker.isLocal())
     if config.GetBool('show-aoe-radius', 0):
         s = loader.loadModel('models/misc/smiley')
         s.reparentTo(render)
         s.setPos(hitObject, pos)
         s.setScale(aoeRadius)
         s.setTransparency(1)
         s.setColorScale(1.0, 0.5, 0.5, 0.40000000000000002)
     
     if ammoSkillId in [
         InventoryType.CannonRoundShot,
         InventoryType.CannonChainShot,
         InventoryType.CannonBullet,
         InventoryType.CannonSkull,
         InventoryType.CannonBarShot,
         InventoryType.CannonFury,
         InventoryType.CannonFirebrand,
         InventoryType.CannonFlamingSkull,
         InventoryType.CannonThunderbolt]:
         hitSfxNames = [
             SoundGlobals.SFX_FX_WOOD_IMPACT_01,
             SoundGlobals.SFX_FX_WOOD_IMPACT_02,
             SoundGlobals.SFX_FX_WOOD_IMPACT_03,
             SoundGlobals.SFX_FX_WOOD_IMPACT_04,
             SoundGlobals.SFX_FX_WOOD_SHATTER_02,
             SoundGlobals.SFX_FX_WOOD_SHATTER_03]
         sfx = loadSfx(random.choice(hitSfxNames))
         base.playSfx(sfx, node = hitObject, cutoff = 1500)
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
             explosionEffect = ExplosionFlip.getEffect(unlimited)
             if explosionEffect:
                 explosionEffect.reparentTo(base.effectsRoot)
                 explosionEffect.setPos(hitObject, pos)
                 explosionEffect.setScale(0.80000000000000004)
                 explosionEffect.play()
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             smokeCloudEffect = SimpleSmokeCloud.getEffect(unlimited)
             if smokeCloudEffect:
                 smokeCloudEffect.reparentTo(hitObject)
                 smokeCloudEffect.setPos(hitObject, pos)
                 smokeCloudEffect.setEffectScale(1.0)
                 smokeCloudEffect.play()
             
             if localAvatar.ship and hitObject == localAvatar.ship:
                 cameraShakerEffect = CameraShaker()
                 cameraShakerEffect.wrtReparentTo(hitObject)
                 cameraShakerEffect.setPos(hitObject, pos)
                 cameraShakerEffect.shakeSpeed = 0.040000000000000001
                 cameraShakerEffect.shakePower = 6.0
                 cameraShakerEffect.numShakes = 2
                 cameraShakerEffect.scalePower = 1
                 cameraShakerEffect.play(120.0)
             
         
     
     if ammoSkillId == InventoryType.CannonExplosive:
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
             effect = Explosion.getEffect(unlimited)
             if effect:
                 effect.wrtReparentTo(hitObject)
                 effect.setPos(hitObject, pos)
                 effect.setEffectScale(1.0)
                 effect.setEffectRadius(aoeRadius / 3.0)
                 effect.play()
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             for i in range(2):
                 effect = FlamingDebris.getEffect(unlimited)
                 if effect:
                     effect.wrtReparentTo(base.effectsRoot)
                     effect.setPos(hitObject, pos)
                     effect.duration = 4
                     effect.velocityX = self.projVelocity[i][0]
                     effect.velocityY = self.projVelocity[i][1]
                     effect.play()
                     continue
             
             if localAvatar.ship and hitObject == localAvatar.ship:
                 cameraShakerEffect = CameraShaker()
                 cameraShakerEffect.wrtReparentTo(hitObject)
                 cameraShakerEffect.setPos(hitObject, pos)
                 cameraShakerEffect.shakeSpeed = 0.040000000000000001
                 cameraShakerEffect.shakePower = 6.0
                 cameraShakerEffect.numShakes = 2
                 cameraShakerEffect.scalePower = 1
                 cameraShakerEffect.play(300.0)
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             effect = FlamingDebris.getEffect(unlimited)
             if effect:
                 effect.wrtReparentTo(base.effectsRoot)
                 effect.setPos(hitObject, pos)
                 effect.duration = 4
                 effect.velocityX = self.projVelocity[i][0]
                 effect.velocityY = self.projVelocity[i][1]
                 effect.play()
             
         
     
     if ammoSkillId == InventoryType.CannonThunderbolt:
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
             effect = LightningStrike.getEffect(unlimited)
             if effect:
                 effect.wrtReparentTo(base.effectsRoot)
                 effect.setPos(hitObject, pos)
                 effect.play()
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             flashEffect = FlashEffect()
             flashEffect.wrtReparentTo(base.effectsRoot)
             flashEffect.setScale(600)
             flashEffect.setPos(hitObject, pos)
             flashEffect.effectColor = Vec4(0.5, 0.80000000000000004, 1, 1)
             flashEffect.fadeTime = 0.29999999999999999
             flashEffect.play()
             if localAvatar.ship and hitObject == localAvatar.ship:
                 cameraShakerEffect = CameraShaker()
                 cameraShakerEffect.wrtReparentTo(hitObject)
                 cameraShakerEffect.setPos(hitObject, pos)
                 cameraShakerEffect.shakeSpeed = 0.059999999999999998
                 cameraShakerEffect.shakePower = 4.0
                 cameraShakerEffect.numShakes = 2
                 cameraShakerEffect.scalePower = 1
                 cameraShakerEffect.play(300.0)
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             shipSplintersAEffect = ShipSplintersA.getEffect(unlimited)
             if shipSplintersAEffect:
                 shipSplintersAEffect.wrtReparentTo(hitObject)
                 shipSplintersAEffect.setPos(hitObject, pos)
                 shipSplintersAEffect.play()
             
         
     elif ammoSkillId == InventoryType.CannonFury:
         flashEffect = FlashEffect()
         flashEffect.wrtReparentTo(base.effectsRoot)
         flashEffect.setScale(300)
         flashEffect.setPos(hitObject, pos)
         flashEffect.effectColor = Vec4(0.5, 0.80000000000000004, 1, 1)
         flashEffect.fadeTime = 0.25
         flashEffect.play()
     elif ammoSkillId == InventoryType.GrenadeExplosion:
         explosionEffect = ExplosionFlip.getEffect(unlimited)
         if explosionEffect:
             explosionEffect.reparentTo(base.effectsRoot)
             explosionEffect.setPos(hitObject, pos)
             explosionEffect.setScale(1.0)
             explosionEffect.play()
             self.playSfx(ammoSkillId, explosionEffect)
         
         smokeCloudEffect = SmokeCloud.getEffect(unlimited)
         if smokeCloudEffect:
             smokeCloudEffect.reparentTo(hitObject)
             smokeCloudEffect.setPos(hitObject, pos)
             smokeCloudEffect.setScale(1.0)
             smokeCloudEffect.spriteScale = 1.0
             smokeCloudEffect.radius = 7.0
             smokeCloudEffect.play()
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
             if shockwaveRingEffect:
                 shockwaveRingEffect.reparentTo(base.effectsRoot)
                 shockwaveRingEffect.setPos(hitObject, pos)
                 shockwaveRingEffect.size = aoeRadius * 4
                 shockwaveRingEffect.play()
             
             flashEffect = MuzzleFlash.getEffect(unlimited)
             if flashEffect:
                 flashEffect.reparentTo(base.effectsRoot)
                 flashEffect.flash.setScale(100)
                 flashEffect.setPos(hitObject, pos)
                 flashEffect.startCol = Vec4(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1)
                 flashEffect.fadeTime = 0.20000000000000001
                 flashEffect.play()
             
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.reparentTo(hitObject)
             cameraShakerEffect.setPos(hitObject, pos)
             cameraShakerEffect.shakeSpeed = 0.040000000000000001
             cameraShakerEffect.shakePower = 6.0
             cameraShakerEffect.numShakes = 2
             cameraShakerEffect.scalePower = 1
             cameraShakerEffect.play(80.0)
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             rockShower = SmallRockShower.getEffect(unlimited)
             if rockShower:
                 rockShower.reparentTo(hitObject)
                 rockShower.setPos(hitObject, pos)
                 rockShower.play()
             
         
     elif ammoSkillId == InventoryType.GrenadeShockBomb:
         explosionEffect = ExplosionFlip.getEffect(unlimited)
         if explosionEffect:
             explosionEffect.reparentTo(base.effectsRoot)
             explosionEffect.setPos(hitObject, pos)
             explosionEffect.setScale(1.0)
             explosionEffect.play()
             self.playSfx(ammoSkillId, explosionEffect)
         
         dustRingEffect = DustRing.getEffect(unlimited)
         if dustRingEffect:
             dustRingEffect.reparentTo(hitObject)
             dustRingEffect.setPos(hitObject, pos)
             dustRingEffect.play()
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
             if shockwaveRingEffect:
                 shockwaveRingEffect.reparentTo(base.effectsRoot)
                 shockwaveRingEffect.setPos(hitObject, pos)
                 shockwaveRingEffect.size = aoeRadius * 4
                 shockwaveRingEffect.play()
             
             flashEffect = MuzzleFlash.getEffect(unlimited)
             if flashEffect:
                 flashEffect.reparentTo(base.effectsRoot)
                 flashEffect.flash.setScale(100)
                 flashEffect.setPos(hitObject, pos)
                 flashEffect.startCol = Vec4(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1)
                 flashEffect.fadeTime = 0.20000000000000001
                 flashEffect.play()
             
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.reparentTo(hitObject)
             cameraShakerEffect.setPos(hitObject, pos)
             cameraShakerEffect.shakeSpeed = 0.040000000000000001
             cameraShakerEffect.shakePower = 3.0
             cameraShakerEffect.numShakes = 2
             cameraShakerEffect.scalePower = 1
             cameraShakerEffect.play(80.0)
         
     elif ammoSkillId == InventoryType.GrenadeSiege:
         explosionEffect = ExplosionFlip.getEffect(unlimited)
         if explosionEffect:
             explosionEffect.reparentTo(base.effectsRoot)
             explosionEffect.setPos(hitObject, pos)
             explosionEffect.setScale(2.5)
             explosionEffect.play()
             self.playSfx(ammoSkillId, explosionEffect)
         
         smokePillarEffect = SmokePillar.getEffect(unlimited)
         if smokePillarEffect:
             smokePillarEffect.reparentTo(hitObject)
             smokePillarEffect.setPos(hitObject, pos)
             smokePillarEffect.setScale(1.0)
             smokePillarEffect.spriteScale = 1.0
             smokePillarEffect.radius = 7.0
             smokePillarEffect.play()
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             dustRingEffect = DustRing.getEffect(unlimited)
             if dustRingEffect:
                 dustRingEffect.reparentTo(hitObject)
                 dustRingEffect.setPos(hitObject, pos)
                 dustRingEffect.play()
             
             shockwaveRingEffect = ShockwaveRing.getEffect()
             if shockwaveRingEffect:
                 shockwaveRingEffect.reparentTo(base.effectsRoot)
                 shockwaveRingEffect.setPos(hitObject, pos)
                 shockwaveRingEffect.size = aoeRadius * 4
                 shockwaveRingEffect.play()
             
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.wrtReparentTo(hitObject)
             cameraShakerEffect.setPos(hitObject, pos)
             cameraShakerEffect.shakeSpeed = 0.059999999999999998
             cameraShakerEffect.shakePower = 4.0
             cameraShakerEffect.numShakes = 2
             cameraShakerEffect.scalePower = 1
             cameraShakerEffect.play(80.0)
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             shipSplintersAEffect = ShipSplintersA.getEffect(unlimited)
             if shipSplintersAEffect:
                 shipSplintersAEffect.reparentTo(hitObject)
                 shipSplintersAEffect.setPos(hitObject, pos)
                 shipSplintersAEffect.play()
             
             for i in range(random.randint(3, 6)):
                 debrisEffect = RockDebris.getEffect(unlimited)
                 if debrisEffect:
                     debrisEffect.reparentTo(base.effectsRoot)
                     debrisEffect.setPos(hitObject, pos)
                     debrisEffect.offsetEndPlaneZFrom(hitObject.getZ())
                     debrisEffect.debris.setScale(0.80000000000000004)
                     debrisEffect.radiusDist = 30
                     debrisEffect.minHeight = 30
                     debrisEffect.maxHeight = 120
                     if debrisEffect.testTrajectory():
                         debrisEffect.play()
                     else:
                         debrisEffect.cleanUpEffect()
                 debrisEffect.testTrajectory()
             
             flashEffect = MuzzleFlash.getEffect(unlimited)
             if flashEffect:
                 flashEffect.reparentTo(base.effectsRoot)
                 flashEffect.flash.setScale(200)
                 flashEffect.setPos(hitObject, pos)
                 flashEffect.startCol = Vec4(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1)
                 flashEffect.fadeTime = 0.20000000000000001
                 flashEffect.play()
             
         
     elif ammoSkillId == InventoryType.GrenadeFireBomb:
         fireEffect = Fire.getEffect(unlimited)
         if fireEffect:
             fireEffect.wrtReparentTo(base.effectsRoot)
             fireEffect.setPos(hitObject, pos + Vec3(0, 0, -1.5))
             fireEffect.setScale(Vec3(0.75, 0.75, 0.75))
             fireEffect.duration = 2.5
             fireEffect.play()
         
         flashEffect = MuzzleFlash.getEffect(unlimited)
         if flashEffect:
             flashEffect.wrtReparentTo(base.effectsRoot)
             flashEffect.flash.setScale(100)
             flashEffect.setPos(hitObject, pos)
             flashEffect.startCol = Vec4(0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1)
             flashEffect.fadeTime = 0.20000000000000001
             flashEffect.play()
             self.playSfx(ammoSkillId, flashEffect)
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
             if shockwaveRingEffect:
                 shockwaveRingEffect.wrtReparentTo(base.effectsRoot)
                 shockwaveRingEffect.setPos(hitObject, pos)
                 shockwaveRingEffect.size = aoeRadius * 4
                 shockwaveRingEffect.play()
             
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.wrtReparentTo(hitObject)
             cameraShakerEffect.setPos(hitObject, pos)
             cameraShakerEffect.shakeSpeed = 0.040000000000000001
             cameraShakerEffect.shakePower = 2.0
             cameraShakerEffect.numShakes = 2
             cameraShakerEffect.scalePower = 1
             cameraShakerEffect.play(80.0)
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             blackSmokeEffect = LightSmoke.getEffect(unlimited)
             if blackSmokeEffect:
                 blackSmokeEffect.wrtReparentTo(base.effectsRoot)
                 blackSmokeEffect.setPos(hitObject, pos)
                 blackSmokeEffect.duration = 4.0
                 blackSmokeEffect.play()
             
         
     elif ammoSkillId == InventoryType.GrenadeSmokeCloud:
         explosionEffect = ExplosionFlip.getEffect(unlimited)
         if explosionEffect:
             explosionEffect.reparentTo(base.effectsRoot)
             explosionEffect.setPos(hitObject, pos)
             explosionEffect.setScale(1.0)
             explosionEffect.play()
             self.playSfx(ammoSkillId, explosionEffect)
         
         smokeCloudEffect = SmokeBomb.getEffect(unlimited)
         if smokeCloudEffect:
             smokeCloudEffect.reparentTo(hitObject)
             smokeCloudEffect.setPos(hitObject, pos)
             smokeCloudEffect.radius = aoeRadius / 1.5
             smokeCloudEffect.play()
             self.playSfx(ammoSkillId, smokeCloudEffect)
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
             shockwaveRingEffect = ShockwaveRing.getEffect(unlimited)
             if shockwaveRingEffect:
                 shockwaveRingEffect.wrtReparentTo(base.effectsRoot)
                 shockwaveRingEffect.setPos(hitObject, pos)
                 shockwaveRingEffect.size = aoeRadius * 4
                 shockwaveRingEffect.play()
             
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.wrtReparentTo(hitObject)
             cameraShakerEffect.setPos(hitObject, pos)
             cameraShakerEffect.shakeSpeed = 0.040000000000000001
             cameraShakerEffect.shakePower = 2.0
             cameraShakerEffect.numShakes = 2
             cameraShakerEffect.scalePower = 1
             cameraShakerEffect.play(80.0)
 def startBurning(self):
     if not self.postInvasionObjs:
         return None
     
     parent = self.postInvasionObjs[0].getParent()
     builder = self.getParentObj().builder
     uid = parent.getNetTag('uid')
     visZone = parent.getNetTag('visZone')
     effectList = []
     if not self.fire_one:
         self.fire_one = Fire.getEffect(1)
     
     if self.fire_one:
         self.fire_one.reparentTo(parent)
         self.fire_one.setPos(-62, -15, 28)
         self.fire_one.setEffectScale(0.75)
         self.fire_one.setTag('uid', uid)
         self.fire_one.setTag('visZone', visZone)
         builder.registerEffect(self.fire_one)
         effectList.append(self.fire_one)
     
     if not self.fire_two:
         self.fire_two = Fire.getEffect(1)
     
     if self.fire_two:
         self.fire_two.reparentTo(parent)
         self.fire_two.setPos(-40, -15, 28)
         self.fire_two.setEffectScale(0.75)
         self.fire_two.setTag('uid', uid)
         self.fire_two.setTag('visZone', visZone)
         builder.registerEffect(self.fire_two)
         effectList.append(self.fire_two)
     
     if not self.fire_three:
         self.fire_three = Fire.getEffect(1)
     
     if self.fire_three:
         self.fire_three.reparentTo(parent)
         self.fire_three.setPos(60, -6, 35)
         self.fire_three.setEffectScale(1.5)
         self.fire_three.setTag('uid', uid)
         self.fire_three.setTag('visZone', visZone)
         builder.registerEffect(self.fire_three)
         effectList.append(self.fire_three)
     
     if not self.smoke_one:
         self.smoke_one = MansionSmoke.getEffect(1)
     
     if self.smoke_one:
         self.smoke_one.reparentTo(parent)
         self.smoke_one.setPos(-51, -4, 30)
         self.smoke_one.setEffectScale(1.0)
         self.smoke_one.setTag('uid', uid)
         self.smoke_one.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_one)
         effectList.append(self.smoke_one)
     
     if not self.smoke_two:
         self.smoke_two = MansionSmoke.getEffect(1)
     
     if self.smoke_one:
         self.smoke_two.reparentTo(parent)
         self.smoke_two.setPos(58, -4, 36)
         self.smoke_two.setEffectScale(1.0)
         self.smoke_two.setTag('uid', uid)
         self.smoke_two.setTag('visZone', visZone)
         builder.registerEffect(self.smoke_two)
         effectList.append(self.smoke_two)
     
     builder.validateEffectSet(set(effectList))
Ejemplo n.º 16
0
class FeastFire(NodePath):
    
    def __init__(self, effectParent = None):
        NodePath.__init__(self, uniqueName('FeastFire'))
        self._fire = Fire()
        self._splats = FireSplats()
        self._sparks = FireSparks()
        self._smoke = HeavySmoke()
        self._feastSmoke = FeastSmoke()
        self.fireSfx = loadSfx(SoundGlobals.SFX_FX_FIRE_LOOP)
        self.fireSfxIval = None
        if self._fire:
            self._fire.reparentTo(self)
            self._fire.effectScale = 1.0
        
        if self._splats:
            self._splats.reparentTo(self)
            self._splats.effectScale = 1.0
        
        if self._sparks:
            self._sparks.reparentTo(self)
            self._sparks.setPos(0, 0, 3)
        
        if self._smoke:
            self._smoke.reparentTo(self)
        
        if self._feastSmoke:
            self._feastSmoke.reparentTo(self)
        

    
    def setCustomSettings(self):
        if self._fire:
            self._fire.setScale(VBase3(1.5, 1, 1))
            self._fire.p0.factory.setLifespanBase(1.25)
            self._fire.p0.factory.setLifespanSpread(0.5)
            self._fire.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 15.0))
            self._fire.p0.emitter.setRadius(4.0)
        
        if self._splats:
            self._splats.setScale(VBase3(1.5, 1, 1))
            self._splats.p0.factory.setLifespanBase(1.3)
            self._splats.p0.factory.setLifespanSpread(0.5)
            self._splats.p0.emitter.setOffsetForce(Vec3(0.0, 0.0, 18.0))
            self._splats.p0.emitter.setRadius(4.0)
        
        if self._sparks:
            self._sparks.setScale(VBase3(1.25, 1, 1))
            self._sparks.p0.factory.setLifespanBase(1.5)
            self._sparks.p0.factory.setLifespanSpread(0.5)
            self._sparks.p0.emitter.setOffsetForce(Vec3(2.0, 2.0, 24.0))
            self._sparks.p0.emitter.setRadius(6.0)
        
        if self._smoke:
            self._smoke.setScale(VBase3(1.25, 1, 1))
            self._smoke.p0.emitter.setOffsetForce(Vec3(2.0, 2.0, 30.0))
            self._smoke.p0.emitter.setRadius(5.0)
        

    
    def startMainEffects(self):
        effectSetting = base.options.getSpecialEffectsSetting()
        if self._fire:
            self._fire.enable()
        
        if self._splats and effectSetting >= base.options.SpecialEffectsHigh:
            self._splats.enable()
        
        if self._sparks and effectSetting >= base.options.SpecialEffectsMedium:
            self._sparks.enable()
        
        if self._smoke:
            self._smoke.enable()
        
        if self.fireSfx:
            self.fireSfxIval = SoundInterval(self.fireSfx, node = self, seamlessLoop = False)
            self.fireSfxIval.loop()
        

    
    def stopMainEffects(self):
        if self._fire:
            self._fire.disable()
        
        if self._splats:
            self._splats.disable()
        
        if self._sparks:
            self._sparks.disable()
        
        if self._smoke:
            self._smoke.disable()
        
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        

    
    def startFarEffects(self):
        if self._feastSmoke:
            self._feastSmoke.enable()
            self._feastSmoke.accelerate()
        

    
    def stopFarEffects(self):
        if self._feastSmoke:
            self._feastSmoke.disable()
        

    
    def stopLoop(self):
        if self._fire:
            self._fire.disable()
        
        if self._splats:
            self._splats.disable()
        
        if self._sparks:
            self._sparks.disable()
        
        if self._smoke:
            self._smoke.disable()
        
        if self._feastSmoke:
            self._feastSmoke.disable()
        
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        

    
    def destroy(self):
        if self._fire:
            self._fire.destroy()
        
        if self._splats:
            self._splats.destroy()
        
        if self._sparks:
            self._sparks.destroy()
        
        if self._smoke:
            self._smoke.destroy()
        
        if self._feastSmoke:
            self._feastSmoke.destroy()
        
        if self.fireSfxIval:
            self.fireSfxIval.finish()
            self.fireSfxIval = None
        
        del self._fire
        del self._splats
        del self._sparks
        del self._smoke
        del self._feastSmoke
        del self.fireSfx