Changes

m
72 revisions imported
Line 6: Line 6:  
local Tabber = require('Module:Tabber')
 
local Tabber = require('Module:Tabber')
   −
local format = require('Module:StringInterpolation').format
+
local format = require('Module:Core').format
    
local EnemyShipInfoKai = ShipInfoKai{
 
local EnemyShipInfoKai = ShipInfoKai{
Line 97: Line 97:  
_background_color = "grey",
 
_background_color = "grey",
 
_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(102, 102, 102, 0) 0%, rgba(102, 102, 102, 0) 60%, rgb(102, 102, 102) 100%);",
 
_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(102, 102, 102, 0) 0%, rgba(102, 102, 102, 0) 60%, rgb(102, 102, 102) 100%);",
_plain_rare_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(102, 102, 102, 0) 0%, rgba(102, 102, 102, 0.4) 60%, rgba(77, 77, 77, 0.7) 100%);",
+
_plain_rare_background_color = "#d8d840",
 +
_plain_rare_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(192, 192, 0, 0) 0%, rgba(192, 192, 0, 0.4) 60%, rgba(144, 144, 0, 0.7) 100%);",
 
_elite_glow_background_color = "#c95050",
 
_elite_glow_background_color = "#c95050",
 
_mid_boss_background_color = "#A67474",
 
_mid_boss_background_color = "#A67474",
Line 138: Line 139:  
_display_none = "none",
 
_display_none = "none",
 
}
 
}
 +
 +
function EnemyShipInfoKai:get_module()
 +
self._ship_data_module = EnemyShip:get_module(self._args.name or self._args[1], true)
 +
end
    
function EnemyShipInfoKai:bg_color()
 
function EnemyShipInfoKai:bg_color()
Line 150: Line 155:  
bg_color = self._mid_boss_background_color
 
bg_color = self._mid_boss_background_color
 
extra_style = self._mid_boss_background_image
 
extra_style = self._mid_boss_background_image
 +
elseif rarity == 7 then
 +
    bg_color = self._plain_rare_background_color
 +
extra_style = self._plain_rare_background_image
 
else
 
else
 
bg_color = self._background_color
 
bg_color = self._background_color
if rarity == 7 then
+
extra_style = self._background_image
extra_style = self._plain_rare_background_image
  −
elseif rarity == 6 then
  −
extra_style = self._background_image
  −
end
   
end
 
end
 
elseif rarity < 4 then
 
elseif rarity < 4 then
Line 199: Line 203:     
function EnemyShipInfoKai:id()
 
function EnemyShipInfoKai:id()
    local id = self._ship:id()
+
self._vars.id = Formatting:format_stat(self._ship:id())
    if id < 1501 then
  −
        id = id + 1000
  −
    end
  −
self._vars.id = Formatting:format_stat(id)
   
end
 
end
   Line 212: Line 212:  
function EnemyShipInfoKai:type()
 
function EnemyShipInfoKai:type()
 
local ship_type = Formatting:format_ship_type(self._ship:type())
 
local ship_type = Formatting:format_ship_type(self._ship:type())
if self._ship:is_pillbox() then
+
if self._ship:speed() == 0 then
ship_type = ship_type .. " (Pillbox)"
+
ship_type = ship_type ..
elseif self._ship:is_installation() then
+
(self._ship:is_pillbox() and " (Pillbox)" or " (Installation)")
ship_type = ship_type .. " (Installation)"
   
end
 
end
 +
-- automatically make units with 0 speed installations
 +
-- deprecate _installation
 
self._vars.type = ship_type
 
self._vars.type = ship_type
 
end
 
end
Line 223: Line 224:  
if self._ship:can_debuff() then
 
if self._ship:can_debuff() then
 
local tabber = Tabber()
 
local tabber = Tabber()
tabber:add_tab("Normal", ShipGraphicKai:get{ship = self._ship, size = self._args.cg_size or self._tabber_cg_size})
+
tabber:add_tab("Normal", ShipGraphicKai:get{ship = self._ship, size = self._args.cg_size or self._tabber_cg_size, hd = true})
 
tabber:add_tab("Armor Broken", ShipGraphicKai:get{ship = self._ship, damaged = true, size = self._args.cg_size or self._tabber_cg_size})
 
tabber:add_tab("Armor Broken", ShipGraphicKai:get{ship = self._ship, damaged = true, size = self._args.cg_size or self._tabber_cg_size})
 
self._vars.image = tostring(tabber)
 
self._vars.image = tostring(tabber)
 
else
 
else
self._vars.image = ShipGraphicKai:get{ship = self._ship, size = self._args.cg_size or self._cg_size}
+
self._vars.image = ShipGraphicKai:get{ship = self._ship, size = self._args.cg_size or self._cg_size, hd = true}
 
end
 
end
 
end
 
end
Line 238: Line 239:     
function EnemyShipInfoKai:armor()
 
function EnemyShipInfoKai:armor()
self._vars.armor = Formatting:format_stat(self._ship:armor())
+
    local equipment_armor = self._ship:equipment_armor()
 +
    local armor = self._ship:armor()
 +
    local stat = Formatting:format_stat(armor)
 +
self._vars.armor = equipment_armor ~= 0 and Formatting:tooltip(stat, armor + equipment_armor) or stat
 
end
 
end
   Line 305: Line 309:     
function EnemyShipInfoKai:air_power()
 
function EnemyShipInfoKai:air_power()
self._vars.air_power = Formatting:format_stat(self._ship:air_power())
+
self._vars.air_power = Formatting:format_air_power(self._ship:air_power(), self._ship:air_power_estimation())
 
end
 
end
  
Bots, gkautomate
12,557

edits