Spaces:
Runtime error
Runtime error
04.21 commit
Browse files- parse_new_school.py +61 -0
- schools/bei_ao_jue/buffs.py +2 -4
- schools/bei_ao_jue/recipes.py +11 -11
- schools/bei_ao_jue/skills.py +0 -1
- schools/shan_hai_xin_jue/buffs.py +26 -0
- schools/shan_hai_xin_jue/skills.py +90 -0
parse_new_school.py
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os.path
|
3 |
+
|
4 |
+
from utils.lua import parse
|
5 |
+
|
6 |
+
|
7 |
+
class Parser:
|
8 |
+
buffs: dict = None
|
9 |
+
|
10 |
+
@staticmethod
|
11 |
+
def parse_talents(detail):
|
12 |
+
return [row[1] for row in detail]
|
13 |
+
|
14 |
+
def parse_buff(self, row):
|
15 |
+
detail = row.strip("{}").split(",")
|
16 |
+
buff_id, buff_stack, buff_level = int(detail[4]), int(detail[5]), int(detail[8])
|
17 |
+
if buff_id not in self.buffs:
|
18 |
+
self.buffs[buff_id] = {}
|
19 |
+
if buff_level not in self.buffs[buff_id]:
|
20 |
+
self.buffs[buff_id][buff_level] = []
|
21 |
+
if buff_stack not in self.buffs[buff_id][buff_level]:
|
22 |
+
self.buffs[buff_id][buff_level].append(buff_stack)
|
23 |
+
self.buffs[buff_id][buff_level].sort()
|
24 |
+
|
25 |
+
def parse_skill(self, row):
|
26 |
+
detail = row.strip("{}").split(",")
|
27 |
+
|
28 |
+
skill_id, skill_level, critical = int(detail[4]), int(detail[5]), detail[6] == "true"
|
29 |
+
if skill_id not in self.skills:
|
30 |
+
self.skills[skill_id] = []
|
31 |
+
if skill_level not in self.skills[skill_id]:
|
32 |
+
self.skills[skill_id].append(skill_level)
|
33 |
+
self.skills[skill_id].sort()
|
34 |
+
|
35 |
+
def __call__(self, file_name):
|
36 |
+
self.buffs = {}
|
37 |
+
self.skills = {}
|
38 |
+
self.talents = []
|
39 |
+
lines = open(file_name).readlines()
|
40 |
+
for line in lines:
|
41 |
+
row = line.split("\t")
|
42 |
+
if row[4] == "4":
|
43 |
+
detail = parse(row[-1])
|
44 |
+
if isinstance(detail, list):
|
45 |
+
self.talents = self.parse_talents(detail[6])
|
46 |
+
for line in lines:
|
47 |
+
row = line.split("\t")
|
48 |
+
if row[4] == "13":
|
49 |
+
self.parse_buff(row[-1])
|
50 |
+
elif row[4] == "21":
|
51 |
+
self.parse_skill(row[-1])
|
52 |
+
json.dump(self.skills, open("skills.json", "w", encoding="utf-8"))
|
53 |
+
print(len(self.skills))
|
54 |
+
json.dump(self.buffs, open("buffs.json", "w", encoding="utf-8"))
|
55 |
+
print({k: {} for k in self.buffs})
|
56 |
+
print(len(self.buffs))
|
57 |
+
|
58 |
+
|
59 |
+
if __name__ == '__main__':
|
60 |
+
parser = Parser()
|
61 |
+
parser("单押.jcl")
|
schools/bei_ao_jue/buffs.py
CHANGED
@@ -20,12 +20,10 @@ BUFFS = {
|
|
20 |
23066: {
|
21 |
"buff_name": "含风",
|
22 |
"gain_skills": {
|
23 |
-
|
24 |
-
"skill_damage_addition": 102,
|
25 |
-
},
|
26 |
-
16610: {
|
27 |
"skill_damage_addition": 102,
|
28 |
}
|
|
|
29 |
}
|
30 |
},
|
31 |
14972: {
|
|
|
20 |
23066: {
|
21 |
"buff_name": "含风",
|
22 |
"gain_skills": {
|
23 |
+
skill_id: {
|
|
|
|
|
|
|
24 |
"skill_damage_addition": 102,
|
25 |
}
|
26 |
+
for skill_id in (16787, 16610, 16794)
|
27 |
}
|
28 |
},
|
29 |
14972: {
|
schools/bei_ao_jue/recipes.py
CHANGED
@@ -37,12 +37,12 @@ RECIPE_GAINS: Dict[str, Dict[str, Gain]] = {
|
|
37 |
"2%会心": critical_strike_recipe([16803, 16802, 16801, 16800, 17043, 19423, 19424], 200),
|
38 |
},
|
39 |
"擒龙六斩": {
|
40 |
-
"5%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938], 51),
|
41 |
-
"4%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938], 41),
|
42 |
-
"3%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938], 31),
|
43 |
-
"4%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938], 400),
|
44 |
-
"3%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938], 300),
|
45 |
-
"2%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938], 200),
|
46 |
},
|
47 |
"刀啸风吟": {
|
48 |
"5%伤害": damage_addition_recipe([16610], 51),
|
@@ -54,10 +54,10 @@ RECIPE_GAINS: Dict[str, Dict[str, Gain]] = {
|
|
54 |
}
|
55 |
|
56 |
RECIPES: Dict[str, List[str]] = {
|
57 |
-
"雷走风切": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
58 |
-
"项王击鼎": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
59 |
-
"破釜沉舟": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
60 |
-
"上将军印": ["4%伤害", "3%伤害", "2%伤害", "4%会心", "3%会心", "2%会心"],
|
61 |
-
"擒龙六斩": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
62 |
"刀啸风吟": ["5%伤害", "4%伤害", "4%会心", "3%会心", "2%会心"]
|
63 |
}
|
|
|
37 |
"2%会心": critical_strike_recipe([16803, 16802, 16801, 16800, 17043, 19423, 19424], 200),
|
38 |
},
|
39 |
"擒龙六斩": {
|
40 |
+
"5%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 51),
|
41 |
+
"4%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 41),
|
42 |
+
"3%伤害": damage_addition_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 31),
|
43 |
+
"4%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 400),
|
44 |
+
"3%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 300),
|
45 |
+
"2%会心": critical_strike_recipe([16933, 16934, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942], 200),
|
46 |
},
|
47 |
"刀啸风吟": {
|
48 |
"5%伤害": damage_addition_recipe([16610], 51),
|
|
|
54 |
}
|
55 |
|
56 |
RECIPES: Dict[str, List[str]] = {
|
57 |
+
"雷走风切": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
58 |
+
"项王击鼎": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
59 |
+
"破釜沉舟": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
60 |
+
"上将军印": ["4%伤害", "3%伤害", "2%伤害", "4%会心", "3%会心", "2%会心"],
|
61 |
+
"擒龙六斩": ["5%伤害", "4%伤害", "3%伤害", "4%会心", "3%会心", "2%会心"],
|
62 |
"刀啸风吟": ["5%伤害", "4%伤害", "4%会心", "3%会心", "2%会心"]
|
63 |
}
|
schools/bei_ao_jue/skills.py
CHANGED
@@ -64,7 +64,6 @@ SKILLS: Dict[int, Skill | dict] = {
|
|
64 |
"skill_name": "闹须弥",
|
65 |
"bind_skill": 11447,
|
66 |
"tick": 8
|
67 |
-
|
68 |
},
|
69 |
16933: {
|
70 |
"skill_class": PhysicalDamage,
|
|
|
64 |
"skill_name": "闹须弥",
|
65 |
"bind_skill": 11447,
|
66 |
"tick": 8
|
|
|
67 |
},
|
68 |
16933: {
|
69 |
"skill_class": PhysicalDamage,
|
schools/shan_hai_xin_jue/buffs.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from base.buff import Buff
|
2 |
+
from general.buffs import GENERAL_BUFFS
|
3 |
+
|
4 |
+
BUFFS = {
|
5 |
+
16025: {
|
6 |
+
"buff_name": "雷引",
|
7 |
+
"gain_attributes": {
|
8 |
+
"physical_critical_strike_gain": 400,
|
9 |
+
"physical_critical_power_gain": 41
|
10 |
+
}
|
11 |
+
},
|
12 |
+
26857: {
|
13 |
+
"buff_name": "承契",
|
14 |
+
"gain_attributes": {
|
15 |
+
"all_damage_addition": 62
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
for buff_id, detail in BUFFS.items():
|
21 |
+
BUFFS[buff_id] = Buff(buff_id, detail.pop("buff_name"))
|
22 |
+
for attr, value in detail.items():
|
23 |
+
setattr(BUFFS[buff_id], attr, value)
|
24 |
+
|
25 |
+
for buff_id, buff in GENERAL_BUFFS.items():
|
26 |
+
BUFFS[buff_id] = buff
|
schools/shan_hai_xin_jue/skills.py
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Dict
|
2 |
+
|
3 |
+
from base.skill import PhysicalDamage, PhysicalDotDamage, Skill
|
4 |
+
from general.skills import GENERAL_SKILLS
|
5 |
+
|
6 |
+
SKILLS: Dict[int, Skill | dict] = {
|
7 |
+
32823: {
|
8 |
+
"skill_class": PhysicalDamage,
|
9 |
+
"skill_name": "破",
|
10 |
+
"surplus_cof": 0
|
11 |
+
},
|
12 |
+
35894: {
|
13 |
+
"skill_class": PhysicalDamage,
|
14 |
+
"skill_name": "风矢",
|
15 |
+
"attack_power_cof": 16,
|
16 |
+
"weapon_damage_cof": 1024
|
17 |
+
},
|
18 |
+
35866: {
|
19 |
+
"skill_class": PhysicalDamage,
|
20 |
+
"skill_name": "劲风簇",
|
21 |
+
"attack_power_cof": 0,
|
22 |
+
"weapon_damage_cof": 0
|
23 |
+
},
|
24 |
+
35987: {
|
25 |
+
"skill_class": PhysicalDamage,
|
26 |
+
"skill_name": "饮羽簇",
|
27 |
+
"attack_power_cof": 0,
|
28 |
+
"weapon_damage_cof": 0
|
29 |
+
},
|
30 |
+
36056: {
|
31 |
+
"skill_class": PhysicalDamage,
|
32 |
+
"skill_name": "践踏",
|
33 |
+
"attack_power_cof": 0
|
34 |
+
},
|
35 |
+
36057: {
|
36 |
+
"skill_class": PhysicalDamage,
|
37 |
+
"skill_name": "重击",
|
38 |
+
"attack_power_cof": 0
|
39 |
+
},
|
40 |
+
36111: {
|
41 |
+
"skill_class": PhysicalDamage,
|
42 |
+
"skill_name": "攻击",
|
43 |
+
"attack_power_cof": 0
|
44 |
+
},
|
45 |
+
36112: {
|
46 |
+
"skill_class": PhysicalDamage,
|
47 |
+
"skill_name": "攻击",
|
48 |
+
"attack_power_cof": 0
|
49 |
+
},
|
50 |
+
36113: {
|
51 |
+
"skill_class": PhysicalDamage,
|
52 |
+
"skill_name": "攻击",
|
53 |
+
"attack_power_cof": 0
|
54 |
+
},
|
55 |
+
36114: {
|
56 |
+
"skill_class": PhysicalDamage,
|
57 |
+
"skill_name": "攻击",
|
58 |
+
"attack_power_cof": 0
|
59 |
+
},
|
60 |
+
36157: {
|
61 |
+
"skill_class": PhysicalDamage,
|
62 |
+
"skill_name": "标鹄",
|
63 |
+
"attack_power_cof": 0
|
64 |
+
},
|
65 |
+
26856: {
|
66 |
+
"skill_class": PhysicalDamage,
|
67 |
+
"skill_name": "贯穿(DOT)",
|
68 |
+
"attack_power_cof": 0
|
69 |
+
},
|
70 |
+
35771: {
|
71 |
+
"skill_class": Skill,
|
72 |
+
"skill_name": "贯穿",
|
73 |
+
"bind_skill": 26856,
|
74 |
+
"max_stack": 6,
|
75 |
+
"tick": 4
|
76 |
+
},
|
77 |
+
36453: {
|
78 |
+
"skill_class": PhysicalDamage,
|
79 |
+
"skill_name": "朝仪万汇",
|
80 |
+
"attack_power_cof": 0
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
for skill_id, detail in SKILLS.items():
|
85 |
+
SKILLS[skill_id] = detail.pop('skill_class')(skill_id, detail.pop('skill_name'))
|
86 |
+
for attr, value in detail.items():
|
87 |
+
setattr(SKILLS[skill_id], attr, value)
|
88 |
+
|
89 |
+
for skill_id, skill in GENERAL_SKILLS.items():
|
90 |
+
SKILLS[skill_id] = skill
|