From 57cf25935cd02f6be7f9f793ae4b39ee118f33d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Tue, 6 Oct 2026 13:42:34 +0800 Subject: [PATCH] update --- backend/core/basic/character/calc_equip.py | 44 ++++++++++++---------- backend/core/basic/roleinfo.py | 2 +- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/backend/core/basic/character/calc_equip.py b/backend/core/basic/character/calc_equip.py index b7e58d4a..f5f26da1 100644 --- a/backend/core/basic/character/calc_equip.py +++ b/backend/core/basic/character/calc_equip.py @@ -284,26 +284,30 @@ class CalcEquipMixin(CharacterBase): def calc_oath_upgrade(self): """计算装备基础效果""" - for index,item in enumerate(self.charOathInfo): - # 誓约升级效果 - if item.oathInfo and item.oathInfo.itemDetailType == '誓约': - for upgrade in item.upgrade: - if index <= 3: - if upgrade == 1: - self.SetStatus(SkillAttack=0.04,Buffer=800) - pass - elif upgrade == 2: - self.SetSkillCD(cd=0.08) - self.SetStatus(EquEffectRatio=0.04,Buffer=800) - elif upgrade == 3: - # 誓约积分 +25 - item.oathInfo.Point += 25 - else: - if upgrade == 1: - self.SetStatus(SpeedA=0.04, SpeedM=0.04, SpeedR=0.04, SkillAttack=0.04, Buffer=800) - elif upgrade == 2 or upgrade == 3: - self.SetStatus(SkillAttack=0.04,Buffer=800) - pass + oath = next( + (item for item in self.charOathInfo + if item.oathInfo is not None and item.oathInfo.itemDetailType == '誓约'), + None, + ) + if oath is not None: + for index, upgrade in enumerate(oath.upgrade): + if index <= 3: + if upgrade == 1: + self.SetStatus(SkillAttack=0.04, Buffer=800) + elif upgrade == 2: + self.SetSkillCD(cd=0.08) + self.SetStatus(EquEffectRatio=0.04, Buffer=800) + elif upgrade == 3: + # 誓约积分 +25 + oath.oathInfo.Point += 25 + elif upgrade == 1: + self.SetStatus( + SpeedA=0.04, SpeedM=0.04, SpeedR=0.04, + SkillAttack=0.04, Buffer=800, + ) + elif upgrade in (2, 3): + self.SetStatus(SkillAttack=0.04, Buffer=800) + pass pass def calc_oaths(self): diff --git a/backend/core/basic/roleinfo.py b/backend/core/basic/roleinfo.py index 60769a58..87c30f56 100644 --- a/backend/core/basic/roleinfo.py +++ b/backend/core/basic/roleinfo.py @@ -69,7 +69,7 @@ class CharacterOathInfo: if info is None: info = {} if info.get('upgrade') is None: - info['upgrade'] = [0, 0, 0, 0] + info['upgrade'] = [0, 0, 0, 0, 0, 0, 0, 0] self.__dict__.update(info) self.id = str(self.id) equipments = equipments or get_equipment(equVerison)