• 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
com>Ckwng
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
local ShipData = require("Module:ShipData")
 
local ShipData = require("Module:ShipData")
 
local EnemyShipData = ShipData{
 
local EnemyShipData = ShipData{
 +
_enemy = true,
 
     _constructor_module = "Module:EnemyShip",
 
     _constructor_module = "Module:EnemyShip",
 
}
 
}
  
function EnemyShipData:air_power()
+
EnemyShipData.hp_leveled = EnemyShipData.hp
    local air_power = 0
+
EnemyShipData.firepower_leveled = EnemyShipData.firepower
    for i=1, self:slots() or 0 do
+
EnemyShipData.torpedo_leveled = EnemyShipData.torpedo
        local slot_equipment, slot_space = self:slot(i)
+
EnemyShipData.aa_leveled = EnemyShipData.aa
        if slot_equipment == nil or slot_space == nil then
+
EnemyShipData.armor_leveled = EnemyShipData.armor
            --we have missing information, fall back to hard-coded air power
+
EnemyShipData.asw_leveled = EnemyShipData.asw
            air_power = self._as_rating
+
EnemyShipData.evasion_leveled = EnemyShipData.evasion
            break
+
EnemyShipData.los_leveled = EnemyShipData.los
        elseif slot_equipment ~= false then
+
EnemyShipData.luck_leveled = EnemyShipData.luck
            --if there is an equipment
+
 
            local slot_equipment_type = slot_equipment:type()
+
function EnemyShipData:can_debuff()
            local slot_equipment_aa = slot_equipment:aa()
+
return self._can_debuff
            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
+
 
 
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