dev
This commit is contained in:
@@ -75,6 +75,7 @@ class CalcEquipMixin(CharacterBase):
|
||||
"""套装效果统计"""
|
||||
suitInfo = {}
|
||||
oathSuitInfo = {}
|
||||
correction = 0
|
||||
equs = get_equipment(self.equVersion)
|
||||
for item in filter(lambda x: x.equInfo is not None, self.charEquipInfo.values()):
|
||||
partEqu = item.equInfo
|
||||
@@ -101,14 +102,16 @@ 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 suitInfo is not None and 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'])
|
||||
if suitInfo is not None and 0 < suitInfo[max_point_suit]['point'] < 2550 and oathSuitInfo.get(max_point_oath_suit, None) is not None:
|
||||
correction = min(2550 - suitInfo[max_point_suit]['point'], oathSuitInfo[max_point_oath_suit]['point'])
|
||||
suitInfo[max_point_suit]['point'] += correction
|
||||
oathSuitInfo[max_point_oath_suit]['point'] -= correction
|
||||
pass
|
||||
suits = zero_point_suits + ([max_point_suit] if max_point_suit is not None else [])
|
||||
suitList: list[Suit] = []
|
||||
oathSuitList: list[OathSuit] = []
|
||||
res = []
|
||||
res = {'suit': None, 'oath': None, 'correction': correction}
|
||||
# print(max_point_suit, suitList)
|
||||
for suit in suits:
|
||||
if suitInfo[suit]['point'] == 0:
|
||||
suitList += equs.get_suit_info(suit, 0, suitInfo[suit]['count'])
|
||||
@@ -116,20 +119,20 @@ class CalcEquipMixin(CharacterBase):
|
||||
suitList += equs.get_suit_info(suit, suitInfo[suit]['point'], 0)
|
||||
if len(suitList) == 0:
|
||||
continue
|
||||
self.suitInfo = suitList
|
||||
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,
|
||||
}
|
||||
)
|
||||
if suit == max_point_suit:
|
||||
self.suitInfo = suitList
|
||||
temp = suitList[-1]
|
||||
res['suit'] = {
|
||||
'id': temp.id,
|
||||
'name': temp.name,
|
||||
'rarity': temp.rarity,
|
||||
'point': suitInfo[suit]['point'],
|
||||
'count': suitInfo[suit]['count'],
|
||||
'level': temp.level,
|
||||
'suitId': suit,
|
||||
'imageUrl': temp.imageUrl,
|
||||
# 'value': temp.value,
|
||||
}
|
||||
for suit in oathSuitInfo:
|
||||
if oathSuitInfo[suit]['point'] == 0:
|
||||
oathSuitList += equs.get_oath_suit_info(suit, 0, oathSuitInfo[suit]['count'])
|
||||
@@ -149,19 +152,19 @@ class CalcEquipMixin(CharacterBase):
|
||||
filtered_dict = {k: v for k, v in suit.__dict__.items() if k[0].isupper()}
|
||||
self.SetStatus(**filtered_dict)
|
||||
if func is not None and oathEffect is None:
|
||||
print(f'套装 {suit.name} 生效')
|
||||
# print(f'套装 {suit.name} 生效')
|
||||
func(self)
|
||||
else:
|
||||
# 当存在套装和誓约不匹配的时候,誓约技能只能是1号位
|
||||
self.charOathSkillId = 1
|
||||
if max_point_suit != max_point_oath_suit:
|
||||
self.charOathSkillId = '1'
|
||||
oathSkillEffect = []
|
||||
self.max_point = max([i['point'] for i in res], default=0)
|
||||
self.max_point = 0 if res['suit'] is None else res.get('suit', {}).get('point', 0)
|
||||
self.oathSuitInfo = []
|
||||
self.oathSkillInfo = []
|
||||
# 当套装点数达到太初时,誓约技能生效
|
||||
if self.max_point >= 2550:
|
||||
for oathSuit in oathSuitList:
|
||||
skill = next((x for x in oathSuit.skills if x.skillId == self.charOathSkillId), None)
|
||||
skills = list(filter(lambda x: x.suitId == oathSuit.suitId, oathSuit.skills))
|
||||
skill = next((x for x in oathSuit.skills if str(x.skillId) == str(self.charOathSkillId)), None)
|
||||
# 誓约套装效果生效
|
||||
filtered_dict = {k: v for k, v in oathSuit.__dict__.items() if k[0].isupper()}
|
||||
self.SetStatus(**filtered_dict)
|
||||
@@ -172,11 +175,23 @@ class CalcEquipMixin(CharacterBase):
|
||||
self.SetStatus(**filtered_dict)
|
||||
self.oathSkillInfo.append(skill)
|
||||
self.oathSuitInfo.append(oathSuit)
|
||||
|
||||
if oathSuit.suitId == max_point_oath_suit:
|
||||
res['oath'] = {
|
||||
'id': oathSuit.id,
|
||||
'name': skill.name,
|
||||
'rarity': oathSuit.rarity,
|
||||
'point': oathSuitInfo[oathSuit.suitId]['point'],
|
||||
'count': oathSuitInfo[oathSuit.suitId]['count'],
|
||||
'level': oathSuit.level,
|
||||
'imageUrl': oathSuit.imageUrl,
|
||||
'suitId': oathSuit.suitId,
|
||||
'skills': [{'id': skill.id, 'skillId': i.skillId, 'name': i.name, 'imageUrl': i.imageUrl, 'enable': i.skillId == '1' or max_point_oath_suit == max_point_suit} for i in skills],
|
||||
# 'value': oathSuit.value,
|
||||
}
|
||||
for skill in oathSkillEffect:
|
||||
func = equs.funs.execture(f'oath_skill_{skill.id}')
|
||||
if func is not None:
|
||||
print(f'誓约技能 {skill.id} 生效')
|
||||
# print(f'誓约技能 {skill.id} 生效')
|
||||
func(self)
|
||||
if self.max_point >= 2550:
|
||||
skillAttack = (self.max_point - 2550) // 70 * 0.01
|
||||
|
||||
@@ -98,16 +98,7 @@ class CharacterInfoMixin(CharacterBase):
|
||||
info['options'] = equInfos.funs.options
|
||||
info['sundry'] = equInfos.funs.sundryList
|
||||
for skill in platinum:
|
||||
info['emblems'].append(
|
||||
{
|
||||
'id': skill,
|
||||
'fame': 232,
|
||||
'position': ['辅助装备', '魔法石'],
|
||||
'detail': skill + ' Lv+1' + ' 四维 + 8',
|
||||
'categorize': ['技能'],
|
||||
'rarity': '白金',
|
||||
}
|
||||
)
|
||||
info['emblems'].append({'id': skill, 'fame': 232, 'value': skill + ' Lv+1' + ' 四维 + 8', 'rarity': '白金', 'rarityId': '-1', 'type': '白金', 'typeId': '-1'})
|
||||
return info
|
||||
|
||||
def getBasicInos(self):
|
||||
|
||||
Reference in New Issue
Block a user