#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
|
|
@ -17,7 +17,9 @@ extends Node3D
|
|||
## * UI: hover, click, back, open, close, error (ui(), also from the menus)
|
||||
## * the opening intro (OpeningIntro, solo only, so never sent): the farmhouse door's creak, the
|
||||
## car doors, the big UFO's hum (a loop), spin-up whine, and zoom away, the part's falling
|
||||
## whistle, and the flash that brings the scarecrow to life
|
||||
## whistle, and the flash that brings the scarecrow to life. While it plays it holds the
|
||||
## ambience and the music (set_scene: its morning, then its night) whatever the phase, and it
|
||||
## stops new_campaign()'s morning stinger (stop_cue) to play it with the sign instead
|
||||
## * Music (the Music bus), by phase: "On the Farm" on the title screen (the farm's morning
|
||||
## behind it), the morning, and by day, and when the farmers are back; "Purgatory" at night;
|
||||
## none at dusk, at dawn, or after a Game Over (only the ambience). Tracks crossfade.
|
||||
|
|
@ -168,6 +170,8 @@ var _bell_left: float = -1.0
|
|||
var music_track := ""
|
||||
var _music := {}
|
||||
var _music_level := {}
|
||||
## A cutscene holds the ambience and the music (set_scene); the phase gets them back at end_scene().
|
||||
var scene := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -369,6 +373,36 @@ func wire_buttons(node: Node) -> void:
|
|||
button.pressed.connect(func() -> void: ui("ui_click"))
|
||||
|
||||
|
||||
## A cutscene's ambience (day, night levels, 0..1; they crossfade to it) and music track ("" for
|
||||
## none), whatever the phase, until end_scene().
|
||||
func set_scene(ambience: Vector2, track: String) -> void:
|
||||
scene = true
|
||||
_ambience_target = ambience
|
||||
music_track = track
|
||||
|
||||
|
||||
## Gives the ambience (at once) and the music back to the phase.
|
||||
func end_scene() -> void:
|
||||
if not scene:
|
||||
return
|
||||
scene = false
|
||||
var phase := sim.campaign.state.phase if sim != null else CampaignController.Phase.MORNING
|
||||
_ambience_target = AMBIENCE.get(phase, Vector2(1.0, 0.0))
|
||||
_ambience = _ambience_target
|
||||
music_track = MUSIC_FOR.get(phase, "")
|
||||
|
||||
|
||||
## Stops whatever a cue is playing now.
|
||||
func stop_cue(cue: String) -> void:
|
||||
for p in _voices_3d:
|
||||
if p.playing and p.get_meta(&"cue", "") == cue:
|
||||
p.stop()
|
||||
for pool: Array[AudioStreamPlayer] in [_voices_ui, _voices_game]:
|
||||
for p in pool:
|
||||
if p.playing and p.get_meta(&"cue", "") == cue:
|
||||
p.stop()
|
||||
|
||||
|
||||
## The first stream of a cue (for looping players the cutscene owns).
|
||||
func stream_of(cue: String) -> AudioStream:
|
||||
var list: Array = streams.get(cue, [])
|
||||
|
|
@ -432,6 +466,8 @@ func _process(delta: float) -> void:
|
|||
|
||||
|
||||
func _on_phase(phase: CampaignController.Phase, _previous: CampaignController.Phase) -> void:
|
||||
if scene:
|
||||
return # the cutscene's (it gives them back at its end)
|
||||
_ambience_target = AMBIENCE.get(phase, Vector2(1.0, 0.0))
|
||||
music_track = MUSIC_FOR.get(phase, "")
|
||||
match phase:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue