mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-06 11:43:44 +08:00
🚨 pre-commit-ci
修复格式错误
This commit is contained in:
parent
36a68e6057
commit
a2a1f1ee20
@ -1,13 +1,15 @@
|
|||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from typing import Dict, List, Union
|
from typing import Dict, List, Union
|
||||||
|
|
||||||
from .effect.Role import RoleInstance
|
from .effect.Role import RoleInstance
|
||||||
from .mono.Character import Character
|
from .mono.Character import Character
|
||||||
|
|
||||||
Excel_path = Path(__file__).parent / 'effect'
|
Excel_path = Path(__file__).parent / 'effect'
|
||||||
with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||||
skill_dict = json.load(f)
|
skill_dict = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
async def cal_char_info(char_data: Dict):
|
async def cal_char_info(char_data: Dict):
|
||||||
char: Character = Character(char_data)
|
char: Character = Character(char_data)
|
||||||
await char.get_equipment_info()
|
await char.get_equipment_info()
|
||||||
|
@ -87,7 +87,9 @@ class Clara(BaseAvatar):
|
|||||||
def extra_ability(self):
|
def extra_ability(self):
|
||||||
logger.info('额外能力')
|
logger.info('额外能力')
|
||||||
logger.info('史瓦罗的反击造成的伤害提高30%')
|
logger.info('史瓦罗的反击造成的伤害提高30%')
|
||||||
self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num('Talent', 'Talent')
|
self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num(
|
||||||
|
'Talent', 'Talent'
|
||||||
|
)
|
||||||
self.extra_ability_attribute['TalentDmgAdd'] = 0.3
|
self.extra_ability_attribute['TalentDmgAdd'] = 0.3
|
||||||
self.extra_ability_attribute['UltraDmgAdd'] = 0.3
|
self.extra_ability_attribute['UltraDmgAdd'] = 0.3
|
||||||
|
|
||||||
@ -325,8 +327,12 @@ class Welt(BaseAvatar):
|
|||||||
|
|
||||||
def eidolons(self):
|
def eidolons(self):
|
||||||
if self.avatar_rank >= 1:
|
if self.avatar_rank >= 1:
|
||||||
self.eidolon_attribute['NormalSkillAdd'] = self.Skill_num('Normal', 'Normal') * 0.5
|
self.eidolon_attribute['NormalSkillAdd'] = (
|
||||||
self.eidolon_attribute['BPSkillSkillAdd'] = self.Skill_num('BPSkill', 'BPSkill') * 0.8
|
self.Skill_num('Normal', 'Normal') * 0.5
|
||||||
|
)
|
||||||
|
self.eidolon_attribute['BPSkillSkillAdd'] = (
|
||||||
|
self.Skill_num('BPSkill', 'BPSkill') * 0.8
|
||||||
|
)
|
||||||
|
|
||||||
def extra_ability(self):
|
def extra_ability(self):
|
||||||
logger.info('额外能力')
|
logger.info('额外能力')
|
||||||
@ -469,7 +475,9 @@ class Topaz(BaseAvatar):
|
|||||||
self.eidolon_attribute['Talent1_FireResistancePenetration'] = 0.1
|
self.eidolon_attribute['Talent1_FireResistancePenetration'] = 0.1
|
||||||
|
|
||||||
def extra_ability(self):
|
def extra_ability(self):
|
||||||
self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num('Ultra', 'Talent1')
|
self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num(
|
||||||
|
'Ultra', 'Talent1'
|
||||||
|
)
|
||||||
logger.info('额外能力')
|
logger.info('额外能力')
|
||||||
logger.info('托帕和账账对拥有火属性弱点的敌方目标造成的伤害提高15%。')
|
logger.info('托帕和账账对拥有火属性弱点的敌方目标造成的伤害提高15%。')
|
||||||
self.extra_ability_attribute['AllDamageAddedRatio'] = 0.15
|
self.extra_ability_attribute['AllDamageAddedRatio'] = 0.15
|
||||||
@ -482,6 +490,7 @@ class Topaz(BaseAvatar):
|
|||||||
'BPSkill_add'
|
'BPSkill_add'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Guinaifen(BaseAvatar):
|
class Guinaifen(BaseAvatar):
|
||||||
Buff: BaseAvatarBuff
|
Buff: BaseAvatarBuff
|
||||||
|
|
||||||
@ -504,9 +513,14 @@ class Guinaifen(BaseAvatar):
|
|||||||
def extra_ability(self):
|
def extra_ability(self):
|
||||||
self.extra_ability_attribute['AllDamageAddedRatio'] = 0.2
|
self.extra_ability_attribute['AllDamageAddedRatio'] = 0.2
|
||||||
if self.avatar_rank >= 6:
|
if self.avatar_rank >= 6:
|
||||||
self.extra_ability_attribute['DmgRatio'] = self.Talent_num('Talent') * 4
|
self.extra_ability_attribute['DmgRatio'] = (
|
||||||
|
self.Talent_num('Talent') * 4
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.extra_ability_attribute['DmgRatio'] = self.Talent_num('Talent') * 3
|
self.extra_ability_attribute['DmgRatio'] = (
|
||||||
|
self.Talent_num('Talent') * 3
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Avatar:
|
class Avatar:
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -78,12 +78,16 @@ class BaseRelicSetSkill:
|
|||||||
set_property = status_add.Property
|
set_property = status_add.Property
|
||||||
set_value = status_add.Value
|
set_value = status_add.Value
|
||||||
if set_property != '':
|
if set_property != '':
|
||||||
relic_set_attribute[set_property] = relic_set_attribute.get(set_property, 0) + set_value
|
relic_set_attribute[set_property] = (
|
||||||
|
relic_set_attribute.get(set_property, 0) + set_value
|
||||||
|
)
|
||||||
if self.pieces4:
|
if self.pieces4:
|
||||||
status_add = RelicSetSkill.RelicSet[str(self.setId)]['4']
|
status_add = RelicSetSkill.RelicSet[str(self.setId)]['4']
|
||||||
if status_add:
|
if status_add:
|
||||||
set_property = status_add.Property
|
set_property = status_add.Property
|
||||||
set_value = status_add.Value
|
set_value = status_add.Value
|
||||||
if set_property != '':
|
if set_property != '':
|
||||||
relic_set_attribute[set_property] = relic_set_attribute.get(set_property, 0) + set_value
|
relic_set_attribute[set_property] = (
|
||||||
|
relic_set_attribute.get(set_property, 0) + set_value
|
||||||
|
)
|
||||||
return relic_set_attribute
|
return relic_set_attribute
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from typing import List, Union
|
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import List, Union
|
||||||
|
|
||||||
from gsuid_core.logger import logger
|
from gsuid_core.logger import logger
|
||||||
|
|
||||||
from .Avatar.Avatar import Avatar
|
from .Avatar.Avatar import Avatar
|
||||||
@ -13,6 +14,8 @@ from .Relic.Relic import RelicSet, SingleRelic
|
|||||||
Excel_path = Path(__file__).parent
|
Excel_path = Path(__file__).parent
|
||||||
with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f:
|
||||||
skill_dict = json.load(f)
|
skill_dict = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
class RoleInstance:
|
class RoleInstance:
|
||||||
def __init__(self, raw_data: Character):
|
def __init__(self, raw_data: Character):
|
||||||
self.raw_data = DamageInstance(raw_data)
|
self.raw_data = DamageInstance(raw_data)
|
||||||
@ -134,7 +137,9 @@ class RoleInstance:
|
|||||||
logger.info(
|
logger.info(
|
||||||
f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成'
|
f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成'
|
||||||
)
|
)
|
||||||
skill_multiplier = skill_multiplier + self.attribute_bonus[attr]
|
skill_multiplier = (
|
||||||
|
skill_multiplier + self.attribute_bonus[attr]
|
||||||
|
)
|
||||||
|
|
||||||
logger.info(f'技能区总: {skill_multiplier}')
|
logger.info(f'技能区总: {skill_multiplier}')
|
||||||
|
|
||||||
@ -217,7 +222,9 @@ class RoleInstance:
|
|||||||
hp_num = merged_attr['hp']
|
hp_num = merged_attr['hp']
|
||||||
skill_type_hp = skill_type + '_HP'
|
skill_type_hp = skill_type + '_HP'
|
||||||
if skill_type_hp in skill_dict[str(self.raw_data.avatar.id_)]:
|
if skill_type_hp in skill_dict[str(self.raw_data.avatar.id_)]:
|
||||||
hp_multiplier = self.avatar.Skill_num(skill_info[4], skill_type_hp)
|
hp_multiplier = self.avatar.Skill_num(
|
||||||
|
skill_info[4], skill_type_hp
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
hp_multiplier = 0
|
hp_multiplier = 0
|
||||||
for attr in self.attribute_bonus:
|
for attr in self.attribute_bonus:
|
||||||
@ -227,7 +234,9 @@ class RoleInstance:
|
|||||||
logger.info(
|
logger.info(
|
||||||
f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成'
|
f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成'
|
||||||
)
|
)
|
||||||
hp_multiplier = hp_multiplier + self.attribute_bonus[attr]
|
hp_multiplier = (
|
||||||
|
hp_multiplier + self.attribute_bonus[attr]
|
||||||
|
)
|
||||||
|
|
||||||
if skill_type == 'Talent':
|
if skill_type == 'Talent':
|
||||||
if (
|
if (
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import json
|
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
from loguru import logger
|
|
||||||
|
|
||||||
from ...utils.map.SR_MAP_PATH import RelicSetSkill, EquipmentID2AbilityProperty
|
from ...utils.map.SR_MAP_PATH import RelicSetSkill, EquipmentID2AbilityProperty
|
||||||
|
|
||||||
@ -53,7 +51,9 @@ class Character:
|
|||||||
for equip_ability in equip_ability_property:
|
for equip_ability in equip_ability_property:
|
||||||
property_type = equip_ability['PropertyType']
|
property_type = equip_ability['PropertyType']
|
||||||
value = equip_ability['Value']['Value']
|
value = equip_ability['Value']['Value']
|
||||||
self.add_attr[property_type] = value + self.add_attr.get(property_type, 0)
|
self.add_attr[property_type] = value + self.add_attr.get(
|
||||||
|
property_type, 0
|
||||||
|
)
|
||||||
|
|
||||||
async def get_char_attribute_bonus(self):
|
async def get_char_attribute_bonus(self):
|
||||||
attribute_bonus = self.attribute_bonus
|
attribute_bonus = self.attribute_bonus
|
||||||
@ -61,7 +61,9 @@ class Character:
|
|||||||
status_add = bonus['statusAdd']
|
status_add = bonus['statusAdd']
|
||||||
bonus_property = status_add['property']
|
bonus_property = status_add['property']
|
||||||
value = status_add['value']
|
value = status_add['value']
|
||||||
self.add_attr[bonus_property] = value + self.add_attr.get(bonus_property, 0)
|
self.add_attr[bonus_property] = value + self.add_attr.get(
|
||||||
|
bonus_property, 0
|
||||||
|
)
|
||||||
|
|
||||||
async def get_relic_info(self):
|
async def get_relic_info(self):
|
||||||
# 计算圣遗物效果
|
# 计算圣遗物效果
|
||||||
@ -71,12 +73,16 @@ class Character:
|
|||||||
# 处理主属性
|
# 处理主属性
|
||||||
relic_property = relic['MainAffix']['Property']
|
relic_property = relic['MainAffix']['Property']
|
||||||
property_value = relic['MainAffix']['Value']
|
property_value = relic['MainAffix']['Value']
|
||||||
self.add_attr[relic_property] = property_value + self.add_attr.get(relic_property, 0)
|
self.add_attr[relic_property] = property_value + self.add_attr.get(
|
||||||
|
relic_property, 0
|
||||||
|
)
|
||||||
# 处理副词条
|
# 处理副词条
|
||||||
for sub in relic['SubAffixList']:
|
for sub in relic['SubAffixList']:
|
||||||
sub_property = sub['Property']
|
sub_property = sub['Property']
|
||||||
sub_value = sub['Value']
|
sub_value = sub['Value']
|
||||||
self.add_attr[sub_property] = sub_value + self.add_attr.get(sub_property, 0)
|
self.add_attr[sub_property] = sub_value + self.add_attr.get(
|
||||||
|
sub_property, 0
|
||||||
|
)
|
||||||
# 处理套装属性
|
# 处理套装属性
|
||||||
set_id_dict = Counter(set_id_list)
|
set_id_dict = Counter(set_id_list)
|
||||||
# logger.info(set_id_dict.most_common())
|
# logger.info(set_id_dict.most_common())
|
||||||
@ -91,14 +97,18 @@ class Character:
|
|||||||
set_property = status_add.Property
|
set_property = status_add.Property
|
||||||
set_value = status_add.Value
|
set_value = status_add.Value
|
||||||
if set_property != '':
|
if set_property != '':
|
||||||
self.add_attr[set_property] = set_value + self.add_attr.get(set_property, 0)
|
self.add_attr[
|
||||||
|
set_property
|
||||||
|
] = set_value + self.add_attr.get(set_property, 0)
|
||||||
if count == 4:
|
if count == 4:
|
||||||
status_add = RelicSetSkill.RelicSet[str(set_id)]['4']
|
status_add = RelicSetSkill.RelicSet[str(set_id)]['4']
|
||||||
if status_add:
|
if status_add:
|
||||||
set_property = status_add.Property
|
set_property = status_add.Property
|
||||||
set_value = status_add.Value
|
set_value = status_add.Value
|
||||||
if set_property != '':
|
if set_property != '':
|
||||||
self.add_attr[set_property] = set_value + self.add_attr.get(set_property, 0)
|
self.add_attr[
|
||||||
|
set_property
|
||||||
|
] = set_value + self.add_attr.get(set_property, 0)
|
||||||
|
|
||||||
# logger.info(json.dumps(self.base_attributes))
|
# logger.info(json.dumps(self.base_attributes))
|
||||||
# logger.info(json.dumps(self.add_attr))
|
# logger.info(json.dumps(self.add_attr))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user