mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-05 11:13:45 +08:00
🚧初步支持 sr强制刷新 暂时仅获取AssistAvatar
This commit is contained in:
parent
87c0c8402f
commit
0232bde7e6
6
StarRailUID/sruid_utils/api/lulu/__init__.py
Normal file
6
StarRailUID/sruid_utils/api/lulu/__init__.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
"""Lulu api 包装
|
||||||
|
"""
|
||||||
|
# from .models import EnkaData as EnkaData # noqa: F401
|
||||||
|
from .requests import get_char_card_info as get_char_card_info # noqa: F401
|
||||||
|
|
||||||
|
__all__ = ["requests"]
|
113
StarRailUID/sruid_utils/api/lulu/models.py
Normal file
113
StarRailUID/sruid_utils/api/lulu/models.py
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from typing import List, Literal, TypedDict
|
||||||
|
|
||||||
|
# https://peps.python.org/pep-0655/#usage-in-python-3-11
|
||||||
|
if sys.version_info >= (3, 11):
|
||||||
|
from typing import NotRequired
|
||||||
|
else:
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
|
|
||||||
|
class EnkaData(TypedDict):
|
||||||
|
playerInfo: PlayerInfo
|
||||||
|
avatarInfoList: List[AvatarInfoListItem]
|
||||||
|
ttl: int
|
||||||
|
uid: str
|
||||||
|
|
||||||
|
|
||||||
|
class PlayerInfo(TypedDict):
|
||||||
|
nickname: str
|
||||||
|
level: int
|
||||||
|
signature: str
|
||||||
|
worldLevel: int
|
||||||
|
nameCardId: int
|
||||||
|
finishAchievementNum: int
|
||||||
|
towerFloorIndex: int
|
||||||
|
towerLevelIndex: int
|
||||||
|
showAvatarInfoList: List[ShowAvatarInfoListItem]
|
||||||
|
showNameCardIdList: List[int]
|
||||||
|
profilePicture: ProfilePicture
|
||||||
|
|
||||||
|
|
||||||
|
class ShowAvatarInfoListItem(TypedDict):
|
||||||
|
avatarId: int
|
||||||
|
level: int
|
||||||
|
costumeId: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
|
class ProfilePicture(TypedDict):
|
||||||
|
avatarId: int
|
||||||
|
|
||||||
|
|
||||||
|
class AvatarInfoListItem(TypedDict):
|
||||||
|
avatarId: int
|
||||||
|
propMap: dict[str, PropMap]
|
||||||
|
talentIdList: List[int]
|
||||||
|
fightPropMap: dict[str, float]
|
||||||
|
skillDepotId: int
|
||||||
|
inherentProudSkillList: List[int]
|
||||||
|
skillLevelMap: dict[str, int]
|
||||||
|
equipList: List[Equip]
|
||||||
|
fetterInfo: FetterInfo
|
||||||
|
|
||||||
|
|
||||||
|
class Equip(TypedDict):
|
||||||
|
itemId: int
|
||||||
|
reliquary: Reliquary
|
||||||
|
weapon: Weapon
|
||||||
|
flat: Flat
|
||||||
|
|
||||||
|
|
||||||
|
class Flat(TypedDict):
|
||||||
|
# l10n
|
||||||
|
nameTextMapHash: str
|
||||||
|
setNameTextMapHash: str
|
||||||
|
|
||||||
|
# artifact
|
||||||
|
reliquaryMainstat: Stat
|
||||||
|
reliquarySubstats: List[Stat]
|
||||||
|
equipType: Literal[
|
||||||
|
"EQUIP_BRACER",
|
||||||
|
"EQUIP_NECKLACE",
|
||||||
|
"EQUIP_SHOES",
|
||||||
|
"EQUIP_RING",
|
||||||
|
"EQUIP_DRESS",
|
||||||
|
]
|
||||||
|
|
||||||
|
# weapon
|
||||||
|
weaponStats: List[Stat]
|
||||||
|
|
||||||
|
rankLevel: Literal[3, 4, 5]
|
||||||
|
itemType: Literal["ITEM_WEAPON", "ITEM_RELIQUARY"]
|
||||||
|
icon: str # https://enka.network/ui/{Icon}.png
|
||||||
|
|
||||||
|
|
||||||
|
class Stat(TypedDict):
|
||||||
|
mainPropId: str
|
||||||
|
appendPropId: str
|
||||||
|
statName: str
|
||||||
|
statValue: float | int
|
||||||
|
|
||||||
|
|
||||||
|
class Weapon(TypedDict):
|
||||||
|
level: int
|
||||||
|
promoteLevel: int
|
||||||
|
affixMap: dict[str, int]
|
||||||
|
|
||||||
|
|
||||||
|
class Reliquary(TypedDict):
|
||||||
|
level: int
|
||||||
|
mainPropId: int
|
||||||
|
appendPropIdList: List[int]
|
||||||
|
|
||||||
|
|
||||||
|
class PropMap(TypedDict):
|
||||||
|
type: int
|
||||||
|
ival: str # Ignore It!
|
||||||
|
val: str
|
||||||
|
|
||||||
|
|
||||||
|
class FetterInfo(TypedDict):
|
||||||
|
expLevel: int
|
16
StarRailUID/sruid_utils/api/lulu/requests.py
Normal file
16
StarRailUID/sruid_utils/api/lulu/requests.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
from httpx import AsyncClient
|
||||||
|
|
||||||
|
# from .models import EnkaData
|
||||||
|
|
||||||
|
|
||||||
|
async def get_char_card_info(uid: str) -> Dict:
|
||||||
|
async with AsyncClient(
|
||||||
|
base_url='https://mhy.fuckmys.tk',
|
||||||
|
timeout=30,
|
||||||
|
) as client:
|
||||||
|
req = await client.get(f'/sr_info/{uid}')
|
||||||
|
return req.json()
|
73
StarRailUID/starrailuid_charinfo/__init__.py
Normal file
73
StarRailUID/starrailuid_charinfo/__init__.py
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# import re
|
||||||
|
# import json
|
||||||
|
# from typing import Tuple
|
||||||
|
|
||||||
|
# from PIL import Image
|
||||||
|
from gsuid_core.sv import SV
|
||||||
|
from gsuid_core.bot import Bot
|
||||||
|
from gsuid_core.models import Event
|
||||||
|
|
||||||
|
from .to_card import enka_to_card
|
||||||
|
|
||||||
|
# from .get_enka_img import draw_char_info_img
|
||||||
|
from ..utils.convert import get_uid
|
||||||
|
from ..utils.error_reply import UID_HINT
|
||||||
|
|
||||||
|
# from ..utils.image.convert import convert_img
|
||||||
|
|
||||||
|
# from ..utils.map.GS_MAP_PATH import alias_data
|
||||||
|
# from .draw_char_rank import draw_cahrcard_list
|
||||||
|
# from .get_enka_img import draw_enka_img, get_full_char
|
||||||
|
# from ..utils.resource.RESOURCE_PATH import TEMP_PATH
|
||||||
|
|
||||||
|
sv_char_info_config = SV('sr面板设置', pm=2)
|
||||||
|
sv_get_char_info = SV('sr面板查询', priority=10)
|
||||||
|
sv_get_sr_original_pic = SV('sr查看面板原图', priority=5)
|
||||||
|
|
||||||
|
|
||||||
|
# @sv_get_char_info.on_prefix('查询')
|
||||||
|
# async def send_char_info(bot: Bot, ev: Event):
|
||||||
|
# # im = await _get_char_info(bot, ev, ev.text)
|
||||||
|
# im = ''
|
||||||
|
# if isinstance(im, str):
|
||||||
|
# await bot.send(im)
|
||||||
|
# elif isinstance(im, Tuple):
|
||||||
|
# if isinstance(im[0], Image.Image):
|
||||||
|
# img = await convert_img(im[0])
|
||||||
|
# else:
|
||||||
|
# img = im[0]
|
||||||
|
# await bot.send(img)
|
||||||
|
# if im[1]:
|
||||||
|
# with open(TEMP_PATH / f'{ev.msg_id}.jpg', 'wb') as f:
|
||||||
|
# f.write(im[1])
|
||||||
|
# elif im is None:
|
||||||
|
# return
|
||||||
|
# else:
|
||||||
|
# await bot.send('发生未知错误')
|
||||||
|
|
||||||
|
|
||||||
|
# async def _get_char_info(bot: Bot, ev: Event, text: str):
|
||||||
|
# # 获取角色名
|
||||||
|
# msg = ''.join(re.findall('[\u4e00-\u9fa5 ]', text))
|
||||||
|
# if not msg:
|
||||||
|
# return
|
||||||
|
# await bot.logger.info('开始执行[查询角色面板]')
|
||||||
|
# # 获取uid
|
||||||
|
# uid = await get_uid(bot, ev)
|
||||||
|
# if uid is None:
|
||||||
|
# return await bot.send(UID_HINT)
|
||||||
|
# await bot.logger.info('[查询角色面板]uid: {}'.format(uid))
|
||||||
|
#
|
||||||
|
# im = await draw_char_info_img(msg, uid, ev.image)
|
||||||
|
# return im
|
||||||
|
|
||||||
|
|
||||||
|
@sv_get_char_info.on_command('sr强制刷新')
|
||||||
|
async def send_card_info(bot: Bot, ev: Event):
|
||||||
|
uid = await get_uid(bot, ev)
|
||||||
|
if uid is None:
|
||||||
|
return await bot.send(UID_HINT)
|
||||||
|
await bot.logger.info('[sr强制刷新]uid: {}'.format(uid))
|
||||||
|
im = await enka_to_card(uid)
|
||||||
|
await bot.logger.info(f'UID{uid}获取角色数据成功!')
|
||||||
|
await bot.send(im)
|
34
StarRailUID/starrailuid_charinfo/cal_value.py
Normal file
34
StarRailUID/starrailuid_charinfo/cal_value.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
from mpmath import mp
|
||||||
|
|
||||||
|
from ..utils.excel.read_excel import RelicSubAffix, RelicMainAffix
|
||||||
|
|
||||||
|
mp.dps = 14
|
||||||
|
|
||||||
|
|
||||||
|
async def cal_relic_main_affix(
|
||||||
|
relic_id: int, affix_id: int, relic_type: int, relic_level: int
|
||||||
|
):
|
||||||
|
rarity = int(str(relic_id)[0]) - 1
|
||||||
|
group = str(rarity) + str(relic_type)
|
||||||
|
relic_data = RelicMainAffix[group][str(affix_id)]
|
||||||
|
assert relic_data['GroupID'] == int(group)
|
||||||
|
assert relic_data['AffixID'] == affix_id
|
||||||
|
base_value = mp.mpf(relic_data['BaseValue']['Value'])
|
||||||
|
level_add = mp.mpf(relic_data['LevelAdd']['Value'])
|
||||||
|
value = base_value + level_add * relic_level
|
||||||
|
affix_property = relic_data['Property']
|
||||||
|
return affix_property, str(value)
|
||||||
|
|
||||||
|
|
||||||
|
async def cal_relic_sub_affix(
|
||||||
|
relic_id: int, affix_id: int, cnt: int, step: int
|
||||||
|
):
|
||||||
|
rarity = int(str(relic_id)[0]) - 1
|
||||||
|
relic_data = RelicSubAffix[str(rarity)][str(affix_id)]
|
||||||
|
assert relic_data['GroupID'] == int(rarity)
|
||||||
|
assert relic_data['AffixID'] == affix_id
|
||||||
|
base_value = mp.mpf(relic_data['BaseValue']['Value'])
|
||||||
|
step_value = mp.mpf(relic_data['StepValue']['Value'])
|
||||||
|
value = base_value * cnt + step_value * step
|
||||||
|
affix_property = relic_data['Property']
|
||||||
|
return affix_property, str(value)
|
150
StarRailUID/starrailuid_charinfo/to_card.py
Normal file
150
StarRailUID/starrailuid_charinfo/to_card.py
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
# import asyncio
|
||||||
|
# from pathlib import Path
|
||||||
|
from typing import Union, Optional
|
||||||
|
|
||||||
|
#
|
||||||
|
# from PIL import Image, ImageDraw
|
||||||
|
from gsuid_core.utils.api.enka.models import EnkaData
|
||||||
|
|
||||||
|
#
|
||||||
|
from .to_data import enka_to_dict
|
||||||
|
|
||||||
|
# from ..utils.image.convert import convert_img
|
||||||
|
# from ..utils.resource.RESOURCE_PATH import CHAR_ICON_PATH
|
||||||
|
# from ..utils.fonts.genshin_fonts import gs_font_18, gs_font_58
|
||||||
|
# from ..utils.map.name_covert import name_to_avatar_id,
|
||||||
|
# avatar_id_to_char_star
|
||||||
|
#
|
||||||
|
# half_color = (255, 255, 255, 120)
|
||||||
|
# first_color = (29, 29, 29)
|
||||||
|
# second_color = (67, 61, 56)
|
||||||
|
# white_color = (247, 247, 247)
|
||||||
|
#
|
||||||
|
# MAP_PATH = Path(__file__).parent / 'map'
|
||||||
|
# TEXT_PATH = Path(__file__).parent / 'texture2D'
|
||||||
|
# char_mask = Image.open(TEXT_PATH / 'char_mask.png')
|
||||||
|
# tag = Image.open(TEXT_PATH / 'tag.png')
|
||||||
|
# footbar = Image.open(TEXT_PATH / 'footbar.png')
|
||||||
|
# pic_500 = Image.open(TEXT_PATH / '500.png')
|
||||||
|
# pic_204 = Image.open(TEXT_PATH / '204.png')
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
async def enka_to_card(
|
||||||
|
uid: str, enka_data: Optional[EnkaData] = None
|
||||||
|
) -> Union[str, bytes]:
|
||||||
|
char_data_list = await enka_to_dict(uid, enka_data)
|
||||||
|
return char_data_list
|
||||||
|
|
||||||
|
|
||||||
|
# if isinstance(char_data_list, str):
|
||||||
|
# if '服务器正在维护或者关闭中' in char_data_list:
|
||||||
|
# return await convert_img(pic_500)
|
||||||
|
# elif '未打开角色展柜' in char_data_list:
|
||||||
|
# return await convert_img(pic_204)
|
||||||
|
# else:
|
||||||
|
# return await convert_img(pic_500)
|
||||||
|
# else:
|
||||||
|
# if char_data_list == []:
|
||||||
|
# return await convert_img(pic_500)
|
||||||
|
#
|
||||||
|
# img = await draw_enka_card(uid=uid, char_data_list=char_data_list)
|
||||||
|
# return img
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# async def draw_enka_card(
|
||||||
|
# uid: str,
|
||||||
|
# char_data_list: Optional[List] = None,
|
||||||
|
# char_list: Optional[List] = None,
|
||||||
|
# ):
|
||||||
|
# if char_list:
|
||||||
|
# char_data_list = []
|
||||||
|
# for char in char_list:
|
||||||
|
# char_data_list.append(
|
||||||
|
# {'avatarName': char,
|
||||||
|
# arId': await name_to_avatar_id(char)}
|
||||||
|
# )
|
||||||
|
# line1 = f'展柜内有 {len(char_data_list)} 个角色!'
|
||||||
|
# else:
|
||||||
|
# if char_data_list is None:
|
||||||
|
# return await convert_img(
|
||||||
|
# Image.new('RGBA', (0, 1), (255, 255, 255))
|
||||||
|
# )
|
||||||
|
# else:
|
||||||
|
# line1 = '刷新成功!'
|
||||||
|
#
|
||||||
|
# ta_list[0]["avatarName"]} 命令进行查询!'
|
||||||
|
# char_num = len(char_data_list)
|
||||||
|
# if char_num <= 8:
|
||||||
|
# based_w, based_h = 1000, 240 + ((char_num + 3) // 4) * 220
|
||||||
|
# else:
|
||||||
|
# based_w, based_h = 1200, 660 + (char_num - 5) // 5 * 110
|
||||||
|
# if (char_num - 5) % 5 >= 4:
|
||||||
|
# based_h += 110
|
||||||
|
#
|
||||||
|
# img = Image.open(TEXT_PATH / 'shin-w.jpg').resize((based_w, based_h))
|
||||||
|
# img.paste(tag, (0, 0), tag)
|
||||||
|
# img.paste(footbar, ((based_w - 800) // 2, based_h - 36), footbar)
|
||||||
|
# img_draw = ImageDraw.Draw(img, 'RGBA')
|
||||||
|
#
|
||||||
|
# img_draw.text(
|
||||||
|
# (97, 98),
|
||||||
|
# line1,
|
||||||
|
# white_color,
|
||||||
|
# gs_font_58,
|
||||||
|
# 'lm',
|
||||||
|
# )
|
||||||
|
# img_draw.text(
|
||||||
|
# (99, 140),
|
||||||
|
# line2,
|
||||||
|
# white_color,
|
||||||
|
# gs_font_18,
|
||||||
|
# 'lm',
|
||||||
|
# )
|
||||||
|
# tasks = []
|
||||||
|
# for index, char_data in enumerate(char_data_list):
|
||||||
|
# tasks.append(draw_enka_char(index, img, char_data))
|
||||||
|
# await asyncio.gather(*tasks)
|
||||||
|
# img = await convert_img(img)
|
||||||
|
# return img
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# async def draw_enka_char(index: int, img: Image.Image, char_data: dict):
|
||||||
|
# char_id = char_data['avatarId']
|
||||||
|
# char_star = await avatar_id_to_char_star(str(char_id))
|
||||||
|
# char_card = Image.open(TEXT_PATH / f'char_card_{char_star}.png')
|
||||||
|
# char_img = (
|
||||||
|
# Image.open(str(CHAR_PATH / f'{char_id}.png'))
|
||||||
|
# .convert('RGBA')
|
||||||
|
# .resize((204, 204))
|
||||||
|
# )
|
||||||
|
# char_temp = Image.new('RGBA', (220, 220))
|
||||||
|
# char_temp.paste(char_img, (8, 8), char_img)
|
||||||
|
# char_card.paste(char_temp, (0, 0), char_mask)
|
||||||
|
# if index <= 7:
|
||||||
|
# if img.size[0] <= 1100:
|
||||||
|
# x = 60 + (index % 4) * 220
|
||||||
|
# else:
|
||||||
|
# x = 160 + (index % 4) * 220
|
||||||
|
# img.paste(
|
||||||
|
# char_card,
|
||||||
|
# (x, 187 + (index // 4) * 220),
|
||||||
|
# char_card,
|
||||||
|
# )
|
||||||
|
# elif index <= 12:
|
||||||
|
# img.paste(
|
||||||
|
# char_card,
|
||||||
|
# (50 + (index % 8) * 220, 296),
|
||||||
|
# char_card,
|
||||||
|
# )
|
||||||
|
# else:
|
||||||
|
# _i = index - 13
|
||||||
|
# x, y = 50 + (_i % 9) * 220, 512 + (_i // 9) * 220
|
||||||
|
# if _i % 9 >= 5:
|
||||||
|
# y += 110
|
||||||
|
# x = 160 + ((_i - 5) % 9) * 220
|
||||||
|
# img.paste(
|
||||||
|
# char_card,
|
||||||
|
# (x, y),
|
||||||
|
# char_card,
|
||||||
|
# )
|
246
StarRailUID/starrailuid_charinfo/to_data.py
Normal file
246
StarRailUID/starrailuid_charinfo/to_data.py
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
import json
|
||||||
|
from typing import List, Union, Optional
|
||||||
|
|
||||||
|
from mpmath import mp
|
||||||
|
from httpx import ReadTimeout
|
||||||
|
from gsuid_core.utils.api.enka.models import EnkaData
|
||||||
|
|
||||||
|
from ..utils.error_reply import UID_HINT
|
||||||
|
from ..utils.excel.read_excel import AvatarPromotion
|
||||||
|
from ..utils.resource.RESOURCE_PATH import PLAYER_PATH
|
||||||
|
from ..sruid_utils.api.lulu.requests import get_char_card_info
|
||||||
|
|
||||||
|
# from gsuid_core.utils.api.minigg.request import get_weapon_info
|
||||||
|
from .cal_value import cal_relic_sub_affix, cal_relic_main_affix
|
||||||
|
from ..utils.map.SR_MAP_PATH import (
|
||||||
|
SetId2Name,
|
||||||
|
Property2Name,
|
||||||
|
RelicId2SetId,
|
||||||
|
EquipmentID2Name,
|
||||||
|
rankId2Name,
|
||||||
|
skillId2Name,
|
||||||
|
skillId2Type,
|
||||||
|
avatarId2Name,
|
||||||
|
avatarId2EnName,
|
||||||
|
)
|
||||||
|
|
||||||
|
mp.dps = 14
|
||||||
|
|
||||||
|
PROP_ATTR_MAP = {
|
||||||
|
'Anemo': '44',
|
||||||
|
'Cryo': '46',
|
||||||
|
'Dendro': '43',
|
||||||
|
'Electro': '41',
|
||||||
|
'Geo': '45',
|
||||||
|
'Hydro': '42',
|
||||||
|
'Pyro': '40',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async def enka_to_dict(
|
||||||
|
sr_uid: str, sr_data: Optional[EnkaData] = None
|
||||||
|
) -> Union[List[dict], str]:
|
||||||
|
"""
|
||||||
|
:说明:
|
||||||
|
访问luluAPI并转换为StarRailUID的数据Json。
|
||||||
|
:参数:
|
||||||
|
* ``uid: str``: 玩家uid。
|
||||||
|
* ``sr_data: Optional[dict] = None``: 来自lulu的dict, 可留空。
|
||||||
|
:返回:
|
||||||
|
* ``刷新完成提示语: str``: 包含刷新成功的角色列表。
|
||||||
|
"""
|
||||||
|
if '未找到绑定的UID' in sr_uid:
|
||||||
|
return UID_HINT
|
||||||
|
if sr_data:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
sr_data = await get_char_card_info(sr_uid)
|
||||||
|
except ReadTimeout:
|
||||||
|
return '网络不太稳定...'
|
||||||
|
if isinstance(sr_data, str):
|
||||||
|
return []
|
||||||
|
if isinstance(sr_data, dict):
|
||||||
|
if 'PlayerDetailInfo' not in sr_data:
|
||||||
|
print(sr_data)
|
||||||
|
im = '服务器正在维护或者关闭中...\n检查lulu api是否可以访问\n如可以访问,尝试上报Bug!'
|
||||||
|
return im
|
||||||
|
elif sr_data is None:
|
||||||
|
return []
|
||||||
|
|
||||||
|
PlayerDetailInfo = sr_data['PlayerDetailInfo']
|
||||||
|
path = PLAYER_PATH / str(sr_uid)
|
||||||
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
|
with open(
|
||||||
|
path / '{}.json'.format(str(sr_uid)), 'w', encoding='UTF-8'
|
||||||
|
) as file:
|
||||||
|
json.dump(PlayerDetailInfo, file, ensure_ascii=False)
|
||||||
|
with open(path / 'rawData.json', 'w', encoding='UTF-8') as file:
|
||||||
|
json.dump(sr_data, file, ensure_ascii=False)
|
||||||
|
|
||||||
|
if 'PlayerDetailInfo' not in sr_data:
|
||||||
|
return f'SR_UID{sr_uid}刷新失败!未打开角色展柜!'
|
||||||
|
|
||||||
|
char_dict_list = []
|
||||||
|
char = PlayerDetailInfo['AssistAvatar']
|
||||||
|
# 处理基本信息
|
||||||
|
char_data = {
|
||||||
|
'uid': str(sr_uid),
|
||||||
|
'nickName': PlayerDetailInfo['NickName'],
|
||||||
|
'avatarId': char['AvatarID'],
|
||||||
|
'avatarName': avatarId2Name[str(char['AvatarID'])],
|
||||||
|
'avatarPromotion': char['Promotion'],
|
||||||
|
'avatarLevel': char['Level'],
|
||||||
|
'avatarSkill': [],
|
||||||
|
'RelicInfo': [],
|
||||||
|
'avatarFightProp': {},
|
||||||
|
}
|
||||||
|
avatarName = avatarId2Name[str(char['AvatarID'])]
|
||||||
|
|
||||||
|
# 处理技能
|
||||||
|
for behavior in char['BehaviorList']:
|
||||||
|
if f'{char["AvatarID"]}0' in str(behavior['BehaviorID']):
|
||||||
|
skill_temp = {}
|
||||||
|
skill_temp['skillId'] = (
|
||||||
|
char['AvatarID'] * 100 + behavior['BehaviorID'] % 10
|
||||||
|
)
|
||||||
|
skill_temp['skillName'] = skillId2Name[str(skill_temp['skillId'])]
|
||||||
|
skill_temp['skillType'] = skillId2Type[str(skill_temp['skillId'])]
|
||||||
|
skill_temp['skillLevel'] = behavior['Level']
|
||||||
|
# behavior_temp['skillIcon'] = skillId2Name['Icon'][
|
||||||
|
# behavior_temp['skillId']
|
||||||
|
# ]
|
||||||
|
char_data['avatarSkill'].append(skill_temp)
|
||||||
|
|
||||||
|
char_data['avatarEnName'] = avatarId2EnName[str(char['AvatarID'])]
|
||||||
|
|
||||||
|
# 处理遗器
|
||||||
|
for relic in char['RelicList']:
|
||||||
|
relic_temp = {}
|
||||||
|
relic_temp['relicId'] = relic['ID']
|
||||||
|
relic_temp['SetId'] = int(RelicId2SetId[str(relic['ID'])])
|
||||||
|
relic_temp['name'] = SetId2Name[str(relic_temp['SetId'])]
|
||||||
|
relic_temp['Level'] = relic['Level'] if 'Level' in relic else 1
|
||||||
|
relic_temp['Type'] = relic['Type']
|
||||||
|
|
||||||
|
relic_temp['MainAffix'] = {}
|
||||||
|
relic_temp['MainAffix']['AffixID'] = relic['MainAffixID']
|
||||||
|
affix_property, value = await cal_relic_main_affix(
|
||||||
|
relic_id=relic['ID'],
|
||||||
|
affix_id=relic['MainAffixID'],
|
||||||
|
relic_type=relic['Type'],
|
||||||
|
relic_level=relic_temp['Level'],
|
||||||
|
)
|
||||||
|
relic_temp['MainAffix']['Property'] = affix_property
|
||||||
|
relic_temp['MainAffix']['Name'] = Property2Name[affix_property]
|
||||||
|
relic_temp['MainAffix']['Value'] = value
|
||||||
|
|
||||||
|
relic_temp['SubAffixList'] = []
|
||||||
|
for sub_affix in relic['RelicSubAffix']:
|
||||||
|
sub_affix_temp = {}
|
||||||
|
sub_affix_temp['SubAffixID'] = sub_affix['SubAffixID']
|
||||||
|
sub_affix_property, value = await cal_relic_sub_affix(
|
||||||
|
relic_id=relic['ID'],
|
||||||
|
affix_id=sub_affix['SubAffixID'],
|
||||||
|
cnt=sub_affix['Cnt'],
|
||||||
|
step=sub_affix['Step'] if 'Step' in sub_affix else 0,
|
||||||
|
)
|
||||||
|
sub_affix_temp['Property'] = sub_affix_property
|
||||||
|
sub_affix_temp['Name'] = Property2Name[sub_affix_property]
|
||||||
|
sub_affix_temp['Cnt'] = sub_affix['Cnt']
|
||||||
|
sub_affix_temp['Step'] = (
|
||||||
|
sub_affix['Step'] if 'Step' in sub_affix else 0
|
||||||
|
)
|
||||||
|
sub_affix_temp['Value'] = value
|
||||||
|
relic_temp['SubAffixList'].append(sub_affix_temp)
|
||||||
|
char_data['RelicInfo'].append(relic_temp)
|
||||||
|
|
||||||
|
# 处理命座
|
||||||
|
rank_temp = []
|
||||||
|
if 'Rank' in char:
|
||||||
|
char_data['rank'] = char['Rank']
|
||||||
|
for index in range(char['Rank']):
|
||||||
|
rankTemp = {}
|
||||||
|
rank_id = int(str(char['AvatarID']) + '0' + str(index + 1))
|
||||||
|
rankTemp['rankId'] = rank_id
|
||||||
|
rankTemp['rankName'] = rankId2Name[str(rank_id)]
|
||||||
|
rank_temp.append(rankTemp)
|
||||||
|
char_data['rankList'] = rank_temp
|
||||||
|
|
||||||
|
# 处理基础属性
|
||||||
|
base_attributes = {}
|
||||||
|
avatar_promotion_base = AvatarPromotion[str(char['AvatarID'])][
|
||||||
|
str(char['Promotion'])
|
||||||
|
]
|
||||||
|
|
||||||
|
# 攻击力
|
||||||
|
base_attributes['attack'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["AttackBase"]['Value'])
|
||||||
|
+ mp.mpf(avatar_promotion_base["AttackAdd"]['Value'])
|
||||||
|
* (char['Level'] - 1)
|
||||||
|
)
|
||||||
|
# 防御力
|
||||||
|
base_attributes['defence'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["DefenceBase"]['Value'])
|
||||||
|
+ mp.mpf(avatar_promotion_base["DefenceAdd"]['Value'])
|
||||||
|
* (char['Level'] - 1)
|
||||||
|
)
|
||||||
|
# 血量
|
||||||
|
base_attributes['hp'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["HPBase"]['Value'])
|
||||||
|
+ mp.mpf(avatar_promotion_base["HPAdd"]['Value']) * (char['Level'] - 1)
|
||||||
|
)
|
||||||
|
# 速度
|
||||||
|
base_attributes['speed'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["SpeedBase"]['Value'])
|
||||||
|
)
|
||||||
|
# 暴击率
|
||||||
|
base_attributes['CriticalChance'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["CriticalChance"]['Value'])
|
||||||
|
)
|
||||||
|
# 暴击伤害
|
||||||
|
base_attributes['CriticalDamage'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["CriticalDamage"]['Value'])
|
||||||
|
)
|
||||||
|
# 嘲讽
|
||||||
|
base_attributes['BaseAggro'] = str(
|
||||||
|
mp.mpf(avatar_promotion_base["BaseAggro"]['Value'])
|
||||||
|
)
|
||||||
|
|
||||||
|
char_data['base_attributes'] = base_attributes
|
||||||
|
|
||||||
|
# 处理武器
|
||||||
|
|
||||||
|
equipment_info = {}
|
||||||
|
|
||||||
|
equipment_info['equipmentID'] = char['EquipmentID']['ID']
|
||||||
|
equipment_info['equipmentName'] = EquipmentID2Name[
|
||||||
|
str(equipment_info['equipmentID'])
|
||||||
|
]
|
||||||
|
# equipment_info['EquipmentStar'] = equipment_info['flat']['rankLevel']
|
||||||
|
|
||||||
|
equipment_info['equipmentLevel'] = char['EquipmentID']['Level']
|
||||||
|
equipment_info['equipmentPromotion'] = char['EquipmentID']['Promotion']
|
||||||
|
equipment_info['equipmentRank'] = char['EquipmentID']['Rank']
|
||||||
|
char_data['equipmentInfo'] = equipment_info
|
||||||
|
|
||||||
|
char_dict_list.append(char_data)
|
||||||
|
with open(
|
||||||
|
path / '{}.json'.format(avatarName), 'w', encoding='UTF-8'
|
||||||
|
) as file:
|
||||||
|
json.dump(char_data, file, ensure_ascii=False)
|
||||||
|
return char_dict_list
|
||||||
|
|
||||||
|
|
||||||
|
async def enka_to_data(
|
||||||
|
uid: str, enka_data: Optional[EnkaData] = None
|
||||||
|
) -> Union[dict, str]:
|
||||||
|
raw_data = await enka_to_dict(uid, enka_data)
|
||||||
|
if isinstance(raw_data, str):
|
||||||
|
return raw_data
|
||||||
|
char_name_list = []
|
||||||
|
char_name_list_str = ''
|
||||||
|
for char_data in raw_data:
|
||||||
|
char_name_list.append(char_data['avatarName'])
|
||||||
|
char_name_list_str = ','.join(char_name_list)
|
||||||
|
return f'UID{uid}刷新完成!\n本次缓存:{char_name_list_str}'
|
@ -8,7 +8,6 @@ from PIL import Image, ImageDraw
|
|||||||
from gsuid_core.logger import logger
|
from gsuid_core.logger import logger
|
||||||
|
|
||||||
from ..utils.image.convert import convert_img
|
from ..utils.image.convert import convert_img
|
||||||
from ..utils.map.name_covert import name_to_avatar_id
|
|
||||||
from ..utils.resource.RESOURCE_PATH import (
|
from ..utils.resource.RESOURCE_PATH import (
|
||||||
PLAYER_PATH,
|
PLAYER_PATH,
|
||||||
WEAPON_PATH,
|
WEAPON_PATH,
|
||||||
@ -19,6 +18,11 @@ from ..utils.image.image_tools import (
|
|||||||
get_qq_avatar,
|
get_qq_avatar,
|
||||||
draw_pic_with_ring,
|
draw_pic_with_ring,
|
||||||
)
|
)
|
||||||
|
from ..utils.map.name_covert import (
|
||||||
|
name_to_avatar_id,
|
||||||
|
name_to_weapon_id,
|
||||||
|
weapon_id_to_en_name,
|
||||||
|
)
|
||||||
from ..utils.fonts.starrail_fonts import (
|
from ..utils.fonts.starrail_fonts import (
|
||||||
sr_font_20,
|
sr_font_20,
|
||||||
sr_font_24,
|
sr_font_24,
|
||||||
@ -92,12 +96,14 @@ async def _draw_card(
|
|||||||
.resize((105, 105))
|
.resize((105, 105))
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
name = await name_to_weapon_id(name)
|
||||||
|
_id = await weapon_id_to_en_name(name)
|
||||||
item_pic = (
|
item_pic = (
|
||||||
Image.open(WEAPON_PATH / f'{name}.png')
|
Image.open(WEAPON_PATH / f'{_id}.png')
|
||||||
.convert('RGBA')
|
.convert('RGBA')
|
||||||
.crop((0, 0, 867, 867))
|
.resize((124, 124))
|
||||||
)
|
)
|
||||||
item_pic = item_pic.resize((105, 105))
|
point = (37, 24)
|
||||||
card_img.paste(item_pic, point, item_pic)
|
card_img.paste(item_pic, point, item_pic)
|
||||||
if gacha_num >= 81:
|
if gacha_num >= 81:
|
||||||
text_color = red_color
|
text_color = red_color
|
||||||
@ -148,7 +154,7 @@ def check_up(name: str, _time: str) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
async def draw_gachalogs_img(uid: str, user_id: str) -> Union[bytes, str]:
|
async def draw_gachalogs_img(uid: str, user_id: str) -> Union[bytes, str]:
|
||||||
path = PLAYER_PATH / str(uid) / 'gacha_logs.json'
|
path = PLAYER_PATH / str(uid) / 'gacha_logs_test.json'
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
return '你还没有跃迁数据噢~\n请使用命令`sr导入抽卡链接`更新跃迁数据~'
|
return '你还没有跃迁数据噢~\n请使用命令`sr导入抽卡链接`更新跃迁数据~'
|
||||||
with open(path, 'r', encoding='UTF-8') as f:
|
with open(path, 'r', encoding='UTF-8') as f:
|
||||||
|
9932
StarRailUID/utils/excel/AvatarPromotionConfig.json
Normal file
9932
StarRailUID/utils/excel/AvatarPromotionConfig.json
Normal file
File diff suppressed because it is too large
Load Diff
1464
StarRailUID/utils/excel/RelicMainAffixConfig.json
Normal file
1464
StarRailUID/utils/excel/RelicMainAffixConfig.json
Normal file
File diff suppressed because it is too large
Load Diff
586
StarRailUID/utils/excel/RelicSubAffixConfig.json
Normal file
586
StarRailUID/utils/excel/RelicSubAffixConfig.json
Normal file
@ -0,0 +1,586 @@
|
|||||||
|
{
|
||||||
|
"2": {
|
||||||
|
"1": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 1,
|
||||||
|
"Property": "HPDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 13.548015787460994
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 1.6935019741893238
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 2,
|
||||||
|
"Property": "AttackDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 6.774007894196158
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.846750987909569
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 3,
|
||||||
|
"Property": "DefenceDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 6.774007894196158
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.846750987909569
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 4,
|
||||||
|
"Property": "HPAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.0138240002720232
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00172800055787184
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 5,
|
||||||
|
"Property": "AttackAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.0138240002720232
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00172800055787184
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 6,
|
||||||
|
"Property": "DefenceAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.01727999999078304
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00216000034809384
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 7,
|
||||||
|
"Property": "SpeedDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.9999999843067494
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0999999985238072
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 8,
|
||||||
|
"Property": "CriticalChanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.01036800055326336
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00129600076764984
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 9,
|
||||||
|
"Property": "CriticalDamageBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 10,
|
||||||
|
"Property": "StatusProbabilityBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.0138240002720232
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00172800055787184
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 11,
|
||||||
|
"Property": "StatusResistanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.0138240002720232
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00172800055787184
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"GroupID": 2,
|
||||||
|
"AffixID": 12,
|
||||||
|
"Property": "BreakDamageAddedRatioBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"1": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 1,
|
||||||
|
"Property": "HPDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 20.322022681416723
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 2.54025296116757
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 2,
|
||||||
|
"Property": "AttackDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 10.16101184071216
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 1.2701259805799858
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 3,
|
||||||
|
"Property": "DefenceDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 10.16101184071216
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 1.2701259805799858
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 4,
|
||||||
|
"Property": "HPAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 5,
|
||||||
|
"Property": "AttackAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 6,
|
||||||
|
"Property": "DefenceAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.025919999986174558
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0032400001728948
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 7,
|
||||||
|
"Property": "SpeedDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 1.1999999813543638
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0999999985238072
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 8,
|
||||||
|
"Property": "CriticalChanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.01555200013140312
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0019440008022287999
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 9,
|
||||||
|
"Property": "CriticalDamageBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.031103999564314318
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00388800090596568
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 10,
|
||||||
|
"Property": "StatusProbabilityBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 11,
|
||||||
|
"Property": "StatusResistanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"GroupID": 3,
|
||||||
|
"AffixID": 12,
|
||||||
|
"Property": "BreakDamageAddedRatioBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.031103999564314318
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00388800090596568
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"1": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 1,
|
||||||
|
"Property": "HPDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 27.096030574681556
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 3.387003946748833
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 2,
|
||||||
|
"Property": "AttackDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 13.548015787460994
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 1.6935019741893238
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 3,
|
||||||
|
"Property": "DefenceDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 13.548015787460994
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 1.6935019741893238
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 4,
|
||||||
|
"Property": "HPAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.02764799984555448
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00345600041725176
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 5,
|
||||||
|
"Property": "AttackAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.02764799984555448
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00345600041725176
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 6,
|
||||||
|
"Property": "DefenceAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.03455999998156608
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00431999999769576
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 7,
|
||||||
|
"Property": "SpeedDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 1.5999999754495926
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.1999999970476144
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 8,
|
||||||
|
"Property": "CriticalChanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.020736000408034798
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00259200083680776
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 9,
|
||||||
|
"Property": "CriticalDamageBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.04147200011757768
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00518400027663168
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 10,
|
||||||
|
"Property": "StatusProbabilityBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.02764799984555448
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00345600041725176
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 11,
|
||||||
|
"Property": "StatusResistanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.02764799984555448
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00345600041725176
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"GroupID": 4,
|
||||||
|
"AffixID": 12,
|
||||||
|
"Property": "BreakDamageAddedRatioBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.04147200011757768
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00518400027663168
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"1": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 1,
|
||||||
|
"Property": "HPDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 33.87003846957621
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 4.233754934425572
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 2,
|
||||||
|
"Property": "AttackDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 16.93501873490072
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 2.116876967558232
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 3,
|
||||||
|
"Property": "DefenceDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 16.93501873490072
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 2.116876967558232
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 4,
|
||||||
|
"Property": "HPAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.03455999998156608
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00431999999769576
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 5,
|
||||||
|
"Property": "AttackAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.03455999998156608
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00431999999769576
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 6,
|
||||||
|
"Property": "DefenceAddedRatio",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.04319999927846568
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00539999982249672
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 7,
|
||||||
|
"Property": "SpeedDelta",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 1.9999999686134988
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.2999999955714216
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 8,
|
||||||
|
"Property": "CriticalChanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.025919999986174558
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0032400001728948
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 9,
|
||||||
|
"Property": "CriticalDamageBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.051839999972349116
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0064800003457896
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 10,
|
||||||
|
"Property": "StatusProbabilityBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.03455999998156608
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00431999999769576
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 11,
|
||||||
|
"Property": "StatusResistanceBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.03455999998156608
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.00431999999769576
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"GroupID": 5,
|
||||||
|
"AffixID": 12,
|
||||||
|
"Property": "BreakDamageAddedRatioBase",
|
||||||
|
"BaseValue": {
|
||||||
|
"Value": 0.051839999972349116
|
||||||
|
},
|
||||||
|
"StepValue": {
|
||||||
|
"Value": 0.0064800003457896
|
||||||
|
},
|
||||||
|
"StepNum": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
StarRailUID/utils/excel/read_excel.py
Normal file
13
StarRailUID/utils/excel/read_excel.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
EXCEL = Path(__file__).parent
|
||||||
|
|
||||||
|
with open(EXCEL / 'RelicMainAffixConfig.json', 'r', encoding='utf8') as f:
|
||||||
|
RelicMainAffix = json.load(f)
|
||||||
|
|
||||||
|
with open(EXCEL / 'RelicSubAffixConfig.json', 'r', encoding='utf8') as f:
|
||||||
|
RelicSubAffix = json.load(f)
|
||||||
|
|
||||||
|
with open(EXCEL / 'AvatarPromotionConfig.json', 'r', encoding='utf8') as f:
|
||||||
|
AvatarPromotion = json.load(f)
|
@ -10,7 +10,15 @@ MAP = Path(__file__).parent / 'data'
|
|||||||
version = StarRail_version
|
version = StarRail_version
|
||||||
|
|
||||||
avatarId2Name_fileName = f'avatarId2Name_mapping_{version}.json'
|
avatarId2Name_fileName = f'avatarId2Name_mapping_{version}.json'
|
||||||
|
avatarId2EnName_fileName = f'avatarId2EnName_mapping_{version}.json'
|
||||||
EquipmentID2Name_fileName = f'EquipmentID2Name_mapping_{version}.json'
|
EquipmentID2Name_fileName = f'EquipmentID2Name_mapping_{version}.json'
|
||||||
|
EquipmentID2EnName_fileName = f'EquipmentID2EnName_mapping_{version}.json'
|
||||||
|
skillId2Name_fileName = f'skillId2Name_mapping_{version}.json'
|
||||||
|
skillId2Type_fileName = f'skillId2Type_mapping_{version}.json'
|
||||||
|
Property2Name_fileName = 'Property2Name.json'
|
||||||
|
RelicId2SetId_fileName = f'RelicId2SetId_mapping_{version}.json'
|
||||||
|
SetId2Name_fileName = f'SetId2Name_mapping_{version}.json'
|
||||||
|
rankId2Name_fileName = f'rankId2Name_mapping_{version}.json'
|
||||||
|
|
||||||
|
|
||||||
class TS(TypedDict):
|
class TS(TypedDict):
|
||||||
@ -21,5 +29,29 @@ class TS(TypedDict):
|
|||||||
with open(MAP / avatarId2Name_fileName, 'r', encoding='UTF-8') as f:
|
with open(MAP / avatarId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
avatarId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
avatarId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / avatarId2EnName_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
avatarId2EnName = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
with open(MAP / EquipmentID2Name_fileName, 'r', encoding='UTF-8') as f:
|
with open(MAP / EquipmentID2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
EquipmentID2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
EquipmentID2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / EquipmentID2EnName_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
EquipmentID2EnName = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / skillId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
skillId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / skillId2Type_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
skillId2Type = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / Property2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
Property2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / RelicId2SetId_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
RelicId2SetId = msgjson.decode(f.read(), type=Dict[str, int])
|
||||||
|
|
||||||
|
with open(MAP / SetId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
SetId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
|
||||||
|
with open(MAP / rankId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||||
|
rankId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
{"20000": "Arrows", "20001": "Cornucopia", "20002": "CollapsingSky", "20003": "Amber", "20004": "Void", "20005": "Chorus", "20006": "DataBank", "20007": "DartingArrow", "20008": "FineFruit", "20009": "ShatteredHome", "20010": "Defense", "20011": "Loop", "20012": "MeshingCogs", "20013": "Passkey", "20014": "Adversarial", "20015": "Multiplication", "20016": "MutualDemise", "20017": "Pioneering", "20018": "HiddenShadow", "20019": "Mediation", "20020": "Sagacity", "21000": "Post-OpConversation", "21001": "GoodNightandSleepWell", "21002": "DayOneofMyNewLife", "21003": "OnlySilenceRemains", "21004": "MemoriesofthePast", "21005": "TheMolesWelcomeYou", "21006": "TheBirthoftheSelf", "21007": "SharedFeeling", "21008": "EyesofthePrey", "21009": "Landau'sChoice", "21010": "Swordplay", "21011": "PlanetaryRendezvous", "21012": "ASecretVow", "21014": "PerfectTiming", "21015": "ResolutionShinesAsPearlsofSweat", "21016": "TrendoftheUniversalMarket", "21017": "SubscribeforMore!", "21021": "QuidProQuo", "21028": "WarmthShortensColdNights", "23001": "IntheNight", "23003": "ButtheBattleIsn'tOver", "23004": "IntheNameoftheWorld", "23005": "MomentofVictory", "23012": "SleepLiketheDead", "23013": "TimeWaitsforNoOne", "24000": "OntheFallofanAeon", "24001": "CruisingintheStellarSea", "24002": "TextureofMemories", "29000": "TextureofMemories", "21013": "MaketheWorldClamor", "23000": "NightontheMilkyWay", "23010": "BeforeDawn", "21019": "UndertheBlueSky", "21020": "Geniuses'Repose", "21023": "WeAreWildfire", "21024": "RiverFlowsinSpring", "21022": "Fermata", "21026": "Woof!WalkTime!", "21027": "TheSeriousnessofBreakfast", "21029": "WeWillMeetAgain", "21030": "ThisIsMe!", "21031": "ReturntoDarkness", "21032": "CarvetheMoon,WeavetheClouds", "21033": "NowheretoRun", "21034": "TodayIsAnotherPeacefulDay", "23002": "SomethingIrreplaceable", "21018": "Dance!Dance!Dance!", "21025": "PastandFuture"}
|
1
StarRailUID/utils/map/data/Property2Name.json
Normal file
1
StarRailUID/utils/map/data/Property2Name.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"MaxHP": "生命值", "Attack": "攻击力", "Defence": "防御力", "Speed": "速度", "CriticalChance": "暴击率", "CriticalDamage": "暴击伤害", "BreakDamageAddedRatio": "击破特攻", "BreakDamageAddedRatioBase": "击破特攻", "HealRatio": "治疗量加成", "MaxSP": "能量上限", "SPRatio": "能量恢复效率", "StatusProbability": "效果命中", "StatusResistance": "效果抵抗", "CriticalChanceBase": "暴击率", "CriticalDamageBase": "暴击伤害", "HealRatioBase": "治疗量加成", "StanceBreakAddedRatio": "dev_失效字段", "SPRatioBase": "能量恢复效率", "StatusProbabilityBase": "效果命中", "StatusResistanceBase": "效果抵抗", "PhysicalAddedRatio": "物理属性伤害提高", "PhysicalResistance": "物理属性抗性提高", "FireAddedRatio": "火属性伤害提高", "FireResistance": "火属性抗性提高", "IceAddedRatio": "冰属性伤害提高", "IceResistance": "冰属性抗性提高", "ThunderAddedRatio": "雷属性伤害提高", "ThunderResistance": "雷属性抗性提高", "WindAddedRatio": "风属性伤害提高", "WindResistance": "风属性抗性提高", "QuantumAddedRatio": "量子属性伤害提高", "QuantumResistance": "量子属性抗性提高", "ImaginaryAddedRatio": "虚数属性伤害提高", "ImaginaryResistance": "虚数属性抗性提高", "BaseHP": "基础生命值提高<unbreak>#1[i]</unbreak>", "HPDelta": "生命值", "HPAddedRatio": "生命值百分比", "BaseAttack": "基础攻击力提高<unbreak>#1[i]</unbreak>", "AttackDelta": "攻击力", "AttackAddedRatio": "攻击力百分比", "BaseDefence": "基础防御力提高<unbreak>#1[i]</unbreak>", "DefenceDelta": "防御力", "DefenceAddedRatio": "防御力百分比", "BaseSpeed": "速度", "HealTakenRatio": "治疗量加成", "PhysicalResistanceDelta": "物理属性抗性提高", "FireResistanceDelta": "火属性抗性提高", "IceResistanceDelta": "冰属性抗性提高", "ThunderResistanceDelta": "雷属性抗性提高", "WindResistanceDelta": "风属性抗性提高", "QuantumResistanceDelta": "量子属性抗性提高", "ImaginaryResistanceDelta": "虚数属性抗性提高", "SpeedDelta": "速度"}
|
@ -0,0 +1 @@
|
|||||||
|
{"31011": 101, "41011": 101, "51011": 101, "61011": 101, "31012": 101, "41012": 101, "51012": 101, "61012": 101, "31013": 101, "41013": 101, "51013": 101, "61013": 101, "31014": 101, "41014": 101, "51014": 101, "61014": 101, "31021": 102, "41021": 102, "51021": 102, "61021": 102, "31022": 102, "41022": 102, "51022": 102, "61022": 102, "31023": 102, "41023": 102, "51023": 102, "61023": 102, "31024": 102, "41024": 102, "51024": 102, "61024": 102, "31031": 103, "41031": 103, "51031": 103, "61031": 103, "31032": 103, "41032": 103, "51032": 103, "61032": 103, "31033": 103, "41033": 103, "51033": 103, "61033": 103, "31034": 103, "41034": 103, "51034": 103, "61034": 103, "31041": 104, "41041": 104, "51041": 104, "61041": 104, "31042": 104, "41042": 104, "51042": 104, "61042": 104, "31043": 104, "41043": 104, "51043": 104, "61043": 104, "31044": 104, "41044": 104, "51044": 104, "61044": 104, "31051": 105, "41051": 105, "51051": 105, "61051": 105, "31052": 105, "41052": 105, "51052": 105, "61052": 105, "31053": 105, "41053": 105, "51053": 105, "61053": 105, "31054": 105, "41054": 105, "51054": 105, "61054": 105, "31061": 106, "41061": 106, "51061": 106, "61061": 106, "31062": 106, "41062": 106, "51062": 106, "61062": 106, "31063": 106, "41063": 106, "51063": 106, "61063": 106, "31064": 106, "41064": 106, "51064": 106, "61064": 106, "31071": 107, "41071": 107, "51071": 107, "61071": 107, "31072": 107, "41072": 107, "51072": 107, "61072": 107, "31073": 107, "41073": 107, "51073": 107, "61073": 107, "31074": 107, "41074": 107, "51074": 107, "61074": 107, "31081": 108, "41081": 108, "51081": 108, "61081": 108, "31082": 108, "41082": 108, "51082": 108, "61082": 108, "31083": 108, "41083": 108, "51083": 108, "61083": 108, "31084": 108, "41084": 108, "51084": 108, "61084": 108, "31091": 109, "41091": 109, "51091": 109, "61091": 109, "31092": 109, "41092": 109, "51092": 109, "61092": 109, "31093": 109, "41093": 109, "51093": 109, "61093": 109, "31094": 109, "41094": 109, "51094": 109, "61094": 109, "31101": 110, "41101": 110, "51101": 110, "61101": 110, "31102": 110, "41102": 110, "51102": 110, "61102": 110, "31103": 110, "41103": 110, "51103": 110, "61103": 110, "31104": 110, "41104": 110, "51104": 110, "61104": 110, "31111": 111, "41111": 111, "51111": 111, "61111": 111, "31112": 111, "41112": 111, "51112": 111, "61112": 111, "31113": 111, "41113": 111, "51113": 111, "61113": 111, "31114": 111, "41114": 111, "51114": 111, "61114": 111, "31121": 112, "41121": 112, "51121": 112, "61121": 112, "31122": 112, "41122": 112, "51122": 112, "61122": 112, "31123": 112, "41123": 112, "51123": 112, "61123": 112, "31124": 112, "41124": 112, "51124": 112, "61124": 112, "33015": 301, "43015": 301, "53015": 301, "63015": 301, "33016": 301, "43016": 301, "53016": 301, "63016": 301, "33025": 302, "43025": 302, "53025": 302, "63025": 302, "33026": 302, "43026": 302, "53026": 302, "63026": 302, "33035": 303, "43035": 303, "53035": 303, "63035": 303, "33036": 303, "43036": 303, "53036": 303, "63036": 303, "33045": 304, "43045": 304, "53045": 304, "63045": 304, "33046": 304, "43046": 304, "53046": 304, "63046": 304, "33055": 305, "43055": 305, "53055": 305, "63055": 305, "33056": 305, "43056": 305, "53056": 305, "63056": 305, "33065": 306, "43065": 306, "53065": 306, "63065": 306, "33066": 306, "43066": 306, "53066": 306, "63066": 306, "33075": 307, "43075": 307, "53075": 307, "63075": 307, "33076": 307, "43076": 307, "53076": 307, "63076": 307, "33085": 308, "43085": 308, "53085": 308, "63085": 308, "33086": 308, "43086": 308, "53086": 308, "63086": 308, "55001": 101, "55002": 101, "55003": 102, "55004": 103, "55005": 103, "55006": 105}
|
1
StarRailUID/utils/map/data/SetId2Name_mapping_1.0.5.json
Normal file
1
StarRailUID/utils/map/data/SetId2Name_mapping_1.0.5.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"101": "云无留迹的过客", "102": "野穗伴行的快枪手", "103": "净庭教宗的圣骑士", "104": "密林卧雪的猎人", "105": "街头出身的拳王", "106": "戍卫风雪的铁卫", "107": "熔岩锻铸的火匠", "108": "繁星璀璨的天才", "109": "激奏雷电的乐队", "110": "晨昏交界的翔鹰", "111": "流星追迹的怪盗", "112": "盗匪荒漠的废土客", "301": "太空封印站", "302": "不老者的仙舟", "303": "泛银河商业公司", "304": "筑城者的贝洛伯格", "305": "星体差分机", "306": "停转的萨尔索图", "307": "盗贼公国塔利亚", "308": "生命的翁瓦克"}
|
@ -0,0 +1 @@
|
|||||||
|
{"1001": "March7th", "1002": "DanHeng", "1003": "Himeko", "1004": "Welt", "1005": "Kafka", "1006": "SilverWolf", "1008": "Arlan", "1009": "Asta", "1013": "Herta", "1101": "Bronya", "1102": "Seele", "1103": "Serval", "1104": "Gepard", "1105": "Natasha", "1106": "Pela", "1107": "Clara", "1108": "Sampo", "1109": "Hook", "1201": "Qingque", "1202": "Tingyun", "1203": "Luocha", "1204": "JingYuan", "1206": "Sushang", "1209": "Yanqing", "1211": "Bailu", "8001": "{NICKNAME}", "8002": "{NICKNAME}", "8003": "{NICKNAME}", "8004": "{NICKNAME}", "9100": "{NICKNAME}"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
{"100101": "单攻", "100103": "群攻", "100104": "单攻", "100106": "", "100107": "", "100201": "单攻", "100202": "单攻", "100203": "单攻", "100204": "强化", "100206": "", "100207": "强化", "100302": "扩散", "100306": "", "100307": "妨害", "100401": "单攻", "100402": "弹射", "100404": "强化", "100406": "", "100501": "单攻", "100502": "扩散", "100503": "群攻", "100504": "单攻", "100506": "", "100507": "", "100801": "单攻", "100802": "单攻", "100803": "扩散", "100804": "强化", "100806": "", "100807": "", "100901": "单攻", "100902": "弹射", "100903": "辅助", "100904": "辅助", "100906": "", "100907": "", "101301": "单攻", "101302": "群攻", "101303": "群攻", "101304": "群攻", "101306": "", "101307": "强化", "110101": "单攻", "110102": "辅助", "110103": "辅助", "110104": "强化", "110106": "", "110107": "辅助", "110203": "单攻", "110206": "", "110207": "强化", "110301": "单攻", "110302": "扩散", "110303": "群攻", "110304": "强化", "110306": "", "110307": "", "110401": "单攻", "110402": "妨害", "110403": "防御", "110404": "回复", "110406": "", "110407": "防御", "110501": "单攻", "110502": "回复", "110503": "回复", "110506": "", "110601": "单攻", "110602": "妨害", "110604": "辅助", "110606": "", "110607": "", "110801": "单攻", "110802": "弹射", "110803": "妨害", "110806": "", "110807": "妨害", "110901": "单攻", "110902": "单攻", "110903": "单攻", "110904": "强化", "110906": "", "110907": "", "110909": "扩散", "120101": "单攻", "120108": "扩散", "120103": "群攻", "120104": "强化", "120106": "", "120107": "强化", "120201": "单攻", "120206": "", "120207": "辅助", "120301": "单攻", "120302": "回复", "120303": "群攻", "120304": "回复", "120306": "", "120307": "回复", "120601": "单攻", "120602": "单攻", "120603": "单攻", "120604": "强化", "120606": "", "120607": "", "120901": "单攻", "120902": "单攻", "120903": "单攻", "120904": "单攻", "120906": "", "120907": "强化", "121101": "单攻", "121102": "回复", "121103": "回复", "121106": "", "121107": "辅助", "800101": "单攻", "800102": "扩散", "800103": "强化", "800104": "强化", "800106": "", "800107": "回复", "800108": "单攻", "800109": "扩散", "800201": "单攻", "800202": "扩散", "800203": "强化", "800204": "强化", "800206": "", "800207": "回复", "800208": "单攻", "800209": "扩散", "800301": "单攻", "800308": "扩散", "800303": "群攻", "800304": "强化", "800306": "", "800307": "防御", "800401": "单攻", "800408": "扩散", "800403": "群攻", "800404": "强化", "800406": "", "800407": "防御", "100601": "单攻", "100602": "妨害", "100603": "妨害", "100604": "妨害", "100606": "", "100607": "", "120401": "单攻", "120402": "群攻", "120403": "群攻", "120404": "弹射", "120406": "", "909807": "回复", "110603": "妨害", "110507": "", "800402": "防御", "800302": "防御", "120202": "辅助", "120204": "强化", "110804": "强化", "110504": "强化", "110202": "单攻", "110204": "强化", "100301": "单攻", "100304": "群攻", "100303": "群攻", "110701": "单攻", "110702": "群攻", "110703": "强化", "110704": "单攻", "110706": "", "110707": "", "110201": "单攻", "121104": "回复", "120407": "强化", "100407": "妨害", "120102": "强化", "100102": "防御", "120203": "辅助", "100403": "群攻"}
|
@ -1,4 +1,4 @@
|
|||||||
from .SR_MAP_PATH import EquipmentID2Name, avatarId2Name
|
from .SR_MAP_PATH import EquipmentID2Name, EquipmentID2EnName, avatarId2Name
|
||||||
|
|
||||||
|
|
||||||
async def avatar_id_to_name(avatar_id: str) -> str:
|
async def avatar_id_to_name(avatar_id: str) -> str:
|
||||||
@ -27,3 +27,17 @@ async def name_to_weapon_id(name: str) -> str:
|
|||||||
weapon_id = i
|
weapon_id = i
|
||||||
break
|
break
|
||||||
return weapon_id
|
return weapon_id
|
||||||
|
|
||||||
|
|
||||||
|
async def weapon_id_to_en_name(weapon_id: str) -> str:
|
||||||
|
weapon_en_name = EquipmentID2EnName[weapon_id]
|
||||||
|
return weapon_en_name
|
||||||
|
|
||||||
|
|
||||||
|
async def en_name_to_weapon_id(name: str) -> str:
|
||||||
|
weapon_id = ''
|
||||||
|
for i in EquipmentID2EnName:
|
||||||
|
if EquipmentID2EnName[i] == name:
|
||||||
|
weapon_id = i
|
||||||
|
break
|
||||||
|
return weapon_id
|
||||||
|
@ -9,8 +9,9 @@ CONFIG_PATH = MAIN_PATH / 'config.json'
|
|||||||
RESOURCE_PATH = MAIN_PATH / 'resource'
|
RESOURCE_PATH = MAIN_PATH / 'resource'
|
||||||
PLAYER_PATH = MAIN_PATH / 'players'
|
PLAYER_PATH = MAIN_PATH / 'players'
|
||||||
CU_BG_PATH = MAIN_PATH / 'bg'
|
CU_BG_PATH = MAIN_PATH / 'bg'
|
||||||
|
TEMP_PATH = RESOURCE_PATH / 'temp'
|
||||||
CHAR_ICON_PATH = RESOURCE_PATH / 'char_icon'
|
CHAR_ICON_PATH = RESOURCE_PATH / 'char_icon'
|
||||||
WEAPON_PATH = RESOURCE_PATH / 'weapons'
|
WEAPON_PATH = RESOURCE_PATH / 'light_cone'
|
||||||
TEXT2D_PATH = Path(__file__).parent / 'texture2d'
|
TEXT2D_PATH = Path(__file__).parent / 'texture2d'
|
||||||
|
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ def init_dir():
|
|||||||
WEAPON_PATH,
|
WEAPON_PATH,
|
||||||
TEXT2D_PATH,
|
TEXT2D_PATH,
|
||||||
CU_BG_PATH,
|
CU_BG_PATH,
|
||||||
|
TEMP_PATH,
|
||||||
]:
|
]:
|
||||||
i.mkdir(parents=True, exist_ok=True)
|
i.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user