From c034b2e70a3f9f42ca23bebcb53ae87aa5a7ff56 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Fri, 26 Jul 2024 10:05:02 +0800 Subject: [PATCH] feat(uigf): metadata from local db --- src/idJson.json | 1937 ++++++++++++++++++++++++++++++++++++++++++ src/main/UIGFJson.js | 25 +- tools/getIdMap.py | 67 ++ 3 files changed, 2023 insertions(+), 6 deletions(-) create mode 100644 src/idJson.json create mode 100644 tools/getIdMap.py diff --git a/src/idJson.json b/src/idJson.json new file mode 100644 index 0000000..0c798fc --- /dev/null +++ b/src/idJson.json @@ -0,0 +1,1937 @@ +{ + "zh-cn": { + "13108": { + "name": "仿制星徽引擎", + "item_type": "音擎", + "rank_type": 3 + }, + "14104": { + "name": "硫磺石", + "item_type": "音擎", + "rank_type": 4 + }, + "12009": { + "name": "「湍流」-斧型", + "item_type": "音擎", + "rank_type": 2 + }, + "13103": { + "name": "聚宝箱", + "item_type": "音擎", + "rank_type": 3 + }, + "13002": { + "name": "时光切片", + "item_type": "音擎", + "rank_type": 3 + }, + "13113": { + "name": "含羞恶面", + "item_type": "音擎", + "rank_type": 3 + }, + "12003": { + "name": "「月相」-朔", + "item_type": "音擎", + "rank_type": 2 + }, + "12002": { + "name": "「月相」-晦", + "item_type": "音擎", + "rank_type": 2 + }, + "13008": { + "name": "双生泣星", + "item_type": "音擎", + "rank_type": 3 + }, + "14001": { + "name": "加农转子", + "item_type": "音擎", + "rank_type": 3 + }, + "13003": { + "name": "雨林饕客", + "item_type": "音擎", + "rank_type": 3 + }, + "13010": { + "name": "兔能环", + "item_type": "音擎", + "rank_type": 3 + }, + "13011": { + "name": "春日融融", + "item_type": "音擎", + "rank_type": 3 + }, + "14102": { + "name": "钢铁肉垫", + "item_type": "音擎", + "rank_type": 4 + }, + "14114": { + "name": "拘缚者", + "item_type": "音擎", + "rank_type": 4 + }, + "14118": { + "name": "嵌合编译器", + "item_type": "音擎", + "rank_type": 4 + }, + "12011": { + "name": "「电磁暴」-贰式", + "item_type": "音擎", + "rank_type": 2 + }, + "13007": { + "name": "正版变身器", + "item_type": "音擎", + "rank_type": 3 + }, + "12005": { + "name": "「残响」-Ⅱ型", + "item_type": "音擎", + "rank_type": 2 + }, + "13112": { + "name": "比格气缸", + "item_type": "音擎", + "rank_type": 3 + }, + "12007": { + "name": "「湍流」-铳型", + "item_type": "音擎", + "rank_type": 2 + }, + "14119": { + "name": "深海访客", + "item_type": "音擎", + "rank_type": 4 + }, + "14124": { + "name": "防暴者Ⅵ型", + "item_type": "音擎", + "rank_type": 4 + }, + "13101": { + "name": "德玛拉电池Ⅱ型", + "item_type": "音擎", + "rank_type": 3 + }, + "14110": { + "name": "燃狱齿轮", + "item_type": "音擎", + "rank_type": 4 + }, + "12013": { + "name": "「恒等式」-本格", + "item_type": "音擎", + "rank_type": 2 + }, + "12006": { + "name": "「残响」-Ⅲ型", + "item_type": "音擎", + "rank_type": 2 + }, + "13004": { + "name": "星徽引擎", + "item_type": "音擎", + "rank_type": 3 + }, + "12014": { + "name": "「恒等式」-变格", + "item_type": "音擎", + "rank_type": 2 + }, + "13005": { + "name": "人为刀俎", + "item_type": "音擎", + "rank_type": 3 + }, + "13127": { + "name": "维序者-特化型", + "item_type": "音擎", + "rank_type": 3 + }, + "13111": { + "name": "旋钻机-赤轴", + "item_type": "音擎", + "rank_type": 3 + }, + "14121": { + "name": "啜泣摇篮", + "item_type": "音擎", + "rank_type": 4 + }, + "12010": { + "name": "「电磁暴」-壹式", + "item_type": "音擎", + "rank_type": 2 + }, + "13115": { + "name": "好斗的阿炮", + "item_type": "音擎", + "rank_type": 3 + }, + "13009": { + "name": "触电唇彩", + "item_type": "音擎", + "rank_type": 3 + }, + "13013": { + "name": "鸢尾秘藏", + "item_type": "音擎", + "rank_type": 3 + }, + "12004": { + "name": "「残响」-Ⅰ型", + "item_type": "音擎", + "rank_type": 2 + }, + "14126": { + "name": "淬锋钳刺", + "item_type": "音擎", + "rank_type": 4 + }, + "12008": { + "name": "「湍流」-矢型", + "item_type": "音擎", + "rank_type": 2 + }, + "12001": { + "name": "「月相」-望", + "item_type": "音擎", + "rank_type": 2 + }, + "13106": { + "name": "家政员", + "item_type": "音擎", + "rank_type": 3 + }, + "14002": { + "name": "逍遥游球", + "item_type": "音擎", + "rank_type": 3 + }, + "14125": { + "name": "玉壶青冰", + "item_type": "音擎", + "rank_type": 4 + }, + "13001": { + "name": "街头巨星", + "item_type": "音擎", + "rank_type": 3 + }, + "13006": { + "name": "贵重骨核", + "item_type": "音擎", + "rank_type": 3 + }, + "12012": { + "name": "「电磁暴」-叁式", + "item_type": "音擎", + "rank_type": 2 + }, + "14003": { + "name": "左轮转子", + "item_type": "音擎", + "rank_type": 3 + }, + "13128": { + "name": "轰鸣座驾", + "item_type": "音擎", + "rank_type": 3 + }, + "1061": { + "name": "可琳", + "item_type": "代理人", + "rank_type": 3 + }, + "1251": { + "name": "青衣", + "item_type": "代理人", + "rank_type": 4 + }, + "1261": { + "name": "简", + "item_type": "代理人", + "rank_type": 4 + }, + "1131": { + "name": "苍角", + "item_type": "代理人", + "rank_type": 3 + }, + "1201": { + "name": "悠真", + "item_type": "代理人", + "rank_type": null + }, + "1081": { + "name": "比利", + "item_type": "代理人", + "rank_type": 3 + }, + "1181": { + "name": "格莉丝", + "item_type": "代理人", + "rank_type": 4 + }, + "2011": { + "name": "哲", + "item_type": "代理人", + "rank_type": 2 + }, + "1011": { + "name": "安比", + "item_type": "代理人", + "rank_type": 3 + }, + "1071": { + "name": "...", + "item_type": "代理人", + "rank_type": null + }, + "2021": { + "name": "铃", + "item_type": "代理人", + "rank_type": 2 + }, + "1031": { + "name": "妮可", + "item_type": "代理人", + "rank_type": 3 + }, + "1281": { + "name": "派派", + "item_type": "代理人", + "rank_type": 3 + }, + "1021": { + "name": "猫又", + "item_type": "代理人", + "rank_type": 4 + }, + "1241": { + "name": "朱鸢", + "item_type": "代理人", + "rank_type": 4 + }, + "1141": { + "name": "莱卡恩", + "item_type": "代理人", + "rank_type": 4 + }, + "1161": { + "name": "莱特", + "item_type": "代理人", + "rank_type": null + }, + "1111": { + "name": "安东", + "item_type": "代理人", + "rank_type": 3 + }, + "1041": { + "name": "「11号」", + "item_type": "代理人", + "rank_type": 4 + }, + "1091": { + "name": "雅", + "item_type": "代理人", + "rank_type": null + }, + "1121": { + "name": "本", + "item_type": "代理人", + "rank_type": 3 + }, + "1211": { + "name": "丽娜", + "item_type": "代理人", + "rank_type": 4 + }, + "1151": { + "name": "露西", + "item_type": "代理人", + "rank_type": 3 + }, + "1101": { + "name": "珂蕾妲", + "item_type": "代理人", + "rank_type": 4 + }, + "1221": { + "name": "柳", + "item_type": "代理人", + "rank_type": null + }, + "1271": { + "name": "赛斯", + "item_type": "代理人", + "rank_type": 3 + }, + "1171": { + "name": "...", + "item_type": "代理人", + "rank_type": null + }, + "1191": { + "name": "艾莲", + "item_type": "代理人", + "rank_type": 4 + } + }, + "zh-tw": { + "13108": { + "name": "仿製星徽引擎", + "item_type": "音擎", + "rank_type": 3 + }, + "14104": { + "name": "硫磺石", + "item_type": "音擎", + "rank_type": 4 + }, + "12009": { + "name": "「湍流」-斧型", + "item_type": "音擎", + "rank_type": 2 + }, + "13103": { + "name": "聚寶箱", + "item_type": "音擎", + "rank_type": 3 + }, + "13002": { + "name": "時光切片", + "item_type": "音擎", + "rank_type": 3 + }, + "13113": { + "name": "含羞惡面", + "item_type": "音擎", + "rank_type": 3 + }, + "12003": { + "name": "「月相」-朔", + "item_type": "音擎", + "rank_type": 2 + }, + "12002": { + "name": "「月相」-晦", + "item_type": "音擎", + "rank_type": 2 + }, + "13008": { + "name": "雙生泣星", + "item_type": "音擎", + "rank_type": 3 + }, + "14001": { + "name": "加農轉子", + "item_type": "音擎", + "rank_type": 3 + }, + "13003": { + "name": "雨林饕客", + "item_type": "音擎", + "rank_type": 3 + }, + "13010": { + "name": "兔能環", + "item_type": "音擎", + "rank_type": 3 + }, + "13011": { + "name": "春日融融", + "item_type": "音擎", + "rank_type": 3 + }, + "14102": { + "name": "鋼鐵肉墊", + "item_type": "音擎", + "rank_type": 4 + }, + "14114": { + "name": "拘縛者", + "item_type": "音擎", + "rank_type": 4 + }, + "14118": { + "name": "嵌合編譯器", + "item_type": "音擎", + "rank_type": 4 + }, + "12011": { + "name": "「電磁暴」-貳式", + "item_type": "音擎", + "rank_type": 2 + }, + "13007": { + "name": "正版變身器", + "item_type": "音擎", + "rank_type": 3 + }, + "12005": { + "name": "「殘響」-Ⅱ型", + "item_type": "音擎", + "rank_type": 2 + }, + "13112": { + "name": "比格氣缸", + "item_type": "音擎", + "rank_type": 3 + }, + "12007": { + "name": "「湍流」-銃型", + "item_type": "音擎", + "rank_type": 2 + }, + "14119": { + "name": "深海訪客", + "item_type": "音擎", + "rank_type": 4 + }, + "14124": { + "name": "防暴者Ⅵ型", + "item_type": "音擎", + "rank_type": 4 + }, + "13101": { + "name": "德瑪拉電池Ⅱ型", + "item_type": "音擎", + "rank_type": 3 + }, + "14110": { + "name": "燃獄齒輪", + "item_type": "音擎", + "rank_type": 4 + }, + "12013": { + "name": "「恆等式」-本格", + "item_type": "音擎", + "rank_type": 2 + }, + "12006": { + "name": "「殘響」-Ⅲ型", + "item_type": "音擎", + "rank_type": 2 + }, + "13004": { + "name": "星徽引擎", + "item_type": "音擎", + "rank_type": 3 + }, + "12014": { + "name": "「恆等式」-變格", + "item_type": "音擎", + "rank_type": 2 + }, + "13005": { + "name": "人爲刀俎", + "item_type": "音擎", + "rank_type": 3 + }, + "13127": { + "name": "維序者-特化型", + "item_type": "音擎", + "rank_type": 3 + }, + "13111": { + "name": "旋鑽機-赤軸", + "item_type": "音擎", + "rank_type": 3 + }, + "14121": { + "name": "啜泣搖籃", + "item_type": "音擎", + "rank_type": 4 + }, + "12010": { + "name": "「電磁暴」-壹式", + "item_type": "音擎", + "rank_type": 2 + }, + "13115": { + "name": "好鬥的阿炮", + "item_type": "音擎", + "rank_type": 3 + }, + "13009": { + "name": "觸電脣彩", + "item_type": "音擎", + "rank_type": 3 + }, + "13013": { + "name": "鳶尾祕藏", + "item_type": "音擎", + "rank_type": 3 + }, + "12004": { + "name": "「殘響」-Ⅰ型", + "item_type": "音擎", + "rank_type": 2 + }, + "14126": { + "name": "淬鋒鉗刺", + "item_type": "音擎", + "rank_type": 4 + }, + "12008": { + "name": "「湍流」-矢型", + "item_type": "音擎", + "rank_type": 2 + }, + "12001": { + "name": "「月相」-望", + "item_type": "音擎", + "rank_type": 2 + }, + "13106": { + "name": "家政員", + "item_type": "音擎", + "rank_type": 3 + }, + "14002": { + "name": "逍遙遊球", + "item_type": "音擎", + "rank_type": 3 + }, + "14125": { + "name": "玉壺青冰", + "item_type": "音擎", + "rank_type": 4 + }, + "13001": { + "name": "街頭巨星", + "item_type": "音擎", + "rank_type": 3 + }, + "13006": { + "name": "貴重骨核", + "item_type": "音擎", + "rank_type": 3 + }, + "12012": { + "name": "「電磁暴」-叄式", + "item_type": "音擎", + "rank_type": 2 + }, + "14003": { + "name": "左輪轉子", + "item_type": "音擎", + "rank_type": 3 + }, + "13128": { + "name": "轟鳴座駕", + "item_type": "音擎", + "rank_type": 3 + }, + "1061": { + "name": "可琳", + "item_type": "代理人", + "rank_type": 3 + }, + "1251": { + "name": "青衣", + "item_type": "代理人", + "rank_type": 4 + }, + "1261": { + "name": "簡", + "item_type": "代理人", + "rank_type": 4 + }, + "1131": { + "name": "蒼角", + "item_type": "代理人", + "rank_type": 3 + }, + "1201": { + "name": "悠真", + "item_type": "代理人", + "rank_type": null + }, + "1081": { + "name": "比利", + "item_type": "代理人", + "rank_type": 3 + }, + "1181": { + "name": "格莉絲", + "item_type": "代理人", + "rank_type": 4 + }, + "2011": { + "name": "哲", + "item_type": "代理人", + "rank_type": 2 + }, + "1011": { + "name": "安比", + "item_type": "代理人", + "rank_type": 3 + }, + "1071": { + "name": "...", + "item_type": "代理人", + "rank_type": null + }, + "2021": { + "name": "鈴", + "item_type": "代理人", + "rank_type": 2 + }, + "1031": { + "name": "妮可", + "item_type": "代理人", + "rank_type": 3 + }, + "1281": { + "name": "派派", + "item_type": "代理人", + "rank_type": 3 + }, + "1021": { + "name": "貓又", + "item_type": "代理人", + "rank_type": 4 + }, + "1241": { + "name": "朱鳶", + "item_type": "代理人", + "rank_type": 4 + }, + "1141": { + "name": "萊卡恩", + "item_type": "代理人", + "rank_type": 4 + }, + "1161": { + "name": "萊特", + "item_type": "代理人", + "rank_type": null + }, + "1111": { + "name": "安東", + "item_type": "代理人", + "rank_type": 3 + }, + "1041": { + "name": "「11號」", + "item_type": "代理人", + "rank_type": 4 + }, + "1091": { + "name": "雅", + "item_type": "代理人", + "rank_type": null + }, + "1121": { + "name": "本", + "item_type": "代理人", + "rank_type": 3 + }, + "1211": { + "name": "麗娜", + "item_type": "代理人", + "rank_type": 4 + }, + "1151": { + "name": "露西", + "item_type": "代理人", + "rank_type": 3 + }, + "1101": { + "name": "珂蕾妲", + "item_type": "代理人", + "rank_type": 4 + }, + "1221": { + "name": "柳", + "item_type": "代理人", + "rank_type": null + }, + "1271": { + "name": "賽斯", + "item_type": "代理人", + "rank_type": 3 + }, + "1171": { + "name": "...", + "item_type": "代理人", + "rank_type": null + }, + "1191": { + "name": "艾蓮", + "item_type": "代理人", + "rank_type": 4 + } + }, + "en-us": { + "13108": { + "name": "Starlight Engine Replica", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14104": { + "name": "The Brimstone", + "item_type": "W-Engines", + "rank_type": 4 + }, + "12009": { + "name": "[Vortex] Hatchet", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13103": { + "name": "The Vault", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13002": { + "name": "Slice of Time", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13113": { + "name": "Bashful Demon", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12003": { + "name": "[Lunar] Noviluna", + "item_type": "W-Engines", + "rank_type": 2 + }, + "12002": { + "name": "[Lunar] Decrescent", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13008": { + "name": "Weeping Gemini", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14001": { + "name": "Cannon Rotor", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13003": { + "name": "Rainforest Gourmet", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13010": { + "name": "Bunny Band", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13011": { + "name": "Spring Embrace", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14102": { + "name": "Steel Cushion", + "item_type": "W-Engines", + "rank_type": 4 + }, + "14114": { + "name": "The Restrained", + "item_type": "W-Engines", + "rank_type": 4 + }, + "14118": { + "name": "Fusion Compiler", + "item_type": "W-Engines", + "rank_type": 4 + }, + "12011": { + "name": "[Magnetic Storm] Bravo", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13007": { + "name": "Original Transmorpher", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12005": { + "name": "[Reverb] Mark II", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13112": { + "name": "Big Cylinder", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12007": { + "name": "[Vortex] Revolver", + "item_type": "W-Engines", + "rank_type": 2 + }, + "14119": { + "name": "Deep Sea Visitor", + "item_type": "W-Engines", + "rank_type": 4 + }, + "14124": { + "name": "Riot Suppressor Mark VI", + "item_type": "W-Engines", + "rank_type": 4 + }, + "13101": { + "name": "Demara Battery Mark II", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14110": { + "name": "Hellfire Gears", + "item_type": "W-Engines", + "rank_type": 4 + }, + "12013": { + "name": "[Identity] Base", + "item_type": "W-Engines", + "rank_type": 2 + }, + "12006": { + "name": "[Reverb] Mark III", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13004": { + "name": "Starlight Engine", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12014": { + "name": "[Identity] Inflection", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13005": { + "name": "Steam Oven", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13127": { + "name": "Item_Weapon_A_1271_Name", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13111": { + "name": "Drill Rig - Red Axis", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14121": { + "name": "Weeping Cradle", + "item_type": "W-Engines", + "rank_type": 4 + }, + "12010": { + "name": "[Magnetic Storm] Alpha", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13115": { + "name": "Kaboom the Cannon", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13009": { + "name": "Electro-Lip Gloss", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13013": { + "name": "...", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12004": { + "name": "[Reverb] Mark I", + "item_type": "W-Engines", + "rank_type": 2 + }, + "14126": { + "name": "Item_Weapon_S_1261_Name", + "item_type": "W-Engines", + "rank_type": 4 + }, + "12008": { + "name": "[Vortex] Arrow", + "item_type": "W-Engines", + "rank_type": 2 + }, + "12001": { + "name": "[Lunar] Pleniluna", + "item_type": "W-Engines", + "rank_type": 2 + }, + "13106": { + "name": "Housekeeper", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14002": { + "name": "Unfettered Game Ball", + "item_type": "W-Engines", + "rank_type": 3 + }, + "14125": { + "name": "Item_Weapon_S_1251_Name", + "item_type": "W-Engines", + "rank_type": 4 + }, + "13001": { + "name": "Street Superstar", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13006": { + "name": "Precious Fossilized Core", + "item_type": "W-Engines", + "rank_type": 3 + }, + "12012": { + "name": "[Magnetic Storm] Charlie", + "item_type": "W-Engines", + "rank_type": 2 + }, + "14003": { + "name": "Six Shooter", + "item_type": "W-Engines", + "rank_type": 3 + }, + "13128": { + "name": "Roaring Ride", + "item_type": "W-Engines", + "rank_type": 3 + }, + "1061": { + "name": "Corin", + "item_type": "Agents", + "rank_type": 3 + }, + "1251": { + "name": "Qingyi", + "item_type": "Agents", + "rank_type": 4 + }, + "1261": { + "name": "...", + "item_type": "Agents", + "rank_type": 4 + }, + "1131": { + "name": "Soukaku", + "item_type": "Agents", + "rank_type": 3 + }, + "1201": { + "name": "Harumasa", + "item_type": "Agents", + "rank_type": null + }, + "1081": { + "name": "Billy", + "item_type": "Agents", + "rank_type": 3 + }, + "1181": { + "name": "Grace", + "item_type": "Agents", + "rank_type": 4 + }, + "2011": { + "name": "Wise", + "item_type": "Agents", + "rank_type": 2 + }, + "1011": { + "name": "Anby", + "item_type": "Agents", + "rank_type": 3 + }, + "1071": { + "name": "...", + "item_type": "Agents", + "rank_type": null + }, + "2021": { + "name": "Belle", + "item_type": "Agents", + "rank_type": 2 + }, + "1031": { + "name": "Nicole", + "item_type": "Agents", + "rank_type": 3 + }, + "1281": { + "name": "Piper", + "item_type": "Agents", + "rank_type": 3 + }, + "1021": { + "name": "Nekomata", + "item_type": "Agents", + "rank_type": 4 + }, + "1241": { + "name": "Zhu Yuan", + "item_type": "Agents", + "rank_type": 4 + }, + "1141": { + "name": "Lycaon", + "item_type": "Agents", + "rank_type": 4 + }, + "1161": { + "name": "Lighter", + "item_type": "Agents", + "rank_type": null + }, + "1111": { + "name": "Anton", + "item_type": "Agents", + "rank_type": 3 + }, + "1041": { + "name": "Soldier 11", + "item_type": "Agents", + "rank_type": 4 + }, + "1091": { + "name": "Miyabi", + "item_type": "Agents", + "rank_type": null + }, + "1121": { + "name": "Ben", + "item_type": "Agents", + "rank_type": 3 + }, + "1211": { + "name": "Rina", + "item_type": "Agents", + "rank_type": 4 + }, + "1151": { + "name": "Lucy", + "item_type": "Agents", + "rank_type": 3 + }, + "1101": { + "name": "Koleda", + "item_type": "Agents", + "rank_type": 4 + }, + "1221": { + "name": "Yanagi", + "item_type": "Agents", + "rank_type": null + }, + "1271": { + "name": "Seth", + "item_type": "Agents", + "rank_type": 3 + }, + "1171": { + "name": "...", + "item_type": "Agents", + "rank_type": null + }, + "1191": { + "name": "Ellen", + "item_type": "Agents", + "rank_type": 4 + } + }, + "ja-jp": { + "13108": { + "name": "なんちゃってスターライトエンジン", + "item_type": "音動機", + "rank_type": 3 + }, + "14104": { + "name": "ブリムストーン", + "item_type": "音動機", + "rank_type": 4 + }, + "12009": { + "name": "「激流」-斧型", + "item_type": "音動機", + "rank_type": 2 + }, + "13103": { + "name": "ザ・ボールト", + "item_type": "音動機", + "rank_type": 3 + }, + "13002": { + "name": "歳月の薄片", + "item_type": "音動機", + "rank_type": 3 + }, + "13113": { + "name": "恥じらう悪面", + "item_type": "音動機", + "rank_type": 3 + }, + "12003": { + "name": "「月相」-朔", + "item_type": "音動機", + "rank_type": 2 + }, + "12002": { + "name": "「月相」-晦", + "item_type": "音動機", + "rank_type": 2 + }, + "13008": { + "name": "双生の涙", + "item_type": "音動機", + "rank_type": 3 + }, + "14001": { + "name": "キャノンローラー", + "item_type": "音動機", + "rank_type": 3 + }, + "13003": { + "name": "密林の食いしん坊", + "item_type": "音動機", + "rank_type": 3 + }, + "13010": { + "name": "ラビットチャージャー", + "item_type": "音動機", + "rank_type": 3 + }, + "13011": { + "name": "ホットスプリング", + "item_type": "音動機", + "rank_type": 3 + }, + "14102": { + "name": "鋼の肉球", + "item_type": "音動機", + "rank_type": 4 + }, + "14114": { + "name": "拘縛されし者", + "item_type": "音動機", + "rank_type": 4 + }, + "14118": { + "name": "複合コンパイラ", + "item_type": "音動機", + "rank_type": 4 + }, + "12011": { + "name": "「磁気嵐」-弐式", + "item_type": "音動機", + "rank_type": 2 + }, + "13007": { + "name": "正規版変身装置", + "item_type": "音動機", + "rank_type": 3 + }, + "12005": { + "name": "「残響」-Ⅱ型", + "item_type": "音動機", + "rank_type": 2 + }, + "13112": { + "name": "ビガー・シリンダー", + "item_type": "音動機", + "rank_type": 3 + }, + "12007": { + "name": "「激流」-銃型", + "item_type": "音動機", + "rank_type": 2 + }, + "14119": { + "name": "ディープシー・ビジター", + "item_type": "音動機", + "rank_type": 4 + }, + "14124": { + "name": "サプレッサーⅥ型", + "item_type": "音動機", + "rank_type": 4 + }, + "13101": { + "name": "デマラ式電池Ⅱ型", + "item_type": "音動機", + "rank_type": 3 + }, + "14110": { + "name": "燃獄ギア", + "item_type": "音動機", + "rank_type": 4 + }, + "12013": { + "name": "「恒等式」-本格", + "item_type": "音動機", + "rank_type": 2 + }, + "12006": { + "name": "「残響」-Ⅲ型", + "item_type": "音動機", + "rank_type": 2 + }, + "13004": { + "name": "スターライトエンジン", + "item_type": "音動機", + "rank_type": 3 + }, + "12014": { + "name": "「恒等式」-変格", + "item_type": "音動機", + "rank_type": 2 + }, + "13005": { + "name": "まな板の鯉", + "item_type": "音動機", + "rank_type": 3 + }, + "13127": { + "name": "Item_Weapon_A_1271_Name", + "item_type": "音動機", + "rank_type": 3 + }, + "13111": { + "name": "ドリルリグ-レッドシャフト", + "item_type": "音動機", + "rank_type": 3 + }, + "14121": { + "name": "啜り泣くゆりかご", + "item_type": "音動機", + "rank_type": 4 + }, + "12010": { + "name": "「磁気嵐」-壱式", + "item_type": "音動機", + "rank_type": 2 + }, + "13115": { + "name": "喧嘩腰のボンバルダム", + "item_type": "音動機", + "rank_type": 3 + }, + "13009": { + "name": "電撃リップグロス", + "item_type": "音動機", + "rank_type": 3 + }, + "13013": { + "name": "...", + "item_type": "音動機", + "rank_type": 3 + }, + "12004": { + "name": "「残響」-Ⅰ型", + "item_type": "音動機", + "rank_type": 2 + }, + "14126": { + "name": "Item_Weapon_S_1261_Name", + "item_type": "音動機", + "rank_type": 4 + }, + "12008": { + "name": "「激流」-矢型", + "item_type": "音動機", + "rank_type": 2 + }, + "12001": { + "name": "「月相」-望", + "item_type": "音動機", + "rank_type": 2 + }, + "13106": { + "name": "ハウスキーパー", + "item_type": "音動機", + "rank_type": 3 + }, + "14002": { + "name": "ゲームボール", + "item_type": "音動機", + "rank_type": 3 + }, + "14125": { + "name": "Item_Weapon_S_1251_Name", + "item_type": "音動機", + "rank_type": 4 + }, + "13001": { + "name": "ストリートスター", + "item_type": "音動機", + "rank_type": 3 + }, + "13006": { + "name": "貴重な石化コア", + "item_type": "音動機", + "rank_type": 3 + }, + "12012": { + "name": "「磁気嵐」-参式", + "item_type": "音動機", + "rank_type": 2 + }, + "14003": { + "name": "シックスシューター", + "item_type": "音動機", + "rank_type": 3 + }, + "13128": { + "name": "グロウル・マイ・カー", + "item_type": "音動機", + "rank_type": 3 + }, + "1061": { + "name": "カリン", + "item_type": "エージェント", + "rank_type": 3 + }, + "1251": { + "name": "青衣", + "item_type": "エージェント", + "rank_type": 4 + }, + "1261": { + "name": "...", + "item_type": "エージェント", + "rank_type": 4 + }, + "1131": { + "name": "蒼角", + "item_type": "エージェント", + "rank_type": 3 + }, + "1201": { + "name": "悠真", + "item_type": "エージェント", + "rank_type": null + }, + "1081": { + "name": "ビリー", + "item_type": "エージェント", + "rank_type": 3 + }, + "1181": { + "name": "グレース", + "item_type": "エージェント", + "rank_type": 4 + }, + "2011": { + "name": "アキラ", + "item_type": "エージェント", + "rank_type": 2 + }, + "1011": { + "name": "アンビー", + "item_type": "エージェント", + "rank_type": 3 + }, + "1071": { + "name": "...", + "item_type": "エージェント", + "rank_type": null + }, + "2021": { + "name": "リン", + "item_type": "エージェント", + "rank_type": 2 + }, + "1031": { + "name": "ニコ", + "item_type": "エージェント", + "rank_type": 3 + }, + "1281": { + "name": "パイパー", + "item_type": "エージェント", + "rank_type": 3 + }, + "1021": { + "name": "猫又", + "item_type": "エージェント", + "rank_type": 4 + }, + "1241": { + "name": "朱鳶", + "item_type": "エージェント", + "rank_type": 4 + }, + "1141": { + "name": "ライカン", + "item_type": "エージェント", + "rank_type": 4 + }, + "1161": { + "name": "ライト", + "item_type": "エージェント", + "rank_type": null + }, + "1111": { + "name": "アンドー", + "item_type": "エージェント", + "rank_type": 3 + }, + "1041": { + "name": "「11号」", + "item_type": "エージェント", + "rank_type": 4 + }, + "1091": { + "name": "雅", + "item_type": "エージェント", + "rank_type": null + }, + "1121": { + "name": "ベン", + "item_type": "エージェント", + "rank_type": 3 + }, + "1211": { + "name": "リナ", + "item_type": "エージェント", + "rank_type": 4 + }, + "1151": { + "name": "ルーシー", + "item_type": "エージェント", + "rank_type": 3 + }, + "1101": { + "name": "クレタ", + "item_type": "エージェント", + "rank_type": 4 + }, + "1221": { + "name": "柳", + "item_type": "エージェント", + "rank_type": null + }, + "1271": { + "name": "セス", + "item_type": "エージェント", + "rank_type": 3 + }, + "1171": { + "name": "...", + "item_type": "エージェント", + "rank_type": null + }, + "1191": { + "name": "エレン", + "item_type": "エージェント", + "rank_type": 4 + } + }, + "ko-kr": { + "13108": { + "name": "별빛 엔진 레플리카", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14104": { + "name": "유황석", + "item_type": "W-엔진", + "rank_type": 4 + }, + "12009": { + "name": "「급류」-도끼", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13103": { + "name": "보물함", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13002": { + "name": "시간의 파편", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13113": { + "name": "수줍은 악마", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12003": { + "name": "「루나」-초승달", + "item_type": "W-엔진", + "rank_type": 2 + }, + "12002": { + "name": "「루나」-그믐달", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13008": { + "name": "쌍둥이의 눈물", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14001": { + "name": "캐논 로터", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13003": { + "name": "우림의 식객", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13010": { + "name": "버니 밴드", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13011": { + "name": "봄날의 포옹", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14102": { + "name": "스틸 쿠션", + "item_type": "W-엔진", + "rank_type": 4 + }, + "14114": { + "name": "구속된 자", + "item_type": "W-엔진", + "rank_type": 4 + }, + "14118": { + "name": "감입 컴파일러", + "item_type": "W-엔진", + "rank_type": 4 + }, + "12011": { + "name": "「자기 폭풍」-브라보", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13007": { + "name": "오리지널 변신 아이템", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12005": { + "name": "「잔향」-Ⅱ형", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13112": { + "name": "빅 실린더", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12007": { + "name": "「급류」-총", + "item_type": "W-엔진", + "rank_type": 2 + }, + "14119": { + "name": "심해 방문객", + "item_type": "W-엔진", + "rank_type": 4 + }, + "14124": { + "name": "서프레서 Ⅵ형", + "item_type": "W-엔진", + "rank_type": 4 + }, + "13101": { + "name": "데마라 배터리 Ⅱ형", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14110": { + "name": "헬파이어 기어", + "item_type": "W-엔진", + "rank_type": 4 + }, + "12013": { + "name": "「아이덴티티」-베이스", + "item_type": "W-엔진", + "rank_type": 2 + }, + "12006": { + "name": "「잔향」-Ⅲ형", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13004": { + "name": "별빛 엔진", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12014": { + "name": "「아이덴티티」-인플렉션", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13005": { + "name": "스팀오븐", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13127": { + "name": "Item_Weapon_A_1271_Name", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13111": { + "name": "굴착기-붉은 축", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14121": { + "name": "흐느끼는 요람", + "item_type": "W-엔진", + "rank_type": 4 + }, + "12010": { + "name": "「자기 폭풍」-알파", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13115": { + "name": "용맹한 꽝꽝이", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13009": { + "name": "감전 립글로스", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13013": { + "name": "...", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12004": { + "name": "「잔향」-Ⅰ형", + "item_type": "W-엔진", + "rank_type": 2 + }, + "14126": { + "name": "Item_Weapon_S_1261_Name", + "item_type": "W-엔진", + "rank_type": 4 + }, + "12008": { + "name": "「급류」-화살", + "item_type": "W-엔진", + "rank_type": 2 + }, + "12001": { + "name": "「루나」-보름달", + "item_type": "W-엔진", + "rank_type": 2 + }, + "13106": { + "name": "하우스키퍼", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14002": { + "name": "내 맘대로 게임 볼", + "item_type": "W-엔진", + "rank_type": 3 + }, + "14125": { + "name": "Item_Weapon_S_1251_Name", + "item_type": "W-엔진", + "rank_type": 4 + }, + "13001": { + "name": "거리의 슈퍼스타", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13006": { + "name": "귀중한 화석 코어", + "item_type": "W-엔진", + "rank_type": 3 + }, + "12012": { + "name": "「자기 폭풍」-찰리", + "item_type": "W-엔진", + "rank_type": 2 + }, + "14003": { + "name": "리볼버 로터", + "item_type": "W-엔진", + "rank_type": 3 + }, + "13128": { + "name": "뛰뛰빵빵", + "item_type": "W-엔진", + "rank_type": 3 + }, + "1061": { + "name": "코린", + "item_type": "에이전트", + "rank_type": 3 + }, + "1251": { + "name": "청의", + "item_type": "에이전트", + "rank_type": 4 + }, + "1261": { + "name": "...", + "item_type": "에이전트", + "rank_type": 4 + }, + "1131": { + "name": "소우카쿠", + "item_type": "에이전트", + "rank_type": 3 + }, + "1201": { + "name": "하루마사", + "item_type": "에이전트", + "rank_type": null + }, + "1081": { + "name": "빌리", + "item_type": "에이전트", + "rank_type": 3 + }, + "1181": { + "name": "그레이스", + "item_type": "에이전트", + "rank_type": 4 + }, + "2011": { + "name": "와이즈", + "item_type": "에이전트", + "rank_type": 2 + }, + "1011": { + "name": "엔비", + "item_type": "에이전트", + "rank_type": 3 + }, + "1071": { + "name": "...", + "item_type": "에이전트", + "rank_type": null + }, + "2021": { + "name": "벨", + "item_type": "에이전트", + "rank_type": 2 + }, + "1031": { + "name": "니콜", + "item_type": "에이전트", + "rank_type": 3 + }, + "1281": { + "name": "파이퍼", + "item_type": "에이전트", + "rank_type": 3 + }, + "1021": { + "name": "네코마타", + "item_type": "에이전트", + "rank_type": 4 + }, + "1241": { + "name": "주연", + "item_type": "에이전트", + "rank_type": 4 + }, + "1141": { + "name": "리카온", + "item_type": "에이전트", + "rank_type": 4 + }, + "1161": { + "name": "라이터", + "item_type": "에이전트", + "rank_type": null + }, + "1111": { + "name": "앤톤", + "item_type": "에이전트", + "rank_type": 3 + }, + "1041": { + "name": "「11호」", + "item_type": "에이전트", + "rank_type": 4 + }, + "1091": { + "name": "미야비", + "item_type": "에이전트", + "rank_type": null + }, + "1121": { + "name": "벤", + "item_type": "에이전트", + "rank_type": 3 + }, + "1211": { + "name": "리나", + "item_type": "에이전트", + "rank_type": 4 + }, + "1151": { + "name": "루시", + "item_type": "에이전트", + "rank_type": 3 + }, + "1101": { + "name": "콜레다", + "item_type": "에이전트", + "rank_type": 4 + }, + "1221": { + "name": "야나기", + "item_type": "에이전트", + "rank_type": null + }, + "1271": { + "name": "세스", + "item_type": "에이전트", + "rank_type": 3 + }, + "1171": { + "name": "...", + "item_type": "에이전트", + "rank_type": null + }, + "1191": { + "name": "엘렌", + "item_type": "에이전트", + "rank_type": 4 + } + } +} \ No newline at end of file diff --git a/src/main/UIGFJson.js b/src/main/UIGFJson.js index b19cd13..5b8c7f3 100644 --- a/src/main/UIGFJson.js +++ b/src/main/UIGFJson.js @@ -7,6 +7,7 @@ const { name, version } = require('../../package.json') const i18n = require('./i18n') const { mergeData } = require('./utils/mergeData') const { sendMsg } = require('./utils') +const idJson = require('../idJson.json') const getTimeString = () => { return new Date().toLocaleString('sv').replace(/[- :]/g, '').slice(0, -2) @@ -104,23 +105,35 @@ const importUIGF = async () => { jsonData.nap.forEach(uidData => { const resultTemp = [] const isNew = !Boolean(dataMap.has(uidData.uid)) + let region_time_zone if (!isNew) region_time_zone = dataMap.get(uidData.uid).region_time_zone else region_time_zone = uidData.timezone + let targetLang + if (!isNew) targetLang = dataMap.get(uidData.uid).lang + else targetLang = uidData.lang + if(!idJson[targetLang] && (!uidData.list[0].name || !uidData.list[0].item_type || !uidData.list[0].rank_type)) targetLang = config.lang + + let idTargetLangJson = idJson[targetLang] + uidData.list.forEach(recordEntry => { + let rank_type + if (idTargetLangJson?.[recordEntry.item_id].rank_type) rank_type = String(idTargetLangJson[recordEntry.item_id].rank_type) + else rank_type = recordEntry.rank_type resultTemp.push({ gacha_id: recordEntry.gacha_id, gacha_type: recordEntry.gacha_type, item_id: recordEntry.item_id, - count: recordEntry.count, + count: recordEntry.count ?? "1", time: convertTimeZone(recordEntry.time, uidData.timezone, region_time_zone), - name: recordEntry.name, - item_type: recordEntry.item_type, - rank_type: recordEntry.rank_type, + name: idTargetLangJson?.[recordEntry.item_id].name ?? recordEntry.name, + item_type: idTargetLangJson?.[recordEntry.item_id].item_type ?? recordEntry.item_type, + rank_type: rank_type, id: recordEntry.id }) }) + const resultTempGrouped = resultTemp.reduce((acc, curr) => { if (!acc[curr.gacha_type]) { acc[curr.gacha_type] = [] @@ -133,9 +146,9 @@ const importUIGF = async () => { let data const mergedData = mergeData(dataMap.get(uidData.uid), resultMap) if (isNew) { - data = { result: mergedData, time: Date.now(), uid: uidData.uid, lang: uidData.lang, region_time_zone: uidData.timezone, deleted: false } + data = { result: mergedData, time: Date.now(), uid: uidData.uid, lang: targetLang, region_time_zone: uidData.timezone, deleted: false } } else { - data = { result: mergedData, time: Date.now(), uid: dataMap.get(uidData.uid).uid, lang: dataMap.get(uidData.uid).lang, region_time_zone: dataMap.get(uidData.uid).region_time_zone, deleted: dataMap.get(uidData.uid).deleted } + data = { result: mergedData, time: Date.now(), uid: dataMap.get(uidData.uid).uid, lang: targetLang, region_time_zone: dataMap.get(uidData.uid).region_time_zone, deleted: dataMap.get(uidData.uid).deleted } } saveData(data, '') diff --git a/tools/getIdMap.py b/tools/getIdMap.py new file mode 100644 index 0000000..3525f58 --- /dev/null +++ b/tools/getIdMap.py @@ -0,0 +1,67 @@ +import requests +import json +from opencc import OpenCC + +# 初始化 OpenCC 转换器 +cc = OpenCC('s2t') + +# 获取 JSON 数据 +weapon_url = 'https://api.hakush.in/zzz/data/weapon.json' +character_url = 'https://api.hakush.in/zzz/data/character.json' + +# 语言映射配置 +language_map = { + "zh-cn": "CHS", + "zh-tw": "CHS", # 简体转繁体 + "en-us": "EN", + "ja-jp": "JA", + "ko-kr": "KO" +} + +# 类型映射配置 +type_map = { + "weapon": {"zh-cn": "音擎", "zh-tw": "音擎", "en-us": "W-Engines", "ja-jp": "音動機", "ko-kr": "W-엔진"}, + "character": {"zh-cn": "代理人", "zh-tw": "代理人", "en-us": "Agents", "ja-jp": "エージェント", "ko-kr": "에이전트"} +} + +def fetch_json(url): + response = requests.get(url) + response.raise_for_status() + return response.json() + +def transform_data(data, item_type): + transformed = {lang: {} for lang in language_map.keys()} + for id, item in data.items(): + for lang, key in language_map.items(): + name = item[key] if lang != 'zh-tw' else cc.convert(item['CHS']) + transformed[lang][id] = { + "name": name, + "item_type": type_map[item_type][lang], + "rank_type": item['rank'] + } + return transformed + +def main(): + try: + weapon_data = fetch_json(weapon_url) + character_data = fetch_json(character_url) + + transformed_data = {lang: {} for lang in language_map.keys()} + + weapon_transformed = transform_data(weapon_data, "weapon") + character_transformed = transform_data(character_data, "character") + + for lang in language_map.keys(): + transformed_data[lang].update(weapon_transformed[lang]) + transformed_data[lang].update(character_transformed[lang]) + + with open('./src/idJson.json', 'w', encoding='utf-8') as f: + json.dump(transformed_data, f, ensure_ascii=False, indent=2) + + print("Data successfully transformed and saved") + + except requests.RequestException as e: + print(f"Error fetching data: {e}") + +if __name__ == "__main__": + main() \ No newline at end of file