• 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
m
 
(8 intermediate revisions by 2 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()
+
EnemyShipData.hp_leveled = EnemyShipData.hp
return self._battle_card
+
EnemyShipData.firepower_leveled = EnemyShipData.firepower
end
+
EnemyShipData.torpedo_leveled = EnemyShipData.torpedo
+
EnemyShipData.aa_leveled = EnemyShipData.aa
function EnemyShipData:hp()
+
EnemyShipData.armor_leveled = EnemyShipData.armor
return self._hp
+
EnemyShipData.asw_leveled = EnemyShipData.asw
end
+
EnemyShipData.evasion_leveled = EnemyShipData.evasion
 
+
EnemyShipData.los_leveled = EnemyShipData.los
function EnemyShipData:firepower()
+
EnemyShipData.luck_leveled = EnemyShipData.luck
return self._firepower
 
end
 
 
 
function EnemyShipData:torpedo()
 
return self._torpedo
 
end
 
 
 
function EnemyShipData:aa()
 
return self._aa
 
end
 
  
function EnemyShipData:armor()
+
function EnemyShipData:can_debuff()
return self._armor
+
return self._can_debuff
 
end
 
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
 
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