Clean up alpha clones for December 2017 release - also runs a few sanity checks to make sure that CCP doesn't forget to include a skill in one of the races

This commit is contained in:
blitzmann
2017-11-22 21:42:25 -05:00
parent e4f3ed05cc
commit 25df05a15d

View File

@@ -113,13 +113,30 @@ def main(db, json_path):
def convertClones(data):
newData = []
# December, 2017 - CCP decided to use only one set of skill levels for alpha clones. However, this is still
# represented in the data as a skillset per race. To ensure that all skills are the same, we store them in a way
# that we can check to make sure all races have the same skills, as well as skill levels
check = {}
for ID in data:
for skill in data[ID]["skills"]:
newData.append({
"alphaCloneID": int(ID),
"alphaCloneName": data[ID]["internalDescription"],
"alphaCloneName": "Alpha Clone",
"typeID": skill["typeID"],
"level": skill["level"]})
if ID not in check:
check[ID] = {}
check[ID][int(skill["typeID"])] = int(skill["level"])
if not reduce(lambda a, b: a if a == b else False, [v for _, v in check.iteritems()]):
raise Exception("Alpha Clones not all equal")
newData = [x for x in newData if x['alphaCloneID'] == 1]
if len(newData) == 0:
raise Exception("Alpha Clone processing failed")
return newData