🐛 修复ysa未知制图问题

This commit is contained in:
CMHopeSunshine 2022-09-08 18:06:23 +08:00
parent 198ee3a71f
commit 4e6666fd01

View File

@ -39,28 +39,25 @@ def sort_characters(characters: List[Character]) -> List[Character]:
武器等级每级0.6/0.6/0.6/0.8/1精炼等级每级10/10/10/20/40 武器等级每级0.6/0.6/0.6/0.8/1精炼等级每级10/10/10/20/40
圣遗物每级0.5/0.8/1每个两件套20分四件套60分最后按降序排序 圣遗物每级0.5/0.8/1每个两件套20分四件套60分最后按降序排序
""" """
characters = [chara for chara in characters if chara is not None]
for chara in characters: for chara in characters:
try: chara.score = chara.level * (0.8 if chara.rarity == 4 else 1) + chara.fetter * 3
chara.score = chara.level * (0.8 if chara.rarity == 4 else 1) + chara.fetter * 3 if chara.talents:
if chara.talents: for talent in chara.talents:
for talent in chara.talents: chara.score += talent.level * (5 if talent.level <= 6 else 8)
chara.score += talent.level * (5 if talent.level <= 6 else 8) chara.score += len(chara.constellation) * (15 if chara.rarity == 4 else 50)
chara.score += len(chara.constellation) * (15 if chara.rarity == 4 else 50) if chara.weapon:
if chara.weapon: chara.score += chara.weapon.level * (
chara.score += chara.weapon.level * ( 0.6 if chara.weapon.rarity <= 3 else 0.8 if chara.weapon.rarity == 4 else 1)
0.6 if chara.weapon.rarity <= 3 else 0.8 if chara.weapon.rarity == 4 else 1) chara.score += chara.weapon.affix_level * (
chara.score += chara.weapon.affix_level * ( 10 if chara.weapon.rarity <= 3 else 20 if chara.weapon.rarity == 4 else 50)
10 if chara.weapon.rarity <= 3 else 20 if chara.weapon.rarity == 4 else 50) if chara.artifacts:
if chara.artifacts: suit = GenshinTools.get_artifact_suit(chara.artifacts)
suit = GenshinTools.get_artifact_suit(chara.artifacts) chara.suit = suit
chara.suit = suit chara.score += 60 if len(suit) == 2 and suit[0] == suit[1] else 20 * len(suit)
chara.score += 60 if len(suit) == 2 and suit[0] == suit[1] else 20 * len(suit) for artifact in chara.artifacts:
for artifact in chara.artifacts: chara.score += artifact.level * (0.5 if artifact.rarity <= 3 else 0.8 if artifact.rarity == 4 else 1)
chara.score += artifact.level * (0.5 if artifact.rarity <= 3 else 0.8 if artifact.rarity == 4 else 1) else:
else:
chara.suit = []
except Exception:
chara.score = 0
chara.suit = [] chara.suit = []
return sorted(characters, key=lambda x: x.score, reverse=True) return sorted(characters, key=lambda x: x.score, reverse=True)