mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 07:47:14 +03:00
Handle new mining equipment in 3.3
This commit is contained in:
parent
004ae2e9c0
commit
4a81c1b0e2
20
coriolis.py
20
coriolis.py
@ -75,6 +75,26 @@ if __name__ == "__main__":
|
||||
else:
|
||||
modules[key] = { 'mass': m.get('mass', 0) } # Some modules don't have mass
|
||||
|
||||
# Pre 3.3 modules
|
||||
add(modules, 'int_stellarbodydiscoveryscanner_standard', { 'mass': 2 })
|
||||
add(modules, 'int_stellarbodydiscoveryscanner_intermediate', { 'mass': 2 })
|
||||
add(modules, 'int_stellarbodydiscoveryscanner_advanced', { 'mass': 2 })
|
||||
|
||||
# 3.3 additions not yet present in coriolis-data
|
||||
add(modules, 'hpt_mining_subsurfdispmisle_fixed_small', { 'mass': 2 })
|
||||
add(modules, 'hpt_mining_subsurfdispmisle_turret_small', { 'mass': 2 })
|
||||
add(modules, 'hpt_mining_subsurfdispmisle_fixed_medium', { 'mass': 4 })
|
||||
add(modules, 'hpt_mining_subsurfdispmisle_turret_medium', { 'mass': 4 })
|
||||
add(modules, 'hpt_mining_abrblstr_fixed_small', { 'mass': 2 })
|
||||
add(modules, 'hpt_mining_abrblstr_turret_small', { 'mass': 2 })
|
||||
add(modules, 'hpt_mining_seismchrgwarhd_fixed_medium', { 'mass': 4 })
|
||||
add(modules, 'hpt_mining_seismchrgwarhd_turret_medium', { 'mass': 4 })
|
||||
add(modules, 'hpt_mrascanner_size0_class1', { 'mass': 1.3 })
|
||||
add(modules, 'hpt_mrascanner_size0_class2', { 'mass': 1.3 })
|
||||
add(modules, 'hpt_mrascanner_size0_class3', { 'mass': 1.3 })
|
||||
add(modules, 'hpt_mrascanner_size0_class4', { 'mass': 1.3 })
|
||||
add(modules, 'hpt_mrascanner_size0_class5', { 'mass': 1.3 })
|
||||
|
||||
modules = OrderedDict([(k,modules[k]) for k in sorted(modules)]) # sort for easier diffing
|
||||
cPickle.dump(modules, open('modules.p', 'wb'))
|
||||
|
||||
|
@ -36,6 +36,9 @@ weapon_map = {
|
||||
'guardian_shardcannon' : 'Guardian Shard Cannon',
|
||||
'minelauncher' : 'Mine Launcher',
|
||||
('minelauncher','impulse') : 'Shock Mine Launcher',
|
||||
'mining_abrblstr' : 'Abrasion Blaster',
|
||||
'mining_seismchrgwarhd' : 'Seismic Charge Launcher',
|
||||
'mining_subsurfdispmisle' : 'Sub-Surface Displacement Missile',
|
||||
'mininglaser' : 'Mining Laser',
|
||||
('mininglaser','advanced') : 'Mining Lance Beam Laser',
|
||||
'multicannon' : 'Multi-Cannon',
|
||||
@ -140,6 +143,14 @@ weaponrating_map = {
|
||||
'hpt_guardian_shardcannon_turret_large': 'D',
|
||||
'hpt_minelauncher_fixed_small': 'I',
|
||||
'hpt_minelauncher_fixed_medium': 'I',
|
||||
'hpt_mining_abrblstr_fixed_small' : 'D',
|
||||
'hpt_mining_abrblstr_turret_small' : 'D',
|
||||
'hpt_mining_seismchrgwarhd_fixed_medium' : 'B',
|
||||
'hpt_mining_seismchrgwarhd_turret_medium' : 'B',
|
||||
'hpt_mining_subsurfdispmisle_fixed_small' : 'B',
|
||||
'hpt_mining_subsurfdispmisle_fixed_medium' : 'B',
|
||||
'hpt_mining_subsurfdispmisle_turret_small' : 'B',
|
||||
'hpt_mining_subsurfdispmisle_turret_medium' : 'B',
|
||||
'hpt_mininglaser_fixed_small': 'D',
|
||||
'hpt_mininglaser_fixed_medium': 'D',
|
||||
'hpt_mininglaser_turret_small': 'D',
|
||||
@ -225,6 +236,7 @@ utility_map = {
|
||||
'cargoscanner' : 'Cargo Scanner',
|
||||
'cloudscanner' : 'Frame Shift Wake Scanner',
|
||||
'crimescanner' : 'Kill Warrant Scanner',
|
||||
'mrascanner' : 'Pulse Wave Analyser',
|
||||
'shieldbooster' : 'Shield Booster',
|
||||
}
|
||||
|
||||
@ -264,6 +276,9 @@ fighter_rating_map = {
|
||||
misc_internal_map = {
|
||||
('detailedsurfacescanner', 'tiny') : ('Detailed Surface Scanner', 'C'),
|
||||
('dockingcomputer', 'standard') : ('Standard Docking Computer', 'E'),
|
||||
('stellarbodydiscoveryscanner', 'standard') : ('Basic Discovery Scanner', 'E'),
|
||||
('stellarbodydiscoveryscanner', 'intermediate') : ('Intermediate Discovery Scanner', 'D'),
|
||||
('stellarbodydiscoveryscanner', 'advanced') : ('Advanced Discovery Scanner', 'C'),
|
||||
}
|
||||
|
||||
standard_map = {
|
||||
@ -336,11 +351,6 @@ def lookup(module, ship_map, entitled=False):
|
||||
name = module['name'].lower().split('_')
|
||||
new = { 'id': module['id'], 'symbol': module['name'] }
|
||||
|
||||
# Hack 'Guardian used as a prefix'
|
||||
if name[1] == 'guardian':
|
||||
name.pop(1)
|
||||
name[1] = 'guardian_%s' % name[1]
|
||||
|
||||
# Armour - e.g. Federation_Dropship_Armour_Grade2
|
||||
if name[-2] == 'armour':
|
||||
name = module['name'].lower().rsplit('_', 2) # Armour is ship-specific, and ship names can have underscores
|
||||
@ -362,10 +372,30 @@ def lookup(module, ship_map, entitled=False):
|
||||
elif not entitled and name[1] == 'planetapproachsuite':
|
||||
return None
|
||||
|
||||
# Countermeasures - e.g. Hpt_PlasmaPointDefence_Turret_Tiny
|
||||
elif name[0]=='hpt' and name[1] in countermeasure_map:
|
||||
new['category'] = 'utility'
|
||||
new['name'], new['rating'] = countermeasure_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
||||
new['class'] = weaponclass_map[name[-1]]
|
||||
|
||||
# Utility - e.g. Hpt_CargoScanner_Size0_Class1
|
||||
elif name[0]=='hpt' and name[1] in utility_map:
|
||||
new['category'] = 'utility'
|
||||
new['name'] = utility_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
||||
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['rating'] = rating_map[name[3][5:]]
|
||||
|
||||
# Hardpoints - e.g. Hpt_Slugshot_Fixed_Medium
|
||||
elif name[0]=='hpt' and name[1] in weapon_map:
|
||||
elif name[0]=='hpt':
|
||||
# Hack 'Guardian' and 'Mining' prefixes
|
||||
if len(name) > 3 and name[3] in weaponmount_map:
|
||||
prefix = name.pop(1)
|
||||
name[1] = '%s_%s' % (prefix, name[1])
|
||||
if name[1] not in weapon_map: raise AssertionError('%s: Unknown weapon "%s"' % (module['id'], name[0]))
|
||||
if name[2] not in weaponmount_map: raise AssertionError('%s: Unknown weapon mount "%s"' % (module['id'], name[2]))
|
||||
if name[3] not in weaponclass_map: raise AssertionError('%s: Unknown weapon class "%s"' % (module['id'], name[3]))
|
||||
|
||||
new['category'] = 'hardpoint'
|
||||
if len(name)>4:
|
||||
if name[4] in weaponoldvariant_map: # Old variants e.g. Hpt_PulseLaserBurst_Turret_Large_OC
|
||||
@ -386,23 +416,6 @@ def lookup(module, ship_map, entitled=False):
|
||||
new['guidance'] = missiletype_map[name[1]]
|
||||
new['class'] = weaponclass_map[name[3]]
|
||||
|
||||
# Countermeasures - e.g. Hpt_PlasmaPointDefence_Turret_Tiny
|
||||
elif name[0]=='hpt' and name[1] in countermeasure_map:
|
||||
new['category'] = 'utility'
|
||||
new['name'], new['rating'] = countermeasure_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
||||
new['class'] = weaponclass_map[name[-1]]
|
||||
|
||||
# Utility - e.g. Hpt_CargoScanner_Size0_Class1
|
||||
elif name[0]=='hpt' and name[1] in utility_map:
|
||||
new['category'] = 'utility'
|
||||
new['name'] = utility_map[len(name)>4 and (name[1],name[4]) or name[1]]
|
||||
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['rating'] = rating_map[name[3][5:]]
|
||||
|
||||
elif name[0]=='hpt':
|
||||
raise AssertionError('%s: Unknown weapon "%s"' % (module['id'], name[1]))
|
||||
|
||||
elif name[0]!='int':
|
||||
raise AssertionError('%s: Unknown prefix "%s"' % (module['id'], name[0]))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user