This commit is contained in:
西瓜°
2026-04-19 15:47:44 +08:00
parent 97da529e35
commit dbf33477d9
12 changed files with 182 additions and 109 deletions
+6 -1
View File
@@ -1,4 +1,5 @@
from collections.abc import Mapping
import sys
from typing import Any, Literal
from core.abstract.character import CharacterProperty
@@ -91,7 +92,7 @@ class CharacterBase(CharacterProperty):
# 唤醒的情况下的基础数据
self.AtkP = 0 + 65
self.AtkM = 0 + 65
self.AtkI = 1116 + 65
self.AtkI = 0 + 65
self.PAtkP = 1.0
self.PAtkM = 1.0
self.PAtkI = 1.0
@@ -239,6 +240,10 @@ class CharacterBase(CharacterProperty):
],
) -> None:
"""设置角色属性"""
# if kwargs.get('SkillAttack', 0) != 0:
# frame = sys._getframe(1) # 1 表示上一级调用帧
# caller_name = frame.f_code.co_name
# print(caller_name, kwargs.get('SkillAttack', 0))
self.STR += 力量 + kwargs.get('STR', 0) + 四维 + 力智
self.INT += 智力 + kwargs.get('INT', 0) + 四维 + 力智
self.Spirit += 精神 + kwargs.get('Spirit', 0) + 四维 + 体精
+15 -8
View File
@@ -18,18 +18,25 @@ class CalcEquipMixin(CharacterBase):
self.charOathInfo = []
self.charEmblemInfo = []
self.bindAwake = info.get('bindAwake', 50)
if info.get('emblems', None) is None:
info['emblems'] = {}
if info.get('oaths', None) is None:
info['oaths'] = {}
for key in info['equips']:
self.charEquipInfo[key] = CharacterEquipInfo(info['equips'][key], self.equVersion, key)
for key in info['oaths']:
# 导入誓约打造信息、誓约信息
self.charOathInfo.append(CharacterOathInfo(info['oaths'][key], self.equVersion, key))
# 异常处理 彩色等级自动取最小值
minEmblemLv = min([info['emblems'][key]['lv'] for key in ['红色', '蓝色', '绿色', '黄色']], default=1)
info['emblems']['彩色']['lv'] = minEmblemLv
for key in info['emblems']:
# 导入徽章打造信息、徽章信息
info['emblems'][key]['part'] = key
self.charEmblemInfo.append(CharacterEmblemInfo(info['emblems'][key]))
try:
# 异常处理 彩色等级自动取最小值
minEmblemLv = min([info['emblems'][key]['lv'] for key in ['红色', '蓝色', '绿色', '黄色']], default=1)
info['emblems']['彩色']['lv'] = minEmblemLv
for key in info['emblems']:
# 导入徽章打造信息、徽章信息
info['emblems'][key]['part'] = key
self.charEmblemInfo.append(CharacterEmblemInfo(info['emblems'][key]))
pass
except Exception as e:
pass
self.charOathSkillId = info.get('oathSkill', 1)
@@ -94,7 +101,7 @@ class CalcEquipMixin(CharacterBase):
max_point_oath_suit = max((suit for suit in oathSuitInfo if oathSuitInfo[suit]['point'] > 0), key=lambda suit: oathSuitInfo[suit]['point'], default=None)
zero_point_suits = [suit for suit in suitInfo if suitInfo[suit]['point'] == 0]
# 套装没有到太初的时候,优先把誓约套装的点数加到装备套装上,以达到更高的套装等级
if 0 < suitInfo[max_point_suit]['point'] < 2550:
if 0 < suitInfo[max_point_suit]['point'] < 2550 and oathSuitInfo.get('max_point_oath_suit', None) is not None:
suitInfo[max_point_suit]['point'] += min(2550 - suitInfo[max_point_suit]['point'], oathSuitInfo[max_point_oath_suit]['point'])
oathSuitInfo[max_point_oath_suit]['point'] -= min(2550 - suitInfo[max_point_suit]['point'], oathSuitInfo[max_point_oath_suit]['point'])
pass
+8 -4
View File
@@ -51,18 +51,22 @@ class CharacterInfoMixin(CharacterBase):
equInfos = get_equipment(self.equVersion)
equs = []
suits = []
stones = []
oaths = []
# stones = []
for i in equInfos.equs:
if i.itemType == '武器' and i.itemDetailType not in self.武器选项:
continue
equs.append(i.__dict__)
for i in equInfos.suits:
suits.append(i.__dict__)
for i in equInfos.stones:
stones.append(i.__dict__)
for i in equInfos.oaths:
oaths.append(i.__dict__)
# for i in equInfos.stones:
# stones.append(i.__dict__)
info['oaths'] = oaths
info['equips'] = equs
info['suits'] = suits
info['stones'] = stones
# info['stones'] = stones
key = '辅助' if self.buffer else '输出'
info['enchants'] = list(filter(lambda x: key in x['categorize'], equInfos.enchants))
info['emblems'] = [i for i in equInfos.emblems]