Changes

Add improvement effects for firepower, torpedo and ASW
Line 216: Line 216:  
function EquipmentData:firepower()
 
function EquipmentData:firepower()
 
return self._firepower
 
return self._firepower
 +
end
 +
 +
function EquipmentData:firepower_leveled(night_battle)
 +
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 coeff = (night_battle and night_battle_coeffs[self._type] or 0) or day_battle_coeffs[self._type]
 +
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 224: Line 231:  
function EquipmentData:torpedo()
 
function EquipmentData:torpedo()
 
return self._torpedo
 
return self._torpedo
 +
end
 +
 +
function EquipmentData:torpedo_leveled(night_battle)
 +
local night_battle_coeffs = { [5] = 1 }
 +
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]
 +
return coeff and self._level and self._level > 0 and (self._torpedo or 0) + coeff * math.sqrt(self._level) or self._torpedo
 
end
 
end
   Line 236: Line 250:  
function EquipmentData:asw()
 
function EquipmentData:asw()
 
return self._asw
 
return self._asw
 +
end
 +
 +
function EquipmentData:asw_leveled()
 +
local coeffs = { [14] = 0.75, [15] = 0.75 }
 +
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
 
end
 
end
  
cssedit, gkautomate
7,064

edits