feat:优化职业技能关联实现

This commit is contained in:
2026-10-13 15:57:28 +08:00
parent 15c3bff467
commit 7dc5f4cde5
20 changed files with 875 additions and 161 deletions
@@ -912,25 +912,10 @@ class Skill25(ActiveSkill):
# 蓄气时间上限减少率 : {value3}%
data3 = get_data(f'{prefix}/{uuid}', 3)
_ratio = 1
ratio = 1.0
associate = [{"type":"*cdRatio","data":data1,"skills":['冰墙', '元素之门', '元素之幕', '元素震荡', '圣灵水晶', '烈焰冲击','天雷', '雷旋', '杰克降临', '湮灭黑洞', '极冰盛宴', '虚无之球', '光与暗的交响']}]
@property
def ratio(self):
return self._ratio
@ratio.setter
def ratio(self, value):
if self._ratio != value:
data = self.associate[0]
ratio = (1 - data['data'][self.lv] / 100 * value) / (1 - data['data'][self.lv] / 100 * self._ratio)
for item in data['skills']:
skill = self.char.GetSkillByName(item)
if skill is not None:
skill.cdRatio *= ratio
self._ratio = value
# 技能等级变化的时候,系数对应的数值变化
def update_skill_attribute(self, skill, type, old, new, data, ratio=100, weapon=(), weapon_type=None, weapon_options=()):
super().update_skill_attribute(skill, type, old, new, data, ratio / self.ratio, weapon, weapon_type, weapon_options)
@@ -1139,25 +1124,10 @@ class Skill31(PassiveSkill):
# 所有属性抗性增加值 : {value1}
data1 = get_data(f'{prefix}/{uuid}', 1)
_ratio = 1
ratio = 1.0
associate = [{"type":"*skillDamage","data":data0}]
@property
def ratio(self):
return self._ratio
@ratio.setter
def ratio(self, value):
if self._ratio != value:
data = self.associate[0]
ratio = (1 + data['data'][self.lv] / 100 * value) / (1 + data['data'][self.lv] / 100 * self._ratio)
for item in self.char.GetSkillNames('all', True):
skill = self.char.GetSkillByName(item)
if skill is not None:
skill.skillRation *= ratio
self._ratio = value
# 技能等级变化的时候,系数对应的数值变化
def update_skill_attribute(self, skill, type, old, new, data, ratio=100, weapon=(), weapon_type=None, weapon_options=()):
super().update_skill_attribute(skill, type, old, new, data, ratio / self.ratio, weapon, weapon_type, weapon_options)
@@ -2924,14 +2924,7 @@ class Skill60(ActiveSkill):
# 自身强化
skillDamage = 1.15
@property
def lv(self):
"""技能等级"""
return self.char.GetSkillByName("传说召唤 : 逆月者拉莫斯").lv
@lv.setter
def lv(self, value):
...
level_source = '传说召唤 : 逆月者拉莫斯'
# 逆月
# mage_female/summoner/10834437b54f67c4c27f92eaabd59bb1
@@ -2505,13 +2505,7 @@ class Skill49(ActiveSkill):
associate = [{'data': data3, 'skills': ['变异苍蝇拍', '超级苍蝇拍', '改良舒露露', '改良魔法星弹', '暗影斗篷', '技艺融合', '超级棒棒糖', '光电兔', '雪人刨冰', '乌洛波洛斯之环', '糖果大作战精怪乐园', '糖果大作战捣蛋杰克']}, {'data': data4, 'type': '+powerFail', 'skills': ['熔岩药瓶', '暴炎加热炉', '冰霜钻孔车']}]
@property
def lv(self):
"""技能等级"""
return self.char.GetSkillByName('贤者之石').lv
@lv.setter
def lv(self, value): ...
level_source = '贤者之石'
def getSkillData(self, lv = 0):
pre = self.char.GetSkillByName('超级苍蝇拍')