This commit is contained in:
2025-04-09 18:29:03 +08:00
parent 3032e6cf5a
commit edf347fbd3
11 changed files with 271 additions and 713 deletions
+12 -11
View File
@@ -104,27 +104,28 @@ class Skill:
type = assoc.get('type', '*skillRation')
skills = assoc.get('skills', '*')
data = assoc.get('data', [0] * self.maxLv)
ratio = assoc.get('ratio', 100)
exceptSkills = assoc.get('exceptSkills', [])
if type[0] not in ['*', '+', '$']:
if self.precondition():
getattr(self, type)(old, new, data, skills,exceptSkills)
getattr(self, type)(old, new, data, skills,exceptSkills,ratio)
continue
if self.precondition():
self._apply_association(type, old, new, data, skills,exceptSkills)
self._apply_association(type, old, new, data, skills,exceptSkills,ratio)
def precondition(self):
"""effect的前置条件"""
return True
def _apply_association(self, type, old, new, data, skills, exceptSkills):
def _apply_association(self, type, old, new, data, skills, exceptSkills,ratio = 100):
if type.startswith('$*'):
if 'cdReduce' in type:
value = (1 - data[new] / 100) / (1 - data[old] / 100)
value = (1 - data[new] / ratio) / (1 - data[old] / ratio)
else:
value = (1 + data[new] / 100) / (1 + data[old] / 100)
value = (1 + data[new] / ratio) / (1 + data[old] / ratio)
eval(f'self.char.SetStatus({type[2:]}={value})')
elif type.startswith('$+'):
value = data[new] / 100 - data[old] / 100
value = data[new] / ratio - data[old] / ratio
eval(f'self.char.SetStatus({type[2:]}={value})')
else:
if skills == '*':
@@ -134,16 +135,16 @@ class Skill:
continue
skill = self.char.GetSkillByName(name)
if skill is not None:
self._update_skill_attribute(skill,type, old, new, data)
self._update_skill_attribute(skill,type, old, new, data,ratio)
def _update_skill_attribute(self,skill, type, old, new, data):
def _update_skill_attribute(self,skill, type, old, new, data,ratio = 100):
if type.startswith('*'):
if 'cdReduce' in type:
setattr(skill, type[1:], getattr(skill, type[1:]) * (1 - data[new] / 100) / (1 - data[old] / 100))
setattr(skill, type[1:], getattr(skill, type[1:]) * (1 - data[new] / ratio) / (1 - data[old] / ratio))
else:
setattr(skill, type[1:], getattr(skill, type[1:]) * (1 + data[new] / 100) / (1 + data[old] / 100))
setattr(skill, type[1:], getattr(skill, type[1:]) * (1 + data[new] / ratio) / (1 + data[old] / ratio))
elif type.startswith('+'):
setattr(skill, type[1:], getattr(skill, type[1:]) + data[new] / 100 - data[old] / 100)
setattr(skill, type[1:], getattr(skill, type[1:]) + data[new] / ratio - data[old] / ratio)
def skillInfo(self, mode: str | None = None):
pass
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -21,7 +21,7 @@ adv = [
'children': [
{'id': 0, 'name': 'sword_master', 'title': '极诣·驭剑士', 'open': False},
{'id': 1, 'name': 'dark_templar', 'title': '极诣·暗殿骑士', 'open': False},
{'id': 2, 'name': 'demon_slayer', 'title': '极诣·契魔者', 'open': False},
{'id': 2, 'name': 'demon_slayer', 'title': '极诣·契魔者', 'open': True, 'class': 'GF.swordman_female.demon_slayer'},
{'id': 3, 'name': 'vegabond', 'title': '极诣·流浪武士', 'open': True, 'class': 'GF.swordman_female.vegabond'},
{'id': 4, 'name': 'spectre', 'title': '极诣·刃影', 'open': False},
],