优化:伤害计算区域对齐

This commit is contained in:
KimgiaiiWuyi 2022-07-10 02:00:16 +08:00
parent 3156e18083
commit 71bc1135d1
3 changed files with 6 additions and 6 deletions

View File

@ -279,9 +279,9 @@ async def draw_dmgCacl_img(raw_data: dict) -> Image:
text_color = (255, 255, 255)
title_color = (255, 255, 100)
text_size = genshin_font_origin(28)
result_draw.text((60, 22), '角色动作', title_color, text_size, anchor='lm')
result_draw.text((450, 22), '暴击伤害', title_color, text_size, anchor='lm')
result_draw.text((690, 22), '期望伤害', title_color, text_size, anchor='lm')
result_draw.text((45, 22), '角色动作', title_color, text_size, anchor='lm')
result_draw.text((460, 22), '暴击伤害', title_color, text_size, anchor='lm')
result_draw.text((695, 22), '期望伤害', title_color, text_size, anchor='lm')
for index, power_name in enumerate(power_list):
attack_type = power_name[0]
@ -331,9 +331,9 @@ async def draw_dmgCacl_img(raw_data: dict) -> Image:
crit_dmg = (effect_prop * power_percent + power_value) * (1 + critdmg_cal) * (1 + dmgBonus_cal) * d * r + add_dmg
avg_dmg = (crit_dmg - add_dmg) * critrate_cal + (1 - critrate_cal) * (effect_prop * power_percent + power_value) * (1 + dmgBonus_cal) * d * r + add_dmg
result_draw.text((60, 22 + (index + 1) * 40), power_list[power_name]['power_name'], text_color, text_size, anchor='lm')
result_draw.text((450, 22 + (index + 1) * 40), str(round(crit_dmg)), text_color, text_size, anchor='lm')
result_draw.text((690, 22 + (index + 1) * 40), str(round(avg_dmg)), text_color, text_size, anchor='lm')
result_draw.text((45, 22 + (index + 1) * 40), power_list[power_name]['power_name'], text_color, text_size, anchor='lm')
result_draw.text((460, 22 + (index + 1) * 40), str(round(crit_dmg)), text_color, text_size, anchor='lm')
result_draw.text((695, 22 + (index + 1) * 40), str(round(avg_dmg)), text_color, text_size, anchor='lm')
return result_img, len(power_list) + 2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 890 B