#33: opening intro cutscene
OpeningIntro (game/scripts/opening_intro.gd) plays on every New vacation (not Continue, not when hosting co-op): the farmers leave in their loaded station wagon, "Later that night....", a bickering UFO crew drops a part whose blue flash brings the scarecrow (hung on a post in its T-pose) to life, the UFO zooms off, then the loading screen and the first morning's sign. Hold Space / Enter / A (or E, or the mouse button) 1 s to skip from any stage; Escape pauses it; Restart the night skips it; Save & quit clears it. It ends with the farm exactly as new_campaign() leaves it. Hooks: ReviewPanel keeps the sign down while the intro has the farm (and only focuses Start when the sign is up); DialogueDirector holds its conversations and the sign, then intro_over() plays night 1's morning conversations before the sign; Tutorial hides; FarmAudio gets set_scene / end_scene (ambience and music held by a cutscene) and stop_cue (the morning stinger plays with the sign instead); Main wires new_vacation(intro), blocked, resume's freeze, restart and to_menu. Tests: test_intro (45 checks); test_flow skips the new intro. Tool: game/tools/capture_intro.gd saves a frame per stage for the timing review. Docs: README, RULES, LAYOUT (staging points), PLAYTEST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d96ef8b5be
commit
c6daf3d217
19 changed files with 2112 additions and 21 deletions
|
|
@ -10,6 +10,9 @@ extends Node
|
|||
## starts while a menu is up (the shops, or Main's: DialogueBox.blocked) or the vacation is over,
|
||||
## and a new morning (or a retry) takes down whatever was up. play() shows a conversation from
|
||||
## code at any time; replay() (debug: F5) plays this phase's again.
|
||||
## The opening intro (OpeningIntro) holds all of it: nothing starts while it's on screen (play()
|
||||
## waits) and the sign stays down while it has the farm; at its end (intro_over()) night 1's
|
||||
## morning conversations play, then the sign comes up.
|
||||
|
||||
const DIR := "res://game/resources/dialogue/"
|
||||
|
||||
|
|
@ -73,9 +76,9 @@ func due(n: int, phase: CampaignController.Phase) -> Array[Conversation]:
|
|||
return out
|
||||
|
||||
|
||||
## Shows conversation c now, or after the one that's up.
|
||||
## Shows conversation c now, or after the one that's up (or the opening intro).
|
||||
func play(c: Conversation) -> void:
|
||||
if is_playing():
|
||||
if is_playing() or _intro_busy():
|
||||
_asked.append(c)
|
||||
return
|
||||
_played[c] = true
|
||||
|
|
@ -98,6 +101,17 @@ func replay() -> void:
|
|||
play(c)
|
||||
|
||||
|
||||
## Whether a conversation would start now (the intro keeps the sign down for it).
|
||||
func has_due() -> bool:
|
||||
return not _asked.is_empty() or (not _queue.is_empty() and _elapsed() >= _queue[0].delay)
|
||||
|
||||
|
||||
## The opening intro is over: this morning's conversations now, then the sign.
|
||||
func intro_over() -> void:
|
||||
if not is_playing():
|
||||
_next()
|
||||
|
||||
|
||||
## Takes down whatever is up and forgets what was due.
|
||||
func stop() -> void:
|
||||
_queue.clear()
|
||||
|
|
@ -120,7 +134,7 @@ func _exit_tree() -> void:
|
|||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if _queue.is_empty() or is_playing() or box.is_blocked() or sim.campaign.is_over() or sim._menu_open():
|
||||
if _queue.is_empty() or is_playing() or box.is_blocked() or sim.campaign.is_over() or sim._menu_open() or _intro_busy():
|
||||
return
|
||||
if _elapsed() >= _queue[0].delay:
|
||||
play(_queue.pop_front())
|
||||
|
|
@ -146,6 +160,11 @@ func _on_phase(phase: CampaignController.Phase, _previous: CampaignController.Ph
|
|||
|
||||
func _on_finished(_c: Conversation) -> void:
|
||||
_release()
|
||||
_next()
|
||||
|
||||
|
||||
## The next conversation (asked for, or due), or the sign.
|
||||
func _next() -> void:
|
||||
if not _asked.is_empty():
|
||||
play(_asked.pop_front())
|
||||
elif not _queue.is_empty() and _elapsed() >= _queue[0].delay:
|
||||
|
|
@ -155,10 +174,10 @@ func _on_finished(_c: Conversation) -> void:
|
|||
|
||||
|
||||
## The morning sign steps aside while a conversation is up, and comes back (with the focus on
|
||||
## Start the day) after it.
|
||||
## Start the day) after it (not while the opening intro has the farm).
|
||||
func _sign(show: bool) -> void:
|
||||
var review := sim.review_panel if sim != null else null
|
||||
if review == null:
|
||||
if review == null or (show and sim.intro != null and sim.intro.running):
|
||||
return
|
||||
if show:
|
||||
review.refresh()
|
||||
|
|
@ -167,6 +186,10 @@ func _sign(show: bool) -> void:
|
|||
review.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
|
||||
|
||||
func _intro_busy() -> bool:
|
||||
return sim != null and sim.intro != null and sim.intro.busy()
|
||||
|
||||
|
||||
## Stops the farm for a conversation that pauses the game: the whole tree solo, this machine's
|
||||
## scarecrow in co-op.
|
||||
func _hold(pause: bool) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue