Skip to content
Merged

Dev6 #1560

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tasks/DemonEncounter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class DemonConfig(BaseModel):
description="通过预设名称来匹配普通封魔御魂分组\n例如=> 逢魔之时,歌(中间的是英文逗号)",
)
# 周一
demon_kiryou_utahime: str = Field(default="group,team", description="鬼灵歌姬御魂1")
demon_kiryou_utahime_supplementary: str = Field(default="group,team", description="鬼灵歌姬御魂补充")
demon_kiryou_utahime: str = Field(default="group,team", description="鬼灵歌姬御魂")
# 周二
demon_shinkirou: str = Field(default="group,team", description="蜃气楼御魂")
# 周三 土蜘蛛
Expand All @@ -67,17 +66,16 @@ class BestDemonConfig(BaseModel):
default=False,
description="通过预设名称来匹配极封魔御魂分组\n例如=> 逢魔之时,歌(中间的是英文逗号)",
)
best_demon_kiryou_utahime: str = Field(default="group,team", description="极鬼灵歌姬御魂1")
best_demon_kiryou_utahime_supplementary: str = Field(default="group,team", description="极鬼灵歌姬御魂补充")
best_demon_kiryou_utahime: str = Field(default="group,team", description="极鬼灵歌姬御魂")
best_demon_shinkirou: str = Field(default="group,team", description="极蜃气楼御魂")
best_demon_tsuchigumo: str = Field(default="group,team", description="极土蜘蛛御魂")
best_demon_gashadokuro: str = Field(default="group,team", description="极荒骷髅御魂")
best_demon_namazu: str = Field(default="group,team", description="极地震鲇御魂")
best_demon_oboroguruma: str = Field(default="group,team", description="极胧车御魂")
best_demon_nightly_aramitamau: str = Field(default="group,team", description="极夜荒魂御魂")

hide_fields = dynamic_hide('best_demon_kiryou_utahime', 'best_demon_kiryou_utahime_supplementary',
'best_demon_oboroguruma', 'best_demon_nightly_aramitamau')
hide_fields = dynamic_hide('best_demon_kiryou_utahime', 'best_demon_oboroguruma',
'best_demon_nightly_aramitamau')


def convert_to_general_battle_config(boss_type: str, demon_battle_conf: 'DemonBattleConfig' = None,
Expand Down
8 changes: 2 additions & 6 deletions tasks/DemonEncounter/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ def checkout_soul(self):
group, team = getattr(self.conf.demon_soul_config, self.boss_type).split(",")
if group and team:
self.run_switch_soul_by_name(group, team)
if datetime.now().weekday() == 0:
if select_best_demon:
group, team = getattr(self.conf.best_demon_soul_config, f'{self.boss_type}_supplementary').split(",")
else:
group, team = getattr(self.conf.demon_soul_config, f'{self.boss_type}_supplementary').split(",")
self.run_switch_soul_by_name(group, team)
return
logger.error(f'Unknown switch soul conf: group[{group}], team[{team}]')
Comment on lines +68 to +69
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (bug_risk): 移除周一的补充御魂切换逻辑会改变行为;请确认这是有意为之。

此前,当 datetime.now().weekday() == 0 时,代码会进行第二次切换,切到 *_supplementary 御魂(对普通和最佳鬼王都是如此)。现在在第一次 run_switch_soul_by_name 后就直接返回,因此不会再执行补充切换。如果玩家依赖这种“周一双阶段切换”的行为,他们的体验会发生变化。如果这是有意的,则无需改动;否则建议在保留新配置结构的前提下,重新引入周一特有的补充切换逻辑。

Original comment in English

question (bug_risk): Removal of Monday supplementary soul switching changes behavior; confirm this is intended.

Previously, when datetime.now().weekday() == 0, the code did a second switch to a *_supplementary soul (for both normal and best demons). Now it returns after the first run_switch_soul_by_name, so the supplementary switch never occurs. If players depended on this two-stage Monday behavior, their experience will change. If that’s intentional, no action needed; if not, consider reintroducing the Monday-specific supplementary switch while keeping the new config structure.


def execute_boss(self):
"""
Expand Down
3 changes: 1 addition & 2 deletions tasks/SixRealms/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class SixRealmsGate(BaseModel):

class SixRealms(ConfigBase):
scheduler: Scheduler = Field(default_factory=Scheduler)
switch_soul_config_1: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
switch_soul_config_2: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
switch_soul_config: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
six_realms_gate: SixRealmsGate = Field(default_factory=SixRealmsGate)


Expand Down
22 changes: 4 additions & 18 deletions tasks/SixRealms/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,14 @@ def _config(self):
return self.config.model.six_realms

def run(self):
if self._config.switch_soul_config_1.enable:
if self._config.switch_soul_config.enable:
self.ui_get_current_page()
self.ui_goto(page_shikigami_records)
self.run_switch_soul(self._config.switch_soul_config_1.switch_group_team)
if self._config.switch_soul_config_1.enable_switch_by_name:
self.run_switch_soul(self._config.switch_soul_config.switch_group_team)
if self._config.switch_soul_config.enable_switch_by_name:
Comment on lines +34 to +38
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: 考虑在两个标志都启用时避免对 page_shikigami_records 的重复跳转。

合并为单一的 switch_soul_config 之后,当 enableenable_switch_by_name 都为 true 时,这条路径会连续两次调用 ui_get_current_page()ui_goto(page_shikigami_records)。你可以改为只导航一次,然后依次调用 run_switch_soulrun_switch_soul_by_name,以避免多余的 UI 调用并降低潜在的不稳定性。

Original comment in English

suggestion: Consider avoiding double navigation to page_shikigami_records when both flags are enabled.

With the merged switch_soul_config, when both enable and enable_switch_by_name are true, this path calls ui_get_current_page() and ui_goto(page_shikigami_records) twice in succession. You could instead navigate once and then run both run_switch_soul and run_switch_soul_by_name to avoid redundant UI calls and reduce potential flakiness.

self.ui_get_current_page()
self.ui_goto(page_shikigami_records)
self.run_switch_soul_by_name(
self._config.switch_soul_config_1.group_name,
self._config.switch_soul_config_1.team_name
)
if self._config.switch_soul_config_2.enable:
self.ui_get_current_page()
self.ui_goto(page_shikigami_records)
self.run_switch_soul(self._config.switch_soul_config_2.switch_group_team)
if self._config.switch_soul_config_2.enable_switch_by_name:
self.ui_get_current_page()
self.ui_goto(page_shikigami_records)
self.run_switch_soul_by_name(
self._config.switch_soul_config_2.group_name,
self._config.switch_soul_config_2.team_name
)
self.run_switch_soul_by_name(self._config.switch_soul_config.group_name, self._config.switch_soul_config.team_name)
self.ui_get_current_page()
self.ui_goto(page_six_gates)

Expand Down
Loading