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

This commit is contained in:
2026-10-13 17:10:08 +08:00
parent 7dc5f4cde5
commit 927866d366
78 changed files with 5242 additions and 1011 deletions
+61 -13
View File
@@ -1,6 +1,25 @@
# ddc49e9ad1ff72a00b53c6cff5b1e920
from core.basic.skill import PassiveSkill, ActiveSkill, get_data, _get_skill_damage_suffixes, _get_skill_dataplus_suffixes
from core.basic.character import Character
from core.basic.skill_effect_types import (
CharacterAttribute,
CharacterEffect,
Constant,
Hit,
LevelTable,
Operation,
Percent,
ProfessionAttribute,
SkillAttribute,
SkillEffect,
)
class RogueAttribute(ProfessionAttribute):
"""本职业专用的最终效果属性;字段含义与技能实现保持一致。"""
END_POWER = 'endpower'
"""刺客:终结追击分组的伤害倍率。"""
prefix = "thief/rogue/cn/skillDetail"
@@ -744,13 +763,20 @@ class Skill20(ActiveSkill):
maxLayer = 6
associate = [{'type': '*endpower', 'data': data0}, {'type': '*endpower'}]
# 迁移前实现(保留对照):
# associate = [{'type': '*endpower', 'data': data0}, {'type': '*endpower'}]
associate = [
SkillEffect(attribute=RogueAttribute.END_POWER, value=1 + Percent(LevelTable(data0))),
SkillEffect(attribute=RogueAttribute.END_POWER, value=1 + Percent(Constant(0))),
]
def update_skill_attribute(self, skill, type, old, new, data, ratio=100, weapon=(), weapon_type=None, weapon_options=()):
if len(data) == 0:
data = getattr(self, f'data{int(self.maxLayer)}')
data = [i - 100 if i > 100 else 0 for i in data]
super().update_skill_attribute(skill, type, old, new, data, ratio, weapon, weapon_type, weapon_options)
# 迁移前实现(保留对照):
# def update_skill_attribute(self, skill, type, old, new, data, ratio=100, weapon=(), weapon_type=None, weapon_options=()):
# if len(data) == 0:
# data = getattr(self, f'data{int(self.maxLayer)}')
# data = [i - 100 if i > 100 else 0 for i in data]
# super().update_skill_attribute(skill, type, old, new, data, ratio, weapon, weapon_type, weapon_options)
# 原第二条关联未提供 data,旧引擎默认零表,不进入空表分支;保留原有效倍率。
# 诅咒之箭
# thief/rogue/547ab2b2bd860d3e37355a9cfbc1077c
@@ -806,7 +832,11 @@ class Skill22(PassiveSkill):
# [弧光闪]追加攻击发动次数增加 : {value0}
data0 = get_data(f'{prefix}/{uuid}', 0)
associate = [{'type': '+hit0', 'data': data0, 'ratio': 1, 'skills': ['弧光闪']}]
# 迁移前实现(保留对照):
# associate = [{'type': '+hit0', 'data': data0, 'ratio': 1, 'skills': ['弧光闪']}]
associate = [
SkillEffect(attribute=Hit(0), operation=Operation.ADD, value=LevelTable(data0), skills=['弧光闪']),
]
# 迅影
# thief/rogue/1b1cfab062e0768bcc889e33e1f30dbf
@@ -1061,10 +1091,16 @@ class Skill27(PassiveSkill):
# 命中率增加 : {value10}%
data10 = get_data(f'{prefix}/{uuid}', 10)
# 迁移前实现(保留对照):
# associate = [
# {'type': '$*PAtkP', 'data': data0},
# {'type': '*cdReduce', 'data': data1, 'exceptSkills': []},
# {'type': '+maxLayer', 'data': data2, 'ratio': 1, 'skills': ['终结之击']},
# ]
associate = [
{'type': '$*PAtkP', 'data': data0},
{'type': '*cdReduce', 'data': data1, 'exceptSkills': []},
{'type': '+maxLayer', 'data': data2, 'ratio': 1, 'skills': ['终结之击']},
CharacterEffect(attribute=CharacterAttribute.P_ATK_P, value=1 + Percent(LevelTable(data0))),
SkillEffect(attribute=SkillAttribute.CD_REDUCE, value=1 - Percent(LevelTable(data1)), except_skills=[]),
SkillEffect(attribute=SkillAttribute.MAX_LAYER, operation=Operation.ADD, value=LevelTable(data2), skills=['终结之击']),
]
# 旋舞斩
@@ -1664,7 +1700,11 @@ class Skill40(PassiveSkill):
# 命中率增加 : {value4}%
data4 = get_data(f'{prefix}/{uuid}', 4)
associate = [{'data': data1}]
# 迁移前实现(保留对照):
# associate = [{'data': data1}]
associate = [
SkillEffect(attribute=SkillAttribute.DAMAGE, value=1 + Percent(LevelTable(data1))),
]
# 月轮舞
# thief/rogue/c61f5a010370101402b05b21916c2071
@@ -1914,7 +1954,11 @@ class Skill45(PassiveSkill):
data0 = get_data(f'{prefix}/{uuid}', 0)
# 连击点数上限增加量 : {value1}个
data1 = get_data(f'{prefix}/{uuid}', 1)
associate = [{'data': data0, 'type': '$*PAtkP'}]
# 迁移前实现(保留对照):
# associate = [{'data': data0, 'type': '$*PAtkP'}]
associate = [
CharacterEffect(attribute=CharacterAttribute.P_ATK_P, value=1 + Percent(LevelTable(data0))),
]
# 乱空杀
# thief/rogue/5cac3411ccef1af333953e0ded5e942d
@@ -2148,7 +2192,11 @@ class Skill50(PassiveSkill):
data2 = get_data(f'{prefix}/{uuid}', 2)
# 多段攻击间隔减少率 : {value3}%
data3 = get_data(f'{prefix}/{uuid}', 3)
associate = [{'data': data0}]
# 迁移前实现(保留对照):
# associate = [{'data': data0}]
associate = [
SkillEffect(attribute=SkillAttribute.DAMAGE, value=1 + Percent(LevelTable(data0))),
]
# 影·万古星辰
# thief/rogue/ef9d26746effee9199b54541f01b8752