mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
chore(tools): 查找肉鸽招募中未提及的干员 (#9865)
This commit is contained in:
1
tools/RoguelikeOperSearch/.gitignore
vendored
Normal file
1
tools/RoguelikeOperSearch/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
missing*
|
||||
45
tools/RoguelikeOperSearch/RoguelikeOperSearch.py
Normal file
45
tools/RoguelikeOperSearch/RoguelikeOperSearch.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
proj_dir = os.path.join(cur_dir, "../../")
|
||||
|
||||
battle_data_path = os.path.join(proj_dir, "resource/battle_data.json")
|
||||
theme_paths = {
|
||||
"Phantom": os.path.join(proj_dir, "resource/roguelike/Phantom/recruitment.json"),
|
||||
"Mizuki": os.path.join(proj_dir, "resource/roguelike/Mizuki/recruitment.json"),
|
||||
"Sami": os.path.join(proj_dir, "resource/roguelike/Sami/recruitment.json"),
|
||||
"Sarkaz": os.path.join(proj_dir, "resource/roguelike/Sarkaz/recruitment.json")
|
||||
}
|
||||
|
||||
def read_battle_data_names():
|
||||
with open(battle_data_path, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
names = []
|
||||
for key, value in data.get("chars", {}).items():
|
||||
if key.startswith("char_"):
|
||||
if value.get("rarity") and value.get("rarity") >=3:
|
||||
name = value.get("name")
|
||||
if name:
|
||||
names.append(name)
|
||||
return names
|
||||
|
||||
def check_recruitment_files(names):
|
||||
missing_oper = {}
|
||||
for theme, path in theme_paths.items():
|
||||
missing_oper[theme] = []
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
for name in names:
|
||||
if content.find(f'"{name}"') == -1:
|
||||
missing_oper[theme].append(name)
|
||||
|
||||
# 输出到missing_oper.txt
|
||||
with open(os.path.join(cur_dir, 'missing_oper.txt'), 'w', encoding='utf-8') as f:
|
||||
for theme, missing_names in missing_oper.items():
|
||||
if missing_names:
|
||||
f.write(f"{theme}: {' , '.join(missing_names)}\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
names = read_battle_data_names()
|
||||
check_recruitment_files(names)
|
||||
Reference in New Issue
Block a user