def __calculateAmmoShots(self): if self.charge is not None: # Set number of cycles before reload is needed chargeRate = self.getModifiedItemAttr("chargeRate") numCharges = self.numCharges numShots = floorFloat(float(numCharges) / chargeRate) else: numShots = None return numShots
def numCharges(self): if self.charge is None: charges = 0 else: chargeVolume = self.charge.volume containerCapacity = self.item.capacity if chargeVolume is None or containerCapacity is None: charges = 0 else: charges = floorFloat(float(containerCapacity) / chargeVolume) return charges
def __calculateCrystalShots(self): if self.charge is not None: if self.getModifiedChargeAttr("crystalsGetDamaged") == 1: # For depletable crystals, calculate average amount of shots before it's destroyed hp = self.getModifiedChargeAttr("hp") chance = self.getModifiedChargeAttr("crystalVolatilityChance") damage = self.getModifiedChargeAttr("crystalVolatilityDamage") crystals = self.numCharges numShots = floorFloat(float(crystals * hp) / (damage * chance)) else: # Set 0 (infinite) for permanent crystals like t1 laser crystals numShots = 0 else: numShots = None return numShots