diff --git a/backend/core/basic/character/base.py b/backend/core/basic/character/base.py index e814442f..1a329239 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 @@ -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) + 四维 + 体精 diff --git a/backend/core/basic/character/calc_equip.py b/backend/core/basic/character/calc_equip.py index 50f9c70d..6b97a919 100644 --- a/backend/core/basic/character/calc_equip.py +++ b/backend/core/basic/character/calc_equip.py @@ -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 diff --git a/backend/core/basic/character/info.py b/backend/core/basic/character/info.py index ca24b24f..ca8583cc 100644 --- a/backend/core/basic/character/info.py +++ b/backend/core/basic/character/info.py @@ -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] diff --git a/backend/core/basic/equipment.py b/backend/core/basic/equipment.py index 8f522b70..052b3fcd 100644 --- a/backend/core/basic/equipment.py +++ b/backend/core/basic/equipment.py @@ -80,10 +80,10 @@ class Equipments: self.equs: list[Equ] = [] self.oaths: list[Oath] = [] self.oath_dict: dict[str, Oath] = {} - self.stones: list[Equ] = [] + # self.stones: list[Equ] = [] self.funs = self.init_func() self.equ_dict: dict[str, Equ] = {} - self.stone_dict: dict[str, Equ] = {} + # self.stone_dict: dict[str, Equ] = {} self.jades = [] self.enchants = [] self.emblems = [] @@ -94,7 +94,7 @@ class Equipments: self.init_equs() self.init_suits() self.init_enchants() - self.init_stones() + # self.init_stones() self.init_emblem() self.init_jades() self.init_oaths() @@ -124,27 +124,27 @@ class Equipments: self.equs.append(equ) self.equ_dict[equ.id] = equ - def init_stones(self): - """从数据库中获取所有装备信息""" - with Session(self.engine) as session: - db_list = session.query(StoneData).all() - keys = [key for key in StoneData.__dict__.keys() if key[0].isupper()] + ['suit'] - for item in db_list: - max_adaptation = 0 - item.id = str(item.id) - for attr in keys: - if attr == 'suit': - value = parse_to_number_list(getattr(item, attr), []) - value = [str(int(i)) for i in value] - else: - value = parse_to_number_list(getattr(item, attr)) - max_adaptation = max(max_adaptation, len(value) - 1) - setattr(item, attr, value) - stone_dict = {k: v for k, v in item.__dict__.items() if not k.startswith('_')} - stone_dict['max_adaptation'] = max_adaptation - stone = Equ(**stone_dict) - self.stones.append(stone) - self.stone_dict[stone.id] = stone + # def init_stones(self): + # """从数据库中获取所有装备信息""" + # with Session(self.engine) as session: + # db_list = session.query(StoneData).all() + # keys = [key for key in StoneData.__dict__.keys() if key[0].isupper()] + ['suit'] + # for item in db_list: + # max_adaptation = 0 + # item.id = str(item.id) + # for attr in keys: + # if attr == 'suit': + # value = parse_to_number_list(getattr(item, attr), []) + # value = [str(int(i)) for i in value] + # else: + # value = parse_to_number_list(getattr(item, attr)) + # max_adaptation = max(max_adaptation, len(value) - 1) + # setattr(item, attr, value) + # stone_dict = {k: v for k, v in item.__dict__.items() if not k.startswith('_')} + # stone_dict['max_adaptation'] = max_adaptation + # stone = Equ(**stone_dict) + # self.stones.append(stone) + # self.stone_dict[stone.id] = stone def init_suits(self): """从数据库中获取所有套装信息""" @@ -188,9 +188,9 @@ class Equipments: db_list = session.query(EmblemData).all() for item in db_list: emblem = {k: v for k, v in item.__dict__.items() if not k.startswith('_')} - emblem['position'] = [] if emblem['itemType'] is None else emblem['itemType'].split(',') - emblem['categorize'] = [] if emblem['categorize'] is None else emblem['categorize'].split(',') - del emblem['itemType'] + # emblem['position'] = [] if emblem['itemType'] is None else emblem['itemType'].split(',') + # emblem['categorize'] = [] if emblem['categorize'] is None else emblem['categorize'].split(',') + # del emblem['itemType'] self.emblems.append(emblem) pass pass @@ -336,6 +336,8 @@ class Oath: Buffer: list[float] | float wearUrl: list[str] max_adaptation: int + itemType: str + itemDetailType: str def __init__(self, **kwargs): self.__dict__.update(kwargs) diff --git a/backend/dataFiles/dcalc_0.db b/backend/dataFiles/dcalc_0.db index 620c726b..3bf8aaa8 100644 Binary files a/backend/dataFiles/dcalc_0.db and b/backend/dataFiles/dcalc_0.db differ diff --git a/backend/database/models.py b/backend/database/models.py index 650ccc1c..bddce708 100644 --- a/backend/database/models.py +++ b/backend/database/models.py @@ -104,11 +104,12 @@ class EmblemData(Base): __tablename__ = 'emblem' id = Column(Integer, primary_key=True) - detail = Column(Text) - categorize = Column(Integer) - itemType = Column(Text) - fame = Column(Integer) + rarityId = Column(Integer) rarity = Column(Text) + typeId = Column(Integer) + type = Column(Text) + value = Column(Text) + fame = Column(Integer) class JadeData(Base): @@ -135,6 +136,8 @@ class OathData(Base): rarity = Column(Text) position = Column(Text) Point = Column(Integer) + itemType = Column(Text) + itemDetailType = Column(Text) categorize = Column(Text) imageUrl = Column(Text) detail = Column(Text) @@ -165,6 +168,8 @@ class PrimerData(Base): name = Column(Text) rarity = Column(Text) position = Column(Text) + itemType = Column(Text) + itemDetailType = Column(Text) Point = Column(Integer) categorize = Column(Text) imageUrl = Column(Text) diff --git a/frontend/src/api/info/type.ts b/frontend/src/api/info/type.ts index 3f92cd14..8b23f4d0 100644 --- a/frontend/src/api/info/type.ts +++ b/frontend/src/api/info/type.ts @@ -31,6 +31,7 @@ export interface ICharacterInfo { stones: IEquipment[] enchants: IEnchantingInfo[] emblems: IEnchantingInfo[] + oaths: IEquipment[] weapons: string[] subweapons: string[] skills: ISkill[] @@ -73,6 +74,11 @@ export interface IEquipment { bufferDetail: string } +export interface IOathInfo extends IEquipment { + position: string[] + wearUrl: string[] +} + export interface ISkill { icon: string name: string @@ -91,7 +97,7 @@ export interface ISkill { desc: string }[] uuid: string - upType:'damage' |'heal' + upType: 'damage' | 'heal' } export interface ISuit { diff --git a/frontend/src/components/dnf/Equipment/List/index.vue b/frontend/src/components/dnf/Equipment/List/index.vue index d98eba89..85edb947 100644 --- a/frontend/src/components/dnf/Equipment/List/index.vue +++ b/frontend/src/components/dnf/Equipment/List/index.vue @@ -16,9 +16,9 @@ {{ partName(part) }} -