Skip to content
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

Update maxroll importer for spiritborn #381

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/setup_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ runs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
shell: powershell
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
- name: Setup env
uses: ./.github/actions/setup_env

- name: Setup cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: pre-commit
shell: powershell
run: pre-commit run -a
Expand Down
1 change: 1 addition & 0 deletions assets/lang/enUS/item_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"Material": "custom type material",
"OffHandTotem": "totem",
"Polearm": "polearm",
"Quarterstaff": "quarterstaff",
"Ring": "ring",
"Scythe": "scythe",
"Scythe2H": "two-handed scythe",
Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

TP = concurrent.futures.ThreadPoolExecutor()

__version__ = "5.8.0"
__version__ = "5.8.1"
2 changes: 2 additions & 0 deletions src/gui/importer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def fix_weapon_type(input_str: str) -> ItemType | None:
return ItemType.Axe2H
if "2h scythe" in input_str:
return ItemType.Scythe2H
if "quarterstaff" in input_str:
return ItemType.Quarterstaff
if "scythe" in input_str:
return ItemType.Scythe
if "crossbow" in input_str:
Expand Down
12 changes: 8 additions & 4 deletions src/gui/importer/maxroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,14 @@ def _find_item_affixes(mapping_data: dict, item_affixes: dict) -> list[Affix]:
attr_desc = f"to {skill_data["name"]}"
break
else:
if affix["attributes"][0]["param"] == -1460542966 and affix["attributes"][0]["id"] == 1033:
if affix["attributes"][0]["param"] == -1460542966:
attr_desc = "to core skills"
elif affix["attributes"][0]["param"] == -755407686 and affix["attributes"][0]["id"] == 1034:
elif affix["attributes"][0]["param"] == -755407686:
attr_desc = "to defensive skills"
elif affix["attributes"][0]["param"] == 746476422 and affix["attributes"][0]["id"] == 1034:
elif affix["attributes"][0]["param"] == 746476422:
attr_desc = "to mastery skills"
elif affix["attributes"][0]["param"] == -954965341:
attr_desc = "to basic skills"
clean_desc = re.sub(r"\[.*?\]|[^a-zA-Z ]", "", attr_desc)
clean_desc = clean_desc.replace("SecondSeconds", "seconds")
affix_obj = Affix(name=closest_match(clean_str(clean_desc), Dataloader().affix_dict))
Expand All @@ -181,6 +183,8 @@ def _attr_desc_special_handling(affix_id: str) -> str:
return "maximum poison resistance"
case 2037914:
return "subterfuge cooldown reduction"
case 2123788:
return "chance for core skills to hit twice"
case _:
return ""

Expand Down Expand Up @@ -233,7 +237,7 @@ def _extract_planner_url_and_id_from_guide(url: str) -> tuple[str, int]:
if __name__ == "__main__":
src.logger.setup()
URLS = [
"https://maxroll.gg/d4/planner/1i5tt0c0#2",
"https://maxroll.gg/d4/planner/pl7lv0kv#3",
]
for X in URLS:
import_maxroll(url=X)
1 change: 1 addition & 0 deletions src/item/data/item_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ItemType(Enum):
Mace2H = "two-handed mace"
OffHandTotem = "totem"
Polearm = "polearm"
Quarterstaff = "quarterstaff"
Ring = "ring"
Scythe = "scythe"
Scythe2H = "two-handed scythe"
Expand Down
1 change: 1 addition & 0 deletions src/tools/gen_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def main(d4data_dir: Path, companion_app_dir: Path):
"Mace2H",
"OffHandTotem",
"Polearm",
"Quarterstaff",
"Ring",
"Scythe",
"Scythe2H",
Expand Down
12 changes: 3 additions & 9 deletions tests/gui/importer/test_maxroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@

URLS = [
"https://maxroll.gg/d4/build-guides/double-swing-barbarian-guide",
"https://maxroll.gg/d4/build-guides/evade-spiritborn-build-guide",
"https://maxroll.gg/d4/build-guides/frozen-orb-sorcerer-guide",
"https://maxroll.gg/d4/build-guides/minion-necromancer-guide",
"https://maxroll.gg/d4/build-guides/shadow-minion-necromancer-guide",
"https://maxroll.gg/d4/planner/1i5tt0c0#2",
"https://maxroll.gg/d4/planner/3n11i06l",
"https://maxroll.gg/d4/planner/ailu5022#4",
"https://maxroll.gg/d4/planner/cm6pf0xa#5",
"https://maxroll.gg/d4/planner/dq1q601f#2",
"https://maxroll.gg/d4/planner/dqih026y#3",
"https://maxroll.gg/d4/planner/r61bp0om#11",
"https://maxroll.gg/d4/planner/ubaoz02q#1",
"https://maxroll.gg/d4/build-guides/quill-volley-spiritborn-guide",
"https://maxroll.gg/d4/build-guides/touch-of-death-spiritborn-guide",
]


Expand Down