diff --git a/pyproject.toml b/pyproject.toml index 3366245..469f6bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starrail_damage_cal" -version = "1.8.1" +version = "1.8.2" description = "For StarRail Role Damage Cal" authors = [ {name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"}, diff --git a/starrail_damage_cal/damage/utils.py b/starrail_damage_cal/damage/utils.py index ef45151..0fc6ee9 100644 --- a/starrail_damage_cal/damage/utils.py +++ b/starrail_damage_cal/damage/utils.py @@ -35,7 +35,7 @@ async def cal_relic_sub_affix(relic_id: int, affix_id: int, cnt: int, step: int) rarity = int(str(relic_id)[0]) - 1 relic_data = None for relic in RelicSubAffixConfig: - if relic.AffixID == affix_id: + if relic.AffixID == affix_id and relic.GroupID == rarity: relic_data = relic break if relic_data is None: diff --git a/test.py b/test.py index 14e4525..9fad63f 100644 --- a/test.py +++ b/test.py @@ -2,10 +2,12 @@ import json from typing import List, Union from starrail_damage_cal.cal_damage import DamageCal +from starrail_damage_cal.to_data import api_to_dict async def test_get_damage_data_by_uid() -> None: - data = await DamageCal.get_all_damage_data_by_uid(uid="100111010") + # print(await api_to_dict("108069476")) + data = await DamageCal.get_damage_data_by_uid(uid="108069476", avatar_name="流萤") if isinstance(data, Union[List, dict]): print(json.dumps(data, ensure_ascii=False, indent=4))