Extend pre-impact pause and synchronize both call timers
This commit is contained in:
@@ -316,7 +316,7 @@ func show_menu() -> void:
|
||||
box.add_child(button("Позвонить маме" if completed == 0 else "Продолжить · звонок %d" % mini(completed + 1, 10), "start", func(): dial_call(mini(completed + 1, 10), false)))
|
||||
box.add_child(button("Проверка сцен · выбрать любой из 10 звонков", "testing", show_test_menu))
|
||||
box.add_child(button("Звук и титры", "settings", show_settings))
|
||||
box.add_child(label("0.2.4 · Катя: Jessica · Мама: Carol · ElevenLabs\nПрогресс сохраняется после находок и законченных звонков.", 16, MUTED))
|
||||
box.add_child(label("0.2.5 · Катя: Jessica · Мама: Carol · ElevenLabs\nПрогресс сохраняется после находок и законченных звонков.", 16, MUTED))
|
||||
|
||||
func show_settings() -> void:
|
||||
var box := modal()
|
||||
@@ -617,6 +617,7 @@ func strike() -> void:
|
||||
screen_fade.color = Color(0, 0, 0, 0.94)
|
||||
status_label.text = "Соединение прервано"
|
||||
refresh_commands()
|
||||
refresh_live()
|
||||
if viewing_messages: show_messages()
|
||||
if qa_mode: return
|
||||
var epoch := start_tick
|
||||
@@ -722,7 +723,6 @@ func refresh_live() -> void:
|
||||
var rise := clampf((elapsed-float(story.timeline.alarm))/6.0,0.0,1.0)
|
||||
rise = rise*rise*(3.0-2.0*rise)
|
||||
siren.volume_db = linear_to_db(lerpf(db_to_linear(-70),db_to_linear(-23),rise))
|
||||
clock_label.text = "" if chapter == 1 else "%02d:%02d" % [mini(int(elapsed), 90) / 60, mini(int(elapsed), 90) % 60]
|
||||
status_label.text = "Плохая связь" if place == "alcove" and not items.has("connected") else "На линии"
|
||||
if not running: status_label.text = "Соединение прервано" if impacted else "Готова позвонить"
|
||||
var names := {"flat": "В квартире", "inner": "Внутренний коридор", "landing": "Лестничная площадка", "alcove": "Боковой тамбур"}
|
||||
@@ -737,6 +737,7 @@ func refresh_live() -> void:
|
||||
update_choice_state()
|
||||
busy_bar.visible = not busy.is_empty()
|
||||
if not busy.is_empty(): busy_bar.value = clampf((elapsed - busy_start) / (busy_end - busy_start) * 100, 0, 100)
|
||||
stage.refresh_call_display()
|
||||
|
||||
func action_button(id: String, node: Node = null) -> Button:
|
||||
if node == null: node = ui
|
||||
|
||||
@@ -12,6 +12,10 @@ func check(ok: bool, message: String) -> void:
|
||||
errors.append(message)
|
||||
push_error("PHONE QA: " + message)
|
||||
|
||||
func check_clocks(expected: String, context: String) -> void:
|
||||
check(game.clock_label.text == expected, "Katya call duration " + context)
|
||||
check(game.stage.mother_clock.text == expected, "Mother call duration " + context)
|
||||
|
||||
func click(id: String) -> void:
|
||||
var gameplay := id in ["question", "cancel"]
|
||||
for action in game.story.actions:
|
||||
@@ -86,12 +90,24 @@ func realtime_check() -> void:
|
||||
# Opt-in, genuinely wait for the complete prologue and production transition.
|
||||
start(1)
|
||||
game.qa_mode = false
|
||||
var warning_finished: Array[float] = []
|
||||
var record_warning := func():
|
||||
if game.running and not game.heard.is_empty() and game.heard[-1] == "hum":
|
||||
warning_finished.append(game.elapsed)
|
||||
game.voice.finished.connect(record_warning)
|
||||
var began := Time.get_ticks_msec()
|
||||
for step in range(3):
|
||||
await game.get_tree().create_timer(30.0).timeout
|
||||
print("PHONE_REALTIME elapsed=", (Time.get_ticks_msec() - began) / 1000.0)
|
||||
await game.get_tree().create_timer(9.0).timeout
|
||||
game.voice.finished.disconnect(record_warning)
|
||||
check(game.impacted and not game.running, "Real 90-second strike")
|
||||
check_clocks("01:30", "real disconnected call")
|
||||
check(warning_finished.size() == 1, "Real warning plays to its natural end")
|
||||
if warning_finished.size() == 1:
|
||||
var warning_gap := float(game.story.timeline.impact) - warning_finished[0]
|
||||
check(warning_gap >= 5, "Real warning leaves five seconds before impact")
|
||||
print("PHONE_REALTIME warning_gap=", warning_gap)
|
||||
for beat in game.story.intro:
|
||||
check(beat.line in game.heard, "Real prologue " + str(beat.line))
|
||||
check("after_call" in game.heard, "Production post-impact reply")
|
||||
@@ -139,10 +155,12 @@ func run(target: Node) -> void:
|
||||
check(carol_count == 58, "All 58 mother lines use Carol")
|
||||
check(game.voice_length("greeting") <= game.story.intro[0].at, "Greeting fits before prologue")
|
||||
check(45 + game.voice_length("power") <= 51, "Blackout reaction fits before conversation resumes")
|
||||
check(85 + game.voice_length("hum") <= 90, "Hum reaction fits before strike")
|
||||
var warning_at: float = game.story.timeline.hum
|
||||
check(90 - warning_at - game.voice_length("hum") >= 5, "At least five seconds after full warning before strike")
|
||||
check(game.hum.stream.get_length() >= 90 - warning_at, "Background hum covers the longer wait until impact")
|
||||
for index in range(game.story.intro.size()):
|
||||
var beat: Dictionary = game.story.intro[index]
|
||||
var next_at: float = game.story.intro[index + 1].at if index + 1 < game.story.intro.size() else 85.0
|
||||
var next_at: float = game.story.intro[index + 1].at if index + 1 < game.story.intro.size() else warning_at
|
||||
if float(beat.at) < 45: next_at = minf(next_at, 45)
|
||||
check(float(beat.at) + game.voice_length(beat.line) <= next_at, "Intro line fits before next cue: " + str(beat.line))
|
||||
await capture("phone-menu")
|
||||
@@ -151,11 +169,13 @@ func run(target: Node) -> void:
|
||||
click("back_menu")
|
||||
game.dial_call(1,true,0,true)
|
||||
check(game.dialing and not game.running, "Dial animation precedes the 90-second clock")
|
||||
check_clocks("", "hidden before connection")
|
||||
check(game.stage.mother_status.text == "Входящий звонок", "Mother sees incoming daughter call")
|
||||
await game.get_tree().create_timer(0.55).timeout
|
||||
await capture("phone-dialing")
|
||||
await game.get_tree().create_timer(1.9 if DisplayServer.get_name() == "headless" else 1.5).timeout
|
||||
check(game.running and not game.dialing and game.elapsed < 1.0, "Connection starts a fresh full attempt")
|
||||
check_clocks("00:00", "first connection")
|
||||
check("greeting" in game.heard, "Mother answers after connection")
|
||||
game.stage.update(1.0)
|
||||
check(game.stage.purple_level > game.stage.pink_level, "Mother lights the violet background")
|
||||
@@ -273,6 +293,11 @@ func run(target: Node) -> void:
|
||||
# Every redial repeats the same external world, including the first call.
|
||||
for number in range(1, 11):
|
||||
start(number)
|
||||
check_clocks("00:00", "reset in call " + str(number))
|
||||
at(0.95)
|
||||
check_clocks("00:00", "before first full second")
|
||||
at(1.05)
|
||||
check_clocks("00:01", "one elapsed second")
|
||||
at(23.99)
|
||||
check(not game.fired.has("alarm"), "No early siren: " + str(number))
|
||||
at(24.01)
|
||||
@@ -287,13 +312,23 @@ func run(target: Node) -> void:
|
||||
at(45.01)
|
||||
check(game.fired.get("power") == 45.0 and "темно" in game.place_label.text, "Same visible blackout: " + str(number))
|
||||
check("power" in game.heard, "Mother acknowledges blackout: " + str(number))
|
||||
at(84.99)
|
||||
at(59.95)
|
||||
check_clocks("00:59", "before minute rollover")
|
||||
at(60.05)
|
||||
check_clocks("01:00", "minute rollover")
|
||||
at(warning_at - 0.01)
|
||||
check(not game.fired.has("hum"), "No early hum: " + str(number))
|
||||
at(85.01)
|
||||
check(game.fired.get("hum") == 85.0, "Same hum time: " + str(number))
|
||||
at(warning_at + 0.01)
|
||||
check(game.fired.get("hum") == warning_at, "Same hum time: " + str(number))
|
||||
at(warning_at + game.voice_length("hum") + 0.01)
|
||||
check(not game.impacted and game.heard[-1] == "hum", "Full warning leaves time before impact: " + str(number))
|
||||
at(89.99)
|
||||
check_clocks("01:29", "last second of call")
|
||||
check(not game.impacted, "No early strike: " + str(number))
|
||||
finish("flat")
|
||||
check_clocks("01:30", "duration held after disconnect")
|
||||
at(95)
|
||||
check_clocks("01:30", "post-call notifications do not advance duration")
|
||||
check(game.fired.get("impact") == 90.0, "Same strike time: " + str(number))
|
||||
start(1)
|
||||
at(45.01)
|
||||
@@ -313,7 +348,7 @@ func run(target: Node) -> void:
|
||||
check(game.heard == ["greeting"], "Identical opening " + str(number))
|
||||
if number == 1:
|
||||
check(game.action_button("keys_search") == null, "Prologue has no commands")
|
||||
check(game.clock_label.text.is_empty(), "Prologue hides time")
|
||||
check_clocks("00:00", "prologue shows duration")
|
||||
for beat in game.story.intro: at(beat.at + 0.01)
|
||||
check(game.heard.size() == 19 and "power" in game.heard, "Ordinary conversation and blackout acknowledgement")
|
||||
else:
|
||||
@@ -326,7 +361,7 @@ func run(target: Node) -> void:
|
||||
check(entry.opening in game.heard and entry.reply in game.heard, "Unique opening " + str(number))
|
||||
perform("question")
|
||||
check(entry.question in game.heard and entry.answer in game.heard, "Unique exchange " + str(number))
|
||||
at(85.01)
|
||||
at(warning_at + 0.01)
|
||||
check(game.heard[-1] == "hum", "Hum before strike")
|
||||
finish("flat")
|
||||
await capture("phone-ending")
|
||||
|
||||
@@ -241,16 +241,22 @@ func update(delta: float) -> void:
|
||||
menu_button.disabled = game.dialing
|
||||
memory_button.disabled = game.dialing
|
||||
memory_button.text = "Память" + (" · %d" % game.facts.size() if not game.facts.is_empty() else "")
|
||||
refresh_call_display()
|
||||
|
||||
func refresh_call_display() -> void:
|
||||
if game.dialing:
|
||||
call_direction.text = "ИСХОДЯЩИЙ ВЫЗОВ"
|
||||
game.status_label.text = "Вызов" + ".".repeat(1 + int(smartphone.pulse*1.5)%3)
|
||||
game.clock_label.text = ""
|
||||
mother_status.text = "Входящий звонок"
|
||||
mother_clock.text = "•••"
|
||||
mother_clock.text = ""
|
||||
else:
|
||||
call_direction.text = "МОБИЛЬНЫЙ"
|
||||
mother_status.text = "Разговор" if game.running else ("Вызов завершён" if game.impacted else "Ожидание")
|
||||
mother_clock.text = game.clock_label.text if game.running else ""
|
||||
var seconds := clampi(int(game.elapsed),0,int(game.story.timeline.impact))
|
||||
var duration := "%02d:%02d" % [seconds/60,seconds%60] if game.running or game.impacted else ""
|
||||
game.clock_label.text = duration
|
||||
mother_clock.text = duration
|
||||
|
||||
func begin_dial() -> void:
|
||||
speaker = ""
|
||||
|
||||
Reference in New Issue
Block a user