diff --git a/backend/core/basic/character/base.py b/backend/core/basic/character/base.py index 6aa75b86..78dbef78 100644 --- a/backend/core/basic/character/base.py +++ b/backend/core/basic/character/base.py @@ -1,4 +1,5 @@ from collections.abc import Mapping +import sys from typing import Any, Literal from core.abstract.character import CharacterProperty @@ -268,6 +269,8 @@ class CharacterBase(CharacterProperty): """设置角色属性""" # if kwargs.get('SkillAttack', 0) != 0: # frame = sys._getframe(1) # 1 表示上一级调用帧 + # if 'apply_uppercase_attrs' in frame.f_code.co_name: + # frame = sys._getframe(2) # 2 表示上上级调用帧 # caller_name = frame.f_code.co_name # print(caller_name, kwargs.get('SkillAttack', 0)) kget = kwargs.get @@ -291,7 +294,7 @@ class CharacterBase(CharacterProperty): self.ElementR[elem] += kget(f'{elem}抗', 0) + element_r.get(elem, 0) + 全属抗 self.CriticalM += kget('CriticalM', 0) + 魔暴 self.CriticalP += kget('CriticalP', 0) + 物暴 - self.SkillAttack *= (1 + 技攻) * (1 + kget('SkillAttack', 0)) + self.SkillAttack *= (1 + round(技攻,6)) * (1 +round( kget('SkillAttack', 0),6)) self.SpeedA += 攻击速度 + kget('SpeedA', 0) + 三速 self.SpeedM += 移动速度 + kget('SpeedM', 0) + 三速 self.SpeedR += 施放速度 + kget('SpeedR', 0) + 三速 diff --git a/backend/core/basic/character/calc_equip.py b/backend/core/basic/character/calc_equip.py index e96884bd..8b8e256e 100644 --- a/backend/core/basic/character/calc_equip.py +++ b/backend/core/basic/character/calc_equip.py @@ -292,13 +292,14 @@ class CalcEquipMixin(CharacterBase): apply_uppercase_attrs(self, oath) fun(self) # 誓约升级效果 - for upgrade in item.upgrade: - if upgrade == 1: - self.SetStatus(SkillAttack=0.04,Buffer=800) - pass - if upgrade == 2: - self.SetSkillCD(cd=0.08) - self.SetStatus(EquEffectRatio=0.04,Buffer=800) + if item.oathInfo and item.oathInfo.itemDetailType == '誓约': + for upgrade in item.upgrade: + if upgrade == 1: + self.SetStatus(SkillAttack=0.04,Buffer=800) + pass + if upgrade == 2: + self.SetSkillCD(cd=0.08) + self.SetStatus(EquEffectRatio=0.04,Buffer=800) pass pass diff --git a/backend/core/basic/character/effect_apply.py b/backend/core/basic/character/effect_apply.py index 5eabdbbd..107f8fda 100644 --- a/backend/core/basic/character/effect_apply.py +++ b/backend/core/basic/character/effect_apply.py @@ -1,3 +1,4 @@ +import sys from typing import Any @@ -6,6 +7,10 @@ def uppercase_attrs(source: Any) -> dict[str, Any]: def apply_uppercase_attrs(character: Any, source: Any) -> None: + # if source.SkillAttack is not None and source.SkillAttack != 0: + # frame = sys._getframe(1) # 1 表示上一级调用帧 + # caller_name = frame.f_code.co_name + # print(caller_name, source.SkillAttack) character.SetStatus(**uppercase_attrs(source)) diff --git a/backend/core/equipment/version_0/emblem.py b/backend/core/equipment/version_0/emblem.py index d011905a..0e4d5b29 100644 --- a/backend/core/equipment/version_0/emblem.py +++ b/backend/core/equipment/version_0/emblem.py @@ -516,19 +516,19 @@ def emblem_4701(char: CharacterProperty): @register -def emblem_combine(char: CharacterProperty, position: str, lv: int = 1, emblem_list: list[int | str] = []): - bufferP = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] - buffer = [10, 30, 60, 90, 120, 150, 180, 210, 240270, 300, 320, 340, 360, 380, 400] - skillAttack = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] - attackP = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] +def emblem_combine(char: CharacterProperty, position: str, lv: int = 0, emblem_list: list[int | str] = []): + bufferP = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] + buffer = [10, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 320, 340, 360, 380, 400] + skillAttack = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] + attackP = [0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] if position == '白金': return # 固有属性 if position == '彩色': - char.SetStatus(BufferP=bufferP[lv - 1], SkillAttack=skillAttack[lv - 1]) + char.SetStatus(BufferP=bufferP[lv], SkillAttack=skillAttack[lv]) else: - char.SetStatus(Buffer=buffer[lv - 1], AttackP=attackP[lv - 1]) - rarity = (lv - 1) // 5 + char.SetStatus(Buffer=buffer[lv], AttackP=attackP[lv]) + rarity = (lv) // 5 emblems = list(filter(lambda x: safeParseInt(x) > 0, emblem_list)) or [] emblem_raritys = [safeParseInt(i) // 1000 for i in emblems] # 稀有 diff --git a/backend/core/equipment/version_0/equ.py b/backend/core/equipment/version_0/equ.py index 1ceed674..d5ff695f 100644 --- a/backend/core/equipment/version_0/equ.py +++ b/backend/core/equipment/version_0/equ.py @@ -5835,7 +5835,7 @@ def weapon_point(char: CharacterProperty): point = char.charEquipInfo['武器'].precision skillAttack = 0.1 * point + (0.6 if point >= 25 else 0) + (0.6 if point >= 50 else 0) + (0.6 if point >= 75 else 0) + (1.9 if point >= 100 else 0) buffer = 40 * point + (120 if point >= 25 else 0) + (120 if point >= 50 else 0) + (120 if point >= 75 else 0) + (340 if point >= 100 else 0) - char.SetStatus(SkillAttack=skillAttack / 100, Buffer=buffer) + char.SetStatus(SkillAttack=round(skillAttack / 100, 6), Buffer=buffer) pass @@ -14856,7 +14856,7 @@ def equ_2000(char: CharacterProperty): char.SetStatus(SkillAttack=0.378, Buffer=12180) pass if char.max_point >= 2550: - char.SetStatus(SkillAttack=0.555, Buffer=12630) + char.SetStatus(SkillAttack=0.489, Buffer=12930) pass point = char.charEquipInfo['魔法石'].precision skillAttack = 0.1 * point - (point // 25) * 0.1 + (0.5 if point >= 25 else 0) + (0.6 if point >= 50 else 0) + (0.6 if point >= 75 else 0) + (1.8 if point >= 100 else 0) @@ -14905,12 +14905,12 @@ def equ_2001(char: CharacterProperty): char.SetStatus(SkillAttack=0.384, Buffer=11220) pass if char.max_point >= 2550: - char.SetStatus(SkillAttack=0.562, Buffer=12630) + char.SetStatus(SkillAttack=0.502, Buffer=12930) pass point = char.charEquipInfo['耳环'].precision skillAttack = 0.1 * point - (point // 25) * 0.1 + (0.1 if point >= 25 else 0) + (0.1 if point >= 50 else 0) + (0.1 if point >= 75 else 0) + (0.1 if point >= 100 else 0) buffer = 30 * point - (point // 25) * 30 + (390 if point >= 25 else 0) + (420 if point >= 50 else 0) + (420 if point >= 75 else 0) + (540 if point >= 100 else 0) - char.SetStatus(SkillAttack=skillAttack / 100, Buffer=buffer) + char.SetStatus(SkillAttack=round(skillAttack / 100,6), Buffer=buffer) char.SetSkillCD(cd=0.04) cd = (point // 25) * 0.04 char.SetStatus(EquEffectRatio=0.10) @@ -14948,12 +14948,12 @@ def equ_2002(char: CharacterProperty): char.SetStatus(SkillAttack=0.384, Buffer=11220) pass if char.max_point >= 2550: - char.SetStatus(SkillAttack=0.57, Buffer=12630) + char.SetStatus(SkillAttack=0.502, Buffer=12930) pass point = char.charEquipInfo['辅助装备'].precision skillAttack = 0.1 * point - (point // 25) * 0.1 + (0.1 if point >= 25 else 0) + (0.1 if point >= 50 else 0) + (0.1 if point >= 75 else 0) + (0.1 if point >= 100 else 0) buffer = 30 * point - (point // 25) * 30 + (350 if point >= 25 else 0) + (380 if point >= 50 else 0) + (380 if point >= 75 else 0) + (510 if point >= 100 else 0) - char.SetStatus(SkillAttack=skillAttack / 100, Buffer=buffer) + char.SetStatus(SkillAttack=round(skillAttack / 100,6), Buffer=buffer) for part in ['项链', '手镯', '戒指']: if char.charEquipInfo[part].equInfo and '黑牙' in char.charEquipInfo[part].equInfo.name: char.SetStatus(SkillAttack=0.03, Buffer=75) diff --git a/backend/dataFiles/dcalc_0.db b/backend/dataFiles/dcalc_0.db index c136b101..2b265fe5 100644 Binary files a/backend/dataFiles/dcalc_0.db and b/backend/dataFiles/dcalc_0.db differ