def _extractRawParams(self):
     if self._vehicleDescr is not None:
         descriptors = getShellDescriptors(self._itemDescr, self._vehicleDescr)
         params = calcShellParams(descriptors)
     else:
         params = self._getPrecachedInfo().params
     return params
 def getAvgParams(self):
     if self._vehicleDescr is not None:
         descriptors = getShellDescriptors(self._itemDescr, self._vehicleDescr)
         avgParams = calcShellParams(descriptors)
     else:
         avgParams = self.precachedParams.avgParams
     return avgParams
Beispiel #3
0
    def piercingPowerTable(self):
        if self._itemDescr['kind'] in (SHELL_TYPES.ARMOR_PIERCING,
                                       SHELL_TYPES.ARMOR_PIERCING_CR):
            if self._vehicleDescr is None:
                return NO_DATA
            result = []
            shellDescriptor = getShellDescriptors(self._itemDescr,
                                                  self._vehicleDescr)[0]
            piercingMax, piercingMin = shellDescriptor[
                PIERCING_POWER_PROP_NAME]
            randFactor = self._itemDescr['piercingPowerRandomization']
            lossPerMeter = (piercingMax - piercingMin) / 400.0
            maxDistance = self.maxShotDistance
            for distance in PIERCING_DISTANCES:
                if distance > maxDistance:
                    distance = int(maxDistance)
                currPiercing = piercingMax - lossPerMeter * (distance - 100.0)
                result.append(
                    (distance, (currPiercing - randFactor * currPiercing,
                                currPiercing + randFactor * currPiercing)))

            return result
        else:
            return
            return
Beispiel #4
0
 def getAvgParams(self):
     if self._vehicleDescr is not None:
         descriptors = getShellDescriptors(self._itemDescr,
                                           self._vehicleDescr)
         avgParams = calcShellParams(descriptors)
     else:
         avgParams = self.precachedParams.avgParams
     return avgParams
Beispiel #5
0
    def piercingPowerTable(self):
        if self._itemDescr.kind in (SHELL_TYPES.ARMOR_PIERCING,
                                    SHELL_TYPES.ARMOR_PIERCING_CR):
            if self._vehicleDescr is None:
                return NO_DATA
            result = []
            shellDescriptor = getShellDescriptors(self._itemDescr,
                                                  self._vehicleDescr)[0]
            maxDistance = self.maxShotDistance
            for distance in PIERCING_DISTANCES:
                if distance > maxDistance:
                    distance = int(maxDistance)
                currPiercing = PIERCING_POWER.computePiercingPowerAtDist(
                    shellDescriptor.piercingPower, distance, maxDistance)
                result.append((distance, currPiercing))

            return result
        else:
            return
    def piercingPowerTable(self):
        if self._itemDescr['kind'] in (SHELL_TYPES.ARMOR_PIERCING, SHELL_TYPES.ARMOR_PIERCING_CR):
            if self._vehicleDescr is None:
                return NO_DATA
            result = []
            shellDescriptor = getShellDescriptors(self._itemDescr, self._vehicleDescr)[0]
            piercingMax, piercingMin = shellDescriptor[PIERCING_POWER_PROP_NAME]
            randFactor = self._itemDescr['piercingPowerRandomization']
            lossPerMeter = (piercingMax - piercingMin) / 400.0
            maxDistance = self.maxShotDistance
            for distance in PIERCING_DISTANCES:
                if distance > maxDistance:
                    distance = int(maxDistance)
                currPiercing = piercingMax - lossPerMeter * (distance - 100.0)
                result.append((distance, (currPiercing - randFactor * currPiercing, currPiercing + randFactor * currPiercing)))

            return result
        else:
            return
            return
 def maxShotDistance(self):
     if self._itemDescr['kind'] in _SHELL_KINDS:
         if self._vehicleDescr is not None:
             return getShellDescriptors(self._itemDescr, self._vehicleDescr)[0]['maxDistance']
     return
 def __getShellDescriptor(self):
     shellDescriptors = getShellDescriptors(self._itemDescr, self._vehicleDescr)
     return shellDescriptors[0] if shellDescriptors else None
Beispiel #9
0
 def maxShotDistance(self):
     if self._itemDescr.kind in _SHELL_KINDS:
         if self._vehicleDescr is not None:
             return getShellDescriptors(self._itemDescr,
                                        self._vehicleDescr)[0].maxDistance
     return