diff --git a/StarRailUID/starrailuid_charinfo/__init__.py b/StarRailUID/starrailuid_charinfo/__init__.py index c4511fb..73dccf9 100644 --- a/StarRailUID/starrailuid_charinfo/__init__.py +++ b/StarRailUID/starrailuid_charinfo/__init__.py @@ -7,7 +7,7 @@ from gsuid_core.sv import SV from gsuid_core.bot import Bot from gsuid_core.models import Event -from .cal_damage import cal, cal_info +from .cal_damage import cal_info from .to_card import api_to_card from ..utils.convert import get_uid from ..utils.sr_prefix import PREFIX @@ -22,33 +22,6 @@ sv_get_char_info = SV('sr面板查询', priority=10) sv_get_sr_original_pic = SV('sr查看面板原图', priority=5) sv_char_damage_cal = SV('sr伤害计算') - -@sv_char_damage_cal.on_prefix(f'{PREFIX}伤害计算') -async def send_damage_msg(bot: Bot, ev: Event): - msg = ''.join(re.findall('[\u4e00-\u9fa5 ]', ev.text)) - if not msg: - return None - await bot.logger.info('开始执行[角色伤害计算]') - # 获取uid - sr_uid = await get_uid(bot, ev) - if sr_uid is None: - return await bot.send(UID_HINT) - await bot.logger.info(f'[角色伤害计算]uid: {sr_uid}') - char_name = ' '.join(re.findall('[\u4e00-\u9fa5]+', msg)) - - char_data = await get_char_data(sr_uid, char_name) - if isinstance(char_data, str): - return await bot.send(char_data) - im_list = [] - im = await cal(char_data) - for info_im in im: - con = f"{info_im[0]}" - con = f"{con} 暴击伤害{info_im[1]} 期望伤害{info_im[2]} 满配辅助末日兽伤害{info_im[3]}" - im_list.append(con) - await bot.send(im_list) - return None - - @sv_get_char_info.on_prefix(f'{PREFIX}查询') async def send_char_info(bot: Bot, ev: Event): im = await _get_char_info(bot, ev, ev.text) diff --git a/StarRailUID/starrailuid_charinfo/cal_damage.py b/StarRailUID/starrailuid_charinfo/cal_damage.py index f37732a..ffbfcb6 100644 --- a/StarRailUID/starrailuid_charinfo/cal_damage.py +++ b/StarRailUID/starrailuid_charinfo/cal_damage.py @@ -1,16 +1,9 @@ import json from pathlib import Path from typing import Dict, List, Union - -from .effect.Role import RoleInstance from .mono.Character import Character from .damage.Avatar import AvatarInstance -Excel_path = Path(__file__).parent / 'effect' -with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f: - skill_dict = json.load(f) - - async def cal_char_info(char_data: Dict): char: Character = Character(char_data) await char.get_equipment_info() @@ -18,22 +11,6 @@ async def cal_char_info(char_data: Dict): await char.get_relic_info() return char - -async def cal(char_data: Dict): - char = await cal_char_info(char_data) - - skill_info_list: List[List[Union[str, float]]] = [] - if str(char.char_id) in skill_dict: - skill_list = skill_dict[str(char.char_id)]['skillList'] - skill_list = skill_list.keys() - for skill_type in skill_list: - role = RoleInstance(char) - im_tmp = await role.cal_damage(skill_type) - skill_info_list.append(im_tmp) - return skill_info_list - return '角色伤害计算未完成' - - async def cal_info(char_data: Dict): char = await cal_char_info(char_data) avatar = AvatarInstance(char) diff --git a/StarRailUID/starrailuid_charinfo/damage/AvatarDamage/AvatarDamage.py b/StarRailUID/starrailuid_charinfo/damage/AvatarDamage/AvatarDamage.py index 6472470..3a48664 100644 --- a/StarRailUID/starrailuid_charinfo/damage/AvatarDamage/AvatarDamage.py +++ b/StarRailUID/starrailuid_charinfo/damage/AvatarDamage/AvatarDamage.py @@ -3,7 +3,7 @@ from typing import Dict, List from gsuid_core.logger import logger -from ..Role import calculate_damage +from ..Role import calculate_damage, calculate_shield, calculate_heal from ..Base.AvatarBase import BaseAvatar, BaseAvatarBuff from ..Base.model import DamageInstanceSkill, DamageInstanceAvatar @@ -1285,9 +1285,19 @@ class Fuxuan(BaseAvatar): self.avatar_level, 1, ) - damagelist2[2] += damage3 + damagelist2[2] += damage2 skill_info_list.append({'name': '终结技', 'damagelist': damagelist2}) + # 计算终结技治疗 + damagelist3 = await calculate_heal( + base_attr, + attribute_bonus, + 'Ultra', + 0.05, + 133, + ) + skill_info_list.append({'name': '终结技治疗', 'damagelist': damagelist3}) + return skill_info_list class Yanqing(BaseAvatar): @@ -1919,18 +1929,560 @@ class Guinaifen(BaseAvatar): skill_info_list.append({'name': '单次持续伤害', 'damagelist': damagelist4}) return skill_info_list - + +class Gepard(BaseAvatar): + Buff: BaseAvatarBuff + + def __init__( + self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] + ): + super().__init__(char=char, skills=skills) + self.eidolon_attribute: Dict[str, float] = {} + self.extra_ability_attribute: Dict[str, float] = {} + self.eidolons() + self.extra_ability() + + def Technique(self): + pass + + def eidolons(self): + pass + + def extra_ability(self): + pass + + async def getdamage( + self, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + damage1, damage2, damage3 = await calculate_damage( + base_attr, + attribute_bonus, + 'fujia', + 'fujia', + 'Thunder', + 0.44, + self.avatar_level, + ) + + skill_info_list = [] + # 计算普攻伤害 + skill_multiplier = self.Skill_num('Normal', 'Normal') + damagelist1 = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist1[2] += damage3 + skill_info_list.append({'name': '普攻', 'damagelist': damagelist1}) + + # 计算战技伤害 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill') + damagelist2 = await calculate_damage( + base_attr, + attribute_bonus, + 'BPSkill', + 'BPSkill', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist2[2] += damage3 + skill_info_list.append({'name': '战技', 'damagelist': damagelist2}) + + # 计算终结技护盾 + skill_multiplier = self.Skill_num('Ultra', 'Ultra') + skill_num = self.Skill_num('Ultra', 'Ultra_G') + damagelist3 = await calculate_shield( + base_attr, + attribute_bonus, + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '终结技(护盾)', 'damagelist': damagelist3}) + + return skill_info_list + +class Luocha(BaseAvatar): + Buff: BaseAvatarBuff + + def __init__( + self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] + ): + super().__init__(char=char, skills=skills) + self.eidolon_attribute: Dict[str, float] = {} + self.extra_ability_attribute: Dict[str, float] = {} + self.eidolons() + self.extra_ability() + + def Technique(self): + pass + + def eidolons(self): + if self.avatar_rank >= 1: + self.eidolon_attribute['AttackAddedRatio'] = 0.2 + if self.avatar_rank >= 6: + self.eidolon_attribute['ResistancePenetration'] = 0.2 + + def extra_ability(self): + pass + + async def getdamage( + self, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + damage1, damage2, damage3 = await calculate_damage( + base_attr, + attribute_bonus, + 'fujia', + 'fujia', + 'Thunder', + 0.44, + self.avatar_level, + ) + + skill_info_list = [] + # 计算普攻伤害 + skill_multiplier = self.Skill_num('Normal', 'Normal') + damagelist1 = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist1[2] += damage3 + skill_info_list.append({'name': '普攻', 'damagelist': damagelist1}) + + # 计算终结技伤害 + skill_multiplier = self.Skill_num('Ultra', 'Ultra') + damagelist2 = await calculate_damage( + base_attr, + attribute_bonus, + 'Ultra', + 'Ultra', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist2[2] += damage3 + skill_info_list.append({'name': '终结技', 'damagelist': damagelist2}) + + # 计算战技治疗 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill') + skill_num = self.Skill_num('BPSkill', 'BPSkill_G') + damagelist3 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + 1, + ) + skill_info_list.append({'name': '战技治疗量', 'damagelist': damagelist3}) + if self.avatar_rank >= 2: + add_attr_bonus = copy.deepcopy(attribute_bonus) + add_attr_bonus['HealRatioBase'] = add_attr_bonus.get('HealRatioBase', 0) + 0.3 + damagelist4 = await calculate_heal( + base_attr, + add_attr_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + 1, + ) + skill_info_list.append({'name': '战技治疗量(生命<50%)(2魂)', 'damagelist': damagelist4}) + + damagelist5 = await calculate_shield( + base_attr, + attribute_bonus, + 0.18, + 240, + 1, + ) + skill_info_list.append({'name': '战技护盾量(生命>50%)(2魂)', 'damagelist': damagelist5}) + + # 计算天赋治疗量 + skill_multiplier = self.Skill_num('Talent', 'Talent') + skill_num = self.Skill_num('Talent', 'Talent_G') + damagelist6 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + 1, + ) + skill_info_list.append({'name': '天赋治疗量', 'damagelist': damagelist6}) + + # 计算技能树额外能力治疗量 + damagelist7 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + 0.07, + 93, + 1, + ) + skill_info_list.append({'name': '技能树治疗量', 'damagelist': damagelist7}) + + return skill_info_list + +class Bailu(BaseAvatar): + Buff: BaseAvatarBuff + + def __init__( + self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] + ): + super().__init__(char=char, skills=skills) + self.eidolon_attribute: Dict[str, float] = {} + self.extra_ability_attribute: Dict[str, float] = {} + self.eidolons() + self.extra_ability() + + def Technique(self): + pass + + def eidolons(self): + if self.avatar_rank >= 2: + self.eidolon_attribute['HealRatioBase'] = 0.15 + if self.avatar_rank >= 4: + self.eidolon_attribute['AllDamageAddedRatio'] = 0.3 + + def extra_ability(self): + self.extra_ability_attribute['HPAddedRatio'] = 0.10 + + async def getdamage( + self, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + damage1, damage2, damage3 = await calculate_damage( + base_attr, + attribute_bonus, + 'fujia', + 'fujia', + 'Thunder', + 0.44, + self.avatar_level, + ) + + skill_info_list = [] + # 计算普攻伤害 + skill_multiplier = self.Skill_num('Normal', 'Normal') + damagelist1 = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist1[2] += damage3 + skill_info_list.append({'name': '普攻', 'damagelist': damagelist1}) + + # 计算战技治疗 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill') + skill_num = self.Skill_num('BPSkill', 'BPSkill_G') + damagelist2 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + ) + heal_num = damagelist2[0] + for i in range(1, 3): + beilv = 1 - (i * 0.15) + damagelist2[0] = damagelist2[0] + heal_num * beilv + skill_info_list.append({'name': '战技治疗量', 'damagelist': damagelist2}) + + # 计算终结技治疗量 + skill_multiplier = self.Skill_num('Ultra', 'Ultra') + skill_num = self.Skill_num('Ultra', 'Ultra_G') + damagelist3 = await calculate_heal( + base_attr, + attribute_bonus, + 'Ultra', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '终结技治疗量', 'damagelist': damagelist3}) + + # 计算天赋生息治疗量 + skill_multiplier = self.Skill_num('Talent', 'Talent') + skill_num = self.Skill_num('Talent', 'Talent_G') + damagelist4 = await calculate_heal( + base_attr, + attribute_bonus, + 'Talent', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '天赋[生息]治疗量', 'damagelist': damagelist4}) + + # 计算天赋复活治疗量 + skill_multiplier = self.Skill_num('Talent', 'Talent1') + skill_num = self.Skill_num('Talent', 'Talent1_G') + damagelist5 = await calculate_heal( + base_attr, + attribute_bonus, + 'Talent', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '天赋[复活]治疗量', 'damagelist': damagelist5}) + + return skill_info_list + +class Lynx(BaseAvatar): + Buff: BaseAvatarBuff + + def __init__( + self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] + ): + super().__init__(char=char, skills=skills) + self.eidolon_attribute: Dict[str, float] = {} + self.extra_ability_attribute: Dict[str, float] = {} + self.eidolons() + self.extra_ability() + + def Technique(self): + pass + + def eidolons(self): + if self.avatar_rank >= 1: + self.eidolon_attribute['HealRatioBase'] = 0.2 + + def extra_ability(self): + pass + + async def getdamage( + self, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + damage1, damage2, damage3 = await calculate_damage( + base_attr, + attribute_bonus, + 'fujia', + 'fujia', + 'Thunder', + 0.44, + self.avatar_level, + ) + + # 计算战技生命上限 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill_HP') + skill_num = self.Skill_num('BPSkill', 'BPSkill_HP_G') + if self.avatar_rank >= 6: + skill_multiplier += 0.06 + hp = base_attr['hp'] * (1 + attribute_bonus['HPAddedRatio']) + attribute_bonus['HPDelta'] + hp_add = hp * skill_multiplier + skill_num + attribute_bonus['HPDelta'] = attribute_bonus.get('HPDelta', 0) + hp_add + + skill_info_list = [] + # 计算普攻伤害 + skill_multiplier = self.Skill_num('Normal', 'Normal_HP') + damagelist1 = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + skill_multiplier, + self.avatar_level, + 1, + ) + damagelist1[2] += damage3 + skill_info_list.append({'name': '普攻', 'damagelist': damagelist1}) + + # 计算战技治疗 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill') + skill_num = self.Skill_num('BPSkill', 'BPSkill_G') + damagelist2 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '战技治疗量', 'damagelist': damagelist2}) + damagelist3 = [] + damagelist3.append(hp_add) + skill_info_list.append({'name': '[求生反应]生命上限', 'damagelist': damagelist3}) + + # 计算终结技治疗量 + skill_multiplier = self.Skill_num('Ultra', 'Ultra') + skill_num = self.Skill_num('Ultra', 'Ultra_G') + damagelist4 = await calculate_heal( + base_attr, + attribute_bonus, + 'Ultra', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '终结技治疗量', 'damagelist': damagelist4}) + + # 计算天赋治疗量 + skill_multiplier = self.Skill_num('Talent', 'Talent') + skill_num = self.Skill_num('Talent', 'Talent_G') + damagelist5 = await calculate_heal( + base_attr, + attribute_bonus, + 'Talent', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '天赋缓回治疗量', 'damagelist': damagelist5}) + + # 计算天赋求生反应治疗量 + skill_multiplier = self.Skill_num('Talent', 'Talent1') + self.Skill_num('Talent', 'Talent') + skill_num = self.Skill_num('Talent', 'Talent1_G') + self.Skill_num('Talent', 'Talent_G') + damagelist6 = await calculate_heal( + base_attr, + attribute_bonus, + 'Talent', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '天赋[求生反应]缓回治疗量', 'damagelist': damagelist6}) + + return skill_info_list + +class Natasha(BaseAvatar): + Buff: BaseAvatarBuff + + def __init__( + self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] + ): + super().__init__(char=char, skills=skills) + self.eidolon_attribute: Dict[str, float] = {} + self.extra_ability_attribute: Dict[str, float] = {} + self.eidolons() + self.extra_ability() + + def Technique(self): + pass + + def eidolons(self): + pass + + def extra_ability(self): + self.extra_ability_attribute['HealRatioBase'] = 0.1 + self.Skill_num('Talent', 'Talent') + + async def getdamage( + self, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + damage1, damage2, damage3 = await calculate_damage( + base_attr, + attribute_bonus, + 'fujia', + 'fujia', + 'Thunder', + 0.44, + self.avatar_level, + ) + + skill_info_list = [] + # 计算普攻伤害 + skill_multiplier = self.Skill_num('Normal', 'Normal') + damagelist1 = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + skill_multiplier, + self.avatar_level, + ) + damagelist1[2] += damage3 + if self.avatar_rank >= 6: + damagelist_add = await calculate_damage( + base_attr, + attribute_bonus, + 'Normal', + 'Normal', + self.avatar_element, + 0.4, + self.avatar_level, + 1, + ) + damagelist1[0] += damagelist_add[0] + damagelist1[1] += damagelist_add[1] + damagelist1[2] += damagelist_add[2] + skill_info_list.append({'name': '普攻', 'damagelist': damagelist1}) + + # 计算战技治疗 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill') + skill_num = self.Skill_num('BPSkill', 'BPSkill_G') + damagelist2 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '战技治疗量', 'damagelist': damagelist2}) + + # 计算战技缓回治疗量 + skill_multiplier = self.Skill_num('BPSkill', 'BPSkill1') + skill_num = self.Skill_num('BPSkill', 'BPSkill1_G') + damagelist3 = await calculate_heal( + base_attr, + attribute_bonus, + 'BPSkill', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '战技缓回治疗量', 'damagelist': damagelist3}) + + # 计算终结技治疗量 + skill_multiplier = self.Skill_num('Ultra', 'Ultra') + skill_num = self.Skill_num('Ultra', 'Ultra_G') + damagelist4 = await calculate_heal( + base_attr, + attribute_bonus, + 'Ultra', + skill_multiplier, + skill_num, + ) + skill_info_list.append({'name': '终结技治疗量', 'damagelist': damagelist4}) + + return skill_info_list + class AvatarDamage: @classmethod def create( cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] ): + if char.id_ == 1105: + return Natasha(char, skills) + if char.id_ == 1110: + return Lynx(char, skills) + if char.id_ == 1211: + return Bailu(char, skills) + if char.id_ == 1203: + return Luocha(char, skills) if char.id_ == 1210: return Guinaifen(char, skills) if char.id_ == 1302: return Argenti(char, skills) if char.id_ == 1112: return Topaz(char, skills) + if char.id_ == 1104: + return Gepard(char, skills) if char.id_ == 1005: return Kafka(char, skills) if char.id_ == 1201: diff --git a/StarRailUID/starrailuid_charinfo/damage/Excel/SkillData.json b/StarRailUID/starrailuid_charinfo/damage/Excel/SkillData.json index c324246..af03190 100644 --- a/StarRailUID/starrailuid_charinfo/damage/Excel/SkillData.json +++ b/StarRailUID/starrailuid_charinfo/damage/Excel/SkillData.json @@ -27,12 +27,7 @@ 0.9200000008568168, 0.9600000008940697, 1 ], "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [120] }, "1204": { "Normal": [ @@ -64,13 +59,7 @@ 7.920000000372529, 8.250000000372529 ], "Maze": [20], - "Ultra_Use": [130], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "10层神君", 1, "Talent", "Talent"] - } + "Ultra_Use": [130] }, "1107": { "Normal": [ @@ -101,13 +90,7 @@ 1.840000000372529, 1.920000000372529, 2.000000000372529 ], "Maze": [20], - "Ultra_Use": [130], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Talent": ["attack", "反击", 1, "Talent", "Talent"], - "Talent1": ["attack", "强化反击", 1, "Talent", "Ultra"] - } + "Ultra_Use": [130] }, "1213": { "Normal": [ @@ -153,14 +136,7 @@ 0.115000000372529, 0.120000000372529, 0.125000000372529 ], "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 2, "Normal", "Normal"], - "Normal1": ["attack", "瞬华", 3, "Normal", "Normal"], - "Normal2": ["attack", "天矢阴", 5, "Normal", "Normal"], - "Normal3": ["attack", "盘拏耀跃", 7, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 3, "Ultra", "Ultra"] - } + "Ultra_Use": [140] }, "1006": { "Normal": [ @@ -204,12 +180,7 @@ 0.088000000372529, 0.096000000372529, 0.100000000372529 ], "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [110] }, "1005": { "Normal": [ @@ -246,14 +217,7 @@ 1.694000000372529, 1.792000000372529, 1.890000000372529 ], "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "DOT": ["attack", "单次持续伤害", 1, "DOT", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } + "Ultra_Use": [110] }, "1205": { "Normal": [ @@ -307,13 +271,7 @@ 1.265000000372529, 1.320000000372529, 1.375000000372529 ], "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Normal1": ["attack", "无间剑树", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } + "Ultra_Use": [110] }, "1208": { "Normal_HP": [ @@ -343,11 +301,7 @@ 1.120000000372529, 1.160000000372529, 1.200000000372529 ], "Maze": [20], - "Ultra_Use": [135], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [135] }, "1104": { "Normal": [ @@ -373,12 +327,7 @@ 150, 240, 308, 375, 420, 465, 499, 533, 566, 600, 634, 668, 701, 735, 769 ], "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["defence", "终结技(护盾)", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [110] }, "1209": { "Normal": [ @@ -429,13 +378,7 @@ 0.3450000008568168, 0.3600000008940697, 0.3750000008940697 ], "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "附加伤害", 1, "Talent", "Talent"] - } + "Ultra_Use": [120] }, "1004": { "Normal": [ @@ -465,12 +408,7 @@ 0.6900000008568168, 0.7200000008940697, 0.7500000008940697 ], "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 3, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [120] }, "1003": { "Normal": [ @@ -500,13 +438,7 @@ 1.6100000008568168, 1.6800000008940697, 1.7500000008940697 ], "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } + "Ultra_Use": [120] }, "1201": { "Normal": [ @@ -541,12 +473,7 @@ 0.8280000008568168, 0.8640000008940697, 0.9000000008940697 ], "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Normal1": ["attack", "杠上开花!", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [140] }, "1212": { "Normal": [ @@ -590,13 +517,7 @@ 2.0700000008568168, 2.1600000008940697, 2.2500000008940697 ], "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "BPSkill1": ["attack", "寒川映月", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } + "Ultra_Use": [140] }, "1112": { "Normal": [ @@ -633,12 +554,7 @@ 0.30000000086613, 0.31250000093132 ], "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Talent", "Normal"], - "Talent": ["attack", "账账", 1, "Talent", "Talent"], - "Talent1": ["attack", "强化账账", 1, "Talent", "Talent"] - } + "Ultra_Use": [140] }, "1302": { "Normal": [ @@ -682,12 +598,7 @@ 0.029499999713152647, 0.030999999959021807, 0.032500000204890966 ], "Maze": [20], - "Ultra_Use": [180], - "skillList": { - "Normal": ["attack", "普攻", 1, "Talent", "Normal"], - "BPSkill": ["attack", "账账", 1, "Talent", "BPSkill"], - "Talent1": ["attack", "强化账账", 1, "Talent", "Talent"] - } + "Ultra_Use": [180] }, "1210": { "Normal": [ @@ -724,12 +635,168 @@ 0.07899999944493175, 0.08199999993667006, 0.08499999972991645 ], "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "DOT": ["attack", "每段灼烧", 1, "DOT", "BPSkill"] - } + "Ultra_Use": [140] + }, + "1203": { + "Normal": [ + 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, + 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, + 1.1000000000931323, 1.2000000001862645, 1.3000000002793968 + ], + "BPSkill_G": [200, 320, 410, 500, 560, 620, 665, 710, 755, 800, 845, 890, 935, 980, 1025], + "BPSkill": [ + 0.40000000037252903, 0.42500000004656613, 0.45000000041909516, + 0.47500000009313226, 0.5000000004656613, 0.5200000004842877, + 0.5400000005029142, 0.5600000005215406, 0.5800000005401671, + 0.6000000005587935, 0.62000000057742, 0.6400000005960464, + 0.6600000006146729, 0.6800000006332994, 0.7000000006519258 + ], + "Ultra": [ + 1.2000000001862645, 1.2800000002607703, 1.3600000003352761, + 1.440000000409782, 1.5200000004842877, 1.6000000005587935, + 1.7000000006519258, 1.800000000745058, 1.9000000008381903, + 2, 2.080000000074506, 2.1600000001490116, + 2.2400000002235174, 2.3200000002980232, 2.400000000372529 + ], + "Talent": [ + 0.12000000011175871, 0.12749999994412065, 0.13499999977648258, + 0.14250000030733645, 0.1500000001396984, 0.15599999972619116, + 0.16200000001117587, 0.16799999959766865, 0.17399999988265336, + 0.18000000016763806, 0.18599999975413084, 0.19200000003911555, + 0.19799999962560833, 0.20399999991059303, 0.21000000019557774 + ], + "Talent_G": [60, 96, 123, 150, 168, 186, 200, 213, 227, 240, 254, 267, 281, 294, 308], + "Maze": [20], + "Ultra_Use": [100] + }, + "1211": { + "Normal": [ + 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, + 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, + 1.1000000000931323, 1.2000000001862645, 1.3000000002793968 + ], + "BPSkill": [ + 0.07799999951384962, 0.08287500101141632, 0.08775000041350722, + 0.09262500051409006, 0.09749999991618097, 0.10140000027604401, + 0.10529999993741512, 0.10919999959878623, 0.11309999995864928, + 0.11699999962002039, 0.12090000067837536, 0.12480000033974648, + 0.1287000000011176, 0.13260000036098063, 0.13650000002235174 + ], + "BPSkill_G": [78, 124, 159, 195, 218, 241, 259, 276, 294, 312, 329, 347, 364, 382, 399], + "Ultra": [ + 0.09000000008381903, 0.09562500030733645, 0.10125000053085387, + 0.10687500075437129, 0.11250000027939677, 0.11699999962002039, + 0.12150000035762787, 0.12599999969825149, 0.13050000043585896, + 0.13499999977648258, 0.13949999981559813, 0.14399999985471368, + 0.14849999989382923, 0.15299999993294477, 0.15749999997206032 + ], + "Ultra_G": [90, 144, 185, 225, 252, 279, 299, 320, 340, 360, 380, 400, 420, 441, 461], + "Talent": [ + 0.035999999614432454, 0.038249999983236194, 0.04050000035203993, + 0.04275000072084367, 0.04499999969266355, 0.04680000012740493, + 0.048599999863654375, 0.05040000029839575, 0.0522000000346452, + 0.05399999977089465, 0.055800000205636024, 0.05759999994188547, + 0.05939999967813492, 0.061200000112876296, 0.06299999984912574 + ], + "Talent_G": [36, 57, 74, 90, 101, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184], + "Talent1": [ + 0.12000000011175871, 0.12749999994412065, 0.13499999977648258, + 0.14250000030733645, 0.1500000001396984, 0.15599999972619116, + 0.16200000001117587, 0.16799999959766865, 0.17399999988265336, + 0.18000000016763806, 0.18599999975413084, 0.19200000003911555, + 0.19799999962560833, 0.20399999991059303, 0.21000000019557774 + ], + "Talent1_G": [120, 192, 246, 300, 336, 372, 399, 426, 453, 480, 507, 534, 561, 588, 615], + "Maze": [20], + "Ultra_Use": [100] + }, + "1110": { + "Normal_HP": [ + 0.2500000004656613, 0.3000000005587935, 0.3500000006519258, + 0.4000000007450581, 0.4500000008381903, 0.5000000000931323, + 0.5500000001862645, 0.6000000002793968, 0.6500000002793968 + ], + "BPSkill": [ + 0.0800000000745058, 0.08499999972991645, 0.09000000008381903, + 0.09499999973922968, 0.10000000009313226, 0.10399999981746078, + 0.1079999995417893, 0.11199999996460974, 0.11599999968893826, + 0.12000000011175871, 0.12399999983608723, 0.12799999956041574, + 0.1319999999832362, 0.1359999997075647, 0.14000000013038516 + ], + "BPSkill_G": [80, 128, 164, 200, 224, 248, 266, 284, 302, 320, 338, 356, 374, 392, 410], + "BPSkill_HP": [ + 0.05000000004656613, 0.05250000022351742, 0.054999999701976776, + 0.057499999878928065, 0.060000000055879354, 0.06250000023283064, + 0.06562500027939677, 0.0687500003259629, 0.07187500107102096, + 0.07499999972060323, 0.07749999989755452, 0.0800000000745058, + 0.0825000002514571, 0.08499999972991645, 0.08749999990686774 + ], + "BPSkill_HP_G": [50, 80, 103, 125, 140, 155, 166, 178, 189, 200, 211, 222, 234, 245, 256], + "Ultra": [ + 0.09000000008381903, 0.09562500030733645, 0.10125000053085387, + 0.10687500075437129, 0.11250000027939677, 0.11699999962002039, + 0.12150000035762787, 0.12599999969825149, 0.13050000043585896, + 0.13499999977648258, 0.13949999981559813, 0.14399999985471368, + 0.14849999989382923, 0.15299999993294477, 0.15749999997206032 + ], + "Ultra_G": [90, 144, 185, 225, 252, 279, 299, 320, 340, 360, 380, 400, 420, 441, 461], + "Talent": [ + 0.02399999974295497, 0.02549999998882413, 0.026999999536201358, + 0.028499999782070518, 0.030000000027939677, 0.03120000008493662, + 0.03240000014193356, 0.0336000001989305, 0.034800000255927444, + 0.035999999614432454, 0.037199999671429396, 0.03839999972842634, + 0.03959999978542328, 0.04080000054091215, 0.04199999989941716 + ], + "Talent_G": [24, 38, 49, 60, 67, 74, 80, 85, 91, 96, 101, 107, 112, 118, 123], + "Talent1": [ + 0.030000000027939677, 0.03187500103376806, 0.033750000642612576, + 0.035625000251457095, 0.037499999860301614, 0.03899999940767884, + 0.04050000035203993, 0.04199999989941716, 0.04350000014528632, + 0.04499999969266355, 0.04649999993853271, 0.04799999948590994, + 0.0494999997317791, 0.05099999997764826, 0.05250000022351742 + ], + "Talent1_G": [30, 48, 62, 75, 84, 93, 100, 107, 113, 120, 127, 134, 140, 147, 154], + "Maze": [20], + "Ultra_Use": [100] + }, + "1105": { + "Normal": [ + 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, + 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, + 1.1000000000931323, 1.2000000001862645, 1.3000000002793968 + ], + "BPSkill": [ + 0.07000000006519258, 0.07437500054948032, 0.07875000033527613, + 0.08312500012107193, 0.08749999990686774, 0.09100000001490116, + 0.09450000012293458, 0.09799999953247607, 0.10150000033900142, + 0.1049999997485429, 0.10849999985657632, 0.11199999996460974, + 0.11550000007264316, 0.11899999948218465, 0.12250000028871 + ], + "BPSkill_G": [70, 112, 144, 175, 196, 217, 233, 249, 264, 280, 296, 312, 327, 343, 359], + "BPSkill1": [ + 0.04799999948590994, 0.05099999997764826, 0.05399999977089465, + 0.056999999564141035, 0.060000000055879354, 0.06240000016987324, + 0.06480000028386712, 0.06719999969936907, 0.06959999981336296, + 0.07199999992735684, 0.07440000004135072, 0.0768000001553446, + 0.07919999957084656, 0.08160000038333237, 0.08399999979883432 + ], + "BPSkill1_G": [48, 77, 98, 120, 134, 149, 160, 170, 181, 192, 203, 214, 224, 235, 246], + "Ultra": [ + 0.09199999994598329, 0.09775000042282045, 0.10350000020116568, + 0.1092499999795109, 0.11499999975785613, 0.11959999985992908, + 0.12419999996200204, 0.128800000064075, 0.13340000016614795, + 0.13799999956972897, 0.14260000037029386, 0.14719999977387488, + 0.15180000057443976, 0.1563999999780208, 0.16100000008009374 + ], + "Ultra_G": [92, 147, 189, 230, 258, 285, 306, 327, 247, 368, 389, 409, 430, 451, 472], + "Talent": [ + 0.25000000023283064, 0.27499999990686774, 0.3000000002793968, + 0.32499999995343387, 0.3500000003259629, 0.375, + 0.4062500004656613, 0.43750000023283064, 0.46875000069849193, + 0.5000000004656613, 0.5250000001396984, 0.5500000005122274, + 0.5750000001862645, 0.6000000005587935, 0.6250000002328306 + ], + "Maze": [20], + "Ultra_Use": [100] } } diff --git a/StarRailUID/starrailuid_charinfo/damage/Excel/weapon_effect.json b/StarRailUID/starrailuid_charinfo/damage/Excel/weapon_effect.json index dd6120a..888ee83 100644 --- a/StarRailUID/starrailuid_charinfo/damage/Excel/weapon_effect.json +++ b/StarRailUID/starrailuid_charinfo/damage/Excel/weapon_effect.json @@ -367,6 +367,92 @@ ] } }, + "23008": { + "Param": { + "speed": [ + 12, 14, 16, 18, 20 + ] + } + }, + "20019": { + "Param": { + "speed": [ + 12, 14, 16, 18, 20 + ] + } + }, + "23017": { + "Param": { + "AttackAddedRatio": [ + 0.02399999974295497, 0.027999999467283487, 0.031999999890103936, + 0.035999999614432454, 0.0400000000372529 + ] + } + }, + "21000": { + "Param": { + "Ultra_HealRatioBase": [ + 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, + 0.21000000019557774, 0.24000000022351742 + ] + } + }, + "21014": { + "Param": { + "StatusResistance": [ + 0.33000000030733645, 0.3600000003352761, 0.3900000003632158, + 0.4200000003911555, 0.45000000041909516 + ], + "HealRatioBase": [ + 0.1500000001396984, 0.18000000016763806, 0.21000000019557774, + 0.24000000022351742, 0.2700000002514571 + ] + } + }, + "21032": { + "Param": { + "AttackAddedRatio": [ + 0.10000000009313226, 0.12499999976716936, 0.1500000001396984, + 0.17499999981373549, 0.20000000018626451 + ], + "CriticalDamage": [ + 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, + 0.21000000019557774, 0.24000000022351742 + ] + } + }, + "20005": { + "Param": { + "AttackAddedRatio": [ + 0.0800000000745058, 0.09000000008381903, 0.10000000009313226, + 0.11000000010244548, 0.12000000011175871 + ] + } + }, + "22001": { + "Param": { + "HealRatioBase": [ + 0.1600000001490116, 0.1900000001769513, 0.22000000020489097, + 0.25000000023283064, 0.2800000002607703 + ] + } + }, + "20001": { + "Param": { + "HealRatioBase": [ + 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, + 0.21000000019557774, 0.24000000022351742 + ] + } + }, + "21011": { + "Param": { + "AllDamageAddedRatio": [ + 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, + 0.21000000019557774, 0.24000000022351742 + ] + } + }, "21010": { "Param": { "AllDamageAddedRatio": [ diff --git a/StarRailUID/starrailuid_charinfo/damage/Role.py b/StarRailUID/starrailuid_charinfo/damage/Role.py index 6924b65..e01548c 100644 --- a/StarRailUID/starrailuid_charinfo/damage/Role.py +++ b/StarRailUID/starrailuid_charinfo/damage/Role.py @@ -4,7 +4,66 @@ from gsuid_core.logger import logger from .utils import merge_attribute +async def calculate_heal( + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + skill_type: str, + skill_multiplier: float, + skill_num: float, + is_atk = 0, +): + add_attr_bonus = copy.deepcopy(attribute_bonus) + merged_attr = await merge_attribute(base_attr, add_attr_bonus) + + if is_atk == 1: + hp = merged_attr.get('attack', 0) + else: + hp = merged_attr.get('hp', 0) + logger.info(f'生命: {hp}') + # 检查是否有治疗量加成 + heal_ratio_base = merged_attr.get('HealRatioBase', 0) + for attr in merged_attr: + if '_HealRatioBase' in attr and attr.split('_')[0] in (skill_type): + heal_ratio_base += merged_attr[attr] + heal_ratio = heal_ratio_base + 1 + logger.info(f'治疗量加成: {heal_ratio}') + + heal_num = ( + hp * skill_multiplier + skill_num + ) * heal_ratio + + skill_info_list = [heal_num] + return skill_info_list + +async def calculate_shield( + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + skill_multiplier: float, + skill_num: float, + is_atk = 0, +): + add_attr_bonus = copy.deepcopy(attribute_bonus) + merged_attr = await merge_attribute(base_attr, add_attr_bonus) + + if is_atk == 1: + defence = merged_attr.get('attack', 0) + else: + defence = merged_attr.get('defence', 0) + logger.info(f'防御力: {defence}') + + # 检查是否有护盾加成 + shield_added_ratio = merged_attr.get('shield_added_ratio', 0) + shield_added = shield_added_ratio + 1 + logger.info(f'护盾加成: {shield_added}') + + defence_num = ( + defence * skill_multiplier + skill_num + ) * shield_added + + skill_info_list = [defence_num] + return skill_info_list + async def calculate_damage( base_attr: Dict[str, float], attribute_bonus: Dict[str, float], diff --git a/StarRailUID/starrailuid_charinfo/damage/Weapon/Weapon.py b/StarRailUID/starrailuid_charinfo/damage/Weapon/Weapon.py index 425bf6f..09ecacd 100644 --- a/StarRailUID/starrailuid_charinfo/damage/Weapon/Weapon.py +++ b/StarRailUID/starrailuid_charinfo/damage/Weapon/Weapon.py @@ -1777,188 +1777,672 @@ class AnInstanceBeforeAGaze(BaseWeapon): ) return attribute_bonus +# 时节不居 +class TimeWaitsforNoOne(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者对我方目标提供治疗时,记录治疗量。当任意我方目标施放攻击后,根据记录治疗量的36%,对随机1个受到攻击的敌方目标造成基于装备者属性的附加伤害 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 棺的回响 +class EchoesoftheCoffin(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者施放终结技后,使我方全体速度提高12点,持续1回合。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + speed_delta = attribute_bonus.get('SpeedDelta', 0) + attribute_bonus['SpeedDelta'] = ( + speed_delta + + ( + weapon_effect['23008']['Param']['speed'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 惊魂夜 +class NightofFright(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者为我方目标提供治疗时,使该目标的攻击力提高2.3%,该效果最多叠加5层 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) + attribute_bonus['AttackAddedRatio'] = ( + attack_added_ratio + + ( + weapon_effect['23017']['Param']['AttackAddedRatio'][ + self.weapon_rank - 1 + ] + ) + * 5 + ) + return attribute_bonus + +# 一场术后对话 +class PostOpConversation(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 在施放终结技时治疗量提高12%。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + Ultra_HealRatioBase = attribute_bonus.get('Ultra_HealRatioBase', 0) + attribute_bonus['Ultra_HealRatioBase'] = ( + Ultra_HealRatioBase + + ( + weapon_effect['21000']['Param']['Ultra_HealRatioBase'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 同一种心情 +class SharedFeeling(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 在施放战技时为我方全体恢复2点能量。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 此时恰好 +class PerfectTiming(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 使装备者的治疗量提高,提高数值等同于效果抵抗的33%,最多使治疗量提高15%。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + StatusResistance = attribute_bonus.get('StatusResistance', 0) + HealRatioBase_maxadd = weapon_effect['21000']['Param']['HealRatioBase'][self.weapon_rank - 1] + HealRatioBaseadd = StatusResistance * weapon_effect['21000']['Param']['StatusResistance'][self.weapon_rank - 1] + HealRatioBase = attribute_bonus.get('HealRatioBase', 0) + attribute_bonus['HealRatioBase'] = HealRatioBase + min(HealRatioBaseadd, HealRatioBase_maxadd) + return attribute_bonus + +# 等价交换 +class QuidProQuo(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 随机为1个当前能量百分比小于50%的我方其他目标恢复8点能量。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 暖夜不会漫长 +class WarmthShortensColdNights(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 施放普攻或战技后,为我方全体回复等同于各自生命上限2%的生命值。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 嘿,我在这儿 +class HeyOverHere(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者施放战技时,治疗量提高16%,持续2回合。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + HealRatioBase = attribute_bonus.get('HealRatioBase', 0) + attribute_bonus['HealRatioBase'] = ( + HealRatioBase + + ( + weapon_effect['22001']['Param']['HealRatioBase'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 物穰 +class Cornucopia(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 装备者施放战技和终结技时,治疗量提高12%。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + Ultra_HealRatioBase = attribute_bonus.get('Ultra_HealRatioBase', 0) + attribute_bonus['Ultra_HealRatioBase'] = ( + Ultra_HealRatioBase + + ( + weapon_effect['20001']['Param']['HealRatioBase'][ + self.weapon_rank - 1 + ] + ) + ) + BPSkill_HealRatioBase = attribute_bonus.get('BPSkill_HealRatioBase', 0) + attribute_bonus['BPSkill_HealRatioBase'] = ( + BPSkill_HealRatioBase + + ( + weapon_effect['20001']['Param']['HealRatioBase'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 嘉果 +class FineFruit(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 战斗开始时,立即为我方全体恢复6点能量。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 蕃息 +class Multiplication(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 战斗开始时,立即为我方全体恢复6点能量。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 但战斗还未结束 +class ButtheBattleIsnotOver(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者施放战技后,使下一个行动的我方【其他目标】造成的伤害提高30% + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 记忆中的模样 +class MemoriesofthePast(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 装备者施放攻击后,额外恢复4点能量 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 与行星相会 +class PlanetaryRendezvous(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当我方目标造成与装备者相同属性的伤害时,造成的伤害提高12%。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0) + attribute_bonus['AllDamageAddedRatio'] = ( + all_damage_added_ratio + + ( + weapon_effect['21011']['Param']['AllDamageAddedRatio'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 舞!舞!舞! +class DanceDanceDance(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者施放终结技后,我方全体行动提前16%。 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 过往未来 +class PastandFuture(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 使下一个行动的我方【其他目标】造成的伤害提高16% + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 镂月裁云之意 +class CarvetheMoonWeavetheClouds(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 在战斗开始时以及当装备者回合开始时,随机生效1个效果 + # 使我方全体攻击力提高10% + # 使我方全体暴击伤害提高12% + # 暂时固定只算攻击 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + AttackAddedRatio = attribute_bonus.get('AttackAddedRatio', 0) + attribute_bonus['AttackAddedRatio'] = ( + AttackAddedRatio + + ( + weapon_effect['21032']['Param']['AttackAddedRatio'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 齐颂 +class Chorus(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 进入战斗后,使我方全体的攻击力提高8% + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + AttackAddedRatio = attribute_bonus.get('AttackAddedRatio', 0) + attribute_bonus['AttackAddedRatio'] = ( + AttackAddedRatio + + ( + weapon_effect['20005']['Param']['AttackAddedRatio'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + +# 轮契 +class MeshingCogs(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 使装备者施放攻击或受到攻击后,额外恢复4点能量 + pass + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + return attribute_bonus + +# 调和 +class Mediation(BaseWeapon): + weapon_base_attributes: Dict + + def __init__(self, weapon: DamageInstanceWeapon): + super().__init__(weapon) + + async def check(self): + # 当装备者施放终结技后,使我方全体速度提高12点,持续1回合。 + return True + + async def weapon_ability( + self, + Ultra_Use: float, + base_attr: Dict[str, float], + attribute_bonus: Dict[str, float], + ): + if await self.check(): + speed_delta = attribute_bonus.get('SpeedDelta', 0) + attribute_bonus['SpeedDelta'] = ( + speed_delta + + ( + weapon_effect['20019']['Param']['speed'][ + self.weapon_rank - 1 + ] + ) + ) + return attribute_bonus + class Weapon: @classmethod def create(cls, weapon: DamageInstanceWeapon): - if weapon.id_ in [ - 23018, - 23011, - 23007, - 21005, - 21019, - 21026, - 21033, - 24000, - 23002, - 23009, - 23015, - 21012, - 21006, - 21013, - 21027, - 21020, - 21034, - 23000, - 23010, - 23001, - 21003, - 23012, - 24001, - 21024, - 21017, - 20014, - 20007, - 21010, - 21031, - 20000, - 23006, - 23004, - 24003, - 22000, - 21029, - 21022, - 21015, - 21008, - 21001, - 23005, - 24002, - 21030, - 21023, - 21016, - 21009, - 21002, - 20017, - 20010, - 20003, - 20016, - 20009, - 20002, - 20018, - 20011, - 20004, - 20020, - 20013, - 20006, - 23014, - 23016, - ]: - if weapon.id_ == 23018: - return AnInstanceBeforeAGaze(weapon) - if weapon.id_ == 23016: - return WorrisomeBlissf(weapon) - if weapon.id_ == 23012: - return SleepLiketheDead(weapon) - if weapon.id_ == 23014: - return Thisbodyisasword(weapon) - if weapon.id_ == 20006: - return DataBank(weapon) - if weapon.id_ == 20013: - return Passkey(weapon) - if weapon.id_ == 20020: - return Sagacity(weapon) - if weapon.id_ == 20004: - return Void(weapon) - if weapon.id_ == 20011: - return Loop(weapon) - if weapon.id_ == 20018: - return HiddenShadow(weapon) - if weapon.id_ == 20002: - return CollapsingSky(weapon) - if weapon.id_ == 20009: - return ShatteredHome(weapon) - if weapon.id_ == 20016: - return MutualDemise(weapon) - if weapon.id_ == 20003: - return Amber(weapon) - if weapon.id_ == 20010: - return Defense(weapon) - if weapon.id_ == 20017: - return Pioneering(weapon) - if weapon.id_ == 21002: - return DayOneofMyNewLife(weapon) - if weapon.id_ == 21009: - return LandausChoice(weapon) - if weapon.id_ == 21016: - return TrendoftheUniversalMarket(weapon) - if weapon.id_ == 21023: - return WeAreWildfire(weapon) - if weapon.id_ == 21030: - return ThisIsMe(weapon) - if weapon.id_ == 24002: - return TextureofMemories(weapon) - if weapon.id_ == 23005: - return MomentofVictory(weapon) - if weapon.id_ == 23011: - return SheAlreadyShutHerEyes(weapon) - if weapon.id_ == 21001: - return GoodNightandSleepWell(weapon) - if weapon.id_ == 21008: - return EyesofthePrey(weapon) - if weapon.id_ == 21015: - return ResolutionShinesAsPearlsofSweat(weapon) - if weapon.id_ == 21022: - return Fermata(weapon) - if weapon.id_ == 21029: - return WeWillMeetAgain(weapon) - if weapon.id_ == 22000: - return BeforetheTutorialMissionStarts(weapon) - if weapon.id_ == 24003: - return SolitaryHealing(weapon) - if weapon.id_ == 23004: - return IntheNameoftheWorld(weapon) - if weapon.id_ == 23006: - return PatienceIsAllYouNeed(weapon) - if weapon.id_ == 23007: - return IncessantRain(weapon) - if weapon.id_ == 21005: - return TheMolesWelcomeYou(weapon) - if weapon.id_ == 21019: - return UndertheBlueSky(weapon) - if weapon.id_ == 21026: - return WoofWalkTime(weapon) - if weapon.id_ == 21033: - return NowheretoRun(weapon) - if weapon.id_ == 24000: - return OntheFallofanAeon(weapon) - if weapon.id_ == 23002: - return SomethingIrreplaceable(weapon) - if weapon.id_ == 23009: - return TheUnreachableSide(weapon) - if weapon.id_ == 23015: - return BrighterThantheSun(weapon) - if weapon.id_ == 21012: - return ASecretVow(weapon) - if weapon.id_ == 21006: - return TheBirthoftheSelf(weapon) - if weapon.id_ == 21013: - return MaketheWorldClamor(weapon) - if weapon.id_ == 21020: - return GeniusesRepose(weapon) - if weapon.id_ == 21027: - return SeriousnessofBreakfast(weapon) - if weapon.id_ == 21034: - return TodayIsAnotherPeacefulDay(weapon) - if weapon.id_ == 23000: - return NightontheMilkyWay(weapon) - if weapon.id_ == 23010: - return BeforeDawn(weapon) - if weapon.id_ == 24001: - return CruisingintheStellarSea(weapon) - if weapon.id_ == 23001: - return IntheNight(weapon) - if weapon.id_ == 21003: - return OnlySilenceRemains(weapon) - if weapon.id_ == 21024: - return RiverFlowsinSpring(weapon) - if weapon.id_ == 20014: - return Adversarial(weapon) - if weapon.id_ == 20007: - return DartingArrow(weapon) - if weapon.id_ == 21010: - return Swordplay(weapon) - if weapon.id_ == 21031: - return ReturntoDarkness(weapon) - if weapon.id_ == 20000: - return Arrows(weapon) - raise ValueError(f'未知武器id: {weapon.id_}') - raise ValueError(f'不支持的武器种类: {weapon.id_}') + if weapon.id_ == 20019: + return Mediation(weapon) + if weapon.id_ == 20012: + return MeshingCogs(weapon) + if weapon.id_ == 20005: + return Chorus(weapon) + if weapon.id_ == 21032: + return CarvetheMoonWeavetheClouds(weapon) + if weapon.id_ == 21025: + return PastandFuture(weapon) + if weapon.id_ == 21018: + return DanceDanceDance(weapon) + if weapon.id_ == 21011: + return PlanetaryRendezvous(weapon) + if weapon.id_ == 21004: + return MemoriesofthePast(weapon) + if weapon.id_ == 23003: + return ButtheBattleIsnotOver(weapon) + if weapon.id_ == 20015: + return Multiplication(weapon) + if weapon.id_ == 20008: + return FineFruit(weapon) + if weapon.id_ == 20001: + return Cornucopia(weapon) + if weapon.id_ == 22001: + return HeyOverHere(weapon) + if weapon.id_ == 21028: + return WarmthShortensColdNights(weapon) + if weapon.id_ == 21021: + return QuidProQuo(weapon) + if weapon.id_ == 21014: + return PerfectTiming(weapon) + if weapon.id_ == 21007: + return SharedFeeling(weapon) + if weapon.id_ == 21000: + return PostOpConversation(weapon) + if weapon.id_ == 23017: + return NightofFright(weapon) + if weapon.id_ == 23008: + return EchoesoftheCoffin(weapon) + if weapon.id_ == 23013: + return TimeWaitsforNoOne(weapon) + if weapon.id_ == 23018: + return AnInstanceBeforeAGaze(weapon) + if weapon.id_ == 23016: + return WorrisomeBlissf(weapon) + if weapon.id_ == 23012: + return SleepLiketheDead(weapon) + if weapon.id_ == 23014: + return Thisbodyisasword(weapon) + if weapon.id_ == 20006: + return DataBank(weapon) + if weapon.id_ == 20013: + return Passkey(weapon) + if weapon.id_ == 20020: + return Sagacity(weapon) + if weapon.id_ == 20004: + return Void(weapon) + if weapon.id_ == 20011: + return Loop(weapon) + if weapon.id_ == 20018: + return HiddenShadow(weapon) + if weapon.id_ == 20002: + return CollapsingSky(weapon) + if weapon.id_ == 20009: + return ShatteredHome(weapon) + if weapon.id_ == 20016: + return MutualDemise(weapon) + if weapon.id_ == 20003: + return Amber(weapon) + if weapon.id_ == 20010: + return Defense(weapon) + if weapon.id_ == 20017: + return Pioneering(weapon) + if weapon.id_ == 21002: + return DayOneofMyNewLife(weapon) + if weapon.id_ == 21009: + return LandausChoice(weapon) + if weapon.id_ == 21016: + return TrendoftheUniversalMarket(weapon) + if weapon.id_ == 21023: + return WeAreWildfire(weapon) + if weapon.id_ == 21030: + return ThisIsMe(weapon) + if weapon.id_ == 24002: + return TextureofMemories(weapon) + if weapon.id_ == 23005: + return MomentofVictory(weapon) + if weapon.id_ == 23011: + return SheAlreadyShutHerEyes(weapon) + if weapon.id_ == 21001: + return GoodNightandSleepWell(weapon) + if weapon.id_ == 21008: + return EyesofthePrey(weapon) + if weapon.id_ == 21015: + return ResolutionShinesAsPearlsofSweat(weapon) + if weapon.id_ == 21022: + return Fermata(weapon) + if weapon.id_ == 21029: + return WeWillMeetAgain(weapon) + if weapon.id_ == 22000: + return BeforetheTutorialMissionStarts(weapon) + if weapon.id_ == 24003: + return SolitaryHealing(weapon) + if weapon.id_ == 23004: + return IntheNameoftheWorld(weapon) + if weapon.id_ == 23006: + return PatienceIsAllYouNeed(weapon) + if weapon.id_ == 23007: + return IncessantRain(weapon) + if weapon.id_ == 21005: + return TheMolesWelcomeYou(weapon) + if weapon.id_ == 21019: + return UndertheBlueSky(weapon) + if weapon.id_ == 21026: + return WoofWalkTime(weapon) + if weapon.id_ == 21033: + return NowheretoRun(weapon) + if weapon.id_ == 24000: + return OntheFallofanAeon(weapon) + if weapon.id_ == 23002: + return SomethingIrreplaceable(weapon) + if weapon.id_ == 23009: + return TheUnreachableSide(weapon) + if weapon.id_ == 23015: + return BrighterThantheSun(weapon) + if weapon.id_ == 21012: + return ASecretVow(weapon) + if weapon.id_ == 21006: + return TheBirthoftheSelf(weapon) + if weapon.id_ == 21013: + return MaketheWorldClamor(weapon) + if weapon.id_ == 21020: + return GeniusesRepose(weapon) + if weapon.id_ == 21027: + return SeriousnessofBreakfast(weapon) + if weapon.id_ == 21034: + return TodayIsAnotherPeacefulDay(weapon) + if weapon.id_ == 23000: + return NightontheMilkyWay(weapon) + if weapon.id_ == 23010: + return BeforeDawn(weapon) + if weapon.id_ == 24001: + return CruisingintheStellarSea(weapon) + if weapon.id_ == 23001: + return IntheNight(weapon) + if weapon.id_ == 21003: + return OnlySilenceRemains(weapon) + if weapon.id_ == 21024: + return RiverFlowsinSpring(weapon) + if weapon.id_ == 20014: + return Adversarial(weapon) + if weapon.id_ == 20007: + return DartingArrow(weapon) + if weapon.id_ == 21010: + return Swordplay(weapon) + if weapon.id_ == 21031: + return ReturntoDarkness(weapon) + if weapon.id_ == 20000: + return Arrows(weapon) + raise ValueError(f'未知武器id: {weapon.id_}') diff --git a/StarRailUID/starrailuid_charinfo/damage/utils.py b/StarRailUID/starrailuid_charinfo/damage/utils.py index 35482d7..67f569f 100644 --- a/StarRailUID/starrailuid_charinfo/damage/utils.py +++ b/StarRailUID/starrailuid_charinfo/damage/utils.py @@ -37,38 +37,3 @@ async def merge_attribute( logger.info(f'未知的属性加成: {attribute}, 采用覆盖模式') merged_attr[attribute] = attribute_bonus[attribute] return merged_attr - -def merge_attribute_dam( - base_attr: Dict[str, float], attribute_bonus: Dict[str, float] -) -> Dict[str, float]: - merged_attr = base_attr.copy() - for attribute, value in attribute_bonus.items(): - if attribute.endswith('Delta'): - attr = attribute.split('Delta')[0].lower() - if attr in merged_attr: - merged_attr[attr] += value - else: - merged_attr[attribute] = attribute_bonus[attribute] - elif attribute.endswith('AddedRatio'): - attr = attribute.split('AddedRatio')[0].lower() - if attr in merged_attr: - merged_attr[attr] += base_attr[attr] * value - else: - merged_attr[attribute] = attribute_bonus[attribute] - elif attribute in [ - 'ignore_defence', - 'Atk_buff', - 'Normal_buff', - 'shield_added_ratio', - ]: - merged_attr[attribute] = base_attr.get(attribute, 0) + value - elif attribute.endswith( - ('ResistancePenetration', 'DmgAdd', 'DmgRatio') - ): - merged_attr[attribute] = base_attr.get(attribute, 0) + value - elif attribute.endswith('Base'): - merged_attr[attribute] = base_attr.get(attribute, 0) + value - else: - logger.info(f'未知的属性加成: {attribute}, 采用覆盖模式') - merged_attr[attribute] = attribute_bonus[attribute] - return merged_attr \ No newline at end of file diff --git a/StarRailUID/starrailuid_charinfo/draw_char_img.py b/StarRailUID/starrailuid_charinfo/draw_char_img.py index 0f4104e..53985f6 100644 --- a/StarRailUID/starrailuid_charinfo/draw_char_img.py +++ b/StarRailUID/starrailuid_charinfo/draw_char_img.py @@ -661,30 +661,40 @@ async def draw_char_img(char_data: Dict, sr_uid: str, msg: str): sr_font_26, 'lm', ) - damage1 = math.floor(damage_info['damagelist'][0]) # type: ignore - char_img_draw.text( - (370, 2048 + damage_num * 48), - f'{damage1}', - white_color, - sr_font_26, - 'lm', - ) - damage2 = math.floor(damage_info['damagelist'][1]) # type: ignore - char_img_draw.text( - (560, 2048 + damage_num * 48), - f'{damage2}', - white_color, - sr_font_26, - 'lm', - ) - damage3 = math.floor(damage_info['damagelist'][2]) # type: ignore - char_img_draw.text( - (750, 2048 + damage_num * 48), - f'{damage3}', - white_color, - sr_font_26, - 'lm', - ) + if len(damage_info['damagelist']) == 3: + damage1 = math.floor(damage_info['damagelist'][0]) # type: ignore + char_img_draw.text( + (370, 2048 + damage_num * 48), + f'{damage1}', + white_color, + sr_font_26, + 'lm', + ) + damage2 = math.floor(damage_info['damagelist'][1]) # type: ignore + char_img_draw.text( + (560, 2048 + damage_num * 48), + f'{damage2}', + white_color, + sr_font_26, + 'lm', + ) + damage3 = math.floor(damage_info['damagelist'][2]) # type: ignore + char_img_draw.text( + (750, 2048 + damage_num * 48), + f'{damage3}', + white_color, + sr_font_26, + 'lm', + ) + else: + damage = math.floor(damage_info['damagelist'][0]) # type: ignore + char_img_draw.text( + (560, 2048 + damage_num * 48), + f'{damage}', + white_color, + sr_font_26, + 'lm', + ) if char_change == 1: char_img_draw.text( diff --git a/StarRailUID/starrailuid_charinfo/effect/Avatar/Avatar.py b/StarRailUID/starrailuid_charinfo/effect/Avatar/Avatar.py deleted file mode 100644 index 16a1f46..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Avatar/Avatar.py +++ /dev/null @@ -1,562 +0,0 @@ -from typing import Dict, List - -from gsuid_core.logger import logger - -from ..Base.AvatarBase import BaseAvatar, BaseAvatarBuff -from ..Base.model import DamageInstanceSkill, DamageInstanceAvatar - - -class Seele(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank < 2: - self.eidolon_attribute['SpeedAddedRatio'] = 0.25 - if self.avatar_rank >= 1: - self.eidolon_attribute['CriticalChanceBase'] = 0.15 - if self.avatar_rank >= 2: - self.eidolon_attribute['SpeedAddedRatio'] = 0.5 - - def extra_ability(self): - # 额外能力 割裂 抗性穿透提高20 - self.extra_ability_attribute['QuantumResistancePenetration'] = 0.2 - - -class JingYuan(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 2: - self.eidolon_attribute['NormalDmgAdd'] = 0.2 - self.eidolon_attribute['BPSkillDmgAdd'] = 0.2 - self.eidolon_attribute['UltraDmgAdd'] = 0.2 - if self.avatar_rank >= 6: - self.eidolon_attribute['Talent_DmgRatio'] = 0.288 - - def extra_ability(self): - logger.info('额外能力') - logger.info('【神君】下回合的攻击段数大于等于6段, 则其下回合的暴击伤害提高25%。') - self.extra_ability_attribute['CriticalDamageBase'] = 0.25 - logger.info('施放战技后, 暴击率提升10%') - self.extra_ability_attribute['CriticalChanceBase'] = 0.1 - - -class Clara(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 2: - self.eidolon_attribute['AttackAddedRatio'] = 0.2 - - def extra_ability(self): - logger.info('额外能力') - logger.info('史瓦罗的反击造成的伤害提高30%') - self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num( - 'Talent', 'Talent' - ) - self.extra_ability_attribute['TalentDmgAdd'] = 0.3 - self.extra_ability_attribute['UltraDmgAdd'] = 0.3 - - -class Danhengil(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['Atk_buff'] = 1 - if self.avatar_rank >= 4: - self.eidolon_attribute['Normal_buff'] = 4 - if self.avatar_rank >= 6: - self.extra_ability_attribute[ - 'Normal3_ImaginaryResistancePenetration' - ] = 0.6 - - def extra_ability(self): - logger.info('额外能力') - logger.info('对拥有虚数属性弱点的敌方目标造成伤害时, 暴击伤害提高24%。') - self.extra_ability_attribute['CriticalDamageBase'] = 0.24 - - -class Silverwolf(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 4: - self.extra_ability_attribute['UltraSkillAdd'] = 1 - if self.avatar_rank >= 6: - self.extra_ability_attribute['AllDamageAddedRatio'] = 1 - - def extra_ability(self): - logger.info('额外能力') - logger.info('战技降抗') - logger.info('战技使目标全属性抗性降低的效果额外降低3%') - enemy_status_resistance = self.BPSkill_num('BPSkill_D') + 0.03 - self.extra_ability_attribute[ - 'QuantumResistancePenetration' - ] = enemy_status_resistance - logger.info('终结技降防') - ultra_defence = self.Ultra_num('Ultra_D') - logger.info('天赋降防') - talent_defence = self.Talent() - ignore_defence = ultra_defence + talent_defence - self.extra_ability_attribute['ignore_defence'] = ignore_defence - - -class Kafka(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.extra_ability_attribute['DOTDmgAdd'] = 0.3 - if self.avatar_rank >= 2: - self.extra_ability_attribute['DOTDmgAdd'] = 0.55 - if self.avatar_rank >= 6: - self.extra_ability_attribute['DOTSkillAdd'] = 1.56 - - def extra_ability(self): - pass - - -class Blade(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['UltraHpSkillAdd'] = 0.9 - if self.avatar_rank >= 2: - self.eidolon_attribute['CriticalChanceBase'] = 0.15 - - if self.avatar_rank >= 4: - self.eidolon_attribute['HPAddedRatio'] = 0.4 - - def extra_ability(self): - logger.info('额外能力') - logger.info('天赋施放的追加攻击伤害提高20%') - self.extra_ability_attribute['TalentDmgAdd'] = 0.2 - - -class Fuxuan(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['CriticalDamageBase'] = 0.3 - if self.avatar_rank >= 6: - self.eidolon_attribute['UltraHpSkillAdd'] = 1.2 - - def extra_ability(self): - logger.info('符玄战技【穷观阵】属性加成') - self.extra_ability_attribute['CriticalChanceBase'] = self.BPSkill_num( - 'BPSkill_CC' - ) - self.extra_ability_attribute['HPAddedRatio'] = self.BPSkill_num( - 'BPSkill_HP' - ) - - -class Gepard(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - pass - - def extra_ability(self): - pass - - -class Yanqing(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - self.eidolon_attribute['TalentSkillAdd'] = 0.3 - if self.avatar_rank >= 1: - self.eidolon_attribute['TalentSkillAdd'] = 0.9 - if self.avatar_rank >= 4: - self.eidolon_attribute['IceResistancePenetration'] = 0.15 - - def extra_ability(self): - logger.info('额外能力') - logger.info('触发暴击时, 速度提高10%') - self.extra_ability_attribute['SpeedAddedRatio'] = 0.1 - logger.info('【智剑连心】增益') - critical_damage_base_t = self.Talent_num('Talent_CD') - critical_damage_base_u = self.Ultra_num('Ultra_CD') - self.extra_ability_attribute['CriticalDamageBase'] = ( - critical_damage_base_t + critical_damage_base_u - ) - critical_chance_base = self.Talent_num('Talent_CC') - self.extra_ability_attribute['CriticalChanceBase'] = ( - critical_chance_base + 0.6 - ) - - -class Welt(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['NormalSkillAdd'] = ( - self.Skill_num('Normal', 'Normal') * 0.5 - ) - self.eidolon_attribute['BPSkillSkillAdd'] = ( - self.Skill_num('BPSkill', 'BPSkill') * 0.8 - ) - - def extra_ability(self): - logger.info('额外能力') - logger.info('施放终结技时, 有100%基础概率使目标受到的伤害提高12%, 持续2回合。') - logger.info('对被弱点击破的敌方目标造成的伤害提高20') - self.extra_ability_attribute['AllDamageAddedRatio'] = 0.32 - - -class Himeko(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['SpeedAddedRatio'] = 0.1 - if self.avatar_rank >= 2: - self.eidolon_attribute['AllDamageAddedRatio'] = 0.15 - - def extra_ability(self): - logger.info('额外能力') - logger.info('战技对灼烧状态下的敌方目标造成的伤害提高20%。') - self.extra_ability_attribute['BPSkillDmgAdd'] = 0.2 - logger.info('若当前生命值百分比大于等于80%, 则暴击率提高15%。') - self.extra_ability_attribute['CriticalChanceBase'] = 0.15 - - -class Qingque(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['UltraDmgAdd'] = 0.1 - - def extra_ability(self): - logger.info('额外能力') - logger.info('施放强化普攻后, 青雀的速度提高10%, 持续1回合。') - self.extra_ability_attribute['SpeedAddedRatio'] = 0.1 - logger.info('默认4层战技加伤害') - all_damage_added_ratio = self.BPSkill() + 0.1 - self.extra_ability_attribute['AllDamageAddedRatio'] = ( - all_damage_added_ratio * 4 - ) - logger.info('默认暗杠加攻') - self.extra_ability_attribute['AttackAddedRatio'] = self.Talent() - - -class Jingliu(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['CriticalDamageBase'] = 0.24 - self.extra_ability_attribute['UltraSkillAdd'] = 1 - self.extra_ability_attribute['BPSkill1SkillAdd'] = 1 - if self.avatar_rank >= 2: - self.eidolon_attribute['BPSkill1DmgAdd'] = 0.8 - if self.avatar_rank >= 4: - self.eidolon_attribute['BPSkill1AttackAddedRatio'] = 0.3 - self.eidolon_attribute['UltraAttackAddedRatio'] = 0.3 - if self.avatar_rank >= 6: - self.eidolon_attribute['Ultra_CriticalDamageBase'] = 0.5 - self.eidolon_attribute['BPSkill1_CriticalDamageBase'] = 0.5 - - def extra_ability(self): - logger.info('额外能力') - logger.info('【转魄】状态下, 终结技造成的伤害提高20%。') - logger.info('【转魄】状态下, 暴击率提高。') - logger.info('【转魄】状态下, 攻击力提高。') - self.extra_ability_attribute['UltraDmgAdd'] = 0.2 - critical_chance_base = self.Talent_num('Talent_CC') - self.extra_ability_attribute[ - 'Ultra_CriticalChanceBase' - ] = critical_chance_base - self.extra_ability_attribute[ - 'BPSkill1_CriticalChanceBase' - ] = critical_chance_base - attack_added_ratio = self.Talent_num('Talent_atk') - self.extra_ability_attribute[ - 'BPSkill1AttackAddedRatio' - ] = attack_added_ratio - self.extra_ability_attribute[ - 'UltraAttackAddedRatio' - ] = attack_added_ratio - - -class Topaz(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 1: - self.eidolon_attribute['Talent_CriticalDamageBase'] = 0.5 - if self.avatar_rank >= 6: - self.eidolon_attribute['Talent1_FireResistancePenetration'] = 0.1 - - def extra_ability(self): - self.extra_ability_attribute['Talent1SkillAdd'] = self.Skill_num( - 'Ultra', 'Talent1' - ) - logger.info('额外能力') - logger.info('托帕和账账对拥有火属性弱点的敌方目标造成的伤害提高15%。') - self.extra_ability_attribute['AllDamageAddedRatio'] = 0.15 - logger.info('涨幅惊人暴击伤害提高') - self.extra_ability_attribute[ - 'Talent1_CriticalDamageBase' - ] = self.Ultra_num('Ultra_CD') - logger.info('【负债证明】状态,使其受到的追加攻击伤害提高') - self.extra_ability_attribute['TalentDmgAdd'] = self.BPSkill_num( - 'BPSkill_add' - ) - - -class Guinaifen(BaseAvatar): - Buff: BaseAvatarBuff - - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - super().__init__(char=char, skills=skills) - self.eidolon_attribute: Dict[str, float] = {} - self.extra_ability_attribute: Dict[str, float] = {} - self.eidolons() - self.extra_ability() - - def Technique(self): - pass - - def eidolons(self): - if self.avatar_rank >= 2: - self.eidolon_attribute['DOTSkillAdd'] = 0.4 - - def extra_ability(self): - self.extra_ability_attribute['AllDamageAddedRatio'] = 0.2 - if self.avatar_rank >= 6: - self.extra_ability_attribute['DmgRatio'] = ( - self.Talent_num('Talent') * 4 - ) - else: - self.extra_ability_attribute['DmgRatio'] = ( - self.Talent_num('Talent') * 3 - ) - - -class Avatar: - @classmethod - def create( - cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - if char.id_ == 1112: - return Topaz(char, skills) - if char.id_ == 1212: - return Jingliu(char, skills) - if char.id_ == 1201: - return Qingque(char, skills) - if char.id_ == 1003: - return Himeko(char, skills) - if char.id_ == 1004: - return Welt(char, skills) - if char.id_ == 1209: - return Yanqing(char, skills) - if char.id_ == 1104: - return Gepard(char, skills) - if char.id_ == 1208: - return Fuxuan(char, skills) - if char.id_ == 1205: - return Blade(char, skills) - if char.id_ == 1005: - return Kafka(char, skills) - if char.id_ == 1006: - return Silverwolf(char, skills) - if char.id_ == 1213: - return Danhengil(char, skills) - if char.id_ == 1102: - return Seele(char, skills) - if char.id_ == 1204: - return JingYuan(char, skills) - if char.id_ == 1107: - return Clara(char, skills) - if char.id_ == 1210: - return Guinaifen(char, skills) - raise Exception('不支持的角色') diff --git a/StarRailUID/starrailuid_charinfo/effect/Avatar/__init__.py b/StarRailUID/starrailuid_charinfo/effect/Avatar/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/StarRailUID/starrailuid_charinfo/effect/Base/AvatarBase.py b/StarRailUID/starrailuid_charinfo/effect/Base/AvatarBase.py deleted file mode 100644 index 5841899..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Base/AvatarBase.py +++ /dev/null @@ -1,195 +0,0 @@ -import json -from pathlib import Path -from abc import abstractmethod -from typing import List, Union - -import msgspec -from msgspec import Struct - -from .SkillBase import BaseSkills -from ....utils.excel.model import AvatarPromotionConfig -from .model import DamageInstanceSkill, DamageInstanceAvatar - -path = Path(__file__).parent.parent -with Path.open(path / 'Excel' / 'SkillData.json', encoding='utf-8') as f: - skill_dict = json.load(f) - - -class BaseAvatarAttribute(Struct): - attack: float - defence: float - hp: float - speed: float - CriticalChanceBase: float - CriticalDamageBase: float - BaseAggro: float - - def items(self): - return [ - ('attack', self.attack), - ('defence', self.defence), - ('hp', self.hp), - ('speed', self.speed), - ('CriticalChanceBase', self.CriticalChanceBase), - ('CriticalDamageBase', self.CriticalDamageBase), - ('BaseAggro', self.BaseAggro), - ] - - -class BaseAvatarBuff: - @classmethod - def create( - cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - cls.extra_ability_id = [] - if char.extra_ability: - for extra_ability in char.extra_ability: - cls.extra_ability_id.append(extra_ability['extraAbilityId']) - return cls - - @abstractmethod - async def Technique(self): - ... - - @abstractmethod - async def eidolons(self): - ... - - @abstractmethod - async def extra_ability(self): - ... - - -class BaseAvatar: - def __init__( - self, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - self.Skill = BaseSkills.create(char=char, skills=skills) - self.Buff = BaseAvatarBuff.create(char=char, skills=skills) - self.avatar_id = char.id_ - self.avatar_level = char.level - self.avatar_rank = char.rank - self.avatar_element = char.element - self.avatar_promotion = char.promotion - self.avatar_attribute_bonus = char.attribute_bonus - self.avatar_extra_ability = char.extra_ability - self.avatar_attribute = self.get_attribute() - - def get_attribute(self): - promotion = AvatarPromotionConfig.Avatar[str(self.avatar_id)][ - str(self.avatar_promotion) - ] - - return BaseAvatarAttribute( - # 攻击力 - attack=( - promotion.AttackBase.Value - + promotion.AttackAdd.Value * (self.avatar_level - 1) - ), - # 防御力 - defence=( - promotion.DefenceBase.Value - + promotion.DefenceAdd.Value * (self.avatar_level - 1) - ), - # 血量 - hp=( - promotion.HPBase.Value - + promotion.HPAdd.Value * (self.avatar_level - 1) - ), - # 速度 - speed=promotion.SpeedBase.Value, - # 暴击率 - CriticalChanceBase=promotion.CriticalChance.Value, - # 暴击伤害 - CriticalDamageBase=promotion.CriticalDamage.Value, - # 嘲讽 - BaseAggro=promotion.BaseAggro.Value, - ) - - def Skill_Info(self, skill_type: str): - skill_info = skill_dict[str(self.avatar_id)]['skillList'][skill_type] - return msgspec.convert(skill_info, type=List[Union[str, int]]) - - def Skill_num(self, skill: Union[str, int], skill_type: str): - skill_level = 0 - if skill == 'Normal': - skill_level = self.Skill.Normal_.level - 1 - if skill == 'BPSkill': - skill_level = self.Skill.BPSkill_.level - 1 - if skill == 'Ultra': - skill_level = self.Skill.Ultra_.level - 1 - if skill == 'Talent': - skill_level = self.Skill.Talent_.level - 1 - skill_info = skill_dict[str(self.avatar_id)][skill_type][skill_level] - return msgspec.convert(skill_info, type=float) - - def Normalnum(self, skill_type: str): - skill_info = skill_dict[str(self.avatar_id)][skill_type][ - self.Skill.Normal_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Normal(self): - skill_info = skill_dict[str(self.avatar_id)]['Normal'][ - self.Skill.Normal_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def BPSkill(self): - skill_info = skill_dict[str(self.avatar_id)]['BPSkill'][ - self.Skill.BPSkill_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Ultra(self): - skill_info = skill_dict[str(self.avatar_id)]['Ultra'][ - self.Skill.Ultra_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Maze(self): - skill_info = skill_dict[str(self.avatar_id)]['Maze'][ - self.Skill.Maze_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Talent(self): - skill_info = skill_dict[str(self.avatar_id)]['Talent'][ - self.Skill.Talent_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def BPSkill_num(self, skill_type: str): - skill_info = skill_dict[str(self.avatar_id)][skill_type][ - self.Skill.BPSkill_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Ultra_num(self, skill_type: str): - skill_info = skill_dict[str(self.avatar_id)][skill_type][ - self.Skill.Ultra_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Talent_num(self, skill_type: str): - skill_info = skill_dict[str(self.avatar_id)][skill_type][ - self.Skill.Talent_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - - def Talent_add(self): - if self.avatar_id in [1102]: - skill_info = skill_dict[str(self.avatar_id)]['Talent'][ - self.Skill.Talent_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - if self.avatar_id in [1205]: - skill_info = skill_dict[str(self.avatar_id)]['BPSkill'][ - self.Skill.BPSkill_.level - 1 - ] - return msgspec.convert(skill_info, type=float) - return 0.0 - - def Ultra_Use(self): - skill_info = skill_dict[str(self.avatar_id)]['Ultra_Use'][0] - return msgspec.convert(skill_info, type=float) diff --git a/StarRailUID/starrailuid_charinfo/effect/Base/RelicBase.py b/StarRailUID/starrailuid_charinfo/effect/Base/RelicBase.py deleted file mode 100644 index 174013d..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Base/RelicBase.py +++ /dev/null @@ -1,93 +0,0 @@ -from typing import Dict -from abc import abstractmethod - -from gsuid_core.logger import logger - -from .model import DamageInstanceRelic -from ....utils.map.SR_MAP_PATH import RelicSetSkill - - -class SingleRelic: - def __init__(self, relic: DamageInstanceRelic): - self.raw_relic = relic - self.relic_id = relic.relicId - self.set_id = relic.SetId - self.relic_type = relic.Type - self.relic_level = relic.Level - self.relic_attribute_bonus: Dict[str, float] = {} - - def get_attribute_(self): - # MainAffix - if self.raw_relic.MainAffix.Property in self.relic_attribute_bonus: - self.relic_attribute_bonus[ - self.raw_relic.MainAffix.Property - ] += self.raw_relic.MainAffix.Value - else: - self.relic_attribute_bonus[ - self.raw_relic.MainAffix.Property - ] = self.raw_relic.MainAffix.Value - - # SubAffix - if self.raw_relic.SubAffixList: - for sub_affix in self.raw_relic.SubAffixList: - sub_affix_property = sub_affix.Property - value = sub_affix.Value - if sub_affix_property in self.relic_attribute_bonus: - self.relic_attribute_bonus[sub_affix_property] += value - else: - self.relic_attribute_bonus[sub_affix_property] = value - - -class BaseRelicSetSkill: - setId: int - pieces2: bool = False - pieces4: bool = False - - def __init__(self, set_id: int, count: int): - self.setId = set_id - if count >= 2: - self.pieces2 = True - logger.info(f'Relic {set_id} 2 pieces set activated') - if count == 4: - self.pieces4 = True - logger.info(f'Relic {set_id} 4 pieces set activated') - self.relicSetAttribute = self.set_skill_property_ability() - - @abstractmethod - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - ... - - @abstractmethod - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 战斗加成属性, 与 set_skill_property() 互斥 - """ - ... - - def set_skill_property_ability(self): - set_property = '' - set_value = 0 - relic_set_attribute: Dict[str, float] = {} - if self.pieces2: - status_add = RelicSetSkill.RelicSet[str(self.setId)]['2'] - if status_add: - set_property = status_add.Property - set_value = status_add.Value - if set_property != '': - relic_set_attribute[set_property] = ( - relic_set_attribute.get(set_property, 0) + set_value - ) - if self.pieces4: - status_add = RelicSetSkill.RelicSet[str(self.setId)]['4'] - if status_add: - set_property = status_add.Property - set_value = status_add.Value - if set_property != '': - relic_set_attribute[set_property] = ( - relic_set_attribute.get(set_property, 0) + set_value - ) - return relic_set_attribute diff --git a/StarRailUID/starrailuid_charinfo/effect/Base/SkillBase.py b/StarRailUID/starrailuid_charinfo/effect/Base/SkillBase.py deleted file mode 100644 index e3c84df..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Base/SkillBase.py +++ /dev/null @@ -1,45 +0,0 @@ -import json -from typing import List -from pathlib import Path - -from .model import DamageInstanceSkill, DamageInstanceAvatar - -path = Path(__file__).parent.parent -with Path.open(path / 'Excel' / 'SkillData.json', encoding='utf-8') as f: - skill_dict = json.load(f) - - -class SingleSkill: - def __init__(self, skill: DamageInstanceSkill): - self.id = skill.skillId - self.level = skill.skillLevel - - -class BaseSkills: - Normal_: SingleSkill - BPSkill_: SingleSkill - Ultra_: SingleSkill - Maze_: SingleSkill - Talent_: SingleSkill - - @classmethod - def create( - cls, char: DamageInstanceAvatar, skills: List[DamageInstanceSkill] - ): - for skill in skills: - skill_attack_type = skill.skillAttackType - if skill_attack_type == 'Normal': - cls.Normal_ = SingleSkill(skill) - elif skill_attack_type == 'BPSkill': - cls.BPSkill_ = SingleSkill(skill) - elif skill_attack_type == 'Ultra': - cls.Ultra_ = SingleSkill(skill) - elif skill_attack_type == 'Maze': - cls.Maze_ = SingleSkill(skill) - elif skill_attack_type == '': - cls.Talent_ = SingleSkill(skill) - else: - raise ValueError( - f'Unknown skillAttackType: {skill_attack_type}' - ) - return cls diff --git a/StarRailUID/starrailuid_charinfo/effect/Base/WeaponBase.py b/StarRailUID/starrailuid_charinfo/effect/Base/WeaponBase.py deleted file mode 100644 index d6bb1ab..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Base/WeaponBase.py +++ /dev/null @@ -1,78 +0,0 @@ -from typing import Dict -from abc import abstractmethod - -from msgspec import Struct - -from .model import DamageInstanceWeapon -from ....utils.excel.model import EquipmentPromotionConfig -from ....utils.map.SR_MAP_PATH import EquipmentID2AbilityProperty - - -class BaseWeaponAttribute(Struct): - hp: float - attack: float - defence: float - - def items(self): - return [ - ('hp', self.hp), - ('attack', self.attack), - ('defence', self.defence), - ] - - -class BaseWeapon: - def __init__(self, weapon: DamageInstanceWeapon): - self.weapon_id = weapon.id_ - self.weapon_level = weapon.level - self.weapon_rank = weapon.rank - self.weapon_promotion = weapon.promotion - self.weapon_base_attribute = self.get_attribute() - self.weapon_attribute: Dict[str, float] = {} - self.get_attribute() - self.weapon_property_ability() - - @abstractmethod - async def weapon_ability(self, base_attr: Dict, attribute_bonus: Dict): - """ - 战斗加成属性, 与 weapon_property_ability() 互斥 - """ - ... - - def weapon_property_ability(self): - """ - 面板加成属性, 与 weapon_ability() 互斥 - """ - ability_property = EquipmentID2AbilityProperty[str(self.weapon_id)] - equip_ability_property = ability_property[str(self.weapon_rank)] - for equip_ability in equip_ability_property: - property_type = equip_ability['PropertyType'] - value = equip_ability['Value']['Value'] - if property_type in self.weapon_attribute: - self.weapon_attribute[property_type] += value - else: - self.weapon_attribute[property_type] = value - - @abstractmethod - async def check(self): - ... - - def get_attribute(self): - promotion = EquipmentPromotionConfig.Equipment[str(self.weapon_id)][ - str(self.weapon_promotion) - ] - - return BaseWeaponAttribute( - hp=( - promotion.BaseHP.Value - + promotion.BaseHPAdd.Value * (self.weapon_level - 1) - ), - attack=( - promotion.BaseAttack.Value - + promotion.BaseAttackAdd.Value * (self.weapon_level - 1) - ), - defence=( - promotion.BaseDefence.Value - + promotion.BaseDefenceAdd.Value * (self.weapon_level - 1) - ), - ) diff --git a/StarRailUID/starrailuid_charinfo/effect/Base/model.py b/StarRailUID/starrailuid_charinfo/effect/Base/model.py deleted file mode 100644 index 3e033a4..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Base/model.py +++ /dev/null @@ -1,103 +0,0 @@ -from typing import List, Union - -import msgspec -from msgspec import Struct, field - - -class DamageInstanceSkill(Struct): - skillId: int - skillName: str - skillEffect: str - skillAttackType: str - skillLevel: int - - -class DamageInstanceRelicSubAffix(Struct): - SubAffixID: int - Property: str - Name: str - Cnt: int - Step: int - Value: float - - -class DamageInstanceRelicMainAffix(Struct): - AffixID: int - Property: str - Name: str - Value: float - - -class DamageInstanceRelic(Struct): - relicId: int - relicName: str - SetId: int - SetName: str - Type: int - MainAffix: DamageInstanceRelicMainAffix - SubAffixList: Union[List[DamageInstanceRelicSubAffix], None] - Level: int = 0 - - -class DamageInstanceWeapon(Struct): - id_: str = field(name='id') - level: int - rank: int - promotion: int - - -class AttributeBounsStatusAdd(Struct): - property: str - name: str - value: float - - -class DamageInstanceAvatarAttributeBouns(Struct): - attributeBonusId: int - attributeBonusLevel: int - statusAdd: AttributeBounsStatusAdd - - -class DamageInstanceAvatar(Struct): - id_: str = field(name='id') - level: int - rank: int - element: str - promotion: int - attribute_bonus: Union[List[DamageInstanceAvatarAttributeBouns], None] - extra_ability: Union[List, None] - - -class DamageInstance: - avatar: DamageInstanceAvatar - weapon: DamageInstanceWeapon - relic: List[DamageInstanceRelic] - skill: List[DamageInstanceSkill] - - def __init__(self, char): - self.avatar = DamageInstanceAvatar( - id_=char.char_id, - level=char.char_level, - rank=char.char_rank, - element=char.char_element, - promotion=char.char_promotion, - attribute_bonus=msgspec.convert( - char.attribute_bonus, - Union[List[DamageInstanceAvatarAttributeBouns], None], - ), - extra_ability=msgspec.convert( - char.extra_ability, Union[List, None] - ), - ) - self.weapon = DamageInstanceWeapon( - id_=char.equipment['equipmentID'], - level=char.equipment['equipmentLevel'], - rank=char.equipment['equipmentRank'], - promotion=char.equipment['equipmentPromotion'], - ) - self.relic = [] - for relic in char.char_relic: - self.relic.append(msgspec.convert(relic, DamageInstanceRelic)) - self.skill = [] - for skill in char.char_skill: - self.skill.append(msgspec.convert(skill, DamageInstanceSkill)) diff --git a/StarRailUID/starrailuid_charinfo/effect/Excel/SkillData.json b/StarRailUID/starrailuid_charinfo/effect/Excel/SkillData.json deleted file mode 100644 index 78c87f4..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Excel/SkillData.json +++ /dev/null @@ -1,695 +0,0 @@ -{ - "1102": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 1.1000000000931323, 1.2100000001955777, 1.3200000002980232, - 1.4300000004004687, 1.5400000005029142, 1.6500000006053597, - 1.7875000005587935, 1.9250000005122274, 2.0625000002328306, - 2.2000000001862645, 2.31000000028871, 2.4200000003911555, - 2.530000000493601, 2.6400000005960464, 2.750000000698492 - ], - "Ultra": [ - 2.5500000005122274, 2.7200000006705523, 2.890000000828877, - 3.0600000000558794, 3.230000000214204, 3.400000000372529, - 3.612500000745058, 3.825000000419095, 4.037499999860302, - 4.250000000232831, 4.4200000003911555, 4.59000000054948, - 4.760000000707805, 4.93000000086613, 5.100000000093132 - ], - "Talent": [ - 0.40000000037252903, 0.44000000040978193, 0.48000000044703484, - 0.5200000004842877, 0.5600000005215406, 0.6000000005587935, - 0.6500000006053597, 0.7000000006519258, 0.7500000006984919, - 0.8000000007450581, 0.840000000782311, 0.8800000008195639, - 0.9200000008568168, 0.9600000008940697, 1 - ], - "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1204": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 0.5000000004656613, 0.5500000004656613, 0.6000000005587935, - 0.6500000005587935, 0.7000000006519258, 0.7500000006519258, - 0.8000000007450581, 0.8500000007450581, 0.9000000008381903, - 0.9500000008381903, 1.0000000000931323, 1.0500000000931323, - 1.1000000001862645, 1.1500000001862645, 1.2000000002793968, - 1.2500000002793968 - ], - "Ultra": [ - 1.2000000002793968, 1.2800000002793968, 1.3600000002793968, - 1.4400000002793968, 1.5200000002793968, 1.6000000002793968, - 1.6800000002793968, 1.7600000002793968, 1.8400000002793968, - 1.9200000002793968, 2.0000000002793968, 2.0800000002793968, - 2.1600000002793968, 2.2400000002793968, 2.3200000002793968, - 2.4000000002793968 - ], - "Talent": [ - 3.300000000372529, 3.63000000372529, 3.960000000372529, 4.290000000372529, - 4.620000000372529, 4.495000000372529, 5.363000000372529, - 5.775000000372529, 6.188000000372529, 6.600000000372529, - 6.930000000372529, 7.260000000372529, 7.590000000372529, - 7.920000000372529, 8.250000000372529 - ], - "Maze": [20], - "Ultra_Use": [130], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "10层神君", 1, "Talent", "Talent"] - } - }, - "1107": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 0.6000000004656613, 0.6600000004656613, 0.7200000005587935, - 0.7800000005587935, 0.8400000006519258, 0.9000000006519258, - 0.9600000007450581, 1.0200000007450581, 1.0800000008381903, - 1.1400000008381903, 1.2000000000931323, 1.2600000000931323, - 1.3200000001862645, 1.3800000001862645, 1.4400000002793968, - 1.5000000002793968 - ], - "Talent1": [ - 0.9600000002793968, 1.0240000002793968, 1.0880000002793968, - 1.1520000002793968, 1.2160000002793968, 1.2800000002793968, - 1.3600000002793968, 1.4400000002793968, 1.5200000002793968, - 1.6000000002793968, 1.6640000002793968, 1.7280000002793968, - 1.7920000002793968, 1.1850000002793968, 1.9200000002793968 - ], - "Talent": [ - 0.800000000372529, 0.880000000372529, 0.960000000372529, - 1.040000000372529, 1.120000000372529, 1.200000000372529, - 1.300000000372529, 1.400000000372529, 1.500000000372529, - 1.600000000372529, 1.680000000372529, 1.760000000372529, - 1.840000000372529, 1.920000000372529, 2.000000000372529 - ], - "Maze": [20], - "Ultra_Use": [130], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Talent": ["attack", "反击", 1, "Talent", "Talent"], - "Talent1": ["attack", "强化反击", 1, "Talent", "Ultra"] - } - }, - "1213": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "Normal1": [ - 1.3000000004656613, 1.5600000005587935, 1.8200000006519258, - 2.0800000007450581, 2.3400000008381903, 2.6000000000931323, - 2.8600000001862645, 3.1200000002793968, 3.3800000002793968 - ], - "Normal2": [ - 1.9000000004656613, 2.2800000005587935, 2.6600000006519258, - 3.0400000007450581, 3.4200000008381903, 3.8000000000931323, - 4.1800000001862645, 4.5600000002793968, 4.9400000002793968 - ], - "Normal3": [ - 2.5000000004656613, 3.0000000005587935, 3.5000000006519258, - 4.0000000007450581, 4.5000000008381903, 5.0000000000931323, - 5.5000000001862645, 6.0000000002793968, 6.5000000002793968 - ], - "BPSkill": [ - 0.0600000004656613, 0.0660000004656613, 0.0720000005587935, - 0.0780000005587935, 0.0840000006519258, 0.0900000006519258, - 0.0975000007450581, 0.1050000007450581, 0.1125000008381903, - 0.1200000008381903, 0.1260000000931323, 0.1320000000931323, - 0.1380000001862645, 0.1440000001862645, 0.1500000002793968, - 0.1560000002793968 - ], - "Ultra": [ - 1.8000000002793968, 1.9200000002793968, 2.0400000002793968, - 2.1600000002793968, 2.2800000002793968, 2.4000000002793968, - 2.5500000002793968, 2.7000000002793968, 2.8500000002793968, - 3.0000000002793968, 3.1200000002793968, 3.2400000002793968, - 3.3600000002793968, 3.4800000002793968, 3.6000000002793968 - ], - "Talent": [ - 0.050000000372529, 0.055000000372529, 0.060000000372529, - 0.065000000372529, 0.070000000372529, 0.075000000372529, - 0.081300000372529, 0.087500000372529, 0.093800000372529, - 0.100000000372529, 0.105000000372529, 0.110000000372529, - 0.115000000372529, 0.120000000372529, 0.125000000372529 - ], - "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 2, "Normal", "Normal"], - "Normal1": ["attack", "瞬华", 3, "Normal", "Normal"], - "Normal2": ["attack", "天矢阴", 5, "Normal", "Normal"], - "Normal3": ["attack", "盘拏耀跃", 7, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 3, "Ultra", "Ultra"] - } - }, - "1006": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 0.9800000004656613, 1.0790000004656613, 1.1760000005587935, - 1.2740000005587935, 1.3720000006519258, 1.4700000006519258, - 1.5925000007450581, 1.7150000007450581, 1.8375000008381903, - 1.9600000008381903, 2.0580000000931323, 2.1560000000931323, - 2.2540000001862645, 2.3520000001862645, 2.4500000002793968 - ], - "BPSkill_D": [ - 0.075000000372529, 0.077500000372529, 0.080000000372529, - 0.082500000372529, 0.085000000372529, 0.087500000372529, - 0.090600000372529, 0.093800000372529, 0.096900000372529, - 0.100000000372529, 0.102500000372529, 0.105000000372529, - 0.107500000372529, 0.110000000372529, 0.112500000372529 - ], - "Ultra": [ - 2.280000000372529, 2.432000000372529, 2.584000000372529, - 2.736000000372529, 2.888000000372529, 3.040000000372529, - 3.230000000372529, 3.420000000372529, 3.610000000372529, - 3.800000000372529, 3.952000000372529, 4.104000000372529, - 4.256000000372529, 4.408000000372529, 4.560000000372529 - ], - "Ultra_D": [ - 0.360000000372529, 0.369000000372529, 0.378000000372529, - 0.387000000372529, 0.396000000372529, 0.405000000372529, - 0.416300000372529, 0.427500000372529, 0.438800000372529, - 0.450000000372529, 0.459000000372529, 0.468000000372529, - 0.477000000372529, 0.486000000372529, 0.495000000372529 - ], - "Talent": [ - 0.040000000372529, 0.044000000372529, 0.048000000372529, - 0.052000000372529, 0.056000000372529, 0.040000000372529, - 0.060000000372529, 0.065000000372529, 0.070000000372529, - 0.075000000372529, 0.080000000372529, 0.084000000372529, - 0.088000000372529, 0.096000000372529, 0.100000000372529 - ], - "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1005": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 0.8000000004656613, 0.8800000004656613, 0.9600000005587935, - 1.0400000005587935, 1.1200000006519258, 1.2000000006519258, - 1.3000000007450581, 1.4000000007450581, 1.5000000008381903, - 1.6000000008381903, 1.6800000000931323, 1.7600000000931323, - 1.8400000001862645, 1.9200000001862645, 2.0000000002793968 - ], - "Ultra": [ - 0.480000000372529, 0.512000000372529, 0.544000000372529, - 0.576000000372529, 0.608000000372529, 0.640000000372529, - 0.680000000372529, 0.720000000372529, 0.760000000372529, - 0.800000000372529, 0.832000000372529, 0.864000000372529, - 0.896000000372529, 0.928000000372529, 0.960000000372529 - ], - "DOT": [ - 1.1600000004656613, 1.2688000004656613, 1.3775000005587935, - 1.4863000005587935, 1.5950000006519258, 1.7581000006519258, - 1.9756000007450581, 2.2475000007450581, 2.5738000008381903, - 2.9000000008381903, 3.0414000000931323, 3.1828000000931323, - 3.3241000001862645, 3.4655000001862645, 3.6069000002793968 - ], - "Talent": [ - 0.420000000372529, 0.518000000372529, 0.616000000372529, - 0.714000000372529, 0.812000000372529, 0.910000000372529, - 1.032500000372529, 1.155000000372529, 1.277500000372529, - 1.400000000372529, 1.498000000372529, 1.596000000372529, - 1.694000000372529, 1.792000000372529, 1.890000000372529 - ], - "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "DOT": ["attack", "单次持续伤害", 1, "DOT", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } - }, - "1205": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "Normal1": [ - 0.2000000004656613, 0.2400000005587935, 0.2800000006519258, - 0.3200000007450581, 0.3600000008381903, 0.4000000000931323, - 0.4400000001862645, 0.4800000002793968, 0.5200000002793968 - ], - "Normal1_HP": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "BPSkill": [ - 0.1200000004656613, 0.1480000004656613, 0.1760000005587935, - 0.204000000372529, 0.232000000372529, 0.260000000372529, - 0.295000000372529, 0.330000000372529, 0.365000000372529, - 0.400000000372529, 0.428000000372529, 0.456000000372529, - 0.484000000372529, 0.512000000372529, 0.540000000372529 - ], - "Ultra": [ - 0.240000000372529, 0.256000000372529, 0.272000000372529, - 0.288000000372529, 0.304000000372529, 0.320000000372529, - 0.340000000372529, 0.360000000372529, 0.380000000372529, - 0.400000000372529, 0.416000000372529, 0.432000000372529, - 0.448000000372529, 0.464000000372529, 0.480000000372529 - ], - "Ultra_HP": [ - 1.500000000372529, 1.540000000372529, 1.580000000372529, - 1.620000000372529, 1.660000000372529, 1.700000000372529, - 1.750000000372529, 1.800000000372529, 1.850000000372529, - 1.900000000372529, 1.940000000372529, 1.980000000372529, - 2.020000000372529, 2.060000000372529, 2.100000000372529 - ], - "Talent": [ - 0.220000000372529, 0.242000000372529, 0.264000000372529, - 0.286000000372529, 0.308000000372529, 0.330000000372529, - 0.357500000372529, 0.385000000372529, 0.412500000372529, - 0.440000000372529, 0.462000000372529, 0.484000000372529, - 0.506000000372529, 0.528000000372529, 0.550000000372529 - ], - "Talent_HP": [ - 0.550000000372529, 0.605000000372529, 0.660000000372529, - 0.715000000372529, 0.770000000372529, 0.825000000372529, - 0.893800000372529, 0.962500000372529, 1.031300000372529, - 1.100000000372529, 1.155000000372529, 1.210000000372529, - 1.265000000372529, 1.320000000372529, 1.375000000372529 - ], - "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Normal1": ["attack", "无间剑树", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } - }, - "1208": { - "Normal": [0, 0, 0, 0, 0, 0, 0, 0, 0], - "Normal_HP": [ - 0.2500000004656613, 0.3000000005587935, 0.3500000006519258, - 0.4000000007450581, 0.4500000008381903, 0.5000000000931323, - 0.5500000001862645, 0.6000000002793968, 0.6500000002793968 - ], - "BPSkill_HP": [ - 0.0300000004656613, 0.0330000004656613, 0.0360000005587935, - 0.039000000372529, 0.042000000372529, 0.045000000372529, - 0.048800000372529, 0.052500000372529, 0.056300000372529, - 0.060000000372529, 0.063000000372529, 0.066000000372529, - 0.069000000372529, 0.072000000372529, 0.075000000372529 - ], - "BPSkill_CC": [ - 0.0600000004656613, 0.0660000004656613, 0.0720000005587935, - 0.078000000372529, 0.084000000372529, 0.090000000372529, - 0.097500000372529, 0.105000000372529, 0.112500000372529, - 0.120000000372529, 0.126000000372529, 0.132000000372529, - 0.138000000372529, 0.144000000372529, 0.150000000372529 - ], - "Ultra": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "Ultra_HP": [ - 0.600000000372529, 0.640000000372529, 0.680000000372529, - 0.720000000372529, 0.760000000372529, 0.800000000372529, - 0.850000000372529, 0.900000000372529, 0.950000000372529, - 1.000000000372529, 1.040000000372529, 1.080000000372529, - 1.120000000372529, 1.160000000372529, 1.200000000372529 - ], - "Talent": [ - 0.220000000372529, 0.242000000372529, 0.264000000372529, - 0.286000000372529, 0.308000000372529, 0.330000000372529, - 0.357500000372529, 0.385000000372529, 0.412500000372529, - 0.440000000372529, 0.462000000372529, 0.484000000372529, - 0.506000000372529, 0.528000000372529, 0.550000000372529 - ], - "Maze": [20], - "Ultra_Use": [135], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1104": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "BPSkill": [ - 1.0000000004656613, 1.1000000004656613, 1.2000000005587935, - 1.300000000372529, 1.400000000372529, 1.500000000372529, - 1.625000000372529, 1.750000000372529, 1.875000000372529, - 2.000000000372529, 2.100000000372529, 2.200000000372529, - 2.300000000372529, 2.400000000372529, 2.500000000372529 - ], - "Ultra": [ - 0.300000000372529, 0.318800000372529, 0.337500000372529, - 0.356300000372529, 0.375000000372529, 0.390000000372529, - 0.405000000372529, 0.420000000372529, 0.435000000372529, - 0.450000000372529, 0.465000000372529, 0.480000000372529, - 0.495000000372529, 0.510000000372529, 0.525000000372529 - ], - "Ultra_G": [ - 150, 240, 308, 375, 420, 465, 499, 533, 566, 600, 634, 668, 701, 735, 769 - ], - "Maze": [20], - "Ultra_Use": [110], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["defence", "终结技(护盾)", 1, "Ultra", "Ultra"] - } - }, - "1209": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 1.1000000000931323, 1.2100000001955777, 1.3200000002980232, - 1.4300000004004687, 1.5400000005029142, 1.6500000006053597, - 1.7875000005587935, 1.9250000005122274, 2.0625000002328306, - 2.2000000001862645, 2.31000000028871, 2.4200000003911555, - 2.530000000493601, 2.6400000005960464, 2.750000000698492 - ], - "Ultra": [ - 2.1000000005122274, 2.2400000006705523, 2.380000000828877, - 2.5200000000558794, 2.660000000214204, 2.800000000372529, - 2.975000000745058, 3.150000000419095, 3.332499999860302, - 3.500000000232831, 3.6400000003911555, 3.78000000054948, - 3.920000000707805, 4.06000000086613, 4.200000000093132 - ], - "Ultra_CD": [ - 0.3000000005122274, 0.3200000006705523, 0.340000000828877, - 0.3600000000558794, 0.380000000214204, 0.400000000372529, - 0.425000000745058, 0.450000000419095, 0.474999999860302, - 0.500000000232831, 0.5200000003911555, 0.54000000054948, - 0.560000000707805, 0.58000000086613, 0.600000000093132 - ], - "Talent": [ - 0.25000000037252903, 0.27500000040978193, 0.30000000044703484, - 0.3250000004842877, 0.3500000005215406, 0.3750000005587935, - 0.4063000006053597, 0.4375000006519258, 0.4688000006984919, - 0.5000000007450581, 0.525000000782311, 0.5500000008195639, - 0.5750000008568168, 0.6000000008940697, 0.6250000008940697 - ], - "Talent_CC": [ - 0.15000000037252903, 0.15500000040978193, 0.16000000044703484, - 0.1650000004842877, 0.1700000005215406, 0.1750000005587935, - 0.1813000006053597, 0.1875000006519258, 0.1938000006984919, - 0.2000000007450581, 0.205000000782311, 0.2100000008195639, - 0.2150000008568168, 0.2200000008940697, 0.2250000008940697 - ], - "Talent_CD": [ - 0.15000000037252903, 0.16500000040978193, 0.18000000044703484, - 0.1950000004842877, 0.2100000005215406, 0.2250000005587935, - 0.2438000006053597, 0.2625000006519258, 0.2813000006984919, - 0.3000000007450581, 0.315000000782311, 0.3300000008195639, - 0.3450000008568168, 0.3600000008940697, 0.3750000008940697 - ], - "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "附加伤害", 1, "Talent", "Talent"] - } - }, - "1004": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 1.0800000000931323, 1.1880000001955777, 1.2960000002980232, - 1.4040000004004687, 1.5120000005029142, 1.6200000006053597, - 1.7550000005587935, 1.8900000005122274, 2.0550000002328306, - 2.1600000001862645, 2.26800000028871, 2.3760000003911555, - 2.484000000493601, 2.5920000005960464, 2.700000000698492 - ], - "Ultra": [ - 0.9000000005122274, 0.9600000006705523, 1.020000000828877, - 1.0800000000558794, 1.140000000214204, 1.200000000372529, - 1.275000000745058, 1.350000000419095, 1.424999999860302, - 1.500000000232831, 1.5600000003911555, 1.62000000054948, - 1.680000000707805, 1.74000000086613, 1.800000000093132 - ], - "Talent": [ - 0.30000000037252903, 0.33000000040978193, 0.36000000044703484, - 0.3900000004842877, 0.4200000005215406, 0.4500000005587935, - 0.4875000006053597, 0.525000006519258, 0.5625000006984919, - 0.6000000007450581, 0.63000000782311, 0.6600000008195639, - 0.6900000008568168, 0.7200000008940697, 0.7500000008940697 - ], - "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 3, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1003": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "BPSkill": [ - 1.0000000000931323, 1.1000000001955777, 1.2000000002980232, - 1.3000000004004687, 1.4000000005029142, 1.5000000006053597, - 1.6250000005587935, 1.7500000005122274, 1.8750000002328306, - 2.0000000001862645, 2.10000000028871, 2.2000000003911555, - 2.300000000493601, 2.4000000005960464, 2.500000000698492 - ], - "Ultra": [ - 1.3800000005122274, 1.4720000006705523, 1.564000000828877, - 1.6560000000558794, 1.748000000214204, 1.840000000372529, - 1.955000000745058, 2.070000000419095, 2.185000000860302, - 2.300000000232831, 2.3920000003911555, 2.48400000054948, - 2.596000000707805, 2.66800000086613, 2.76000000093132 - ], - "Talent": [ - 0.70000000037252903, 0.77000000040978193, 0.84000000044703484, - 0.9100000004842877, 0.9800000005215406, 1.0500000005587935, - 1.1375000006053597, 1.225000006519258, 1.312500006984919, - 1.4000000007450581, 1.47000000782311, 1.5400000008195639, - 1.6100000008568168, 1.6800000008940697, 1.7500000008940697 - ], - "Maze": [20], - "Ultra_Use": [120], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "Talent": ["attack", "追加攻击", 1, "Talent", "Talent"] - } - }, - "1201": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968 - ], - "Normal1": [ - 1.2000000000931323, 1.4400000001955777, 1.6800000002980232, - 1.9200000004004687, 2.1600000005029142, 2.4000000006053597, - 2.6450000005587935, 2.8800000005122274, 3.1200000002328306 - ], - "BPSkill": [ - 0.14000000037252903, 0.15400000040978193, 0.16800000044703484, - 0.1820000004842877, 0.1960000005215406, 0.2100000005587935, - 0.2275000006053597, 0.2450000006519258, 0.2625000006984919, - 0.2800000007450581, 0.294000000782311, 0.3080000008195639, - 0.3220000008568168, 0.3360000008940697, 0.3500000008940697 - ], - "Ultra": [ - 1.2000000005122274, 1.2800000006705523, 1.360000000828877, - 1.440000000558794, 1.520000000214204, 1.600000000372529, - 1.700000000745058, 1.800000000419095, 1.900000000860302, - 2.000000000232831, 2.0800000003911555, 2.16000000054948, - 2.240000000707805, 2.32000000086613, 2.40000000093132 - ], - "Talent": [ - 0.36000000037252903, 0.39600000040978193, 0.43200000044703484, - 0.4680000004842877, 0.5040000005215406, 0.5400000005587935, - 0.5850000006053597, 0.6300000006519258, 0.6750000006984919, - 0.7200000007450581, 0.756000000782311, 0.7920000008195639, - 0.8280000008568168, 0.8640000008940697, 0.9000000008940697 - ], - "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "Normal1": ["attack", "杠上开花!", 1, "Normal", "Normal"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1212": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "BPSkill": [ - 1.0000000005122274, 1.1000000006705523, 1.200000000828877, - 1.300000000558794, 1.400000000214204, 1.500000000372529, - 1.630000000745058, 1.750000000419095, 1.880000000860302, - 2.000000000232831, 2.1000000003911555, 2.20000000054948, - 2.300000000707805, 2.40000000086613, 2.50000000093132 - ], - "BPSkill1": [ - 1.2500000005122274, 1.3750000006705523, 1.500000000828877, - 1.625000000558794, 1.750000000214204, 1.875000000372529, - 2.031250000745058, 2.187500000419095, 2.343750000860302, - 2.500000000232831, 2.6250000003911555, 2.75000000054948, - 2.875000000707805, 3.00000000086613, 3.12500000093132 - ], - "Ultra": [ - 1.8000000005122274, 1.9200000006705523, 2.040000000828877, - 2.160000000558794, 2.280000000214204, 2.400000000372529, - 2.550000000745058, 2.700000000419095, 2.850000000860302, - 3.000000000232831, 3.1200000003911555, 3.24000000054948, - 3.360000000707805, 3.48000000086613, 3.60000000093132 - ], - "Talent_CC": [ - 0.40000000037252903, 0.41000000040978193, 0.42000000044703484, - 0.4300000004842877, 0.4400000005215406, 0.4500000005587935, - 0.4625000006053597, 0.4750000006519258, 0.4875000006984919, - 0.5000000007450581, 0.510000000782311, 0.5200000008195639, - 0.5300000008568168, 0.5400000008940697, 0.5500000008940697 - ], - "Talent_atk": [ - 0.90000000037252903, 0.99000000040978193, 1.08000000044703484, - 1.1700000004842877, 1.2600000005215406, 1.3500000005587935, - 1.4625000006053597, 1.5750000006519258, 1.6875000006984919, - 1.8000000007450581, 1.890000000782311, 1.9800000008195639, - 2.0700000008568168, 2.1600000008940697, 2.2500000008940697 - ], - "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "BPSkill1": ["attack", "寒川映月", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"] - } - }, - "1112": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000001862645, 1.2000000002793968, 1.3000000002793968 - ], - "BPSkill": [ - 0.7500000005122274, 0.8250000006705523, 0.900000000828877, - 0.975000000558794, 1.050000000214204, 1.125000000372529, - 1.218750000745058, 1.312500000419095, 1.406250000860302, - 1.500000000232831, 1.575000000391155, 1.65000000054948, 1.725000000707805, - 1.80000000086613, 1.87500000093132 - ], - "BPSkill_add": [ - 0.2500000005122274, 0.2750000006705523, 0.300000000828877, - 0.325000000558794, 0.350000000214204, 0.375000000372529, - 0.406250000745058, 0.437500000419095, 0.468750000860302, - 0.500000000232831, 0.5250000003911555, 0.55000000054948, - 0.575000000707805, 0.60000000086613, 0.62500000093132 - ], - "Talent1": [ - 0.7500000005122274, 0.8250000006705523, 0.900000000828877, - 0.975000000558794, 1.050000000214204, 1.125000000372529, - 1.218750000745058, 1.312500000419095, 1.406250000860302, - 1.500000000232831, 1.575000000391155, 1.65000000054948, 1.725000000707805, - 1.80000000086613, 1.87500000093132 - ], - "Ultra_CD": [ - 0.1250000005122274, 0.13750000006705523, 0.150000000828877, - 0.162500000558794, 0.175000000214204, 0.187500000372529, - 0.203125000745058, 0.218750000419095, 0.234375000860302, - 0.250000000232831, 0.262500000391155, 0.27500000054948, 0.287500000707805, - 0.30000000086613, 0.31250000093132 - ], - "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Talent", "Normal"], - "BPSkill": ["attack", "账账", 1, "Talent", "BPSkill"], - "Talent1": ["attack", "强化账账", 1, "Talent", "Talent"] - } - }, - "1210": { - "Normal": [ - 0.5000000004656613, 0.6000000005587935, 0.7000000006519258, - 0.8000000007450581, 0.9000000008381903, 1.0000000000931323, - 1.1000000000931323, 1.2000000001862645, 1.3000000002793968 - ], - "BPSkill": [ - 0.6000000005587935, 0.6600000006146729, 0.7200000006705523, - 0.7800000007264316, 0.840000000782311, 0.9000000008381903, - 0.9750000005587935, 1.0500000000465661, 1.1249999997671694, - 1.2000000001862645, 1.2600000002421439, 1.3200000002980232, - 1.3800000003539026, 1.440000000409782, 1.5000000004656613 - ], - "DOT": [ - 0.8390400004573166, 0.9229800018947572, 1.0069200003053993, - 1.0908600010443479, 1.1748000003863126, 1.3007100007962435, - 1.4685900008771569, 1.6784400006290525, 1.9302600014489144, - 2.182080000638962, 2.2912020003423095, 2.400324000744149, - 2.5094460004474968, 2.6185680008493364, 2.727690001251176 - ], - "Ultra": [ - 0.7200000006705523, 0.7680000001564622, 0.8160000003408641, - 0.8640000005252659, 0.9120000007096678, 0.9600000008940697, - 1.0200000000186265, 1.0800000000745058, 1.1400000001303852, - 1.2000000001862645, 1.2479999996721745, 1.2959999998565763, - 1.3440000000409782, 1.39200000022538, 1.440000000409782 - ], - "Talent": [ - 0.0400000000372529, 0.04299999983049929, 0.04599999962374568, - 0.04899999941699207, 0.05199999990873039, 0.054999999701976776, - 0.058750000316649675, 0.06250000023283064, 0.06625000014901161, - 0.07000000006519258, 0.07299999985843897, 0.07599999965168536, - 0.07899999944493175, 0.08199999993667006, 0.08499999972991645 - ], - "Maze": [20], - "Ultra_Use": [140], - "skillList": { - "Normal": ["attack", "普攻", 1, "Normal", "Normal"], - "BPSkill": ["attack", "战技", 1, "BPSkill", "BPSkill"], - "Ultra": ["attack", "终结技", 1, "Ultra", "Ultra"], - "DOT": ["attack", "每段灼烧", 1, "DOT", "BPSkill"] - } - } -} diff --git a/StarRailUID/starrailuid_charinfo/effect/Excel/weapon_effect.json b/StarRailUID/starrailuid_charinfo/effect/Excel/weapon_effect.json deleted file mode 100644 index 17c1461..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Excel/weapon_effect.json +++ /dev/null @@ -1,469 +0,0 @@ -{ - "23001": { - "Param": { - "CriticalChance": [ - 0.18000000016763806, 0.21000000019557774, 0.24000000022351742, - 0.2700000002514571, 0.3000000002793968 - ], - "a_dmg": [ - 0.060000000055879354, 0.07000000006519258, 0.0800000000745058, - 0.09000000008381903, 0.10000000009313226 - ], - "e_dmg": [ - 0.060000000055879354, 0.07000000006519258, 0.0800000000745058, - 0.09000000008381903, 0.10000000009313226 - ], - "q_crit_dmg": [ - 0.12000000011175871, 0.14000000013038516, 0.1600000001490116, - 0.18000000016763806, 0.20000000018626451 - ] - }, - "AbilityProperty": [ - 0.18000000016763806, 0.21000000019557774, 0.24000000022351742, - 0.2700000002514571, 0.3000000002793968 - ] - }, - "21003": { - "Param": { - "CriticalChance": [ - 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, - 0.21000000019557774, 0.24000000022351742 - ] - } - }, - "24001": { - "Param": { - "CriticalChance": [ - 0.0800000000745058, 0.10000000009313226, 0.12000000011175871, - 0.14000000013038516, 0.1600000001490116 - ], - "AttackAddedRatio": [ - 0.20000000018626451, 0.25000000023283064, 0.3000000002793968, - 0.3500000003259629, 0.40000000037252903 - ] - }, - "AbilityProperty": [ - 0.0800000000745058, 0.10000000009313226, 0.12000000011175871, - 0.14000000013038516, 0.1600000001490116 - ] - }, - "21024": { - "Param": { - "SpeedAddedRatio": [ - 0.0800000000745058, 0.09000000008381903, 0.10000000009313226, - 0.11000000010244548, 0.12000000011175871 - ], - "AllDamageAddedRatio": [ - 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, - 0.21000000019557774, 0.24000000022351742 - ] - } - }, - "21017": { - "Param": { - "a_dmg": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ], - "e_dmg": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ] - } - }, - "23010": { - "Param": { - "CriticalDamageBase": [ - 0.36000000022351742, 0.4200000002793968, 0.4800000003352761, - 0.5400000003911555, 0.60000000044703484 - ], - "e_dmg": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ], - "r_dmg": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ], - "t_dmg": [ - 0.48000000022351742, 0.5600000002793968, 0.6400000003352761, - 0.7200000003911555, 0.80000000044703484 - ] - } - }, - "20002": { - "Param": { - "a_dmg": [ - 0.20000000022351742, 0.2500000002793968, 0.3000000003352761, - 0.3500000003911555, 0.40000000044703484 - ], - "e_dmg": [ - 0.20000000022351742, 0.2500000002793968, 0.3000000003352761, - 0.3500000003911555, 0.40000000044703484 - ] - } - }, - "21006": { - "Param": { - "t_dmg": [ - 0.48000000022351742, 0.6000000002793968, 0.7200000003352761, - 0.8400000003911555, 0.96000000044703484 - ] - } - }, - "21012": { - "Param": { - "AllDamageAddedRatio": [ - 0.40000000022351742, 0.5000000002793968, 0.6000000003352761, - 0.7000000003911555, 0.80000000044703484 - ] - } - }, - "20011": { - "Param": { - "AllDamageAddedRatio": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ] - } - }, - "20004": { - "Param": { - "StatusProbability": [ - 0.20000000022351742, 0.2500000002793968, 0.3000000003352761, - 0.3500000003911555, 0.40000000044703484 - ] - } - }, - "20020": { - "Param": { - "A3_AttackAddedRatio": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ] - } - }, - "21013": { - "Param": { - "r_dmg": [ - 0.32000000022351742, 0.4000000002793968, 0.4800000003352761, - 0.5600000003911555, 0.64000000044703484 - ] - } - }, - "20006": { - "Param": { - "r_dmg": [ - 0.28000000022351742, 0.3500000002793968, 0.4200000003352761, - 0.4900000003911555, 0.56000000044703484 - ] - } - }, - "20014": { - "Param": { - "SpeedAddedRatio": [ - 0.10000000009313226, 0.12000000011175871, 0.14000000013038516, - 0.1600000001490116, 0.18000000016763806 - ] - } - }, - "20007": { - "Param": { - "AttackAddedRatio": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ] - } - }, - "23000": { - "Param": { - "AttackAddedRatio": [ - 0.09000000022351742, 0.1050000002793968, 0.1200000003352761, - 0.1350000003911555, 0.15000000044703484 - ], - "AllDamageAddedRatio": [ - 0.30000000022351742, 0.3500000002793968, 0.4000000003352761, - 0.4500000003911555, 0.50000000044703484 - ] - } - }, - "21001": { - "Param": { - "AllDamageAddedRatio": [ - 0.12000000022351742, 0.1500000002793968, 0.1800000003352761, - 0.2100000003911555, 0.24000000044703484 - ] - } - }, - "23011": { - "Param": { - "AllDamageAddedRatio": [ - 0.09000000022351742, 0.1050000002793968, 0.1200000003352761, - 0.1350000003911555, 0.15000000044703484 - ] - } - }, - "23005": { - "Param": { - "DefenceAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "20003": { - "Param": { - "DefenceAddedRatio": [ - 0.1600000000745058, 0.20000000009313226, 0.24000000011175871, - 0.28000000013038516, 0.3200000001490116 - ] - } - }, - "21022": { - "Param": { - "AllDamageAddedRatio": [ - 0.16000000022351742, 0.2050000002793968, 0.2400000003352761, - 0.2850000003911555, 0.32000000044703484 - ] - } - }, - "21015": { - "Param": { - "ignore_defence": [ - 0.12000000022351742, 0.1300000002793968, 0.1400000003352761, - 0.1500000003911555, 0.16000000044703484 - ] - } - }, - "23004": { - "Param": { - "AllDamageAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ], - "A2_StatusProbability": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ], - "A2_AttackAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "23007": { - "Param": { - "DmgRatio": [ - 0.12000000022351742, 0.1400000002793968, 0.1600000003352761, - 0.1800000003911555, 0.20000000044703484 - ], - "CriticalChance": [ - 0.12000000022351742, 0.1400000002793968, 0.1600000003352761, - 0.1800000003911555, 0.20000000044703484 - ] - } - }, - "23006": { - "Param": { - "SpeedAddedRatio": [ - 0.04800000022351742, 0.0560000002793968, 0.0640000003352761, - 0.0720000003911555, 0.0800000044703484 - ], - "AllDamageAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "21020": { - "Param": { - "AttackAddedRatio": [ - 0.16000000022351742, 0.2050000002793968, 0.2400000003352761, - 0.2850000003911555, 0.32000000044703484 - ], - "CriticalDamageBase": [ - 0.24000000022351742, 0.3000000002793968, 0.3600000003352761, - 0.4200000003911555, 0.48000000044703484 - ] - } - }, - "23015": { - "Param": { - "AttackAddedRatio": [ - 0.18000000022351742, 0.2150000002793968, 0.2400000003352761, - 0.2750000003911555, 0.30000000044703484 - ], - "CriticalChance": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ] - } - }, - "20016": { - "Param": { - "CriticalChance": [ - 0.12000000022351742, 0.1500000002793968, 0.1800000003352761, - 0.2100000003911555, 0.24000000044703484 - ] - } - }, - "21005": { - "Param": { - "AttackAddedRatio": [ - 0.12000000022351742, 0.1500000002793968, 0.1800000003352761, - 0.2100000003911555, 0.24000000044703484 - ] - } - }, - "21019": { - "Param": { - "AttackAddedRatio": [ - 0.16000000022351742, 0.200000002793968, 0.2400000003352761, - 0.2850000003911555, 0.32000000044703484 - ], - "CriticalChance": [ - 0.12000000022351742, 0.1500000002793968, 0.1800000003352761, - 0.2100000003911555, 0.24000000044703484 - ] - } - }, - "23009": { - "Param": { - "CriticalChance": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ], - "HPAddedRatio": [ - 0.18000000022351742, 0.2100000002793968, 0.2400000003352761, - 0.2700000003911555, 0.30000000044703484 - ], - "AllDamageAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "21034": { - "Param": { - "AllDamageAddedRatio": [ - 0.0020000022351742, 0.0025000002793968, 0.0030000003352761, - 0.0035000003911555, 0.0040000044703484 - ] - } - }, - "20009": { - "Param": { - "AllDamageAddedRatio": [ - 0.2000000000745058, 0.25000000009313226, 0.30000000011175871, - 0.35000000013038516, 0.4100000001490116 - ] - } - }, - "21010": { - "Param": { - "AllDamageAddedRatio": [ - 0.0800000000745058, 0.10000000009313226, 0.12000000011175871, - 0.14000000013038516, 0.1600000001490116 - ] - } - }, - "21033": { - "Param": { - "AllDamageAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ], - "AttackAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "23014": { - "Param": { - "AllDamageAddedRatio": [ - 0.1400000000745058, 0.16400000009313226, 0.19000000011175871, - 0.21400000013038516, 0.2400000001490116 - ], - "ResistancePenetration": [ - 0.1200000000745058, 0.14000000009313226, 0.16000000011175871, - 0.18000000013038516, 0.2000000001490116 - ] - } - }, - "23002": { - "Param": { - "AllDamageAddedRatio": [ - 0.2400000000745058, 0.28000000009313226, 0.32000000011175871, - 0.36000000013038516, 0.4000000001490116 - ] - } - }, - "21026": { - "Param": { - "AllDamageAddedRatio": [ - 0.16000000011175871, 0.2000000001396984, 0.24000000016763806, - 0.28000000019557774, 0.32000000022351742 - ], - "AttackAddedRatio": [ - 0.1000000000745058, 0.12500000009313226, 0.15000000011175871, - 0.17500000013038516, 0.2000000001490116 - ] - } - }, - "24000": { - "Param": { - "AllDamageAddedRatio": [ - 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, - 0.21000000019557774, 0.24000000022351742 - ], - "AttackAddedRatio": [ - 0.0800000000745058, 0.10000000009313226, 0.12000000011175871, - 0.14000000013038516, 0.1600000001490116 - ] - } - }, - "21027": { - "Param": { - "AllDamageAddedRatio": [ - 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, - 0.21000000019557774, 0.24000000022351742 - ], - "AttackAddedRatio": [ - 0.04000000011175871, 0.0500000001396984, 0.06000000016763806, - 0.07000000019557774, 0.08000000022351742 - ] - } - }, - "23012": { - "Param": { - "CriticalChance": [ - 0.36000000011175871, 0.4200000001396984, 0.48000000016763806, - 0.54000000019557774, 0.60000000022351742 - ] - } - }, - "23016": { - "Param": { - "CriticalDamageBase": [ - 0.12000000011175871, 0.14000000013038516, 0.1600000001490116, - 0.18000000016763806, 0.20000000018626451 - ], - "TalentDmgAdd": [ - 0.30000000011175871, 0.3500000001396984, 0.40000000016763806, - 0.45000000019557774, 0.50000000022351742 - ] - } - }, - "21031": { - "enable": false - }, - "20000": { - "Param": { - "CriticalChance": [ - 0.12000000011175871, 0.1500000001396984, 0.18000000016763806, - 0.21000000019557774, 0.24000000022351742 - ] - } - } -} diff --git a/StarRailUID/starrailuid_charinfo/effect/Relic/Relic.py b/StarRailUID/starrailuid_charinfo/effect/Relic/Relic.py deleted file mode 100644 index 7e2b21f..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Relic/Relic.py +++ /dev/null @@ -1,742 +0,0 @@ -from collections import Counter -from typing import Dict, List, Union - -from gsuid_core.logger import logger - -from ..utils import merge_attribute -from ..Base.model import DamageInstanceRelic -from ..Base.RelicBase import SingleRelic, BaseRelicSetSkill - - -class Relic101(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 在战斗开始时 - """ - logger.info('Relic101 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - pass - return attribute_bonus - - -class Relic102(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 无 - """ - logger.info('Relic102 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - a_dmg = attribute_bonus.get('NormalDmgAdd', 0) - attribute_bonus['NormalDmgAdd'] = a_dmg + 0.10000000018626451 - return attribute_bonus - - -class Relic103(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 战斗中生效:装备者提供的护盾量提高 - """ - logger.info('Relic103 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - shield_added_ratio = attribute_bonus.get('shield_added_ratio', 0) - attribute_bonus['shield_added_ratio'] = ( - shield_added_ratio + 0.20000000018626451 - ) - return attribute_bonus - - -class Relic104(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者施放终结技 - """ - logger.info('Relic104 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - critical_damage_base = attribute_bonus.get('CriticalDamageBase', 0) - attribute_bonus['CriticalDamageBase'] = ( - critical_damage_base + 0.25000000023283064 - ) - return attribute_bonus - - -class Relic105(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 施放攻击或受到攻击时, 默认叠满 - """ - logger.info('Relic105 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio + 0.05000000004656613 * 5 - ) - return attribute_bonus - - -class Relic106(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 无 - """ - logger.info('Relic106 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - pass - return attribute_bonus - - -class Relic107(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - TODO: 检查是否是火属性伤害 - """ - logger.info('Relic107 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4: - e_dmg = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = e_dmg + 0.12000000011175871 - if self.pieces4 and await self.check(base_attr, attribute_bonus): - fire_added_ratio = attribute_bonus.get('FireAddedRatio', 0) - attribute_bonus['FireAddedRatio'] = ( - fire_added_ratio + 0.12000000011175871 - ) - return attribute_bonus - - -class Relic108(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者对敌方目标造成伤害 - 目标拥有量子属性弱点 - """ - logger.info('Relic108 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info(attribute_bonus) - ignore_defence = attribute_bonus.get('ignore_defence', 0) - attribute_bonus['ignore_defence'] = ( - ignore_defence + 0.10000000009313226 * 2 - ) - return attribute_bonus - - -class Relic109(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - TODO: 检查是否释放战技 - """ - logger.info('Relic109 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info(attribute_bonus) - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio + 0.20000000018626451 - ) - return attribute_bonus - - -class Relic110(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者施放终结技 - """ - logger.info('Relic110 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info('ModifyActionDelay') - return attribute_bonus - - -class Relic111(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - self._count = count - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者击破敌方目标弱点 - """ - logger.info('Relic111 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info('ModifySPNew') - return attribute_bonus - - -class Relic112(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - self._count = count - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者对陷入负面效果的敌方目标造成伤害 - 对陷入禁锢状态的敌方目标造成伤害 - """ - logger.info('Relic111 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info('对陷入负面效果的敌方目标造成伤害') - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base + 0.10000000009313226 - ) - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info('对陷入禁锢状态的敌方目标造成伤害') - critical_damage_base = attribute_bonus.get('CriticalDamageBase', 0) - attribute_bonus['CriticalDamageBase'] = ( - critical_damage_base + 0.20000000018626451 - ) - return attribute_bonus - - -class Relic113(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - self._count = count - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 当装备者受到攻击或被我方目标消耗生命值后, 暴击率提高8%, 持续2回合, 该效果最多叠加2层。 - """ - logger.info('Relic113 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - logger.info('当装备者受到攻击或被我方目标消耗生命值后') - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base + 0.08000000009313226 * 2 - ) - return attribute_bonus - - -class Relic114(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - self._count = count - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 当装备者对我方目标施放终结技时, 我方全体速度提高12%, 持续1回合, 该效果无法叠加。 - """ - logger.info('Relic114 check success') - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces4 and await self.check(base_attr, attribute_bonus): - speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0) - attribute_bonus['SpeedAddedRatio'] = ( - speed_added_ratio + 0.12000000011175871 - ) - return attribute_bonus - - -class Relic301(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者的速度大于等于120 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['speed'] >= 120: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio + 0.12000000011175871 - ) - return attribute_bonus - - -class Relic302(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者的速度大于等于120 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['speed'] >= 120: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio + 0.0800000000745058 - ) - return attribute_bonus - - -class Relic303(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - # 提高装备者等同于当前效果命中25%的攻击力,最多提高25% - return True - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - merged_attr = await merge_attribute(base_attr, attribute_bonus) - status_probability = merged_attr.get('StatusProbabilityBase', 0) - # 提高装备者等同于当前效果命中25%的攻击力,最多提高25% - attribute_bonus['AttackAddedRatio'] = attack_added_ratio + min( - 0.25000000023283064, status_probability / 0.25 - ) - return attribute_bonus - - -class Relic304(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 备者的效果命中大于等于50% - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['StatusResistanceBase'] >= 0.5000000004656613: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - defence_added_ratio = attribute_bonus.get('DefenceAddedRatio', 0) - attribute_bonus['DefenceAddedRatio'] = ( - defence_added_ratio + 0.1500000001396984 - ) - return attribute_bonus - - -class Relic305(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者的暴击伤害大于等于120% - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['CriticalDamageBase'] >= 1.2000000001862645: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base + 0.6000000005587935 - ) - return attribute_bonus - - -class Relic306(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者当前暴击率大于等于50% - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['CriticalChanceBase'] >= 0.5: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - q_dmg = attribute_bonus.get('UltraDmgAdd', 0) - attribute_bonus['UltraDmgAdd'] = q_dmg + 0.1500000001396984 - a3_dmg = attribute_bonus.get('TalentDmgAdd', 0) - attribute_bonus['TalentDmgAdd'] = a3_dmg + 0.1500000001396984 - return attribute_bonus - - -class Relic307(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者的速度大于等于145 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['speed'] >= 145: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - break_damage_added_ratio_base = attribute_bonus.get( - 'BreakDamageAddedRatioBase', 0 - ) - attribute_bonus['BreakDamageAddedRatioBase'] = ( - break_damage_added_ratio_base + 0.20000000018626451 - ) - return attribute_bonus - - -class Relic308(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 装备者的速度大于等于120 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['speed'] >= 120: - logger.info('Relic306 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - logger.info('ModifyActionDelay') - return attribute_bonus - - -class Relic309(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 当装备者的当前暴击率大于等于70%时, 普攻和战技造成的伤害提高20%。 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['CriticalChanceBase'] >= 0.7: - logger.info('Relic309 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - a_dmg = attribute_bonus.get('NormalDmgAdd', 0) - attribute_bonus['NormalDmgAdd'] = a_dmg + 0.20000000018626451 - a2_dmg = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = a2_dmg + 0.20000000018626451 - return attribute_bonus - - -class Relic310(BaseRelicSetSkill): - def __init__(self, set_id: int, count: int): - super().__init__(set_id, count) - - async def check( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - """ - 当装备者的效果抵抗大于等于30%时, 我方全体暴击伤害提高10%。 - """ - merged_attr = await merge_attribute(base_attr, attribute_bonus) - if merged_attr['StatusResistanceBase'] >= 0.3: - logger.info('Relic310 check success') - return True - return False - - async def set_skill_ability( - self, base_attr: Dict[str, float], attribute_bonus: Dict[str, float] - ): - if self.pieces2 and await self.check(base_attr, attribute_bonus): - critical_damage_base = attribute_bonus.get('CriticalDamageBase', 0) - attribute_bonus['CriticalDamageBase'] = ( - critical_damage_base + 0.10000000018626451 - ) - return attribute_bonus - - -class RelicSet: - HEAD: SingleRelic - HAND: SingleRelic - BODY: SingleRelic - FOOT: SingleRelic - NECK: SingleRelic - OBJECT: SingleRelic - Unknow: SingleRelic - - SetSkill: List[ - Union[ - Relic101, - Relic102, - Relic103, - Relic104, - Relic105, - Relic106, - Relic107, - Relic108, - Relic109, - Relic110, - Relic111, - Relic112, - Relic113, - Relic114, - Relic301, - Relic302, - Relic303, - Relic304, - Relic305, - Relic306, - Relic307, - Relic308, - Relic309, - Relic310, - ] - ] - - def create(self, relic_list: List[DamageInstanceRelic]): - set_id_list: List[int] = [] - for relic in relic_list: - set_id_list.append(relic.SetId) - - if relic.Type == 1: - self.HEAD = SingleRelic(relic) - elif relic.Type == 2: - self.HAND = SingleRelic(relic) - elif relic.Type == 3: - self.BODY = SingleRelic(relic) - elif relic.Type == 4: - self.FOOT = SingleRelic(relic) - elif relic.Type == 5: - self.NECK = SingleRelic(relic) - elif relic.Type == 6: - self.OBJECT = SingleRelic(relic) - else: - self.Unknow = SingleRelic(relic) - - self.set_id_counter = Counter(set_id_list).most_common() - self.check_set() - self.get_attribute() - return self - - def get_attribute(self): - for item in self.__dict__: - if type(self.__dict__[item]) == SingleRelic: - itme__: SingleRelic = self.__dict__[item] - itme__.get_attribute_() - - def check_set(self): - self.SetSkill = [] - for item in self.set_id_counter: - set_id = item[0] - count = item[1] - - if set_id == 101: - self.SetSkill.append(Relic101(set_id, count)) - elif set_id == 102: - self.SetSkill.append(Relic102(set_id, count)) - elif set_id == 103: - self.SetSkill.append(Relic103(set_id, count)) - elif set_id == 104: - self.SetSkill.append(Relic104(set_id, count)) - elif set_id == 105: - self.SetSkill.append(Relic105(set_id, count)) - elif set_id == 106: - self.SetSkill.append(Relic106(set_id, count)) - elif set_id == 107: - self.SetSkill.append(Relic107(set_id, count)) - elif set_id == 108: - self.SetSkill.append(Relic108(set_id, count)) - elif set_id == 109: - self.SetSkill.append(Relic109(set_id, count)) - elif set_id == 110: - self.SetSkill.append(Relic110(set_id, count)) - elif set_id == 111: - self.SetSkill.append(Relic111(set_id, count)) - elif set_id == 112: - self.SetSkill.append(Relic112(set_id, count)) - elif set_id == 113: - self.SetSkill.append(Relic113(set_id, count)) - elif set_id == 114: - self.SetSkill.append(Relic114(set_id, count)) - elif set_id == 301: - self.SetSkill.append(Relic301(set_id, count)) - elif set_id == 302: - self.SetSkill.append(Relic302(set_id, count)) - elif set_id == 303: - self.SetSkill.append(Relic303(set_id, count)) - elif set_id == 304: - self.SetSkill.append(Relic304(set_id, count)) - elif set_id == 305: - self.SetSkill.append(Relic305(set_id, count)) - elif set_id == 306: - self.SetSkill.append(Relic306(set_id, count)) - elif set_id == 307: - self.SetSkill.append(Relic307(set_id, count)) - elif set_id == 308: - self.SetSkill.append(Relic308(set_id, count)) - elif set_id == 309: - self.SetSkill.append(Relic309(set_id, count)) - elif set_id == 310: - self.SetSkill.append(Relic310(set_id, count)) - else: - raise Exception(f'Unknow SetId: {set_id}') diff --git a/StarRailUID/starrailuid_charinfo/effect/Relic/__init__.py b/StarRailUID/starrailuid_charinfo/effect/Relic/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/StarRailUID/starrailuid_charinfo/effect/Role.py b/StarRailUID/starrailuid_charinfo/effect/Role.py deleted file mode 100644 index e096a61..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Role.py +++ /dev/null @@ -1,534 +0,0 @@ -import json -from pathlib import Path -from typing import List, Union - -from gsuid_core.logger import logger - -from .Avatar.Avatar import Avatar -from .Weapon.Weapon import Weapon -from .utils import merge_attribute -from ..mono.Character import Character -from .Base.model import DamageInstance -from .Relic.Relic import RelicSet, SingleRelic - -Excel_path = Path(__file__).parent -with Path.open(Excel_path / 'Excel' / 'SkillData.json', encoding='utf-8') as f: - skill_dict = json.load(f) - - -class RoleInstance: - def __init__(self, raw_data: Character): - self.raw_data = DamageInstance(raw_data) - - self.avatar = Avatar.create(self.raw_data.avatar, self.raw_data.skill) - self.weapon = Weapon.create(self.raw_data.weapon) - self.relic_set = RelicSet().create(self.raw_data.relic) - - self.base_attr = self.cal_role_base_attr() - self.attribute_bonus: dict[str, float] = {} - - self.cal_relic_attr_add() - self.cal_avatar_attr_add() - self.cal_avatar_eidolon_add() - self.cal_weapon_attr_add() - - def cal_role_base_attr(self): - logger.info('cal_role_base_attr') - base_attr: dict[str, float] = {} - avatar_attribute = self.avatar.avatar_attribute - for attr_name, attr_value in avatar_attribute.items(): - if attr_name in base_attr: - base_attr[attr_name] += attr_value - else: - base_attr[attr_name] = attr_value - - weapon_attribute = self.weapon.weapon_base_attribute - for attr_name, attr_value in weapon_attribute.items(): - if attr_name in base_attr: - base_attr[attr_name] += attr_value - else: - base_attr[attr_name] = attr_value - return base_attr - - def cal_relic_attr_add(self): - # 单件属性 - for relic_type in self.relic_set.__dict__: - if type(self.relic_set.__dict__[relic_type]) == SingleRelic: - relic: SingleRelic = self.relic_set.__dict__[relic_type] - for attribute in relic.relic_attribute_bonus: - if attribute in self.attribute_bonus: - self.attribute_bonus[ - attribute - ] += relic.relic_attribute_bonus[attribute] - else: - self.attribute_bonus[ - attribute - ] = relic.relic_attribute_bonus[attribute] - - # 套装面板加成属性 - for set_skill in self.relic_set.SetSkill: - for attribute in set_skill.relicSetAttribute: - if attribute in self.attribute_bonus: - self.attribute_bonus[ - attribute - ] += set_skill.relicSetAttribute[attribute] - else: - self.attribute_bonus[ - attribute - ] = set_skill.relicSetAttribute[attribute] - - def cal_avatar_attr_add(self): - attribute_bonus = self.avatar.avatar_attribute_bonus - if attribute_bonus: - for bonus in attribute_bonus: - status_add = bonus.statusAdd - bonus_property = status_add.property - value = status_add.value - if bonus_property in self.attribute_bonus: - self.attribute_bonus[bonus_property] += value - else: - self.attribute_bonus[bonus_property] = value - - def cal_avatar_eidolon_add(self): - for attribute in self.avatar.eidolon_attribute: - if attribute in self.attribute_bonus: - self.attribute_bonus[ - attribute - ] += self.avatar.eidolon_attribute[attribute] - else: - self.attribute_bonus[ - attribute - ] = self.avatar.eidolon_attribute[attribute] - for attribute in self.avatar.extra_ability_attribute: - if attribute in self.attribute_bonus: - self.attribute_bonus[ - attribute - ] += self.avatar.extra_ability_attribute[attribute] - else: - self.attribute_bonus[ - attribute - ] = self.avatar.extra_ability_attribute[attribute] - - def cal_weapon_attr_add(self): - for attribute in self.weapon.weapon_attribute: - if attribute in self.attribute_bonus: - self.attribute_bonus[ - attribute - ] += self.weapon.weapon_attribute[attribute] - else: - self.attribute_bonus[attribute] = self.weapon.weapon_attribute[ - attribute - ] - - async def cal_damage(self, skill_type: str): - logger.info('base_attr') - logger.info(self.base_attr) - logger.info('attribute_bonus') - logger.info(self.attribute_bonus) - logger.info(skill_type) - # 技能区 - skill_info = self.avatar.Skill_Info(skill_type) - skill_multiplier = self.avatar.Skill_num(skill_info[4], skill_type) - # 检查是否有对某一个技能的倍率加成 - for attr in self.attribute_bonus: - if attr.__contains__('SkillAdd'): - skill_name = attr.split('SkillAdd')[0] - if skill_name in (skill_type, skill_info[3]): - logger.info( - f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成' - ) - skill_multiplier = ( - skill_multiplier + self.attribute_bonus[attr] - ) - - logger.info(f'技能区总: {skill_multiplier}') - - # 检查武器战斗生效的buff - logger.info('检查武器战斗生效的buff') - Ultra_Use = self.avatar.Ultra_Use() - logger.info('Ultra_Use') - logger.info(Ultra_Use) - self.attribute_bonus = await self.weapon.weapon_ability( - Ultra_Use, self.base_attr, self.attribute_bonus - ) - logger.info(self.attribute_bonus) - logger.info('检查遗器套装战斗生效的buff') - for set_skill in self.relic_set.SetSkill: - self.attribute_bonus = await set_skill.set_skill_ability( - self.base_attr, self.attribute_bonus - ) - if self.attribute_bonus is None: - raise Exception('attribute_bonus is None') - logger.info(self.attribute_bonus) - - # 检查是否有对某一个技能的属性加成 - logger.info('检查是否有对某一个技能的属性加成') - for attr in self.attribute_bonus: - # 攻击加成 - if attr.__contains__('AttackAddedRatio'): - attr_name = attr.split('AttackAddedRatio')[0] - if attr_name in (skill_type, skill_info[3]): - attack_added_ratio = self.attribute_bonus.get( - 'AttackAddedRatio', 0 - ) - self.attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio + self.attribute_bonus[attr] - ) - # 效果命中加成 - if attr.__contains__('StatusProbabilityBase'): - attr_name = attr.split('StatusProbabilityBase')[0] - if attr_name in (skill_type, skill_info[3]): - status_probability = self.attribute_bonus.get( - 'StatusProbabilityBase', 0 - ) - self.attribute_bonus['StatusProbabilityBase'] = ( - status_probability + self.attribute_bonus[attr] - ) - - merged_attr = await merge_attribute( - self.base_attr, self.attribute_bonus - ) - logger.info(f'{merged_attr}') - skill_info_list = [] - # 技能类型为攻击 - if skill_info[0] == 'attack': - if isinstance(skill_info[2], str): - raise Exception('skill_info[2] is str') - skill_multiplier = skill_multiplier / skill_info[2] - logger.info(f'技能区单段: {skill_multiplier}') - if self.raw_data.avatar.id_ == 1004: - if self.raw_data.avatar.rank >= 6 and skill_type == 'BPSkill': - skill_info[2] = skill_info[2] + 1 - multiplier_add = self.avatar.Talent() - skill_multiplier = skill_multiplier + multiplier_add - - if ( - self.raw_data.avatar.id_ == 1201 - and self.raw_data.avatar.rank >= 4 - and skill_type == 'Normal' - ): - skill_info[2] = skill_info[2] + 1 - - attack = merged_attr.get('attack', 0) - if self.raw_data.avatar.id_ == 1104: - # 杰帕德天赋加攻 - defence = merged_attr['defence'] - attack = attack + (defence * 0.35) - logger.info(f'攻击力: {attack}') - damage_add = 0 - hp_multiplier = 0 - hp_num = 0 - if self.raw_data.avatar.id_ in [1205, 1208]: - hp_num = merged_attr['hp'] - skill_type_hp = skill_type + '_HP' - 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 - ) - else: - hp_multiplier = 0 - for attr in self.attribute_bonus: - if attr.__contains__('HpSkillAdd'): - skill_name = attr.split('HpSkillAdd')[0] - if skill_name in (skill_type, skill_info[3]): - logger.info( - f'{skill_name}对{skill_type}有{self.attribute_bonus[attr]}倍率加成' - ) - hp_multiplier = ( - hp_multiplier + self.attribute_bonus[attr] - ) - - if skill_type == 'Talent': - if ( - self.raw_data.avatar.rank >= 6 - and self.raw_data.avatar.id_ == 1205 - ): - damage_add = hp_num * 0.5 - attack = (skill_multiplier * attack) + (hp_multiplier * hp_num) - skill_multiplier = 1 - logger.info(f'混伤区: {attack}') - - logger.info(f'额外伤害: {damage_add}') - # 模拟 同属性弱点 同等级 的怪物 - # 韧性条减伤 - enemy_damage_reduction = 0.1 - damage_reduction = 1 - enemy_damage_reduction - logger.info(f'韧性区: {damage_reduction}') - # 抗性区 - enemy_status_resistance = 0.0 - for attr in merged_attr: - if attr.__contains__('ResistancePenetration'): - # 检查是否有某一属性的抗性穿透 - attr_name = attr.split('ResistancePenetration')[0] - if attr_name in (self.avatar.avatar_element, 'AllDamage'): - logger.info(f'{attr_name}属性有{merged_attr[attr]}穿透加成') - enemy_status_resistance += merged_attr[attr] - # 检查是否有某一技能属性的抗性穿透 - if attr_name.__contains__('_'): - skill_name = attr_name.split('_')[0] - skillattr_name = attr_name.split('_')[1] - if skill_name in ( - skill_type, - skill_info[3], - ) and skillattr_name in ( - self.avatar.avatar_element, - 'AllDamage', - ): - enemy_status_resistance += merged_attr[attr] - logger.info( - f'{skill_name}对{skillattr_name}属性有{merged_attr[attr]}穿透加成' - ) - resistance_area = 1.0 - (0 - enemy_status_resistance) - logger.info(f'抗性区: {resistance_area}') - - # 防御区 - # 检查是否有 ignore_defence - logger.info('检查是否有 ignore_defence') - ignore_defence = 1.0 - for attr in merged_attr: - if attr == 'ignore_defence': - ignore_defence = 1 - merged_attr[attr] - break - logger.info(f'ignore_defence {ignore_defence}') - enemy_defence = ( - self.avatar.avatar_level * 10 + 200 - ) * ignore_defence - defence_multiplier = (self.avatar.avatar_level * 10 + 200) / ( - self.avatar.avatar_level * 10 + 200 + enemy_defence - ) - logger.info(f'防御区: {defence_multiplier}') - - # 增伤区 - # TODO: 这里计算只考虑了希儿,需要重写 injury_area = self.avatar.Talent_add() - injury_area = self.avatar.Talent_add() - # 检查是否有对某一个技能的伤害加成 - logger.info('检查是否有对某一个技能的伤害加成') - for attr in merged_attr: - if attr.__contains__('DmgAdd'): - attr_name = attr.split('DmgAdd')[0] - if attr_name in (skill_type, skill_info[3]): - logger.info( - f'{attr} 对 {skill_type} 有 {merged_attr[attr]} 伤害加成' - ) - injury_area += merged_attr[attr] - # 检查有无符合属性的伤害加成 - logger.info('检查球有无符合属性的伤害加成') - element_area = 0 - for attr in merged_attr: - if attr.__contains__('AddedRatio'): - attr_name = attr.split('AddedRatio')[0] - if attr_name in (self.avatar.avatar_element, 'AllDamage'): - logger.info( - f'{attr} 对 {self.avatar.avatar_element} ' - f'有 {merged_attr[attr]} 伤害加成' - ) - if attr_name == self.avatar.avatar_element: - element_area += merged_attr[attr] - injury_area += merged_attr[attr] - injury_area += 1 - logger.info(f'增伤区: {injury_area}') - - # 易伤区 - logger.info('检查是否有易伤加成') - damage_ratio = merged_attr.get('DmgRatio', 0) - # 检查是否有对特定技能的易伤加成 - # Talent_DmgRatio - for attr in merged_attr: - if attr.__contains__('_DmgRatio'): - skill_name = attr.split('_')[0] - if skill_name in (skill_type, skill_info[3]): - logger.info( - f'{attr} 对 {skill_type} 有 {merged_attr[attr]} 易伤加成' - ) - damage_ratio += merged_attr[attr] - damage_ratio = damage_ratio + 1 - logger.info(f'易伤: {damage_ratio}') - - # 爆伤区 - if skill_type == 'DOT': - critical_damage_base = 0.0 - else: - logger.info('检查是否有爆伤加成') - logger.info(f'{merged_attr}') - critical_damage_base = merged_attr.get('CriticalDamageBase', 0) - # 检查是否有对特定技能的爆伤加成 - # Ultra_CriticalChance - for attr in merged_attr: - if attr.__contains__('_CriticalDamageBase'): - skill_name = attr.split('_')[0] - if skill_name in (skill_type, skill_info[3]): - logger.info( - f'{attr} 对 {skill_type} 有 ' - f'{merged_attr[attr]} 爆伤加成' - ) - critical_damage_base += merged_attr[attr] - critical_damage = critical_damage_base + 1 - logger.info(f'暴伤: {critical_damage}') - - # 暴击区 - logger.info('检查是否有暴击加成') - critical_chance_base = merged_attr['CriticalChanceBase'] - # 检查是否有对特定技能的爆伤加成 - # Ultra_CriticalChance - for attr in merged_attr: - if attr.__contains__('_CriticalChance'): - skill_name = attr.split('_')[0] - if skill_name in (skill_type, skill_info[3]): - logger.info( - f'{attr} 对 {skill_type} 有 ' - f'{merged_attr[attr]} 暴击加成' - ) - critical_chance_base += merged_attr[attr] - critical_chance_base = min(1, critical_chance_base) - logger.info(f'暴击: {critical_chance_base}') - - # 期望伤害 - qiwang_damage = (critical_chance_base * critical_damage_base) + 1 - logger.info(f'暴击期望: {qiwang_damage}') - damage_cd_z = 0.0 - damage_qw_z = 0.0 - damage_tz_z = 0.0 - attack_tz = 0.0 - injury_add = 0.0 - critical_damage_add = 0 - for i in range(1, skill_info[2] + 1): - injury_add = 0 - critical_damage_add = 0 - if self.raw_data.avatar.id_ == 1213: - injury_add = self.avatar.Talent() - critical_damage_add = self.avatar.BPSkill() - normal_buff = merged_attr.get('Normal_buff', 0) - if i >= 4: - normal_buff = min(4, int(normal_buff + (i - 3))) - if normal_buff >= 1: - critical_damage_add = normal_buff * critical_damage_add - atk_buff = merged_attr.get('Atk_buff', 0) - atk_buff = min(10, int((i - 1) * (atk_buff + 1))) - injury_add = atk_buff * injury_add - qiwang_damage = ( - critical_chance_base - * (critical_damage_base + critical_damage_add) - ) + 1 - - damage_cd = ( - attack - * skill_multiplier - * damage_ratio - * (injury_area + injury_add) - * defence_multiplier - * resistance_area - * damage_reduction - * (critical_damage + critical_damage_add) - + damage_add - ) - damage_cd_z += damage_cd - damage_qw = ( - attack - * skill_multiplier - * damage_ratio - * (injury_area + injury_add) - * defence_multiplier - * resistance_area - * damage_reduction - * qiwang_damage - + damage_add - ) - damage_qw_z += damage_qw - - attr_value_tz: float = self.base_attr.get('attack', 0) - attribute_atk = self.attribute_bonus.get('AttackDelta', 0) - attack_tz = ( - attr_value_tz - + attr_value_tz - * ( - 1 - + self.attribute_bonus.get('AttackAddedRatio', 0) - + 2.144 - ) - + attribute_atk - ) - if self.raw_data.avatar.id_ in [1205, 1208]: - attack_tz = (skill_multiplier * attack_tz) + ( - hp_multiplier * hp_num - ) - injury_add_tz = 0 - if self.avatar.avatar_element == 'Imaginary': - injury_add_tz = 0.12 - damage_tz = ( - attack_tz - * skill_multiplier - * damage_ratio - * (injury_area + injury_add + injury_add_tz + 2.326) - * defence_multiplier - * resistance_area - * damage_reduction - * (critical_damage + critical_damage_add + 1.594) - * 10 - + damage_add - ) - - damage_tz_z += damage_tz - - if ( - self.raw_data.avatar.id_ == 1003 - and self.raw_data.avatar.rank >= 6 - ): - damage_cd_z = damage_cd_z * 1.8 - damage_qw_z = damage_qw_z * 1.8 - damage_tz_z = damage_tz_z * 1.8 - - if self.avatar.avatar_element == 'Thunder': - element_area = 0 - damage_tz_fj = ( - attack_tz - * 0.44 - * damage_ratio - * (injury_area + injury_add + 2.326 + element_area) - * defence_multiplier - * resistance_area - * damage_reduction - * (critical_damage + critical_damage_add + 1.594) - * 10 - ) - damage_tz_z += damage_tz_fj - skill_info_list: List[Union[str, float]] = [] - skill_info_list.append(skill_info[1]) - skill_info_list.append(damage_cd_z) - skill_info_list.append(damage_qw_z) - skill_info_list.append(damage_tz_z) - logger.info( - f'{skill_info[1]} 暴击伤害: {damage_cd_z} 期望伤害{damage_qw_z}' - ) - - # 技能类型为防御 - if skill_info[0] == 'defence': - defence = merged_attr['defence'] - logger.info(f'防御力: {defence}') - defence_multiplier = 0 - - # 获取技能提供的固定护盾值 - if skill_type == 'Normal': - defence_multiplier = self.avatar.Normalnum('Normal_G') - elif skill_type == 'BPSkill': - defence_multiplier = self.avatar.BPSkill_num('BPSkill_G') - elif skill_type == 'Ultra': - defence_multiplier = self.avatar.Ultra_num('Ultra_G') - elif skill_type == 'Talent': - defence_multiplier = self.avatar.Talent_num('Talent_G') - - # 检查是否有护盾加成 - shield_added_ratio = merged_attr.get('shield_added_ratio', 0) - shield_added = shield_added_ratio + 1 - logger.info(f'护盾加成: {shield_added}') - - defence_num = ( - defence * skill_multiplier + defence_multiplier - ) * shield_added - - skill_info_list: List[Union[str, float]] = [] - skill_info_list.append(skill_info[1]) - skill_info_list.append(defence_num) - skill_info_list.append(defence_num) - skill_info_list.append(defence_num) - - return skill_info_list diff --git a/StarRailUID/starrailuid_charinfo/effect/Weapon/Weapon.py b/StarRailUID/starrailuid_charinfo/effect/Weapon/Weapon.py deleted file mode 100644 index 9767eb2..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/Weapon/Weapon.py +++ /dev/null @@ -1,1931 +0,0 @@ -import json -from typing import Dict -from pathlib import Path - -from ..Base.WeaponBase import BaseWeapon -from ..Base.model import DamageInstanceWeapon - -path = Path(__file__).parent.parent -with Path.open(path / 'Excel' / 'weapon_effect.json', encoding='utf-8') as f: - weapon_effect = json.load(f) - - -class Arrows(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者消灭敌方目标 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChance', 0) - attribute_bonus['CriticalChance'] = ( - critical_chance_base - + weapon_effect['20000']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -class ReturntoDarkness(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者消灭敌方目标 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - pass - return attribute_bonus - - -class Swordplay(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者多次击中同一敌方目标时, 每次造成的伤害提高8%, 该效果最多叠加5层 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + ( - weapon_effect['21010']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 5 - ) - return attribute_bonus - - -class DartingArrow(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者消灭敌方目标 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + weapon_effect['20007']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -class Adversarial(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者消灭敌方目标 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0) - attribute_bonus['SpeedAddedRatio'] = ( - speed_added_ratio - + weapon_effect['20014']['Param']['SpeedAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - return attribute_bonus - - -class SubscribeforMore(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者的当前能量值等于其能量上限 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0) - attribute_bonus['NormalDmgAdd'] = ( - normal_dmg_add - + ( - weapon_effect['21017']['Param']['a_dmg'][ - self.weapon_rank - 1 - ] - ) - * 2 - ) - bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = ( - bp_skill_dmg_add - + ( - weapon_effect['21017']['Param']['e_dmg'][ - self.weapon_rank - 1 - ] - ) - * 2 - ) - return attribute_bonus - return attribute_bonus - - -class RiverFlowsinSpring(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 进入战斗后,使装备者速度提高8%,造成的伤害提高12%。 - # 当装备者受到伤害后该效果失效,下个回合结束时该效果恢复。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0) - attribute_bonus['SpeedAddedRatio'] = ( - speed_added_ratio - + weapon_effect['21024']['Param']['SpeedAddedRatio'][ - self.weapon_rank - 1 - ] - ) - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['21024']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - return attribute_bonus - - -class OnlySilenceRemains(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当场上的敌方目标数量小于等于2时 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['21003']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - return attribute_bonus - - -# 拂晓之前 -class BeforeDawn(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = bp_skill_dmg_add + ( - weapon_effect['23010']['Param']['e_dmg'][self.weapon_rank - 1] - ) - ultra_dmg_add = attribute_bonus.get('UltraDmgAdd', 0) - attribute_bonus['UltraDmgAdd'] = ultra_dmg_add + ( - weapon_effect['23010']['Param']['r_dmg'][self.weapon_rank - 1] - ) - talent_dmg_add = attribute_bonus.get('TalentDmgAdd', 0) - attribute_bonus['TalentDmgAdd'] = talent_dmg_add + ( - weapon_effect['23010']['Param']['t_dmg'][self.weapon_rank - 1] - ) - return attribute_bonus - - -class IntheNight(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - char_speed = ( - base_attr.get('speed', 0) + attribute_bonus.get('SpeedDelta', 0) - ) * (attribute_bonus.get('SpeedAddedRatio', 0) + 1) - count_ = min(6, int((char_speed - 100) / 10)) - normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0) - attribute_bonus['NormalDmgAdd'] = ( - normal_dmg_add - + (weapon_effect['23001']['Param']['a_dmg'][self.weapon_rank - 1]) - * count_ - ) - bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = ( - bp_skill_dmg_add - + (weapon_effect['23001']['Param']['e_dmg'][self.weapon_rank - 1]) - * count_ - ) - ultra_critical_chance_base = attribute_bonus.get( - 'Ultra_CriticalDamageBase', 0 - ) - attribute_bonus['Ultra_CriticalDamageBase'] = ( - ultra_critical_chance_base - + ( - weapon_effect['23001']['Param']['q_crit_dmg'][ - self.weapon_rank - 1 - ] - ) - * count_ - ) - return attribute_bonus - - -class CruisingintheStellarSea(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者对生命值百分比小于等于50%的敌方目标 - # 装备者消灭敌方目标 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['24001']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + weapon_effect['24001']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -class SeriousnessofBreakfast(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者造成伤害提高12% - # 每消灭1个敌方目标, 装备者的攻击力提高4%, 该效果最多叠加3层。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['21027']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + ( - weapon_effect['21027']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - return attribute_bonus - - -# 银河铁道之夜 -class NightontheMilkyWay(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 场上每有1个敌方目标, 使装备者的攻击力提高9% - # 敌方目标的弱点被击破时, 装备者造成的伤害提高30% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + weapon_effect['23000']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['23000']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - return attribute_bonus - - -# 今日亦是和平的一日 -class TodayIsAnotherPeacefulDay(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 根据装备者的能量上限, 提高装备者造成的伤害: 每点能量提高0.2%, 最多计入160点 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + ( - weapon_effect['21034']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * Ultra_Use - ) - return attribute_bonus - - -# 天才们的休憩 -class GeniusesRepose(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者攻击力提高16% - # 当装备者消灭敌方目标后, 暴击伤害提高24% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalDamageBase', 0) - attribute_bonus['CriticalDamageBase'] = critical_chance_base + ( - weapon_effect['21020']['Param']['CriticalDamageBase'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 别让世界静下来 -class MaketheWorldClamor(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 终结技造成的伤害提高32%。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - ultra_dmg_add = attribute_bonus.get('UltraDmgAdd', 0) - attribute_bonus['UltraDmgAdd'] = ultra_dmg_add + ( - weapon_effect['21013']['Param']['r_dmg'][self.weapon_rank - 1] - ) - return attribute_bonus - - -# 「我」的诞生 -class TheBirthoftheSelf(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 追加攻击造成的伤害提高30% - # 若该敌方目标当前生命值百分比小于等于50%, 则追加攻击造成的伤害额外提高30%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - talent_dmg_add = attribute_bonus.get('TalentDmgAdd', 0) - attribute_bonus['TalentDmgAdd'] = talent_dmg_add + ( - weapon_effect['21006']['Param']['t_dmg'][self.weapon_rank - 1] - ) - return attribute_bonus - return attribute_bonus - - -# 秘密誓心 -class ASecretVow(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 造成的伤害提高20% - # 对当前生命值百分比大于等于装备者自身当前生命值百分比的敌方目标 - # 造成的伤害额外提高20% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['21012']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - return attribute_bonus - - -# 比阳光更明亮的 -class BrighterThantheSun(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者的暴击率提高18% - # 当装备者施放普攻时, 获得1层【龙吟】, 持续2回合。 - # 每层【龙吟】使装备者的攻击力提高18%,【龙吟】最多叠加2层 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + ( - weapon_effect['23015']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 2 - ) - return attribute_bonus - - -# 到不了的彼岸 -class TheUnreachableSide(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者的暴击率提高30%, 生命上限提高30% - # 当装备者受到攻击或装备者消耗自身生命值后, 造成的伤害提高40% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['23009']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 无可取代的东西 -class SomethingIrreplaceable(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者的攻击力提高24% - # 当装备者消灭敌方目标或受到攻击后, 造成的伤害提高24% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['23002']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 记一位星神的陨落 -class OntheFallofanAeon(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者施放攻击时, 使装备者本场战斗中的攻击力提高8%, 该效果最多叠加4层 - # 当装备者击破敌方目标弱点后, 造成的伤害提高12% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + ( - weapon_effect['24000']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 4 - ) - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['24000']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 无处可逃 -class NowheretoRun(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者的攻击力提高24% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 汪! 散步时间! -class WoofWalkTime(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者的攻击力提高10% - # 对处于灼烧或裂伤状态的敌方目标造成的伤害提高16% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - # attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - # attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf( - # weapon_effect['21026']['Param']['AttackAddedRatio'][ - # self.weapon_rank - 1 - # ] - # ) - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['21026']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 在蓝天下 -class UndertheBlueSky(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者攻击力提高16% - # 当装备者消灭敌方目标后, 暴击率提高12% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - # attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - # attribute_bonus['AttackAddedRatio'] = attack_added_ratio + mp.mpf( - # weapon_effect['21019']['Param']['AttackAddedRatio'][ - # self.weapon_rank - 1 - # ] - # ) - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['21019']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 鼹鼠党欢迎你 -class TheMolesWelcomeYou(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者施放普攻、战技或终结技攻击敌方目标后, - # 分别获取一层【淘气值】。每层使装备者的攻击力提高12%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - attack_added_ratio = attribute_bonus.get('AttackAddedRatio', 0) - attribute_bonus['AttackAddedRatio'] = ( - attack_added_ratio - + ( - weapon_effect['21005']['Param']['AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - return attribute_bonus - - -# 雨一直下 -class IncessantRain(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者对同时处于大于等于3个负面效果的敌方目标造成伤害时, 暴击率提高12% - # 持有【以太编码】的目标受到的伤害提高12% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - damage_ratio = attribute_bonus.get('DmgRatio', 0) - attribute_bonus['DmgRatio'] = ( - damage_ratio - + weapon_effect['23007']['Param']['DmgRatio'][ - self.weapon_rank - 1 - ] - ) - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['23007']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 只需等待 -class PatienceIsAllYouNeed(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者造成的伤害提高24% - # 装备者每次施放攻击后, 速度提高4.8%, 最多叠加3层。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['23006']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - - speed_added_ratio = attribute_bonus.get('SpeedAddedRatio', 0) - attribute_bonus['SpeedAddedRatio'] = ( - speed_added_ratio - + ( - weapon_effect['23006']['Param']['SpeedAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - return attribute_bonus - - -# 以世界之名 -class IntheNameoftheWorld(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者对陷入负面效果的敌方目标造成的伤害提高24% - # 当装备者施放战技时, 装备者此次攻击的效果命中提高18% - # 当装备者施放战技时, 装备者此次攻击的攻击力提高24%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['23004']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - - a2_status_probability = attribute_bonus.get( - 'BPSkillStatusProbabilityBase', 0 - ) - attribute_bonus['BPSkillStatusProbabilityBase'] = ( - a2_status_probability - + weapon_effect['23004']['Param']['A2_StatusProbability'][ - self.weapon_rank - 1 - ] - ) - - a2_attack_added_ratio = attribute_bonus.get( - 'BPSkillAttackAddedRatio', 0 - ) - attribute_bonus['BPSkillAttackAddedRatio'] = ( - a2_attack_added_ratio - + weapon_effect['23004']['Param']['A2_AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 孤独的疗愈 -class SolitaryHealing(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者的击破特攻提高20% - # 装备者施放终结技时, 使装备者造成的持续伤害提高24% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 新手任务开始前 -class BeforetheTutorialMissionStarts(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者攻击防御力被降低的敌方目标后, 恢复4点能量。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 后会有期 -class WeWillMeetAgain(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者施放普攻或战技后, - # 对随机1个受到攻击的敌方目标造成等同于自身48%攻击力的附加伤害。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 延长记号 -class Fermata(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 对处于触电或风化状态的敌方目标造成的伤害提高16% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['21022']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 决心如汗珠般闪耀 -class ResolutionShinesAsPearlsofSweat(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 对处于触电或风化状态的敌方目标造成的伤害提高16% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - ignore_defence = attribute_bonus.get('ignore_defence', 0) - attribute_bonus['ignore_defence'] = ( - ignore_defence - + weapon_effect['21015']['Param']['ignore_defence'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 猎物的视线 -class EyesofthePrey(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 造成的持续伤害提高24%。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 晚安与睡颜 -class GoodNightandSleepWell(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 敌方目标每承受1个负面效果, 装备者对其造成的伤害提高12%, 最多叠加3层 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + ( - weapon_effect['21001']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - return attribute_bonus - - -# 她已闭上双眼 -class SheAlreadyShutHerEyes(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者的生命值降低时, 使我方全体造成的伤害提高15% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + ( - weapon_effect['23011']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - return attribute_bonus - - -# 制胜的瞬间 -class MomentofVictory(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者受到攻击后, 防御力额外提高24% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - defence_added_ratio = attribute_bonus.get('DefenceAddedRatio', 0) - attribute_bonus['DefenceAddedRatio'] = ( - defence_added_ratio - + weapon_effect['23005']['Param']['DefenceAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 记忆的质料 -class TextureofMemories(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # ... - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 这就是我啦 -class ThisIsMe(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者施放终结技时造成的伤害值提高, 提高数值等同于装备者防御力的60% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 我们是地火 -class WeAreWildfire(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 战斗开始时, 使我方全体受到的伤害降低8% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 宇宙市场趋势 -class TrendoftheUniversalMarket(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者受到攻击后, 有100%的基础概率使敌方目标陷入灼烧状态, - # 每回合造成等同于装备者40%防御力的持续伤害 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 朗道的选择 -class LandausChoice(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者受到攻击的概率提高, 同时受到的伤害降低16%。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 余生的第一天 -class DayOneofMyNewLife(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 进入战斗后, 使我方全体的全属性抗性提高8% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 开疆 -class Pioneering(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 进入战斗后, 使我方全体的全属性抗性提高8% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 戍御 -class Defense(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 进入战斗后, 使我方全体的全属性抗性提高8% - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 琥珀 -class Amber(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者当前生命值百分比小于50%时, 其防御力额外提高16%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - defence_added_ratio = attribute_bonus.get('DefenceAddedRatio', 0) - attribute_bonus['DefenceAddedRatio'] = ( - defence_added_ratio - + weapon_effect['20003']['Param']['DefenceAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 俱殁 -class MutualDemise(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者当前生命值百分比小于80%时, 暴击率提高12% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['20016']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 乐圮 -class ShatteredHome(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者对当前生命值百分比大于50%的敌方目标造成的伤害提高20%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['20009']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 天倾 -class CollapsingSky(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者普攻和战技造成的伤害提高20%。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - normal_dmg_add = attribute_bonus.get('NormalDmgAdd', 0) - attribute_bonus['NormalDmgAdd'] = normal_dmg_add + ( - weapon_effect['20002']['Param']['a_dmg'][self.weapon_rank - 1] - ) - bp_skill_dmg_add = attribute_bonus.get('BPSkillDmgAdd', 0) - attribute_bonus['BPSkillDmgAdd'] = bp_skill_dmg_add + ( - weapon_effect['20002']['Param']['e_dmg'][self.weapon_rank - 1] - ) - return attribute_bonus - - -# 匿影 -class HiddenShadow(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 施放战技后, 使装备者的下一次普攻对敌方目标造成等同于自身60%攻击力的附加伤害。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 渊环 -class Loop(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者对减速状态下的敌方目标造成的伤害提高24%。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - all_damage_added_ratio = attribute_bonus.get( - 'AllDamageAddedRatio', 0 - ) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + weapon_effect['20009']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 幽邃 -class Void(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 战斗开始时, 使装备者的效果命中提高20%, 持续3回合。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - status_probability = attribute_bonus.get( - 'StatusProbabilityBase', 0 - ) - attribute_bonus['StatusProbabilityBase'] = ( - status_probability - + weapon_effect['20004']['Param']['StatusProbability'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 睿见 -class Sagacity(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者施放终结技时, 攻击力提高24%, 持续2回合。 - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - a3_attack_added_ratio = attribute_bonus.get( - 'UltraAttackAddedRatio', 0 - ) - attribute_bonus['UltraAttackAddedRatio'] = ( - a3_attack_added_ratio - + weapon_effect['20020']['Param']['A3_AttackAddedRatio'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 灵钥 -class Passkey(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者施放战技后额外恢复8点能量 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - return attribute_bonus - - -# 智库 -class DataBank(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 使装备者终结技造成的伤害提高28%。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - ultra_dmg_add = attribute_bonus.get('UltraDmgAdd', 0) - attribute_bonus['UltraDmgAdd'] = ultra_dmg_add + ( - weapon_effect['20006']['Param']['r_dmg'][self.weapon_rank - 1] - ) - return attribute_bonus - - -# 此身为剑 -class Thisbodyisasword(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当队友受到攻击或消耗生命值后, 装备者获得1层【月蚀】, - # 最多叠加3层。每层【月蚀】使装备者下一次攻击造成的伤害提高14%。 - # 叠满3层时, 额外使该次攻击无视目标12%的防御力。该效果在装备者施放攻击后解除。 - pass - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - all_damage_added_ratio = attribute_bonus.get('AllDamageAddedRatio', 0) - attribute_bonus['AllDamageAddedRatio'] = ( - all_damage_added_ratio - + ( - weapon_effect['23014']['Param']['AllDamageAddedRatio'][ - self.weapon_rank - 1 - ] - ) - * 3 - ) - - resistance_penetration = attribute_bonus.get( - 'AllDamageResistancePenetration', 0 - ) - attribute_bonus[ - 'AllDamageResistancePenetration' - ] = resistance_penetration + ( - weapon_effect['23014']['Param']['ResistancePenetration'][ - self.weapon_rank - 1 - ] - ) - - return attribute_bonus - - -# 如泥酣眠 -class SleepLiketheDead(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 当装备者的普攻或战技伤害未造成暴击时,使自身暴击率提高36% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalChanceBase', 0) - attribute_bonus['CriticalChanceBase'] = ( - critical_chance_base - + weapon_effect['23012']['Param']['CriticalChance'][ - self.weapon_rank - 1 - ] - ) - return attribute_bonus - - -# 烦恼着,幸福着 -class WorrisomeBlissf(BaseWeapon): - weapon_base_attributes: Dict - - def __init__(self, weapon: DamageInstanceWeapon): - super().__init__(weapon) - - async def check(self): - # 装备者施放追加攻击后,使目标陷入【温驯】状态,该效果最多叠加2层.我方目标击中【温驯】状态下的敌方目标时,每层【温驯】使造成的暴击伤害提高12% - return True - - async def weapon_ability( - self, - Ultra_Use: float, - base_attr: Dict[str, float], - attribute_bonus: Dict[str, float], - ): - critical_chance_base = attribute_bonus.get('TalentDmgAdd', 0) - attribute_bonus['TalentDmgAdd'] = ( - critical_chance_base - + weapon_effect['23016']['Param']['TalentDmgAdd'][ - self.weapon_rank - 1 - ] - ) - if await self.check(): - critical_chance_base = attribute_bonus.get('CriticalDamageBase', 0) - attribute_bonus['CriticalDamageBase'] = ( - critical_chance_base - + ( - weapon_effect['23016']['Param']['CriticalDamageBase'][ - self.weapon_rank - 1 - ] - ) - * 2 - ) - return attribute_bonus - - -class Weapon: - @classmethod - def create(cls, weapon: DamageInstanceWeapon): - if weapon.id_ in [ - 23011, - 23007, - 21005, - 21019, - 21026, - 21033, - 24000, - 23002, - 23009, - 23015, - 21012, - 21006, - 21013, - 21027, - 21020, - 21034, - 23000, - 23010, - 23001, - 21003, - 23012, - 24001, - 21024, - 21017, - 20014, - 20007, - 21010, - 21031, - 20000, - 23006, - 23004, - 24003, - 22000, - 21029, - 21022, - 21015, - 21008, - 21001, - 23005, - 24002, - 21030, - 21023, - 21016, - 21009, - 21002, - 20017, - 20010, - 20003, - 20016, - 20009, - 20002, - 20018, - 20011, - 20004, - 20020, - 20013, - 20006, - 23014, - 23016, - ]: - if weapon.id_ == 23016: - return WorrisomeBlissf(weapon) - if weapon.id_ == 23012: - return SleepLiketheDead(weapon) - if weapon.id_ == 23014: - return Thisbodyisasword(weapon) - if weapon.id_ == 20006: - return DataBank(weapon) - if weapon.id_ == 20013: - return Passkey(weapon) - if weapon.id_ == 20020: - return Sagacity(weapon) - if weapon.id_ == 20004: - return Void(weapon) - if weapon.id_ == 20011: - return Loop(weapon) - if weapon.id_ == 20018: - return HiddenShadow(weapon) - if weapon.id_ == 20002: - return CollapsingSky(weapon) - if weapon.id_ == 20009: - return ShatteredHome(weapon) - if weapon.id_ == 20016: - return MutualDemise(weapon) - if weapon.id_ == 20003: - return Amber(weapon) - if weapon.id_ == 20010: - return Defense(weapon) - if weapon.id_ == 20017: - return Pioneering(weapon) - if weapon.id_ == 21002: - return DayOneofMyNewLife(weapon) - if weapon.id_ == 21009: - return LandausChoice(weapon) - if weapon.id_ == 21016: - return TrendoftheUniversalMarket(weapon) - if weapon.id_ == 21023: - return WeAreWildfire(weapon) - if weapon.id_ == 21030: - return ThisIsMe(weapon) - if weapon.id_ == 24002: - return TextureofMemories(weapon) - if weapon.id_ == 23005: - return MomentofVictory(weapon) - if weapon.id_ == 23011: - return SheAlreadyShutHerEyes(weapon) - if weapon.id_ == 21001: - return GoodNightandSleepWell(weapon) - if weapon.id_ == 21008: - return EyesofthePrey(weapon) - if weapon.id_ == 21015: - return ResolutionShinesAsPearlsofSweat(weapon) - if weapon.id_ == 21022: - return Fermata(weapon) - if weapon.id_ == 21029: - return WeWillMeetAgain(weapon) - if weapon.id_ == 22000: - return BeforetheTutorialMissionStarts(weapon) - if weapon.id_ == 24003: - return SolitaryHealing(weapon) - if weapon.id_ == 23004: - return IntheNameoftheWorld(weapon) - if weapon.id_ == 23006: - return PatienceIsAllYouNeed(weapon) - if weapon.id_ == 23007: - return IncessantRain(weapon) - if weapon.id_ == 21005: - return TheMolesWelcomeYou(weapon) - if weapon.id_ == 21019: - return UndertheBlueSky(weapon) - if weapon.id_ == 21026: - return WoofWalkTime(weapon) - if weapon.id_ == 21033: - return NowheretoRun(weapon) - if weapon.id_ == 24000: - return OntheFallofanAeon(weapon) - if weapon.id_ == 23002: - return SomethingIrreplaceable(weapon) - if weapon.id_ == 23009: - return TheUnreachableSide(weapon) - if weapon.id_ == 23015: - return BrighterThantheSun(weapon) - if weapon.id_ == 21012: - return ASecretVow(weapon) - if weapon.id_ == 21006: - return TheBirthoftheSelf(weapon) - if weapon.id_ == 21013: - return MaketheWorldClamor(weapon) - if weapon.id_ == 21020: - return GeniusesRepose(weapon) - if weapon.id_ == 21027: - return SeriousnessofBreakfast(weapon) - if weapon.id_ == 21034: - return TodayIsAnotherPeacefulDay(weapon) - if weapon.id_ == 23000: - return NightontheMilkyWay(weapon) - if weapon.id_ == 23010: - return BeforeDawn(weapon) - if weapon.id_ == 24001: - return CruisingintheStellarSea(weapon) - if weapon.id_ == 23001: - return IntheNight(weapon) - if weapon.id_ == 21003: - return OnlySilenceRemains(weapon) - if weapon.id_ == 21024: - return RiverFlowsinSpring(weapon) - if weapon.id_ == 20014: - return Adversarial(weapon) - if weapon.id_ == 20007: - return DartingArrow(weapon) - if weapon.id_ == 21010: - return Swordplay(weapon) - if weapon.id_ == 21031: - return ReturntoDarkness(weapon) - if weapon.id_ == 20000: - return Arrows(weapon) - raise ValueError(f'未知武器id: {weapon.id_}') - raise ValueError(f'不支持的武器种类: {weapon.id_}') diff --git a/StarRailUID/starrailuid_charinfo/effect/Weapon/__init__.py b/StarRailUID/starrailuid_charinfo/effect/Weapon/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/StarRailUID/starrailuid_charinfo/effect/__init__.py b/StarRailUID/starrailuid_charinfo/effect/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/StarRailUID/starrailuid_charinfo/effect/utils.py b/StarRailUID/starrailuid_charinfo/effect/utils.py deleted file mode 100644 index 61ac5df..0000000 --- a/StarRailUID/starrailuid_charinfo/effect/utils.py +++ /dev/null @@ -1,65 +0,0 @@ -from typing import Dict - - -async def merge_attribute( - base_attr: Dict[str, float], attribute_bonus: Dict[str, float] -): - # hp attack defence need base_value and add_value - merged_attr: Dict[str, float] = {} - attr_list = ['attack', 'defence', 'hp', 'speed'] - for attribute in attribute_bonus: - if ( - attribute.__contains__('Attack') - or attribute.__contains__('Defence') - or attribute.__contains__('HP') - or attribute.__contains__('Speed') - ): - if attribute.__contains__('Delta'): - attr = attribute.split('Delta')[0].lower() - if attr in attr_list: - attr_value = merged_attr.get(attr, 0) - merged_attr[attr] = attr_value + attribute_bonus[attribute] - elif attribute.__contains__('AddedRatio'): - attr = attribute.split('AddedRatio')[0].lower() - if attr in attr_list: - attr_value = merged_attr.get(attr, 0) - merged_attr[attr] = attr_value + base_attr[attr] * ( - 1 + attribute_bonus[attribute] - ) - else: - raise Exception(f'attribute error {attribute}') - elif attribute.__contains__('Base'): - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute.__contains__('AddedRatio'): - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute.__contains__('DmgAdd'): - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute.__contains__('DmgRatio'): - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute == 'ignore_defence': - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute.__contains__('ResistancePenetration'): - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute == 'Atk_buff': - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute == 'Normal_buff': - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - elif attribute == 'shield_added_ratio': - attr_value = base_attr.get(attribute, 0) - merged_attr[attribute] = attr_value + attribute_bonus[attribute] - else: - continue - for attr in base_attr: - merged_value = merged_attr.get(attr, 0) - if merged_value == 0: - merged_attr[attr] = base_attr[attr] - - return merged_attr