Line 221: |
Line 221: |
| 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 } |
− | local coeff = (night_battle and night_battle_coeffs[self._type] or 0) or day_battle_coeffs[self._type] | + | local coeff = nil |
| + | if night_battle then |
| + | coeff = night_battle_coeffs[self._type] |
| + | else |
| + | coeff = day_battle_coeffs[self._type] |
| + | 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._level and self._level > 0 and (self._firepower or 0) + coeff * math.sqrt(self._level) or self._firepower |
| end | | end |
Line 236: |
Line 241: |
| 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 } |
− | local coeff = (night_battle and night_battle_coeffs[self._type] or 0) or day_battle_coeffs[self._type] | + | local coeff = nil |
| + | if night_battle then |
| + | coeff = night_battle_coeffs[self._type] |
| + | else |
| + | coeff = day_battle_coeffs[self._type] |
| + | 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._level and self._level > 0 and (self._torpedo or 0) + coeff * math.sqrt(self._level) or self._torpedo |
| end | | end |