Changes
Try fixing the condition of opening torpedo (see the comments)
end
end
function ShipCapabilities:_is_midget_submarine(equipment)
function ShipCapabilities:_is_wg(equipment)
return equipment:type() == 22
return equipment:type() == 37
end
end
function ShipCapabilities:_is_wg(equipment)
function ShipCapabilities:_opening_torpedo_conditon(ship)
if not ship then
ship = self._ship
end
local has_special_equipment = false
for i = 1, ship:slot_length() or 0 do
local equipment, size = ship:slot(i)
if equipment:id() == 41 or equipment:id() == 541 then
has_special_equipment = true
end
end
-- copied from Vita ver
-- Kouhyouteki and Abyssal Cuttelfish Torpedo,
-- but not midget submarines, are treated solely.
-- It seems that Abyssal Ambush Torpedo and High-speed Abyssal Torpedo mod.2
-- cannot perform opening torpedo.
if ship:type() == 13 or ship:type() == 14 then
if ship._id > 1500 then
return string.find(ship._suffix, "[Ff]lagshp|[Ee]lite") ~= nil
-- copied from Vita ver
else
local level = ship:level()
return has_special_equipment or (level and level >= 10)
end
else
return has_special_equipment
end
end
end
-- Basic attack power for opening torpedo, including fleet torpedo.
-- Basic attack power for opening torpedo, including fleet torpedo.
function ShipCapabilities:opening_torpedo(fleet_torpedo)
function ShipCapabilities:opening_torpedo(fleet_torpedo)
return _opening_torpedo_conditon(self._ship) and closing_torpedo(fleet_torpedo)
-- With the new implementation we can remove _opening_torpedo attribute
end
end