using System; using System.Collections; using System.IO; using UnityEngine; using UnityEngine.UIElements; namespace BigShipTycoon { public sealed partial class TycoonApp { private IEnumerator VisualSmoke() { string[] args = Environment.GetCommandLineArgs(); int index = Array.IndexOf(args, "-big-ship-tycoon-smoke"); if (index + 1 >= args.Length) { Application.Quit(1); yield break; } string directory = args[index + 1]; Directory.CreateDirectory(directory); if (Array.IndexOf(args, "-captain-only") >= 0) { yield return CaptainSmoke(directory); yield break; } if (Array.IndexOf(args, "-class-lineup-only") >= 0) { yield return ClassLineupSmoke(directory); yield break; } 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 } && PassageAudio.LoadPortClip("Approach", port) is { length: > 1 }, "Named PA recordings for " + Market.Ports[port].Name)) yield break; } Vector2[] pacific = MapPaths(new[] { 15, 16 })[0]; if (!CheckSmoke(Mathf.Abs(pacific[MapSamples].x - pacific[0].x) < 45, "Voyage map wraps the date line")) yield break; if (!CheckSmoke(deckAmbience.Ready && titleArt != null && titleArt.name == "BigShipTycoonTitle", "New title art and all deck ambience loops are loaded")) yield break; brandingPreview = true; Render(); yield return CaptureSmoke(directory, "00-big-ship-tycoon-thumbnail"); brandingPreview = false; Render(); yield return CaptureSmoke(directory, "01-title"); if (!CheckSmoke(guidedCareer, "The guide is on by default") || !SubmitSmoke("guide-toggle") || !CheckSmoke(!guidedCareer, "Guide can be turned off at title") || !SubmitSmoke("guide-toggle") || !SubmitSmoke("start-used") || !SubmitSmoke("replace") || !CheckSmoke(Ship?.Name == "MV Meridian" && guideContext == GuideStep.SetCourse, "Guided used start")) yield break; yield return CaptureSmoke(directory, "02-harbor"); yield return new WaitForSecondsRealtime(.45f); float harborOverview = harbor.OrbitVerticalSpan; float farDeckFocus = deckAmbience.Focus; Vector3 harborCenter = harbor.OrbitTarget; harbor.Zoom(-90, new Vector2(.56f, .54f)); yield return new WaitForSecondsRealtime(.65f); if (!CheckSmoke(harbor.OrbitVerticalSpan < harborOverview * .22f && harbor.OrbitCameraIsClear && Vector3.Distance(harborCenter, harbor.OrbitTarget) > 2f, "Harbor wheel reaches close inspection and follows the pointer") || !CheckSmoke(deckAmbience.Focus > farDeckFocus + .35f && deckAmbience.Level(DeckSound.Deck) > .05f, $"Zooming in brings up local deck audio ({farDeckFocus:F2} to {deckAmbience.Focus:F2}, deck {deckAmbience.Level(DeckSound.Deck):F2})")) yield break; harbor.Zoom(90); yield return new WaitForSecondsRealtime(.65f); if (!CheckSmoke(harbor.OrbitVerticalSpan > harborOverview * .97f && Vector3.Distance(harborCenter, harbor.OrbitTarget) < .4f, "Zooming back out restores the harbor framing")) yield break; harbor.ResetView(true); harbor.Zoom(-13, new Vector2(.49f, .56f)); yield return new WaitForSecondsRealtime(.55f); yield return CaptureSmoke(directory, "02a-harbor-close-up"); harbor.ResetView(true); int laundry = Ship.CrewCount(CrewRole.Laundry), treasury = company.Cash; int recruitment = CrewMarket.HireFee(Ship, CrewRole.Laundry), dailyPayroll = Ship.DailyPayroll; if (!SubmitSmoke("harbor-crew-office") || !SubmitSmoke($"crew-hire-{(int)CrewRole.Laundry}") || !CheckSmoke(page == CrewOfficePage && Ship.CrewCount(CrewRole.Laundry) == laundry + 1 && company.Cash == treasury - recruitment && Ship.DailyPayroll > dailyPayroll, "Recruiting crew at the office spends cash and adds to voyage payroll")) yield break; yield return CaptureSmoke(directory, "02b-crew-office"); if (!SubmitSmoke("nav-0")) yield break; if (!SubmitSmoke("plan-voyage") || !CheckSmoke(page == 3 && destination == 1 && guideContext == GuideStep.Fare, "Set course and fare guide")) yield break; yield return CaptureSmoke(directory, "03-passage-chart"); int fare = Ship.Fare; if (!SubmitSmoke("fare-plus") || !CheckSmoke(Ship.Fare == fare + 50 && guideContext == GuideStep.CastOff, "Fare control and departure guide")) yield break; if (!SubmitSmoke("port-plan-open")) yield break; IntegerField provisioning = root.Q("port-food-units"); if (!CheckSmoke(provisioning != null && provisioning.value > 0, "Dockside orders show recommended provisions")) yield break; provisioning.value = 1120; if (!SubmitSmoke("port-program-1") || !CheckSmoke(portFoodOrder == 1120 && portProgram == EntertainmentProgram.LiveMusic, "Order an exact food quantity and book local musicians")) yield break; yield return CaptureSmoke(directory, "03a-dockside-orders"); if (!SubmitSmoke("port-plan-close")) yield break; if (!SubmitSmoke("weather-swell") || !CheckSmoke(PassageWeatherFor(0, 1) == WeatherCondition.Swell, "Select forecast conditions") || !SubmitSmoke("weather-calm")) yield break; if (!SubmitSmoke("dispatch") || !CheckSmoke(underway != null && livePassage != null && Ship.Port == 0 && company.Voyages == 0 && PassageDuration(underway) >= 175 && livePassage.Assisted && underway.Weather == WeatherCondition.Calm && underway.Plan?.FoodUnits == 1120 && underway.Plan.Program == EntertainmentProgram.LiveMusic && underway.Crew == Ship.DailyPayroll * underway.Days && livePassage.AssignedCrew(CrewRole.Laundry) == laundry + 1, "Cast off into an assisted live crossing")) yield break; if (!CheckSmoke(harbor.PortCinematicActive && Harbor.PortCinematicDuration < 5 && root.Q