Files
Diabolo/DoOtboy/do-otboy/scripts/phone_continuity_qa.gd
T

123 lines
6.5 KiB
GDScript
Raw Normal View History

extends RefCounted
## Regressions for information that used to appear before mom revealed it.
func run(qa: RefCounted) -> void:
var game: Node = qa.game
for number in range(2,11):
qa.start(number)
qa.wait_for_speech()
qa.check(not game.facts.has("mail") and not game.facts.has("code"),"Chapter alone grants no letter or code: " + str(number))
qa.check(game.action_button("read_mail") == null and game.action_button("safe") == null,"Unheard letter and safe stay hidden: " + str(number))
qa.check("call_04_k" not in game.heard and "call_05_k" not in game.heard,"No knowledgeable opening on an empty profile: " + str(number))
qa.check(game.action_button("mail_hint") == null,"No reason to bring up email without mother's earlier request")
qa.start(1)
var request_at := 0.0
for beat in game.story.intro:
if beat.line == "intro_02": request_at = beat.at
qa.at(request_at+0.1)
qa.check(not game.facts.has("mail_request"),"Request is not remembered before mom finishes")
qa.at(game.speech_until+0.01)
qa.check(game.facts.has("mail_request") and not game.facts.has("mail") and not game.facts.has("code"),"First call establishes only an unopened important letter")
qa.check(game.elapsed < game.story.timeline.alarm,"Letter request is heard before the siren")
qa.click("memory")
await qa.capture("phone-first-letter-memory")
qa.check(game.memory_content.text.contains("Попросила Катю помочь"),"Memory records why Katya will return to the letter")
qa.click("close_memory")
qa.finish("flat")
qa.click("next")
qa.check(game.chapter == 2 and game.action_button("mail_hint") != null,"First call gives a reason to ask about the letter in call two")
qa.check(game.action_button("read_mail") == null,"Remembering a request does not reveal contents")
qa.perform("mail_hint")
qa.perform("read_mail")
qa.check(game.facts.has("code") and game.elapsed < 45,"Motivated second-call route reads the code before blackout")
qa.start(2)
qa.click("memory")
await qa.capture("phone-memory-empty")
qa.check(game.memory_content.get_parsed_text().contains("Мама ещё не рассказала"),"Empty memory explains that nothing has been learned")
qa.click("close_memory")
qa.click("look")
qa.at(game.reply_at+0.1)
qa.check(not game.facts.has("entry") and not game.facts.has("lamp_location"),"A started answer is not yet learned")
qa.click("memory")
qa.at(maxf(game.busy_end,game.speech_until)+0.1)
qa.check(game.memory_content.text.contains("лишь предположила") and game.memory_content.text.contains("фонарь"),"Open memory updates when the mother finishes")
qa.check(not game.facts.has("keys_exact"),"A guess about the jacket is not an exact pocket location")
qa.click("close_memory")
qa.check(game.action_button("keys_fast") == null and game.action_button("keys_search") != null,"Looking around does not unlock the exact key instruction")
game.say("keys_fast_k")
qa.check("keys_fast_k" not in game.heard,"Direct line dispatch cannot bypass knowledge")
qa.perform("keys_search")
qa.check(game.facts.has("keys_exact"),"Exact pocket is learned only after finding keys")
qa.click("memory")
await qa.capture("phone-memory-learned")
qa.check(game.memory_content.get_parsed_text().contains("правом кармане"),"Learned knowledge is visible in the notebook")
qa.click("close_memory")
qa.start_with_letter(2)
qa.perform("mail_hint")
qa.check(game.facts.has("mail") and not game.facts.has("code"),"Email conversation reveals a marked letter but not its code")
qa.check(game.heard.has("mail_hint_k") and game.heard.has("mail_hint_m"),"Letter discovery is a complete conversation")
qa.perform("read_mail")
qa.check(game.facts.has("code") and game.elapsed < 45,"Letter can be discovered and read before power loss")
qa.finish("flat")
qa.click("next")
qa.check(game.facts.has("mail") and game.facts.has("code") and game.items.is_empty(),"Heard letter details survive a redial")
# Cut the mother midway through reading the code, not just the request.
qa.start(4,2)
game.facts.erase("code")
qa.wait_for_speech()
var mail: Dictionary
for action in game.story.actions:
if action.id == "read_mail": mail = action
qa.at(45-game.action_duration(mail)+game.voice_length(mail.response)/2)
qa.click("read_mail")
qa.at(game.reply_at+0.1)
qa.check(game.heard[-1] == "read_mail_m" and not game.facts.has("code"),"Partial spoken code does not count as a complete discovery")
qa.at(45.01)
qa.check(not game.facts.has("code") and game.heard[-1] == "late_mail","Interrupted mother answer grants no code")
# A real test redial must retain knowledge before choosing its introduction.
game.qa_mode = false
game.begin_call(4,true,1,{"mail":true})
qa.check(game.events[0].line == "call_04_k","Retained test knowledge selects the correct opening before dialogue starts")
game.qa_mode = true
qa.start(5,2)
qa.wait_for_speech()
qa.check(game.action_button("question") == null,"Remembering a plan does not put it in mother's hands")
qa.perform("safe")
qa.check(game.action_button("question") != null,"Plan question unlocks after physically opening the safe")
qa.perform("question")
qa.finish("flat")
for number in [3,4,6,7]:
qa.start(number,2)
if number == 3: qa.perform("lamp_fast")
elif number in [6,7]:
qa.perform("keys_fast")
qa.perform("front")
qa.perform("question")
qa.check(game.story.chapters[number-1].answer in game.heard,"Contextual question remains reachable: " + str(number))
qa.finish("landing" if number in [6,7] else "flat")
qa.start(8,2)
qa.click("memory")
await qa.capture("phone-memory-full")
for text in game.story.facts.values():
qa.check(game.memory_content.get_parsed_text().contains(text),"Every known clue is available in scrollable memory")
qa.click("close_memory")
var legacy: Dictionary = game.Profile.valid_flags({"keys":true,"mail":true,"code":true},game.story.facts)
qa.check(not legacy.has("keys_exact") and legacy.has("code"),"Legacy guessed keys are not upgraded to confirmed knowledge")
var previous_facts: Dictionary = game.facts.duplicate()
var previous_completed: int = game.completed
game.facts = {"lamp":true}
game.completed = 3
qa.check(game.continuation_chapter() == 1 and game.facts == {"lamp":true} and game.completed == 3,"Legacy profile hears the missing setup without losing progress")
game.facts["mail_request"] = true
qa.check(game.continuation_chapter() == 4,"Heard setup restores the saved continuation")
game.facts = {"mail":true}
qa.check(game.continuation_chapter() == 4,"Existing genuine letter knowledge remains valid")
game.facts = previous_facts
game.completed = previous_completed