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

add temper manuals #213

Merged
merged 1 commit into from
May 16, 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: 1 addition & 0 deletions assets/lang/enUS/item_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"Staff": "staff",
"Sword": "sword",
"Sword2H": "two-handed sword",
"TemperManual": "temper manual",
"Tome": "tome",
"Wand": "wand"
}
1 change: 1 addition & 0 deletions src/item/data/item_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ItemType(Enum):
Sword2H = "two-handed sword"
Tome = "tome"
Wand = "wand"
TemperManual = "temper manual"
# Custom Types
Material = "material"
Sigil = "sigil"
4 changes: 3 additions & 1 deletion src/item/descr/read_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def read_descr(rarity: ItemRarity, img_item_descr: np.ndarray, show_warnings: bo
screenshot("failed_itempower_itemtype", img=img_item_descr)
return None

if item.item_type == ItemType.Material or (item.rarity in [ItemRarity.Magic, ItemRarity.Common] and item.item_type != ItemType.Sigil):
if item.item_type in [ItemType.Material, ItemType.TemperManual] or (
item.rarity in [ItemRarity.Magic, ItemRarity.Common] and item.item_type != ItemType.Sigil
):
return item

# Find textures for bullets and sockets
Expand Down
3 changes: 3 additions & 0 deletions src/loot_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def check_items(inv: InventoryBase):
elif rarity == ItemRarity.Magic and item_descr.item_type == ItemType.Elixir:
Logger.info(f"Matched: Elixir")
continue
elif item_descr.item_type == ItemType.TemperManual:
Logger.info(f"Matched: Temper Manual")
continue
elif rarity in [ItemRarity.Magic, ItemRarity.Common] and item_descr.item_type != ItemType.Sigil:
keyboard.send("space")
wait(0.13, 0.14)
Expand Down
3 changes: 3 additions & 0 deletions src/scripts/vision_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def vision_mode():
elif rarity == ItemRarity.Magic and item_descr.item_type == ItemType.Elixir:
Logger.info(f"Matched: Elixir")
ignored_item = True
elif item_descr.item_type == ItemType.TemperManual:
Logger.info(f"Matched: Temper Manual")
ignored_item = True
elif rarity in [ItemRarity.Magic, ItemRarity.Common] and item_descr.item_type != ItemType.Sigil:
match = False

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 @@ -177,6 +177,7 @@ def main(d4data_dir: Path, companion_app_dir: Path):
"Tome",
"Wand",
"OffHandTotem",
"TemperManual",
]
item_typ_dict = {
"Material": "custom type material",
Expand Down
Binary file added test/assets/item/temper_manual_2160p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions test/item/read_descr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@
codex_upgrade=True,
),
),
(
(3840, 2160),
f"{BASE_PATH}/temper_manual_2160p.png",
Item(
item_type=ItemType.TemperManual,
rarity=ItemRarity.Magic,
),
),
],
)
def test_read_descr(img_res: tuple[int, int], input_img: str, expected_item: Item):
Expand Down
Loading