🚨修复光锥阶数bug 更新以双爆为评价体系的遗器评分

This commit is contained in:
qwerdvd 2023-05-13 20:41:32 +08:00
parent f0de903dbd
commit 974f8133ea

View File

@ -375,7 +375,7 @@ async def draw_char_info_img(raw_mes: str, sr_uid: str, url: Optional[str]):
rank_img_draw = ImageDraw.Draw(rank_img) rank_img_draw = ImageDraw.Draw(rank_img)
rank_img_draw.text( rank_img_draw.text(
(70, 44), (70, 44),
f'{NUM_MAP[char.equipment["equipmentRarity"]]}', f'{NUM_MAP[char.equipment["equipmentRank"]]}',
white_color, white_color,
sr_font_28, sr_font_28,
'mm', 'mm',
@ -422,6 +422,7 @@ async def draw_char_info_img(raw_mes: str, sr_uid: str, url: Optional[str]):
if char.char_relic: if char.char_relic:
weapon_rank_bg = Image.open(TEXT_PATH / 'rank_bg.png') weapon_rank_bg = Image.open(TEXT_PATH / 'rank_bg.png')
char_info.paste(weapon_rank_bg, (690, 880), weapon_rank_bg) char_info.paste(weapon_rank_bg, (690, 880), weapon_rank_bg)
relic_score = 0
for relic in char.char_relic: for relic in char.char_relic:
rarity = RelicId2Rarity[str(relic["relicId"])] rarity = RelicId2Rarity[str(relic["relicId"])]
@ -496,10 +497,14 @@ async def draw_char_info_img(raw_mes: str, sr_uid: str, url: Optional[str]):
anchor='mm', anchor='mm',
) )
# relicScore = 0
for index, i in enumerate(relic['SubAffixList']): for index, i in enumerate(relic['SubAffixList']):
subName: str = i['Name'] subName: str = i['Name']
subValue = mp.mpf(i['Value']) subValue = mp.mpf(i['Value'])
subProperty = i['Property']
if subProperty == 'CriticalDamageBase':
relic_score += subValue
if subProperty == 'CriticalChanceBase':
relic_score += subValue * 2
if subName in ['攻击力', '生命值', '防御力', '速度']: if subName in ['攻击力', '生命值', '防御力', '速度']:
subValueStr = nstr(subValue, 3) subValueStr = nstr(subValue, 3)
else: else:
@ -526,6 +531,19 @@ async def draw_char_info_img(raw_mes: str, sr_uid: str, url: Optional[str]):
char_info.paste( char_info.paste(
relic_img, RELIC_POS[str(relic["Type"])], relic_img relic_img, RELIC_POS[str(relic["Type"])], relic_img
) )
if relic_score > 1:
relic_value_level = Image.open(TEXT_PATH / 'CommonIconS.png')
char_info.paste(relic_value_level, (778, 963), relic_value_level)
elif relic_score > 0.6:
relic_value_level = Image.open(TEXT_PATH / 'CommonIconA.png')
char_info.paste(relic_value_level, (778, 963), relic_value_level)
elif relic_score > 0.3:
relic_value_level = Image.open(TEXT_PATH / 'CommonIconB.png')
char_info.paste(relic_value_level, (778, 963), relic_value_level)
elif relic_score > 0:
relic_value_level = Image.open(TEXT_PATH / 'CommonIconC.png')
char_info.paste(relic_value_level, (778, 963), relic_value_level)
else: else:
char_img_draw.text( char_img_draw.text(
(525, 1565), (525, 1565),