| Line 156: |
Line 156: |
| | function ShipData:class_number() | | function ShipData:class_number() |
| | return self._class_number | | return self._class_number |
| | + | end |
| | + | |
| | + | function ShipData:display_class() |
| | + | return self._display_class |
| | end | | end |
| | | | |
| Line 164: |
Line 168: |
| | 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 |
| | | | |
| | function ShipData:is_battleship() | | function ShipData:is_battleship() |
| | return self._type == 8 or self._type == 9 or self._type == 10 or self._type == 12 | | return self._type == 8 or self._type == 9 or self._type == 10 or self._type == 12 |
| | + | end |
| | + | |
| | + | function ShipData:is_carrier() |
| | + | return self._type == 7 or self._type == 11 or self._type == 18 |
| | + | end |
| | + | |
| | + | function ShipData:is_auxiliary() |
| | + | return self._type == 22 or self._type == 16 or self._type == 17 or self._type == 19 or self._type == 20 |
| | + | end |
| | + | |
| | + | function ShipData:is_submarine() |
| | + | return self._type == 13 or self._type == 14 |
| | + | end |
| | + | |
| | + | function ShipData:is_CL() |
| | + | 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 553: |
Line 581: |
| | 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 |
| | + | |
| | + | function ShipData:all_remodel_cost() |
| | + | return { |
| | + | ammo = self._remodel_ammo, |
| | + | steel = self._remodel_steel, |
| | + | devmat = self._remodel_development_material, |
| | + | conmat = self._remodel_construction_material or false, |
| | + | screw = self._remodel_screw or false, |
| | + | blueprint = self._remodel_blueprint, |
| | + | catapult = self._remodel_catapult, |
| | + | report = self._remodel_report or false, |
| | + | gunmat = self._remodel_gunmat or false, |
| | + | airmat = self._remodel_airmat or false, |
| | + | armament = self._remodel_armament or false, |
| | + | overseas = self._remodel_overseas or false, |
| | } | | } |
| | end | | end |
| Line 587: |
Line 632: |
| | 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 601: |
Line 650: |
| | 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 |
| | + | |
| | + | function ShipData:all_remodel_to_cost() |
| | + | return { |
| | + | ammo = self._remodel_to_ammo, |
| | + | steel = self._remodel_to_steel, |
| | + | devmat = self._remodel_to_development_material, |
| | + | conmat = self._remodel_to_construction_material or false, |
| | + | screw = self._remodel_to_screw or false, |
| | + | blueprint = self._remodel_to_blueprint, |
| | + | catapult = self._remodel_to_catapult, |
| | + | report = self._remodel_to_report or false, |
| | + | gunmat = self._remodel_to_gunmat or false, |
| | + | airmat = self._remodel_to_airmat or false, |
| | + | armament = self._remodel_to_armament or false, |
| | + | overseas = self._remodel_to_overseas or false, |
| | } | | } |
| | end | | end |
| Line 697: |
Line 763: |
| | 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 836: |
Line 910: |
| | 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 846: |
Line 918: |
| | 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 |
| | | | |