Skip to content

Fix: 优化低心情处理与活动困难图编队流程#5759

Open
wan300 wants to merge 3 commits into
LmeSzinc:devfrom
wan300:dev/emotion-control
Open

Fix: 优化低心情处理与活动困难图编队流程#5759
wan300 wants to merge 3 commits into
LmeSzinc:devfrom
wan300:dev/emotion-control

Conversation

@wan300

@wan300 wan300 commented Jun 26, 2026

Copy link
Copy Markdown

概要

这次改动主要优化情绪控制链路,并适配活动困难图中低心情弹窗与推荐编队的处理流程。

主要改动

  • 拆分情绪控制中的“账本计算”和“仅处理弹窗”两类场景,新增 Emotion_PopupOnly / should_track 判定,避免活动困难图等 popup-only 场景误触发心情等待或扣减。
  • 低心情弹窗出现时,在 calculate 模式下改为取消出击、按舰队重置情绪账本、计算恢复时间,并延后当前任务。
  • 战斗入口相关模块同步传递 fleet_index,使 combatraidevent_hospitalgems_farmingauto_search_combatmap 的低心情处理能定位到对应舰队。
  • 为活动困难图和特殊关卡增加 popup-only 适配,处理 event_*ht/c/d 前缀关卡,并在推荐编队流程中处理确认弹窗,避免卡在推荐/确认界面。
  • 增加进图前情绪校准:从船坞扫描指定常规舰队的最低心情,并同步回当前任务的情绪记录,减少脚本账本与游戏实际心情不一致导致的误判。
  • 修正白色取消弹窗处理逻辑,避免 POPUP_CANCEL_WHITE 被误点为 POPUP_CONFIRM_WHITE
  • 补齐部分活动/作战档案关卡名转换列表,保持新活动与归档关卡的命名兼容。

Copilot AI review requested due to automatic review settings June 26, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@EmoryLeo

Copy link
Copy Markdown
Contributor

搞这么复杂可能会出现意想不到的bug

@wan300

wan300 commented Jun 28, 2026

Copy link
Copy Markdown
Author

那我把识别心情那块的去了,只保留低心情弹窗兜底这里的,这样也能解决心情账本出现问题时不会直接卡死退出这个问题#5248

Comment thread module/handler/info_handler.py Outdated
Comment on lines 187 to 203
def handle_combat_low_emotion(self):
if not self.emotion.is_ignore:
def handle_combat_low_emotion(self, fleet_index=None):
if self.emotion.is_ignore:
result = self.handle_popup_confirm('IGNORE_LOW_EMOTION')
if result:
# Avoid clicking AUTO_SEARCH_MAP_OPTION_OFF
self.interval_reset(AUTO_SEARCH_MAP_OPTION_OFF)
return result

if not self.emotion.is_calculate:
return False

result = self.handle_popup_confirm('IGNORE_LOW_EMOTION')
result = self.handle_popup_cancel('LOW_EMOTION_CONTROL')
if result:
# Avoid clicking AUTO_SEARCH_MAP_OPTION_OFF
self.interval_reset(AUTO_SEARCH_MAP_OPTION_OFF)
self.emotion.delay_after_low_emotion(fleet_index=fleet_index)
return result

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

handle 系方法不应该有修改配置文件的行为

Comment thread module/combat/emotion.py
Comment on lines +227 to +240
indexes = self._fleet_indexes(fleet_index=fleet_index)
if len(indexes) > 1:
logger.warning('Unable to identify low-emotion fleet, reset both fleet ledgers')

logger.hr('Emotion control')
self.update()
fleets = [self.fleets[index - 1] for index in indexes]
for fleet in fleets:
fleet.current = max(fleet.limit - 1, 0)
logger.info(f'Reset emotion fleet {fleet.fleet} to {fleet.current}')

self.record()
self.show()
return fleets

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

不是,ai写的代码自己审一下啊,弹低心情就把心情设置为最大,那计算心情的意义是什么呢

设置为0,然后让 Emotion.wait() 在图内等待,然后等到下一场战斗的心情再继续,结束关卡之后等待下一把的预期心情消耗再进图

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

抱歉这个是我记错了,我记成心情40点以下就出现弹窗,所以max(fleet.limit - 1, 0)这设成出现弹窗就默认心情到了39点

@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request / 功能请求 New feature or requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants