• 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:EquipmentData"

From Kancolle Wiki
Jump to navigation Jump to search
com>Ckwng
(Module for equipment data class.)
(No difference)

Revision as of 06:13, 11 December 2014

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

local BaseData = require("Module:BaseData")
local EquipmentData = BaseData()

function EquipmentData:name(raw)
	self:format_stat(self._name, raw)
end

function EquipmentData:id(raw)
	self:format_stat(self._id, raw)
end

function EquipmentData:japanese_name(raw)
	self:format_stat(self._japanese_name, raw)
end

function EquipmentData:type(raw)
	self:format_type(self._type, raw)
end

function EquipmentData:rarity(raw)
	self:format_rarity(self._rarity, raw)
end

function EquipmentData:card(raw)
	self:format_card(self._card, raw)
end

function EquipmentData:firepower(raw)
	self:format_stat(self._firepower, raw)
end

function EquipmentData:torpedo(raw)
	self:format_stat(self._torpedo, raw)
end

function EquipmentData:aa(raw)
	self:format_stat(self._aa, raw)
end

function EquipmentData:armor(raw)
	self:format_stat(self._armor, raw)
end

function EquipmentData:asw(raw)
	self:format_stat(self._asw, raw)
end

function EquipmentData:shelling_accuracy(raw)
	self:format_stat(self._shelling_accuracy, raw)
end

function EquipmentData:torpedo_accuracy(raw)
	self:format_stat(self._torpedo_accuracy, raw)
end

function EquipmentData:los(raw)
	self:format_stat(self._los, raw)
end

function EquipmentData:speed(raw)
	self:format_speed(self._speed, raw)
end

function EquipmentData:luck(raw)
	self:format_stat(self._luck, raw)
end

function EquipmentData:range(raw)
	self:format_range(self._range, raw)
end

function EquipmentData:scrap_fuel(raw)
	self:format_stat(self._scrap_fuel, raw)
end

function EquipmentData:scrap_ammo(raw)
	self:format_stat(self._scrap_ammo, raw)
end

function EquipmentData:scrap_steel(raw)
	self:format_stat(self._scrap_steel, raw)
end

function EquipmentData:scrap_bauxite(raw)
	self:format_stat(self._scrap_bauxite, raw)
end

function EquipmentData:upgradable(raw)
	return not not self._upgradable
end

EquipmentData.format_type = EquipmentData.create_formatter({
	[1] = "Small Caliber Main Gun",
	[2] = "Medium Caliber Main Gun",
	[3] = "Large Caliber Main Gun",
	[4] = "Secondary Gun",
	[5] = "Torpedo",
	[6] = "Carrier-based Fighter Aircraft",
	[7] = "Carrier-based Dive Bomber",
	[8] = "Carrier-based Torpedo Bomber",
	[9] = "Carrier-based Reconnaissance Aircraft",
	[10] = "Reconnaissance Seaplane",
	[11] = "Seaplane Bomber",
	[12] = "Small Radar",
	[13] = "Large Radar",
	[14] = "Sonar",
	[15] = "Depth Charge",
	[16] = "Extra Armor",
	[17] = "Engine Improvement",
	[18] = "Anti-Aircraft Shell",
	[19] = "Armor Piercing Shell",
	[20] = "VT Fuze",
	[21] = "Anti-Aircraft Machine Gun",
	[22] = "Midget Submarine",
	[23] = "Damage Control Personnel",
	[24] = "Landing Craft",
	[25] = "Autogyro",
	[26] = "Anti-submarine Patrol Aircraft",
	[27] = "Extra Armor (Medium)",
	[28] = "Extra Armor (Large)",
	[29] = "Searchlight",
	[30] = "Supply Transport Container",
	[31] = "Ship Repair Facility",
	[32] = "Submarine Torpedo",
	[33] = "Star Shell",
	[34] = "Command Facility",
	[35] = "Aviation Personnel",
	[36] = "Anti-Aircraft Fire Director",
	})

EquipmentData.format_rarity = EquipmentData.create_formatter({
	[0] = "Common",
	[1] = "Rare",
	[2] = "Holo",
	[3] = "S Holo",
	[4] = "SS Holo",
	})

function EquipmentData:create(ship)
	ship = ship or {}
	setmetatable(ship, self)
	self.__index = self
	return ship
end

EquipmentData.__call = EquipmentData.create

return EquipmentData