Add fleet save slots and rotatable onboard venues

This commit is contained in:
josh
2026-11-28 16:04:48 -05:00
parent a9472edc35
commit c570a64840
37 changed files with 1970 additions and 310 deletions

View File

@@ -11,6 +11,7 @@ namespace Soundings.Editor
VerifyFinancedStartAndConstruction();
VerifyHullDeckProgression();
VerifyMultiBerthFacilities();
VerifyRotatableFacilities();
VerifyFlagshipCampaign();
VerifyLiveCrossingSettlement();
VerifyConcurrentSettlement();
@@ -153,6 +154,65 @@ namespace Soundings.Editor
"Ocean Class fits grand suites and a grand theater");
}
private static void VerifyRotatableFacilities()
{
Company company = Company.Start(false);
company.Cash = 2400000;
company.Voyages = 9;
company.Reputation = 42;
Require(company.Build(company.ActiveShip, 1, 9, Facility.ShoppingArcade) != null,
"Coastal hull cannot fit a shopping arcade");
Require(company.Acquire(Market.Regional, false, "Silver Current") == null, "commission a Regional hull for footprint checks");
Ship ship = company.ActiveShip;
Deck deck = ship.Decks[0];
int columns = ship.Hull.Columns;
deck.Cells[0] = Facility.Suite;
deck.Cells[1] = Facility.Extension;
Require(company.CanLoad() && deck.AnchorAt(1, columns) == 0, "legacy row layouts load without footprint metadata");
const int arcade = 4;
int lowerLeft = arcade + columns - 1;
int cash = company.Cash;
Require(company.Build(ship, 0, columns, Facility.ShoppingArcade, 2) != null && company.Cash == cash,
"a turned arcade cannot cross the portside boundary");
Require(company.Build(ship, 0, arcade, Facility.ShoppingArcade, 2) == null
&& deck.AnchorAt(lowerLeft, columns) == arcade && deck.AnchorAt(lowerLeft + 1, columns) == arcade
&& deck.Cells[arcade - 1] == Facility.Empty && deck.AnchorAt(1, columns) == 0,
"an L-shaped installation spans two rows while preserving the open bay and the legacy suite");
Require(ship.RetailCapacity == Market.Facilities[(int)Facility.ShoppingArcade].Capacity,
"arcade capacity is counted once");
cash = company.Cash;
Require(company.Build(ship, 0, arcade - 2, Facility.Spa) != null && deck.Cells[arcade - 2] == Facility.Empty
&& company.Cash == cash, "a square venue cannot overlap another venue's lower row");
Require(company.Build(ship, 0, lowerLeft, Facility.ShoppingArcade, 1) == null
&& deck.RotationAt(arcade) == 1 && deck.Cells[lowerLeft] == Facility.Empty && deck.Cells[lowerLeft + 1] == Facility.Empty
&& deck.AnchorAt(lowerLeft + 2, columns) == arcade && company.Cash == cash,
"rotating an arcade through a continuation reuses its anchor without charging again");
Require(company.Build(ship, 1, 2, Facility.Spa, 3) == null && company.Build(ship, 1, 4, Facility.WaterPark) != null,
"Regional hull fits a spa and keeps the water park locked");
company = JsonUtility.FromJson<Company>(JsonUtility.ToJson(company));
Require(company.CanLoad() && company.ActiveShip.Decks[0].AnchorAt(lowerLeft + 2, columns) == arcade
&& company.ActiveShip.Decks[1].RotationAt(2) == 3
&& company.ActiveShip.Decks[1].FacilityAt(columns + 3, columns) == Facility.Spa,
"saved footprints retain their anchors and rotations, including square venues");
Require(company.Acquire(Market.Ocean, false, "Blue Horizon") == null, "commission an Ocean Class hull for footprint checks");
ship = company.ActiveShip;
deck = ship.Decks[1];
columns = ship.Hull.Columns;
int farCorner = 2 + columns * 2 + 1;
FacilitySpec waterPark = Market.Facilities[(int)Facility.WaterPark];
Require(company.Build(ship, 1, 2, Facility.WaterPark, 1) == null
&& deck.AnchorAt(farCorner, columns) == 2 && ship.PoolCapacity == waterPark.Capacity,
"turning a three-by-two water park spans three rows and counts its capacity once");
cash = company.Cash;
Require(company.Build(ship, 1, farCorner, Facility.Empty) == null
&& Array.TrueForAll(deck.Cells, cell => cell == Facility.Empty) && company.Cash == cash + waterPark.Price / 4,
"clearing the far corner removes the water park and refunds it once");
}
private static void VerifyConcurrentSettlement()
{
Company company = Company.Start(false);