-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.16 Export Fixes for Items and Passives #38
Changes from 15 commits
b2ef4c2
b34b707
557a214
6397e03
30420c1
f702e9a
78214dc
860ef96
f1283ae
dcd5e3c
4fcc59f
59bcc8a
acd3c82
6176bdd
640a1fc
c38252e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ | |
|
||
|
||
def _apply_column_map(infobox, column_map, list_object): | ||
|
||
for k, data in column_map: | ||
value = list_object[k] | ||
if data.get('condition') and not data['condition'](value): | ||
|
@@ -565,7 +566,8 @@ class ItemsParser(SkillParserShared): | |
'Heist': '3.12.0', | ||
'Ritual': '3.13.0', | ||
'Ultimatum': '3.14.0', | ||
'Expedition': '3.15.0' | ||
'Expedition': '3.15.0', | ||
'Scourge': '3.16.0' | ||
} | ||
|
||
_IGNORE_DROP_LEVEL_CLASSES = ( | ||
|
@@ -764,12 +766,26 @@ class ItemsParser(SkillParserShared): | |
'Metadata/Items/Gems/SupportGemConcentratedEffect': '', | ||
'Metadata/Items/Gems/SupportGemIncreasedCriticalStrikes': '', | ||
'Metadata/Items/Gems/SupportGemMeleeSplash': '', | ||
'Metadata/Items/Gems/SkillGemEnergyBlade': '', | ||
# ================================================================= | ||
# One Hand Axes | ||
# ================================================================= | ||
|
||
'Metadata/Items/Weapons/OneHandWeapons/OneHandAxes/OneHandAxe22': | ||
'', | ||
|
||
# ================================================================= | ||
# One Hand Swords | ||
# ================================================================= | ||
'Metadata/Items/Weapons/OneHandWeapons/OneHandSwords/StormBladeOneHand': | ||
' (One Handed Sword)', | ||
|
||
# ================================================================= | ||
# Two Hand Swords | ||
# ================================================================= | ||
'Metadata/Items/Weapons/TwoHandWeapons/TwoHandSwords/StormBladeTwoHand': | ||
' (Two Handed Sword)', | ||
|
||
# ================================================================= | ||
# Boots | ||
# ================================================================= | ||
|
@@ -2199,24 +2215,40 @@ def _type_amulet(self, infobox, base_item_type): | |
_type_armour = _type_factory( | ||
data_file='ArmourTypes.dat', | ||
data_mapping=( | ||
('Armour', { | ||
'template': 'armour', | ||
('ArmourMin', { | ||
'template': 'armour_min', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('Evasion', { | ||
'template': 'evasion', | ||
('ArmourMax', { | ||
'template': 'armour_max', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('EnergyShield', { | ||
'template': 'energy_shield', | ||
('EvasionMin', { | ||
'template': 'evasion_min', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('EvasionMin', { | ||
'template': 'evasion_max', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('EnergyShieldMin', { | ||
'template': 'energy_shield_min', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('EnergyShieldMax', { | ||
'template': 'energy_shield_max', | ||
'condition': lambda v: v > 0, | ||
}), | ||
('IncreasedMovementSpeed', { | ||
'template': 'movement_speed', | ||
'condition': lambda v: v != 0, | ||
}), | ||
('Ward', { | ||
'template': 'ward', | ||
('WardMin', { | ||
'template': 'ward_min', | ||
'condition': lambda v: v != 0, | ||
}), | ||
('WardMax', { | ||
'template': 'ward_max', | ||
'condition': lambda v: v != 0, | ||
}), | ||
), | ||
|
@@ -2361,17 +2393,17 @@ def _currency_extra(self, infobox, base_item_type, currency): | |
) | ||
|
||
_master_hideout_doodad_map = ( | ||
('HideoutNPCsKey', { | ||
'template': 'master', | ||
'format': lambda v: v['Hideout_NPCsKey']['Name'], | ||
'condition': lambda v: v is not None, | ||
}), | ||
('MasterLevel', { | ||
'template': 'master_level_requirement', | ||
}), | ||
('FavourCost', { | ||
'template': 'master_favour_cost', | ||
}), | ||
# ('HideoutNPCsKey', { | ||
# 'template': 'master', | ||
# 'format': lambda v: v['Hideout_NPCsKey']['Name'], | ||
# 'condition': lambda v: v is not None, | ||
# }), | ||
# ('MasterLevel', { | ||
# 'template': 'master_level_requirement', | ||
# }), | ||
# ('FavourCost', { | ||
# 'template': 'master_favour_cost', | ||
# }), | ||
) | ||
|
||
def _apply_master_map(self, infobox, base_item_type, hideout): | ||
|
@@ -2386,19 +2418,19 @@ def _apply_master_map(self, infobox, base_item_type, hideout): | |
'template': 'is_master_doodad', | ||
'format': lambda v: not v, | ||
}), | ||
('HideoutNPCsKey', { | ||
'template': 'master', | ||
'format': lambda v: v['Hideout_NPCsKey']['Name'], | ||
'condition': lambda v: v, | ||
}), | ||
('FavourCost', { | ||
'template': 'master_favour_cost', | ||
#'condition': lambda v: v, | ||
}), | ||
('MasterLevel', { | ||
'template': 'master_level_requirement', | ||
#'condition': lambda v: v, | ||
}), | ||
# ('HideoutNPCsKey', { | ||
# 'template': 'master', | ||
# 'format': lambda v: v['Hideout_NPCsKey']['Name'], | ||
# 'condition': lambda v: v, | ||
# }), | ||
# ('FavourCost', { | ||
# 'template': 'master_favour_cost', | ||
# #'condition': lambda v: v, | ||
# }), | ||
# ('MasterLevel', { | ||
# 'template': 'master_level_requirement', | ||
# #'condition': lambda v: v, | ||
# }), | ||
('Variation_AOFiles', { | ||
'template': 'variation_count', | ||
'format': lambda v: len(v), | ||
|
@@ -2442,7 +2474,8 @@ def MapSeriesHelper(d): | |
'Heist', | ||
'Ritual', | ||
'Ultimatum', | ||
'Expedition' | ||
'Expedition', | ||
'Scourge' | ||
] | ||
# print('yep', map_series[d]) | ||
return map_series[d] | ||
|
@@ -2779,10 +2812,14 @@ def _harvest_plant_booster_extra(self, infobox, base_item_type, | |
row_index=True, | ||
) | ||
|
||
''' | ||
This defines the expected data elements for an item class. | ||
''' | ||
Comment on lines
+3303
to
+3305
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me like we're inside of a method here, which would mean that we should use line comments here instead of docstrings. Can we please change this to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's within a class, not a method. |
||
_cls_map = { | ||
# Jewellery | ||
'Amulet': (_type_amulet, ), | ||
# Armour types | ||
'Armour': (_type_level, _type_attribute, _type_armour, ), | ||
'Gloves': (_type_level, _type_attribute, _type_armour, ), | ||
'Boots': (_type_level, _type_attribute, _type_armour, ), | ||
'Body Armour': (_type_level, _type_attribute, _type_armour, ), | ||
|
@@ -2990,7 +3027,8 @@ def _conflict_atlas_region_upgrade( | |
_conflict_resolver_map = { | ||
'Active Skill Gem': _conflict_active_skill_gems, | ||
'QuestItem': _conflict_quest_items, | ||
'HideoutDoodad': _conflict_hideout_doodad, | ||
#TODO: Make a new doodad resolver that doesn't rely on 'HideoutNPCsKey' | ||
#'HideoutDoodad': _conflict_hideout_doodad, | ||
'Map': _conflict_maps, | ||
'MapFragment': _conflict_map_fragments, | ||
'DivinationCard': _conflict_divination_card, | ||
|
@@ -3017,12 +3055,12 @@ def _process_purchase_costs(self, source, infobox): | |
for rarity in RARITY: | ||
if rarity.id >= 5: | ||
break | ||
for i, (item, cost) in enumerate( | ||
source[rarity.name_upper + 'Purchase'], | ||
start=1): | ||
prefix = 'purchase_cost_%s%s' % (rarity.name_lower, i) | ||
infobox[prefix + '_name'] = item['Name'] | ||
infobox[prefix + '_amount'] = cost | ||
# for i, (item, cost) in enumerate( | ||
# source[rarity.name_upper + 'Purchase'], | ||
# start=1): | ||
# prefix = 'purchase_cost_%s%s' % (rarity.name_lower, i) | ||
# infobox[prefix + '_name'] = item['Name'] | ||
# infobox[prefix + '_amount'] = cost | ||
|
||
def by_rowid(self, parsed_args): | ||
return self._export( | ||
|
@@ -3194,6 +3232,8 @@ def _export(self, parsed_args, items): | |
cls_id = base_item_type['ItemClassesKey']['Id'] | ||
m_id = base_item_type['Id'] | ||
|
||
self._print_item_rowid(parsed_args, base_item_type) | ||
|
||
infobox = OrderedDict() | ||
self._process_base_item_type(base_item_type, infobox) | ||
self._process_purchase_costs(base_item_type, infobox) | ||
|
@@ -3281,6 +3321,23 @@ def _export(self, parsed_args, items): | |
|
||
return r | ||
|
||
def _print_item_rowid(self, parsed_args, base_item_type): | ||
#Don't print anything if not running in the rowid mode. | ||
if (not 'start' in vars(parsed_args).keys()) or (not 'end' in vars(parsed_args).keys()): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as #37 (comment) |
||
return | ||
|
||
export_row_count = parsed_args.end - parsed_args.start | ||
#If we're printing less than 100 rows, print every rowid | ||
if export_row_count <= 100: | ||
print_granularity = 1 | ||
else: | ||
print_granularity = export_row_count//100 | ||
|
||
item_offset = base_item_type.rowid - parsed_args.start | ||
if (item_offset == 0) or item_offset % print_granularity == 0: | ||
console('Processing item with rowid {}: {}'.format(base_item_type.rowid, base_item_type['Name'])) | ||
return | ||
|
||
def _format_map_name(self, base_item_type, map_series, language=None): | ||
if language is None: | ||
language = self._language | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,10 +506,8 @@ def main(self, parsed_args): | |
self._copy_from_keys( | ||
row, self._COPY_KEYS_BESTIARY_COMPONENTS, components | ||
) | ||
if row['RarityKey'] != RARITY.ANY: | ||
components[-1]['rarity'] = self.rr['ClientStrings.dat'].index[ | ||
'Id']['ItemDisplayString' + row['RarityKey'].name_upper][ | ||
'Text'] | ||
if row['BeastRarity'] != RARITY.ANY: | ||
components[-1]['rarity'] = self.rr['ClientStrings.dat'].index['Id']['ItemDisplayString' + row['BeastRarity'].name_upper]['Text'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one's a doozy to follow by-eye. Can we try: if row['BeastRarity'] != RARITY.ANY:
display_string = 'ItemDisplayString' + row['BeastRarity'].name_upper
components[-1]['rarity'] = self.rr['ClientStrings.dat'].index['Id'][display_string]['Text'] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure 👍 |
||
|
||
recipe_components = [] | ||
for recipe_id, data in recipe_components_temp.items(): | ||
|
@@ -1438,7 +1436,7 @@ def SortCategoryHelper(d): | |
# 'default': '', | ||
# }), | ||
('CraftingItemClassCategoriesKeys', { | ||
'key': 'crafting_item_class_categories', | ||
'key': 'item_class_categories', | ||
'value': lambda v: [k['Text'] for k in v], | ||
}), | ||
# ('CraftingBenchUnlockCategoriesKeys', { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
# Python | ||
import re | ||
import os.path | ||
import warnings | ||
from functools import partialmethod | ||
from collections import OrderedDict | ||
|
||
|
@@ -289,6 +290,10 @@ def export(self, parsed_args, passives): | |
data['icon'] = '%s (%s)' % (icon[-1], icon[-2]) | ||
else: | ||
data['icon'] = icon[-1] | ||
#atlas_start_node doesn't have an icon path | ||
else: | ||
data['icon'] = '' | ||
warnings.warn('Icon path file not found for {}: {}'.format(passive['Id'], passive['Name'])) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as #37 (comment) |
||
|
||
data['icon'] = data['icon'].replace('.dds', '') | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a case of YAGNI?
Will we ever have any need for this? @Journeytojah @angelic-knight
If not needed, just remove outright instead of comment. But please check with one another first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be safe to delete. @Journeytojah, what's your take on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this and surrounding related code.