Add manual port pilotage and working bridge instruments

Scale docking momentum by hull, require manual mooring and channel maneuvers in Captain Career, and add rank-specific bridge instruments and voiced training.
This commit is contained in:
josh
2026-11-29 21:34:36 -05:00
parent 290e4cb45d
commit 86ee1b99bf
57 changed files with 2454 additions and 62 deletions

View File

@@ -7,11 +7,15 @@ namespace BigShipTycoon
internal sealed class FleetPassageSnapshot
{
public int ShipIndex, Speed;
public bool ApproachAnnounced, HasDeparturePlan, HasView;
public int DockRadarRange;
public int PilotageCuesPlayed;
public bool DockRadarNorthUp, HasRadarSettings;
public bool ApproachAnnounced, HasDeparturePlan, HasView, HasDockManeuver;
public Voyage Voyage;
public HelmSnapshot Helm;
public OnboardSessionSnapshot Session;
public PassageViewSnapshot View;
public DockManeuverSnapshot Dock;
}
[Serializable]
@@ -45,7 +49,10 @@ namespace BigShipTycoon
HasDeparturePlan = hasDeparturePlan,
ApproachAnnounced = foreground ? passageAudio.ApproachSent : passage.ApproachAnnounced,
Helm = passage.Helm.CaptureState(), Session = passage.Session.CaptureState(),
HasView = view != null, View = view
HasView = view != null, View = view,
HasDockManeuver = passage.Dock != null, Dock = passage.Dock?.Capture(),
HasRadarSettings = company.IsCaptainCareer, DockRadarRange = passage.DockRadarRange,
DockRadarNorthUp = passage.DockRadarNorthUp, PilotageCuesPlayed = passage.PilotageCuesPlayed
});
}
return snapshots.ToArray();
@@ -78,7 +85,16 @@ namespace BigShipTycoon
FocusPassage(passage, false);
PassageViewSnapshot view = passage.RestoredView;
passage.RestoredView = null;
if (view != null)
if (passage.Dock != null)
{
if (view?.Bridge == true)
{
passageBridge = true;
harbor.ViewBridge();
DisplayDockInstruments(passage.Dock);
}
}
else if (view != null)
RestorePassageView(view);
else if (passage.Helm.Manual)
{
@@ -161,6 +177,32 @@ namespace BigShipTycoon
if (!passage.Helm.RestoreState(snapshot.Helm) || !passage.Session.RestoreState(snapshot.Session))
return false;
passage.Speed = snapshot.Speed;
passage.PilotageCuesPlayed = snapshot.PilotageCuesPlayed & ((1 << 11) - 1);
if (snapshot.HasRadarSettings)
{
if ((uint)snapshot.DockRadarRange >= (uint)DockRadarRanges.Length)
return false;
passage.DockRadarRange = snapshot.DockRadarRange;
passage.DockRadarNorthUp = snapshot.DockRadarNorthUp;
}
if (snapshot.HasDockManeuver)
{
DockManeuverSnapshot dock = snapshot.Dock;
if (!savedCompany.IsCaptainCareer || dock == null || passage.Speed != 1
|| dock.Arriving != passage.Helm.Arrived
|| !dock.Arriving && passage.Helm.Position.sqrMagnitude > 0)
return false;
passage.Dock = new DockManeuver(ship.HullIndex, dock.Arriving);
if (!passage.Dock.Restore(dock))
return false;
}
else if (savedCompany.IsCaptainCareer && (passage.Helm.Arrived
|| passage.Helm.Position.sqrMagnitude == 0 && passage.Helm.Speed == 0 && !passage.Helm.Manual))
{
// Older careers could be saved at the opening of a port cinematic.
passage.Dock = new DockManeuver(ship.HullIndex, passage.Helm.Arrived, passage.Helm.Speed);
passage.Speed = 1;
}
passage.ApproachAnnounced = snapshot.ApproachAnnounced;
PassageViewSnapshot view = snapshot.View;
if (snapshot.HasView && view != null && view.Deck >= -1 && view.Deck < ship.Decks.Count