From 0f098c954067ed3f32204d8a585c12a189b5c0c5 Mon Sep 17 00:00:00 2001 From: Hengyu Date: Sat, 6 Jan 2024 19:10:35 +0800 Subject: [PATCH 1/4] Fix: blessing keyword extraction --- dev_tools/keyword_extract.py | 9 +- tasks/rogue/keywords/blessing.py | 216 +++++++++++++++++++++++++++++++ 2 files changed, 223 insertions(+), 2 deletions(-) diff --git a/dev_tools/keyword_extract.py b/dev_tools/keyword_extract.py index b7fe5892c..ce4d2b572 100644 --- a/dev_tools/keyword_extract.py +++ b/dev_tools/keyword_extract.py @@ -287,7 +287,7 @@ class KeywordExtract: text = replace_templates(text) text = text.replace('1', f'{correct_time}') return text - + last_id = getattr(gen, 'last_id', 0) for index, keyword in enumerate(self.keywords_id): _, old_name = self.find_keyword(keyword, lang='en') @@ -295,7 +295,7 @@ class KeywordExtract: if old_name in old_quest: continue name = old_name.replace('1', str(correct_times.setdefault(old_name, 1))) - + with gen.Object(key=name, object_class=keyword_class): gen.ObjectAttr(key='id', value=index + last_id + 1) gen.ObjectAttr(key='name', value=name) @@ -517,6 +517,11 @@ class KeywordExtract: resonances_id = [deep_get(blessing, '1.MazeBuffID') for blessing in blessings_info.values() if deep_get(blessing, '1.AeonID')] + # ignore endless buffs + endless_buffs = read_file(os.path.join(TextMap.DATA_FOLDER, 'ExcelOutput', 'RogueEndlessMegaBuffDesc.json')) + endless_buff_ids = [int(id_) for id_ in endless_buffs] + blessings_id = [id_ for id_ in blessings_id if id_ not in endless_buff_ids] + def get_blessing_infos(id_list, with_enhancement: bool): blessings_hash = [deep_get(blessings_name_map, f"{blessing_id}.1.BuffName.Hash") for blessing_id in id_list] diff --git a/tasks/rogue/keywords/blessing.py b/tasks/rogue/keywords/blessing.py index 7de0f6eaa..b6decbfff 100644 --- a/tasks/rogue/keywords/blessing.py +++ b/tasks/rogue/keywords/blessing.py @@ -1731,3 +1731,219 @@ Vesicle = RogueBlessing( rarity=1, enhancement='', ) +BCI_34_Gray_Matter = RogueBlessing( + id=145, + name='BCI_34_Gray_Matter', + cn='BCI-34型灰质', + cht='BCI-34型灰質', + en='BCI-34 Gray Matter', + jp='BCI-34型灰白質', + es='Materia gris BCI-34', + path_id=9, + rarity=3, + enhancement='', +) +SMR_2_Amygdala = RogueBlessing( + id=146, + name='SMR_2_Amygdala', + cn='SMR-2型杏仁核', + cht='SMR-2型杏仁核', + en='SMR-2 Amygdala', + jp='SMR-2型扁桃体', + es='Amígdala SMR-2', + path_id=9, + rarity=3, + enhancement='', +) +VEP_18_Occipital_Lobe = RogueBlessing( + id=147, + name='VEP_18_Occipital_Lobe', + cn='VEP-18型枕叶', + cht='VEP-18型枕葉', + en='VEP-18 Occipital Lobe', + jp='VEP-18型後頭葉', + es='Lóbulo occipital VEP-18', + path_id=9, + rarity=3, + enhancement='', +) +Attachment_Vestibular_System = RogueBlessing( + id=148, + name='Attachment_Vestibular_System', + cn='附加:前庭系统', + cht='附加:前庭系統', + en='Attachment: Vestibular System', + jp='付加:前庭器官', + es='Adjunto: Sistema vestibular', + path_id=9, + rarity=2, + enhancement='', +) +Imitation_Transmitter_Synthesis = RogueBlessing( + id=149, + name='Imitation_Transmitter_Synthesis', + cn='模仿:递质合成', + cht='模仿:遞質合成', + en='Imitation: Transmitter Synthesis', + jp='模倣:神経伝達物質合成', + es='Imitación: Síntesis del transmisor', + path_id=9, + rarity=2, + enhancement='', +) +Implant_Explicit_Memory = RogueBlessing( + id=150, + name='Implant_Explicit_Memory', + cn='植入:外显记忆', + cht='植入:外顯記憶', + en='Implant: Explicit Memory', + jp='インプラント:顕在的記憶', + es='Implante: Recuerdo explícito', + path_id=9, + rarity=2, + enhancement='', +) +Mimesis_Tactile_Pathway = RogueBlessing( + id=151, + name='Mimesis_Tactile_Pathway', + cn='拟态:触觉通路', + cht='擬態:觸覺通路', + en='Mimesis: Tactile Pathway', + jp='擬態:神経路', + es='Mimetización: Ruta táctil', + path_id=9, + rarity=2, + enhancement='', +) +Analysis_Subliminal_Sensation = RogueBlessing( + id=152, + name='Analysis_Subliminal_Sensation', + cn='分析:阈下知觉', + cht='分析:閾下知覺', + en='Analysis: Subliminal Sensation', + jp='分析:サブリミナル効果', + es='Análisis: Sensación subliminal', + path_id=9, + rarity=2, + enhancement='', +) +Load_Striated_Cortex = RogueBlessing( + id=153, + name='Load_Striated_Cortex', + cn='装载:纹状皮层', + cht='裝載:紋狀皮層', + en='Load: Striated Cortex', + jp='積載:有線皮質', + es='Carga: Corteza estriada', + path_id=9, + rarity=2, + enhancement='', +) +Stimulation_Saltatory_Conduction = RogueBlessing( + id=154, + name='Stimulation_Saltatory_Conduction', + cn='激发:跳跃传导', + cht='激發:跳躍傳導', + en='Stimulation: Saltatory Conduction', + jp='刺激:跳躍伝導', + es='Estimulación: Conducción saltarina', + path_id=9, + rarity=2, + enhancement='', +) +Throne_of_Engaged_Gears = RogueBlessing( + id=155, + name='Throne_of_Engaged_Gears', + cn='齿轮啮合的王座', + cht='齒輪嚙合的王座', + en='Throne of Engaged Gears', + jp='歯車が組合う王座', + es='Trono de engranajes comprometidos', + path_id=9, + rarity=1, + enhancement='', +) +Ring_of_Bent_Wires = RogueBlessing( + id=156, + name='Ring_of_Bent_Wires', + cn='导线弯绕的指环', + cht='導線彎繞的戒指', + en='Ring of Bent Wires', + jp='導線が取り巻く指輪', + es='Anillo de cables doblados', + path_id=9, + rarity=1, + enhancement='', +) +Scepter_of_Energy_Torque = RogueBlessing( + id=157, + name='Scepter_of_Energy_Torque', + cn='能量变矩的权杖', + cht='能量變矩的權杖', + en='Scepter of Energy Torque', + jp='エネルギー渦巻く王笏', + es='Cetro de torsión de energía', + path_id=9, + rarity=1, + enhancement='', +) +Torch_of_Anti_Lag_Ignition = RogueBlessing( + id=158, + name='Torch_of_Anti_Lag_Ignition', + cn='偏时引燃的炬火', + cht='偏時引燃的炬火', + en='Torch of Anti-Lag Ignition', + jp='アンチラグの炬火', + es='Antorcha de encendido demorado', + path_id=9, + rarity=1, + enhancement='', +) +Candle_of_Delayed_Diffraction = RogueBlessing( + id=159, + name='Candle_of_Delayed_Diffraction', + cn='延迟衍射的烛光', + cht='延遲衍射的燭光', + en='Candle of Delayed Diffraction', + jp='遅延回折の燭光', + es='Vela de difracción retardada', + path_id=9, + rarity=1, + enhancement='', +) +Canopy_of_Mottled_Metal = RogueBlessing( + id=160, + name='Canopy_of_Mottled_Metal', + cn='金属斑驳的华盖', + cht='金屬斑駁的華蓋', + en='Canopy of Mottled Metal', + jp='古びた金属の華蓋', + es='Dosel de metal jaspeado', + path_id=9, + rarity=1, + enhancement='', +) +Garment_of_Coiled_Wires = RogueBlessing( + id=161, + name='Garment_of_Coiled_Wires', + cn='线圈编织的罗绮', + cht='線圈編織的羅綺', + en='Garment of Coiled Wires', + jp='コイルが織りなす装束', + es='Vestimenta de cables enrollados', + path_id=9, + rarity=1, + enhancement='', +) +Wreath_of_Interlaced_Pipes = RogueBlessing( + id=162, + name='Wreath_of_Interlaced_Pipes', + cn='管道交错的桂冠', + cht='管道交錯的桂冠', + en='Wreath of Interlaced Pipes', + jp='交錯するパイプの冠', + es='Corona de tuberías entrelazadas', + path_id=9, + rarity=1, + enhancement='', +) From 49e7ff4762642c6f0e32e100e36948e01943d0b5 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:40:27 +0800 Subject: [PATCH 2/4] Fix: LF endings in routes.json --- dev_tools/route_extract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_tools/route_extract.py b/dev_tools/route_extract.py index 485414aa3..cfa1cf5d3 100644 --- a/dev_tools/route_extract.py +++ b/dev_tools/route_extract.py @@ -95,7 +95,7 @@ class RouteExtract: def model_to_json(model, file): content = model.model_dump_json(indent=2) - with open(file, 'w', encoding='utf-8') as f: + with open(file, 'w', encoding='utf-8', newline='') as f: f.write(content) From 3b906ba789fce527fddf3ccb1ff6cbe0578930f4 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sat, 6 Jan 2024 20:49:06 +0800 Subject: [PATCH 3/4] Fix: Non-ASCII characters in Cafe_Self_Deceit --- dev_tools/keyword_extract.py | 1 + tasks/rogue/keywords/blessing.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dev_tools/keyword_extract.py b/dev_tools/keyword_extract.py index ce4d2b572..dd53f1a6a 100644 --- a/dev_tools/keyword_extract.py +++ b/dev_tools/keyword_extract.py @@ -20,6 +20,7 @@ def text_to_variable(text): text = re.sub(r'[(),#"?!&%*]|', '', text) # text = re.sub(r'[#_]?\d+(_times?)?', '', text) text = re.sub(r'', '', text) + text = text.replace('é', 'e') return text.strip('_') diff --git a/tasks/rogue/keywords/blessing.py b/tasks/rogue/keywords/blessing.py index b6decbfff..d97bffd8a 100644 --- a/tasks/rogue/keywords/blessing.py +++ b/tasks/rogue/keywords/blessing.py @@ -483,9 +483,9 @@ Beginning_and_End = RogueBlessing( rarity=2, enhancement='', ) -Café_Self_Deceit = RogueBlessing( +Cafe_Self_Deceit = RogueBlessing( id=41, - name='Café_Self_Deceit', + name='Cafe_Self_Deceit', cn='自欺咖啡馆', cht='自欺咖啡館', en='Café Self-Deceit', From 9cf5515fb9510056694ed8c3285f115dff97b097 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 7 Jan 2024 03:49:01 +0800 Subject: [PATCH 4/4] Fix: [CN] Blessing ocr of Analysis_Subliminal_Sensation --- tasks/rogue/blessing/blessing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/rogue/blessing/blessing.py b/tasks/rogue/blessing/blessing.py index 5f8dc88e0..a83db202f 100644 --- a/tasks/rogue/blessing/blessing.py +++ b/tasks/rogue/blessing/blessing.py @@ -87,6 +87,7 @@ class RogueBuffOcr(Ocr): r".*繁.*": "葳蕤繁祉,延彼遐龄", "回馈底护": "回馈庇护", "[范茫]+白夜": "茫茫白夜", + "阅下": "阈下", } elif self.lang == 'en': replace_pattern_dict = {