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:
@@ -3,19 +3,28 @@ using System;
|
||||
namespace BigShipTycoon
|
||||
{
|
||||
public enum EntertainmentProgram { Shipboard, LiveMusic, Headline }
|
||||
public enum PassageOrder { Cruise, Economy, Express }
|
||||
|
||||
[Serializable]
|
||||
public sealed class DeparturePlan
|
||||
{
|
||||
public int FoodUnits, FoodCost, ProgramCost;
|
||||
public EntertainmentProgram Program;
|
||||
public PassageOrder Order;
|
||||
}
|
||||
|
||||
public static class PortPlanning
|
||||
{
|
||||
internal static int EngineMode(PassageOrder order) => order switch { PassageOrder.Economy => 0, PassageOrder.Express => 2, _ => 1 };
|
||||
internal static double FuelRate(int mode) => mode switch { 0 => .78, 2 => 1.22, _ => 1 };
|
||||
internal static float SpeedRate(int mode) => mode switch { 0 => .82f, 2 => 1.22f, _ => 1 };
|
||||
internal static int RoundFuel(double expected) => Math.Max(1, (int)Math.Round(expected, MidpointRounding.AwayFromZero));
|
||||
internal static int PlannedFuel(int cruiseBurn, PassageOrder order) => RoundFuel(cruiseBurn * FuelRate(EngineMode(order)));
|
||||
|
||||
private static readonly int[] FoodMarket =
|
||||
{
|
||||
462, 590, 477, 338, 423, 635, 514, 397, 452, 302, 350, 311, 475, 326, 539, 535, 658, 610, 496, 318, 372, 332
|
||||
462, 590, 477, 338, 423, 635, 514, 397, 452, 302, 350, 311, 475, 326, 539, 535, 658, 610, 496, 318, 372, 332,
|
||||
438, 407
|
||||
};
|
||||
|
||||
public static int FoodPriceCents(int port, int day)
|
||||
@@ -79,7 +88,8 @@ namespace BigShipTycoon
|
||||
|
||||
internal static double ShowTime(EntertainmentProgram program) => program == EntertainmentProgram.LiveMusic ? .42 : .63;
|
||||
|
||||
public static void Apply(Ship ship, Voyage quote, int day, int? foodUnits, EntertainmentProgram program)
|
||||
public static void Apply(Ship ship, Voyage quote, int day, int? foodUnits, EntertainmentProgram program,
|
||||
PassageOrder order = PassageOrder.Cruise)
|
||||
{
|
||||
int ordered = Market.Clamp(foodUnits ?? RecommendedFood(ship, quote), 0, ship.FoodCapacity);
|
||||
if (!CanBook(ship, program))
|
||||
@@ -90,9 +100,15 @@ namespace BigShipTycoon
|
||||
FoodUnits = ordered,
|
||||
FoodCost = (ordered * FoodPriceCents(quote.Origin, day) + 50) / 100,
|
||||
Program = program,
|
||||
ProgramCost = ProgramPrice(program, quote, day)
|
||||
ProgramCost = ProgramPrice(program, quote, day),
|
||||
Order = order
|
||||
};
|
||||
|
||||
int fuel = PlannedFuel(quote.FuelBurn, order);
|
||||
double unitCost = ship.Fuel > 0 ? ship.FuelValue / ship.Fuel : Market.FuelPrice(quote.Origin, day);
|
||||
quote.FuelExpense = (int)Math.Round(Math.Min(fuel, ship.Fuel) * unitCost
|
||||
+ Math.Max(0, fuel - ship.Fuel) * Market.FuelPrice(quote.Origin, day));
|
||||
|
||||
// The port invoice replaces the food share of baseline catering. Labor and other supplies still matter.
|
||||
quote.Catering = quote.Guests * quote.Days * 15;
|
||||
double shows = Math.Min(1, (double)ship.Entertainment / Math.Max(1, ship.Capacity));
|
||||
|
||||
Reference in New Issue
Block a user