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 184: |
Line 188: |
| function ShipData:is_CL() | | function ShipData:is_CL() |
| return self._type == 3 or self._type == 4 or self._type == 21 | | return self._type == 3 or self._type == 4 or self._type == 21 |
| + | end |
| + | |
| + | function ShipData:is_CA() |
| + | return self._type == 5 or self._type == 6 |
| end | | end |
| | | |
Line 569: |
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 603: |
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 617: |
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 713: |
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 852: |
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 862: |
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 |
| | | |