Rebrand as Big Ship Tycoon and add crew operations

This commit is contained in:
josh
2026-11-28 17:49:48 -05:00
parent a54f66cec9
commit 2c85a5ba00
68 changed files with 1642 additions and 98 deletions

View File

@@ -16,10 +16,75 @@ namespace Soundings.Editor
VerifyLiveCrossingSettlement();
VerifyConcurrentSettlement();
VerifyStormAndShipSystems();
VerifyCrewAndLaundry();
VerifyPortOrders();
VerifyMultiStopItinerary();
VerifyShoreExcursions();
Debug.Log("Soundings economy verification passed for both starts, pricing, fuel, enlarged venues, fleet settlements, saves, weather, ship systems, port orders, multi-stop itineraries and shore excursions.");
Debug.Log("Big Ship Tycoon economy verification passed for both starts, pricing, fuel, enlarged venues, fleet settlements, saves, weather, ship systems, crew payroll, laundry, port orders, multi-stop itineraries and shore excursions.");
}
private static void VerifyCrewAndLaundry()
{
Company company = Company.Start(false);
Ship ship = company.ActiveShip;
Voyage baseQuote = company.Forecast(ship, 1);
int galley = ship.CrewCount(CrewRole.Galley);
int laundry = ship.CrewCount(CrewRole.Laundry);
int dailyWage = CrewMarket.Roles[(int)CrewRole.Laundry].DailyWage;
int hireFee = CrewMarket.HireFee(ship, CrewRole.Laundry);
int initialCash = company.Cash;
Require(galley > 0 && laundry > 0 && baseQuote.Crew == ship.DailyPayroll * baseQuote.Days
&& company.DepartureBlock(ship, baseQuote) == null, "the starter vessel has a fully payable sailing crew");
Require(company.ChangeCrew(ship, CrewRole.Laundry, 1, true) != null && company.Cash == initialCash,
"an underway crew role cannot be changed");
Require(company.ChangeCrew(ship, CrewRole.Laundry, 1) == null && company.Cash == initialCash - hireFee,
"a dockside hire charges a single recruitment fee");
Voyage upgradedQuote = company.Forecast(ship, 1);
Require(ship.CrewCount(CrewRole.Laundry) == laundry + 1 && baseQuote.CrewAssigned[(int)CrewRole.Laundry] == laundry
&& upgradedQuote.Crew == baseQuote.Crew + dailyWage * upgradedQuote.Days,
"a changed roster adds daily payroll to a new quote and preserves prior voyage assignments");
var upgraded = new OnboardSession(ship, upgradedQuote) { Assisted = false };
int expandedLaundry = upgraded.LaundryCapacity;
int staffedMeals = upgraded.Get(OnboardService.Meals).Capacity;
upgraded.AdvanceTo(.50f);
Require(company.Cash == initialCash - hireFee && upgraded.LaundryCleaned > 0,
"operations use the booked roster and withhold payroll until settlement");
int beforeSail = company.Cash;
Require(company.Sail(ship, 1, upgraded) == null && company.History[0].Crew == upgradedQuote.Crew
&& company.Cash == beforeSail + upgradedQuote.CashChange
&& company.History[0].Onboard.LaundryCleaned > 0,
"arrival records payroll and laundry results and posts the exact cash change");
Require(company.Sail(ship, 1, upgraded) != null && company.Cash == beforeSail + upgradedQuote.CashChange,
"a completed voyage cannot debit payroll twice");
Require(CrewMarket.HireFee(ship, CrewRole.Laundry) != hireFee,
"the same role costs a different recruitment fee at another port");
company = JsonUtility.FromJson<Company>(JsonUtility.ToJson(company));
Require(company.CanLoad() && company.ActiveShip.CrewCount(CrewRole.Laundry) == laundry + 1
&& company.History[0].CrewAssigned[(int)CrewRole.Laundry] == laundry + 1
&& company.History[0].Onboard.LaundryCleaned > 0,
"staff contracts, booked manifests and laundry statistics survive a career save");
company = Company.Start(false);
ship = company.ActiveShip;
for (int release = 0; release < 3; release++)
{
Require(company.ChangeCrew(ship, CrewRole.Galley, -1) == null
&& company.ChangeCrew(ship, CrewRole.Laundry, -1) == null,
"release service staff at port");
}
Voyage leanQuote = company.Forecast(ship, 1);
var lean = new OnboardSession(ship, leanQuote) { Assisted = false };
Require(lean.LaundryCapacity < expandedLaundry && lean.LaundryCapacity < lean.LaundryDemand
&& lean.Get(OnboardService.Meals).Capacity < staffedMeals,
"smaller Galley and Laundry teams limit actual onboard service");
lean.AdvanceTo(.50f);
Require(lean.LaundryBacklog > 0 && lean.CanExtendLaundry, "an undersized laundry roster builds up a linen backlog");
int regularCapacity = lean.LaundryCapacity;
int beforeShift = lean.Expenses;
lean.ExtendLaundry();
Require(lean.LaundryBoost && lean.LaundryCapacity > regularCapacity && lean.Expenses == beforeShift + lean.LaundryShiftCost,
"the player can authorize a paid extra laundry shift during the voyage");
}
private static void VerifyShoreExcursions()