This commit is contained in:
2025-04-05 13:00:16 +08:00
parent e2099aa047
commit da8e163322
20 changed files with 1843 additions and 15196 deletions
+72 -11
View File
@@ -150,10 +150,11 @@ class Character:
def __init__(self, equVersion) -> None:
self.equVersion = equVersion
# self.equs = get_equ(self.equVersion)
self.STR = 0
self.INT = 0
self.Spirit = 0
self.Vitality = 0
# 工会四维
self.STR = 0 + 120
self.INT = 0 + 120
self.Spirit = 0 + 120
self.Vitality = 0 + 120
# 唤醒的情况下的基础数据
self.AtkP = 0 + 65
self.AtkM = 0 + 65
@@ -555,18 +556,33 @@ class Character:
suitInfo[suit]['count'] += 1
else:
suitInfo[suit]['point'] += partFusion.Point
print(suitInfo)
# 取得点数最高的套装
max_point_suit = max((suit for suit in suitInfo if suitInfo[suit]['point'] > 0), key=lambda suit: suitInfo[suit]['point'], default=None)
# 处理没有点数的老套装
zero_point_suits = [suit for suit in suitInfo if suitInfo[suit]['point'] == 0]
suits = zero_point_suits + ([max_point_suit] if max_point_suit is not None else [])
suits_effect = []
suitList = []
res = []
for suit in suits:
if suitInfo[suit]['point'] == 0:
suits_effect += [i.id for i in equs.get_suit_info(suit, 0, suitInfo[suit]['count'])]
suitList += equs.get_suit_info(suit, 0, suitInfo[suit]['count'])
# suits_effect += [i.id for i in equs.get_suit_info(suit, 0, suitInfo[suit]['count'])]
else:
suits_effect += [i.id for i in equs.get_suit_info(suit, suitInfo[suit]['point'], 0)]
suitList += equs.get_suit_info(suit, suitInfo[suit]['point'], 0)
# suits_effect += [i.id for i in equs.get_suit_info(suit, suitInfo[suit]['point'], 0)]
temp = suitList[-1]
res.append({
'id': temp.id,
'name': temp.name,
'rarity': temp.rarity,
'point': suitInfo[suit]['point'],
'count': suitInfo[suit]['count'],
'level': temp.level,
'imageUrl': temp.imageUrl,
'value': temp.value,
})
suits_effect = [i.id for i in suitList]
for i in suits_effect:
func = equs.funs.suit_func_list.get(str(i), None)
suit = next((x for x in equs.suits if str(x.id) == str(i)), None)
@@ -575,11 +591,15 @@ class Character:
if suit is not None:
filtered_dict = {k: v for k, v in suit.__dict__.items() if k[0].isupper()}
self.SetStatus(**filtered_dict)
return res
def calc_equs(self):
"""计算装备基础效果和额外词条"""
"""计算装备基础效果、附魔、贴膜"""
effects = get_equipment(self.equVersion).funs
for equ in [item.equInfo for item in filter(lambda x: x.equInfo is not None, self.charEquipInfo.values())]:
for detail in [(item.equInfo,item.fusionInfo,item.enchant) for item in filter(lambda x: x.equInfo is not None, self.charEquipInfo.values())]:
equ = detail[0]
fusion = detail[1]
enchat = detail[2]
if equ is None:
continue
fun = effects.equ_func_list.get(str(equ.id), None)
@@ -590,6 +610,19 @@ class Character:
self.SetStatus(**filtered_dict)
# 获取装备额外属性
fun(self)
# 附魔
fun = effects.enchant_func_list.get(str(enchat), None)
if fun is not None:
fun(self)
# 贴膜
if fusion is None:
continue
fun = effects.equ_func_list.get(str(fusion.id), None)
# 获取装备基础属性 并给角色设置(大写开头属性为角色属性)
filtered_dict = {k: v for k, v in fusion.__dict__.items() if k[0].isupper()}
self.SetStatus(**filtered_dict)
# 获取装备额外属性
fun(self)
def calc_basic(self):
"""计算基础属性:防具精通、增幅、强化等"""
@@ -660,7 +693,8 @@ class Character:
# 部位效果计算
self.calc_equs()
# 计算套装基础效果
self.calc_suits()
suit = self.calc_suits()
# print(suit)
# effects = get_equipment(self.equVersion).funs
# for effect in equ_effect:
# func = effects.equ_func_list.get(str(effect), None)
@@ -705,7 +739,34 @@ class Character:
'damage': ratuio_equ_skill * i.data * 10,
}
)
return {'skills': skillInfos, 'info': {k: v for k, v in self.__dict__.items() if k[0].isupper()}}
attrs = []
if self.输出类型 == '物理百分比':
attrs.extend(['STR', 'AtkP'])
if self.输出类型 == '魔法百分比':
attrs.extend(['INT', 'AtkM'])
if self.输出类型 == '物理固伤':
attrs.extend(['STR', 'AtkI'])
if self.输出类型 == '魔法固伤':
attrs.extend(['INT', 'AtkI'])
info = []
attrs.extend(['Attack', 'AttackP', 'SkillAttack', 'ElementDB'])
for attr in attrs:
temp = getattr(CharacterInfo, attr)
if attr.startswith('Atk'):
info.append({
'name':temp.name,
'value':temp.value(getattr(self, attr)*getattr(self, f'P{attr}'))}
)
pass
else:
info.append(
{
'name': temp.name,
'value': temp.value(getattr(self, attr)),
}
)
pass
return {'skills': skillInfos, 'info': info,"suits": suit}
# 技能影响角色的属性,如属强、抗性等
def calc_damage_ration(self):
+14 -2
View File
@@ -1,7 +1,6 @@
import importlib
from database.models import EmblemData, Session, EquData, StoneData, SuitData, EnchantData
from database.models import EmblemData, Session, EquData, StoneData, SuitData, EnchantData,JadeData
from database.connect import get_db_engine as get_engine
from functools import cache
def parse_to_number_list(info: str, default: list[float] = [0]) -> list[float]:
@@ -164,6 +163,19 @@ class Equipments:
self.emblems.append(emblem)
pass
pass
def init_jades(self):
"""从数据库中获取所有辟邪玉信息"""
with Session(self.engine) as session:
db_list = session.query(JadeData).all()
for item in db_list:
jade = {k: v for k, v in item.__dict__.items() if not k.startswith('_')}
jade['position'] = [] if jade['itemType'] is None else jade['itemType'].split(',')
jade['categorize'] = [] if jade['categorize'] is None else jade['categorize'].split(',')
del jade['itemType']
self.jades.append(jade)
pass
pass
def init_func(self):
"""根据装备版本加载装备效果"""
+9 -25
View File
@@ -33,32 +33,10 @@ class CharacterInfo(enum.Enum):
AtkI = '独立攻击力', '/ui/UI_ProfileIcon_008.png', lambda x: round(x, 0)
"""独立攻击力"""
ElementA: dict[str, float]
# """属性攻击"""
ElementDB = '攻击属性', '/ui/UI_ProfileIcon_009.png', lambda x: f'火({int(x['火'])})/光({int(x['光'])})/冰({int(x['冰'])})/暗({int(x['暗'])})'
"""攻击属性"""
ElementDB0 = '火属性强化', '/ui/UI_ProfileIcon_022.png', lambda x: round(x, 0)
ElementR0 = '火属性抗性', '/ui/UI_ProfileIcon_023.png', lambda x: round(x, 0)
ElementDB1 = '冰属性强化', '/ui/UI_ProfileIcon_024.png', lambda x: round(x, 0)
ElementR1 = '冰属性抗性', '/ui/UI_ProfileIcon_025.png', lambda x: round(x, 0)
ElementDB2 = '光属性强化', '/ui/UI_ProfileIcon_026.png', lambda x: round(x, 0)
ElementR2 = '光属性抗性', '/ui/UI_ProfileIcon_027.png', lambda x: round(x, 0)
ElementDB3 = '暗属性强化', '/ui/UI_ProfileIcon_028.png', lambda x: round(x, 0)
ElementR3 = '暗属性抗性', '/ui/UI_ProfileIcon_029.png', lambda x: round(x, 0)
CriticalP = '物理暴击', '/ui/UI_ProfileIcon_011.png', lambda x: f'{format(x * 100, ".2f")}%'
"""物理暴击"""
CriticalM = '魔法暴击', '/ui/UI_ProfileIcon_010.png', lambda x: f'{format(x * 100, ".2f")}%'
"""魔法暴击"""
EquipmentSkillAttack = '技能攻击力增加', '/ui/UI_ProfileIcon_047.png', lambda x: f'{format(x * 100 - 100, ".2f")}%'
SkillAttack = '技能攻击力增加', '/ui/UI_ProfileIcon_047.png', lambda x: f'{format(x * 100 - 100, ".2f")}%'
"""技能攻击力"""
SpeedA = '攻击速度', '/ui/UI_ProfileIcon_012.png', lambda x: f'{format(x * 100, ".2f")}%'
@@ -70,6 +48,12 @@ class CharacterInfo(enum.Enum):
SpeedR = '施放速度', '/ui/UI_ProfileIcon_013.png', lambda x: f'{format(x * 100, ".2f")}%'
"""施放速度"""
Attack = '攻击强化', '/ui/UI_ProfileIcon_015.png', lambda x: f'{format(x * 100, ".2f")}%'
"""攻击强化"""
AttackP = '攻击强化%', '/ui/UI_ProfileIcon_015.png', lambda x: f'{format(x * 100 - 100, ".2f")}%'
"""攻击强化%"""
# HitP : float
# """命中率"""
-2
View File
@@ -29,8 +29,6 @@ class CharacterEquipInfo:
"""装备信息"""
fusionInfo: Union['Equ', None]
"""贴膜信息"""
fusionInfo: Union['Equ', None]
"""贴膜信息"""
def __init__(self, info={}, equVerison=0, part='') -> None:
info["fusion"] = info.get("fusion", None)
@@ -2,6 +2,8 @@ from .suit import suit_func_list
from .jade import jade_func_list
from .equ import equ_func_list
from .avatar import get_dress_list
from .enchant import enchant_func_list
options = [
{'id': 1, 'name': '龙战八荒,', 'options': ['BUFF OFF', 'BUFF ON', '期望']},
{'id': 2, 'name': '混沌净化', 'options': ['净化', '堕落']},
+210
View File
@@ -0,0 +1,210 @@
from core.basic.character import Character
emblem_func_list = {}
def emblem_1(char: Character):
"""
力智+20 暴击+1.9%
"""
char.SetStatus(力智=20)
pass
def emblem_2(char: Character):
"""
力智+15 暴击+1.5%
"""
char.SetStatus(力智=15)
pass
def emblem_3(char: Character):
"""
力智+10 暴击+1.1%
"""
char.SetStatus(力智=10)
pass
def emblem_4(char: Character):
"""
力智+35
"""
char.SetStatus(力智=35)
pass
def emblem_5(char: Character):
"""
体精+35
"""
char.SetStatus(体精=35)
pass
def emblem_6(char: Character):
"""
体精+25
"""
char.SetStatus(体精=25)
pass
def emblem_7(char: Character):
"""
体精+17
"""
char.SetStatus(体精=17)
pass
def emblem_8(char: Character):
"""
力智+30
"""
char.SetStatus(力智=30)
pass
def emblem_9(char: Character):
"""
攻速+2%
"""
char.SetStatus(攻速=0.02)
pass
def emblem_10(char: Character):
"""
体精+30
"""
char.SetStatus(体精=30)
pass
def emblem_11(char: Character):
"""
三攻+20
"""
char.SetStatus(三攻=20)
pass
def emblem_12(char: Character):
"""
力智+30
"""
char.SetStatus(力智=30)
pass
def emblem_13(char: Character):
"""
体精+30
"""
char.SetStatus(体精=30)
pass
def emblem_14(char: Character):
"""
力智+25
"""
char.SetStatus(力智=25)
pass
def emblem_15(char: Character):
"""
力智+15
"""
char.SetStatus(力智=15)
pass
def emblem_16(char: Character):
"""
攻速+1.5%
"""
char.SetStatus(攻速=0.015)
pass
def emblem_17(char: Character):
"""
体精+15
"""
char.SetStatus(体精=15)
pass
def emblem_18(char: Character):
"""
三攻+15
"""
char.SetStatus(三攻=15)
pass
def emblem_19(char: Character):
"""
体精+15
"""
char.SetStatus(体精=15)
pass
def emblem_20(char: Character):
"""
力智+17
"""
char.SetStatus(力智=17)
pass
def emblem_21(char: Character):
"""
力智+10
"""
char.SetStatus(力智=10)
pass
def emblem_22(char: Character):
"""
攻速+1.1%
"""
char.SetStatus(攻速=0.011)
pass
def emblem_23(char: Character):
"""
体精+10
"""
char.SetStatus(体精=10)
pass
def emblem_24(char: Character):
"""
三攻+10
"""
char.SetStatus(三攻=10)
pass
def emblem_25(char: Character):
"""
体精+10
"""
char.SetStatus(体精=10)
pass
for i in range(0, 3000):
try:
if str(i) not in emblem_func_list.keys():
emblem_func_list[str(i)] = eval(f'emblem_{i}')
except Exception:
pass
-228
View File
@@ -1,228 +0,0 @@
from core.basic.property import CharacterProperty
emblems_func_list = {}
# 名望 部位 颜色 品质 属性
index = ("maxFame", "position", "type", "rarity", "props")
def emblems_25000(char: CharacterProperty = {}, text=False):
if text:
return (0, '', '其它', '华丽', '无徽章')
def emblems_25001(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '玲珑', '力智+35')
char.基础属性加成(力智=35)
def emblems_25021(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '玲珑', '体精+35')
char.基础属性加成(体精=35)
def emblems_25002(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '灿烂', '力智+25')
char.基础属性加成(力智=25)
def emblems_25022(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '玲珑', '体精+25')
char.基础属性加成(体精=25)
def emblems_25003(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '华丽', '力智+17')
char.基础属性加成(力智=17)
def emblems_25023(char: CharacterProperty = {}, text=False):
if text:
return (0, '戒指,腰带,皮肤,武器装扮,光环', '红色', '玲珑', '体精+17')
char.基础属性加成(体精=17)
def emblems_25004(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,戒指,腰带,皮肤,武器装扮,光环', '红绿', '玲珑', '力智+20 暴击+1.9%')
char.基础属性加成(力智=20, 暴击率=0.022)
def emblems_25005(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,戒指,腰带,皮肤,武器装扮,光环', '红绿', '玲珑', '力智+15 暴击+1.5%')
char.基础属性加成(力智=15, 暴击率=0.015)
def emblems_25006(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,戒指,腰带,皮肤,武器装扮,光环', '红绿', '玲珑', '力智+10 暴击+1.1%')
char.基础属性加成(力智=10, 暴击率=0.011)
def emblems_25007(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '灿烂', '力智+15')
char.基础属性加成(力智=15)
def emblems_25008(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '华丽', '力智+10')
char.基础属性加成(力智=10)
def emblems_25009(char: CharacterProperty = {}, text=False):
if text:
return (0, '手镯,鞋,皮肤,武器装扮,光环', '蓝色', '玲珑', '三攻+20')
char.基础属性加成(三攻=20)
def emblems_25010(char: CharacterProperty = {}, text=False):
if text:
return (0, '手镯,鞋,皮肤,武器装扮,光环', '蓝色', '灿烂', '三攻+15')
char.基础属性加成(三攻=15)
def emblems_25011(char: CharacterProperty = {}, text=False):
if text:
return (0, '手镯,鞋,皮肤,武器装扮,光环', '蓝色', '华丽', '三攻+10')
char.基础属性加成(三攻=10)
def emblems_25012(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,皮肤,武器装扮,光环', '绿色', '灿烂', '体精+15')
char.基础属性加成(体精=15)
def emblems_25013(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,皮肤,武器装扮,光环', '绿色', '华丽', '体精+10')
char.基础属性加成(体精=10)
def emblems_25014(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '玲珑', '攻速+2%')
char.攻击速度增加(0.02)
def emblems_25015(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '灿烂', '攻速+1.5%')
char.攻击速度增加(0.015)
def emblems_25016(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '华丽', '攻速+1.1%')
char.攻击速度增加(0.011)
def emblems_25017(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '玲珑', '属抗+7')
char.所有属性抗性加成(7)
def emblems_25018(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '灿烂', '属抗+5')
char.所有属性抗性加成(5)
def emblems_25019(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '华丽', '属抗+3')
char.所有属性抗性加成(3)
def emblems_25020(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '玲珑', '异抗+0.7%')
char.所有异常抗性加成(7/1000)
def emblems_25024(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '灿烂', '异抗+0.5%')
char.所有异常抗性加成(5/1000)
def emblems_25025(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环,腰带,上衣,下装,手镯,鞋', '彩色', '华丽', '异抗+0.3%')
char.所有异常抗性加成(3/1000)
def emblems_25026(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '玲珑', '力智+30')
char.基础属性加成(力智=30)
def emblems_25027(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '灿烂', '体精+15')
char.基础属性加成(体精=15)
def emblems_25028(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '华丽', '体精+10')
char.基础属性加成(体精=10)
def emblems_25029(char: CharacterProperty = {}, text=False):
if text:
return (0, '头肩,项链,皮肤,武器装扮,光环', '黄色', '玲珑', '体精+30')
char.基础属性加成(体精=30)
def emblems_25030(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,皮肤,武器装扮,光环', '绿色', '玲珑', '体精+30')
char.基础属性加成(体精=30)
def emblems_25031(char: CharacterProperty = {}, text=False):
if text:
return (0, '上衣,下装,皮肤,武器装扮,光环', '绿色', '玲珑', '力智+30')
char.基础属性加成(力智=30)
# 徽章效果id范围 25001~25999
for i in range(25001, 25040):
try:
if i not in emblems_func_list.keys():
emblems_func_list[i] = eval('emblems_{}'.format(i))
except Exception:
pass
def get_embfunc_by_id(id):
return emblems_func_list.get(int(id), emblems_25000)
def get_emblems_setinfo(char: CharacterProperty = {}):
infolist = []
for i in emblems_func_list.keys():
data = {}
data['id'] = i
emblems = emblems_func_list[i]
info = emblems(text=True)
char.评分开始()
emblems(char)
评分 = char.评分结束()
data['rate'] = 评分
num = 0
for k in index:
value = info[num]
if(k == 'position'):
value = [i.strip() for i in value.split(",")]
data[k] = value
num += 1
infolist.append(data)
infolist.sort(key=lambda x: x['rate'], reverse=True)
return infolist
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
+11 -1
View File
@@ -104,4 +104,14 @@ class EmblemData(Base):
categorize = Column(Integer)
itemType = Column(Text)
fame = Column(Integer)
rarity = Column(Text)
rarity = Column(Text)
class JadeData(Base):
__tablename__ = 'jade'
id = Column(Integer, primary_key=True)
name = Column(Text)
min = Column(Integer)
max = Column(Integer)
unit = Column(Text)
pre = Column(Float)
@@ -30,9 +30,6 @@ const infoStyle = (part: string) => {
let x = 15
let y = 5
let index = infoStore.avatarParts.findIndex((p) => p == part)
if (index > 7) {
index += 1
}
// if (index == 13) {
// index -= 7
// } else if (index >= 5 && index <= 12) {
@@ -45,7 +42,7 @@ const infoStyle = (part: string) => {
}
else if (part.includes('宠物装备')) {
x += 6 * 39
y += (index - infoStore.avatarParts.findIndex((p) => p == '宠物装备-红') - 1) * 40
y += (index - infoStore.avatarParts.findIndex((p) => p == '宠物装备-红')) * 40
} else {
x += (index % 4) * 39
y += Math.floor(index / 4) * 40
@@ -66,6 +63,7 @@ const choosePart = (part: string) => {
const partName = (part: string) => {
if (part == '武器装扮') return '武器'
if(part == '快捷栏装备') return '快捷'
return part.replace('宠物装备-', '')
}
</script>
@@ -20,7 +20,7 @@ export default defineComponent({
)
})
const enchanting_list = computed<IEnchantingInfo[] | undefined>(() => {
const enchant_list = computed<IEnchantingInfo[] | undefined>(() => {
return basicInfoStore.enchants
?.filter((item) => item.position.includes(part.value))
.sort((a, b) => (b.fame ?? 0) - (a.fame ?? 0))
@@ -55,7 +55,7 @@ export default defineComponent({
}
// 附魔
const enchanting = currentInfo<string | number>('enchanting')
const enchant = currentInfo<string | number>('enchant')
// 镶嵌栏1
const emblem_0 = currentInfo<string | number>('emblem_0', 0)
@@ -92,9 +92,9 @@ export default defineComponent({
{has_enchant.value ? (
<div class="equ-profile-item">
<div class="row-name">{part.value == '宠物' ? '附魔' : '属性'}</div>
<calc-select v-model={enchanting.value} class="flex-1 !h-20px">
<calc-select v-model={enchant.value} class="flex-1 !h-20px">
<calc-option value={0}>无</calc-option>
{renderList(enchanting_list.value ?? [], (item) => (
{renderList(enchant_list.value ?? [], (item) => (
<calc-option value={item.id}>{item.detail}</calc-option>
))}
</calc-select>
@@ -24,7 +24,7 @@ export default defineComponent({
)
const basicInfoStore = useInfoStore()
const enchanting_list = computed<IEnchantingInfo[] | undefined>(() => {
const enchant_list = computed<IEnchantingInfo[] | undefined>(() => {
return basicInfoStore.enchants
?.filter(
(item) =>
@@ -62,7 +62,7 @@ export default defineComponent({
let parts: string[] = []
if (global_change.value) {
if (name === 'enchanting') {
if (name === 'enchant') {
const enchant = basicInfoStore?.enchants?.find((item) => item.id == val) as
| IEnchantingInfo
| undefined
@@ -96,7 +96,7 @@ export default defineComponent({
}
// 附魔
const enchanting = currentInfo<string | number>('enchanting')
const enchant = currentInfo<string | number>('enchant')
// 镶嵌栏1
const emblem_0 = currentInfo<string | number>('emblem_0', 0)
@@ -171,9 +171,9 @@ export default defineComponent({
)}
<div class="equ-profile-item">
<div class="row-name">附魔</div>
<calc-select v-model={enchanting.value} class="flex-1 !h-20px">
<calc-select v-model={enchant.value} class="flex-1 !h-20px">
<calc-option value={""}>无</calc-option>
{renderList(enchanting_list.value ?? [], (item) => (
{renderList(enchant_list.value ?? [], (item) => (
<calc-option value={item.id}>{item.detail}</calc-option>
))}
</calc-select>
@@ -0,0 +1,55 @@
<template>
<div>
<template v-for="key in ['0','1','2','3']" :key="key">
<div class="flex gap-2 mt-5px">
<calc-select class="flex-1 !h-20px" v-model="configStore.config.jades[key].id">
<calc-option v-for="(item, index) in ['0','1']" :key="index" :value="item">
{{item}}
</calc-option>
</calc-select>
<calc-select class="flex-1 !h-20px" v-model="configStore.config.jades[key].value"></calc-select>
</div>
</template>
</div>
</template>
<script setup lang="ts">
import { useConfigStore } from '@/stores'
import { useInfoStore } from '@/stores'
const configStore = useConfigStore()
const infoStore = useInfoStore()
// const valueList = computed(() => {
// return function (id: number = -1) {
// if (id == -1) {
// return undefined
// } else {
// const res = []
// const cur = infoStore.jade?.find(e => e.id == id) as IJadeInfo
// if (cur) {
// const { max, min, unit, pre } = cur
// //
// if (pre == 0) {
// res.push({
// id: 1,
// value: unit
// })
// } else {
// for (let i = Number(max) as number; i >= Number(min);) {
// if (i != 0) {
// res.push({
// id: getFloat(i, 1),
// value: (i > 0 ? "+" : "") + getFloat(i, 1) + unit
// })
// }
// i = Number((i - Number(pre)).toFixed(1))
// }
// }
// return res
// }
// }
// }
// }
// })
</script>
+5 -1
View File
@@ -1,5 +1,5 @@
<template>
<div class="w-400px">
<div class="w-420px">
<calc-collapse class="w-100%" title="装备/时装打造(点击部位切换)">
<calc-tabs v-model="partTab" class="!mb-2">
<calc-tab :value="0">装备栏</calc-tab>
@@ -8,11 +8,15 @@
<equipment v-if="partTab === 0"></equipment>
<clothes v-if="partTab === 1"></clothes>
</calc-collapse>
<calc-collapse class="w-100%" title="辟邪玉">
<jade></jade>
</calc-collapse>
</div>
</template>
<script setup lang="ts">
import equipment from './components/equipment.vue'
import clothes from './components/avatar.vue';
import jade from './components/jade.vue';
const partTab = ref(0)
</script>
+1 -2
View File
@@ -8,7 +8,7 @@
</calc-tabs>
</div>
<div class="content flex">
<div class="flex flex-1">
<div class="flex flex-1" v-if="!!infoStore.infos?.alter">
<RouterView></RouterView>
</div>
@@ -40,7 +40,6 @@ const stopWatch = watch<any>(
onMounted(async () => {
await infoStore.createCharacter(props.alter, '0')
configStore.loadConfig()
window.addEventListener('beforeunload', () => {
configStore.saveConfig()
})
+13 -2
View File
@@ -31,7 +31,10 @@ export interface IConfig {
fusion: string
}
>
jades: Record<string, number>
jades: Record<string, {
id:string
value: number
}>
avatar: Record<
string,
{
@@ -117,7 +120,15 @@ export const useConfigStore = defineStore('configStore', () => {
(config.value.skills[id] = {
lv: infoStore.skills.find((skill) => skill.id.toString() === id)?.maxLearnLv ?? 0,
})
})
});
(["0", "1", "2", "3"].filter((key) => !Object.keys(config.value.jades).includes(key)) ?? []).forEach((key) => {
config.value.jades[key] = {
id: '',
value: 0,
}
}
)
}
const saveConfig = () => {
+5
View File
@@ -1,6 +1,7 @@
import api from '@/api'
import type { ICharacterInfo } from '@/api/info/type'
import { defineStore } from 'pinia'
import { useConfigStore } from './config'
export const useInfoStore = defineStore('infoStore', () => {
const alter_token = ref<string>('')
@@ -20,6 +21,8 @@ export const useInfoStore = defineStore('infoStore', () => {
const avatars = computed(() => infos.value?.avatar ?? {})
// const jades = computed(() => infos.value?.jades ?? [])
const parts = [
'头肩',
'上衣',
@@ -45,6 +48,7 @@ export const useInfoStore = defineStore('infoStore', () => {
'胸部',
'上衣',
'皮肤',
'快捷栏装备',
'腰带',
'下装',
'鞋',
@@ -58,6 +62,7 @@ export const useInfoStore = defineStore('infoStore', () => {
const time = new Date().getTime()
alter_token.value = btoa(JSON.stringify({ alter, equVersion, time }))
infos.value = await api.characterInfo()
useConfigStore().loadConfig()
}
return {