• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Lots of fixes
Line 18: Line 18:  
_remodel_level = "'''Remodel Level'''",
 
_remodel_level = "'''Remodel Level'''",
 
_build_time = "'''Build Time'''",
 
_build_time = "'''Build Time'''",
_id_1 = "%d",
+
_id_1 = "%s",
_id_2 = "%d (%d)",
+
_id_2 = "%s (%s)",
 
_stat_1 = "%d",
 
_stat_1 = "%d",
 
_stat_2 = "%d (%d)",
 
_stat_2 = "%d (%d)",
Line 28: Line 28:  
_template = [[{|style="border: 1px solid darkgray; width: 320px;"
 
_template = [[{|style="border: 1px solid darkgray; width: 320px;"
 
|-
 
|-
|colspan="4" style="text-align: center; background-color: ${name_bg_color};${name_extra_style}"|<p style="font-size:20px">'''${name}'''</p>
+
|colspan="4" style="text-align: center; background-color: ${top_bg_color};${top_extra_style}"|<p style="font-size:20px">'''${name}'''</p>
 
<p style="font-size:15px">'''No.${id} ${japanese_name}'''</p>
 
<p style="font-size:15px">'''No.${id} ${japanese_name}'''</p>
 
<p>'''${class} ${type}'''</p>
 
<p>'''${class} ${type}'''</p>
Line 95: Line 95:     
function ShipInfoKai:id(ship)
 
function ShipInfoKai:id(ship)
return mw.ustring.format(ship.has_true_id() and self._id_2 or self._id_1, ship:id(), ship:true_id())
+
return mw.ustring.format(ship:has_true_id() and self._id_2 or self._id_1, ship:id(), ship:true_id())
 
end
 
end
    
function ShipInfoKai:image(ship)
 
function ShipInfoKai:image(ship)
return mw.ustring.format("[[File:%s]]", ship.card() or self._catbomb)
+
return mw.ustring.format("[[File:%s]]", ship:card(true) or self._catbomb)
 
end
 
end
   Line 105: Line 105:  
return mw.ustring.format(self._stat_1, ship:hp())
 
return mw.ustring.format(self._stat_1, ship:hp())
 
end
 
end
 +
 
function ShipInfoKai:firepower(ship)
 
function ShipInfoKai:firepower(ship)
 
return mw.ustring.format(ship:has_firepower_max() and self._stat_2 or self._stat_1, ship:firepower(), ship:firepower_max())
 
return mw.ustring.format(ship:has_firepower_max() and self._stat_2 or self._stat_1, ship:firepower(), ship:firepower_max())
Line 127: Line 128:  
function ShipInfoKai:asw(ship)
 
function ShipInfoKai:asw(ship)
 
return mw.ustring.format(ship:has_asw_max() and self._stat_2 or self._stat_1, ship:asw(), ship:asw_max())
 
return mw.ustring.format(ship:has_asw_max() and self._stat_2 or self._stat_1, ship:asw(), ship:asw_max())
 +
end
 +
 +
function ShipInfoKai:speed(ship)
 +
return ship:speed()
 
end
 
end
    
function ShipInfoKai:los(ship)
 
function ShipInfoKai:los(ship)
 
return mw.ustring.format(ship:has_los_max() and self._stat_2 or self._stat_1, ship:los(), ship:los_max())
 
return mw.ustring.format(ship:has_los_max() and self._stat_2 or self._stat_1, ship:los(), ship:los_max())
end
+
end
 +
 
 +
function ShipInfoKai:range(ship)
 +
return ship:range()
 +
end
    
function ShipInfoKai:luck(ship)
 
function ShipInfoKai:luck(ship)
Line 152: Line 161:  
local slots = {}
 
local slots = {}
 
for i = 1, ship:slots() do
 
for i = 1, ship:slots() do
slots:insert(format(self._slot_template, {equipment = ship:equipment(i), space = ship:space(i)}))
+
table.insert(slots, format(self._slot_template, {equipment = ship:equipment(i), space = ship:space(i)}))
 
end
 
end
return slots:concat()
+
return table.concat(slots)
 
end
 
end
   −
function ShipInfoKai:Infobox(ship, model)
+
function ShipInfoKai:Infobox(name, model)
local ship = Ship(ship, model)
+
local ship = Ship(name, model)
 
local vars = {}
 
local vars = {}
local rarity = ship.rarity(true) or 0
+
local rarity = ship:rarity(true) or 0
 
vars.top_bg_color = self:top_bg_color(ship)
 
vars.top_bg_color = self:top_bg_color(ship)
vars.name = ship.name()
+
vars.top_extra_style = self:top_extra_style(ship)
 +
vars.name = ship:name()
 
vars.id = self:id(ship)
 
vars.id = self:id(ship)
vars.japanese_name = ship.japanese_name()
+
vars.japanese_name = ship:japanese_name()
vars.class = ship.class()
+
vars.class = ship:class()
vars.type = ship.type()
+
vars.type = ship:type()
 
vars.image = self:image(ship)
 
vars.image = self:image(ship)
 
vars.hp = self:hp(ship)
 
vars.hp = self:hp(ship)
Line 184: Line 194:  
vars.slots = self:slots(ship)
 
vars.slots = self:slots(ship)
 
vars.slot_details = self:slot_details(ship)
 
vars.slot_details = self:slot_details(ship)
 +
return format(self._template, vars)
 
end
 
end
    
return ShipInfoKai
 
return ShipInfoKai
Anonymous user

Navigation menu