面板查询添加击破特攻

This commit is contained in:
a376148946 2024-03-01 11:15:58 +08:00
parent b049810b22
commit bccce182af
7 changed files with 21 additions and 12 deletions

View File

@ -63,6 +63,6 @@ async def send_srabyss_info(bot: Bot, ev: Event):
else:
floor = None
await bot.logger.info(f'[sr查询深渊信息]深渊层数: {floor}')
im = await draw_abyss_img(user_id, uid, floor, schedule_type, ev.sender)
im = await draw_abyss_img(user_id, uid, ev.sender, floor, schedule_type)
await bot.send(im)
return None

View File

@ -150,9 +150,9 @@ async def _draw_floor_card(
async def draw_abyss_img(
qid: Union[str, int],
uid: str,
sender: Union[str, str],
floor: Optional[int] = None,
schedule_type: str = '1',
sender,
) -> Union[bytes, str]:
raw_abyss_data = await mys_api.get_srspiral_abyss_info(uid, schedule_type)

View File

@ -128,11 +128,11 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str) -> Union[bytes,
# 放属性图标
attr_img = Image.open(TEXT_PATH / f'IconAttribute{char.char_element}.png')
char_info.paste(attr_img, (540, 166), attr_img)
char_info.paste(attr_img, (540, 122), attr_img)
# 放角色名
char_img_draw = ImageDraw.Draw(char_info)
char_img_draw.text((620, 207), char.char_name, (255, 255, 255), sr_font_38, 'lm')
char_img_draw.text((620, 162), char.char_name, (255, 255, 255), sr_font_38, 'lm')
if hasattr(sr_font_38, 'getsize'):
char_name_len = sr_font_38.getsize(char.char_name)[0] # type: ignore
else:
@ -141,7 +141,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str) -> Union[bytes,
# 放等级
char_img_draw.text(
(620 + char_name_len + 50, 212),
(620 + char_name_len + 50, 168),
f'LV.{char.char_level!s}',
white_color,
sr_font_24,
@ -152,7 +152,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str) -> Union[bytes,
rarity_img = Image.open(
TEXT_PATH / f'LightCore_Rarity{char.char_rarity}.png'
).resize((306, 72))
char_info.paste(rarity_img, (490, 233), rarity_img)
char_info.paste(rarity_img, (490, 189), rarity_img)
# 放命座
rank_img = Image.open(TEXT_PATH / 'ImgNewBg.png')
@ -160,7 +160,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str) -> Union[bytes,
rank_img_draw.text(
(70, 44), f'{NUM_MAP[char.char_rank]}', white_color, sr_font_28, 'mm'
)
char_info.paste(rank_img, (722, 225), rank_img)
char_info.paste(rank_img, (722, 181), rank_img)
# 放uid
char_img_draw.text(
@ -292,7 +292,16 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str) -> Union[bytes,
sr_font_26,
'rm',
)
char_info.paste(attr_bg, (475, 300), attr_bg)
# 击破特攻
status_resistance_base = char.add_attr.get('BreakDamageAddedRatioBase', 0) * 100
attr_bg_draw.text(
(500, 31 + 48 * 8),
f'{status_resistance_base:.1f}%',
white_color,
sr_font_26,
'rm',
)
char_info.paste(attr_bg, (475, 256), attr_bg)
# 命座
for rank in range(6):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -63,7 +63,7 @@ async def send_srabyss_info(bot: Bot, ev: Event):
else:
floor = None
await bot.logger.info(f'[sr查询模拟宇宙信息]模拟宇宙世界数: {floor}')
im = await draw_rogue_img(user_id, uid, floor, schedule_type, ev.sender)
im = await draw_rogue_img(user_id, uid, ev.sender, floor, schedule_type)
await bot.send(im)
return None

View File

@ -248,9 +248,9 @@ async def _draw_rogue_card(
async def draw_rogue_img(
qid: Union[str, int],
uid: str,
sender: Union[str, str],
floor: Optional[int] = None,
schedule_type: str = '3',
sender,
) -> Union[bytes, str]:
raw_rogue_data = await mys_api.get_rogue_info(uid, '3')
@ -536,7 +536,7 @@ async def draw_rogue_img(
async def draw_rogue_locust_img(
qid: Union[str, int],
uid: str,
sender,
sender: Union[str, str],
) -> Union[bytes, str]:
raw_rogue_data = await mys_api.get_rogue_locust_info(uid, '3')

View File

@ -376,7 +376,7 @@ async def _draw_detail_card(
async def get_detail_card(
qid: Union[str, int], sr_uid: str, sender
qid: Union[str, int], sr_uid: str, sender: Union[str, str]
) -> Union[bytes, str]:
# 获取角色列表
avatar_list = await mys_api.get_avatar_info(sr_uid, 1001)