fix:修正技攻

This commit is contained in:
2026-06-29 02:56:37 +08:00
parent e9128641b8
commit fa5a055cf1
6 changed files with 31 additions and 22 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
from collections.abc import Mapping from collections.abc import Mapping
import sys
from typing import Any, Literal from typing import Any, Literal
from core.abstract.character import CharacterProperty from core.abstract.character import CharacterProperty
@@ -268,6 +269,8 @@ class CharacterBase(CharacterProperty):
"""设置角色属性""" """设置角色属性"""
# if kwargs.get('SkillAttack', 0) != 0: # if kwargs.get('SkillAttack', 0) != 0:
# frame = sys._getframe(1) # 1 表示上一级调用帧 # 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 # caller_name = frame.f_code.co_name
# print(caller_name, kwargs.get('SkillAttack', 0)) # print(caller_name, kwargs.get('SkillAttack', 0))
kget = kwargs.get kget = kwargs.get
@@ -291,7 +294,7 @@ class CharacterBase(CharacterProperty):
self.ElementR[elem] += kget(f'{elem}抗', 0) + element_r.get(elem, 0) + 全属抗 self.ElementR[elem] += kget(f'{elem}抗', 0) + element_r.get(elem, 0) + 全属抗
self.CriticalM += kget('CriticalM', 0) + 魔暴 self.CriticalM += kget('CriticalM', 0) + 魔暴
self.CriticalP += kget('CriticalP', 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.SpeedA += 攻击速度 + kget('SpeedA', 0) + 三速
self.SpeedM += 移动速度 + kget('SpeedM', 0) + 三速 self.SpeedM += 移动速度 + kget('SpeedM', 0) + 三速
self.SpeedR += 施放速度 + kget('SpeedR', 0) + 三速 self.SpeedR += 施放速度 + kget('SpeedR', 0) + 三速
+8 -7
View File
@@ -292,13 +292,14 @@ class CalcEquipMixin(CharacterBase):
apply_uppercase_attrs(self, oath) apply_uppercase_attrs(self, oath)
fun(self) fun(self)
# 誓约升级效果 # 誓约升级效果
for upgrade in item.upgrade: if item.oathInfo and item.oathInfo.itemDetailType == '誓约':
if upgrade == 1: for upgrade in item.upgrade:
self.SetStatus(SkillAttack=0.04,Buffer=800) if upgrade == 1:
pass self.SetStatus(SkillAttack=0.04,Buffer=800)
if upgrade == 2: pass
self.SetSkillCD(cd=0.08) if upgrade == 2:
self.SetStatus(EquEffectRatio=0.04,Buffer=800) self.SetSkillCD(cd=0.08)
self.SetStatus(EquEffectRatio=0.04,Buffer=800)
pass pass
pass pass
@@ -1,3 +1,4 @@
import sys
from typing import Any 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: 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)) character.SetStatus(**uppercase_attrs(source))
+8 -8
View File
@@ -516,19 +516,19 @@ def emblem_4701(char: CharacterProperty):
@register @register
def emblem_combine(char: CharacterProperty, position: str, lv: int = 1, emblem_list: list[int | str] = []): 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.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] 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, 240270, 300, 320, 340, 360, 380, 400] 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.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016] 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.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.009, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016]
if position == '白金': if position == '白金':
return return
# 固有属性 # 固有属性
if position == '彩色': if position == '彩色':
char.SetStatus(BufferP=bufferP[lv - 1], SkillAttack=skillAttack[lv - 1]) char.SetStatus(BufferP=bufferP[lv], SkillAttack=skillAttack[lv])
else: else:
char.SetStatus(Buffer=buffer[lv - 1], AttackP=attackP[lv - 1]) char.SetStatus(Buffer=buffer[lv], AttackP=attackP[lv])
rarity = (lv - 1) // 5 rarity = (lv) // 5
emblems = list(filter(lambda x: safeParseInt(x) > 0, emblem_list)) or [] emblems = list(filter(lambda x: safeParseInt(x) > 0, emblem_list)) or []
emblem_raritys = [safeParseInt(i) // 1000 for i in emblems] emblem_raritys = [safeParseInt(i) // 1000 for i in emblems]
# 稀有 # 稀有
+6 -6
View File
@@ -5835,7 +5835,7 @@ def weapon_point(char: CharacterProperty):
point = char.charEquipInfo['武器'].precision 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) 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) 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 pass
@@ -14856,7 +14856,7 @@ def equ_2000(char: CharacterProperty):
char.SetStatus(SkillAttack=0.378, Buffer=12180) char.SetStatus(SkillAttack=0.378, Buffer=12180)
pass pass
if char.max_point >= 2550: if char.max_point >= 2550:
char.SetStatus(SkillAttack=0.555, Buffer=12630) char.SetStatus(SkillAttack=0.489, Buffer=12930)
pass pass
point = char.charEquipInfo['魔法石'].precision 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) 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) char.SetStatus(SkillAttack=0.384, Buffer=11220)
pass pass
if char.max_point >= 2550: if char.max_point >= 2550:
char.SetStatus(SkillAttack=0.562, Buffer=12630) char.SetStatus(SkillAttack=0.502, Buffer=12930)
pass pass
point = char.charEquipInfo['耳环'].precision 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) 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) 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) char.SetSkillCD(cd=0.04)
cd = (point // 25) * 0.04 cd = (point // 25) * 0.04
char.SetStatus(EquEffectRatio=0.10) char.SetStatus(EquEffectRatio=0.10)
@@ -14948,12 +14948,12 @@ def equ_2002(char: CharacterProperty):
char.SetStatus(SkillAttack=0.384, Buffer=11220) char.SetStatus(SkillAttack=0.384, Buffer=11220)
pass pass
if char.max_point >= 2550: if char.max_point >= 2550:
char.SetStatus(SkillAttack=0.57, Buffer=12630) char.SetStatus(SkillAttack=0.502, Buffer=12930)
pass pass
point = char.charEquipInfo['辅助装备'].precision 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) 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) 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 ['项链', '手镯', '戒指']: for part in ['项链', '手镯', '戒指']:
if char.charEquipInfo[part].equInfo and '黑牙' in char.charEquipInfo[part].equInfo.name: if char.charEquipInfo[part].equInfo and '黑牙' in char.charEquipInfo[part].equInfo.name:
char.SetStatus(SkillAttack=0.03, Buffer=75) char.SetStatus(SkillAttack=0.03, Buffer=75)
Binary file not shown.