Exemple #1
0
    def playFireEffect(self, spawnNode, ammoSkillId):
        if self.localAvatarUsingWeapon:
            boomSfx = random.choice(self.localFireSfx)
        else:
            boomSfx = random.choice(self.distFireSfx)
        base.playSfx(boomSfx, node=spawnNode, cutoff=3000)
        scaleMult = 0.75 + random.random()
        if base.options.getSpecialEffectsSetting(
        ) >= base.options.SpecialEffectsMedium:
            muzzleFlameEffect = MuzzleFlame.getEffect()
            if muzzleFlameEffect:
                muzzleFlameEffect.reparentTo(self.ship.getTransNode())
                muzzleFlameEffect.setHpr(spawnNode, 0, 90, 0)
                muzzleFlameEffect.setPos(spawnNode, 0, -6, 0)
                muzzleFlameEffect.setScale(2.0 * scaleMult)
                muzzleFlameEffect.play()

        if base.options.getSpecialEffectsSetting(
        ) == base.options.SpecialEffectsMedium:
            cannonSmokeEffect = CannonSmokeSimple.getEffect()
            if cannonSmokeEffect:
                cannonSmokeEffect.reparentTo(self.ship.getTransNode())
                cannonSmokeEffect.effectModel.unstash()
                cannonSmokeEffect.setHpr(spawnNode, 0, 90, 0)
                cannonSmokeEffect.setPos(spawnNode, 0, -15, 0)
                cannonSmokeEffect.setScale(2.2000000000000002 * scaleMult)
                cannonSmokeEffect.play()

        if base.options.getSpecialEffectsSetting(
        ) >= base.options.SpecialEffectsHigh:
            cannonSmokeEffect = CannonBlastSmoke.getEffect()
            if cannonSmokeEffect:
                cannonSmokeEffect.reparentTo(self.ship.getTransNode())
                cannonSmokeEffect.particleDummy.reparentTo(
                    self.ship.getTransNode())
                cannonSmokeEffect.setPosHpr(spawnNode, 0, -3, 0, 180, 0, 0)
                cannonSmokeEffect.particleDummy.setHpr(spawnNode, 180, 0, 0)
                cannonSmokeEffect.setEffectScale(1.8 * scaleMult)
                cannonSmokeEffect.play()

        if base.options.getSpecialEffectsSetting(
        ) >= base.options.SpecialEffectsLow:
            if ammoSkillId == InventoryType.CannonGrapeShot:
                effect = GrapeshotEffect.getEffect()
                if effect:
                    effect.reparentTo(self.ship.getTransNode())
                    effect.setPosHpr(spawnNode, 0, 0, 0, -90, 0, 0)
                    effect.time = 2.0
                    effect.play()
 def playFireEffect(self, spawnNode, ammoSkillId):
     if self.localAvatarUsingWeapon:
         boomSfx = random.choice(self.localFireSfx)
     else:
         boomSfx = random.choice(self.distFireSfx)
     base.playSfx(boomSfx, node = spawnNode, cutoff = 3000)
     scaleMult = 0.75 + random.random()
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
         muzzleFlameEffect = MuzzleFlame.getEffect()
         if muzzleFlameEffect:
             muzzleFlameEffect.reparentTo(self.ship.getTransNode())
             muzzleFlameEffect.setHpr(spawnNode, 0, 90, 0)
             muzzleFlameEffect.setPos(spawnNode, 0, -6, 0)
             muzzleFlameEffect.setScale(2.0 * scaleMult)
             muzzleFlameEffect.play()
         
     
     if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsMedium:
         cannonSmokeEffect = CannonSmokeSimple.getEffect()
         if cannonSmokeEffect:
             cannonSmokeEffect.reparentTo(self.ship.getTransNode())
             cannonSmokeEffect.effectModel.unstash()
             cannonSmokeEffect.setHpr(spawnNode, 0, 90, 0)
             cannonSmokeEffect.setPos(spawnNode, 0, -15, 0)
             cannonSmokeEffect.setScale(2.2000000000000002 * scaleMult)
             cannonSmokeEffect.play()
         
     
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
         cannonSmokeEffect = CannonBlastSmoke.getEffect()
         if cannonSmokeEffect:
             cannonSmokeEffect.reparentTo(self.ship.getTransNode())
             cannonSmokeEffect.particleDummy.reparentTo(self.ship.getTransNode())
             cannonSmokeEffect.setPosHpr(spawnNode, 0, -3, 0, 180, 0, 0)
             cannonSmokeEffect.particleDummy.setHpr(spawnNode, 180, 0, 0)
             cannonSmokeEffect.setEffectScale(1.8 * scaleMult)
             cannonSmokeEffect.play()
         
     
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
         if ammoSkillId == InventoryType.CannonGrapeShot:
             effect = GrapeshotEffect.getEffect()
             if effect:
                 effect.reparentTo(self.ship.getTransNode())
                 effect.setPosHpr(spawnNode, 0, 0, 0, -90, 0, 0)
                 effect.time = 2.0
                 effect.play()
 def playFireEffect(self, ammoSkillId = 0, buffs = []):
     self.playSoundEffect(ammoSkillId)
     if self.ship:
         effectParent = self.ship.getModelRoot()
         relativeNode = self.cannonExitPoint
     else:
         effectParent = self
         relativeNode = self.cannonExitPoint
     effectParent.clearColorScale()
     effectH = self.hNode.getH(effectParent)
     effectP = self.pivot.getP(effectParent)
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
         muzzleFlameEffect = MuzzleFlame.getEffect()
         if muzzleFlameEffect:
             muzzleFlameEffect.reparentTo(effectParent)
             muzzleFlameEffect.setHpr(relativeNode, 0, -90, 0)
             muzzleFlameEffect.setPos(relativeNode, 0, 0, 0)
             muzzleFlameEffect.setScale(1.0)
             muzzleFlameEffect.play()
         
     
     if not self.localAvatarUsingWeapon:
         if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsMedium:
             cannonSmokeEffect = CannonSmokeSimple.getEffect()
             if cannonSmokeEffect:
                 cannonSmokeEffect.reparentTo(effectParent)
                 cannonSmokeEffect.effectModel.unstash()
                 cannonSmokeEffect.setHpr(relativeNode, 0, -90, 0)
                 cannonSmokeEffect.setPos(relativeNode, 0, 1, 0)
                 cannonSmokeEffect.setScale(1.0)
                 cannonSmokeEffect.play()
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             cannonSmokeEffect = CannonBlastSmoke.getEffect()
             if cannonSmokeEffect:
                 cannonSmokeEffect.reparentTo(effectParent)
                 cannonSmokeEffect.particleDummy.reparentTo(effectParent)
                 cannonSmokeEffect.setHpr(effectParent, effectH, effectP, 0)
                 cannonSmokeEffect.particleDummy.setHpr(effectParent, effectH, effectP, 0)
                 cannonSmokeEffect.setPos(relativeNode, 0, 0, 0)
                 cannonSmokeEffect.setEffectScale(1.0)
                 cannonSmokeEffect.play()
             
         
     elif base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
         cannonSmokeEffect = CannonSmokeSimple.getEffect()
         if cannonSmokeEffect:
             cannonSmokeEffect.reparentTo(effectParent)
             cannonSmokeEffect.effectModel.stash()
             cannonSmokeEffect.setHpr(relativeNode, 0, -90, 0)
             cannonSmokeEffect.setPos(relativeNode, 0, 1, 0)
             cannonSmokeEffect.setScale(1.0)
             cannonSmokeEffect.play()
         
     
     if self.recoilIval:
         self.recoilIval.pause()
         self.recoilIval.start()
     
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
         if WeaponConstants.C_OPENFIRE in buffs:
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.reparentTo(effectParent)
             cameraShakerEffect.shakeSpeed = 0.029999999999999999
             cameraShakerEffect.shakePower = 0.69999999999999996
             cameraShakerEffect.numShakes = 1
             cameraShakerEffect.play(10.0)
Exemple #4
0
 def playFireEffect(self, ammoSkillId = 0, buffs = []):
     self.playSoundEffect(ammoSkillId)
     if self.ship:
         effectParent = self.ship.getModelRoot()
         relativeNode = self.cannonExitPoint
     else:
         effectParent = self
         relativeNode = self.cannonExitPoint
     effectParent.clearColorScale()
     effectH = self.hNode.getH(effectParent)
     effectP = self.pivot.getP(effectParent)
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow:
         muzzleFlameEffect = MuzzleFlame.getEffect()
         if muzzleFlameEffect:
             muzzleFlameEffect.reparentTo(effectParent)
             muzzleFlameEffect.setHpr(relativeNode, 0, -90, 0)
             muzzleFlameEffect.setPos(relativeNode, 0, 0, 0)
             muzzleFlameEffect.setScale(1.0)
             muzzleFlameEffect.play()
         
     
     if not self.localAvatarUsingWeapon:
         if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsMedium:
             cannonSmokeEffect = CannonSmokeSimple.getEffect()
             if cannonSmokeEffect:
                 cannonSmokeEffect.reparentTo(effectParent)
                 cannonSmokeEffect.effectModel.unstash()
                 cannonSmokeEffect.setHpr(relativeNode, 0, -90, 0)
                 cannonSmokeEffect.setPos(relativeNode, 0, 1, 0)
                 cannonSmokeEffect.setScale(1.0)
                 cannonSmokeEffect.play()
             
         
         if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
             cannonSmokeEffect = CannonBlastSmoke.getEffect()
             if cannonSmokeEffect:
                 cannonSmokeEffect.reparentTo(effectParent)
                 cannonSmokeEffect.particleDummy.reparentTo(effectParent)
                 cannonSmokeEffect.setHpr(effectParent, effectH, effectP, 0)
                 cannonSmokeEffect.particleDummy.setHpr(effectParent, effectH, effectP, 0)
                 cannonSmokeEffect.setPos(relativeNode, 0, 0, 0)
                 cannonSmokeEffect.setEffectScale(1.0)
                 cannonSmokeEffect.play()
             
         
     elif base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium:
         cannonSmokeEffect = CannonSmokeSimple.getEffect()
         if cannonSmokeEffect:
             cannonSmokeEffect.reparentTo(effectParent)
             cannonSmokeEffect.effectModel.stash()
             cannonSmokeEffect.setHpr(relativeNode, 0, -90, 0)
             cannonSmokeEffect.setPos(relativeNode, 0, 1, 0)
             cannonSmokeEffect.setScale(1.0)
             cannonSmokeEffect.play()
         
     
     if self.recoilIval:
         self.recoilIval.pause()
         self.recoilIval.start()
     
     if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh:
         if WeaponConstants.C_OPENFIRE in buffs:
             cameraShakerEffect = CameraShaker()
             cameraShakerEffect.reparentTo(effectParent)
             cameraShakerEffect.shakeSpeed = 0.029999999999999999
             cameraShakerEffect.shakePower = 0.69999999999999996
             cameraShakerEffect.numShakes = 1
             cameraShakerEffect.play(10.0)