附魔导入 装备基础信息导入
This commit is contained in:
@@ -400,15 +400,16 @@ class Character:
|
||||
}
|
||||
)
|
||||
info['skills'] = skillInfo
|
||||
equInfos = get_equipment(self.equVersion)
|
||||
equs = []
|
||||
suits = []
|
||||
for i in get_equipment(self.equVersion).equs:
|
||||
for i in equInfos.equs:
|
||||
equs.append(i.__dict__)
|
||||
for i in get_equipment(self.equVersion).suits:
|
||||
for i in equInfos.suits:
|
||||
suits.append(i.__dict__)
|
||||
info['equips'] = equs
|
||||
info['suits'] = suits
|
||||
enchats = []
|
||||
info['enchants'] = equInfos.enchants
|
||||
emblems = []
|
||||
return info
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import importlib
|
||||
from database.models import Session, EquData, SuitData
|
||||
from database.models import Session, EquData, SuitData, EnchantData
|
||||
from database.connect import get_db_engine as get_engine
|
||||
from functools import cache
|
||||
|
||||
@@ -7,7 +7,6 @@ from functools import cache
|
||||
def parse_to_number_list(info: str, default: list[float] = [0]) -> list[float]:
|
||||
return default if not info else [float(i) for i in info.split(',')]
|
||||
|
||||
|
||||
class Equ:
|
||||
id: str
|
||||
name: str
|
||||
@@ -73,10 +72,12 @@ class Equipments:
|
||||
self.equs: list[Equ] = []
|
||||
self.funs = self.init_func()
|
||||
self.equ_dict: dict[str, Equ] = {}
|
||||
self.enchants = []
|
||||
self.suits: list[Suit] = []
|
||||
self.suit_dict: dict[str, Suit] = {}
|
||||
self.init_equs()
|
||||
self.init_suits()
|
||||
self.init_enchants()
|
||||
self.engine.dispose()
|
||||
|
||||
def init_equs(self):
|
||||
@@ -111,6 +112,19 @@ class Equipments:
|
||||
self.suit_dict.setdefault(str(suit.suitId), []).append(suit)
|
||||
pass
|
||||
|
||||
def init_enchants(self):
|
||||
"""从数据库中获取所有附魔信息"""
|
||||
with Session(self.engine) as session:
|
||||
db_list = session.query(EnchantData).all()
|
||||
for item in db_list:
|
||||
enchant = {k: v for k, v in item.__dict__.items() if not k.startswith('_')}
|
||||
enchant['position'] = [] if enchant['itemType'] is None else enchant['itemType'].split(',')
|
||||
enchant['categorize'] = [] if enchant['categorize'] is None else enchant['categorize'].split(',')
|
||||
del enchant['itemType']
|
||||
self.enchants.append(enchant)
|
||||
pass
|
||||
pass
|
||||
|
||||
def init_func(self):
|
||||
"""根据装备版本加载装备效果"""
|
||||
try:
|
||||
|
||||
@@ -312,7 +312,7 @@ class Skill18(ActiveSkill):
|
||||
cube = 3
|
||||
cd = 30
|
||||
mp = [800, 1680]
|
||||
icon = '$char/超真空弹:切利.png'
|
||||
icon = '$char/超真空弹:切利'
|
||||
|
||||
data0 = [0, 246, 272, 296, 320, 347, 372, 396, 420, 447, 473, 497, 521, 546, 573, 597, 623, 647, 671, 698, 723, 747, 771, 798, 824, 848, 872, 897, 924, 948, 972, 998, 1022, 1049, 1074, 1098, 1122, 1148, 1175, 1199, 1223, 1248, 1275, 1299, 1323, 1349, 1373, 1400, 1424, 1449, 1473]# noqa: E501
|
||||
hit0 = 20
|
||||
|
||||
Binary file not shown.
@@ -55,3 +55,12 @@ class EquData(Base):
|
||||
Attack = Column(Text)
|
||||
Buffer = Column(Text)
|
||||
suit = Column(Text)
|
||||
|
||||
class EnchantData(Base):
|
||||
__tablename__ = 'enchant'
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
detail = Column(Text)
|
||||
categorize = Column(Integer)
|
||||
itemType = Column(Text)
|
||||
fame = Column(Integer)
|
||||
|
||||
Reference in New Issue
Block a user