- 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
Line 1:
Line 1:
− +
− +
−
− function EnemyShipData:name()
− if self._suffix then
− return self:base_name() .. " " .. self._suffix
− else
− return self:base_name()
− end
− end
−
− function EnemyShipData:base_name()
− return self._name
− end
−
− function EnemyShipData:link()
− if self._page then
− return self._page, self:name()
− elseif self._suffix then
− return self:base_name(), self:name()
− else
− return self:name()
− end
− end
−
− function EnemyShipData:localized_name()
− return self._localized_name
− end
−
− function EnemyShipData:nick()
− return self._nick
− end
−
− function EnemyShipData:japanese_name()
− return self._japanese_name
− end
−
− function EnemyShipData:japanese_nick()
− return self._japanese_nick
− end
−
− function EnemyShipData:reading()
− return self._reading
− end
−
− function EnemyShipData:reading_nick()
− return self._reading_nick
− end
− +
− return self._battle_card+
− end+
− +
− function EnemyShipData:hp()+
− return self._hp+
− end+
− +
− function EnemyShipData:firepower()+
− return self._firepower+
− end+
− +
− function EnemyShipData:torpedo()+
− return self._torpedo+
− end+
− +
− function EnemyShipData:aa()+
− return self._aa+
− end+
− +
− function EnemyShipData:armor()+
− return self._armor+
− end+
− +
− function EnemyShipData:asw()+
− return self._asw+
− end+
−
− function EnemyShipData:evasion()
− return self._evasion
− end
−
− function EnemyShipData:los()
− return self._los
− end
−
− function EnemyShipData:luck()
− return self._luck
− end
−
− function EnemyShipData:slot(slot)
− if self._equipment then
− local equipment_slot = self._equipment[slot]
− if equipment_slot then
− return equipment_slot.equipment, equipment_slot.size
− end
− end
− return nil
− end
−
− function EnemyShipData:slots()
− if self._equipment then
− return #self._equipment
− end
− return nil
− end
−
− function EnemyShipData:total_space()
− if not self._equipment then
− return nil
− end
− local total_space = 0
− local size
− for _, v in ipairs(self._equipment) do
− size = v["size"]
− if size == nil then
− total_space = nil
− break
− elseif size == false then
− else
− total_space = total_space + size
− end
− end
− return total_space
− end
−
− function EnemyShipData:speed()
− return self._speed
− end
−
− function EnemyShipData:range()
− return self._range
− end
−
− function EnemyShipData:as_rating()
− return self._as_rating
−
−
− function EnemyShipData:create(ship)
− ship = ship or {}
− setmetatable(ship, ship)
− ship.__index = self
− return ship
no edit summary
local BaseData = require("Module:BaseData")
local ShipData = require("Module:ShipData")
local EnemyShipData = BaseData()
local EnemyShipData = ShipData()
function EnemyShipData:battle_card()
function EnemyShipData:air_power()
local air_power = 0
for i=1, self:slots() do
local slot_equipment, slot_space = self:slot(i)
if slot_equipment == nil or slot_space == nil then
--we have missing information, fall back to hard-coded air power
air_power = self._as_rating
break
elseif slot_equipment ~= false then
--if there is an equipment
local slot_equipment_type = slot_equipment:type()
local slot_equipment_aa = slot_equipment:aa()
if slot_equipment_aa and
(slot_equipment_type == 6 or
slot_equipment_type == 7 or
slot_equipment_type == 8 or
slot_equipment_type == 11) then
air_power = air_power +
math.floor(math.sqrt(slot_space) * slot_equipment_aa)
elseif slot_equipment_aa == nil then
--we have missing information, fall back to hard-coded air power
air_power = self._as_rating
break
end
end
end
return air_power
end
end
end