def announceGenerate(self): DistributedObject.announceGenerate(self) if self.ship is None or self.pirateTarget is None or self.ship.isEmpty() or self.pirateTarget.isEmpty(): self.sendUpdate('shotDown') return self.barrelModel = loader.loadModel('models/ammunition/pir_m_gam_can_powderKeg') self.barrelModel.setScale(2.0) base.playSfx(self.launchSound, node=self.barrelModel, cutoff=2000) self.barrelModel.reparentTo(self.ship) self.barrelModel.setPos(0, 0, 10) self.barrelModel.wrtReparentTo(self.pirateTarget) self.makeCollNode() self.barrelModel.setTag('objType', str(PiratesGlobals.COLL_FLAMING_BARREL)) self.collNode.setPythonTag('barrel', self) self.projectileInterval = Parallel(ProjectileInterval(self.barrelModel, endPos=Point3(0.0, 0.0, 4.5), duration=self.flightDuration, gravityMult=CannonDefenseGlobals.BARREL_GRAVITY), self.barrelModel.hprInterval(self.flightDuration, Vec3(720, 640, 440)), Sequence(Wait(self.flightDuration - 1.2), Func(base.playSfx, self.closeSound, node=self.barrelModel, cutoff=2000), Wait(1.2), Func(self.hitTarget)), name=self.uniqueName('FlamingBarrelFlying')) self.collNode.reparentTo(self.barrelModel) self.projectileInterval.start() base.cTrav.addCollider(self.collNode, self.collHandler) base.cr.activeWorld.flamingBarrels.append(self) self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(self.barrelModel) self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.wantBlur = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh self.trailEffect.startLoop() return
def announceGenerate(self): DistributedObject.announceGenerate(self) if self.ship is None and self.pirateTarget is None and self.ship.isEmpty() or self.pirateTarget.isEmpty(): self.sendUpdate('shotDown') return None self.barrelModel = loader.loadModel('models/ammunition/pir_m_gam_can_powderKeg') self.barrelModel.setScale(2.0) base.playSfx(self.launchSound, node = self.barrelModel, cutoff = 2000) self.barrelModel.reparentTo(self.ship) self.barrelModel.setPos(0, 0, 10) self.barrelModel.wrtReparentTo(self.pirateTarget) self.makeCollNode() self.barrelModel.setTag('objType', str(PiratesGlobals.COLL_FLAMING_BARREL)) self.collNode.setPythonTag('barrel', self) self.projectileInterval = Parallel(ProjectileInterval(self.barrelModel, endPos = Point3(0.0, 0.0, 4.5), duration = self.flightDuration, gravityMult = CannonDefenseGlobals.BARREL_GRAVITY), self.barrelModel.hprInterval(self.flightDuration, Vec3(720, 640, 440)), Sequence(Wait(self.flightDuration - 1.2), Func(base.playSfx, self.closeSound, node = self.barrelModel, cutoff = 2000), Wait(1.2), Func(self.hitTarget)), name = self.uniqueName('FlamingBarrelFlying')) self.collNode.reparentTo(self.barrelModel) self.projectileInterval.start() base.cTrav.addCollider(self.collNode, self.collHandler) base.cr.activeWorld.flamingBarrels.append(self) self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(self.barrelModel) self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.wantBlur = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh self.trailEffect.startLoop()
def loadModel(self): self.mtrail = None self.strail = None self.scaleIval = None maxGlowScale = 8 minGlowScale = 7 if not base.config.GetBool('want-special-effects', 1): cannonball = loader.loadModel('models/ammunition/cannonball') elif self.ammoSkillId in (InventoryType.CannonRoundShot, InventoryType.CannonGrapeShot): cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonChainShot: cannonball = loader.loadModel('models/ammunition/chainShot') ball1 = cannonball.find('**/ball_0') ball1.setBillboardPointEye() ball2 = cannonball.find('**/ball_1') ball2.setBillboardPointEye() if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: randVal = random.uniform(-180.0, 180.0) randSpeed = random.uniform(-0.10000000000000001, 0.10000000000000001) randDirection = 1 self.effectIval = cannonball.hprInterval( 0.40000000000000002 + randSpeed, Point3(randVal, 360 * randDirection, 0), startHpr=Point3(randVal, 0, 0)) self.effectIval.loop() if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self, self.chainshot_vertex_list) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonFirebrand: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonFlamingSkull or self.ammoSkillId == InventoryType.CannonFirebrand: maxGlowScale = 28 minGlowScale = 24 cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonFury: maxGlowScale = 40 minGlowScale = 30 cannonball = self.attachNewNode('cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = FuryTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.wantBlur = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonComet: cannonball = self.attachNewNode('cannonball') cannonball1 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball1) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball2 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball2) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball3 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball3) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball1.reparentTo(cannonball) cannonball1.setPos(0, 4, -4) cannonball2.reparentTo(cannonball) cannonball2.setPos(0, -4, -4) cannonball3.reparentTo(cannonball) cannonball3.setPos(0, 0, 4) self.effectIval = cannonball.hprInterval(1.0, Point3(0, 0, 360), startHpr=Point3(0, 0, 0)) self.effectIval.loop() elif self.ammoSkillId == InventoryType.CannonGrappleHook: cannonball = loader.loadModel('models/ammunition/GrapplingHook') cannonball.flattenStrong() prop = cannonball.getChild(0) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.effectIval = Sequence( LerpHprInterval(prop, 2.0, Point3(0, 0, 360), startHpr=Point3(0, 0, 0))) self.effectIval.loop() if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh: self.createMotionTrails(self, self.small_vertex_list) if base.options.getSpecialEffectsSetting( ) <= base.options.SpecialEffectsMedium: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonThunderbolt: maxGlowScale = 19 minGlowScale = 15 cannonball = self.attachNewNode('cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = ThunderBallGlow.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.setScale(0.5) self.trailEffect.startLoop() if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsHigh: self.glowA = loader.loadModel('models/effects/flareRing') self.glowA.node().setAttrib( ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowA.setDepthWrite(0) self.glowA.setFogOff() self.glowA.setLightOff() self.glowA.setBin('fixed', 120) self.glowA.setColorScale(0.5, 0.80000000000000004, 1, 0.5) self.glowA.reparentTo(cannonball) self.glowA.setBillboardPointEye() scaleUp = self.glowA.scaleInterval(0.10000000000000001, 4.5, startScale=3.5, blendType='easeInOut') scaleDown = self.glowA.scaleInterval(0.10000000000000001, 3.5, startScale=4.5, blendType='easeInOut') self.glowATrack = Sequence(scaleUp, scaleDown) self.glowATrack.loop() if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonExplosive: cannonball = loader.loadModel('models/ammunition/cannonball') else: cannonball = loader.loadModel('models/ammunition/cannonball') if self.ammoSkillId == InventoryType.CannonBullet: cannonball.setColor(0.84999999999999998, 0.84999999999999998, 0.66000000000000003, 1.0) elif self.ammoSkillId == InventoryType.CannonGasCloud: cannonball.setColor(0.55000000000000004, 1.0, 0.57999999999999996, 1.0) elif self.ammoSkillId == InventoryType.CannonSkull: cannonball.setColor(1.0, 0.55000000000000004, 0.55000000000000004, 1.0) elif self.ammoSkillId == InventoryType.CannonFlameCloud: cannonball.setColor(1.0, 0.10000000000000001, 0.90000000000000002, 1.0) elif self.ammoSkillId == InventoryType.CannonBarShot: cannonball.setColor(0.0, 0.10000000000000001, 0.75, 1.0) elif self.ammoSkillId == InventoryType.CannonKnives: cannonball.setColor(0.97999999999999998, 1.0, 0.34999999999999998, 1.0) elif self.ammoSkillId == InventoryType.CannonMine: cannonball.setColor(0.68999999999999995, 0.52000000000000002, 0.19, 1.0) elif self.ammoSkillId == InventoryType.CannonBarnacles: cannonball.setColor(0.050000000000000003, 0.65000000000000002, 0.029999999999999999, 1.0) if self.ammoSkillId == InventoryType.CannonGrapeShot: cannonball.setScale(0.80000000000000004) else: cannonball.setScale(2.0) if WeaponConstants.C_OPENFIRE in self.buffs: if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.glowB = loader.loadModel('models/effects/lanternGlow') self.glowB.node().setAttrib( ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowB.setDepthWrite(0) self.glowB.setFogOff() self.glowB.setLightOff() self.glowB.setBin('fixed', 120) self.glowB.setColorScale(1, 0.80000000000000004, 0.5, 0.90000000000000002) self.glowB.reparentTo(cannonball) self.glowB.setBillboardPointEye() scaleUp = self.glowB.scaleInterval(0.10000000000000001, maxGlowScale, startScale=minGlowScale, blendType='easeInOut') scaleDown = self.glowB.scaleInterval(0.10000000000000001, minGlowScale, startScale=maxGlowScale, blendType='easeInOut') self.glowBTrack = Sequence(scaleUp, scaleDown) self.glowBTrack.loop() return cannonball
def loadModel(self): self.mtrail = None self.strail = None self.scaleIval = None maxGlowScale = 8 minGlowScale = 7 if not base.config.GetBool('want-special-effects', 1): cannonball = loader.loadModel('models/ammunition/cannonball') else: if self.ammoSkillId == InventoryType.DefenseCannonRoundShot: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) else: if self.ammoSkillId == InventoryType.DefenseCannonHotShot: cannonball = loader.loadModel( 'models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() else: if self.ammoSkillId == InventoryType.CannonFlamingSkull or self.ammoSkillId == InventoryType.DefenseCannonHotShot: maxGlowScale = 28 minGlowScale = 24 cannonball = loader.loadModel( 'models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() else: if self.ammoSkillId == InventoryType.DefenseCannonPowderKeg: cannonball = loader.loadModel( 'models/ammunition/pir_m_gam_can_powderKeg') cannonball.setHpr(90, 0, 90) if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) else: cannonball = loader.loadModel( 'models/ammunition/cannonball') if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting( ) == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) cannonball.setScale(2.0) if self.ammoSkillId == InventoryType.DefenseCannonMine: cannonball.setColor(1.0, 0.0, 0.0, 1.0) cannonball.setScale(4.0) if self.ammoSkillId == InventoryType.DefenseCannonPowderKeg: cannonball.setScale(4.0) if WeaponConstants.C_OPENFIRE in self.buffs: if base.options.getSpecialEffectsSetting( ) >= base.options.SpecialEffectsLow: self.glowB = loader.loadModel('models/effects/lanternGlow') self.glowB.node().setAttrib( ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowB.setDepthWrite(0) self.glowB.setFogOff() self.glowB.setLightOff() self.glowB.setBin('fixed', 120) self.glowB.setColorScale(1, 0.8, 0.5, 0.9) self.glowB.reparentTo(cannonball) self.glowB.setBillboardPointEye() scaleUp = self.glowB.scaleInterval(0.1, maxGlowScale, startScale=minGlowScale, blendType='easeInOut') scaleDown = self.glowB.scaleInterval(0.1, minGlowScale, startScale=maxGlowScale, blendType='easeInOut') self.glowBTrack = Sequence(scaleUp, scaleDown) self.glowBTrack.loop() cannonball.setPythonTag('DefenseAmmo', self) cannonball.setTag('DefenseAmmo', '1') return cannonball
def loadModel(self): self.mtrail = None self.strail = None self.scaleIval = None maxGlowScale = 8 minGlowScale = 7 if not base.config.GetBool('want-special-effects', 1): cannonball = loader.loadModel('models/ammunition/cannonball') elif self.ammoSkillId == InventoryType.DefenseCannonRoundShot: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.DefenseCannonHotShot: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonFlamingSkull or self.ammoSkillId == InventoryType.DefenseCannonHotShot: maxGlowScale = 28 minGlowScale = 24 cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.DefenseCannonPowderKeg: cannonball = loader.loadModel('models/ammunition/pir_m_gam_can_powderKeg') cannonball.setHpr(90, 0, 90) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) else: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) cannonball.setScale(2.0) if self.ammoSkillId == InventoryType.DefenseCannonMine: cannonball.setColor(1.0, 0.0, 0.0, 1.0) cannonball.setScale(4.0) if self.ammoSkillId == InventoryType.DefenseCannonPowderKeg: cannonball.setScale(4.0) if WeaponConstants.C_OPENFIRE in self.buffs: if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.glowB = loader.loadModel('models/effects/lanternGlow') self.glowB.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowB.setDepthWrite(0) self.glowB.setFogOff() self.glowB.setLightOff() self.glowB.setBin('fixed', 120) self.glowB.setColorScale(1, 0.80000000000000004, 0.5, 0.90000000000000002) self.glowB.reparentTo(cannonball) self.glowB.setBillboardPointEye() scaleUp = self.glowB.scaleInterval(0.10000000000000001, maxGlowScale, startScale = minGlowScale, blendType = 'easeInOut') scaleDown = self.glowB.scaleInterval(0.10000000000000001, minGlowScale, startScale = maxGlowScale, blendType = 'easeInOut') self.glowBTrack = Sequence(scaleUp, scaleDown) self.glowBTrack.loop() cannonball.setPythonTag('DefenseAmmo', self) cannonball.setTag('DefenseAmmo', '1') return cannonball
def loadModel(self): self.mtrail = None self.strail = None self.scaleIval = None maxGlowScale = 8 minGlowScale = 7 if not base.config.GetBool('want-special-effects', 1): cannonball = loader.loadModel('models/ammunition/cannonball') elif self.ammoSkillId in (InventoryType.CannonRoundShot, InventoryType.CannonGrapeShot): cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonChainShot: cannonball = loader.loadModel('models/ammunition/chainShot') ball1 = cannonball.find('**/ball_0') ball1.setBillboardPointEye() ball2 = cannonball.find('**/ball_1') ball2.setBillboardPointEye() if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: randVal = random.uniform(-180.0, 180.0) randSpeed = random.uniform(-0.10000000000000001, 0.10000000000000001) randDirection = 1 self.effectIval = cannonball.hprInterval(0.40000000000000002 + randSpeed, Point3(randVal, 360 * randDirection, 0), startHpr = Point3(randVal, 0, 0)) self.effectIval.loop() if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self, self.chainshot_vertex_list) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonFirebrand: cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonFlamingSkull or self.ammoSkillId == InventoryType.CannonFirebrand: maxGlowScale = 28 minGlowScale = 24 cannonball = loader.loadModel('models/ammunition/cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonFury: maxGlowScale = 40 minGlowScale = 30 cannonball = self.attachNewNode('cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = FuryTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.wantBlur = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh self.trailEffect.reparentTo(cannonball) self.trailEffect.startLoop() elif self.ammoSkillId == InventoryType.CannonComet: cannonball = self.attachNewNode('cannonball') cannonball1 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball1) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball2 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball2) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball3 = loader.loadModel('models/ammunition/cannonball') self.trailEffect = FireTrail.getEffect() if self.trailEffect: self.trailEffect.wantGlow = base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium self.trailEffect.reparentTo(cannonball3) self.trailEffect.startLoop() self.createMotionTrails(self, self.small_vertex_list, self.fire_motion_color) cannonball1.reparentTo(cannonball) cannonball1.setPos(0, 4, -4) cannonball2.reparentTo(cannonball) cannonball2.setPos(0, -4, -4) cannonball3.reparentTo(cannonball) cannonball3.setPos(0, 0, 4) self.effectIval = cannonball.hprInterval(1.0, Point3(0, 0, 360), startHpr = Point3(0, 0, 0)) self.effectIval.loop() elif self.ammoSkillId == InventoryType.CannonGrappleHook: cannonball = loader.loadModel('models/ammunition/GrapplingHook') cannonball.flattenStrong() prop = cannonball.getChild(0) if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.effectIval = Sequence(LerpHprInterval(prop, 2.0, Point3(0, 0, 360), startHpr = Point3(0, 0, 0))) self.effectIval.loop() if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh: self.createMotionTrails(self, self.small_vertex_list) if base.options.getSpecialEffectsSetting() <= base.options.SpecialEffectsMedium: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonThunderbolt: maxGlowScale = 19 minGlowScale = 15 cannonball = self.attachNewNode('cannonball') if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.trailEffect = ThunderBallGlow.getEffect() if self.trailEffect: self.trailEffect.reparentTo(cannonball) self.trailEffect.setScale(0.5) self.trailEffect.startLoop() if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsHigh: self.glowA = loader.loadModel('models/effects/flareRing') self.glowA.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowA.setDepthWrite(0) self.glowA.setFogOff() self.glowA.setLightOff() self.glowA.setBin('fixed', 120) self.glowA.setColorScale(0.5, 0.80000000000000004, 1, 0.5) self.glowA.reparentTo(cannonball) self.glowA.setBillboardPointEye() scaleUp = self.glowA.scaleInterval(0.10000000000000001, 4.5, startScale = 3.5, blendType = 'easeInOut') scaleDown = self.glowA.scaleInterval(0.10000000000000001, 3.5, startScale = 4.5, blendType = 'easeInOut') self.glowATrack = Sequence(scaleUp, scaleDown) self.glowATrack.loop() if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsMedium: self.createMotionTrails(self) if base.options.getSpecialEffectsSetting() == base.options.SpecialEffectsLow: self.createSimpleMotionTrail(self) elif self.ammoSkillId == InventoryType.CannonExplosive: cannonball = loader.loadModel('models/ammunition/cannonball') else: cannonball = loader.loadModel('models/ammunition/cannonball') if self.ammoSkillId == InventoryType.CannonBullet: cannonball.setColor(0.84999999999999998, 0.84999999999999998, 0.66000000000000003, 1.0) elif self.ammoSkillId == InventoryType.CannonGasCloud: cannonball.setColor(0.55000000000000004, 1.0, 0.57999999999999996, 1.0) elif self.ammoSkillId == InventoryType.CannonSkull: cannonball.setColor(1.0, 0.55000000000000004, 0.55000000000000004, 1.0) elif self.ammoSkillId == InventoryType.CannonFlameCloud: cannonball.setColor(1.0, 0.10000000000000001, 0.90000000000000002, 1.0) elif self.ammoSkillId == InventoryType.CannonBarShot: cannonball.setColor(0.0, 0.10000000000000001, 0.75, 1.0) elif self.ammoSkillId == InventoryType.CannonKnives: cannonball.setColor(0.97999999999999998, 1.0, 0.34999999999999998, 1.0) elif self.ammoSkillId == InventoryType.CannonMine: cannonball.setColor(0.68999999999999995, 0.52000000000000002, 0.19, 1.0) elif self.ammoSkillId == InventoryType.CannonBarnacles: cannonball.setColor(0.050000000000000003, 0.65000000000000002, 0.029999999999999999, 1.0) if self.ammoSkillId == InventoryType.CannonGrapeShot: cannonball.setScale(0.80000000000000004) else: cannonball.setScale(2.0) if WeaponConstants.C_OPENFIRE in self.buffs: if base.options.getSpecialEffectsSetting() >= base.options.SpecialEffectsLow: self.glowB = loader.loadModel('models/effects/lanternGlow') self.glowB.node().setAttrib(ColorBlendAttrib.make(ColorBlendAttrib.MAdd)) self.glowB.setDepthWrite(0) self.glowB.setFogOff() self.glowB.setLightOff() self.glowB.setBin('fixed', 120) self.glowB.setColorScale(1, 0.80000000000000004, 0.5, 0.90000000000000002) self.glowB.reparentTo(cannonball) self.glowB.setBillboardPointEye() scaleUp = self.glowB.scaleInterval(0.10000000000000001, maxGlowScale, startScale = minGlowScale, blendType = 'easeInOut') scaleDown = self.glowB.scaleInterval(0.10000000000000001, minGlowScale, startScale = maxGlowScale, blendType = 'easeInOut') self.glowBTrack = Sequence(scaleUp, scaleDown) self.glowBTrack.loop() return cannonball