镜牢决策补强: 确认重试回退、快感合成闸门与英文 OCR 别名
- aalc_engine: window_move 下按压保持 0.5s, 避免 Unity 漏点 - jev_mirror_agent: 技能描述抖动时 Enter 未推进改点已核对按钮并限制连续重试; 结果页指纹忽略剧情与时钟变化; 追加的苦难不再误判为单个饰品场景; 第 3 层起离开商店前强制做一次有界快感合成检查 - lc_scene_aliases: 补 Mounting Trials / Acquire E.G.O Gift 等标签, 识别拆分的 Win/Bate 胜率按钮与 Max HP / Defense Level 文本 - tests: 覆盖上述回归点
This commit is contained in:
@@ -87,6 +87,41 @@ class EnglishMirrorBoundaryTest(unittest.TestCase):
|
|||||||
self.assertNotEqual(agent.scene_fingerprint(observation('00:00:43:02')),
|
self.assertNotEqual(agent.scene_fingerprint(observation('00:00:43:02')),
|
||||||
agent.scene_fingerprint(observation('00:00:43:02', 'Commence')))
|
agent.scene_fingerprint(observation('00:00:43:02', 'Commence')))
|
||||||
|
|
||||||
|
def test_result_story_ocr_changes_do_not_reset_continue_fallback(self):
|
||||||
|
def observation(story, clock, button='Continue'):
|
||||||
|
return normalize({'items': [{'text': text, 'score': score} for text, score in
|
||||||
|
[('Result', .99), (button, .99), (story, .95), (clock, .98)]]})
|
||||||
|
first = observation('You lookaway and continue on your path.', '00:00:10:02')
|
||||||
|
second = observation('You look away and continue on your path.', '00:00:10:16')
|
||||||
|
self.assertEqual(agent.scene_fingerprint(first), agent.scene_fingerprint(second))
|
||||||
|
self.assertNotEqual(agent.scene_fingerprint(first),
|
||||||
|
agent.scene_fingerprint(observation('same', '00:00:10:16', 'Battle!')))
|
||||||
|
|
||||||
|
def test_english_layer_cards_are_not_single_gift_observation(self):
|
||||||
|
state = {'screen': {'w': 1278, 'h': 731}, 'items': [
|
||||||
|
{'text': text, 'x': x, 'y': y, 'w': 90, 'h': 25, 'score': .99}
|
||||||
|
for text, x, y in [('Acquire E.G.O Gift', 250, 159), ('Mounting Trials', 250, 425),
|
||||||
|
('DefenseLevel +1, MaxHP+7.5%', 250, 491),
|
||||||
|
('Select', 1080, 572), ('0/2', 1160, 569), ('Refuse Gift', 900, 572)]]}
|
||||||
|
normalize(state)
|
||||||
|
self.assertIn('防御等级 +1, 体力上限+7.5%', [item['text'] for item in state['items']])
|
||||||
|
with mock.patch.object(agent, 'button_enabled', return_value=True):
|
||||||
|
options = agent.candidates(state)
|
||||||
|
self.assertTrue(any(key.startswith('hardship_') for key in options))
|
||||||
|
self.assertNotIn('decline_extra_observation', options)
|
||||||
|
self.assertNotIn('hardship_confirm', options)
|
||||||
|
state['items'][-2]['text'] = '选择2/2'
|
||||||
|
with mock.patch.object(agent, 'button_enabled', return_value=True):
|
||||||
|
options = agent.candidates(state)
|
||||||
|
self.assertEqual(set(options), {'requires_analysis', 'wait', 'hardship_confirm'})
|
||||||
|
|
||||||
|
def test_split_win_rate_button_starts_battle_loop_without_wave_label(self):
|
||||||
|
state = normalize({'screen': {'w': 1278, 'h': 731}, 'items': [
|
||||||
|
{'text': text, 'x': 993, 'y': y, 'w': 30, 'h': 16, 'score': .97}
|
||||||
|
for text, y in [('Win', 542), ('Bate', 554)]]})
|
||||||
|
self.assertTrue(agent.battle_is_visible(state))
|
||||||
|
self.assertIn('battle', agent.candidates(state))
|
||||||
|
|
||||||
def test_commence_and_split_sinner_header_reach_judgement_boundary(self):
|
def test_commence_and_split_sinner_header_reach_judgement_boundary(self):
|
||||||
state = {'screen': {'w': 1920, 'h': 1080}, 'items': [
|
state = {'screen': {'w': 1920, 'h': 1080}, 'items': [
|
||||||
{'text': text, 'x': 1200, 'y': y, 'w': 200, 'h': 40, 'score': 1}
|
{'text': text, 'x': 1200, 'y': y, 'w': 200, 'h': 40, 'score': 1}
|
||||||
|
|||||||
Reference in New Issue
Block a user