mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 15:57:14 +03:00
Add missing 3.2 ships, modules & commoditites
This commit is contained in:
parent
88dc460a27
commit
f2bd931a84
@ -36,7 +36,7 @@ def addcommodities(data):
|
||||
new = {
|
||||
'id' : commodity['id'],
|
||||
'symbol' : commodity['name'],
|
||||
'category' : commodity['categoryname'],
|
||||
'category' : companion.category_map.get(commodity['categoryname']) or commodity['categoryname'],
|
||||
'name' : commodity.get('locName') or 'Limpets',
|
||||
}
|
||||
old = commodities.get(key)
|
||||
|
@ -111,8 +111,8 @@ id,symbol,category,name
|
||||
128672131,DiplomaticBag,Salvage,Diplomatic Bag
|
||||
128672132,ScientificResearch,Salvage,Scientific Research
|
||||
128672133,ScientificSamples,Salvage,Scientific Samples
|
||||
128672134,PoliticalPrisoner,Salvage,Political Prisoner
|
||||
128672135,Hostage,Salvage,Hostage
|
||||
128672134,PoliticalPrisoner,Salvage,Political Prisoners
|
||||
128672135,Hostage,Salvage,Hostages
|
||||
128672136,LargeExplorationDataCash,Salvage,Large Survey Data Cache
|
||||
128672137,SmallExplorationDataCash,Salvage,Small Survey Data Cache
|
||||
128672159,AntiqueJewellery,Salvage,Antique Jewellery
|
||||
@ -204,3 +204,5 @@ id,symbol,category,name
|
||||
128793129,ThargoidTissueSampleType2,Salvage,Thargoid Basilisk Tissue Sample
|
||||
128793130,ThargoidTissueSampleType3,Salvage,Thargoid Medusa Tissue Sample
|
||||
128824468,ThargoidScoutTissueSample,Salvage,Thargoid Scout Tissue Sample
|
||||
128888499,AncientKey,Salvage,Ancient Key
|
||||
128902652,ThargoidTissueSampleType4,Salvage,Thargoid Hydra Tissue Sample
|
||||
|
|
@ -73,6 +73,7 @@ ship_map = {
|
||||
'type9' : 'Type-9 Heavy',
|
||||
'type9_military' : 'Type-10 Defender',
|
||||
'typex' : 'Alliance Chieftain',
|
||||
'typex_2' : 'Alliance Crusader',
|
||||
'typex_3' : 'Alliance Challenger',
|
||||
'viper' : 'Viper MkIII',
|
||||
'viper_mkiv' : 'Viper MkIV',
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e9417ea417690006db18ab649ed6f2384ea12416
|
||||
Subproject commit 48f19712170915328d38804ca3470fdf20ff176f
|
40
coriolis.py
40
coriolis.py
@ -3,10 +3,12 @@
|
||||
# build ship and module databases from https://github.com/EDCD/coriolis-data/
|
||||
#
|
||||
|
||||
import csv
|
||||
import base64
|
||||
from collections import OrderedDict
|
||||
import cPickle
|
||||
import json
|
||||
from traceback import print_exc
|
||||
|
||||
from config import config
|
||||
import outfitting
|
||||
@ -73,33 +75,15 @@ if __name__ == "__main__":
|
||||
else:
|
||||
modules[key] = { 'mass': m.get('mass', 0) } # Some modules don't have mass
|
||||
|
||||
# 3.0 / 3.1 additions not yet present in coriolis-data
|
||||
add(modules, 'hpt_causticmissile_fixed_medium', {'mass': 4})
|
||||
add(modules, 'hpt_flechettelauncher_fixed_medium', {'mass': 4})
|
||||
add(modules, 'hpt_flechettelauncher_turret_medium', {'mass': 4})
|
||||
add(modules, 'hpt_guardian_plasmalauncher_fixed_large', {'mass': 8})
|
||||
add(modules, 'hpt_guardian_plasmalauncher_turret_large', {'mass': 8})
|
||||
add(modules, 'hpt_guardian_shardcannon_turret_medium', {'mass': 4})
|
||||
add(modules, 'hpt_guardian_shardcannon_turret_large', {'mass': 8})
|
||||
add(modules, 'hpt_plasmashockcannon_fixed_medium', {'mass': 4})
|
||||
add(modules, 'hpt_plasmashockcannon_gimbal_large', {'mass': 8}) # ???
|
||||
add(modules, 'hpt_plasmashockcannon_turret_medium', {'mass': 4})
|
||||
add(modules, 'hpt_plasmashockcannon_turret_large', {'mass': 8}) # ???
|
||||
add(modules, 'int_dronecontrol_decontamination_size1_class1', {'mass': 1.3})
|
||||
add(modules, 'int_dronecontrol_decontamination_size3_class1', {'mass': 2})
|
||||
add(modules, 'int_dronecontrol_decontamination_size5_class1', {'mass': 20})
|
||||
add(modules, 'int_dronecontrol_decontamination_size7_class1', {'mass': 128})
|
||||
add(modules, 'int_dronecontrol_unkvesselresearch', {'mass': 1.3})
|
||||
add(modules, 'int_metaalloyhullreinforcement_size1_class1', { 'mass': 2 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size1_class2', { 'mass': 2 }) # anomaly
|
||||
add(modules, 'int_metaalloyhullreinforcement_size2_class1', { 'mass': 4 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size2_class2', { 'mass': 2 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size3_class1', { 'mass': 8 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size3_class2', { 'mass': 4 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size4_class1', { 'mass': 16 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size4_class2', { 'mass': 8 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size5_class1', { 'mass': 32 })
|
||||
add(modules, 'int_metaalloyhullreinforcement_size5_class2', { 'mass': 16 })
|
||||
|
||||
modules = OrderedDict([(k,modules[k]) for k in sorted(modules)]) # sort for easier diffing
|
||||
cPickle.dump(modules, open('modules.p', 'wb'))
|
||||
|
||||
# Check data is present for all modules
|
||||
with open('outfitting.csv') as csvfile:
|
||||
reader = csv.DictReader(csvfile, restval='')
|
||||
for row in reader:
|
||||
try:
|
||||
module = outfitting.lookup({ 'id': row['id'], 'name': row['symbol'] }, companion.ship_map)
|
||||
except:
|
||||
print row['symbol']
|
||||
print_exc()
|
||||
|
@ -21,7 +21,7 @@ weapon_map = {
|
||||
'advancedtorppylon' : 'Torpedo Pylon',
|
||||
'atdumbfiremissile' : 'AX Missile Rack',
|
||||
'atmulticannon' : 'AX Multi-Cannon',
|
||||
'basicmissilerack' : 'Missile Rack',
|
||||
'basicmissilerack' : 'Seeker Missile Rack',
|
||||
'beamlaser' : 'Beam Laser',
|
||||
('beamlaser','heat') : 'Retributor Beam Laser',
|
||||
'cannon' : 'Cannon',
|
||||
@ -81,6 +81,7 @@ weaponclass_map = {
|
||||
weaponrating_map = {
|
||||
'hpt_advancedtorppylon_fixed_small' : 'I',
|
||||
'hpt_advancedtorppylon_fixed_medium': 'I',
|
||||
'hpt_advancedtorppylon_fixed_large' : 'I',
|
||||
'hpt_atdumbfiremissile_fixed_medium': 'B',
|
||||
'hpt_atdumbfiremissile_fixed_large' : 'A',
|
||||
'hpt_atdumbfiremissile_turret_medium': 'B',
|
||||
@ -91,6 +92,7 @@ weaponrating_map = {
|
||||
'hpt_atmulticannon_turret_large' : 'E',
|
||||
'hpt_basicmissilerack_fixed_small' : 'B',
|
||||
'hpt_basicmissilerack_fixed_medium' : 'B',
|
||||
'hpt_basicmissilerack_fixed_large' : 'A',
|
||||
'hpt_beamlaser_fixed_small' : 'E',
|
||||
'hpt_beamlaser_fixed_medium' : 'D',
|
||||
'hpt_beamlaser_fixed_large': 'C',
|
||||
@ -117,17 +119,23 @@ weaponrating_map = {
|
||||
'hpt_drunkmissilerack_fixed_medium': 'B',
|
||||
'hpt_dumbfiremissilerack_fixed_small': 'B',
|
||||
'hpt_dumbfiremissilerack_fixed_medium': 'B',
|
||||
'hpt_dumbfiremissilerack_fixed_large': 'A',
|
||||
'hpt_flakmortar_fixed_medium': 'B',
|
||||
'hpt_flakmortar_turret_medium': 'B',
|
||||
'hpt_flechettelauncher_fixed_medium': 'B',
|
||||
'hpt_flechettelauncher_turret_medium': 'B',
|
||||
'hpt_guardian_gausscannon_fixed_medium': 'B', # guess
|
||||
'hpt_guardian_gausscannon_fixed_small': 'D',
|
||||
'hpt_guardian_gausscannon_fixed_medium': 'B',
|
||||
'hpt_guardian_plasmalauncher_fixed_small': 'D',
|
||||
'hpt_guardian_plasmalauncher_fixed_medium': 'B',
|
||||
'hpt_guardian_plasmalauncher_fixed_large': 'C',
|
||||
'hpt_guardian_plasmalauncher_turret_small': 'F',
|
||||
'hpt_guardian_plasmalauncher_turret_medium': 'E',
|
||||
'hpt_guardian_plasmalauncher_turret_large': 'D',
|
||||
'hpt_guardian_shardcannon_fixed_small': 'D',
|
||||
'hpt_guardian_shardcannon_fixed_medium': 'A',
|
||||
'hpt_guardian_shardcannon_fixed_large': 'C',
|
||||
'hpt_guardian_shardcannon_turret_small': 'F',
|
||||
'hpt_guardian_shardcannon_turret_medium': 'D',
|
||||
'hpt_guardian_shardcannon_turret_large': 'D',
|
||||
'hpt_minelauncher_fixed_small': 'I',
|
||||
@ -146,13 +154,17 @@ weaponrating_map = {
|
||||
'hpt_multicannon_gimbal_huge': 'A',
|
||||
'hpt_multicannon_turret_small': 'G',
|
||||
'hpt_multicannon_turret_medium': 'F',
|
||||
'hpt_multicannon_turret_large': 'E',
|
||||
'hpt_plasmaaccelerator_fixed_medium': 'C',
|
||||
'hpt_plasmaaccelerator_fixed_large': 'B',
|
||||
'hpt_plasmaaccelerator_fixed_huge': 'A',
|
||||
'hpt_plasmashockcannon_fixed_small': 'D',
|
||||
'hpt_plasmashockcannon_fixed_medium': 'D',
|
||||
'hpt_plasmashockcannon_fixed_large': 'C',
|
||||
'hpt_plasmashockcannon_gimbal_small': 'E',
|
||||
'hpt_plasmashockcannon_gimbal_medium': 'D',
|
||||
'hpt_plasmashockcannon_gimbal_large': 'C',
|
||||
'hpt_plasmashockcannon_turret_small': 'F',
|
||||
'hpt_plasmashockcannon_turret_medium': 'E',
|
||||
'hpt_plasmashockcannon_turret_large': 'D',
|
||||
'hpt_pulselaser_fixed_small': 'F',
|
||||
@ -305,7 +317,7 @@ internal_map = {
|
||||
|
||||
|
||||
# Module mass, FSD data etc
|
||||
moduledata = cPickle.load(open(join(config.respath, 'modules.p'), 'rb'))
|
||||
moduledata = OrderedDict()
|
||||
|
||||
|
||||
# Given a module description from the Companion API returns a description of the module in the form of a
|
||||
@ -317,6 +329,10 @@ moduledata = cPickle.load(open(join(config.respath, 'modules.p'), 'rb'))
|
||||
# (Given the ad-hocery in this implementation a big lookup table might have been simpler and clearer).
|
||||
def lookup(module, ship_map, entitled=False):
|
||||
|
||||
# Lazily populate
|
||||
if not moduledata:
|
||||
moduledata.update(cPickle.load(open(join(config.respath, 'modules.p'), 'rb')))
|
||||
|
||||
# if not module.get('category'): raise AssertionError('%s: Missing category' % module['id']) # only present post 1.3, and not present in ship loadout
|
||||
if not module.get('name'): raise AssertionError('%s: Missing name' % module['id'])
|
||||
|
||||
@ -358,9 +374,13 @@ def lookup(module, ship_map, entitled=False):
|
||||
if name[4] in weaponoldvariant_map: # Old variants e.g. Hpt_PulseLaserBurst_Turret_Large_OC
|
||||
new['name'] = weapon_map[name[1]] + ' ' + weaponoldvariant_map[name[4]]
|
||||
new['rating'] = '?'
|
||||
elif '_'.join(name[:4]) not in weaponrating_map:
|
||||
raise AssertionError('%s: Unknown weapon rating "%s"' % (module['id'], module['name']))
|
||||
else: # PP faction-specific weapons e.g. Hpt_Slugshot_Fixed_Large_Range
|
||||
new['name'] = weapon_map[(name[1],name[4])]
|
||||
new['rating'] = weaponrating_map['_'.join(name[:4])] # assumes same rating as base weapon
|
||||
elif module['name'].lower() not in weaponrating_map:
|
||||
raise AssertionError('%s: Unknown weapon rating "%s"' % (module['id'], module['name']))
|
||||
else:
|
||||
new['name'] = weapon_map[name[1]]
|
||||
new['rating'] = weaponrating_map[module['name'].lower()] # no obvious rule - needs lookup table
|
||||
|
132
ships.p
132
ships.p
@ -22,196 +22,202 @@ a(dp12
|
||||
g6
|
||||
I400
|
||||
saa(lp13
|
||||
S'Anaconda'
|
||||
S'Alliance Crusader'
|
||||
p14
|
||||
a(dp15
|
||||
g6
|
||||
I400
|
||||
I500
|
||||
saa(lp16
|
||||
S'Asp Explorer'
|
||||
S'Anaconda'
|
||||
p17
|
||||
a(dp18
|
||||
g6
|
||||
I280
|
||||
I400
|
||||
saa(lp19
|
||||
S'Asp Scout'
|
||||
S'Asp Explorer'
|
||||
p20
|
||||
a(dp21
|
||||
g6
|
||||
I150
|
||||
I280
|
||||
saa(lp22
|
||||
S'Beluga Liner'
|
||||
S'Asp Scout'
|
||||
p23
|
||||
a(dp24
|
||||
g6
|
||||
I950
|
||||
I150
|
||||
saa(lp25
|
||||
S'Cobra MkIII'
|
||||
S'Beluga Liner'
|
||||
p26
|
||||
a(dp27
|
||||
g6
|
||||
I180
|
||||
I950
|
||||
saa(lp28
|
||||
S'Cobra MkIV'
|
||||
S'Cobra MkIII'
|
||||
p29
|
||||
a(dp30
|
||||
g6
|
||||
I210
|
||||
I180
|
||||
saa(lp31
|
||||
S'Diamondback Explorer'
|
||||
S'Cobra MkIV'
|
||||
p32
|
||||
a(dp33
|
||||
g6
|
||||
I260
|
||||
I210
|
||||
saa(lp34
|
||||
S'Diamondback Scout'
|
||||
S'Diamondback Explorer'
|
||||
p35
|
||||
a(dp36
|
||||
g6
|
||||
I170
|
||||
I260
|
||||
saa(lp37
|
||||
S'Dolphin'
|
||||
S'Diamondback Scout'
|
||||
p38
|
||||
a(dp39
|
||||
g6
|
||||
I140
|
||||
I170
|
||||
saa(lp40
|
||||
S'Eagle'
|
||||
S'Dolphin'
|
||||
p41
|
||||
a(dp42
|
||||
g6
|
||||
I50
|
||||
I140
|
||||
saa(lp43
|
||||
S'Federal Assault Ship'
|
||||
S'Eagle'
|
||||
p44
|
||||
a(dp45
|
||||
g6
|
||||
I480
|
||||
I50
|
||||
saa(lp46
|
||||
S'Federal Corvette'
|
||||
S'Federal Assault Ship'
|
||||
p47
|
||||
a(dp48
|
||||
g6
|
||||
I900
|
||||
I480
|
||||
saa(lp49
|
||||
S'Federal Dropship'
|
||||
S'Federal Corvette'
|
||||
p50
|
||||
a(dp51
|
||||
g6
|
||||
I580
|
||||
I900
|
||||
saa(lp52
|
||||
S'Federal Gunship'
|
||||
S'Federal Dropship'
|
||||
p53
|
||||
a(dp54
|
||||
g6
|
||||
I580
|
||||
saa(lp55
|
||||
S'Fer-de-Lance'
|
||||
S'Federal Gunship'
|
||||
p56
|
||||
a(dp57
|
||||
g6
|
||||
I250
|
||||
I580
|
||||
saa(lp58
|
||||
S'Hauler'
|
||||
S'Fer-de-Lance'
|
||||
p59
|
||||
a(dp60
|
||||
g6
|
||||
I14
|
||||
I250
|
||||
saa(lp61
|
||||
S'Imperial Clipper'
|
||||
S'Hauler'
|
||||
p62
|
||||
a(dp63
|
||||
g6
|
||||
I400
|
||||
I14
|
||||
saa(lp64
|
||||
S'Imperial Courier'
|
||||
S'Imperial Clipper'
|
||||
p65
|
||||
a(dp66
|
||||
g6
|
||||
I35
|
||||
I400
|
||||
saa(lp67
|
||||
S'Imperial Cutter'
|
||||
S'Imperial Courier'
|
||||
p68
|
||||
a(dp69
|
||||
g6
|
||||
I1100
|
||||
I35
|
||||
saa(lp70
|
||||
S'Imperial Eagle'
|
||||
S'Imperial Cutter'
|
||||
p71
|
||||
a(dp72
|
||||
g6
|
||||
I50
|
||||
I1100
|
||||
saa(lp73
|
||||
S'Keelback'
|
||||
S'Imperial Eagle'
|
||||
p74
|
||||
a(dp75
|
||||
g6
|
||||
I180
|
||||
I50
|
||||
saa(lp76
|
||||
S'Krait MkII'
|
||||
S'Keelback'
|
||||
p77
|
||||
a(dp78
|
||||
g6
|
||||
I320
|
||||
I180
|
||||
saa(lp79
|
||||
S'Orca'
|
||||
S'Krait MkII'
|
||||
p80
|
||||
a(dp81
|
||||
g6
|
||||
I290
|
||||
I320
|
||||
saa(lp82
|
||||
S'Python'
|
||||
S'Orca'
|
||||
p83
|
||||
a(dp84
|
||||
g6
|
||||
I350
|
||||
I290
|
||||
saa(lp85
|
||||
S'Sidewinder'
|
||||
S'Python'
|
||||
p86
|
||||
a(dp87
|
||||
g6
|
||||
I25
|
||||
I350
|
||||
saa(lp88
|
||||
S'Type-10 Defender'
|
||||
S'Sidewinder'
|
||||
p89
|
||||
a(dp90
|
||||
g6
|
||||
I1200
|
||||
I25
|
||||
saa(lp91
|
||||
S'Type-6 Transporter'
|
||||
S'Type-10 Defender'
|
||||
p92
|
||||
a(dp93
|
||||
g6
|
||||
I155
|
||||
I1200
|
||||
saa(lp94
|
||||
S'Type-7 Transporter'
|
||||
S'Type-6 Transporter'
|
||||
p95
|
||||
a(dp96
|
||||
g6
|
||||
I350
|
||||
I155
|
||||
saa(lp97
|
||||
S'Type-9 Heavy'
|
||||
S'Type-7 Transporter'
|
||||
p98
|
||||
a(dp99
|
||||
g6
|
||||
I850
|
||||
I350
|
||||
saa(lp100
|
||||
S'Viper MkIII'
|
||||
S'Type-9 Heavy'
|
||||
p101
|
||||
a(dp102
|
||||
g6
|
||||
I50
|
||||
I850
|
||||
saa(lp103
|
||||
S'Viper MkIV'
|
||||
S'Viper MkIII'
|
||||
p104
|
||||
a(dp105
|
||||
g6
|
||||
I190
|
||||
I50
|
||||
saa(lp106
|
||||
S'Vulture'
|
||||
S'Viper MkIV'
|
||||
p107
|
||||
a(dp108
|
||||
g6
|
||||
I190
|
||||
saa(lp109
|
||||
S'Vulture'
|
||||
p110
|
||||
a(dp111
|
||||
g6
|
||||
I230
|
||||
saatRp109
|
||||
saatRp112
|
||||
.
|
Loading…
x
Reference in New Issue
Block a user