Przeglądaj źródła

feat(MetaDemon): summon demon first when fatigue >= 61 (configurable)

Add a new switch md_fatigue_summon_first (default on, configurable from
the config GUI). When enabled and fatigue is between 61 and 100 with no
own demon online, summon a demon BEFORE the existing
own -> shared -> summon judgment chain.

Boundaries kept safe:
- no duplicate summon when a demon is already online
- fatigue > 100 still follows the original buy-tea/exit logic
微凉徒眸 3 dni temu
rodzic
commit
f449cb359e

+ 2 - 0
assets/i18n/zh-CN.json

@@ -72,6 +72,8 @@
   "limit_cultivation_drills_help": "搜寻到一只后会一直打,直到打完算一次",
   "auto_shared_boss": "自动挑战共享鬼王",
   "auto_shared_boss_help": "是否自动挑战其他玩家共享的鬼王",
+  "md_fatigue_summon_first": "疲劳≥61优先召唤鬼王",
+  "md_fatigue_summon_first_help": "开启后,疲劳值达到61及以上且自己没有鬼王在线时,优先召唤鬼王(先于协战鬼王判定);疲劳满后仍按原逻辑买茶/退出",
   "enable_switch_daily_training": "日常训练开启切换御魂",
   "enable_switch_cultivation_drills": "修行合训开启切换御魂",
   "demon_battle_config": "逢魔战斗内切换阵容",

+ 1 - 0
tasks/MetaDemon/config.py

@@ -77,6 +77,7 @@ class MetaDemonConfig(ConfigBase):
     meta_crafting_card: bool = Field(default=True, description='craft_essence_help')
     auto_tea: bool = Field(default=False, description='auto_tea_help')
     auto_shared_boss: bool = Field(default=True, description='auto_shared_boss_help')
+    md_fatigue_summon_first: bool = Field(default=True, description='md_fatigue_summon_first_help')
     # extreme_notify: bool = Field(default=False, description='extreme_notify_help')
     md_strategy_count: int = Field(default=0, ge=0, description='md_strategy_count_help')
     md_use_strategy: bool = Field(default=False, description='md_use_strategy_help')

+ 9 - 0
tasks/MetaDemon/script_task.py

@@ -113,6 +113,15 @@ class ScriptTask(RightActivity, Battle, GeneralBattle, SwitchSoul, Star56):
             if not (self.appear(self.I_FIND_DEMON) or self.appear(self.I_BATTLE_DEMON)):
                 continue
 
+            # 疲劳达到阈值时优先召唤鬼王(开关控制,判定先于原有逻辑)
+            if self.config.meta_demon.meta_demon_config.md_fatigue_summon_first:
+                fatigue = self.current_exhaustion()
+                if 61 <= fatigue <= 100 and self.appear(self.I_BOSS_EMPTY):
+                    logger.info('Fatigue >= 61, summon demon first')
+                    if self.find_demon():
+                        boss_timer.reset()
+                        continue
+
             # 先看自己有没有鬼王要打
             if (not self.appear(self.I_BOSS_EMPTY) and
                     (self.appear(self.I_BOSS_CONVENE) or self.appear(self.I_BOOS_PUBLIC))):