Add riverboat captain career and distinct ship classes
Add class-specific vessel geometry and sea motion, a guided helm qualification path, dockside sailing orders, and local excursions at all 24 ports.
This commit is contained in:
@@ -6,8 +6,6 @@ namespace BigShipTycoon
|
||||
{
|
||||
private const double PortionPerMeal = .26;
|
||||
private const int WaterPerLaundryLoad = 10;
|
||||
private static readonly double[] FuelRates = { .78, 1, 1.22 };
|
||||
private static readonly float[] ShipSpeeds = { .82f, 1, 1.22f };
|
||||
private double provisions, water, waste, fuelIntegrated, health = 99, hydration = 1;
|
||||
private double laundryBacklog, laundryCleaned;
|
||||
private int galleyUntil, pumpsUntil, treatmentUntil, laundryUntil;
|
||||
@@ -15,7 +13,7 @@ namespace BigShipTycoon
|
||||
private readonly double[] crewCoverage = new double[CrewMarket.Roles.Count];
|
||||
public bool Assisted { get; set; } = true;
|
||||
public int EngineMode { get; private set; } = 1;
|
||||
public float SpeedFactor => ShipSpeeds[EngineMode] * (float)(.86 + .14 * Coverage(CrewRole.Bridge));
|
||||
public float SpeedFactor => PortPlanning.SpeedRate(EngineMode) * (float)(.86 + .14 * Coverage(CrewRole.Bridge));
|
||||
public int Health => (int)Math.Round(health);
|
||||
public int WaterPercent => (int)Math.Round(100 * water / Ship.WaterCapacity);
|
||||
public int SewagePercent => (int)Math.Round(100 * waste / Ship.WasteCapacity);
|
||||
@@ -37,7 +35,7 @@ namespace BigShipTycoon
|
||||
public int StoreCost => 180 + Quote.Guests * 3;
|
||||
public int PumpCost => 410;
|
||||
public int TreatmentCost => 360;
|
||||
public int RepairCost => 780 + Ship.HullIndex * 490;
|
||||
public int RepairCost => Ship.HullIndex == Market.River ? 480 : 780 + Ship.HullIndex * 490;
|
||||
public bool CanOpenStores => !StoresOpened && provisions < Ship.FoodCapacity * .85 && CanSpend(StoreCost);
|
||||
public bool CanExtendLaundry => !LaundryBoost && AssignedCrew(CrewRole.Laundry) > 0 && CanSpend(LaundryShiftCost);
|
||||
|
||||
@@ -46,8 +44,8 @@ namespace BigShipTycoon
|
||||
public bool CanSpend(int cost) => tick < ticks && Expenses + cost <= Quote.TicketSales / 4;
|
||||
|
||||
public bool CanSetEngineMode(int mode) =>
|
||||
mode >= 0 && mode < FuelRates.Length
|
||||
&& (mode < 2 || (Coverage(CrewRole.Engineering) >= .85 && FuelForMode(mode) + Quote.Reserve <= Ship.Fuel));
|
||||
mode is >= 0 and <= 2 && (mode < 2 || Coverage(CrewRole.Engineering) >= .85)
|
||||
&& (mode <= EngineMode || FuelForMode(mode) + Quote.Reserve <= Ship.Fuel);
|
||||
|
||||
public void SetEngineMode(int mode)
|
||||
{
|
||||
@@ -129,8 +127,8 @@ namespace BigShipTycoon
|
||||
|
||||
private int FuelForMode(int mode)
|
||||
{
|
||||
double expected = Quote.FuelBurn * (fuelIntegrated + (ticks - tick) * FuelRates[mode]) / ticks;
|
||||
return Math.Max(1, (int)Math.Round(expected, MidpointRounding.AwayFromZero));
|
||||
double expected = Quote.FuelBurn * (fuelIntegrated + (ticks - tick) * PortPlanning.FuelRate(mode)) / ticks;
|
||||
return PortPlanning.RoundFuel(expected);
|
||||
}
|
||||
|
||||
private void AdvanceSystems()
|
||||
@@ -145,7 +143,7 @@ namespace BigShipTycoon
|
||||
BoostTreatment();
|
||||
}
|
||||
|
||||
fuelIntegrated += FuelRates[EngineMode];
|
||||
fuelIntegrated += PortPlanning.FuelRate(EngineMode);
|
||||
double portionOfDay = (double)Quote.Days / ticks;
|
||||
double engineering = .35 + .65 * Coverage(CrewRole.Engineering);
|
||||
water = Math.Min(Ship.WaterCapacity, water + Ship.WaterProduction * engineering * (PumpsBoost ? 1.9 : 1) * portionOfDay);
|
||||
|
||||
Reference in New Issue
Block a user