Add multi-stop voyages, a live chart, and named port announcements
This commit is contained in:
@@ -19,7 +19,9 @@ namespace Soundings
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if (title && pendingStart.HasValue)
|
||||
if (!paused && underway != null && voyageMapOpen)
|
||||
ToggleVoyageMap();
|
||||
else if (title && pendingStart.HasValue)
|
||||
{
|
||||
pendingStart = null;
|
||||
Render();
|
||||
@@ -62,6 +64,8 @@ namespace Soundings
|
||||
private void UpdateActivePassage()
|
||||
{
|
||||
float delta = Time.unscaledDeltaTime;
|
||||
if (Input.GetKeyDown(KeyCode.M))
|
||||
ToggleVoyageMap();
|
||||
if (Input.GetKeyDown(KeyCode.H) && (passageBridge || passageHelm.Manual))
|
||||
ToggleHelm();
|
||||
|
||||
@@ -76,6 +80,7 @@ namespace Soundings
|
||||
}
|
||||
passageHelm.Advance(delta * passageSpeed, rudder, livePassage.SpeedFactor, underway.Weather);
|
||||
float progress = passageHelm.Progress;
|
||||
UpdatePortApproach();
|
||||
bool performanceWasActive = livePassage.PerformanceActive;
|
||||
livePassage.AdvanceTo(progress);
|
||||
if (!performanceWasActive && livePassage.PerformanceActive)
|
||||
@@ -139,6 +144,18 @@ namespace Soundings
|
||||
UpdateHelmControls();
|
||||
UpdateStationInteractions();
|
||||
UpdateAnnouncement();
|
||||
UpdateVoyageMap();
|
||||
}
|
||||
|
||||
private void UpdatePortApproach()
|
||||
{
|
||||
if (passageAudio.ApproachSent || passageHelm.Arrived)
|
||||
return;
|
||||
|
||||
float usualApproach = Mathf.Clamp(PassageDuration(underway) * .17f, 18f, 44f);
|
||||
float speakingTime = (passageAudio.ApproachSeconds + 1.2f) * passageSpeed * livePassage.SpeedFactor;
|
||||
if (passageHelm.RemainingSeconds <= Mathf.Max(usualApproach, speakingTime))
|
||||
passageAudio.AnnounceApproach();
|
||||
}
|
||||
|
||||
private void TurnPassageCamera(float delta) =>
|
||||
@@ -199,6 +216,7 @@ namespace Soundings
|
||||
passageSpeed = 1;
|
||||
passageDeck = passageServiceArea = -1;
|
||||
passageBridge = passageExploring = false;
|
||||
voyageMapOpen = false;
|
||||
stationFeedbackText = null;
|
||||
passageBusinessOpen = true;
|
||||
SetPassageFreeLook(false);
|
||||
@@ -208,7 +226,7 @@ namespace Soundings
|
||||
harbor.BeginPassage(quote.Weather, PassageDuration(quote));
|
||||
harbor.ShowDeck(passageDeck);
|
||||
harbor.UpdatePassengers(livePassage, 0);
|
||||
passageAudio.Begin();
|
||||
passageAudio.Begin(quote.Destination);
|
||||
Render();
|
||||
}
|
||||
|
||||
@@ -289,6 +307,7 @@ namespace Soundings
|
||||
livePassage = null;
|
||||
passageHelm = null;
|
||||
passageServiceArea = -1;
|
||||
voyageMapOpen = false;
|
||||
passageAudio.End();
|
||||
serviceReadout = null;
|
||||
SetPassageFreeLook(false);
|
||||
@@ -303,7 +322,12 @@ namespace Soundings
|
||||
page = 4;
|
||||
ReviewGuideVoyage();
|
||||
}
|
||||
Apply(failure, $"Arrived in {Market.Ports[voyage.Destination].Name}.");
|
||||
string arrival = $"Arrived in {Market.Ports[voyage.Destination].Name}.";
|
||||
if (failure == null && voyage.ItineraryLeg > 0)
|
||||
arrival += Ship.Itinerary is { HasNext: true } itinerary
|
||||
? $" Next call is {Market.Ports[itinerary.NextPort].Name}."
|
||||
: " Itinerary complete.";
|
||||
Apply(failure, arrival);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user