Changes

no edit summary
Line 164: Line 164:  
function ShipData:code()
 
function ShipData:code()
 
return Formatting:format_ship_code(self._type)
 
return Formatting:format_ship_code(self._type)
 +
end
 +
 +
function ShipData:formatted_type()
 +
return Formatting:format_ship_type(self._type)
 
end
 
end
   Line 573: Line 577:  
    devmat = self._remodel_development_material,
 
    devmat = self._remodel_development_material,
 
    conmat = self._remodel_construction_material or false,
 
    conmat = self._remodel_construction_material or false,
    screw = false
+
    screw = self._remodel_screw or false,
 
     }
 
     }
 
end
 
end
Line 607: Line 611:  
function ShipData:remodel_construction_material()
 
function ShipData:remodel_construction_material()
 
return self._remodel_construction_material
 
return self._remodel_construction_material
 +
end
 +
 +
function ShipData:remodel_screw()
 +
return self._remodel_screw
 
end
 
end
   Line 621: Line 629:  
    devmat = self._remodel_to_development_material,
 
    devmat = self._remodel_to_development_material,
 
    conmat = self._remodel_to_construction_material or false,
 
    conmat = self._remodel_to_construction_material or false,
    screw = false
+
    screw = self._remodel_to_screw or false,
 
     }
 
     }
 
end
 
end
Line 717: Line 725:  
function ShipData:speed()
 
function ShipData:speed()
 
return self._speed
 
return self._speed
 +
end
 +
 +
function ShipData:formatted_speed()
 +
return Formatting:format_speed(self._speed)
 
end
 
end
    
function ShipData:range()
 
function ShipData:range()
 
return self._range
 
return self._range
 +
end
 +
 +
function ShipData:formatted_range()
 +
return Formatting:format_range(self._range)
 
end
 
end
   Line 856: Line 872:  
end
 
end
   −
--The implementation date for this ship. A 3-tuple of year, month, day (JST) as a table, or nil if unknown.
  −
--EXPERIMENTAL, DO NOT USE. Spec for this feature may rapidly change.
   
function ShipData:implementation_date()
 
function ShipData:implementation_date()
 
if self._implementation_date ~= nil then
 
if self._implementation_date ~= nil then
Line 866: Line 880:  
end
 
end
 
     return self._implementation_date
 
     return self._implementation_date
 +
end
 +
 +
function ShipData:implementation_date_string()
 +
local date = self:implementation_date()
 +
    return not date and "??" or string.format("%s/%s/%s", date[1], date[2] < 10 and "0" .. date[2] or date[2], date[3] < 10 and "0" .. date[3] or date[3])
 
end
 
end
  
cssedit, gkautomate
6,926

edits