mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-31 07:39:44 +03:00
Fix for outfitting cabins and fighter hangars
This commit is contained in:
parent
4f72d02c35
commit
ea8f6e4ec0
@ -1 +1 @@
|
|||||||
Subproject commit c686af45cc299a2ba7f7eeace35dd3e898bbb588
|
Subproject commit d4ffc0202a929d25eb2056b1af00030a59a4512a
|
@ -79,6 +79,7 @@ fixup_map.update({
|
|||||||
'Enforcer Cannon' : ('Multi-cannon', 'Enforcer'),
|
'Enforcer Cannon' : ('Multi-cannon', 'Enforcer'),
|
||||||
'Enhanced Performance Thrusters': ('Thrusters', 'Enhanced Performance'),
|
'Enhanced Performance Thrusters': ('Thrusters', 'Enhanced Performance'),
|
||||||
'Imperial Hammer Rail Gun' : ('Rail Gun', 'Imperial Hammer'),
|
'Imperial Hammer Rail Gun' : ('Rail Gun', 'Imperial Hammer'),
|
||||||
|
'Luxury Class Passenger Cabin' : ('Luxury Passenger Cabin', None),
|
||||||
'Mining Lance Beam Laser' : ('Mining Laser', 'Mining Lance'),
|
'Mining Lance Beam Laser' : ('Mining Laser', 'Mining Lance'),
|
||||||
'Multi-Cannon' : ('Multi-cannon', None),
|
'Multi-Cannon' : ('Multi-cannon', None),
|
||||||
'Pacifier Frag-Cannon' : ('Fragment Cannon', 'Pacifier'),
|
'Pacifier Frag-Cannon' : ('Fragment Cannon', 'Pacifier'),
|
||||||
@ -335,5 +336,8 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
modules[key] = { 'mass': m.get('mass', 0) } # Some modules don't have mass
|
modules[key] = { 'mass': m.get('mass', 0) } # Some modules don't have mass
|
||||||
|
|
||||||
|
# not in coriolis-data at time of writing
|
||||||
|
modules[('Pulse Laser', None, '2', 'E')] = { 'mass': 4 } # Fixed used to be 2F
|
||||||
|
|
||||||
cPickle.dump(modules, open('modules.p', 'wb'), protocol = cPickle.HIGHEST_PROTOCOL)
|
cPickle.dump(modules, open('modules.p', 'wb'), protocol = cPickle.HIGHEST_PROTOCOL)
|
||||||
|
|
||||||
|
@ -45,10 +45,12 @@ ships = cPickle.load(open(join(config.respath, 'ships.p'), 'rb'))
|
|||||||
def export(data, filename=None):
|
def export(data, filename=None):
|
||||||
|
|
||||||
def class_rating(module):
|
def class_rating(module):
|
||||||
if 'guidance' in module:
|
if 'guidance' in module: # Missiles
|
||||||
return module['class'] + module['rating'] + '/' + module.get('mount', 'F')[0] + module['guidance'][0] + ' '
|
return module['class'] + module['rating'] + '/' + module.get('mount', 'F')[0] + module['guidance'][0] + ' '
|
||||||
elif 'mount' in module:
|
elif 'mount' in module: # Hardpoints
|
||||||
return module['class'] + module['rating'] + '/' + module['mount'][0] + ' '
|
return module['class'] + module['rating'] + '/' + module['mount'][0] + ' '
|
||||||
|
elif 'Cabin' in module['name']: # Passenger cabins
|
||||||
|
return module['class'] + module['rating'] + '/' + module['name'][0] + ' '
|
||||||
else:
|
else:
|
||||||
return module['class'] + module['rating'] + ' '
|
return module['class'] + module['rating'] + ' '
|
||||||
|
|
||||||
|
@ -187,7 +187,8 @@ rating_map = {
|
|||||||
'5': 'A',
|
'5': 'A',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ratings are messed up for Corrosion Resistant Cargo Rack
|
# Ratings are weird for the following
|
||||||
|
|
||||||
corrosion_rating_map = {
|
corrosion_rating_map = {
|
||||||
'1': 'E',
|
'1': 'E',
|
||||||
'2': 'F',
|
'2': 'F',
|
||||||
@ -198,6 +199,10 @@ planet_rating_map = {
|
|||||||
'2': 'G',
|
'2': 'G',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fighter_rating_map = {
|
||||||
|
'1': 'D',
|
||||||
|
}
|
||||||
|
|
||||||
misc_internal_map = {
|
misc_internal_map = {
|
||||||
('detailedsurfacescanner', 'tiny') : ('Detailed Surface Scanner', 'C'),
|
('detailedsurfacescanner', 'tiny') : ('Detailed Surface Scanner', 'C'),
|
||||||
('dockingcomputer', 'standard') : ('Standard Docking Computer', 'E'),
|
('dockingcomputer', 'standard') : ('Standard Docking Computer', 'E'),
|
||||||
@ -224,7 +229,7 @@ internal_map = {
|
|||||||
'cargorack' : 'Cargo Rack',
|
'cargorack' : 'Cargo Rack',
|
||||||
'collection' : 'Collector Limpet Controller',
|
'collection' : 'Collector Limpet Controller',
|
||||||
'corrosionproofcargorack' : 'Corrosion Resistant Cargo Rack',
|
'corrosionproofcargorack' : 'Corrosion Resistant Cargo Rack',
|
||||||
'fighterbay' : 'Fighter Bay',
|
'fighterbay' : 'Fighter Hangar',
|
||||||
'fsdinterdictor' : 'Frame Shift Drive Interdictor',
|
'fsdinterdictor' : 'Frame Shift Drive Interdictor',
|
||||||
'fuelscoop' : 'Fuel Scoop',
|
'fuelscoop' : 'Fuel Scoop',
|
||||||
'fueltransfer' : 'Fuel Transfer Limpet Controller',
|
'fueltransfer' : 'Fuel Transfer Limpet Controller',
|
||||||
@ -351,7 +356,7 @@ def lookup(module, ship_map, entitled=False):
|
|||||||
elif name[1] in internal_map: # e.g. Int_CargoRack_Size8_Class1
|
elif name[1] in internal_map: # e.g. Int_CargoRack_Size8_Class1
|
||||||
new['category'] = 'internal'
|
new['category'] = 'internal'
|
||||||
if name[1] == 'passengercabin':
|
if name[1] == 'passengercabin':
|
||||||
new['name'] = cabin_map[name[1]]
|
new['name'] = cabin_map[name[3][5:]]
|
||||||
else:
|
else:
|
||||||
new['name'] = internal_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
new['name'] = internal_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
||||||
else:
|
else:
|
||||||
@ -360,6 +365,7 @@ def lookup(module, ship_map, entitled=False):
|
|||||||
if not name[2].startswith('size') or not name[3].startswith('class'): raise AssertionError('%s: Unknown class/rating "%s/%s"' % (module['id'], name[2], name[3]))
|
if not name[2].startswith('size') or not name[3].startswith('class'): raise AssertionError('%s: Unknown class/rating "%s/%s"' % (module['id'], name[2], name[3]))
|
||||||
new['class'] = str(name[2][4:])
|
new['class'] = str(name[2][4:])
|
||||||
new['rating'] = (name[1]=='buggybay' and planet_rating_map or
|
new['rating'] = (name[1]=='buggybay' and planet_rating_map or
|
||||||
|
name[1]=='fighterbay' and fighter_rating_map or
|
||||||
name[1]=='corrosionproofcargorack' and corrosion_rating_map or
|
name[1]=='corrosionproofcargorack' and corrosion_rating_map or
|
||||||
rating_map)[name[3][5:]]
|
rating_map)[name[3][5:]]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user