• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Add preliminary leveled ShipData support
Line 184: Line 184:  
end
 
end
 
return self._cg_damaged
 
return self._cg_damaged
 +
end
 +
 +
function ShipData:level()
 +
return self._level
 
end
 
end
   Line 192: Line 196:  
function ShipData:hp_max()
 
function ShipData:hp_max()
 
return self._hp_max
 
return self._hp_max
 +
end
 +
 +
function ShipData:hp_leveled()
 +
local hp = self:hp()
 +
if self._level and self._level > 100 then
 +
return math.floor((self:hp_max() - hp) * (self._level - 99) / 51 + hp)
 +
end
 +
return hp
 
end
 
end
   Line 200: Line 212:  
function ShipData:firepower_max()
 
function ShipData:firepower_max()
 
return self._firepower_max
 
return self._firepower_max
 +
end
 +
 +
function ShipData:firepower_leveled()
 +
if self._firepower_leveled then
 +
return self._firepower_leveled
 +
end
 +
return self:firepower_max()
 
end
 
end
   Line 208: Line 227:  
function ShipData:torpedo_max()
 
function ShipData:torpedo_max()
 
return self._torpedo_max
 
return self._torpedo_max
 +
end
 +
 +
function ShipData:firepower_leveled()
 +
if self._torpedo_leveled then
 +
return self._torpedo_leveled
 +
end
 +
return self:torpedo_max()
 
end
 
end
   Line 216: Line 242:  
function ShipData:aa_max()
 
function ShipData:aa_max()
 
return self._aa_max
 
return self._aa_max
 +
end
 +
 +
function ShipData:firepower_leveled()
 +
if self._aa_leveled then
 +
return self._aa_leveled
 +
end
 +
return self:aa_max()
 
end
 
end
   Line 224: Line 257:  
function ShipData:armor_max()
 
function ShipData:armor_max()
 
return self._armor_max
 
return self._armor_max
 +
end
 +
 +
function ShipData:armor_leveled()
 +
if self._armor_leveled then
 +
return self._armor_leveled
 +
end
 +
return self:armor_max()
 
end
 
end
   Line 232: Line 272:  
function ShipData:asw_max()
 
function ShipData:asw_max()
 
return self._asw_max
 
return self._asw_max
 +
end
 +
 +
function ShipData:asw_leveled()
 +
if self._level then
 +
local asw = self:asw()
 +
return math.floor((self:asw_max() - asw) * self._level / 99 + asw)
 +
end
 +
return self:asw_max()
 
end
 
end
   Line 240: Line 288:  
function ShipData:evasion_max()
 
function ShipData:evasion_max()
 
return self._evasion_max
 
return self._evasion_max
 +
end
 +
 +
function ShipData:evasion_leveled()
 +
if self._level then
 +
local evasion = self:evasion()
 +
return math.floor((self:evasion_max() - evasion) * self._level / 99 + evasion)
 +
end
 +
return self:evasion_max()
 
end
 
end
   Line 248: Line 304:  
function ShipData:los_max()
 
function ShipData:los_max()
 
return self._los_max
 
return self._los_max
 +
end
 +
 +
function ShipData:los_leveled()
 +
if self._level then
 +
local los = self:los()
 +
return math.floor((self:los_max() - los) * self._level / 99 + los)
 +
end
 +
return self:los_max()
 
end
 
end
   Line 256: Line 320:  
function ShipData:luck_max()
 
function ShipData:luck_max()
 
return self._luck_max
 
return self._luck_max
 +
end
 +
 +
function ShipData:luck_leveled()
 +
if self._luck_leveled then
 +
return self._luck_leveled
 +
end
 +
return self:luck()
 
end
 
end
   Line 370: Line 441:  
setmetatable(ship, ship)
 
setmetatable(ship, ship)
 
ship.__index = self
 
ship.__index = self
 +
ship.__call = self.__call
 
return ship
 
return ship
 
end
 
end
  −
ShipData.__call = ShipData.create
      
return ShipData
 
return ShipData
Anonymous user

Navigation menu