ysd新增班尼特、莫娜、七七、琴、温迪伤害计算,mys自动签到支持私聊

This commit is contained in:
CMHopeSunshine 2022-07-17 18:45:03 +08:00
parent ba18bb9445
commit 59d1224631
9 changed files with 323 additions and 112 deletions

View File

@ -37,7 +37,6 @@ from ..utils.message_util import get_uid_in_msg, uid_userId_to_dict, replace_all
require('nonebot_plugin_apscheduler')
from nonebot_plugin_apscheduler import scheduler
__plugin_meta__ = PluginMetadata(
name="Paimon_Info",
description="小派蒙的原神信息查询模块",
@ -75,7 +74,6 @@ __plugin_meta__ = PluginMetadata(
},
)
sy = on_command('sy', aliases={'深渊信息', '深境螺旋信息'}, priority=7, block=True)
sy.__paimon_help__ = {
"usage": "sy[层数](uid)",
@ -469,8 +467,12 @@ async def mys_sign_handler(event: MessageEvent, msg: Message = CommandArg()):
@mys_sign_auto.handle()
@exception_handler()
async def mys_sign_auto_handler(event: MessageEvent, msg: Message = CommandArg()):
if event.message_type != 'group':
await mys_sign_auto.finish('自动签到功能暂时只限Q群内使用哦')
if event.message_type == 'group':
remind_id = str(event.group_id)
elif event.message_type == 'private':
remind_id = 'q' + str(event.user_id)
else:
await mys_sign_auto.finish('自动签到功能暂时不支持频道使用哦')
msg = str(msg).strip()
find_uid = re.search(r'(?P<uid>(1|2|5)\d{8})', msg)
if not find_uid:
@ -483,13 +485,12 @@ async def mys_sign_auto_handler(event: MessageEvent, msg: Message = CommandArg()
cookie = await get_private_cookie(uid, key='uid')
if not cookie:
await mys_sign_auto.finish('你的该uid还没绑定cookie哦先用ysb绑定吧!', at_sender=True)
await add_auto_sign(str(event.user_id), uid, str(event.group_id))
await add_auto_sign(str(event.user_id), uid, remind_id)
await mys_sign_auto.finish('开启米游社自动签到成功,派蒙会在每日0点帮你签到', at_sender=True)
elif find_action.group('action') in ['关闭', '禁用', 'off']:
await delete_auto_sign(str(event.user_id), uid)
await mys_sign_auto.finish('关闭米游社自动签到成功', at_sender=True)
else:
# await add_auto_sign(str(event.user_id), uid, str(event.group_id))
await mys_sign_auto.finish('指令错误,在后面加 开启/关闭 来使用哦', at_sender=True)
@ -630,18 +631,25 @@ async def auto_sign():
ann = defaultdict(lambda: defaultdict(list))
logger.info('---派蒙开始执行米游社自动签到---')
sign_list = await get_sign_list()
for user_id, uid, group_id in data:
for user_id, uid, remind_id in data:
await sleep(random.randint(3, 8))
sign_result = await sign(uid)
if not isinstance(sign_result, str):
await sleep(1)
sign_info = await get_sign_info(uid)
sign_day = sign_info['data']['total_sign_day'] - 1
ann[group_id]['成功'].append(
if remind_id.startswith('q'):
await get_bot().send_private_msg(user_id=remind_id[1:],
message=f'你的uid{uid}自动签到成功!签到奖励为{sign_list["data"]["awards"][sign_day]["name"]}*{sign_list["data"]["awards"][sign_day]["cnt"]}')
else:
ann[remind_id]['成功'].append(
f'.UID{uid}-{sign_list["data"]["awards"][sign_day]["name"]}*{sign_list["data"]["awards"][sign_day]["cnt"]}')
else:
await delete_auto_sign(user_id, uid)
ann[group_id]['失败'].append(f'.UID{uid}')
if remind_id.startswith('q'):
await get_bot().send_private_msg(user_id=remind_id[1:], message=f'你的uid{uid}签到失败请重新绑定cookie再开启自动签到')
else:
ann[remind_id]['失败'].append(f'.UID{uid}')
for group_id, content in ann.items():
group_str = '米游社自动签到结果:\n'
for type, ann_list in content.items():

View File

@ -502,6 +502,8 @@ def get_damage_multipiler(data: dict) -> dict:
level_q = data['天赋'][3]['等级'] - 1 if data['名称'] in ['神里绫华', '莫娜'] else data['天赋'][2]['等级'] - 1
level_e = data['天赋'][1]['等级'] - 1
level_a = data['天赋'][0]['等级'] - 1
attack = data['属性']['基础攻击'] + data['属性']['额外攻击']
health = data['属性']['基础生命'] + data['属性']['额外生命']
defense = data['属性']['基础防御'] + data['属性']['额外防御']
dm = {}
if data['名称'] == '钟离':
@ -515,7 +517,7 @@ def get_damage_multipiler(data: dict) -> dict:
if data['名称'] == '胡桃':
dm = {'B:l70-增伤-*': (0.33, '半血以下',)}
dm['B:l1-攻击力'] = (float(skill_data['蝶引来生']['数值']['攻击力提高'][level_e].replace('%生命值上限', '')) / 100.0 * (
data['属性']['基础生命'] + data['属性']['额外生命']), '开E后')
health), '开E后')
dm['AZ-e火:裸重击'] = float(skill_data['普通攻击·往生秘传枪法']['数值']['重击伤害'][level_a].replace('%', '')) / 100.0
dm['AZ-e火-r蒸发1.5:重击蒸发'] = float(skill_data['普通攻击·往生秘传枪法']['数值']['重击伤害'][level_a].replace('%', '')) / 100.0
dm['E-e火-r蒸发1.5:雪梅香蒸发'] = float(skill_data['蝶引来生']['数值']['血梅香伤害'][level_e].replace('%', '')) / 100.0
@ -704,7 +706,7 @@ def get_damage_multipiler(data: dict) -> dict:
'B:c1-增伤-A': (0.4, '一命增伤'),
'B:l1-额外倍率-A': (
float(skill_data['神里流·镜花']['数值']['浪闪伤害值提高'][level_e].replace('%最大生命值/层', '')) / 100.0 * n * (
data['属性']['基础生命'] + data['属性']['额外生命']),),
health),),
'B:l1-增伤-A': (float(skill_data['神里流·水囿']['数值']['普通攻击伤害提升'][level_q].replace('%', '')) / 100.0,),
'A-e水:瞬水剑第一段': float(skill_data['神里流·镜花']['数值']['一段瞬水剑伤害'][level_e].replace('%', '')) / 100.0,
'Q-e水:大招每下': float(skill_data['神里流·水囿']['数值']['水花剑伤害'][level_q].replace('%', '')) / 100.0
@ -758,12 +760,12 @@ def get_damage_multipiler(data: dict) -> dict:
up = data['属性']['扩散系数'] if '扩散系数' in data['属性'] else 0
return {
'B:d': ['技能仅计算风伤部分'],
'B:c6-增伤-AX': (data['属性']['元素精通'] * 0.002, ),
'AX-e风:E后高空下落': float(skill_data['普通攻击·我流剑术']['数值']['低空/高空坠地冲击伤害'][level_a].split('/')[1].replace('%', '')) / 100.0,
'B:c6-增伤-AX': (data['属性']['元素精通'] * 0.002,),
'AX-e风:E后高空下落': float(
skill_data['普通攻击·我流剑术']['数值']['低空/高空坠地冲击伤害'][level_a].split('/')[1].replace('%', '')) / 100.0,
'E-e风:E点按伤害': float(skill_data['千早振']['数值']['点按技能伤害'][level_e].replace('%', '')) / 100.0,
'Q-e风:大招斩击': float(skill_data['万叶之一刀']['数值']['斩击伤害'][level_q].replace('%', '')) / 100.0,
'Q-e风:大招持续': float(skill_data['万叶之一刀']['数值']['持续伤害'][level_q].replace('%', '')) / 100.0,
# '大招附加': float(skill_data['万叶之一刀']['数值']['附加元素伤害'][level_q].replace('%', '')) / 100.0,
'T:扩散伤害': int(upheaval_reaction(data['等级'], '扩散', data['属性']['元素精通'], up))
}
if data['名称'] == '鹿野院平藏':
@ -771,13 +773,88 @@ def get_damage_multipiler(data: dict) -> dict:
data['属性']['元素精通'] += 80 if data['等级'] >= 70 else 0
up = data['属性']['扩散系数'] if '扩散系数' in data['属性'] else 0
return {
'B:c6-暴击率-E': (0.16, ),
'B:c6-暴击率-E': (0.16,),
'B:c6-暴击伤害-E': (0.32,),
'AZ-e风:重击': float(skill_data['普通攻击·不动流格斗术']['数值']['重击伤害'][level_a].replace('%', '')) / 100.0,
'E-e风:满层勠心拳': (float(e['技能伤害'][level_e].replace('%', '')) + 4 * float(e['变格伤害提升'][level_e].replace('%/层', '')) + float(e['正论伤害提升'][level_e].replace('%', ''))) / 100.0,
'E-e风:满层勠心拳': (float(e['技能伤害'][level_e].replace('%', '')) + 4 * float(
e['变格伤害提升'][level_e].replace('%/层', '')) + float(e['正论伤害提升'][level_e].replace('%', ''))) / 100.0,
'Q-e风:聚风蹴真空弹': float(skill_data['聚风蹴']['数值']['不动流·真空弹伤害'][level_q].replace('%', '')) / 100.0,
'T:扩散伤害': int(upheaval_reaction(data['等级'], '扩散', data['属性']['元素精通'], up))
}
if data['名称'] == '班尼特':
attack_increase = float(skill_data['美妙旅程']['数值']['攻击力加成比例'][level_q].replace('%', '')) / 100.0 + (
0.2 if len(data['命座']) >= 1 else 0)
hp_recover = skill_data['美妙旅程']['数值']['持续治疗'][level_q].split('+')
return {
'B:c6-增伤-E': (0.15,),
'B:l1-攻击力': (int(attack_increase * data['属性']['基础攻击']),),
'E-e火:元素战技点按': float(skill_data['热情过载']['数值']['点按伤害'][level_e].replace('%', '')) / 100.0,
'Q-e火:大招伤害': float(skill_data['美妙旅程']['数值']['技能伤害'][level_q].replace('%', '')) / 100.0,
'T:大招攻击加成': int(attack_increase * data['属性']['基础攻击']),
'T:大招持续治疗': int(
(float(hp_recover[0].replace('每秒', '').replace('%生命值上限', '')) / 100.0 * health + int(hp_recover[1])) * (
1 + data['属性']['治疗加成'])),
}
if data['名称'] == '温迪':
up = data['属性']['扩散系数'] if '扩散系数' in data['属性'] else 0
return {
'B:d': ['技能仅计算风伤部分'],
'B:c2-减抗-*': (0.24, '二命减抗'),
'B:c4-增伤-*': (0.25, '四命增伤'),
'B:c6-减抗-*': (0.2, '六命减抗'),
'E-e风:E点按伤害': float(skill_data['高天之歌']['数值']['点按伤害'][level_e].replace('%', '')) / 100.0,
'Q-e风:大招持续伤害': float(skill_data['风神之诗']['数值']['持续伤害'][level_q].replace('%', '')) / 100.0,
'T:扩散伤害': int(upheaval_reaction(data['等级'], '扩散', data['属性']['元素精通'], up))
}
if data['名称'] == '莫娜':
if len(data['命座']) >= 1:
if '蒸发系数' in data['属性']:
data['属性']['蒸发系数'] += 0.15
else:
data['属性']['蒸发系数'] = 0.15
return {
'B:c4-暴击率-*': (0.15,),
'B:c6-增伤-AZ': (1.8, '六命重击增伤满层'),
'B:l1-增伤-*': (float(skill_data['星命定轨']['数值']['伤害加成'][level_q].replace('%', '')) / 100.0, '星异增伤'),
'AZ-e水:重击': float(skill_data['普通攻击·因果点破']['数值']['重击伤害'][level_a].replace('%', '')) / 100.0,
'E-e水:E持续伤害': float(skill_data['水中幻愿']['数值']['持续伤害'][level_e].replace('%', '')) / 100.0,
'Q-e水:泡影破裂': float(skill_data['星命定轨']['数值']['泡影破裂伤害'][level_q].replace('%', '')) / 100.0,
'Q-e水-r蒸发2.0:泡影破裂蒸发': float(skill_data['星命定轨']['数值']['泡影破裂伤害'][level_q].replace('%', '')) / 100.0,
}
if data['名称'] == '':
recovery1 = skill_data['蒲公英之风']['数值']['领域发动治疗量'][level_q].split('+')
recovery2 = skill_data['蒲公英之风']['数值']['持续治疗'][level_q].split('+')
return {
'B:c1-增伤-E': (0.4, '战技长按1秒'),
'B:c4-减抗-E': (0.4, '四命减抗'),
'B:c4-减抗-Q': (0.4,),
'AZ:重击': float(skill_data['普通攻击·西风剑术']['数值']['重击伤害'][level_a].replace('%', '')) / 100.0,
'E-e风:风压剑': float(skill_data['风压剑']['数值']['技能伤害'][level_e].replace('%', '')) / 100.0,
'Q-e风:大招爆发伤害': float(skill_data['蒲公英之风']['数值']['爆发伤害'][level_q].replace('%', '')) / 100.0,
'Q-e风:大招出入领域伤害': float(skill_data['蒲公英之风']['数值']['出入领域伤害'][level_q].replace('%', '')) / 100.0,
'T:大招瞬时治疗': int((float(recovery1[0].replace('%攻击力', '')) / 100.0 * attack + int(recovery1[1])) * (
1 + data['属性']['治疗加成'])),
'T:大招持续治疗': int(
(float(recovery2[0].replace('每秒', '').replace('%攻击力', '')) / 100.0 * attack + int(recovery2[1])) * (
1 + data['属性']['治疗加成'])),
}
if data['名称'] == '七七':
a = skill_data['普通攻击·云来古剑法']['数值']['重击伤害'][level_a].split('+')
a_rec = skill_data['仙法·寒病鬼差']['数值']['命中治疗量'][level_e].split('+')
e_rec = skill_data['仙法·寒病鬼差']['数值']['持续治疗量'][level_e].split('+')
q_rec = skill_data['仙法·救苦度厄']['数值']['治疗量'][level_e].split('+')
return {
'B:c1-增伤-AZ': (0.15,),
'AZ:重击': (float(a[0].replace('%', '')) / 100.0, float(a[0].replace('%', '')) / 100.0),
'E-e冰:E释放伤害': float(skill_data['仙法·寒病鬼差']['数值']['技能伤害'][level_e].replace('%', '')) / 100.0,
'T:开E后普攻治疗量': int(
(float(a_rec[0].replace('%攻击力', '')) / 100.0 * attack + int(a_rec[1])) * (1 + data['属性']['治疗加成'])),
'T:E持续治疗量': int(
(float(e_rec[0].replace('%攻击力', '')) / 100.0 * attack + int(e_rec[1])) * (1 + data['属性']['治疗加成'])),
'T:挂符每次治疗量': int(
(float(q_rec[0].replace('%攻击力', '')) / 100.0 * attack + int(q_rec[1])) * (1 + data['属性']['治疗加成'])),
'Q-e冰:大招伤害': float(skill_data['仙法·救苦度厄']['数值']['技能伤害'][level_q].replace('%', '')) / 100.0,
}
def draw_dmg_pic(dmg: Dict[str, Union[tuple, list]]):

View File

@ -29,8 +29,7 @@ def get_chan_time(timeStamp1, timeStamp2):
date = dateArray1.strftime("%Y.%m.%d")
otherStyleTime1 = dateArray1.strftime("%H:%M:%S")
otherStyleTime2 = dateArray2.strftime("%H:%M:%S")
time_consumed = timeStamp2 - timeStamp1
return f'{date} {otherStyleTime1}-{otherStyleTime2} {str(time_consumed // 60).rjust(2, "0")}{str(time_consumed % 60).rjust(2, "0")}'
return f'{date} 结束时间 上{otherStyleTime1}{otherStyleTime2}'
async def draw_abyss_floor_card(floor, floor_n):
@ -46,7 +45,7 @@ async def draw_abyss_floor_card(floor, floor_n):
star_w += 50
battles = j['battles']
if not battles:
floor_draw.text((183, h + 135), '未有战斗记录', font=get_font(25), fill='white')
return None
else:
floor_draw.text((140, h), str(get_chan_time(int(battles[0]['timestamp']), int(battles[1]['timestamp']))),
font=get_font(21), fill='white')
@ -150,11 +149,16 @@ async def draw_abyss_card(data, uid, floor_num):
floor_img_list = []
for floor_n in floor_num:
try:
floor = data['floors'][floor_n - 9]
except IndexError:
break
if not floor['levels']:
break
floor_img = await draw_abyss_floor_card(floor, floor_n)
if floor_img:
floor_img_list.append(floor_img)
if floor_img_list:
floor_img_num = len(floor_img_list)
total_img = Image.new("RGBA", (700, 5 + 524 + 5 + floor_img_num * 1210), (255, 255, 255, 255))
total_img.alpha_composite(top_img, (5, 5))
@ -164,3 +168,5 @@ async def draw_abyss_card(data, uid, floor_num):
h += 1210
return MessageBuild.Image(total_img, quality=75, mode='RGB')
else:
return MessageBuild.Image(top_img, quality=75, mode='RGB')

View File

@ -1,6 +1,6 @@
import datetime
import os
import random
from io import BytesIO
from pathlib import Path
import matplotlib.pyplot as plt
@ -30,9 +30,10 @@ async def draw_ring(per):
wedgeprops={'width': 0.18},
startangle=90,
colors=colors)
plt.savefig('temp.png', transparent=True)
img = Image.open('temp.png').resize((266, 266)).convert('RGBA')
os.remove('temp.png')
bio = BytesIO()
plt.savefig(bio, transparent=True)
bio.seek(0)
img = Image.open(bio).resize((266, 266)).convert('RGBA')
plt.cla()
plt.close("all")
return img
@ -48,9 +49,9 @@ async def draw_daily_note_card(data, uid):
elif data['retcode'] != 0:
return f'派蒙获取{uid}数据失败了,获取状态:\n{data["message"]},{data["retcode"]}'
data = data['data']
circle_img = load_image(os.path.join(res_path, 'daily_note', '透明圆.png'))
finished_icon = load_image(os.path.join(res_path, 'daily_note', 'finished.png'))
bg_img = load_image(os.path.join(res_path, 'daily_note', 'ssbq.png'), mode='RGBA')
circle_img = load_image(res_path / 'daily_note' / '透明圆.png')
finished_icon = load_image(res_path / 'daily_note' / 'finished.png')
bg_img = load_image(res_path / 'daily_note' / 'ssbq.png', mode='RGBA')
bg_draw = ImageDraw.Draw(bg_img)
# uid文字
@ -66,7 +67,8 @@ async def draw_daily_note_card(data, uid):
recover_time_str = f'将于{recover_time_day}{recover_time.strftime("%H:%M")}回满'
bg_draw.text((780, 480), recover_time_str, fill='white', font=get_font(40, '优设标题黑.ttf'))
# 宝钱文字
bg_draw.text((337, 701), f"{data['current_home_coin']}/{data['max_home_coin']}", fill='white', font=get_font(48, 'number.ttf'))
bg_draw.text((337, 701), f"{data['current_home_coin']}/{data['max_home_coin']}", fill='white',
font=get_font(48, 'number.ttf'))
bg_img.alpha_composite(await draw_ring(data['current_home_coin'] / data['max_home_coin']), (98, 593))
if data['current_home_coin'] == data['max_home_coin']:
bg_draw.text((820, 701), f"洞天宝钱满了哦~", fill='white', font=get_font(40, '优设标题黑.ttf'))
@ -93,10 +95,14 @@ async def draw_daily_note_card(data, uid):
bg_draw.text((337, 1147), f"{7 - data['transformer']['recovery_time']['Day']}/7", fill='white',
font=get_font(48, 'number.ttf'))
bg_img.alpha_composite(await draw_ring((7 - data['transformer']['recovery_time']['Day']) / 7), (98, 1039))
if data['transformer']['recovery_time']['Day'] == 0:
rt = data['transformer']['recovery_time']
if rt['Day'] == 0 and rt['reached']:
bg_draw.text((465, 1147), "可使用", fill='white', font=get_font(40, '优设标题黑.ttf'))
elif rt['Day'] == 0 and not rt['reached']:
bg_draw.text((463, 1127), f"{rt['Hour']}时后", fill='white', font=get_font(40, '优设标题黑.ttf'))
bg_draw.text((465, 1167), "可使用", fill='white', font=get_font(40, '优设标题黑.ttf'))
else:
bg_draw.text((471, 1127), f"{data['transformer']['recovery_time']['Day']}天后", fill='white',
bg_draw.text((471, 1127), f"{rt['Day']}天后", fill='white',
font=get_font(40, '优设标题黑.ttf'))
bg_draw.text((465, 1167), "可使用", fill='white', font=get_font(40, '优设标题黑.ttf'))
else:
@ -116,18 +122,25 @@ async def draw_daily_note_card(data, uid):
abyss_new_day = 16 if datetime.datetime.now().day < 16 else 1
abyss_new = datetime.datetime.strptime('2022.' + str(abyss_new_month) + '.' + str(abyss_new_day) + '.00:00',
'%Y.%m.%d.%H:%M') - datetime.datetime.now()
bg_draw.text((337, 1358), f"{abyss_new.days}/15", fill='white',
abyss_new_total = datetime.datetime.strptime('2022.' + str(abyss_new_month) + '.' + str(abyss_new_day) + '.00:00',
'%Y.%m.%d.%H:%M') - datetime.datetime.strptime(
'2022.' + str(abyss_new_month if abyss_new_month == datetime.datetime.now().month else abyss_new_month - 1) + '.' + str(1 if datetime.datetime.now().day < 16 else 16) + '.00:00',
'%Y.%m.%d.%H:%M')
bg_draw.text((337, 1358), f"{abyss_new.days}/{abyss_new_total.days}", fill='white',
font=get_font(48, 'number.ttf'))
bg_draw.text((745, 1358), f"本期深渊还有{abyss_new.days if abyss_new.days <= 15 else 15}天结束", fill='white',
bg_draw.text((745, 1358), f"本期深渊还有{abyss_new.days if abyss_new.days <= abyss_new_total.days else abyss_new_total.days}天结束", fill='white',
font=get_font(40, '优设标题黑.ttf'))
bg_img.alpha_composite(await draw_ring(abyss_new.days if abyss_new.days <= 15 else 15 / 15), (100, 1249))
bg_img.alpha_composite(await draw_ring(abyss_new.days / abyss_new_total.days), (100, 1249))
# 派遣情况
exp = data['expeditions']
if exp:
i = 0
for role in exp:
role_avatar = Path() / 'data' / 'LittlePaimon' / 'res' / 'avatar_side' / role['avatar_side_icon'].split('/')[-1]
role_avatar = await aiorequests.get_img(url=role['avatar_side_icon'], size=(135, 135), mode='RGBA', save_path=role_avatar)
role_avatar = Path() / 'data' / 'LittlePaimon' / 'res' / 'avatar_side' / \
role['avatar_side_icon'].split('/')[-1]
role_avatar = await aiorequests.get_img(url=role['avatar_side_icon'], size=(135, 135), mode='RGBA',
save_path=role_avatar)
bg_img.alpha_composite(role_avatar, (i * 200 + 168, 1537))
bg_img.alpha_composite(await draw_ring(1 - int(role['remained_time']) / 72000), (i * 201 + 101, 1490))
if role['status'] == 'Ongoing':
@ -152,8 +165,10 @@ async def draw_daily_note_card(data, uid):
last_finish_str = f'{last_finish_day}{last_finish_time.strftime("%H:%M")}'
bg_draw.text((1408, 1588), last_finish_str, fill="#5680d2",
font=get_font(60, '优设标题黑.ttf'))
role_img = load_image(os.path.join(res_path, 'emoticons', random.choice(os.listdir(os.path.join(res_path, 'emoticons')))), size=3.5, mode='RGBA')
else:
bg_draw.text((1408, 1588), '未安排派遣', fill="#5680d2",
font=get_font(60, '优设标题黑.ttf'))
role_img = load_image(random.choice(list((res_path / 'emoticons').iterdir())), size=3.5, mode='RGBA')
bg_img.alpha_composite(role_img, (1220, 200))
now = datetime.datetime.now().strftime('%m月%d%H:%M')
bg_draw.text((554, 1794), 'Created by LittlePaimon·' + now, fill='#5680d2', font=get_font(40, '优设标题黑.ttf'))

View File

@ -1,5 +1,5 @@
import os
import random
from io import BytesIO
from pathlib import Path
import matplotlib.pyplot as plt
@ -35,9 +35,10 @@ async def draw_ring(per, colors):
wedgeprops={'width': 0.29},
startangle=90,
colors=colors)
plt.savefig('temp.png', transparent=True)
img = Image.open('temp.png').resize((378, 378)).convert('RGBA')
os.remove('temp.png')
bio = BytesIO()
plt.savefig(bio, transparent=True)
bio.seek(0)
img = Image.open(bio).resize((378, 378)).convert('RGBA')
plt.cla()
plt.close("all")
return img
@ -57,9 +58,9 @@ async def draw_monthinfo_card(data):
elif data['retcode'] != 0:
return f'派蒙获取数据失败了,获取状态:\n{data["message"]},{data["retcode"]}'
data = data['data']
bg_img = load_image(os.path.join(res_path, 'monthinfo', 'bg.png'), mode='RGBA')
bg_img = load_image(res_path / 'monthinfo' / 'bg.png', mode='RGBA')
bg_draw = ImageDraw.Draw(bg_img)
line = load_image(os.path.join(res_path, 'monthinfo', 'line.png'), mode='RGBA')
line = load_image(res_path / 'monthinfo' / 'line.png', mode='RGBA')
# 顶标题
bg_draw.text((60, 42), f'旅行者{data["data_month"]}月札记', font=get_font(30, 'msyhbd.ttc'), fill='#27384C')
bg_draw.text((300, 52), f'{data["nickname"]} {data["uid"]}', font=get_font(21), fill='#27384C')
@ -73,16 +74,16 @@ async def draw_monthinfo_card(data):
bg_img.alpha_composite(await get_box('原石', data['day_data']['current_primogems']), (40, 328))
bg_img.alpha_composite(await get_box('摩拉', data['day_data']['current_mora']), (40, 388))
# 表情
emoticon1 = load_image(os.path.join(res_path, 'emoticons', random.choice(os.listdir(os.path.join(res_path, 'emoticons')))), mode='RGBA')
emos = list((res_path / 'emoticons').iterdir())
emoticon1 = load_image(random.choice(emos), mode='RGBA')
bg_img.alpha_composite(emoticon1, (360, 140))
emoticon2 = load_image(os.path.join(res_path, 'emoticons', random.choice(os.listdir(os.path.join(res_path, 'emoticons')))), mode='RGBA')
emoticon2 = load_image(random.choice(emos), mode='RGBA')
bg_img.alpha_composite(emoticon2, (360, 317))
bg_img.alpha_composite(line, (64, 480))
# 圆环比例图
bg_draw.text((60, 495), '原石收入组成:', font=get_font(25, 'msyhbd.ttc'), fill='#27384C')
circle = load_image(os.path.join(res_path, 'monthinfo', 'circle.png'), mode='RGBA')
circle = load_image(res_path / 'monthinfo' / 'circle.png', mode='RGBA')
bg_img.alpha_composite(circle, (50, 550))
color = {'每日活跃': '#BD9A5A', '深境螺旋': '#739970', '活动奖励': '#5A7EA0', '邮件奖励': '#7A6CA7', '冒险奖励': '#D56564',

View File

@ -9,7 +9,6 @@ from ..utils.db_util import update_cookie_cache
from ..utils.decorator import cache
@cache(ttl=datetime.timedelta(minutes=10))
async def get_abyss_data(user_id, uid, schedule_type="1", use_cache=True):
server_id = "cn_qd01" if uid[0] == '5' else "cn_gf01"
url = "https://api-takumi-record.mihoyo.com/game_record/app/genshin/api/spiralAbyss"

View File

@ -56,35 +56,27 @@
## 丨更新日志
> README只展示最近更新全部更新日志详见[这里](https://github.com/CMHopeSunshine/LittlePaimon/blob/nonebot2/UPDATE_LOG.md)
+ 7.3
- 重构部分代码
- **修改静态资源和用户数据目录**
- 理论上会**自动迁移**,但`git pull`更新可能会将资源删除,所以最好**手动迁移,同时备份**
- 1、将派蒙的`res`文件夹改名`LittlePaimon`移到nonebot根目录的`resources`中(没有`resources`就新建一个)
- 2、将派蒙的`user_data`文件夹移到nonebot根目录的`data/LittlePaimon`目录中(同理,没有就新建)
- 静态资源改为启动时自动下载
+ 7.4
- 回档部分7.3的修改
- `ysd`新增`香菱、申鹤`伤害计算
- 修复`60秒早报`接口bug
- 修复神里绫人被识别为绫华别名的bug
- 修复抽卡记录获取bug
+ 7.8
- 增加`甘雨、夜兰、行秋、神里绫华、阿贝多、刻晴、八重神子`伤害计算
+ 7.9
- 增加`优菈、达达利亚、迪卢克、凝光、菲谢尔、北斗、神里绫人、荒泷一斗、宵宫`伤害计算
+ 7.13
- 增加`诺艾尔、烟绯、珊瑚宫心海`伤害计算
+ 7.14
- ysd支持`鹿野院平藏`,增加`枫原万叶、鹿野院平藏`伤害计算
+ 7.15
- 增加新武器的攻略,修复`ysd`命座天赋加成以及岩元素护盾数值
+ 7.17
- `ysd`新增`班尼特、莫娜、七七、琴、温迪`伤害计算
- `mys自动签到`支持私聊
- `sy`修正深渊信息时间介绍
- `sy`没有绑定cookie时将不再错误的展示空阵容信息
- `ssbq`修复没有派遣时会报错的bug
## 丨功能列表
详见我的博客[功能列表](https://blog.cherishmoon.fun/posts/nonebot2funclist.html) <br>
博客内容可能滞后于实际版本 ~~太懒了~~
## 丨重要提示
如果你是**7月3日**之前克隆的用户,且之后没有更新过,请按照下面的方法迁移数据:
- 1、将派蒙的`res`文件夹改名`LittlePaimon`移到nonebot根目录的`resources`中(没有`resources`就新建一个)
- 2、将派蒙的`user_data`文件夹移到nonebot根目录的`data/LittlePaimon`目录中(同理,没有就新建)
## 丨部署方法
### 我很熟悉NoneBot2

View File

@ -84,3 +84,9 @@
- ysd支持`鹿野院平藏`,增加`枫原万叶、鹿野院平藏`伤害计算
+ 7.15
- 增加新武器的攻略,修复`ysd`命座天赋加成以及岩元素护盾数值
+ 7.17
- `ysd`新增`班尼特、莫娜、七七、琴、温迪`伤害计算
- `mys自动签到`支持私聊
- `sy`修正深渊信息时间介绍
- `sy`没有绑定cookie时将不再错误的展示空阵容信息
- `ssbq`修复没有派遣时会报错的bug

View File

@ -14517,9 +14517,116 @@
]
}
},
"星命定轨": "凝聚粼粼的水波,倒映出虚幻星空,对大范围内的敌人施加泡影状态。泡影以星相的气泡包裹敌人,施加潮湿状态。较弱的敌人会被禁锢在泡影中,无法行动。处于泡影影响下的敌人受到伤害时,会产生以下效果:•对敌人施加星异的伤害加成效果,并以此提高这一次造成的伤害;•解除泡影效果,并额外造成一次水元素伤害。星异持续时间内,提高目标对象受到的伤害。自从神的目光开始牵引着天上的光明,命运自此被称之为命运。",
"星命定轨": {
"描述": "凝聚粼粼的水波,倒映出虚幻星空,对大范围内的敌人施加泡影状态。泡影以星相的气泡包裹敌人,施加潮湿状态。较弱的敌人会被禁锢在泡影中,无法行动。处于泡影影响下的敌人受到伤害时,会产生以下效果:•对敌人施加星异的伤害加成效果,并以此提高这一次造成的伤害;•解除泡影效果,并额外造成一次水元素伤害。星异持续时间内,提高目标对象受到的伤害。自从神的目光开始牵引着天上的光明,命运自此被称之为命运。",
"数值": {
"泡影持续时间": [
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
"8.0秒",
""
],
"泡影破裂伤害": [
"442%",
"476%",
"509%",
"553%",
"586%",
"619%",
"664%",
"708%",
"752%",
"796%",
"841%",
"885%",
"940%",
"995%",
""
],
"伤害加成": [
"42%",
"44%",
"46%",
"48%",
"50%",
"52%",
"54%",
"56%",
"58%",
"60%",
"60%",
"60%",
"60%",
"60%",
""
],
"星异持续时间": [
"4.0秒",
"4.0秒",
"4.0秒",
"4.5秒",
"4.5秒",
"4.5秒",
"5.0秒",
"5.0秒",
"5.0秒",
"5.0秒",
"5.0秒",
"5.0秒",
"5.0秒",
"5.0秒",
""
],
"冷却时间": [
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
"15.0秒",
""
],
"元素能量": [
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
"60",
""
]
}
},
"「老太婆来抓我啊!」": "进入虚实流动状态2秒后如果周围存在敌人则自动凝聚一个虚影。通过这种方式产生的虚影持续2秒造成的破裂伤害相当于水中幻愿伤害的50%。",
"「托付于命运吧!」": "莫娜的水元素伤害加成获得额外提升,提升程度相当于她的元素充能效率的20%。"
"「托付于命运吧!」": "莫娜的水元素伤害加成获得额外提升,提升程度相当于她的元素充能效率的20%。",
"运行原理": "合成武器突破素材时有25%概率返还部分合成材料。"
},
"cv": {
"cn": "陈婷婷",