-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed sigils & added new materials (#389)
- Loading branch information
Showing
19 changed files
with
124 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"ItemPower": "item power", | ||
"ItemTier": "tier" | ||
"ItemPower": "item power" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
TP = concurrent.futures.ThreadPoolExecutor() | ||
|
||
__version__ = "5.8.3" | ||
__version__ = "5.8.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import cv2 | ||
import pytest | ||
|
||
from src.cam import Cam | ||
from src.config import BASE_DIR | ||
from src.item.data.affix import Affix, AffixType | ||
from src.item.data.item_type import ItemType | ||
from src.item.data.rarity import ItemRarity | ||
from src.item.descr.read_descr import read_descr | ||
from src.item.models import Item | ||
|
||
BASE_PATH = BASE_DIR / "tests/assets/item/season6" | ||
|
||
items = [] | ||
|
||
materials = [ | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_compass_1.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Common, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_rune_magic_1.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Magic, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_rune_magic_2.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Magic, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_rune_rare_1.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Rare, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_rune_rare_2.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Rare, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_tribute_magic_1.png", | ||
Item( | ||
item_type=ItemType.Material, | ||
rarity=ItemRarity.Magic, | ||
), | ||
), | ||
] | ||
|
||
sigils = [ | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_sigil_1.png", | ||
Item( | ||
affixes=[Affix(name="ancestors_favor"), Affix(name="monster_barrier")], | ||
inherent=[Affix(name="carrion_fields", type=AffixType.inherent)], | ||
item_type=ItemType.Sigil, | ||
rarity=ItemRarity.Common, | ||
), | ||
), | ||
( | ||
(2560, 1440), | ||
f"{BASE_PATH}/1440p_small_sigil_2.png", | ||
Item( | ||
affixes=[Affix(name="ancestors_favor"), Affix(name="monster_barrier")], | ||
inherent=[Affix(name="whispering_pines", type=AffixType.inherent)], | ||
item_type=ItemType.Sigil, | ||
rarity=ItemRarity.Common, | ||
), | ||
), | ||
] | ||
|
||
|
||
def _run_test_helper(img_res: tuple[int, int], input_img: str, expected_item: Item): | ||
Cam().update_window_pos(0, 0, *img_res) | ||
img = cv2.imread(input_img) | ||
item = read_descr(expected_item.rarity, img) | ||
assert item == expected_item | ||
|
||
|
||
@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), items) | ||
def test_item(img_res: tuple[int, int], input_img: str, expected_item: Item): | ||
_run_test_helper(img_res=img_res, input_img=input_img, expected_item=expected_item) | ||
|
||
|
||
@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), materials) | ||
def test_materials(img_res: tuple[int, int], input_img: str, expected_item: Item): | ||
_run_test_helper(img_res=img_res, input_img=input_img, expected_item=expected_item) | ||
|
||
|
||
@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), sigils) | ||
def test_sigils(img_res: tuple[int, int], input_img: str, expected_item: Item): | ||
_run_test_helper(img_res=img_res, input_img=input_img, expected_item=expected_item) |