This commit is contained in:
CMHopeSunshine 2022-06-04 12:01:37 +08:00
parent 1268987794
commit 8067de559f
2 changed files with 14 additions and 12 deletions

3
.gitignore vendored
View File

@ -146,5 +146,6 @@ nohup.out
# 忽略文件夹 # 忽略文件夹
.history .history
Paimon_exchange/* _Paimon_exchange/*
user_data/gacha_log_data/* user_data/gacha_log_data/*
user_data/player_info/*

View File

@ -222,9 +222,13 @@ async def draw_role_card(uid, data):
for artifact in data['圣遗物']: for artifact in data['圣遗物']:
suit.append(artifact['所属套装']) suit.append(artifact['所属套装'])
for s in suit: for s in suit:
if suit.count(s) == 4: if s not in suit2 and 1 < suit.count(s) < 4:
reli_path = res_path2 / 'reli' / f'{data["圣遗物"][0]["图标"]}.png' suit2.append(s)
reli_path = await aiorequests.get_img(url=artifact_url.format(data["圣遗物"][0]["图标"]), size=(110, 110), if suit.count(s) >= 4:
for r in data['圣遗物']:
if r['所属套装'] == s:
reli_path = res_path2 / 'reli' / f'{r["图标"]}.png'
reli_path = await aiorequests.get_img(url=artifact_url.format(r["图标"]), size=(110, 110),
save_path=reli_path) save_path=reli_path)
bg.alpha_composite(reli_path, (76, 1130)) bg.alpha_composite(reli_path, (76, 1130))
bg.alpha_composite(reli_path, (76, 1255)) bg.alpha_composite(reli_path, (76, 1255))
@ -232,8 +236,6 @@ async def draw_role_card(uid, data):
bg_draw.text((184, 1292), f'{s[:2]}四件套', fill='white', font=get_font(36)) bg_draw.text((184, 1292), f'{s[:2]}四件套', fill='white', font=get_font(36))
flag = True flag = True
break break
if s not in suit2 and 1 < suit.count(s) < 4:
suit2.append(s)
if len(suit2) == 2: if len(suit2) == 2:
bg_draw.text((184, 1168), f'{suit2[0][:2]}两件套', fill='white', font=get_font(36)) bg_draw.text((184, 1168), f'{suit2[0][:2]}两件套', fill='white', font=get_font(36))
bg_draw.text((184, 1292), f'{suit2[1][:2]}两件套', fill='white', font=get_font(36)) bg_draw.text((184, 1292), f'{suit2[1][:2]}两件套', fill='white', font=get_font(36))
@ -257,7 +259,6 @@ async def draw_role_card(uid, data):
reli_path = await aiorequests.get_img(url=artifact_url.format(r["图标"]), size=(110, 110), reli_path = await aiorequests.get_img(url=artifact_url.format(r["图标"]), size=(110, 110),
save_path=reli_path) save_path=reli_path)
bg.alpha_composite(reli_path, (76, 1130)) bg.alpha_composite(reli_path, (76, 1130))
break break
elif not flag: elif not flag:
bg_draw.text((184, 1168), '未激活套装', fill='white', font=get_font(36)) bg_draw.text((184, 1168), '未激活套装', fill='white', font=get_font(36))