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

Difference between revisions of "Module:EnemyShipData"

From Kancolle Wiki
Jump to navigation Jump to search
(Created page with "local BaseData = require("Module:BaseData") local EnemyShipData = BaseData() function EnemyShipData:name() if self._suffix then return self:base_name() .. " " .. self._su...")
 
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
local BaseData = require("Module:BaseData")
+
local ShipData = require("Module:ShipData")
local EnemyShipData = BaseData()
+
local EnemyShipData = ShipData{
+
_enemy = true,
function EnemyShipData:name()
+
    _constructor_module = "Module:EnemyShip",
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
 
 
 
function EnemyShipData:battle_card()
 
return self._battle_card
 
end
 
 
function EnemyShipData:hp()
 
return self._hp
 
end
 
 
 
function EnemyShipData:firepower()
 
return self._firepower
 
end
 
  
function EnemyShipData:torpedo()
+
EnemyShipData.hp_leveled = EnemyShipData.hp
return self._torpedo
+
EnemyShipData.firepower_leveled = EnemyShipData.firepower
end
+
EnemyShipData.torpedo_leveled = EnemyShipData.torpedo
 +
EnemyShipData.aa_leveled = EnemyShipData.aa
 +
EnemyShipData.armor_leveled = EnemyShipData.armor
 +
EnemyShipData.asw_leveled = EnemyShipData.asw
 +
EnemyShipData.evasion_leveled = EnemyShipData.evasion
 +
EnemyShipData.los_leveled = EnemyShipData.los
 +
EnemyShipData.luck_leveled = EnemyShipData.luck
  
function EnemyShipData:aa()
+
function EnemyShipData:can_debuff()
return self._aa
+
return self._can_debuff
 
end
 
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:create(ship)
 
ship = ship or {}
 
setmetatable(ship, ship)
 
ship.__index = self
 
return ship
 
end
 
 
 
EnemyShipData.__call = EnemyShipData.create
 
EnemyShipData.__call = EnemyShipData.create
 
   
 
   
 
return EnemyShipData
 
return EnemyShipData

Latest revision as of 02:00, 24 May 2021

Documentation for this module may be created at Module:EnemyShipData/doc

local ShipData = require("Module:ShipData")
local EnemyShipData = ShipData{
	_enemy = true,
    _constructor_module = "Module:EnemyShip",
}

EnemyShipData.hp_leveled = EnemyShipData.hp
EnemyShipData.firepower_leveled = EnemyShipData.firepower
EnemyShipData.torpedo_leveled = EnemyShipData.torpedo
EnemyShipData.aa_leveled = EnemyShipData.aa
EnemyShipData.armor_leveled = EnemyShipData.armor
EnemyShipData.asw_leveled = EnemyShipData.asw
EnemyShipData.evasion_leveled = EnemyShipData.evasion
EnemyShipData.los_leveled = EnemyShipData.los
EnemyShipData.luck_leveled = EnemyShipData.luck

function EnemyShipData:can_debuff()
	return self._can_debuff
end

EnemyShipData.__call = EnemyShipData.create
 
return EnemyShipData