fix:修正技攻
This commit is contained in:
@@ -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) + 三速
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user