def getStartNatureAura(self, av): unlimited = av.isLocal() flashEffect = FlashEffect() flashEffect.reparentTo(av) flashEffect.setPos(0, 0, 2.0) flashEffect.setScale(15.0) flashEffect.fadeTime = 1.0 flashEffect.setEffectColor(Vec4(0.29999999999999999, 1, 0.5, 1)) animSeq = Sequence(Wait(0.5)) animSeq.append(Func(flashEffect.play)) healBlast = VoodooHealBlast.getEffect(unlimited) if healBlast: healBlast.reparentTo(av) healBlast.setPos(0, 0, 2.5) animSeq.append(Func(healBlast.play)) animSeq.append(Wait(0.10000000000000001)) burstEffect = VoodooAuraBurst.getEffect(unlimited) if burstEffect: burstEffect.reparentTo(av) burstEffect.setPos(0, 0, 0.25) burstEffect.setEffectColor(Vec4(0.29999999999999999, 1, 0.5, 0.5)) animSeq.append(Func(burstEffect.play)) return animSeq
def getStartWardingAura(self, av): unlimited = av.isLocal() flashEffect = FlashEffect() flashEffect.reparentTo(av) flashEffect.setPos(0, 0, 2.0) flashEffect.setScale(15.0) flashEffect.fadeTime = 1.0 flashEffect.setEffectColor(Vec4(0.40000000000000002, 0.59999999999999998, 1, 1)) animSeq = Sequence(Wait(0.5)) animSeq.append(Func(flashEffect.play)) shieldBlast = VoodooShieldBlast.getEffect(unlimited) if shieldBlast: shieldBlast.reparentTo(av) shieldBlast.setPos(0, 0, 1.5) animSeq.append(Func(shieldBlast.play)) animSeq.append(Wait(0.10000000000000001)) burstEffect = VoodooAuraBurst.getEffect(unlimited) if burstEffect: burstEffect.reparentTo(av) burstEffect.setPos(0, 0, 0.25) burstEffect.setEffectColor(Vec4(0.40000000000000002, 0.59999999999999998, 1, 0.59999999999999998)) animSeq.append(Func(burstEffect.play)) return animSeq
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 getStartNatureAura(self, av): unlimited = av.isLocal() flashEffect = FlashEffect() flashEffect.reparentTo(av) flashEffect.setPos(0, 0, 2.0) flashEffect.setScale(15.0) flashEffect.fadeTime = 1.0 flashEffect.setEffectColor(Vec4(0.3, 1, 0.5, 1)) animSeq = Sequence(Wait(0.5)) animSeq.append(Func(flashEffect.play)) healBlast = VoodooHealBlast.getEffect(unlimited) if healBlast: healBlast.reparentTo(av) healBlast.setPos(0, 0, 2.5) animSeq.append(Func(healBlast.play)) animSeq.append(Wait(0.1)) burstEffect = VoodooAuraBurst.getEffect(unlimited) if burstEffect: burstEffect.reparentTo(av) burstEffect.setPos(0, 0, 0.25) burstEffect.setEffectColor(Vec4(0.3, 1, 0.5, 0.5)) animSeq.append(Func(burstEffect.play)) return animSeq
def getStartWardingAura(self, av): unlimited = av.isLocal() flashEffect = FlashEffect() flashEffect.reparentTo(av) flashEffect.setPos(0, 0, 2.0) flashEffect.setScale(15.0) flashEffect.fadeTime = 1.0 flashEffect.setEffectColor(Vec4(0.4, 0.6, 1, 1)) animSeq = Sequence(Wait(0.5)) animSeq.append(Func(flashEffect.play)) shieldBlast = VoodooShieldBlast.getEffect(unlimited) if shieldBlast: shieldBlast.reparentTo(av) shieldBlast.setPos(0, 0, 1.5) animSeq.append(Func(shieldBlast.play)) animSeq.append(Wait(0.1)) burstEffect = VoodooAuraBurst.getEffect(unlimited) if burstEffect: burstEffect.reparentTo(av) burstEffect.setPos(0, 0, 0.25) burstEffect.setEffectColor(Vec4(0.4, 0.6, 1, 0.6)) animSeq.append(Func(burstEffect.play)) return animSeq
def getBurstEffectsIval(self): if not self.burstEffectsIval: self.burstEffectsIval = Parallel() if self.burstTypeId is None: return self.burstEffectsIval theSoundInterval = SoundInterval(random.choice(self.burstSfx), node=self.effectsNode, cutOff=8000) self.burstEffectsIval.append( Func(self.setupSoundVolume, theSoundInterval)) self.burstEffectsIval.append(theSoundInterval) flash = FlashEffect() flash.reparentTo(self.effectsNode) flash.setEffectColor(self.primaryColor) flash.setScale(1200 * self.scale) flash.fadeTime = 0.5 self.burstEffectsIval.append(flash.getTrack()) self.burstEffects.append(flash) primaryBlast = BlastEffect() primaryBlast.reparentTo(self.effectsNode) primaryBlast.setScale(100 * self.scale) primaryBlast.setEffectColor(Vec4(1, 1, 1, 1)) primaryBlast.fadeTime = 0.75 self.burstEffectsIval.append(primaryBlast.getTrack()) self.burstEffects.append(primaryBlast) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: secondaryBlast = BlastEffect() secondaryBlast.reparentTo(self.effectsNode) secondaryBlast.setScale(250 * self.scale) secondaryBlast.setEffectColor(self.primaryColor) secondaryBlast.fadeTime = 0.29999999999999999 self.burstEffectsIval.append(secondaryBlast.getTrack()) self.burstEffects.append(secondaryBlast) if self.burstTypeId == FireworkBurstType.Sparkles: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.primaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.PeonyShell: explosion = PeonyEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.0 self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setEffectColor(self.primaryColor) sparkles.startDelay = 0.0 self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsMedium: explosion = PeonyEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale * 0.80000000000000004) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.14999999999999999 explosion.setR(220) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) elif self.burstTypeId == FireworkBurstType.PeonyParticleShell: explosion = StarBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale * 0.75) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) elif self.burstTypeId == FireworkBurstType.PeonyDiademShell: explosion = StarBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.ChrysanthemumShell: explosion = ChrysanthemumEffect() explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale * 0.80000000000000004) sparkles.setEffectColor(self.primaryColor) sparkles.startDelay = 0.20000000000000001 self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.ChrysanthemumDiademShell: explosion = ChrysanthemumEffect() explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.RingShell: explosion = RingEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) elif self.burstTypeId == FireworkBurstType.SaturnShell: explosion = RingEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(75 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.BeeShell: explosion = NoiseSparkles.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append( Sequence(Wait(0.10000000000000001), explosion.getTrack())) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) elif self.burstTypeId == FireworkBurstType.SkullBlast: explosion = SkullBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.10000000000000001 self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) skullFlash = SkullFlash.getEffect() if skullFlash: skullFlash.reparentTo(self.effectsNode) skullFlash.setScale(650 * self.scale) skullFlash.fadeTime = 0.75 skullFlash.startDelay = 0.080000000000000002 self.burstEffectsIval.append(skullFlash.getTrack()) self.burstEffects.append(skullFlash) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(400 * self.scale) sparkles.startDelay = 0.10000000000000001 sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.TrailExplosion: explosion = TrailExplosion.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.numTrails = 3 + base.options.getSpecialEffectsSetting( ) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) return self.burstEffectsIval
def getBurstEffectsIval(self): if not self.burstEffectsIval: self.burstEffectsIval = Parallel() if self.burstTypeId is None: return self.burstEffectsIval theSoundInterval = SoundInterval(random.choice(self.burstSfx), node = self.effectsNode, cutOff = 8000) self.burstEffectsIval.append(Func(self.setupSoundVolume, theSoundInterval)) self.burstEffectsIval.append(theSoundInterval) flash = FlashEffect() flash.reparentTo(self.effectsNode) flash.setEffectColor(self.primaryColor) flash.setScale(1200 * self.scale) flash.fadeTime = 0.5 self.burstEffectsIval.append(flash.getTrack()) self.burstEffects.append(flash) primaryBlast = BlastEffect() primaryBlast.reparentTo(self.effectsNode) primaryBlast.setScale(100 * self.scale) primaryBlast.setEffectColor(Vec4(1, 1, 1, 1)) primaryBlast.fadeTime = 0.75 self.burstEffectsIval.append(primaryBlast.getTrack()) self.burstEffects.append(primaryBlast) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: secondaryBlast = BlastEffect() secondaryBlast.reparentTo(self.effectsNode) secondaryBlast.setScale(250 * self.scale) secondaryBlast.setEffectColor(self.primaryColor) secondaryBlast.fadeTime = 0.29999999999999999 self.burstEffectsIval.append(secondaryBlast.getTrack()) self.burstEffects.append(secondaryBlast) if self.burstTypeId == FireworkBurstType.Sparkles: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.primaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.PeonyShell: explosion = PeonyEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.0 self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setEffectColor(self.primaryColor) sparkles.startDelay = 0.0 self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsMedium: explosion = PeonyEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale * 0.80000000000000004) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.14999999999999999 explosion.setR(220) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) elif self.burstTypeId == FireworkBurstType.PeonyParticleShell: explosion = StarBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale * 0.75) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) elif self.burstTypeId == FireworkBurstType.PeonyDiademShell: explosion = StarBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.ChrysanthemumShell: explosion = ChrysanthemumEffect() explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale * 0.80000000000000004) sparkles.setEffectColor(self.primaryColor) sparkles.startDelay = 0.20000000000000001 self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.ChrysanthemumDiademShell: explosion = ChrysanthemumEffect() explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(100 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.RingShell: explosion = RingEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) elif self.burstTypeId == FireworkBurstType.SaturnShell: explosion = RingEffect.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) sparkles = SimpleSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(75 * self.scale) sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.BeeShell: explosion = NoiseSparkles.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) self.burstEffectsIval.append(Sequence(Wait(0.10000000000000001), explosion.getTrack())) self.burstEffects.append(explosion) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) elif self.burstTypeId == FireworkBurstType.SkullBlast: explosion = SkullBurst.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.startDelay = 0.10000000000000001 self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) skullFlash = SkullFlash.getEffect() if skullFlash: skullFlash.reparentTo(self.effectsNode) skullFlash.setScale(650 * self.scale) skullFlash.fadeTime = 0.75 skullFlash.startDelay = 0.080000000000000002 self.burstEffectsIval.append(skullFlash.getTrack()) self.burstEffects.append(skullFlash) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: rays = RayBurst() rays.reparentTo(self.effectsNode) rays.setEffectScale(self.scale) rays.setEffectColor(self.primaryColor) self.burstEffectsIval.append(rays.getTrack()) self.burstEffects.append(rays) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh: sparkles = FireworkSparkles.getEffect() if sparkles: sparkles.reparentTo(self.effectsNode) sparkles.setEffectScale(self.scale) sparkles.setRadius(400 * self.scale) sparkles.startDelay = 0.10000000000000001 sparkles.setEffectColor(self.secondaryColor) self.burstEffectsIval.append(sparkles.getTrack()) self.burstEffects.append(sparkles) elif self.burstTypeId == FireworkBurstType.TrailExplosion: explosion = TrailExplosion.getEffect() if explosion: explosion.reparentTo(self.effectsNode) explosion.setEffectScale(self.scale) explosion.setEffectColor(self.primaryColor) explosion.numTrails = 3 + base.options.getSpecialEffectsSetting() self.burstEffectsIval.append(explosion.getTrack()) self.burstEffects.append(explosion) return self.burstEffectsIval
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)