Line 219: |
Line 219: |
| | | |
| function EquipmentData:firepower_leveled(night_battle) | | function EquipmentData:firepower_leveled(night_battle) |
| + | if not self._level or self._level == 0 then |
| + | return self._firepower |
| + | end |
| local night_battle_coeffs = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [19] = 1, [29] = 1, [36] = 1 } | | local night_battle_coeffs = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [19] = 1, [29] = 1, [36] = 1 } |
| local day_battle_coeffs = { [1] = 1, [2] = 1, [3] = 1.5, [4] = 1, [14] = 0.75, [15] = 0.75, [19] = 1, [21] = 1, [29] = 1, [36] = 1 } | | local day_battle_coeffs = { [1] = 1, [2] = 1, [3] = 1.5, [4] = 1, [14] = 0.75, [15] = 0.75, [19] = 1, [21] = 1, [29] = 1, [36] = 1 } |
Line 227: |
Line 230: |
| coeff = day_battle_coeffs[self._type] | | coeff = day_battle_coeffs[self._type] |
| end | | end |
− | return coeff and self._level and self._level > 0 and (self._firepower or 0) + coeff * math.sqrt(self._level) or self._firepower | + | return coeff and (self._firepower or 0) + coeff * math.sqrt(self._level) or self._firepower |
| end | | end |
| | | |
Line 239: |
Line 242: |
| | | |
| function EquipmentData:torpedo_leveled(night_battle) | | function EquipmentData:torpedo_leveled(night_battle) |
| + | if not self._level or self._level == 0 then |
| + | return self._torpedo |
| + | end |
| local night_battle_coeffs = { [5] = 1 } | | local night_battle_coeffs = { [5] = 1 } |
| local day_battle_coeffs = { [5] = 1.2, [21] = 1.2 } | | local day_battle_coeffs = { [5] = 1.2, [21] = 1.2 } |
Line 247: |
Line 253: |
| coeff = day_battle_coeffs[self._type] | | coeff = day_battle_coeffs[self._type] |
| end | | end |
− | return coeff and self._level and self._level > 0 and (self._torpedo or 0) + coeff * math.sqrt(self._level) or self._torpedo | + | return coeff and (self._torpedo or 0) + coeff * math.sqrt(self._level) or self._torpedo |
| end | | end |
| | | |
Line 263: |
Line 269: |
| | | |
| function EquipmentData:asw_leveled() | | function EquipmentData:asw_leveled() |
| + | if not self._level or self._level == 0 then |
| + | return self._asw |
| + | end |
| local coeffs = { [14] = 0.75, [15] = 0.75 } | | local coeffs = { [14] = 0.75, [15] = 0.75 } |
| local coeff = coeffs[self._type] | | local coeff = coeffs[self._type] |
− | return coeff and self._level and self._level > 0 and (self._asw or 0) + coeff * math.sqrt(self._level) or self._asw | + | return coeff and (self._asw or 0) + coeff * math.sqrt(self._level) or self._asw |
| end | | end |
| | | |