Changes

Line 23: Line 23:  
! style="text-align: center; vertical-align: middle;" | Armament
 
! style="text-align: center; vertical-align: middle;" | Armament
 
! style="text-align:left;" | Notes
 
! style="text-align:left;" | Notes
! style="text-align:left;" | OASW]],
+
! style="text-align:left;" | OASW
 +
! style="text-align:left;" | Opening Torpedo]],
 
_columns = {
 
_columns = {
 
"card",
 
"card",
Line 37: Line 38:  
"armament",
 
"armament",
 
"notes",
 
"notes",
"OASW",
+
"oasw",
 +
"otorp"
 
},
 
},
 
_cell = [[|style="text-align:${text_align};background-color:${bg_color}"|${value}]],
 
_cell = [[|style="text-align:${text_align};background-color:${bg_color}"|${value}]],
Line 136: Line 138:  
elseif ShipCapabilities:_is_depth_charge(equipment) then
 
elseif ShipCapabilities:_is_depth_charge(equipment) then
 
dc = true
 
dc = true
elseif ShipCapabilities._is_active_midget_submarine(equipment) then
  −
active_midget_submarine = true
   
end
 
end
 
local real_equipment = equipment:link()
 
local real_equipment = equipment:link()
Line 156: Line 156:  
end
 
end
 
table.insert(icons, icon)
 
table.insert(icons, icon)
end
  −
if ShipCapabilities:_is_submarine(ship) then
  −
if ship:suffix() and (ship:suffix():match("Elite") or ship:suffix():match("Flagship")) then
  −
table.insert(roles, self._opening_torpedo_label)
  −
end
  −
elseif active_midget_submarine then
  −
table.insert(roles, self._opening_torpedo_label)
   
end
 
end
 
if air_power then
 
if air_power then
Line 201: Line 194:  
end
 
end
   −
function EnemyShipListKai:OASW(ship)
+
function EnemyShipListKai:oasw(ship)
 
local capabilities = ShipCapabilities{_ship = ship}
 
local capabilities = ShipCapabilities{_ship = ship}
 
local value = {}
 
local value = {}
Line 208: Line 201:  
 
 
return {value = table.concat(value, "<br/>"), bg_color = opening and "green" or self._transparent, text_align = self._start_align}
 
return {value = table.concat(value, "<br/>"), bg_color = opening and "green" or self._transparent, text_align = self._start_align}
 +
end
 +
 +
function EnemyShipListKai:otorp(ship)
 +
local roles = {}
 +
local active_midget_submarine = false
 +
 +
for i = 1, ship:slots_length() do
 +
local equipment, size, estimation = ship:slot(i)
 +
local icon, equipment_type, equipment_link
 +
if equipment then
 +
equipment_type = equipment:type()
 +
if ShipCapabilities._is_active_midget_submarine(equipment) then
 +
active_midget_submarine = true
 +
end
 +
end
 +
end
 +
 +
local can_otorp = false
 +
 +
if ShipCapabilities:_is_submarine(ship) then
 +
if ship:suffix() and (ship:suffix():match("Elite") or ship:suffix():match("Flagship")) then
 +
can_otorp = true
 +
end
 +
elseif active_midget_submarine then
 +
can_otorp = true
 +
end
 +
table.insert(roles, can_otorp and "Yes" or "No")
 +
 +
return {value = table.concat(roles, ", "), bg_color = can_otorp and "green" or "self._transparent", text_align = self._start_align}
 
end
 
end
  
953

edits