mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-08 04:55:47 +08:00
✨支持1.1版本
This commit is contained in:
parent
ce91fe569b
commit
8455221da3
@ -4,63 +4,64 @@ from typing import List, Optional, TypedDict
|
|||||||
|
|
||||||
|
|
||||||
class MihomoData(TypedDict):
|
class MihomoData(TypedDict):
|
||||||
PlayerDetailInfo: PlayerDetailInfo
|
detailInfo: PlayerDetailInfo
|
||||||
|
|
||||||
|
|
||||||
class Behavior(TypedDict):
|
class Behavior(TypedDict):
|
||||||
BehaviorID: int
|
pointId: int
|
||||||
Level: int
|
level: int
|
||||||
|
|
||||||
|
|
||||||
class Equipment(TypedDict):
|
class Equipment(TypedDict):
|
||||||
Level: int
|
level: int
|
||||||
ID: int
|
tid: int
|
||||||
Promotion: Optional[int]
|
promotion: Optional[int]
|
||||||
Rank: Optional[int]
|
rank: Optional[int]
|
||||||
|
|
||||||
|
|
||||||
class Relic(TypedDict):
|
class Relic(TypedDict):
|
||||||
RelicSubAffix: List[RelicSubAffix]
|
subAffixList: List[subAffixList]
|
||||||
ID: int
|
tid: int
|
||||||
MainAffixID: int
|
mainAffixId: int
|
||||||
Type: int
|
type: int
|
||||||
|
|
||||||
|
|
||||||
class Avatar(TypedDict):
|
class Avatar(TypedDict):
|
||||||
BehaviorList: List[Behavior]
|
skillTreeList: List[Behavior]
|
||||||
Rank: Optional[int]
|
rank: Optional[int]
|
||||||
Pos: Optional[int]
|
pos: Optional[int]
|
||||||
AvatarID: int
|
avatarId: int
|
||||||
Level: int
|
level: int
|
||||||
EquipmentID: Optional[Equipment]
|
equipment: Optional[Equipment]
|
||||||
RelicList: List[Relic]
|
relicList: List[Relic]
|
||||||
Promotion: int
|
promotion: int
|
||||||
|
|
||||||
|
|
||||||
class Challenge(TypedDict):
|
class Challenge(TypedDict):
|
||||||
PreMazeGroupIndex: int
|
scheduleMaxLevel: int
|
||||||
MazeGroupIndex: Optional[int]
|
MazeGroupIndex: Optional[int]
|
||||||
PreMazeGroupIndex: Optional[int]
|
PreMazeGroupIndex: Optional[int]
|
||||||
|
|
||||||
|
|
||||||
class PlayerSpaceInfo(TypedDict):
|
class PlayerSpaceInfo(TypedDict):
|
||||||
ChallengeData: Challenge
|
challengeInfo: Challenge
|
||||||
PassAreaProgress: int
|
maxRogueChallengeScore: int
|
||||||
LightConeCount: int
|
equipmentCount: int
|
||||||
AvatarCount: int
|
avatarCount: int
|
||||||
AchievementCount: int
|
achievementCount: int
|
||||||
|
|
||||||
|
|
||||||
class PlayerDetailInfo(TypedDict):
|
class PlayerDetailInfo(TypedDict):
|
||||||
AssistAvatar: Avatar
|
assistAvatarDetail: Avatar
|
||||||
IsDisplayAvatarList: bool
|
platform: str
|
||||||
DisplayAvatarList: Optional[List[Avatar]]
|
isDisplayAvatar: bool
|
||||||
UID: int
|
avatarDetailList: Optional[List[Avatar]]
|
||||||
CurFriendCount: int
|
uid: int
|
||||||
WorldLevel: int
|
friendCount: int
|
||||||
NickName: str
|
worldLevel: int
|
||||||
|
nickname: str
|
||||||
Birthday: Optional[int]
|
Birthday: Optional[int]
|
||||||
Level: int
|
level: int
|
||||||
PlayerSpaceInfo: Optional[PlayerSpaceInfo]
|
recordInfo: Optional[PlayerSpaceInfo]
|
||||||
HeadIconID: int
|
headIcon: int
|
||||||
Signature: Optional[str]
|
signature: Optional[str]
|
||||||
|
@ -31,6 +31,7 @@ async def api_to_card(
|
|||||||
uid: str, enka_data: Optional[EnkaData] = None
|
uid: str, enka_data: Optional[EnkaData] = None
|
||||||
) -> Union[str, bytes]:
|
) -> Union[str, bytes]:
|
||||||
char_data_list = await api_to_dict(uid, enka_data)
|
char_data_list = await api_to_dict(uid, enka_data)
|
||||||
|
print(char_data_list)
|
||||||
if isinstance(char_data_list, str):
|
if isinstance(char_data_list, str):
|
||||||
if ('服务器正在维护或者关闭中' in char_data_list) or ('网络不太稳定' in char_data_list):
|
if ('服务器正在维护或者关闭中' in char_data_list) or ('网络不太稳定' in char_data_list):
|
||||||
return await convert_img(pic_500)
|
return await convert_img(pic_500)
|
||||||
|
@ -57,13 +57,14 @@ async def api_to_dict(
|
|||||||
if isinstance(sr_data, str):
|
if isinstance(sr_data, str):
|
||||||
return []
|
return []
|
||||||
if isinstance(sr_data, dict):
|
if isinstance(sr_data, dict):
|
||||||
if 'PlayerDetailInfo' not in sr_data:
|
print(sr_data)
|
||||||
|
if 'detailInfo' not in sr_data:
|
||||||
im = '服务器正在维护或者关闭中...\n检查Mihomo.me是否可以访问\n如可以访问,尝试上报Bug!'
|
im = '服务器正在维护或者关闭中...\n检查Mihomo.me是否可以访问\n如可以访问,尝试上报Bug!'
|
||||||
return im
|
return im
|
||||||
elif sr_data is None:
|
elif sr_data is None:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
PlayerDetailInfo = sr_data['PlayerDetailInfo']
|
PlayerDetailInfo = sr_data['detailInfo']
|
||||||
path = PLAYER_PATH / str(sr_uid)
|
path = PLAYER_PATH / str(sr_uid)
|
||||||
path.mkdir(parents=True, exist_ok=True)
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
with open(
|
with open(
|
||||||
@ -73,28 +74,33 @@ async def api_to_dict(
|
|||||||
with open(path / 'rawData.json', 'w', encoding='UTF-8') as file:
|
with open(path / 'rawData.json', 'w', encoding='UTF-8') as file:
|
||||||
json.dump(sr_data, file, ensure_ascii=False)
|
json.dump(sr_data, file, ensure_ascii=False)
|
||||||
|
|
||||||
if 'PlayerDetailInfo' not in sr_data:
|
if 'detailInfo' not in sr_data:
|
||||||
return f'SR_UID{sr_uid}刷新失败!未打开角色展柜!'
|
return f'SR_UID{sr_uid}刷新失败!未打开角色展柜!'
|
||||||
|
|
||||||
char_name_list = []
|
char_name_list = []
|
||||||
char_id_list = []
|
char_id_list = []
|
||||||
im = f'UID: {sr_uid} 的角色展柜刷新成功\n'
|
im = f'UID: {sr_uid} 的角色展柜刷新成功\n'
|
||||||
if PlayerDetailInfo.get('AssistAvatar'):
|
if PlayerDetailInfo.get('assistAvatarDetail'):
|
||||||
if PlayerDetailInfo['AssistAvatar']['AvatarID'] not in char_id_list:
|
if (
|
||||||
|
PlayerDetailInfo['assistAvatarDetail']['avatarId']
|
||||||
|
not in char_id_list
|
||||||
|
):
|
||||||
char_dict, avatarName = await get_data(
|
char_dict, avatarName = await get_data(
|
||||||
PlayerDetailInfo['AssistAvatar'], sr_data, sr_uid
|
PlayerDetailInfo['assistAvatarDetail'], sr_data, sr_uid
|
||||||
)
|
)
|
||||||
im += f'支援角色 {avatarName}\n'
|
im += f'支援角色 {avatarName}\n'
|
||||||
char_name_list.append(avatarName)
|
char_name_list.append(avatarName)
|
||||||
char_id_list.append(PlayerDetailInfo['AssistAvatar']['AvatarID'])
|
char_id_list.append(
|
||||||
if PlayerDetailInfo.get('DisplayAvatarList'):
|
PlayerDetailInfo['assistAvatarDetail']['avatarId']
|
||||||
|
)
|
||||||
|
if PlayerDetailInfo.get('avatarDetailList'):
|
||||||
im += '星海同行'
|
im += '星海同行'
|
||||||
for char in PlayerDetailInfo['DisplayAvatarList']:
|
for char in PlayerDetailInfo['avatarDetailList']:
|
||||||
if char['AvatarID'] not in char_id_list:
|
if char['avatarId'] not in char_id_list:
|
||||||
char_dict, avatarName = await get_data(char, sr_data, sr_uid)
|
char_dict, avatarName = await get_data(char, sr_data, sr_uid)
|
||||||
im += f' {avatarName}'
|
im += f' {avatarName}'
|
||||||
char_name_list.append(avatarName)
|
char_name_list.append(avatarName)
|
||||||
char_id_list.append(char['AvatarID'])
|
char_id_list.append(char['avatarId'])
|
||||||
|
|
||||||
if not char_name_list:
|
if not char_name_list:
|
||||||
im = f'UID: {sr_uid} 的角色展柜刷新失败!\n请检查UID是否正确或者角色展柜是否打开!'
|
im = f'UID: {sr_uid} 的角色展柜刷新失败!\n请检查UID是否正确或者角色展柜是否打开!'
|
||||||
@ -104,32 +110,32 @@ async def api_to_dict(
|
|||||||
|
|
||||||
|
|
||||||
async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
||||||
PlayerDetailInfo = sr_data['PlayerDetailInfo']
|
PlayerDetailInfo = sr_data['detailInfo']
|
||||||
path = PLAYER_PATH / str(sr_uid)
|
path = PLAYER_PATH / str(sr_uid)
|
||||||
# 处理基本信息
|
# 处理基本信息
|
||||||
char_data = {
|
char_data = {
|
||||||
'uid': str(sr_uid),
|
'uid': str(sr_uid),
|
||||||
'nickName': PlayerDetailInfo['NickName'],
|
'nickName': PlayerDetailInfo['nickname'],
|
||||||
'avatarId': char['AvatarID'],
|
'avatarId': char['avatarId'],
|
||||||
'avatarName': avatarId2Name[str(char['AvatarID'])],
|
'avatarName': avatarId2Name[str(char['avatarId'])],
|
||||||
'avatarElement': avatarId2DamageType[str(char['AvatarID'])],
|
'avatarElement': avatarId2DamageType[str(char['avatarId'])],
|
||||||
'avatarRarity': avatarId2Rarity[str(char['AvatarID'])],
|
'avatarRarity': avatarId2Rarity[str(char['avatarId'])],
|
||||||
'avatarPromotion': char.get('Promotion', 0),
|
'avatarPromotion': char.get('promotion', 0),
|
||||||
'avatarLevel': char['Level'],
|
'avatarLevel': char['level'],
|
||||||
'avatarSkill': [],
|
'avatarSkill': [],
|
||||||
'avatarExtraAbility': [],
|
'avatarExtraAbility': [],
|
||||||
'avatarAttributeBonus': [],
|
'avatarAttributeBonus': [],
|
||||||
'RelicInfo': [],
|
'RelicInfo': [],
|
||||||
}
|
}
|
||||||
avatarName = avatarId2Name[str(char['AvatarID'])]
|
avatarName = avatarId2Name[str(char['avatarId'])]
|
||||||
char_data['avatarEnName'] = avatarId2EnName[str(char['AvatarID'])]
|
char_data['avatarEnName'] = avatarId2EnName[str(char['avatarId'])]
|
||||||
# 处理技能
|
# 处理技能
|
||||||
for behavior in char['BehaviorList']:
|
for behavior in char['skillTreeList']:
|
||||||
# 处理技能
|
# 处理技能
|
||||||
if f'{char["AvatarID"]}0' == str(behavior['BehaviorID'])[0:5]:
|
if f'{char["avatarId"]}0' == str(behavior['pointId'])[0:5]:
|
||||||
skill_temp = {}
|
skill_temp = {}
|
||||||
skill_temp['skillId'] = (
|
skill_temp['skillId'] = (
|
||||||
char['AvatarID'] * 100 + behavior['BehaviorID'] % 10
|
char['avatarId'] * 100 + behavior['pointId'] % 10
|
||||||
)
|
)
|
||||||
skill_temp['skillName'] = skillId2Name[str(skill_temp['skillId'])]
|
skill_temp['skillName'] = skillId2Name[str(skill_temp['skillId'])]
|
||||||
skill_temp['skillEffect'] = skillId2Effect[
|
skill_temp['skillEffect'] = skillId2Effect[
|
||||||
@ -138,17 +144,17 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
skill_temp['skillAttackType'] = skillId2AttackType[
|
skill_temp['skillAttackType'] = skillId2AttackType[
|
||||||
str(skill_temp['skillId'])
|
str(skill_temp['skillId'])
|
||||||
]
|
]
|
||||||
skill_temp['skillLevel'] = behavior['Level']
|
skill_temp['skillLevel'] = behavior['level']
|
||||||
char_data['avatarSkill'].append(skill_temp)
|
char_data['avatarSkill'].append(skill_temp)
|
||||||
|
|
||||||
# 处理技能树中的额外能力
|
# 处理技能树中的额外能力
|
||||||
if f'{char["AvatarID"]}1' == str(behavior['BehaviorID'])[0:5]:
|
if f'{char["avatarId"]}1' == str(behavior['pointId'])[0:5]:
|
||||||
extra_ability_temp = {}
|
extra_ability_temp = {}
|
||||||
extra_ability_temp['extraAbilityId'] = behavior['BehaviorID']
|
extra_ability_temp['extraAbilityId'] = behavior['pointId']
|
||||||
extra_ability_temp['extraAbilityLevel'] = behavior['Level']
|
extra_ability_temp['extraAbilityLevel'] = behavior['level']
|
||||||
status_add = characterSkillTree[str(char['AvatarID'])][
|
status_add = characterSkillTree[str(char['avatarId'])][
|
||||||
str(behavior['BehaviorID'])
|
str(behavior['pointId'])
|
||||||
]['levels'][str(behavior['Level'])]['status_add']
|
]['levels'][str(behavior['level'])]['status_add']
|
||||||
extra_ability_temp['statusAdd'] = {}
|
extra_ability_temp['statusAdd'] = {}
|
||||||
if status_add != {}:
|
if status_add != {}:
|
||||||
extra_ability_temp['statusAdd']['property'] = status_add[
|
extra_ability_temp['statusAdd']['property'] = status_add[
|
||||||
@ -161,13 +167,13 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
char_data['avatarExtraAbility'].append(extra_ability_temp)
|
char_data['avatarExtraAbility'].append(extra_ability_temp)
|
||||||
|
|
||||||
# 处理技能树中的属性加成
|
# 处理技能树中的属性加成
|
||||||
if f'{char["AvatarID"]}2' == str(behavior['BehaviorID'])[0:5]:
|
if f'{char["avatarId"]}2' == str(behavior['pointId'])[0:5]:
|
||||||
attribute_bonus_temp = {}
|
attribute_bonus_temp = {}
|
||||||
attribute_bonus_temp['attributeBonusId'] = behavior['BehaviorID']
|
attribute_bonus_temp['attributeBonusId'] = behavior['pointId']
|
||||||
attribute_bonus_temp['attributeBonusLevel'] = behavior['Level']
|
attribute_bonus_temp['attributeBonusLevel'] = behavior['level']
|
||||||
status_add = characterSkillTree[str(char['AvatarID'])][
|
status_add = characterSkillTree[str(char['avatarId'])][
|
||||||
str(behavior['BehaviorID'])
|
str(behavior['pointId'])
|
||||||
]['levels'][str(behavior['Level'])]['status_add']
|
]['levels'][str(behavior['level'])]['status_add']
|
||||||
attribute_bonus_temp['statusAdd'] = {}
|
attribute_bonus_temp['statusAdd'] = {}
|
||||||
if status_add != {}:
|
if status_add != {}:
|
||||||
attribute_bonus_temp['statusAdd']['property'] = status_add[
|
attribute_bonus_temp['statusAdd']['property'] = status_add[
|
||||||
@ -182,23 +188,23 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
char_data['avatarAttributeBonus'].append(attribute_bonus_temp)
|
char_data['avatarAttributeBonus'].append(attribute_bonus_temp)
|
||||||
|
|
||||||
# 处理遗器
|
# 处理遗器
|
||||||
if char.get('RelicList'):
|
if char.get('relicList'):
|
||||||
for relic in char['RelicList']:
|
for relic in char['relicList']:
|
||||||
relic_temp = {}
|
relic_temp = {}
|
||||||
relic_temp['relicId'] = relic['ID']
|
relic_temp['relicId'] = relic['tid']
|
||||||
relic_temp['relicName'] = ItemId2Name[str(relic['ID'])]
|
relic_temp['relicName'] = ItemId2Name[str(relic['tid'])]
|
||||||
relic_temp['SetId'] = int(RelicId2SetId[str(relic['ID'])])
|
relic_temp['SetId'] = int(RelicId2SetId[str(relic['tid'])])
|
||||||
relic_temp['SetName'] = SetId2Name[str(relic_temp['SetId'])]
|
relic_temp['SetName'] = SetId2Name[str(relic_temp['SetId'])]
|
||||||
relic_temp['Level'] = relic['Level'] if 'Level' in relic else 0
|
relic_temp['Level'] = relic['level'] if 'level' in relic else 0
|
||||||
relic_temp['Type'] = relic['Type']
|
relic_temp['Type'] = relic['type']
|
||||||
|
|
||||||
relic_temp['MainAffix'] = {}
|
relic_temp['MainAffix'] = {}
|
||||||
relic_temp['MainAffix']['AffixID'] = relic['MainAffixID']
|
relic_temp['MainAffix']['AffixID'] = relic['mainAffixId']
|
||||||
affix_property, value = await cal_relic_main_affix(
|
affix_property, value = await cal_relic_main_affix(
|
||||||
relic_id=relic['ID'],
|
relic_id=relic['tid'],
|
||||||
set_id=str(relic_temp['SetId']),
|
set_id=str(relic_temp['SetId']),
|
||||||
affix_id=relic['MainAffixID'],
|
affix_id=relic['mainAffixId'],
|
||||||
relic_type=relic['Type'],
|
relic_type=relic['type'],
|
||||||
relic_level=relic_temp['Level'],
|
relic_level=relic_temp['Level'],
|
||||||
)
|
)
|
||||||
relic_temp['MainAffix']['Property'] = affix_property
|
relic_temp['MainAffix']['Property'] = affix_property
|
||||||
@ -206,21 +212,21 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
relic_temp['MainAffix']['Value'] = value
|
relic_temp['MainAffix']['Value'] = value
|
||||||
|
|
||||||
relic_temp['SubAffixList'] = []
|
relic_temp['SubAffixList'] = []
|
||||||
if relic.get('RelicSubAffix'):
|
if relic.get('subAffixList'):
|
||||||
for sub_affix in relic['RelicSubAffix']:
|
for sub_affix in relic['subAffixList']:
|
||||||
sub_affix_temp = {}
|
sub_affix_temp = {}
|
||||||
sub_affix_temp['SubAffixID'] = sub_affix['SubAffixID']
|
sub_affix_temp['SubAffixID'] = sub_affix['affixId']
|
||||||
sub_affix_property, value = await cal_relic_sub_affix(
|
sub_affix_property, value = await cal_relic_sub_affix(
|
||||||
relic_id=relic['ID'],
|
relic_id=relic['tid'],
|
||||||
affix_id=sub_affix['SubAffixID'],
|
affix_id=sub_affix['affixId'],
|
||||||
cnt=sub_affix['Cnt'],
|
cnt=sub_affix['cnt'],
|
||||||
step=sub_affix['Step'] if 'Step' in sub_affix else 0,
|
step=sub_affix['step'] if 'step' in sub_affix else 0,
|
||||||
)
|
)
|
||||||
sub_affix_temp['Property'] = sub_affix_property
|
sub_affix_temp['Property'] = sub_affix_property
|
||||||
sub_affix_temp['Name'] = Property2Name[sub_affix_property]
|
sub_affix_temp['Name'] = Property2Name[sub_affix_property]
|
||||||
sub_affix_temp['Cnt'] = sub_affix['Cnt']
|
sub_affix_temp['Cnt'] = sub_affix['cnt']
|
||||||
sub_affix_temp['Step'] = (
|
sub_affix_temp['Step'] = (
|
||||||
sub_affix['Step'] if 'Step' in sub_affix else 0
|
sub_affix['step'] if 'step' in sub_affix else 0
|
||||||
)
|
)
|
||||||
sub_affix_temp['Value'] = value
|
sub_affix_temp['Value'] = value
|
||||||
relic_temp['SubAffixList'].append(sub_affix_temp)
|
relic_temp['SubAffixList'].append(sub_affix_temp)
|
||||||
@ -228,11 +234,11 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
|
|
||||||
# 处理命座
|
# 处理命座
|
||||||
rank_temp = []
|
rank_temp = []
|
||||||
if 'Rank' in char:
|
if 'rank' in char:
|
||||||
char_data['rank'] = char['Rank']
|
char_data['rank'] = char['rank']
|
||||||
for index in range(char['Rank']):
|
for index in range(char['rank']):
|
||||||
rankTemp = {}
|
rankTemp = {}
|
||||||
rank_id = int(str(char['AvatarID']) + '0' + str(index + 1))
|
rank_id = int(str(char['avatarId']) + '0' + str(index + 1))
|
||||||
rankTemp['rankId'] = rank_id
|
rankTemp['rankId'] = rank_id
|
||||||
rankTemp['rankName'] = rankId2Name[str(rank_id)]
|
rankTemp['rankName'] = rankId2Name[str(rank_id)]
|
||||||
rank_temp.append(rankTemp)
|
rank_temp.append(rankTemp)
|
||||||
@ -240,26 +246,26 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
|
|
||||||
# 处理基础属性
|
# 处理基础属性
|
||||||
base_attributes = {}
|
base_attributes = {}
|
||||||
avatar_promotion_base = AvatarPromotion[str(char['AvatarID'])][
|
avatar_promotion_base = AvatarPromotion[str(char['avatarId'])][
|
||||||
str(char.get('Promotion', 0))
|
str(char.get('promotion', 0))
|
||||||
]
|
]
|
||||||
|
|
||||||
# 攻击力
|
# 攻击力
|
||||||
base_attributes['attack'] = str(
|
base_attributes['attack'] = str(
|
||||||
mp.mpf(avatar_promotion_base["AttackBase"]['Value'])
|
mp.mpf(avatar_promotion_base["AttackBase"]['Value'])
|
||||||
+ mp.mpf(avatar_promotion_base["AttackAdd"]['Value'])
|
+ mp.mpf(avatar_promotion_base["AttackAdd"]['Value'])
|
||||||
* (char['Level'] - 1)
|
* (char['level'] - 1)
|
||||||
)
|
)
|
||||||
# 防御力
|
# 防御力
|
||||||
base_attributes['defence'] = str(
|
base_attributes['defence'] = str(
|
||||||
mp.mpf(avatar_promotion_base["DefenceBase"]['Value'])
|
mp.mpf(avatar_promotion_base["DefenceBase"]['Value'])
|
||||||
+ mp.mpf(avatar_promotion_base["DefenceAdd"]['Value'])
|
+ mp.mpf(avatar_promotion_base["DefenceAdd"]['Value'])
|
||||||
* (char['Level'] - 1)
|
* (char['level'] - 1)
|
||||||
)
|
)
|
||||||
# 血量
|
# 血量
|
||||||
base_attributes['hp'] = str(
|
base_attributes['hp'] = str(
|
||||||
mp.mpf(avatar_promotion_base["HPBase"]['Value'])
|
mp.mpf(avatar_promotion_base["HPBase"]['Value'])
|
||||||
+ mp.mpf(avatar_promotion_base["HPAdd"]['Value']) * (char['Level'] - 1)
|
+ mp.mpf(avatar_promotion_base["HPAdd"]['Value']) * (char['level'] - 1)
|
||||||
)
|
)
|
||||||
# 速度
|
# 速度
|
||||||
base_attributes['speed'] = str(
|
base_attributes['speed'] = str(
|
||||||
@ -283,42 +289,42 @@ async def get_data(char: dict, sr_data: dict, sr_uid: str):
|
|||||||
# 处理武器
|
# 处理武器
|
||||||
|
|
||||||
equipment_info = {}
|
equipment_info = {}
|
||||||
if char['EquipmentID'] != {}:
|
if char.get('equipment'):
|
||||||
equipment_info['equipmentID'] = char['EquipmentID']['ID']
|
equipment_info['equipmentID'] = char['equipment']['tid']
|
||||||
equipment_info['equipmentName'] = EquipmentID2Name[
|
equipment_info['equipmentName'] = EquipmentID2Name[
|
||||||
str(equipment_info['equipmentID'])
|
str(char['equipment']['tid'])
|
||||||
]
|
]
|
||||||
|
|
||||||
equipment_info['equipmentLevel'] = char['EquipmentID']['Level']
|
equipment_info['equipmentLevel'] = char['equipment']['level']
|
||||||
equipment_info['equipmentPromotion'] = char['EquipmentID'].get(
|
equipment_info['equipmentPromotion'] = char['equipment'].get(
|
||||||
'Promotion', 0
|
'promotion', 0
|
||||||
)
|
)
|
||||||
equipment_info['equipmentRank'] = char['EquipmentID']['Rank']
|
equipment_info['equipmentRank'] = char['equipment']['rank']
|
||||||
equipment_info['equipmentRarity'] = EquipmentID2Rarity[
|
equipment_info['equipmentRarity'] = EquipmentID2Rarity[
|
||||||
str(equipment_info['equipmentID'])
|
str(char['equipment']['tid'])
|
||||||
]
|
]
|
||||||
equipment_base_attributes = {}
|
equipment_base_attributes = {}
|
||||||
equipment_promotion_base = EquipmentPromotion[
|
equipment_promotion_base = EquipmentPromotion[
|
||||||
str(equipment_info['equipmentID'])
|
str(char['equipment']['tid'])
|
||||||
][str(equipment_info['equipmentPromotion'])]
|
][str(equipment_info['equipmentPromotion'])]
|
||||||
|
|
||||||
# 生命值
|
# 生命值
|
||||||
equipment_base_attributes['hp'] = str(
|
equipment_base_attributes['hp'] = str(
|
||||||
mp.mpf(equipment_promotion_base["BaseHP"]['Value'])
|
mp.mpf(equipment_promotion_base["BaseHP"]['Value'])
|
||||||
+ mp.mpf(equipment_promotion_base["BaseHPAdd"]['Value'])
|
+ mp.mpf(equipment_promotion_base["BaseHPAdd"]['Value'])
|
||||||
* (equipment_info['equipmentLevel'] - 1)
|
* (char['equipment']['level'] - 1)
|
||||||
)
|
)
|
||||||
# 攻击力
|
# 攻击力
|
||||||
equipment_base_attributes['attack'] = str(
|
equipment_base_attributes['attack'] = str(
|
||||||
mp.mpf(equipment_promotion_base["BaseAttack"]['Value'])
|
mp.mpf(equipment_promotion_base["BaseAttack"]['Value'])
|
||||||
+ mp.mpf(equipment_promotion_base["BaseAttackAdd"]['Value'])
|
+ mp.mpf(equipment_promotion_base["BaseAttackAdd"]['Value'])
|
||||||
* (equipment_info['equipmentLevel'] - 1)
|
* (char['equipment']['level'] - 1)
|
||||||
)
|
)
|
||||||
# 防御力
|
# 防御力
|
||||||
equipment_base_attributes['defence'] = str(
|
equipment_base_attributes['defence'] = str(
|
||||||
mp.mpf(equipment_promotion_base["BaseDefence"]['Value'])
|
mp.mpf(equipment_promotion_base["BaseDefence"]['Value'])
|
||||||
+ mp.mpf(equipment_promotion_base["BaseDefenceAdd"]['Value'])
|
+ mp.mpf(equipment_promotion_base["BaseDefenceAdd"]['Value'])
|
||||||
* (equipment_info['equipmentLevel'] - 1)
|
* (char['equipment']['level'] - 1)
|
||||||
)
|
)
|
||||||
equipment_info['baseAttributes'] = equipment_base_attributes
|
equipment_info['baseAttributes'] = equipment_base_attributes
|
||||||
|
|
||||||
|
@ -1,57 +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": "速度"}
|
||||||
"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": "速度",
|
|
||||||
"SpeedAddedRatio": "速度百分比",
|
|
||||||
"AllDamageTypeAddedRatio": "所有属性伤害提高"
|
|
||||||
}
|
|
||||||
|
@ -1 +1 @@
|
|||||||
{"1001": "Ice", "1002": "Wind", "1003": "Fire", "1004": "Imaginary", "1005": "Thunder", "1006": "Quantum", "1008": "Thunder", "1009": "Fire", "1013": "Ice", "1101": "Wind", "1102": "Quantum", "1103": "Thunder", "1104": "Ice", "1105": "Physical", "1106": "Ice", "1107": "Physical", "1108": "Wind", "1109": "Fire", "1201": "Quantum", "1202": "Thunder", "1203": "Imaginary", "1204": "Thunder", "1206": "Physical", "1209": "Ice", "1211": "Thunder", "8001": "Physical", "8002": "Physical", "8003": "Fire", "8004": "Fire", "9100": "Physical"}
|
{"1001": "Ice", "1002": "Wind", "1003": "Fire", "1004": "Imaginary", "1005": "Thunder", "1006": "Quantum", "1008": "Thunder", "1009": "Fire", "1013": "Ice", "1101": "Wind", "1102": "Quantum", "1103": "Thunder", "1104": "Ice", "1105": "Physical", "1106": "Ice", "1107": "Physical", "1108": "Wind", "1109": "Fire", "1201": "Quantum", "1202": "Thunder", "1203": "Imaginary", "1204": "Thunder", "1206": "Physical", "1207": "Imaginary", "1209": "Ice", "1211": "Thunder", "8001": "Physical", "8002": "Physical", "8003": "Fire", "8004": "Fire"}
|
@ -1 +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}"}
|
{"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", "1207": "Yukong", "1209": "Yanqing", "1211": "Bailu", "8001": "{NICKNAME}", "8002": "{NICKNAME}", "8003": "{NICKNAME}", "8004": "{NICKNAME}"}
|
@ -1 +1 @@
|
|||||||
{"1001": "三月七", "1002": "丹恒", "1003": "姬子", "1004": "瓦尔特", "1005": "卡芙卡", "1006": "银狼", "1008": "阿兰", "1009": "艾丝妲", "1013": "黑塔", "1101": "布洛妮娅", "1102": "希儿", "1103": "希露瓦", "1104": "杰帕德", "1105": "娜塔莎", "1106": "佩拉", "1107": "克拉拉", "1108": "桑博", "1109": "虎克", "1201": "青雀", "1202": "停云", "1203": "罗刹", "1204": "景元", "1206": "素裳", "1209": "彦卿", "1211": "白露", "8001": "开拓者", "8002": "开拓者", "8003": "开拓者", "8004": "开拓者", "9100": "dev_测试用白板"}
|
{"1001": "三月七", "1002": "丹恒", "1003": "姬子", "1004": "瓦尔特", "1005": "卡芙卡", "1006": "银狼", "1008": "阿兰", "1009": "艾丝妲", "1013": "黑塔", "1101": "布洛妮娅", "1102": "希儿", "1103": "希露瓦", "1104": "杰帕德", "1105": "娜塔莎", "1106": "佩拉", "1107": "克拉拉", "1108": "桑博", "1109": "虎克", "1201": "青雀", "1202": "停云", "1203": "罗刹", "1204": "景元", "1206": "素裳", "1207": "驭空", "1209": "彦卿", "1211": "白露", "8001": "开拓者", "8002": "开拓者", "8003": "开拓者", "8004": "开拓者"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
|||||||
StarRailUID_version = '0.1.0'
|
StarRailUID_version = '0.1.0'
|
||||||
StarRail_version = '1.0.5'
|
StarRail_version = '1.1.0'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user