mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-06-19 05:45:03 +08:00
✨ format code
This commit is contained in:
parent
e7e1b53ff1
commit
97241e822c
@ -1,6 +1,6 @@
|
||||
"""Mihomo.me api 包装
|
||||
"""
|
||||
'''Mihomo.me api 包装
|
||||
'''
|
||||
from .models import MihomoData as MihomoData
|
||||
from .requests import get_char_card_info as requests
|
||||
|
||||
__all__ = ["requests", "MihomoData"]
|
||||
__all__ = ['requests', 'MihomoData']
|
||||
|
@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Union, TypedDict
|
||||
from typing import TypedDict
|
||||
|
||||
|
||||
class MihomoData(TypedDict):
|
||||
@ -15,12 +15,12 @@ class Behavior(TypedDict):
|
||||
class Equipment(TypedDict):
|
||||
level: int
|
||||
tid: int
|
||||
promotion: Union[int, None]
|
||||
rank: Union[int, None]
|
||||
promotion: int | None
|
||||
rank: int | None
|
||||
|
||||
|
||||
class Relic(TypedDict):
|
||||
subAffixList: List[SubAffix]
|
||||
subAffixList: list[SubAffix]
|
||||
tid: int
|
||||
mainAffixId: int
|
||||
type: int
|
||||
@ -33,20 +33,20 @@ class SubAffix(TypedDict):
|
||||
|
||||
|
||||
class Avatar(TypedDict):
|
||||
skillTreeList: List[Behavior]
|
||||
rank: Union[int, None]
|
||||
pos: Union[int, None]
|
||||
skillTreeList: list[Behavior]
|
||||
rank: int | None
|
||||
pos: int | None
|
||||
avatarId: int
|
||||
level: int
|
||||
equipment: Union[Equipment, None]
|
||||
relicList: List[Relic]
|
||||
equipment: Equipment | None
|
||||
relicList: list[Relic]
|
||||
promotion: int
|
||||
|
||||
|
||||
class Challenge(TypedDict):
|
||||
scheduleMaxLevel: int
|
||||
MazeGroupIndex: Union[int, None]
|
||||
PreMazeGroupIndex: Union[int, None]
|
||||
MazeGroupIndex: int | None
|
||||
PreMazeGroupIndex: int | None
|
||||
|
||||
|
||||
class PlayerSpaceInfo(TypedDict):
|
||||
@ -61,13 +61,13 @@ class PlayerDetailInfo(TypedDict):
|
||||
assistAvatarDetail: Avatar
|
||||
platform: str
|
||||
isDisplayAvatar: bool
|
||||
avatarDetailList: Union[List[Avatar], None]
|
||||
avatarDetailList: list[Avatar] | None
|
||||
uid: int
|
||||
friendCount: int
|
||||
worldLevel: int
|
||||
nickname: str
|
||||
Birthday: Union[int, None]
|
||||
Birthday: int | None
|
||||
level: int
|
||||
recordInfo: Union[PlayerSpaceInfo, None]
|
||||
recordInfo: PlayerSpaceInfo | None
|
||||
headIcon: int
|
||||
signature: Union[str, None]
|
||||
signature: str | None
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Union, TypedDict
|
||||
from typing import Any, Dict, List, TypedDict, Union
|
||||
|
||||
################
|
||||
# 抽卡记录相关 #
|
||||
|
@ -1,8 +1,8 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.utils.error_reply import UID_HINT
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
|
@ -1,18 +1,16 @@
|
||||
from pathlib import Path
|
||||
from typing import Union, Optional
|
||||
from typing import Optional, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
get_qq_avatar,
|
||||
)
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from .utils import get_icon
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..sruid_utils.api.mys.models import AbyssAvatar
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_28,
|
||||
@ -20,6 +18,8 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_34,
|
||||
sr_font_42,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from .utils import get_icon
|
||||
|
||||
abyss_list = {
|
||||
'1': '琥珀恩赐其一',
|
||||
@ -38,28 +38,28 @@ TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
white_color = (255, 255, 255)
|
||||
gray_color = (175, 175, 175)
|
||||
img_bg = Image.open(TEXT_PATH / 'bg.jpg')
|
||||
level_cover = Image.open(TEXT_PATH / 'level_cover.png').convert("RGBA")
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'char4_bg.png').convert("RGBA")
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'char5_bg.png').convert("RGBA")
|
||||
level_cover = Image.open(TEXT_PATH / 'level_cover.png').convert('RGBA')
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'char4_bg.png').convert('RGBA')
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'char5_bg.png').convert('RGBA')
|
||||
|
||||
star_yes = Image.open(TEXT_PATH / 'star.png').convert("RGBA")
|
||||
star_gray = Image.open(TEXT_PATH / 'star_gray.png').convert("RGBA")
|
||||
star_yes = Image.open(TEXT_PATH / 'star.png').convert('RGBA')
|
||||
star_gray = Image.open(TEXT_PATH / 'star_gray.png').convert('RGBA')
|
||||
|
||||
elements = {
|
||||
"ice": Image.open(TEXT_PATH / "IconNatureColorIce.png").convert("RGBA"),
|
||||
"fire": Image.open(TEXT_PATH / "IconNatureColorFire.png").convert("RGBA"),
|
||||
"imaginary": Image.open(
|
||||
TEXT_PATH / "IconNatureColorImaginary.png"
|
||||
).convert("RGBA"),
|
||||
"quantum": Image.open(TEXT_PATH / "IconNatureColorQuantum.png").convert(
|
||||
"RGBA"
|
||||
'ice': Image.open(TEXT_PATH / 'IconNatureColorIce.png').convert('RGBA'),
|
||||
'fire': Image.open(TEXT_PATH / 'IconNatureColorFire.png').convert('RGBA'),
|
||||
'imaginary': Image.open(
|
||||
TEXT_PATH / 'IconNatureColorImaginary.png'
|
||||
).convert('RGBA'),
|
||||
'quantum': Image.open(TEXT_PATH / 'IconNatureColorQuantum.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"lightning": Image.open(TEXT_PATH / "IconNatureColorThunder.png").convert(
|
||||
"RGBA"
|
||||
'lightning': Image.open(TEXT_PATH / 'IconNatureColorThunder.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"wind": Image.open(TEXT_PATH / "IconNatureColorWind.png").convert("RGBA"),
|
||||
"physical": Image.open(TEXT_PATH / "IconNaturePhysical.png").convert(
|
||||
"RGBA"
|
||||
'wind': Image.open(TEXT_PATH / 'IconNatureColorWind.png').convert('RGBA'),
|
||||
'physical': Image.open(TEXT_PATH / 'IconNaturePhysical.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ async def draw_abyss_img(
|
||||
for index_floor, level in enumerate(raw_abyss_data['all_floor_detail']):
|
||||
if floor:
|
||||
if abyss_list[str(floor)] == level['name']:
|
||||
index_floor = 0
|
||||
index_floor = 0 # noqa: PLW2901
|
||||
else:
|
||||
continue
|
||||
elif index_floor >= 3:
|
||||
|
@ -2,11 +2,11 @@ from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
|
||||
from PIL import Image
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
from PIL import Image
|
||||
|
||||
T = TypeVar("T")
|
||||
T = TypeVar('T')
|
||||
|
||||
ROLEINFO_PATH = get_res_path() / 'StarRailUID' / 'roleinfo'
|
||||
ROLEINFO_PATH.mkdir(parents=True, exist_ok=True)
|
||||
@ -21,6 +21,6 @@ async def get_icon(url: str) -> Image.Image:
|
||||
async with ClientSession() as client:
|
||||
async with client.get(url) as resp:
|
||||
content = await resp.read()
|
||||
with Path.open(path, "wb") as f:
|
||||
with Path.open(path, 'wb') as f:
|
||||
f.write(content)
|
||||
return Image.open(BytesIO(content)).convert("RGBA")
|
||||
return Image.open(BytesIO(content)).convert('RGBA')
|
||||
|
@ -2,19 +2,19 @@ import re
|
||||
from pathlib import Path
|
||||
from typing import Tuple, cast
|
||||
|
||||
from PIL import Image
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from PIL import Image
|
||||
|
||||
from .to_card import api_to_card
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from .get_char_img import draw_char_info_img
|
||||
from ..utils.image.convert import convert_img
|
||||
from .draw_char_img import cal, get_char_data
|
||||
from ..utils.resource.RESOURCE_PATH import TEMP_PATH
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_char_img import cal, get_char_data
|
||||
from .get_char_img import draw_char_info_img
|
||||
from .to_card import api_to_card
|
||||
|
||||
sv_char_info_config = SV('sr面板设置', pm=2)
|
||||
sv_get_char_info = SV('sr面板查询', priority=10)
|
||||
|
@ -73,5 +73,4 @@ async def cal(char_data: Dict):
|
||||
im_tmp = await role.cal_damage('Talent')
|
||||
skill_info_list.append(im_tmp)
|
||||
return skill_info_list
|
||||
else:
|
||||
return '角色伤害计算未完成'
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ..utils.excel.model import RelicMainAffixConfig, RelicSubAffixConfig
|
||||
from ..utils.map.SR_MAP_PATH import RelicId2MainAffixGroup
|
||||
from ..utils.excel.model import RelicSubAffixConfig, RelicMainAffixConfig
|
||||
|
||||
|
||||
async def cal_relic_main_affix(
|
||||
|
@ -4,30 +4,14 @@ import textwrap
|
||||
from pathlib import Path
|
||||
from typing import Dict, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.image.convert import convert_img
|
||||
from gsuid_core.utils.image.image_tools import draw_text_by_line
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from .to_data import api_to_dict
|
||||
from ..utils.error_reply import CHAR_HINT
|
||||
from .cal_damage import cal, cal_char_info
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.excel.read_excel import light_cone_ranks
|
||||
from ..utils.map.name_covert import name_to_avatar_id, alias_to_char_name
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
RelicId2Rarity,
|
||||
AvatarRelicScore,
|
||||
avatarId2Name,
|
||||
avatarId2DamageType,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
RELIC_PATH,
|
||||
SKILL_PATH,
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
CHAR_PORTRAIT_PATH,
|
||||
)
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_18,
|
||||
sr_font_20,
|
||||
@ -38,6 +22,22 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_34,
|
||||
sr_font_38,
|
||||
)
|
||||
from ..utils.map.name_covert import alias_to_char_name, name_to_avatar_id
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
AvatarRelicScore,
|
||||
RelicId2Rarity,
|
||||
avatarId2DamageType,
|
||||
avatarId2Name,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
CHAR_PORTRAIT_PATH,
|
||||
PLAYER_PATH,
|
||||
RELIC_PATH,
|
||||
SKILL_PATH,
|
||||
WEAPON_PATH,
|
||||
)
|
||||
from .cal_damage import cal, cal_char_info
|
||||
from .to_data import api_to_dict
|
||||
|
||||
Excel_path = Path(__file__).parent / 'effect'
|
||||
with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||
@ -45,7 +45,7 @@ with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
|
||||
bg_img = Image.open(TEXT_PATH / "bg.png")
|
||||
bg_img = Image.open(TEXT_PATH / 'bg.png')
|
||||
white_color = (213, 213, 213)
|
||||
NUM_MAP = {0: '零', 1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六', 7: '七'}
|
||||
|
||||
@ -113,6 +113,8 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
if damage_len > 0:
|
||||
bg_height = 48 * (1 + damage_len) + 48
|
||||
char_change = 0
|
||||
msg_h = 0
|
||||
para = []
|
||||
if '换' in msg or '拿' in msg or '带' in msg:
|
||||
char_change = 1
|
||||
para = textwrap.wrap(msg, width=45)
|
||||
@ -257,7 +259,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
critical_chance = (critical_chance + critical_chance_base) * 100
|
||||
attr_bg_draw.text(
|
||||
(500, 31 + 48 * 4),
|
||||
"{:.1f}%".format(critical_chance),
|
||||
f'{critical_chance:.1f}%',
|
||||
white_color,
|
||||
sr_font_26,
|
||||
'rm',
|
||||
@ -268,7 +270,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
critical_damage = (critical_damage + critical_damage_base) * 100
|
||||
attr_bg_draw.text(
|
||||
(500, 31 + 48 * 5),
|
||||
"{:.1f}%".format(critical_damage),
|
||||
f'{critical_damage:.1f}%',
|
||||
white_color,
|
||||
sr_font_26,
|
||||
'rm',
|
||||
@ -279,7 +281,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
)
|
||||
attr_bg_draw.text(
|
||||
(500, 31 + 48 * 6),
|
||||
"{:.1f}%".format(status_probability_base),
|
||||
f'{status_probability_base:.1f}%',
|
||||
white_color,
|
||||
sr_font_26,
|
||||
'rm',
|
||||
@ -288,7 +290,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
status_resistance_base = char.add_attr.get('StatusResistanceBase', 0) * 100
|
||||
attr_bg_draw.text(
|
||||
(500, 31 + 48 * 7),
|
||||
"{:.1f}%".format(status_resistance_base),
|
||||
f'{status_resistance_base:.1f}%',
|
||||
white_color,
|
||||
sr_font_26,
|
||||
'rm',
|
||||
@ -309,7 +311,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
rank_img = (
|
||||
Image.open(SKILL_PATH / f'{char.char_id}{RANK_MAP[rank + 1]}')
|
||||
.resize((50, 50))
|
||||
.convert("RGBA")
|
||||
.convert('RGBA')
|
||||
)
|
||||
rank_img.putalpha(
|
||||
rank_img.getchannel('A').point(
|
||||
@ -375,10 +377,10 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
)
|
||||
if hasattr(sr_font_34, 'getsize'):
|
||||
weapon_name_len = sr_font_34.getsize( # type: ignore
|
||||
char.equipment["equipmentName"]
|
||||
char.equipment['equipmentName']
|
||||
)[0]
|
||||
else:
|
||||
bbox = sr_font_34.getbbox(char.equipment["equipmentName"])
|
||||
bbox = sr_font_34.getbbox(char.equipment['equipmentName'])
|
||||
weapon_name_len = bbox[2] - bbox[0]
|
||||
# 放阶
|
||||
rank_img = Image.open(TEXT_PATH / 'ImgNewBg.png')
|
||||
@ -436,9 +438,9 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
relic_score = 0
|
||||
|
||||
for relic in char.char_relic:
|
||||
rarity = RelicId2Rarity[str(relic["relicId"])]
|
||||
rarity = RelicId2Rarity[str(relic['relicId'])]
|
||||
relic_img = Image.open(TEXT_PATH / f'yq_bg{rarity}.png')
|
||||
if str(relic["SetId"])[0] == '3':
|
||||
if str(relic['SetId'])[0] == '3':
|
||||
relic_piece_img = Image.open(
|
||||
RELIC_PATH / f'{relic["SetId"]}_{relic["Type"] - 5}.png'
|
||||
)
|
||||
@ -448,7 +450,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
)
|
||||
relic_piece_new_img = relic_piece_img.resize(
|
||||
(105, 105), Image.Resampling.LANCZOS
|
||||
).convert("RGBA")
|
||||
).convert('RGBA')
|
||||
relic_img.paste(
|
||||
relic_piece_new_img, (200, 90), relic_piece_new_img
|
||||
)
|
||||
@ -477,7 +479,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
main_level: int = relic['Level']
|
||||
|
||||
if main_name in ['攻击力', '生命值', '防御力', '速度']:
|
||||
mainValueStr = "{:.1f}".format(main_value)
|
||||
mainValueStr = f'{main_value:.1f}'
|
||||
else:
|
||||
mainValueStr = str(math.floor(main_value * 1000) / 10) + '%'
|
||||
|
||||
@ -543,9 +545,9 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
single_relic_score += tmp_score
|
||||
|
||||
if subName in ['攻击力', '生命值', '防御力', '速度']:
|
||||
subValueStr = "{:.1f}".format(subValue)
|
||||
subValueStr = f'{subValue:.1f}'
|
||||
else:
|
||||
subValueStr = "{:.1f}".format(subValue * 100) + '%'
|
||||
subValueStr = f'{subValue * 100:.1f}' + '%'
|
||||
subNameStr = subName.replace('百分比', '').replace('元素', '')
|
||||
# 副词条文字颜色
|
||||
if tmp_score == 0:
|
||||
@ -583,7 +585,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
)
|
||||
|
||||
char_info.paste(
|
||||
relic_img, RELIC_POS[str(relic["Type"])], relic_img
|
||||
relic_img, RELIC_POS[str(relic['Type'])], relic_img
|
||||
)
|
||||
relic_score += single_relic_score
|
||||
if relic_score > 200:
|
||||
@ -689,7 +691,7 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str):
|
||||
if char_change == 1:
|
||||
char_img_draw.text(
|
||||
(525, 2022 + bg_height - msg_h),
|
||||
'面板数据来源于:【面板替换】',
|
||||
'面板数据来源于: 【面板替换】',
|
||||
(180, 180, 180),
|
||||
sr_font_26,
|
||||
'mm',
|
||||
@ -726,13 +728,13 @@ async def get_char_data(
|
||||
) -> Union[Dict, str]:
|
||||
player_path = PLAYER_PATH / str(sr_uid)
|
||||
SELF_PATH = player_path / 'SELF'
|
||||
if "开拓者" in str(char_name):
|
||||
char_name = "开拓者"
|
||||
if '开拓者' in str(char_name):
|
||||
char_name = '开拓者'
|
||||
char_id = await name_to_avatar_id(char_name)
|
||||
if char_id == '':
|
||||
char_name = await alias_to_char_name(char_name)
|
||||
if char_name is False:
|
||||
return "请输入正确的角色名"
|
||||
return '请输入正确的角色名'
|
||||
char_path = player_path / f'{char_name}.json'
|
||||
char_self_path = SELF_PATH / f'{char_name}.json'
|
||||
path = Path()
|
||||
|
@ -3,7 +3,7 @@ from typing import Dict, List
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..Base.AvatarBase import BaseAvatar, BaseAvatarBuff
|
||||
from ..Base.model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
from ..Base.model import DamageInstanceAvatar, DamageInstanceSkill
|
||||
|
||||
|
||||
class Seele(BaseAvatar):
|
||||
@ -59,9 +59,9 @@ class JingYuan(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('【神君】下回合的攻击段数大于等于6段,则其下回合的暴击伤害提高25%。')
|
||||
logger.info('【神君】下回合的攻击段数大于等于6段, 则其下回合的暴击伤害提高25%。')
|
||||
self.extra_ability_attribute['CriticalDamageBase'] = 0.25
|
||||
logger.info('施放战技后,暴击率提升10%')
|
||||
logger.info('施放战技后, 暴击率提升10%')
|
||||
self.extra_ability_attribute['CriticalChanceBase'] = 0.1
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ class Danhengil(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('对拥有虚数属性弱点的敌方目标造成伤害时,暴击伤害提高24%。')
|
||||
logger.info('对拥有虚数属性弱点的敌方目标造成伤害时, 暴击伤害提高24%。')
|
||||
self.extra_ability_attribute['CriticalDamageBase'] = 0.24
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ class Yanqing(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('触发暴击时,速度提高10%')
|
||||
logger.info('触发暴击时, 速度提高10%')
|
||||
self.extra_ability_attribute['SpeedAddedRatio'] = 0.1
|
||||
logger.info('【智剑连心】增益')
|
||||
critical_damage_base_t = self.Talent_num('Talent_CD')
|
||||
@ -310,7 +310,7 @@ class Welt(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('施放终结技时,有100%基础概率使目标受到的伤害提高12%,持续2回合。')
|
||||
logger.info('施放终结技时, 有100%基础概率使目标受到的伤害提高12%, 持续2回合。')
|
||||
logger.info('对被弱点击破的敌方目标造成的伤害提高20')
|
||||
self.extra_ability_attribute['AllDamageAddedRatio'] = 0.32
|
||||
|
||||
@ -340,7 +340,7 @@ class Himeko(BaseAvatar):
|
||||
logger.info('额外能力')
|
||||
logger.info('战技对灼烧状态下的敌方目标造成的伤害提高20%。')
|
||||
self.extra_ability_attribute['BPSkillDmgAdd'] = 0.2
|
||||
logger.info('若当前生命值百分比大于等于80%,则暴击率提高15%。')
|
||||
logger.info('若当前生命值百分比大于等于80%, 则暴击率提高15%。')
|
||||
self.extra_ability_attribute['CriticalChanceBase'] = 0.15
|
||||
|
||||
|
||||
@ -365,7 +365,7 @@ class Qingque(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('施放强化普攻后,青雀的速度提高10%,持续1回合。')
|
||||
logger.info('施放强化普攻后, 青雀的速度提高10%, 持续1回合。')
|
||||
self.extra_ability_attribute['SpeedAddedRatio'] = 0.1
|
||||
logger.info('默认4层战技加伤害')
|
||||
all_damage_added_ratio = self.BPSkill() + 0.1
|
||||
@ -405,9 +405,9 @@ class Jingliu(BaseAvatar):
|
||||
|
||||
def extra_ability(self):
|
||||
logger.info('额外能力')
|
||||
logger.info('【转魄】状态下,终结技造成的伤害提高20%。')
|
||||
logger.info('【转魄】状态下,暴击率提高。')
|
||||
logger.info('【转魄】状态下,攻击力提高。')
|
||||
logger.info('【转魄】状态下, 终结技造成的伤害提高20%。')
|
||||
logger.info('【转魄】状态下, 暴击率提高。')
|
||||
logger.info('【转魄】状态下, 攻击力提高。')
|
||||
self.extra_ability_attribute['UltraDmgAdd'] = 0.2
|
||||
critical_chance_base = self.Talent_num('Talent_CC')
|
||||
self.extra_ability_attribute[
|
||||
|
@ -1,14 +1,14 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from abc import abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import List, Union
|
||||
|
||||
import msgspec
|
||||
from msgspec import Struct
|
||||
|
||||
from .SkillBase import BaseSkills
|
||||
from ....utils.excel.model import AvatarPromotionConfig
|
||||
from .model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
from .model import DamageInstanceAvatar, DamageInstanceSkill
|
||||
from .SkillBase import BaseSkills
|
||||
|
||||
path = Path(__file__).parent.parent
|
||||
with Path.open(path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||
@ -108,8 +108,7 @@ class BaseAvatar:
|
||||
|
||||
def Skill_Info(self, skill_type: str):
|
||||
skill_info = skill_dict[str(self.avatar_id)]['skillList'][skill_type]
|
||||
skill_info_ = msgspec.convert(skill_info, type=List[Union[str, int]])
|
||||
return skill_info_
|
||||
return msgspec.convert(skill_info, type=List[Union[str, int]])
|
||||
|
||||
def Normalnum(self, skill_type: str):
|
||||
skill_info = skill_dict[str(self.avatar_id)][skill_type][
|
||||
@ -171,12 +170,11 @@ class BaseAvatar:
|
||||
self.Skill.Talent_.level - 1
|
||||
]
|
||||
return msgspec.convert(skill_info, type=float)
|
||||
elif self.avatar_id in [1205]:
|
||||
if self.avatar_id in [1205]:
|
||||
skill_info = skill_dict[str(self.avatar_id)]['BPSkill'][
|
||||
self.Skill.BPSkill_.level - 1
|
||||
]
|
||||
return msgspec.convert(skill_info, type=float)
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
def Ultra_Use(self):
|
||||
|
@ -1,10 +1,10 @@
|
||||
from typing import Dict
|
||||
from abc import abstractmethod
|
||||
from typing import Dict
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from .model import DamageInstanceRelic
|
||||
from ....utils.map.SR_MAP_PATH import RelicSetSkill
|
||||
from .model import DamageInstanceRelic
|
||||
|
||||
|
||||
class SingleRelic:
|
||||
|
@ -1,8 +1,8 @@
|
||||
import json
|
||||
from typing import List
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
from .model import DamageInstanceSkill, DamageInstanceAvatar
|
||||
from .model import DamageInstanceAvatar, DamageInstanceSkill
|
||||
|
||||
path = Path(__file__).parent.parent
|
||||
with Path.open(path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||
|
@ -1,11 +1,11 @@
|
||||
from typing import Dict
|
||||
from abc import abstractmethod
|
||||
from typing import Dict
|
||||
|
||||
from msgspec import Struct
|
||||
|
||||
from .model import DamageInstanceWeapon
|
||||
from ....utils.excel.model import EquipmentPromotionConfig
|
||||
from ....utils.map.SR_MAP_PATH import EquipmentID2AbilityProperty
|
||||
from .model import DamageInstanceWeapon
|
||||
|
||||
|
||||
class BaseWeaponAttribute(Struct):
|
||||
|
@ -3,9 +3,9 @@ from typing import Dict, List, Union
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils import merge_attribute
|
||||
from ..Base.model import DamageInstanceRelic
|
||||
from ..Base.RelicBase import SingleRelic, BaseRelicSetSkill
|
||||
from ..Base.RelicBase import BaseRelicSetSkill, SingleRelic
|
||||
from ..utils import merge_attribute
|
||||
|
||||
|
||||
class Relic101(BaseRelicSetSkill):
|
||||
@ -311,7 +311,7 @@ class Relic113(BaseRelicSetSkill):
|
||||
self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float]
|
||||
):
|
||||
'''
|
||||
当装备者受到攻击或被我方目标消耗生命值后,暴击率提高8%,持续2回合,该效果最多叠加2层。
|
||||
当装备者受到攻击或被我方目标消耗生命值后, 暴击率提高8%, 持续2回合, 该效果最多叠加2层。
|
||||
'''
|
||||
logger.info('Relic113 check success')
|
||||
return True
|
||||
@ -337,7 +337,7 @@ class Relic114(BaseRelicSetSkill):
|
||||
self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float]
|
||||
):
|
||||
'''
|
||||
当装备者对我方目标施放终结技时,我方全体速度提高12%,持续1回合,该效果无法叠加。
|
||||
当装备者对我方目标施放终结技时, 我方全体速度提高12%, 持续1回合, 该效果无法叠加。
|
||||
'''
|
||||
logger.info('Relic114 check success')
|
||||
return True
|
||||
@ -573,7 +573,7 @@ class Relic309(BaseRelicSetSkill):
|
||||
self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float]
|
||||
):
|
||||
'''
|
||||
当装备者的当前暴击率大于等于70%时,普攻和战技造成的伤害提高20%。
|
||||
当装备者的当前暴击率大于等于70%时, 普攻和战技造成的伤害提高20%。
|
||||
'''
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr['CriticalChanceBase'] >= 0.7:
|
||||
@ -600,7 +600,7 @@ class Relic310(BaseRelicSetSkill):
|
||||
self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float]
|
||||
):
|
||||
'''
|
||||
当装备者的效果抵抗大于等于30%时,我方全体暴击伤害提高10%。
|
||||
当装备者的效果抵抗大于等于30%时, 我方全体暴击伤害提高10%。
|
||||
'''
|
||||
merged_attr = await merge_attribute(base_attr, attribute_bonus)
|
||||
if merged_attr['StatusResistanceBase'] >= 0.3:
|
||||
|
@ -2,12 +2,12 @@ from typing import List, Union
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from .Avatar.Avatar import Avatar
|
||||
from .Weapon.Weapon import Weapon
|
||||
from .utils import merge_attribute
|
||||
from ..mono.Character import Character
|
||||
from .Avatar.Avatar import Avatar
|
||||
from .Base.model import DamageInstance
|
||||
from .Relic.Relic import RelicSet, SingleRelic
|
||||
from .utils import merge_attribute
|
||||
from .Weapon.Weapon import Weapon
|
||||
|
||||
|
||||
class RoleInstance:
|
||||
@ -153,8 +153,7 @@ class RoleInstance:
|
||||
skill_multiplier = skill_multiplier + 0.9
|
||||
else:
|
||||
skill_multiplier = skill_multiplier + 0.3
|
||||
else:
|
||||
if self.raw_data.avatar.id_ in [1213, 1201]:
|
||||
elif self.raw_data.avatar.id_ in [1213, 1201]:
|
||||
skill_multiplier = self.avatar.Normalnum(skill_type)
|
||||
skill_type = 'Normal'
|
||||
elif self.raw_data.avatar.id_ == 1005:
|
||||
@ -201,7 +200,7 @@ class RoleInstance:
|
||||
# 攻击加成
|
||||
if attr.__contains__('AttackAddedRatio'):
|
||||
attr_name = attr.split('AttackAddedRatio')[0]
|
||||
if attr_name == skill_type or attr_name == skill_info[3]:
|
||||
if attr_name in (skill_type, skill_info[3]):
|
||||
attack_added_ratio = self.attribute_bonus.get(
|
||||
'AttackAddedRatio', 0
|
||||
)
|
||||
@ -211,7 +210,7 @@ class RoleInstance:
|
||||
# 效果命中加成
|
||||
if attr.__contains__('StatusProbabilityBase'):
|
||||
attr_name = attr.split('StatusProbabilityBase')[0]
|
||||
if attr_name == skill_type or attr_name == skill_info[3]:
|
||||
if attr_name in (skill_type, skill_info[3]):
|
||||
status_probability = self.attribute_bonus.get(
|
||||
'StatusProbabilityBase', 0
|
||||
)
|
||||
@ -303,10 +302,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('ResistancePenetration'):
|
||||
attr_name = attr.split('ResistancePenetration')[0]
|
||||
if (
|
||||
attr_name == self.avatar.avatar_element
|
||||
or attr_name == 'AllDamage'
|
||||
):
|
||||
if attr_name in (self.avatar.avatar_element, 'AllDamage'):
|
||||
# 先默认触发
|
||||
enemy_status_resistance = merged_attr[attr]
|
||||
resistance_area = 1.0 - (0 - enemy_status_resistance)
|
||||
@ -345,7 +341,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('DmgAdd'):
|
||||
attr_name = attr.split('DmgAdd')[0]
|
||||
if attr_name == skill_type or attr_name == skill_info[3]:
|
||||
if attr_name in (skill_type, skill_info[3]):
|
||||
logger.info(
|
||||
f'{attr} 对 {skill_type} 有 {merged_attr[attr]} 伤害加成'
|
||||
)
|
||||
@ -356,10 +352,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('AddedRatio'):
|
||||
attr_name = attr.split('AddedRatio')[0]
|
||||
if (
|
||||
attr_name == self.avatar.avatar_element
|
||||
or attr_name == 'AllDamage'
|
||||
):
|
||||
if attr_name in (self.avatar.avatar_element, 'AllDamage'):
|
||||
logger.info(
|
||||
f'{attr} 对 {self.avatar.avatar_element} '
|
||||
f'有 {merged_attr[attr]} 伤害加成'
|
||||
@ -378,7 +371,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('_DmgRatio'):
|
||||
skill_name = attr.split('_')[0]
|
||||
if skill_name == skill_type or skill_name == skill_info[3]:
|
||||
if skill_name in (skill_type, skill_info[3]):
|
||||
logger.info(
|
||||
f'{attr} 对 {skill_type} 有 {merged_attr[attr]} 易伤加成'
|
||||
)
|
||||
@ -398,10 +391,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('_CriticalDamageBase'):
|
||||
skill_name = attr.split('_')[0]
|
||||
if (
|
||||
skill_name == skill_type
|
||||
or skill_name == skill_info[3]
|
||||
):
|
||||
if skill_name in (skill_type, skill_info[3]):
|
||||
logger.info(
|
||||
f'{attr} 对 {skill_type} 有 '
|
||||
f'{merged_attr[attr]} 爆伤加成'
|
||||
@ -418,7 +408,7 @@ class RoleInstance:
|
||||
for attr in merged_attr:
|
||||
if attr.__contains__('_CriticalChance'):
|
||||
skill_name = attr.split('_')[0]
|
||||
if skill_name == skill_type or skill_name == skill_info[3]:
|
||||
if skill_name in (skill_type, skill_info[3]):
|
||||
logger.info(
|
||||
f'{attr} 对 {skill_type} 有 '
|
||||
f'{merged_attr[attr]} 暴击加成'
|
||||
|
@ -1,9 +1,9 @@
|
||||
import json
|
||||
from typing import Dict
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from ..Base.WeaponBase import BaseWeapon
|
||||
from ..Base.model import DamageInstanceWeapon
|
||||
from ..Base.WeaponBase import BaseWeapon
|
||||
|
||||
path = Path(__file__).parent.parent
|
||||
with Path.open(path / 'Excel' / 'weapon_effect.json', encoding='utf-8') as f:
|
||||
@ -65,7 +65,7 @@ class Swordplay(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者多次击中同一敌方目标时,每次造成的伤害提高8%,该效果最多叠加5层
|
||||
# 当装备者多次击中同一敌方目标时, 每次造成的伤害提高8%, 该效果最多叠加5层
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -392,7 +392,7 @@ class SeriousnessofBreakfast(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者造成伤害提高12%
|
||||
# 每消灭1个敌方目标,装备者的攻击力提高4%,该效果最多叠加3层。
|
||||
# 每消灭1个敌方目标, 装备者的攻击力提高4%, 该效果最多叠加3层。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -427,8 +427,8 @@ class NightontheMilkyWay(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 场上每有1个敌方目标,使装备者的攻击力提高9%
|
||||
# 敌方目标的弱点被击破时,装备者造成的伤害提高30%
|
||||
# 场上每有1个敌方目标, 使装备者的攻击力提高9%
|
||||
# 敌方目标的弱点被击破时, 装备者造成的伤害提高30%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -466,7 +466,7 @@ class TodayIsAnotherPeacefulDay(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 根据装备者的能量上限,提高装备者造成的伤害:每点能量提高0.2%,最多计入160点
|
||||
# 根据装备者的能量上限, 提高装备者造成的伤害: 每点能量提高0.2%, 最多计入160点
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -494,7 +494,7 @@ class GeniusesRepose(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者攻击力提高16%
|
||||
# 当装备者消灭敌方目标后,暴击伤害提高24%
|
||||
# 当装备者消灭敌方目标后, 暴击伤害提高24%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -546,7 +546,7 @@ class TheBirthoftheSelf(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 追加攻击造成的伤害提高30%
|
||||
# 若该敌方目标当前生命值百分比小于等于50%,则追加攻击造成的伤害额外提高30%。
|
||||
# 若该敌方目标当前生命值百分比小于等于50%, 则追加攻击造成的伤害额外提高30%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -606,7 +606,7 @@ class BrighterThantheSun(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者的暴击率提高18%
|
||||
# 当装备者施放普攻时,获得1层【龙吟】,持续2回合。
|
||||
# 当装备者施放普攻时, 获得1层【龙吟】, 持续2回合。
|
||||
# 每层【龙吟】使装备者的攻击力提高18%,【龙吟】最多叠加2层
|
||||
return True
|
||||
|
||||
@ -635,8 +635,8 @@ class TheUnreachableSide(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者的暴击率提高30%,生命上限提高30%
|
||||
# 当装备者受到攻击或装备者消耗自身生命值后,造成的伤害提高40%
|
||||
# 装备者的暴击率提高30%, 生命上限提高30%
|
||||
# 当装备者受到攻击或装备者消耗自身生命值后, 造成的伤害提高40%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -667,7 +667,7 @@ class SomethingIrreplaceable(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者的攻击力提高24%
|
||||
# 当装备者消灭敌方目标或受到攻击后,造成的伤害提高24%
|
||||
# 当装备者消灭敌方目标或受到攻击后, 造成的伤害提高24%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -697,8 +697,8 @@ class OntheFallofanAeon(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者施放攻击时,使装备者本场战斗中的攻击力提高8%,该效果最多叠加4层
|
||||
# 当装备者击破敌方目标弱点后,造成的伤害提高12%
|
||||
# 当装备者施放攻击时, 使装备者本场战斗中的攻击力提高8%, 该效果最多叠加4层
|
||||
# 当装备者击破敌方目标弱点后, 造成的伤害提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -753,7 +753,7 @@ class NowheretoRun(BaseWeapon):
|
||||
return attribute_bonus
|
||||
|
||||
|
||||
# 汪!散步时间!
|
||||
# 汪! 散步时间!
|
||||
class WoofWalkTime(BaseWeapon):
|
||||
weapon_base_attributes: Dict
|
||||
|
||||
@ -799,7 +799,7 @@ class UndertheBlueSky(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者攻击力提高16%
|
||||
# 当装备者消灭敌方目标后,暴击率提高12%
|
||||
# 当装备者消灭敌方目标后, 暴击率提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -833,7 +833,7 @@ class TheMolesWelcomeYou(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者施放普攻、战技或终结技攻击敌方目标后,
|
||||
# 装备者施放普攻、战技或终结技攻击敌方目标后,
|
||||
# 分别获取一层【淘气值】。每层使装备者的攻击力提高12%。
|
||||
return True
|
||||
|
||||
@ -862,7 +862,7 @@ class IncessantRain(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者对同时处于大于等于3个负面效果的敌方目标造成伤害时,暴击率提高12%
|
||||
# 当装备者对同时处于大于等于3个负面效果的敌方目标造成伤害时, 暴击率提高12%
|
||||
# 持有【以太编码】的目标受到的伤害提高12%
|
||||
return True
|
||||
|
||||
@ -899,7 +899,7 @@ class PatienceIsAllYouNeed(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者造成的伤害提高24%
|
||||
# 装备者每次施放攻击后,速度提高4.8%,最多叠加3层。
|
||||
# 装备者每次施放攻击后, 速度提高4.8%, 最多叠加3层。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -938,8 +938,8 @@ class IntheNameoftheWorld(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者对陷入负面效果的敌方目标造成的伤害提高24%
|
||||
# 当装备者施放战技时,装备者此次攻击的效果命中提高18%
|
||||
# 当装备者施放战技时,装备者此次攻击的攻击力提高24%。
|
||||
# 当装备者施放战技时, 装备者此次攻击的效果命中提高18%
|
||||
# 当装备者施放战技时, 装备者此次攻击的攻击力提高24%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -990,7 +990,7 @@ class SolitaryHealing(BaseWeapon):
|
||||
|
||||
async def check(self):
|
||||
# 使装备者的击破特攻提高20%
|
||||
# 装备者施放终结技时,使装备者造成的持续伤害提高24%
|
||||
# 装备者施放终结技时, 使装备者造成的持续伤害提高24%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1010,7 +1010,7 @@ class BeforetheTutorialMissionStarts(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者攻击防御力被降低的敌方目标后,恢复4点能量。
|
||||
# 当装备者攻击防御力被降低的敌方目标后, 恢复4点能量。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1030,7 +1030,7 @@ class WeWillMeetAgain(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者施放普攻或战技后,
|
||||
# 装备者施放普攻或战技后,
|
||||
# 对随机1个受到攻击的敌方目标造成等同于自身48%攻击力的附加伤害。
|
||||
pass
|
||||
|
||||
@ -1129,7 +1129,7 @@ class GoodNightandSleepWell(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 敌方目标每承受1个负面效果,装备者对其造成的伤害提高12%,最多叠加3层
|
||||
# 敌方目标每承受1个负面效果, 装备者对其造成的伤害提高12%, 最多叠加3层
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1159,7 +1159,7 @@ class SheAlreadyShutHerEyes(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者的生命值降低时,使我方全体造成的伤害提高15%
|
||||
# 当装备者的生命值降低时, 使我方全体造成的伤害提高15%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1189,7 +1189,7 @@ class MomentofVictory(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者受到攻击后,防御力额外提高24%
|
||||
# 当装备者受到攻击后, 防御力额外提高24%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1237,7 +1237,7 @@ class ThisIsMe(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者施放终结技时造成的伤害值提高,提高数值等同于装备者防御力的60%
|
||||
# 装备者施放终结技时造成的伤害值提高, 提高数值等同于装备者防御力的60%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1257,7 +1257,7 @@ class WeAreWildfire(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 战斗开始时,使我方全体受到的伤害降低8%
|
||||
# 战斗开始时, 使我方全体受到的伤害降低8%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1277,7 +1277,7 @@ class TrendoftheUniversalMarket(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者受到攻击后,有100%的基础概率使敌方目标陷入灼烧状态,
|
||||
# 当装备者受到攻击后, 有100%的基础概率使敌方目标陷入灼烧状态,
|
||||
# 每回合造成等同于装备者40%防御力的持续伤害
|
||||
pass
|
||||
|
||||
@ -1298,7 +1298,7 @@ class LandausChoice(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者受到攻击的概率提高,同时受到的伤害降低16%。
|
||||
# 装备者受到攻击的概率提高, 同时受到的伤害降低16%。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1318,7 +1318,7 @@ class DayOneofMyNewLife(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 进入战斗后,使我方全体的全属性抗性提高8%
|
||||
# 进入战斗后, 使我方全体的全属性抗性提高8%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1338,7 +1338,7 @@ class Pioneering(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 进入战斗后,使我方全体的全属性抗性提高8%
|
||||
# 进入战斗后, 使我方全体的全属性抗性提高8%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1358,7 +1358,7 @@ class Defense(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 进入战斗后,使我方全体的全属性抗性提高8%
|
||||
# 进入战斗后, 使我方全体的全属性抗性提高8%
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1378,7 +1378,7 @@ class Amber(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者当前生命值百分比小于50%时,其防御力额外提高16%。
|
||||
# 当装备者当前生命值百分比小于50%时, 其防御力额外提高16%。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1406,7 +1406,7 @@ class MutualDemise(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 装备者当前生命值百分比小于80%时,暴击率提高12%
|
||||
# 装备者当前生命值百分比小于80%时, 暴击率提高12%
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1492,7 +1492,7 @@ class HiddenShadow(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 施放战技后,使装备者的下一次普攻对敌方目标造成等同于自身60%攻击力的附加伤害。
|
||||
# 施放战技后, 使装备者的下一次普攻对敌方目标造成等同于自身60%攻击力的附加伤害。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1542,7 +1542,7 @@ class Void(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 战斗开始时,使装备者的效果命中提高20%,持续3回合。
|
||||
# 战斗开始时, 使装备者的效果命中提高20%, 持续3回合。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1572,7 +1572,7 @@ class Sagacity(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当装备者施放终结技时,攻击力提高24%,持续2回合。
|
||||
# 当装备者施放终结技时, 攻击力提高24%, 持续2回合。
|
||||
return True
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1646,9 +1646,9 @@ class Thisbodyisasword(BaseWeapon):
|
||||
super().__init__(weapon)
|
||||
|
||||
async def check(self):
|
||||
# 当队友受到攻击或消耗生命值后,装备者获得1层【月蚀】,
|
||||
# 当队友受到攻击或消耗生命值后, 装备者获得1层【月蚀】,
|
||||
# 最多叠加3层。每层【月蚀】使装备者下一次攻击造成的伤害提高14%。
|
||||
# 叠满3层时,额外使该次攻击无视目标12%的防御力。该效果在装备者施放攻击后解除。
|
||||
# 叠满3层时, 额外使该次攻击无视目标12%的防御力。该效果在装备者施放攻击后解除。
|
||||
pass
|
||||
|
||||
async def weapon_ability(
|
||||
@ -1673,11 +1673,11 @@ class Thisbodyisasword(BaseWeapon):
|
||||
attribute_bonus[
|
||||
'AllResistancePenetration'
|
||||
] = resistance_penetration + (
|
||||
(
|
||||
|
||||
weapon_effect['23014']['Param']['ResistancePenetration'][
|
||||
self.weapon_rank - 1
|
||||
]
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
return attribute_bonus
|
||||
@ -1859,5 +1859,4 @@ class Weapon:
|
||||
if weapon.id_ == 20000:
|
||||
return Arrows(weapon)
|
||||
raise ValueError(f'未知武器id: {weapon.id_}')
|
||||
else:
|
||||
raise ValueError(f'不支持的武器种类: {weapon.id_}')
|
||||
|
@ -1,28 +1,28 @@
|
||||
import re
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Dict, Tuple, Union, Optional
|
||||
from typing import Dict, Optional, Tuple, Union
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from .to_data import api_to_dict
|
||||
from .draw_char_img import draw_char_img
|
||||
from ..utils.error_reply import CHAR_HINT
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from ..utils.excel.model import EquipmentPromotionConfig
|
||||
from ..utils.map.name_covert import (
|
||||
alias_to_char_name,
|
||||
name_to_avatar_id,
|
||||
name_to_weapon_id,
|
||||
alias_to_char_name,
|
||||
)
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
EquipmentID2Name,
|
||||
EquipmentID2Rarity,
|
||||
rankId2Name,
|
||||
avatarId2Name,
|
||||
avatarId2EnName,
|
||||
avatarId2DamageType,
|
||||
avatarId2EnName,
|
||||
avatarId2Name,
|
||||
rankId2Name,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from .draw_char_img import draw_char_img
|
||||
from .to_data import api_to_dict
|
||||
|
||||
WEAPON_TO_INT = {
|
||||
'一': 1,
|
||||
@ -57,11 +57,9 @@ PieceName_ilst = {
|
||||
async def draw_char_info_img(raw_mes: str, sr_uid: str):
|
||||
# 获取角色名
|
||||
# msg = ' '.join(re.findall('[\u4e00-\u9fa5]+', raw_mes))
|
||||
print(raw_mes)
|
||||
_args = await get_char_args(raw_mes, sr_uid)
|
||||
if isinstance(_args, str):
|
||||
return _args
|
||||
else:
|
||||
if isinstance(_args[0], str):
|
||||
return _args[0]
|
||||
|
||||
@ -99,6 +97,8 @@ async def get_char_args(
|
||||
msg_list = msg.split('换')
|
||||
for index, part in enumerate(msg_list):
|
||||
changeuid = await get_part_uid(part, uid)
|
||||
if changeuid is None:
|
||||
return 'UID不正确噢~'
|
||||
# 判断主体
|
||||
if index == 0:
|
||||
fake_name, talent_num = await get_fake_char_str(part)
|
||||
@ -145,8 +145,6 @@ async def change_equip(
|
||||
uid: str, char_data: Dict, part: str, s: str, i: int
|
||||
) -> Dict:
|
||||
char_name = part.replace(part[-1], '').replace(uid, '')
|
||||
print(char_name)
|
||||
print(uid)
|
||||
fake_data = await get_char_data(uid, char_name)
|
||||
if isinstance(fake_data, str):
|
||||
return {}
|
||||
@ -159,7 +157,6 @@ async def change_equip(
|
||||
|
||||
|
||||
async def get_part_uid(part: str, uid: str):
|
||||
print(part)
|
||||
sr_uid = uid
|
||||
uid_data = re.findall(r'\d{9}', part)
|
||||
if uid_data:
|
||||
@ -194,6 +191,8 @@ async def get_fake_char_data(
|
||||
) -> Union[Dict, str]:
|
||||
fake_name = await alias_to_char_name(fake_name)
|
||||
original_data = await get_char_data(uid, fake_name)
|
||||
if isinstance(original_data, str):
|
||||
return original_data
|
||||
if isinstance(original_data, Dict):
|
||||
char_data['RelicInfo'] = original_data['RelicInfo']
|
||||
char_data['avatarAttributeBonus'] = original_data[
|
||||
@ -211,7 +210,7 @@ async def get_fake_char_data(
|
||||
char_data['avatarPromotion'] = original_data['avatarPromotion']
|
||||
char_data['avatarName'] = fake_name
|
||||
char_data['avatarId'] = await name_to_avatar_id(fake_name)
|
||||
en_name = avatarId2EnName(char_data['avatarId'])
|
||||
en_name: str = avatarId2EnName(char_data['avatarId']) # type: ignore
|
||||
char_data['avatarEnName'] = en_name
|
||||
if str(char_data['avatarId']) in avatarId2DamageType:
|
||||
char_data['avatarElement'] = avatarId2DamageType[
|
||||
@ -229,13 +228,13 @@ async def get_char_data(
|
||||
) -> Union[Dict, str]:
|
||||
player_path = PLAYER_PATH / str(sr_uid)
|
||||
SELF_PATH = player_path / 'SELF'
|
||||
if "开拓者" in str(char_name):
|
||||
char_name = "开拓者"
|
||||
if '开拓者' in str(char_name):
|
||||
char_name = '开拓者'
|
||||
char_id = await name_to_avatar_id(char_name)
|
||||
if char_id == '':
|
||||
char_name = await alias_to_char_name(char_name)
|
||||
if char_name is False:
|
||||
return "请输入正确的角色名"
|
||||
return '请输入正确的角色名'
|
||||
char_path = player_path / f'{char_name}.json'
|
||||
char_self_path = SELF_PATH / f'{char_name}.json'
|
||||
path = Path()
|
||||
@ -280,11 +279,9 @@ async def get_char(
|
||||
rankTemp['rankName'] = rankId2Name[str(rank_id)]
|
||||
rank_temp.append(rankTemp)
|
||||
char_data['rankList'] = rank_temp
|
||||
print(weapon)
|
||||
if weapon:
|
||||
# 处理武器
|
||||
equipmentid = await name_to_weapon_id(weapon)
|
||||
print(equipmentid)
|
||||
equipment_info = {}
|
||||
equipment_info['equipmentID'] = int(equipmentid)
|
||||
equipment_info['equipmentName'] = EquipmentID2Name[str(equipmentid)]
|
||||
|
@ -1,10 +1,10 @@
|
||||
import json
|
||||
from typing import Dict, List
|
||||
from collections import Counter
|
||||
from typing import Dict, List
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from ...utils.map.SR_MAP_PATH import RelicSetSkill, EquipmentID2AbilityProperty
|
||||
from ...utils.map.SR_MAP_PATH import EquipmentID2AbilityProperty, RelicSetSkill
|
||||
|
||||
|
||||
class Character:
|
||||
|
@ -4,13 +4,13 @@ from typing import Dict, List, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from .to_data import api_to_dict
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.fonts.first_world import fw_font_28
|
||||
from ..utils.map.SR_MAP_PATH import avatarId2Name
|
||||
from ..utils.map.name_covert import avatar_id_to_char_star
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_58
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import avatar_id_to_char_star
|
||||
from ..utils.map.SR_MAP_PATH import avatarId2Name
|
||||
from ..utils.resource.RESOURCE_PATH import CHAR_ICON_PATH, CHAR_PREVIEW_PATH
|
||||
from .to_data import api_to_dict
|
||||
|
||||
half_color = (255, 255, 255, 120)
|
||||
first_color = (29, 29, 29)
|
||||
|
@ -1,40 +1,40 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Union, Optional
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
from httpx import ReadTimeout
|
||||
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..sruid_utils.api.mihomo import MihomoData
|
||||
from ..sruid_utils.api.mihomo.models import Avatar
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from ..sruid_utils.api.mihomo.requests import get_char_card_info
|
||||
from .cal_value import cal_relic_sub_affix, cal_relic_main_affix
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.excel.model import AvatarPromotionConfig, EquipmentPromotionConfig
|
||||
from ..utils.map.SR_MAP_PATH import (
|
||||
SetId2Name,
|
||||
AvatarRankSkillUp,
|
||||
EquipmentID2Name,
|
||||
EquipmentID2Rarity,
|
||||
ItemId2Name,
|
||||
Property2Name,
|
||||
RelicId2SetId,
|
||||
EquipmentID2Name,
|
||||
AvatarRankSkillUp,
|
||||
EquipmentID2Rarity,
|
||||
rankId2Name,
|
||||
skillId2Name,
|
||||
avatarId2Name,
|
||||
skillId2Effect,
|
||||
SetId2Name,
|
||||
avatarId2DamageType,
|
||||
avatarId2EnName,
|
||||
avatarId2Name,
|
||||
avatarId2Rarity,
|
||||
characterSkillTree,
|
||||
rankId2Name,
|
||||
skillId2AttackType,
|
||||
avatarId2DamageType,
|
||||
skillId2Effect,
|
||||
skillId2Name,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from .cal_value import cal_relic_main_affix, cal_relic_sub_affix
|
||||
|
||||
|
||||
async def api_to_dict(
|
||||
sr_uid: str, sr_data: Optional[MihomoData] = None
|
||||
) -> Union[List[Dict], str]:
|
||||
"""
|
||||
'''
|
||||
:说明:
|
||||
访问Mihomo.me API并转换为StarRailUID的数据Json。
|
||||
:参数:
|
||||
@ -42,7 +42,7 @@ async def api_to_dict(
|
||||
* ``sr_data: Optional[Dict] = None``: 来自Mihomo.me的dict, 可留空。
|
||||
:返回:
|
||||
* ``刷新完成提示语: str``: 包含刷新成功的角色列表。
|
||||
"""
|
||||
'''
|
||||
if '未找到绑定的UID' in sr_uid:
|
||||
return UID_HINT
|
||||
if not sr_data:
|
||||
@ -56,7 +56,7 @@ async def api_to_dict(
|
||||
return []
|
||||
if isinstance(sr_data, Dict):
|
||||
if 'detailInfo' not in sr_data:
|
||||
return '服务器正在维护或者关闭中...\n' '检查Mihomo.me是否可以访问\n如可以访问,尝试上报Bug!'
|
||||
return '服务器正在维护或者关闭中...\n检查Mihomo.me是否可以访问\n如可以访问,尝试上报Bug!'
|
||||
elif sr_data is None:
|
||||
return []
|
||||
|
||||
@ -98,7 +98,7 @@ async def api_to_dict(
|
||||
char_id_list.append(char['avatarId'])
|
||||
|
||||
if not char_name_list:
|
||||
return f'UID: {sr_uid} 的角色展柜刷新失败!\n' '请检查UID是否正确或者角色展柜是否打开!'
|
||||
return f'UID: {sr_uid} 的角色展柜刷新失败!\n请检查UID是否正确或者角色展柜是否打开!'
|
||||
|
||||
return char_id_list
|
||||
|
||||
|
@ -2,9 +2,9 @@ from typing import Dict
|
||||
|
||||
from gsuid_core.utils.plugins_config.models import (
|
||||
GSC,
|
||||
GsStrConfig,
|
||||
GsBoolConfig,
|
||||
GsListStrConfig,
|
||||
GsStrConfig,
|
||||
)
|
||||
|
||||
CONIFG_DEFAULT: Dict[str, GSC] = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
from gsuid_core.utils.plugins_config.gs_config import StringConfig
|
||||
|
||||
from .config_default import CONIFG_DEFAULT
|
||||
from ..utils.resource.RESOURCE_PATH import CONFIG_PATH
|
||||
from .config_default import CONIFG_DEFAULT
|
||||
|
||||
srconfig = StringConfig('StarRailUID', CONFIG_PATH, CONIFG_DEFAULT)
|
||||
|
@ -1,12 +1,12 @@
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from .get_gachalogs import save_gachalogs
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_gachalogs import draw_gachalogs_img
|
||||
from .get_gachalogs import save_gachalogs
|
||||
|
||||
sv_gacha_log = SV('sr抽卡记录')
|
||||
sv_get_gachalog_by_link = SV('sr导入抽卡链接', area='DIRECT')
|
||||
|
@ -1,24 +1,17 @@
|
||||
import json
|
||||
import asyncio
|
||||
import datetime
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
draw_pic_with_ring,
|
||||
get_color_bg,
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
)
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import name_to_avatar_id, name_to_weapon_id
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
CHAR_ICON_PATH,
|
||||
)
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_20,
|
||||
sr_font_24,
|
||||
@ -26,6 +19,13 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_38,
|
||||
sr_font_40,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.map.name_covert import name_to_avatar_id, name_to_weapon_id
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
CHAR_ICON_PATH,
|
||||
PLAYER_PATH,
|
||||
WEAPON_PATH,
|
||||
)
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
EMO_PATH = Path(__file__).parent / 'texture2d' / 'emo'
|
||||
|
@ -1,9 +1,9 @@
|
||||
import json
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from urllib import parse
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional
|
||||
from urllib import parse
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
|
@ -1,10 +1,10 @@
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from .get_help import get_core_help
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .get_help import get_core_help
|
||||
|
||||
sv_sr_help = SV('sr帮助')
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
from pathlib import Path
|
||||
from typing import Dict, Union, Optional
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
import aiofiles
|
||||
from PIL import Image
|
||||
from msgspec import json as msgjson
|
||||
from gsuid_core.help.model import PluginHelp
|
||||
from gsuid_core.help.draw_plugin_help import get_help
|
||||
from gsuid_core.help.model import PluginHelp
|
||||
from msgspec import json as msgjson
|
||||
from PIL import Image
|
||||
|
||||
from ..version import StarRail_version
|
||||
from ..utils.fonts.starrail_fonts import starrail_font_origin
|
||||
from ..version import StarRail_version
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
HELP_DATA = Path(__file__).parent / 'Help.json'
|
||||
|
@ -1,13 +1,13 @@
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from .note_text import award
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_note_card import draw_note_img
|
||||
from .note_text import award
|
||||
|
||||
sv_get_monthly_data = SV('sr查询月历')
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
from datetime import datetime
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
from ..utils.fonts.starrail_fonts import sr_font_20, sr_font_28, sr_font_34
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2d'
|
||||
|
||||
@ -215,11 +215,11 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]:
|
||||
xy = ((0, 0), (2100, 2100))
|
||||
temp = -90
|
||||
if not data['month_data']['group_by']:
|
||||
pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw = ImageDraw.Draw(pie_image)
|
||||
pie_image_draw.ellipse(xy, fill=(128, 128, 128))
|
||||
else:
|
||||
pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw = ImageDraw.Draw(pie_image)
|
||||
for _index, i in enumerate(data['month_data']['group_by']):
|
||||
pie_image_draw.pieslice(
|
||||
@ -230,7 +230,7 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]:
|
||||
)
|
||||
temp = temp + (i['percent'] / 100) * 360
|
||||
# 绘制蒙版圆形
|
||||
new_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
new_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw.ellipse((150, 150, 1950, 1950), fill=(255, 255, 255, 0))
|
||||
|
||||
position = (1050, 1050)
|
||||
@ -239,7 +239,7 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]:
|
||||
img.paste(result_pie, (138, 618), result_pie)
|
||||
|
||||
if last_monthly_data:
|
||||
pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw = ImageDraw.Draw(pie_image)
|
||||
for _index, i in enumerate(
|
||||
last_monthly_data['month_data']['group_by']
|
||||
@ -252,12 +252,12 @@ async def draw_note_img(sr_uid: str) -> Union[bytes, str]:
|
||||
)
|
||||
temp = temp + (i['percent'] / 100) * 360
|
||||
else:
|
||||
pie_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw = ImageDraw.Draw(pie_image)
|
||||
pie_image_draw.ellipse(xy, fill=(128, 128, 128))
|
||||
|
||||
# 绘制蒙版圆形
|
||||
new_image = Image.new("RGBA", (2100, 2100), color=(255, 255, 255, 0))
|
||||
new_image = Image.new('RGBA', (2100, 2100), color=(255, 255, 255, 0))
|
||||
pie_image_draw.ellipse((150, 150, 1950, 1950), fill=(255, 255, 255, 0))
|
||||
|
||||
position = (1050, 1050)
|
||||
|
@ -1,9 +1,9 @@
|
||||
from datetime import datetime
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
month_im = """==============
|
||||
month_im = '''==============
|
||||
SR_UID:{}
|
||||
==============
|
||||
本日获取星琼:{}
|
||||
@ -19,7 +19,7 @@ SR_UID:{}
|
||||
上月获取星轨通票&星轨专票:{}
|
||||
==============
|
||||
星琼收入组成:
|
||||
{}=============="""
|
||||
{}=============='''
|
||||
|
||||
|
||||
async def award(uid) -> str:
|
||||
|
@ -1,10 +1,10 @@
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.resource.download_all_resource import download_all_resource
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
|
||||
sv_sr_download_config = SV('sr下载资源', pm=1)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.utils.error_reply import UID_HINT
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
|
@ -1,55 +1,55 @@
|
||||
import math
|
||||
from pathlib import Path
|
||||
from typing import List, Union, Optional
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
from gsuid_core.utils.image.image_tools import (
|
||||
get_qq_avatar,
|
||||
draw_pic_with_ring,
|
||||
get_qq_avatar,
|
||||
)
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from .utils import get_icon
|
||||
from ..sruid_utils.api.mys.models import (
|
||||
LocustBlocks,
|
||||
RogueAvatar,
|
||||
RogueBuffitems,
|
||||
RogueMiracles,
|
||||
)
|
||||
from ..utils.convert import GsCookie
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_28,
|
||||
sr_font_34,
|
||||
sr_font_42,
|
||||
)
|
||||
from ..sruid_utils.api.mys.models import (
|
||||
RogueAvatar,
|
||||
LocustBlocks,
|
||||
RogueMiracles,
|
||||
RogueBuffitems,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from .utils import get_icon
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
white_color = (255, 255, 255)
|
||||
gray_color = (175, 175, 175)
|
||||
img_bg = Image.open(TEXT_PATH / 'bg.jpg')
|
||||
level_cover = Image.open(TEXT_PATH / 'level_cover.png').convert("RGBA")
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'char4_bg.png').convert("RGBA")
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'char5_bg.png').convert("RGBA")
|
||||
content_center = Image.open(TEXT_PATH / 'center.png').convert("RGBA")
|
||||
level_cover = Image.open(TEXT_PATH / 'level_cover.png').convert('RGBA')
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'char4_bg.png').convert('RGBA')
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'char5_bg.png').convert('RGBA')
|
||||
content_center = Image.open(TEXT_PATH / 'center.png').convert('RGBA')
|
||||
|
||||
elements = {
|
||||
"ice": Image.open(TEXT_PATH / "IconNatureColorIce.png").convert("RGBA"),
|
||||
"fire": Image.open(TEXT_PATH / "IconNatureColorFire.png").convert("RGBA"),
|
||||
"imaginary": Image.open(
|
||||
TEXT_PATH / "IconNatureColorImaginary.png"
|
||||
).convert("RGBA"),
|
||||
"quantum": Image.open(TEXT_PATH / "IconNatureColorQuantum.png").convert(
|
||||
"RGBA"
|
||||
'ice': Image.open(TEXT_PATH / 'IconNatureColorIce.png').convert('RGBA'),
|
||||
'fire': Image.open(TEXT_PATH / 'IconNatureColorFire.png').convert('RGBA'),
|
||||
'imaginary': Image.open(
|
||||
TEXT_PATH / 'IconNatureColorImaginary.png'
|
||||
).convert('RGBA'),
|
||||
'quantum': Image.open(TEXT_PATH / 'IconNatureColorQuantum.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"lightning": Image.open(TEXT_PATH / "IconNatureColorThunder.png").convert(
|
||||
"RGBA"
|
||||
'lightning': Image.open(TEXT_PATH / 'IconNatureColorThunder.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"wind": Image.open(TEXT_PATH / "IconNatureColorWind.png").convert("RGBA"),
|
||||
"physical": Image.open(TEXT_PATH / "IconNaturePhysical.png").convert(
|
||||
"RGBA"
|
||||
'wind': Image.open(TEXT_PATH / 'IconNatureColorWind.png').convert('RGBA'),
|
||||
'physical': Image.open(TEXT_PATH / 'IconNaturePhysical.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
}
|
||||
|
||||
@ -304,17 +304,15 @@ async def draw_rogue_img(
|
||||
return '世界不能大于第七世界!'
|
||||
if floor not in detail_list:
|
||||
return '你还没有挑战该模拟宇宙!'
|
||||
else:
|
||||
if schedule_type == '3':
|
||||
elif schedule_type == '3':
|
||||
if raw_rogue_data['current_record']['basic']['finish_cnt'] == 0:
|
||||
return '你还没有挑战本期模拟宇宙!\n' '可以使用[sr上期模拟宇宙]命令查询上期~'
|
||||
else:
|
||||
if raw_rogue_data['last_record']['basic']['finish_cnt'] == 0:
|
||||
return '你还没有挑战上期模拟宇宙!\n' '可以使用[sr模拟宇宙]命令查询本期~'
|
||||
return '你还没有挑战本期模拟宇宙!\n可以使用[sr上期模拟宇宙]命令查询上期~'
|
||||
elif raw_rogue_data['last_record']['basic']['finish_cnt'] == 0:
|
||||
return '你还没有挑战上期模拟宇宙!\n可以使用[sr模拟宇宙]命令查询本期~'
|
||||
|
||||
# 获取背景图片各项参数
|
||||
based_w = 900
|
||||
img = Image.new("RGB", (based_w, based_h), (10, 18, 49))
|
||||
img = Image.new('RGB', (based_w, based_h), (10, 18, 49))
|
||||
img.paste(img_bg, (0, 0))
|
||||
# img = img.crop((0, 0, based_w, based_h))
|
||||
rogue_title = Image.open(TEXT_PATH / 'head.png')
|
||||
@ -389,31 +387,31 @@ async def draw_rogue_img(
|
||||
for index_floor, detail in enumerate(rogue_detail):
|
||||
if floor:
|
||||
if floor == detail['progress']:
|
||||
index_floor = 0
|
||||
index_floor = 0 # noqa: PLW2901
|
||||
else:
|
||||
continue
|
||||
|
||||
if detail['detail_h'] is None:
|
||||
continue
|
||||
|
||||
floor_pic = Image.open(TEXT_PATH / 'detail_bg.png').convert("RGBA")
|
||||
floor_pic = Image.open(TEXT_PATH / 'detail_bg.png').convert('RGBA')
|
||||
floor_pic = floor_pic.resize((900, detail['detail_h']))
|
||||
|
||||
floor_top_pic = Image.open(TEXT_PATH / 'floor_bg_top.png').convert(
|
||||
"RGBA"
|
||||
'RGBA'
|
||||
)
|
||||
floor_pic.paste(floor_top_pic, (0, 0), floor_top_pic)
|
||||
|
||||
floor_center_pic = Image.open(
|
||||
TEXT_PATH / 'floor_bg_center.png'
|
||||
).convert("RGBA")
|
||||
).convert('RGBA')
|
||||
floor_center_pic = floor_center_pic.resize(
|
||||
(900, detail['detail_h'] - 170)
|
||||
)
|
||||
floor_pic.paste(floor_center_pic, (0, 100), floor_center_pic)
|
||||
|
||||
floor_bot_pic = Image.open(TEXT_PATH / 'floor_bg_bot.png').convert(
|
||||
"RGBA"
|
||||
'RGBA'
|
||||
)
|
||||
floor_pic.paste(
|
||||
floor_bot_pic, (0, detail['detail_h'] - 70), floor_bot_pic
|
||||
@ -602,7 +600,7 @@ async def draw_rogue_locust_img(
|
||||
|
||||
# 获取背景图片各项参数
|
||||
based_w = 900
|
||||
img = Image.new("RGB", (based_w, based_h), (10, 18, 49))
|
||||
img = Image.new('RGB', (based_w, based_h), (10, 18, 49))
|
||||
img.paste(img_bg, (0, 0))
|
||||
# img = img.crop((0, 0, based_w, based_h))
|
||||
rogue_title = Image.open(TEXT_PATH / 'head.png')
|
||||
@ -674,28 +672,28 @@ async def draw_rogue_locust_img(
|
||||
'mm',
|
||||
)
|
||||
|
||||
for index_floor, detail in enumerate(rogue_detail):
|
||||
for _, detail in enumerate(rogue_detail):
|
||||
if detail['detail_h'] is None:
|
||||
continue
|
||||
|
||||
floor_pic = Image.open(TEXT_PATH / 'detail_bg.png').convert("RGBA")
|
||||
floor_pic = Image.open(TEXT_PATH / 'detail_bg.png').convert('RGBA')
|
||||
floor_pic = floor_pic.resize((900, detail['detail_h']))
|
||||
|
||||
floor_top_pic = Image.open(TEXT_PATH / 'floor_bg_top.png').convert(
|
||||
"RGBA"
|
||||
'RGBA'
|
||||
)
|
||||
floor_pic.paste(floor_top_pic, (0, 0), floor_top_pic)
|
||||
|
||||
floor_center_pic = Image.open(
|
||||
TEXT_PATH / 'floor_bg_center.png'
|
||||
).convert("RGBA")
|
||||
).convert('RGBA')
|
||||
floor_center_pic = floor_center_pic.resize(
|
||||
(900, detail['detail_h'] - 170)
|
||||
)
|
||||
floor_pic.paste(floor_center_pic, (0, 100), floor_center_pic)
|
||||
|
||||
floor_bot_pic = Image.open(TEXT_PATH / 'floor_bg_bot.png').convert(
|
||||
"RGBA"
|
||||
'RGBA'
|
||||
)
|
||||
floor_pic.paste(
|
||||
floor_bot_pic, (0, detail['detail_h'] - 70), floor_bot_pic
|
||||
@ -723,7 +721,7 @@ async def draw_rogue_locust_img(
|
||||
sr_font_22,
|
||||
'lm',
|
||||
)
|
||||
if detail["fury"]["type"] == 1:
|
||||
if detail['fury']['type'] == 1:
|
||||
floor_pic_draw.text(
|
||||
(800, 120),
|
||||
f'扰动等级:{detail["fury"]["point"]}',
|
||||
|
@ -2,11 +2,11 @@ from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
|
||||
from PIL import Image
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
from PIL import Image
|
||||
|
||||
T = TypeVar("T")
|
||||
T = TypeVar('T')
|
||||
|
||||
ROLEINFO_PATH = get_res_path() / 'StarRailUID' / 'roleinfo'
|
||||
ROLEINFO_PATH.mkdir(parents=True, exist_ok=True)
|
||||
@ -21,6 +21,6 @@ async def get_icon(url: str) -> Image.Image:
|
||||
async with ClientSession() as client:
|
||||
async with client.get(url) as resp:
|
||||
content = await resp.read()
|
||||
with Path.open(path, "wb") as f:
|
||||
with Path.open(path, 'wb') as f:
|
||||
f.write(content)
|
||||
return Image.open(BytesIO(content)).convert("RGBA")
|
||||
return Image.open(BytesIO(content)).convert('RGBA')
|
||||
|
@ -1,9 +1,9 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
|
@ -1,15 +1,15 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Union, Optional
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.utils.error_reply import get_error
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from ..sruid_utils.api.mys.models import AvatarListItem, RoleBasicInfo, Stats
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_36
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.mys_api import mys_api
|
||||
from .utils import get_icon, wrap_list
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.fonts.starrail_fonts import sr_font_24, sr_font_30, sr_font_36
|
||||
from ..sruid_utils.api.mys.models import Stats, RoleBasicInfo, AvatarListItem
|
||||
|
||||
TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||
|
||||
@ -17,11 +17,11 @@ bg1 = Image.open(TEXT_PATH / 'bg1.png')
|
||||
bg2 = Image.open(TEXT_PATH / 'bg2.png')
|
||||
bg3 = Image.open(TEXT_PATH / 'bg3.png')
|
||||
user_avatar = (
|
||||
Image.open(TEXT_PATH / "200101.png").resize((220, 220)).convert("RGBA")
|
||||
Image.open(TEXT_PATH / '200101.png').resize((220, 220)).convert('RGBA')
|
||||
)
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'rarity4_bg.png').convert("RGBA")
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'rarity5_bg.png').convert("RGBA")
|
||||
circle = Image.open(TEXT_PATH / 'char_weapon_bg.png').convert("RGBA")
|
||||
char_bg_4 = Image.open(TEXT_PATH / 'rarity4_bg.png').convert('RGBA')
|
||||
char_bg_5 = Image.open(TEXT_PATH / 'rarity5_bg.png').convert('RGBA')
|
||||
circle = Image.open(TEXT_PATH / 'char_weapon_bg.png').convert('RGBA')
|
||||
|
||||
bg_color = (248, 248, 248)
|
||||
white_color = (255, 255, 255)
|
||||
@ -29,20 +29,20 @@ color_color = (40, 18, 7)
|
||||
first_color = (22, 8, 31)
|
||||
|
||||
elements = {
|
||||
"ice": Image.open(TEXT_PATH / "IconNatureColorIce.png").convert("RGBA"),
|
||||
"fire": Image.open(TEXT_PATH / "IconNatureColorFire.png").convert("RGBA"),
|
||||
"imaginary": Image.open(
|
||||
TEXT_PATH / "IconNatureColorImaginary.png"
|
||||
).convert("RGBA"),
|
||||
"quantum": Image.open(TEXT_PATH / "IconNatureColorQuantum.png").convert(
|
||||
"RGBA"
|
||||
'ice': Image.open(TEXT_PATH / 'IconNatureColorIce.png').convert('RGBA'),
|
||||
'fire': Image.open(TEXT_PATH / 'IconNatureColorFire.png').convert('RGBA'),
|
||||
'imaginary': Image.open(
|
||||
TEXT_PATH / 'IconNatureColorImaginary.png'
|
||||
).convert('RGBA'),
|
||||
'quantum': Image.open(TEXT_PATH / 'IconNatureColorQuantum.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"lightning": Image.open(TEXT_PATH / "IconNatureColorThunder.png").convert(
|
||||
"RGBA"
|
||||
'lightning': Image.open(TEXT_PATH / 'IconNatureColorThunder.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
"wind": Image.open(TEXT_PATH / "IconNatureColorWind.png").convert("RGBA"),
|
||||
"physical": Image.open(TEXT_PATH / "IconNaturePhysical.png").convert(
|
||||
"RGBA"
|
||||
'wind': Image.open(TEXT_PATH / 'IconNatureColorWind.png').convert('RGBA'),
|
||||
'physical': Image.open(TEXT_PATH / 'IconNaturePhysical.png').convert(
|
||||
'RGBA'
|
||||
),
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ async def get_role_img(uid: str) -> Union[bytes, str]:
|
||||
|
||||
|
||||
def _lv(level: int) -> str:
|
||||
return f"Lv.0{level}" if level < 10 else f"Lv.{level}"
|
||||
return f'Lv.0{level}' if level < 10 else f'Lv.{level}'
|
||||
|
||||
|
||||
async def _draw_card_1(
|
||||
@ -81,7 +81,7 @@ async def _draw_card_1(
|
||||
# 写UID
|
||||
bg1_draw.text(
|
||||
(400, 165),
|
||||
f"UID {sr_uid}",
|
||||
f'UID {sr_uid}',
|
||||
font=sr_font_30,
|
||||
fill=white_color,
|
||||
anchor='mm',
|
||||
@ -184,7 +184,7 @@ async def _draw_card_2(
|
||||
for five_avatars in wrap_list(avatars, 5)
|
||||
]
|
||||
)
|
||||
img_card_2 = Image.new("RGBA", (800, len(lines) * 200))
|
||||
img_card_2 = Image.new('RGBA', (800, len(lines) * 200))
|
||||
|
||||
y = 0
|
||||
for line in lines:
|
||||
@ -202,7 +202,7 @@ async def draw_role_card(sr_uid: str) -> Union[bytes, str]:
|
||||
return get_error(role_basic_info)
|
||||
else:
|
||||
role_basic_info = {}
|
||||
role_basic_info['nickname'] = "开拓者"
|
||||
role_basic_info['nickname'] = '开拓者'
|
||||
role_basic_info['level'] = 0
|
||||
|
||||
if isinstance(role_index, int):
|
||||
@ -231,7 +231,7 @@ async def draw_role_card(sr_uid: str) -> Union[bytes, str]:
|
||||
)
|
||||
img2: Image.Image
|
||||
height = img2.size[1]
|
||||
img = Image.new("RGBA", (800, 880 + height), bg_color)
|
||||
img = Image.new('RGBA', (800, 880 + height), bg_color)
|
||||
img.paste(img1, (0, 0))
|
||||
img.paste(img2, (0, 810))
|
||||
img.paste(bg3, (0, height + 810))
|
||||
|
@ -1,12 +1,12 @@
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
from typing import List, TypeVar, Generator
|
||||
from typing import Generator, List, TypeVar
|
||||
|
||||
from PIL import Image
|
||||
from aiohttp import ClientSession
|
||||
from gsuid_core.data_store import get_res_path
|
||||
from PIL import Image
|
||||
|
||||
T = TypeVar("T")
|
||||
T = TypeVar('T')
|
||||
|
||||
ROLEINFO_PATH = get_res_path() / 'StarRailUID' / 'roleinfo'
|
||||
ROLEINFO_PATH.mkdir(parents=True, exist_ok=True)
|
||||
@ -26,6 +26,6 @@ async def get_icon(url: str) -> Image.Image:
|
||||
async with ClientSession() as client:
|
||||
async with client.get(url) as resp:
|
||||
content = await resp.read()
|
||||
with Path.open(path, "wb") as f:
|
||||
with Path.open(path, 'wb') as f:
|
||||
f.write(content)
|
||||
return Image.open(BytesIO(content)).convert("RGBA")
|
||||
return Image.open(BytesIO(content)).convert('RGBA')
|
||||
|
@ -1,18 +1,18 @@
|
||||
import random
|
||||
import asyncio
|
||||
import random
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.aps import scheduler
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.aps import scheduler
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .sign import sign_in, daily_sign
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .sign import daily_sign, sign_in
|
||||
|
||||
SIGN_TIME = srconfig.get_config('SignTime').data
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
import random
|
||||
import asyncio
|
||||
import random
|
||||
from copy import deepcopy
|
||||
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.plugins_config.gs_config import core_plugins_config
|
||||
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
|
||||
private_msg_list = {}
|
||||
group_msg_list = {}
|
||||
@ -49,9 +49,9 @@ async def sign_in(sr_uid: str) -> str:
|
||||
if core_plugins_config.get_config('CaptchaPass').data:
|
||||
gt = sign_data['gt']
|
||||
ch = sign_data['challenge']
|
||||
vl, ch = await mys_api._pass(
|
||||
vl, ch = await mys_api._pass( # noqa: SLF001
|
||||
gt, ch, Header
|
||||
) # noqa: SLF001
|
||||
)
|
||||
if vl:
|
||||
delay = 1
|
||||
Header['x-rpc-challenge'] = ch
|
||||
@ -78,7 +78,7 @@ async def sign_in(sr_uid: str) -> str:
|
||||
break
|
||||
# 重试超过阈值
|
||||
logger.warning('[SR签到] 超过请求阈值...')
|
||||
return 'sr签到失败...出现验证码!\n' '请过段时间使用[签到]或由管理员[全部重签]或手动至米游社进行签到!'
|
||||
return 'sr签到失败...出现验证码!\n请过段时间使用[签到]或由管理员[全部重签]或手动至米游社进行签到!'
|
||||
# 签到失败
|
||||
else:
|
||||
im = 'sr签到失败!'
|
||||
|
@ -1,19 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.aps import scheduler
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.aps import scheduler
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.segment import MessageSegment
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.convert import get_uid
|
||||
from .notice import get_notice_list
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from .stamina_text import get_stamina_text
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_stamina_card import get_stamina_img
|
||||
from .notice import get_notice_list
|
||||
from .stamina_text import get_stamina_text
|
||||
|
||||
sv_get_stamina = SV('sr查询体力')
|
||||
sv_get_stamina_admin = SV('sr强制推送', pm=1)
|
||||
|
@ -4,15 +4,12 @@ from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import aiohttp
|
||||
from PIL import Image, ImageDraw
|
||||
from gsuid_core.logger import logger
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..sruid_utils.api.mys.models import Expedition
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.image.image_tools import get_simple_bg
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_22,
|
||||
sr_font_24,
|
||||
@ -20,6 +17,9 @@ from ..utils.fonts.starrail_fonts import (
|
||||
sr_font_36,
|
||||
sr_font_50,
|
||||
)
|
||||
from ..utils.image.convert import convert_img
|
||||
from ..utils.image.image_tools import get_simple_bg
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
use_widget = srconfig.get_config('WidgetResin').data
|
||||
|
||||
@ -192,8 +192,8 @@ async def draw_stamina_img(sr_uid: str) -> Image.Image:
|
||||
nickname = role_basic_info['nickname']
|
||||
level = role_basic_info['level']
|
||||
else:
|
||||
nickname = "开拓者"
|
||||
level = "0"
|
||||
nickname = '开拓者'
|
||||
level = '0'
|
||||
|
||||
# 开拓力
|
||||
stamina = daily_data['current_stamina']
|
||||
|
@ -3,10 +3,10 @@ from typing import Dict
|
||||
from gsuid_core.gss import gss
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..sruid_utils.api.mys.models import DailyNoteData
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..starrailuid_config.sr_config import srconfig
|
||||
from ..sruid_utils.api.mys.models import DailyNoteData
|
||||
|
||||
MR_NOTICE = '\n可发送[srmr]或者[sr每日]来查看更多信息!\n'
|
||||
|
||||
|
@ -2,15 +2,15 @@ from typing import List
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import get_error
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
daily_im = """*数据刷新可能存在一定延迟,请以当前游戏实际数据为准
|
||||
daily_im = '''*数据刷新可能存在一定延迟,请以当前游戏实际数据为准
|
||||
==============
|
||||
开拓力:{}/{}{}
|
||||
委托执行:
|
||||
总数/完成/上限:{}/{}/{}
|
||||
{}"""
|
||||
{}'''
|
||||
|
||||
|
||||
def seconds2hours(seconds: int) -> str:
|
||||
|
@ -3,8 +3,8 @@ import threading
|
||||
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..starrailuid_resource import startup
|
||||
from ..utils.api import get_sqla
|
||||
|
||||
|
||||
async def all_start():
|
||||
|
@ -1,12 +1,12 @@
|
||||
from typing import List
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from ..utils.message import send_diff_msg
|
||||
from ..utils.sr_prefix import PREFIX
|
||||
from .draw_user_card import get_user_card
|
||||
|
||||
sv_user_config = SV('sr用户管理', pm=2)
|
||||
|
@ -1,10 +1,10 @@
|
||||
from http.cookies import SimpleCookie
|
||||
from pathlib import Path
|
||||
from typing import Dict, List
|
||||
from http.cookies import SimpleCookie
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
from ..utils.error_reply import UID_HINT
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
pic_path = Path(__file__).parent / 'pic'
|
||||
id_list = [
|
||||
|
@ -1,5 +1,5 @@
|
||||
# from pathlib import Path
|
||||
from typing import Tuple, Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
import asyncio
|
||||
import base64
|
||||
import io
|
||||
import json
|
||||
import base64
|
||||
import asyncio
|
||||
from http.cookies import SimpleCookie
|
||||
from typing import Any, Dict, List, Tuple, Union, Literal
|
||||
from typing import Any, Dict, List, Literal, Tuple, Union
|
||||
|
||||
import qrcode
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.logger import logger
|
||||
from qrcode.constants import ERROR_CORRECT_L
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.segment import MessageSegment
|
||||
from qrcode.constants import ERROR_CORRECT_L
|
||||
|
||||
from ..utils.api import get_sqla
|
||||
from ..utils.mys_api import mys_api
|
||||
|
@ -1,22 +1,22 @@
|
||||
import re
|
||||
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.sv import SV
|
||||
from gsuid_core.utils.image.convert import convert_img
|
||||
|
||||
from ..utils.map.name_covert import (
|
||||
alias_to_char_name,
|
||||
name_to_avatar_id,
|
||||
name_to_weapon_id,
|
||||
alias_to_char_name,
|
||||
)
|
||||
from ..utils.resource.RESOURCE_PATH import (
|
||||
WIKI_ROLE_PATH,
|
||||
WIKI_RELIC_PATH,
|
||||
GUIDE_CHARACTER_PATH,
|
||||
WIKI_LIGHT_CONE_PATH,
|
||||
GUIDE_LIGHT_CONE_PATH,
|
||||
WIKI_LIGHT_CONE_PATH,
|
||||
WIKI_MATERIAL_FOR_ROLE,
|
||||
WIKI_RELIC_PATH,
|
||||
WIKI_ROLE_PATH,
|
||||
)
|
||||
|
||||
sv_sr_wiki = SV('星铁WIKI')
|
||||
@ -41,8 +41,8 @@ async def send_role_wiki_pic(bot: Bot, ev: Event):
|
||||
async def send_role_guide_pic(bot: Bot, ev: Event):
|
||||
char_name = ' '.join(re.findall('[\u4e00-\u9fa5]+', ev.text))
|
||||
await bot.logger.info(f'开始获取{char_name}图鉴')
|
||||
if "开拓者" in str(char_name):
|
||||
char_name = "开拓者"
|
||||
if '开拓者' in str(char_name):
|
||||
char_name = '开拓者'
|
||||
char_id = await name_to_avatar_id(char_name)
|
||||
if char_id == '':
|
||||
char_name = await alias_to_char_name(char_name)
|
||||
|
@ -1,14 +1,14 @@
|
||||
import re
|
||||
from typing import Tuple, Union, Optional, overload
|
||||
from typing import Optional, Tuple, Union, overload
|
||||
|
||||
from gsuid_core.bot import Bot
|
||||
from gsuid_core.models import Event
|
||||
from gsuid_core.utils.api.mys.models import IndexData
|
||||
|
||||
from .api import get_sqla
|
||||
from .mys_api import mys_api
|
||||
from .error_reply import VERIFY_HINT
|
||||
from ..sruid_utils.api.mys.models import AbyssData, RogueData, RogueLocustData
|
||||
from .api import get_sqla
|
||||
from .error_reply import VERIFY_HINT
|
||||
from .mys_api import mys_api
|
||||
|
||||
|
||||
@overload
|
||||
|
@ -2,16 +2,16 @@ from typing import Union
|
||||
|
||||
UID_HINT = '你还没有绑定过uid哦!\n请使用[sr绑定uid123456]命令绑定!'
|
||||
MYS_HINT = '你还没有绑定过mysid哦!\n请使用[绑定mys1234]命令绑定!'
|
||||
CK_HINT = """你还没有绑定过Cookie哦!发送【ck帮助】获取帮助!
|
||||
警告:绑定Cookie可能会带来未知的账号风险,请确保信任机器人管理员"""
|
||||
CHAR_HINT = '您的支援/星海同行角色没有{}的数据哦!\n请先把{}' '放入支援/星海同行中再使用【sr强制刷新】命令来缓存数据进行查询! !'
|
||||
CK_HINT = '''你还没有绑定过Cookie哦!发送【ck帮助】获取帮助!
|
||||
警告:绑定Cookie可能会带来未知的账号风险,请确保信任机器人管理员'''
|
||||
CHAR_HINT = '您的支援/星海同行角色没有{}的数据哦!\n请先把{}放入支援/星海同行中再使用【sr强制刷新】命令来缓存数据进行查询! !'
|
||||
VERIFY_HINT = '''出现验证码!
|
||||
如已绑定CK: 请至米游社软件->我的->我的角色处解锁验证码
|
||||
(可使用[gs关闭推送]命令关闭体力推送以减少出现验证码风险)
|
||||
如未绑定CK: 可联系管理员使用[gs清除缓存]命令
|
||||
'''
|
||||
SK_HINT = (
|
||||
'你还没有绑定过Stoken或者Stoken已失效~\n' '请群聊发送 [扫码登陆] 或加好友私聊Bot [添加]后跟SK格式 以绑定SK'
|
||||
'你还没有绑定过Stoken或者Stoken已失效~\n请群聊发送 [扫码登陆] 或加好友私聊Bot [添加]后跟SK格式 以绑定SK'
|
||||
)
|
||||
UPDATE_HINT = '''更新失败!更多错误信息请查看控制台...
|
||||
>> 可以尝试使用
|
||||
|
@ -3,10 +3,10 @@ from typing import Dict, List, Union
|
||||
from msgspec import Struct
|
||||
|
||||
from .read_excel import (
|
||||
RelicSubAffix,
|
||||
RelicMainAffix,
|
||||
AvatarPromotion,
|
||||
EquipmentPromotion,
|
||||
RelicMainAffix,
|
||||
RelicSubAffix,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from base64 import b64encode
|
||||
from io import BytesIO
|
||||
from pathlib import Path
|
||||
from base64 import b64encode
|
||||
from typing import Union, overload
|
||||
|
||||
import aiofiles
|
||||
@ -30,7 +30,7 @@ async def convert_img(img: Path, is_base64: bool = False) -> str:
|
||||
async def convert_img(
|
||||
img: Union[Image.Image, str, Path, bytes], is_base64: bool = False
|
||||
) -> Union[str, bytes]:
|
||||
"""
|
||||
'''
|
||||
:说明:
|
||||
将PIL.Image对象转换为bytes或者base64格式。
|
||||
:参数:
|
||||
@ -38,7 +38,7 @@ async def convert_img(
|
||||
* is_base64 (bool): 是否转换为base64格式, 不填默认转为bytes。
|
||||
:返回:
|
||||
* res: bytes对象或base64编码图片。
|
||||
"""
|
||||
'''
|
||||
if isinstance(img, Image.Image):
|
||||
img = img.convert('RGB')
|
||||
result_buffer = BytesIO()
|
||||
|
@ -1,11 +1,11 @@
|
||||
from pathlib import Path
|
||||
from typing import Union, Optional
|
||||
from typing import Optional, Union
|
||||
|
||||
from PIL import Image
|
||||
from gsuid_core.utils.image.image_tools import TEXT_PATH, CustomizeImage
|
||||
from PIL import Image
|
||||
|
||||
from ..resource.RESOURCE_PATH import CU_BG_PATH
|
||||
from ...starrailuid_config.sr_config import srconfig
|
||||
from ..resource.RESOURCE_PATH import CU_BG_PATH
|
||||
|
||||
BG_PATH = Path(__file__).parent / 'bg'
|
||||
NM_BG_PATH = BG_PATH / 'nm_bg'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Union, TypedDict
|
||||
from typing import Dict, List, TypedDict, Union
|
||||
|
||||
from msgspec import json as msgjson
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from .SR_MAP_PATH import (
|
||||
EquipmentID2Name,
|
||||
EquipmentID2EnName,
|
||||
EquipmentID2Name,
|
||||
alias_data,
|
||||
avatarId2Name,
|
||||
avatarId2Rarity,
|
||||
|
@ -1,31 +1,31 @@
|
||||
import copy
|
||||
import time
|
||||
import random
|
||||
from string import digits, ascii_letters
|
||||
from typing import Any, Dict, Union, Optional, cast
|
||||
import time
|
||||
from string import ascii_letters, digits
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
from gsuid_core.utils.api.mys_api import _MysApi
|
||||
from gsuid_core.utils.api.mys.models import MysSign, SignInfo, SignList
|
||||
from gsuid_core.utils.api.mys.tools import (
|
||||
_random_int_ds,
|
||||
generate_os_ds,
|
||||
get_web_ds_token,
|
||||
)
|
||||
from gsuid_core.utils.api.mys_api import _MysApi
|
||||
|
||||
from .api import srdbsqla
|
||||
from ..sruid_utils.api.mys.api import _API
|
||||
from ..sruid_utils.api.mys.models import (
|
||||
GachaLog,
|
||||
AbyssData,
|
||||
RogueData,
|
||||
RoleIndex,
|
||||
AvatarInfo,
|
||||
MonthlyAward,
|
||||
DailyNoteData,
|
||||
RoleBasicInfo,
|
||||
WidgetStamina,
|
||||
GachaLog,
|
||||
MonthlyAward,
|
||||
RogueData,
|
||||
RogueLocustData,
|
||||
RoleBasicInfo,
|
||||
RoleIndex,
|
||||
WidgetStamina,
|
||||
)
|
||||
from .api import srdbsqla
|
||||
|
||||
RECOGNIZE_SERVER = {
|
||||
'1': 'prod_gf_cn',
|
||||
|
@ -2,12 +2,12 @@ import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Tuple, Union
|
||||
|
||||
from msgspec import json as msgjson
|
||||
from gsuid_core.logger import logger
|
||||
from aiohttp.client import ClientSession
|
||||
from gsuid_core.logger import logger
|
||||
from msgspec import json as msgjson
|
||||
|
||||
from .download_url import download_file
|
||||
from .RESOURCE_PATH import WIKI_PATH, GUIDE_PATH, RESOURCE_PATH
|
||||
from .RESOURCE_PATH import GUIDE_PATH, RESOURCE_PATH, WIKI_PATH
|
||||
|
||||
with Path.open(
|
||||
Path(__file__).parent / 'resource_map.json', encoding='UTF-8'
|
||||
|
@ -1,11 +1,11 @@
|
||||
from typing import Tuple, Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import aiofiles
|
||||
from gsuid_core.logger import logger
|
||||
from aiohttp.client import ClientSession
|
||||
from aiohttp.client_exceptions import ClientConnectorError
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from .RESOURCE_PATH import WIKI_PATH, GUIDE_PATH, RESOURCE_PATH
|
||||
from .RESOURCE_PATH import GUIDE_PATH, RESOURCE_PATH, WIKI_PATH
|
||||
|
||||
PATHDICT = {
|
||||
'resource': RESOURCE_PATH,
|
||||
@ -20,7 +20,7 @@ async def download(
|
||||
resource_type: str,
|
||||
name: str,
|
||||
) -> Optional[Tuple[str, str, str]]:
|
||||
"""
|
||||
'''
|
||||
:说明:
|
||||
下载URL保存入目录
|
||||
:参数:
|
||||
@ -36,7 +36,7 @@ async def download(
|
||||
url: `str`
|
||||
resource_type: `str`
|
||||
name: `str`
|
||||
"""
|
||||
'''
|
||||
async with ClientSession() as sess:
|
||||
return await download_file(url, res_type, resource_type, name, sess)
|
||||
|
||||
@ -54,10 +54,10 @@ async def download_file(
|
||||
async with sess.get(url) as res:
|
||||
content = await res.read()
|
||||
except ClientConnectorError:
|
||||
logger.warning(f"[cos]{name}下载失败")
|
||||
logger.warning(f'[cos]{name}下载失败')
|
||||
return url, resource_type, name
|
||||
async with aiofiles.open(
|
||||
PATHDICT[res_type] / resource_type / name, "wb"
|
||||
PATHDICT[res_type] / resource_type / name, 'wb'
|
||||
) as f:
|
||||
await f.write(content)
|
||||
return None
|
||||
|
@ -49,3 +49,57 @@ pycln = "^2.1.2"
|
||||
nonebug = "^0.3.0"
|
||||
pytest = "^7.2.0"
|
||||
pytest-asyncio = "^0.20.3"
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
select = [
|
||||
"E", "W", # pycodestyle
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"RUF", # ruff
|
||||
"TRY", # tryceratops
|
||||
"UP",
|
||||
|
||||
# pylint
|
||||
"PLW", # Warning
|
||||
"PLR", # Refactor
|
||||
"PLE", # Error
|
||||
|
||||
"PTH", # flake8-use-pathlib
|
||||
"SLF", # flake8-self
|
||||
"RET", # flake8-return
|
||||
"RSE", # flake8-raise
|
||||
"T20", # flake8-print
|
||||
"PIE", # flake8-pie
|
||||
"ISC", # flake8-implicit-str-concat
|
||||
"C4", # flake8-comprehensions
|
||||
"COM", # flake8-commas
|
||||
"A", # flake8-builtins
|
||||
"B", # flake8-bugbear
|
||||
"ASYNC", # flake8-async
|
||||
"Q", # flake8-quotes
|
||||
]
|
||||
ignore = [
|
||||
"PLR2004",
|
||||
"A003",
|
||||
"E501",
|
||||
"COM812",
|
||||
"PLR0912",
|
||||
"PLR0915",
|
||||
"PLR0913",
|
||||
"PLR0911",
|
||||
"PLW0603", # Using the global statement
|
||||
"TRY002",
|
||||
"TRY003"
|
||||
]
|
||||
exclude = [
|
||||
"gen.py",
|
||||
".ruff_cache"
|
||||
]
|
||||
# Assume Python 3.8
|
||||
target-version = "py38"
|
||||
|
||||
[tool.ruff.flake8-quotes]
|
||||
inline-quotes = "single"
|
||||
multiline-quotes = "single"
|
||||
docstring-quotes = "single"
|
Loading…
x
Reference in New Issue
Block a user