def addProximityAmmoFromAI(self, shotNum, pos, ammoSkillId, attackerId, timeRemaining, projectileHitEvent, buffs = []):
     self.ammoSequence = self.ammoSequence + 1 & 255
     cannonball = self.getProjectile(ammoSkillId, projectileHitEvent, buffs)
     cannonball.setTag('shotNum', str(shotNum))
     cannonball.setTag('ammoSequence', str(self.ammoSequence))
     cannonball.setTag('skillId', str(InventoryType.CannonShoot))
     cannonball.setTag('ammoSkillId', str(ammoSkillId))
     cannonball.setTag('attackerId', str(attackerId))
     cannonball.setPos(pos)
     if ammoSkillId != InventoryType.DefenseCannonSmokePowder:
         cannonball.setZ(1)
     
     collNode = cannonball.getCollNode()
     collNode.reparentTo(render)
     if ammoSkillId == InventoryType.DefenseCannonMine:
         cannonball.addInWaterMine(timeRemaining)
     elif ammoSkillId == InventoryType.DefenseCannonPowderKeg:
         cannonball.addPowderKeg(timeRemaining)
     elif ammoSkillId == InventoryType.DefenseCannonSmokePowder:
         cannonball.addSmokePowder(timeRemaining)
     else:
         cannonball.addColdShot(timeRemaining)
     if timeRemaining == CannonDefenseGlobals.getDefenseCannonAmmoDuration(ammoSkillId):
         if ammoSkillId in ammoHitSfx:
             sfx = ammoHitSfx[ammoSkillId]
             base.playSfx(sfx, node = cannonball, cutoff = 6000)
         
     
     return cannonball
 def addProximityAmmoFromAI(self, shotNum, pos, ammoSkillId, attackerId, timeRemaining, projectileHitEvent, buffs=[]):
     self.ammoSequence = self.ammoSequence + 1 & 255
     cannonball = self.getProjectile(ammoSkillId, projectileHitEvent, buffs)
     cannonball.setTag('shotNum', str(shotNum))
     cannonball.setTag('ammoSequence', str(self.ammoSequence))
     cannonball.setTag('skillId', str(InventoryType.CannonShoot))
     cannonball.setTag('ammoSkillId', str(ammoSkillId))
     cannonball.setTag('attackerId', str(attackerId))
     cannonball.setPos(pos)
     if ammoSkillId != InventoryType.DefenseCannonSmokePowder:
         cannonball.setZ(1)
     collNode = cannonball.getCollNode()
     collNode.reparentTo(render)
     if ammoSkillId == InventoryType.DefenseCannonMine:
         cannonball.addInWaterMine(timeRemaining)
     else:
         if ammoSkillId == InventoryType.DefenseCannonPowderKeg:
             cannonball.addPowderKeg(timeRemaining)
         elif ammoSkillId == InventoryType.DefenseCannonSmokePowder:
             cannonball.addSmokePowder(timeRemaining)
         else:
             cannonball.addColdShot(timeRemaining)
         if timeRemaining == CannonDefenseGlobals.getDefenseCannonAmmoDuration(ammoSkillId):
             if ammoSkillId in ammoHitSfx:
                 sfx = ammoHitSfx[ammoSkillId]
                 base.playSfx(sfx, node=cannonball, cutoff=6000)
     return cannonball