Skip to content

Add: GemsFarming hard mode#5598

Open
guoh064 wants to merge 18 commits into
LmeSzinc:devfrom
guoh064:gems_farming_revise
Open

Add: GemsFarming hard mode#5598
guoh064 wants to merge 18 commits into
LmeSzinc:devfrom
guoh064:gems_farming_revise

Conversation

@guoh064

@guoh064 guoh064 commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

优化了GemsFarming类对FleetEquipment的依赖。
添加了紧急委托对困难图模式的支持(比如说EX活动的C2)

Comment thread module/campaign/gems_farming.py
Comment thread module/campaign/gems_farming.py
@guoh064

This comment was marked as off-topic.

@guoh064 guoh064 changed the title Refactor: class GemsFarming Add: GemsFarming hard mode Apr 8, 2026
@guoh064 guoh064 force-pushed the gems_farming_revise branch 4 times, most recently from cfe11ce to 9dd95cb Compare April 15, 2026 16:00
@guoh064 guoh064 force-pushed the gems_farming_revise branch from 9dd95cb to bdd9d36 Compare April 23, 2026 16:19
@guoh064 guoh064 force-pushed the gems_farming_revise branch from 771d781 to a52a330 Compare June 30, 2026 06:11
@guoh064

guoh064 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

已测试event_20260625_cn的活动ht1

@guoh064 guoh064 force-pushed the gems_farming_revise branch from a52a330 to 8f2a802 Compare June 30, 2026 16:21
Comment thread module/equipment/equipment_code.py
Comment on lines +144 to +146
# Disable one other enabled IME at a time
if appear_then_click('(//*[@resource-id="android:id/title" and @text!="FastInputIME"]/following-sibling::*[@resource-id="android:id/switch_widget" and @enabled="true" and @checked="true"])[1]'):
continue

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.

不需要禁用其他输入法吧

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

需要的,mumu12的v5和bluestacks都会出现adb无法直接切换输入法,且fastinputime默认被禁用的问题,需要跑到设置里面去开启fastinputime和关掉其他输入法(我也不想关其他输入法但是光开fastinputime没有用)

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.

image

蓝叠要开这个
通过ui改设置,感觉会有很多适配问题啊

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

不用ui改设置的话感觉没有更好的办法
之前测试的时候,android.settings.INPUT_METHOD_SETTINGS是能直接到达屏幕键盘设置的(我没有Mac设备,但是我记得测了蓝叠5的Pie64,Mumu12的V4和V5,还有雷电9,都可以到达设置屏幕键盘输入法的修改界面来着;
但对于蓝叠用户,用HierarchyButton检测这个“启用屏幕键盘”也不太现实,因为总有人的系统语言环境不是简体中文(可能是千奇百怪的语言);
这个地方如果蓝叠系列有额外的设置的话可能需要后期手动提示一下?

Comment thread module/equipment/equipment_code.py
Comment thread module/equipment/equipment_code.py
Comment on lines +596 to +612
except RequestHumanTakeover as e:
if 'Hard not satisfied' in e.args[0]:
prepared = False
if self.appear(self.fleet_backline_1_button, offset=(20, 20)):
logger.info('Backline is empty, change flagship')
self.flagship_change()
prepared = True
if self.appear(self.fleet_vanguard_1_button, offset=(20, 20)):
logger.info('Vanguard is empty, change vanguard')
self.vanguard_change()
prepared = True
if prepared:
continue
else:
raise e
else:
raise e

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.

用 raise 原样抛出
不在 except 块中执行可能出现二次错误的代码

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这里原来的目的是解决换船和进图之前触发的退役把困难图用的白皮航母给退役掉的问题(因为这个情况只有在退役确认的时候才会出现:
2026-06-26_08-57-52-061661
2026-06-26_08-57-53-066632
如果不处理这个根源问题,接受退役本身可能正好退役掉满级白皮的话,那就需要处理困难图不满足出击条件的异常
而处理这个的方法目前是检测空的按钮后重新编队,理论上重新编队会成功,但是得考虑alas找不到要换上去的后排的可能性(最常见的是船坞过大,7页翻页找不到要保留的指定船只,剩下的白皮轻航本身都是33级以上),因此换船本身是有可能失败的。这里我没想到一个特别好的办法,希望lme也可以支支招

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.

覆写 fleet_preparation,在配对缺失的时候上人
仍然没有角色就推迟任务,寄希望其他任务出击的时候会掉落
增加 class HardNotSatisfied(RequestHumanTakeover) 来避免魔法字符串传递

Comment thread module/campaign/gems_farming.py Outdated
Comment thread module/equipment/equipment_code.py Outdated
@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label Jul 1, 2026
@guoh064 guoh064 requested a review from LmeSzinc July 1, 2026 12:51
@guoh064 guoh064 force-pushed the gems_farming_revise branch from d5b0202 to f4136f3 Compare July 1, 2026 13:03
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.

2 participants