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:
@@ -19,6 +19,7 @@ namespace BigShipTycoon
|
||||
return;
|
||||
|
||||
float delta = Time.unscaledDeltaTime;
|
||||
PausePilotageVoice(paused || title || fleetOpen || careerMenu != CareerMenu.Closed || passageAudio.CurrentAnnouncement.HasValue);
|
||||
deckAmbience.Mix(delta, !title && !paused && !fleetOpen && !voyageMapOpen && !crewManifestOpen
|
||||
&& !ShorePlanningOpen && careerMenu == CareerMenu.Closed && !harbor.PortCinematicActive && HarborOnScreen,
|
||||
livePassage, passageAudio.CurrentAnnouncement.HasValue);
|
||||
@@ -78,7 +79,7 @@ namespace BigShipTycoon
|
||||
}
|
||||
|
||||
passageAudio.Mix(delta, underway != null && !paused,
|
||||
passageHelm?.Speed ?? 0, underway?.Weather ?? WeatherCondition.Calm,
|
||||
ActiveDockManeuver?.SpeedOverGroundKnots ?? passageHelm?.Speed ?? 0, underway?.Weather ?? WeatherCondition.Calm,
|
||||
passageBridge || passageExploring, passageServiceArea == 0);
|
||||
|
||||
if (underway != null)
|
||||
@@ -110,6 +111,12 @@ namespace BigShipTycoon
|
||||
|
||||
private void UpdateActivePassage(float delta)
|
||||
{
|
||||
if (ActiveDockManeuver is DockManeuver dock)
|
||||
{
|
||||
UpdateActiveDockManeuver(dock, delta);
|
||||
return;
|
||||
}
|
||||
|
||||
float rudder = 0;
|
||||
if (fleetOpen)
|
||||
{
|
||||
@@ -120,7 +127,7 @@ namespace BigShipTycoon
|
||||
else if (!ShorePlanningOpen && !crewManifestOpen)
|
||||
rudder = ReadNavigationControls();
|
||||
|
||||
passageHelm.Advance(delta * passageSpeed, rudder, livePassage.SpeedFactor, underway.Weather);
|
||||
passageHelm.Advance(delta * passageSpeed, rudder, PassageEngineSpeed(passageHelm, livePassage), underway.Weather);
|
||||
if (company.IsCaptainCareer && !fleetOpen && !ShorePlanningOpen && !crewManifestOpen && !voyageMapOpen)
|
||||
passageHelm.Practice.Advance(passageHelm, delta, rudder);
|
||||
float progress = passageHelm.Progress;
|
||||
@@ -133,7 +140,10 @@ namespace BigShipTycoon
|
||||
harbor.UpdatePassengers(livePassage, delta);
|
||||
if (passageHelm.Arrived)
|
||||
{
|
||||
FinishVoyage();
|
||||
if (company.IsCaptainCareer)
|
||||
BeginDockArrival(fleetPassages[Ship], Ship);
|
||||
else
|
||||
FinishVoyage();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,6 +159,9 @@ namespace BigShipTycoon
|
||||
UpdateVoyageMap();
|
||||
}
|
||||
|
||||
private float PassageEngineSpeed(HelmNavigation helm, OnboardSession session) => company.IsCaptainCareer
|
||||
? helm.HarborApproachFactor(session.SpeedFactor, session.Quote.Weather) : session.SpeedFactor;
|
||||
|
||||
private float ReadNavigationControls()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.M))
|
||||
@@ -168,15 +181,7 @@ namespace BigShipTycoon
|
||||
|
||||
private void UpdatePassageView(float delta)
|
||||
{
|
||||
if (!Input.GetMouseButton(1) || !Application.isFocused)
|
||||
SetPassageFreeLook(false);
|
||||
if (passageFreeLook && passageCursorLocked)
|
||||
{
|
||||
Vector2 look = new Vector2(Input.GetAxisRaw("Mouse X"), -Input.GetAxisRaw("Mouse Y")) * 10;
|
||||
if (look.sqrMagnitude > .001f)
|
||||
harbor.Look(look);
|
||||
}
|
||||
TurnPassageCamera(delta);
|
||||
UpdatePassageCameraLook(delta);
|
||||
if (!passageHelm.Manual && (passageExploring || passageBridge))
|
||||
{
|
||||
Vector2 movement = new Vector2(MoveAxis(KeyCode.D, KeyCode.A), MoveAxis(KeyCode.W, KeyCode.S));
|
||||
@@ -218,6 +223,19 @@ namespace BigShipTycoon
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePassageCameraLook(float delta)
|
||||
{
|
||||
if (!Input.GetMouseButton(1) || !Application.isFocused)
|
||||
SetPassageFreeLook(false);
|
||||
if (passageFreeLook && passageCursorLocked)
|
||||
{
|
||||
Vector2 look = new Vector2(Input.GetAxisRaw("Mouse X"), -Input.GetAxisRaw("Mouse Y")) * 10;
|
||||
if (look.sqrMagnitude > .001f)
|
||||
harbor.Look(look);
|
||||
}
|
||||
TurnPassageCamera(delta);
|
||||
}
|
||||
|
||||
private void UpdatePortApproach()
|
||||
{
|
||||
if (passageAudio.ApproachSent || passageHelm.Arrived)
|
||||
@@ -284,6 +302,8 @@ namespace BigShipTycoon
|
||||
|
||||
bool assisted = ship.HullIndex == Market.River || company.Voyages < 3 && ship.HullIndex == Market.Coastal;
|
||||
var passage = new FleetPassage(ship, quote, assisted);
|
||||
if (company.IsCaptainCareer)
|
||||
passage.Dock = new DockManeuver(ship.HullIndex, false);
|
||||
ResetShorePlanning();
|
||||
fleetPassages.Add(ship, passage);
|
||||
UpdateVoyageReserves();
|
||||
@@ -292,7 +312,7 @@ namespace BigShipTycoon
|
||||
Notify(null);
|
||||
FocusPassage(passage, true);
|
||||
Save();
|
||||
if (!StartPortCinematic(quote.Origin, false))
|
||||
if (company.IsCaptainCareer || !StartPortCinematic(quote.Origin, false))
|
||||
Render();
|
||||
}
|
||||
|
||||
@@ -377,7 +397,7 @@ namespace BigShipTycoon
|
||||
|
||||
private void SetPassageSpeed(int speed)
|
||||
{
|
||||
if (underway == null || (speed != 1 && speed != 2 && speed != 4) || speed == passageSpeed)
|
||||
if (underway == null || ActiveDockManeuver != null || (speed != 1 && speed != 2 && speed != 4) || speed == passageSpeed)
|
||||
return;
|
||||
if (speed != 1 && company.IsCaptainCareer && passageHelm.Manual)
|
||||
return;
|
||||
@@ -391,6 +411,8 @@ namespace BigShipTycoon
|
||||
{
|
||||
if (underway == null || paused || harbor.PortCinematicActive)
|
||||
return;
|
||||
if (company.IsCaptainCareer && (!passageHelm.Arrived || ActiveDockManeuver is not { Arriving: true, Secured: true }))
|
||||
return;
|
||||
ResetShorePlanning();
|
||||
Voyage voyage = underway;
|
||||
bool helmQualified = company.IsCaptainCareer && passageHelm.Arrived && passageHelm.Practice.Qualified;
|
||||
@@ -419,7 +441,7 @@ namespace BigShipTycoon
|
||||
arrival += " Helm qualification logged.";
|
||||
Notify(arrival);
|
||||
Save();
|
||||
if (fleetOpen)
|
||||
if (company.IsCaptainCareer || fleetOpen)
|
||||
{
|
||||
CompleteDocking();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user