Animate passenger venues and add port-specific cinematics

This commit is contained in:
josh
2026-11-28 14:57:34 -05:00
parent 384f140b92
commit 636a0e2cf8
37 changed files with 2891 additions and 355 deletions

View File

@@ -20,6 +20,8 @@ namespace Soundings
string directory = args[index + 1];
Directory.CreateDirectory(directory);
if (!CheckSmoke(Harbor.AllPortsHaveScenery, "Every destination has a port scenery profile"))
yield break;
for (int port = 0; port < Market.Ports.Count; port++)
{
if (!CheckSmoke(PassageAudio.LoadPortClip("Departure", port) is { length: > 1 }
@@ -77,12 +79,26 @@ namespace Soundings
yield break;
if (!SubmitSmoke("dispatch") || !CheckSmoke(underway != null && livePassage != null && Ship.Port == 0
&& company.Voyages == 0 && PassageDuration(underway) >= 120 && livePassage.Assisted && underway.Weather == WeatherCondition.Calm
&& guideContext == GuideStep.AtSea && root.Q<Button>("guide-skip") != null
&& underway.Plan?.FoodUnits == 1120 && underway.Plan.Program == EntertainmentProgram.LiveMusic,
"Cast off into an assisted live crossing"))
yield break;
if (!CheckSmoke(passageAudio.CurrentAnnouncement == PassageAnnouncement.Departure
&& passageAudio.Caption.Contains("next port of call is Nassau"), "Cast off names Nassau on the ship's PA"))
if (!CheckSmoke(harbor.PortCinematicActive && Harbor.PortCinematicDuration < 5
&& root.Q<Label>("port-cinematic-name")?.text == "Miami"
&& passageAudio.CurrentAnnouncement == PassageAnnouncement.Departure
&& passageAudio.Caption.Contains("next port of call is Nassau"), "Cast off at Miami with a short cinematic and named PA"))
yield break;
Vector3 departureStart = harbor.PassageWorldPosition;
yield return new WaitForSecondsRealtime(1.3f);
if (!CheckSmoke(harbor.PortCinematicActive && passageHelm.Progress == 0
&& Vector3.Distance(departureStart, harbor.PassageWorldPosition) > 1,
"Departure moves the ship through the harbor before starting the voyage clock")
|| !CheckSmoke(harbor.HasActiveGuest(GuestActivity.Swim) && harbor.HasActiveGuest(GuestActivity.Wade)
&& harbor.HasActiveGuest(GuestActivity.Lounge), "Guests swim, wade, and use the pool loungers in calm weather"))
yield break;
holdCinematicClock = true;
yield return CapturePortAndSkipSmoke(directory, "03a-departure-cinematic");
if (!CheckSmoke(!harbor.PortCinematicActive
&& guideContext == GuideStep.AtSea && root.Q<Button>("guide-skip") != null, "Skipping the shot hands control to the voyage"))
yield break;
int mealPrice = livePassage.GetPrice(OnboardService.Meals);
int provisions = livePassage.ProvisionsRemaining;
@@ -142,6 +158,10 @@ namespace Soundings
if (!SubmitSmoke("passage-deck-1") || !CheckSmoke(passageDeck == 1, "Inspect the second guest deck"))
yield break;
yield return CaptureSmoke(directory, "06-guest-deck");
if (!CheckSmoke(harbor.HasActiveGuest(GuestActivity.Drink) && harbor.HasActiveGuest(GuestActivity.TendBar)
&& harbor.HasActiveGuest(GuestActivity.Dine) && harbor.HasActiveGuest(GuestActivity.Watch),
"The fitted bar, dining room, and entertainment venue are active"))
yield break;
float deckOverview = harbor.OrbitVerticalSpan;
harbor.Zoom(-90, new Vector2(.57f, .46f));
yield return new WaitForSecondsRealtime(.65f);
@@ -152,6 +172,10 @@ namespace Soundings
harbor.Zoom(-19, new Vector2(.43f, .49f));
yield return new WaitForSecondsRealtime(.55f);
yield return CaptureSmoke(directory, "06-guest-deck-close-up");
harbor.ResetView(true);
harbor.Zoom(-19, new Vector2(.67f, .39f));
yield return new WaitForSecondsRealtime(.55f);
yield return CaptureSmoke(directory, "06-bar-service-close-up");
if (!SubmitSmoke("passage-bridge") || !CheckSmoke(passageBridge && harbor.FirstPersonPositionIsClear, "Enter the first-person bridge"))
yield break;
yield return CaptureSmoke(directory, "06a-bridge");
@@ -221,8 +245,18 @@ namespace Soundings
yield return new WaitForSecondsRealtime(.15f);
if (!CheckSmoke(passageHelm.Position == pausedPosition, "Paused passage clock") || !SubmitSmoke("resume-game"))
yield break;
if (!SubmitSmoke("dock-now") || !CheckSmoke(Ship.Port == 1 && company.Voyages == 1 && page == 4 && guideContext == GuideStep.Review
&& company.History[0].Plan.FoodUnits == 1120 && company.History[0].Onboard.CrewCalls == 1, "Arrival settles once and records the orders and crew call"))
if (!SubmitSmoke("dock-now") || !CheckSmoke(harbor.PortCinematicActive && Ship.Port == 1 && company.Voyages == 1
&& root.Q<Label>("port-cinematic-name")?.text == "Nassau", "Arrival shot opens on the destination after settlement"))
yield break;
FinishVoyage();
yield return new WaitForSecondsRealtime(1.4f);
if (!CheckSmoke(harbor.PortCinematicActive && company.Voyages == 1, "Arrival cannot settle the voyage twice"))
yield break;
yield return CaptureSmoke(directory, "07-arrival-cinematic");
yield return new WaitUntil(() => !harbor.PortCinematicActive);
if (!CheckSmoke(underway == null && page == 4 && guideContext == GuideStep.Review
&& company.History[0].Plan.FoodUnits == 1120 && company.History[0].Onboard.CrewCalls == 1,
"Arrival hands off to the logbook with the passenger orders and crew call"))
yield break;
yield return CaptureSmoke(directory, "07-logbook");
if (!SubmitSmoke("voyage-0") || !SubmitSmoke("log-accounts") || !SubmitSmoke("log-voyages")
@@ -263,6 +297,10 @@ namespace Soundings
&& livePassage.Get(OnboardService.Amenities).Capacity == 0 && passageAudio.Caption.Contains("Miami"),
"Depart for the first planned call in a storm"))
yield break;
yield return new WaitUntil(() => !harbor.PortCinematicActive);
if (!CheckSmoke(!harbor.HasActiveGuest(GuestActivity.Swim) && !harbor.HasActiveGuest(GuestActivity.Wade),
"Storm conditions close the pool"))
yield break;
SelectPassageDeck(2);
if (!CheckSmoke(passageDeck == 2, "Visit the newly fitted third deck during the next crossing"))
yield break;
@@ -282,7 +320,7 @@ namespace Soundings
&& passageAudio.Caption.Contains("approaching Miami"), "The ship announces its approach to Miami before docking"))
yield break;
yield return CaptureSmoke(directory, "11b-approaching-miami");
float timeout = Time.realtimeSinceStartup + 15;
float timeout = Time.realtimeSinceStartup + 20;
while (underway != null && Time.realtimeSinceStartup < timeout)
yield return null;
if (!CheckSmoke(underway == null && Ship.Port == 0 && company.Voyages == 2
@@ -300,15 +338,20 @@ namespace Soundings
|| !CheckSmoke(underway.Origin == 0 && underway.Destination == 2 && passageAudio.Caption.Contains("Key West"),
"Fuel at the intermediate stop and cast off with the correct new port name"))
yield break;
if (!SubmitSmoke("port-cinematic-skip"))
yield break;
MovePassageToSmoke(.9f);
UpdatePortApproach();
if (!CheckSmoke(passageAudio.CurrentAnnouncement == PassageAnnouncement.Approach
&& passageAudio.Caption.Contains("approaching Key West"), "The second leg announces Key West")
|| !SubmitSmoke("dock-now") || !CheckSmoke(Ship.Port == 2 && company.Voyages == 3
&& Ship.Itinerary is { CompletedStops: 2, HasNext: false }
&& company.History[0].ItineraryLeg == 2 && company.History[0].ItineraryStartDay == company.History[1].ItineraryStartDay,
&& company.History[0].ItineraryLeg == 2 && company.History[0].ItineraryStartDay == company.History[1].ItineraryStartDay
&& root.Q<Label>("port-cinematic-name")?.text == "Key West",
"Complete the itinerary with two linked ledger records"))
yield break;
holdCinematicClock = true;
yield return CapturePortAndSkipSmoke(directory, "11d-key-west-cinematic", 1.4f);
yield return CaptureSmoke(directory, "11d-itinerary-complete");
if (!SubmitSmoke("company-menu") || !SubmitSmoke("return-title") || !SubmitSmoke("start-financed") || !SubmitSmoke("replace")
@@ -361,7 +404,13 @@ namespace Soundings
yield break;
yield return CaptureSmoke(directory, "16-ocean-class-hull");
if (!SubmitSmoke("plan-voyage") || !SubmitSmoke("port-1") || !SubmitSmoke("dispatch")
|| !SubmitSmoke("passage-deck-7") || !CheckSmoke(passageDeck == 7, "Select the eighth deck during the voyage"))
|| !CheckSmoke(harbor.PortCinematicActive && Ship.Name == "MV Crownhaven" && Ship.Decks.Count == 8,
"A custom eight-deck flagship casts off in the live cinematic"))
yield break;
holdCinematicClock = true;
yield return CapturePortAndSkipSmoke(directory, "16b-ocean-class-departure", 1.4f);
if (!SubmitSmoke("passage-deck-7")
|| !CheckSmoke(passageDeck == 7, "Select the eighth deck during the voyage"))
yield break;
yield return CaptureSmoke(directory, "17-ocean-class-cutaway");
harbor.Zoom(-90, new Vector2(.48f, .53f));
@@ -410,6 +459,18 @@ namespace Soundings
return condition;
}
private IEnumerator CapturePortAndSkipSmoke(string directory, string name, float time = -1f)
{
if (time >= 0)
{
cinematicTime = time;
PresentPortCinematicFrame(time);
}
yield return CaptureSmoke(directory, name);
SubmitSmoke("port-cinematic-skip");
holdCinematicClock = false;
}
private static IEnumerator CaptureSmoke(string directory, string name)
{
yield return null;