Connect the spare-key story and add flashlight-dependent stair descent

This commit is contained in:
Codex
2026-10-30 14:59:20 +02:00
parent d1c1375395
commit b572e0bf50
40 changed files with 1485 additions and 676 deletions
@@ -17,7 +17,7 @@ func run(qa: RefCounted) -> void:
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.facts.has("key_letter") and not game.facts.has("key_custody") and not game.facts.has("code"),"First call gives a reason to seek the key, not the safe's history or code")
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")
@@ -56,7 +56,7 @@ func run(qa: RefCounted) -> void:
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.facts.has("key_custody") and not game.facts.has("code"),"Mother explains her neighbor's safe before Katya can request 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")
@@ -80,7 +80,7 @@ func run(qa: RefCounted) -> void:
# A real test redial must retain knowledge before choosing its introduction.
game.qa_mode = false
game.begin_call(4,true,1,{"mail":true})
game.begin_call(4,true,1,{"key_custody":true})
qa.check(game.events[0].line == "call_04_k","Retained test knowledge selects the correct opening before dialogue starts")
game.qa_mode = true
@@ -114,9 +114,11 @@ func run(qa: RefCounted) -> void:
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
game.facts["key_letter"] = 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")
qa.check(game.continuation_chapter() == 1,"Old generic letter knowledge does not invent the neighbor's story")
game.facts = {"mail_request":true,"mail":true,"code":true}
qa.check(game.opening_for(4).opening != "call_04_k" and game.opening_for(5).opening != "call_05_k","Old profiles do not speak the newly written provenance without hearing it")
game.facts = previous_facts
game.completed = previous_completed
+15 -1
View File
@@ -362,7 +362,7 @@ func _unhandled_key_input(event: InputEvent) -> void:
func continuation_chapter() -> int:
# Old profiles without the new conversation must hear it, not receive an
# invented memory. Existing discoveries and completed-call count stay intact.
if not facts.has("mail_request") and not facts.has("mail"): return 1
if not facts.has("key_letter") and not facts.has("key_custody"): return 1
return mini(completed+1,10)
func show_menu() -> void:
@@ -548,6 +548,11 @@ func advance() -> void:
next_time = events[0].at
kind = "dialogue"
if not busy.is_empty():
if busy.has("start_move") and not busy.get("moving",false):
var move_at: float = busy_start + voice_length(busy.request) + 0.12
if move_at < next_time:
next_time = move_at
kind = "move"
if not replied and reply_at < next_time:
next_time = reply_at
kind = "reply"
@@ -559,6 +564,12 @@ func advance() -> void:
soundscape.advance(elapsed, place)
match kind:
"heard": complete_line()
"move":
# Start at the first footsteps, after Katya has finished the instruction.
# Interruption later in the walk keeps this real intermediate location.
place = busy.start_move
busy.moving = true
soundscape.update_location(place)
"impact":
fired.impact = elapsed
strike()
@@ -617,6 +628,8 @@ func line_allowed(id: String) -> bool:
if rule.has("places") and place not in rule.places: return false
for key in rule.get("items",[]):
if not items.has(key): return false
for key in rule.get("missing",[]):
if items.has(key): return false
return true
func opening_for(number: int) -> Dictionary:
@@ -844,6 +857,7 @@ func refresh_commands() -> void:
if not done.has("question") and line_allowed(entry.question):
command_list.add_child(stage.chip("«"+str(story.lines[entry.question].text)+"»","question",func():choose_action("question")))
var names := {"look":"У входной двери", "keys_search":"Найти ключи", "keys_fast":"Ключи в куртке", "lamp_search":"Поискать фонарь", "lamp_fast":"Повернуть батарейку", "mail_hint":"Помочь с письмом", "read_mail":"Прочитать письмо", "safe":"Сейф · 0417", "front":"На площадку", "stairs":"Проверить лестницу", "side_try":"Боковая дверь", "side_open":"Ручку вверх и ключ", "inner":"Подальше от окон", "back":"Вернуться в квартиру", "neighbor":"Постучать соседке", "phone_test":"Проверить связь", "phone_shelf":"Телефон на полку", "speak_here":"Мам, я здесь", "speak_love":"Я люблю тебя"}
names.merge({"stairs_lit":"Спускаться с фонарём", "stairs_down":"Продолжить спуск", "return_flat":"Вернуться за фонарём", "neighbor":"Постучать соседям"},true)
for action in story.actions:
if command_allowed(action):
var id: String = action.id
+6 -3
View File
@@ -105,6 +105,7 @@ func finish(expected: String) -> void:
var rule: Dictionary = game.story.line_rules.get(entry.line,{})
for key in rule.get("facts",[]): check(key in entry.known,"Spoken line has prior evidence: " + entry.line + "/" + key)
for key in rule.get("items",[]): check(key in entry.items,"Spoken line uses a held item: " + entry.line + "/" + key)
for key in rule.get("missing",[]): check(key not in entry.items,"Spoken line respects missing item: " + entry.line + "/" + key)
if rule.has("places"): check(entry.place in rule.places,"Spoken line matches current place: " + entry.line)
results.append({"chapter": game.chapter, "outcome": game.outcome, "facts": game.facts.keys()})
# Fast route checks skip the production epilogue; separate checks below
@@ -271,7 +272,7 @@ func run(target: Node) -> void:
DirAccess.make_dir_recursive_absolute(directory())
check(game.UI_FONT.get_string_size("Позвонить Маме",0,-1,34).x > game.UI_FONT.base_font.get_string_size("Позвонить Маме",0,-1,34).x,"Cyrillic uses the bold variation rather than the regular fallback")
check(game.story.chapters.size() == 10, "Ten chapters")
check(game.story.lines.size() == 110, "All 110 spoken lines")
check(game.story.lines.size() == 116, "All 116 spoken lines")
for id in game.story.lines:
check(game.voice_stream(id) != null and game.voice_length(id) > 0.1, "Playable audio " + id)
var voices: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/voice_manifest.json"))
@@ -284,8 +285,8 @@ func run(target: Node) -> void:
else:
check(voices[id].provider == "ElevenLabs" and voices[id].voice_id == "5u41aNhyCU6hXOcjPPv0", "Carol assigned: " + id)
carol_count += 1
check(jessica_count == 52, "All 52 Katya lines use Jessica")
check(carol_count == 58, "All 58 mother lines use Carol")
check(jessica_count == 55, "All 55 Katya lines use Jessica")
check(carol_count == 61, "All 61 mother lines use Carol")
for id in game.story.lines:
check(voices[id].text == game.story.lines[id].text,"Audio manifest matches corrected dialogue: " + id)
check(game.voice_length("greeting") <= game.story.intro[0].at, "Greeting fits before prologue")
@@ -748,6 +749,8 @@ func run(target: Node) -> void:
game.qa_mode = true
var continuity = load("res://scripts/phone_continuity_qa.gd").new()
await continuity.run(self)
var stairs_checks = load("res://scripts/phone_stairs_qa.gd").new()
await stairs_checks.run(self)
await realtime_final_check()
if "--phone-real-time" in OS.get_cmdline_user_args():
await realtime_check()
@@ -107,6 +107,8 @@ func schedule_task(id: String, start: float, reply: float) -> void:
"lamp_search": ["drawer", "cloth", "switch"], "lamp_fast": ["drawer", "switch"],
"read_mail": ["keyboard"], "safe": ["safe", "paper"],
"front": ["keys", "door", "footsteps"], "stairs": ["footsteps"],
"stairs_lit": ["footsteps", "footsteps", "footsteps"],
"stairs_down": ["footsteps", "footsteps", "footsteps"], "return_flat": ["footsteps", "door"],
"side_try": ["keys", "door"], "side_open": ["door", "footsteps"],
"inner": ["footsteps"], "back": ["footsteps"], "neighbor": ["knock"],
"phone_test": ["phone", "footsteps"], "phone_shelf": ["phone"],
@@ -0,0 +1,56 @@
extends RefCounted
## Flashlight possession changes the route, not just the duration or wording.
func run(qa: RefCounted) -> void:
var game: Node = qa.game
qa.start(2,2)
qa.perform("keys_fast")
qa.perform("front")
qa.check(game.facts.has("lamp") and not game.items.has("lamp"),"Remembering a flashlight is not carrying one")
qa.check(game.action_button("stairs") != null and game.action_button("stairs_lit") == null,"Without the item only a dark stair inspection is available")
game.choose_action("stairs_lit")
qa.check(game.busy.is_empty() and game.place == "landing","Hidden descent cannot bypass flashlight possession")
qa.perform("stairs")
qa.check(game.place == "landing" and game.heard.has("stairs_m"),"In the dark mother stays on the intact landing")
qa.perform("return_flat")
qa.check(game.place == "flat" and game.action_button("lamp_fast") != null,"Mother can return to fetch the flashlight")
qa.finish("flat")
qa.start(2,2)
qa.perform("keys_fast")
qa.perform("lamp_fast")
qa.perform("front")
qa.check(game.action_button("stairs") == null and game.action_button("stairs_lit") != null,"A working flashlight opens an actual descent")
qa.perform("stairs_lit")
qa.check(game.place == "stairwell" and game.heard.has("stairs_lit_m") and not game.heard.has("stairs_m"),"Lit response and movement agree")
qa.check(game.action_button("side_open") == null and game.action_button("neighbor") == null,"Leaving the floor removes its doors from the cloud")
qa.check(game.action_button("question") == null,"Katya does not ask whether mom is alone at home after she has left it")
qa.perform("stairs_down")
qa.check(game.action_button("stairs_down") != null,"The descent can continue instead of hitting an invented blockage")
await qa.capture("phone-stairwell-route")
qa.finish("stairwell")
qa.click("next")
qa.check(game.place == "flat" and game.items.is_empty(),"Redial resets movement and carried flashlight")
qa.start(2,2)
game.facts.erase("stairs")
qa.perform("keys_fast")
qa.perform("lamp_fast")
qa.perform("front")
qa.at(74)
qa.click("stairs_lit")
qa.check(game.place == "landing","Mother hears the complete instruction before starting to walk")
qa.at(game.busy_start+game.voice_length("stairs_lit_k")+0.13)
qa.check(game.place == "stairwell" and not game.facts.has("stairs"),"Movement can begin without granting an unfinished answer")
qa.at(81.1)
qa.check(game.busy.is_empty() and game.heard[-1] == "hum" and not game.facts.has("stairs"),"Fixed final line interrupts a late descent without granting knowledge")
qa.finish("stairwell")
qa.start(2,2)
qa.perform("keys_fast")
qa.perform("lamp_fast")
qa.perform("front")
qa.at(80)
qa.click("stairs_lit")
qa.at(81.1)
qa.check(game.place == "landing","Interrupting Katya before her instruction ends cannot start a phantom descent")
qa.finish("landing")