Unlock expanded venues and manage concurrent fleet voyages

This commit is contained in:
josh
2026-11-28 15:36:55 -05:00
parent 636a0e2cf8
commit a9472edc35
33 changed files with 2094 additions and 363 deletions

View File

@@ -150,12 +150,14 @@ namespace Soundings
for (int side = -1; side <= 1; side += 2)
{
int row = side < 0 ? 0 : ship.Hull.Rows - 1;
Facility facility = ship.Decks[deck].Cells[row * ship.Hull.Columns + column];
Facility facility = ship.Decks[deck].FacilityAt(row * ship.Hull.Columns + column, ship.Hull.Columns);
var (floor, along, outward) = SideFrame(station, y, deckLength * .99f, deckBeam * .83f, offset,
side, DeckStations);
switch (facility)
{
case Facility.Cabin:
case Facility.Suite:
case Facility.GrandSuite:
bool occupied = (i * 3 + deck * 5 + row * 7) % 11 < 3;
BuildWindow(floor, along, outward, side, width * .76f, 1.03f, 1.73f, 2,
occupied ? Paint.Lounge : Paint.Glass);
@@ -165,6 +167,10 @@ namespace Soundings
case Facility.Entertainment:
case Facility.Bar:
case Facility.Amenity:
case Facility.Restaurant:
case Facility.CocktailLounge:
case Facility.GrandTheater:
case Facility.ResortPool:
BuildWindow(floor, along, outward, side, width * .88f, 1.35f, 1.23f, 3,
(i + deck * 2) % 6 == 0 ? Paint.Lounge : Paint.Glass);
break;
@@ -301,7 +307,7 @@ namespace Soundings
Coat(Paint.Pearl).Radome(radome + Vector3.up * .90f, .54f);
}
BuildSunDeck(SunDeckCenter(length, deck), top, deckBeam);
BuildSunDeck(SunDeck(ship), top);
}
private void BuildBridgeWing(float bridge, float top, int side)
@@ -322,21 +328,69 @@ namespace Soundings
new Vector3(.27f, .12f, .052f));
}
private void BuildSunDeck(float pool, float top, float deckBeam)
private void BuildSunDeck(SunDeckLayout plan, float top)
{
bool hasPool = ship.Count(Facility.Amenity) > 0;
if (hasPool)
float pool = plan.PoolCenter;
if (plan.HasPool)
PoolBasin(Coat(Paint.Pearl), Coat(Paint.BlueGlass), Coat(Paint.Pool), new Vector3(pool, top, 0),
new Vector2(PoolHalfLength, PoolHalfWidth), .37f, PoolWaterHeight);
plan.PoolHalfSize, .37f, PoolWaterHeight);
for (int side = -1; side <= 1; side += 2)
{
if (hasPool)
PoolRails(Coat(Paint.Steel), new Vector3(pool - 2.08f, top, side * PoolHalfWidth), side);
for (int i = 0; i < 8; i++)
BuildLounger(LoungerX(pool, i), top, deckBeam * LoungerBeamFraction, side);
BuildParasol(new Vector3(pool + 3.81f, top, side * deckBeam * .55f), side > 0);
if (plan.HasPool)
PoolRails(Coat(Paint.Steel), new Vector3(pool - plan.PoolHalfSize.x + .53f, top, side * plan.PoolHalfSize.y), side);
for (int i = 0; i < plan.Loungers; i++)
BuildLounger(plan.LoungerX(i), top, plan.LoungerDistance, side);
float shadeX = plan.Resort ? pool + plan.PoolHalfSize.x + 1.32f : pool + 3.81f;
BuildParasol(new Vector3(shadeX, top, side * plan.HalfBeam * .55f), side > 0);
if (!plan.Resort)
continue;
// Floating dividers leave three clear routes through the long basin.
float span = plan.PoolHalfSize.x - .80f;
for (int i = 0; i < 24; i++)
{
float x = pool + Mathf.Lerp(-span, span, (float)i / 24);
float z = side * plan.PoolHalfSize.y / 3;
Vector3 rope = new Vector3(x, top + PoolWaterHeight + .023f, z);
Coat(i % 5 == 0 ? Paint.Pearl : Paint.BlueGlass).Rod(rope, rope + Vector3.right * (span / 12), .025f);
}
}
if (plan.Theater)
BuildOpenAirStage(plan, top);
}
private void BuildOpenAirStage(SunDeckLayout plan, float top)
{
float x = plan.StageCenter;
float span = plan.StageHalfWidth;
Coat(Paint.Navy).Box(new Vector3(x, top + .205f, 0), new Vector3(3.12f, .41f, span * 2));
Coat(Paint.Teak).Box(new Vector3(x + .05f, top + .417f, 0), new Vector3(3.03f, .053f, span * 1.94f));
Coat(Paint.DeckCanvas).Box(new Vector3(x - 1.35f, top + 1.59f, 0), new Vector3(.19f, 2.37f, span * 1.84f));
Coat(Paint.Gold).Box(new Vector3(x + 1.58f, top + .34f, 0), new Vector3(.042f, .061f, span * 1.96f));
for (int side = -1; side <= 1; side += 2)
{
Vector3 basePoint = new Vector3(x - .96f, top + .43f, side * span * .95f);
Coat(Paint.Steel).Rod(basePoint, basePoint + Vector3.up * 2.85f, .045f, 8, true);
Coat(Paint.Black).Box(basePoint + new Vector3(.14f, .51f, -side * .16f), new Vector3(.68f, .89f, .45f));
Coat(Paint.Glass).Box(basePoint + new Vector3(.497f, .51f, -side * .16f), new Vector3(.04f, .67f, .32f));
Coat(Paint.Steel).Rod(basePoint + Vector3.up * 2.72f, basePoint + new Vector3(2.52f, 2.32f, 0), .032f);
}
Coat(Paint.Steel).Rod(new Vector3(x - .96f, top + 3.16f, -span * .95f),
new Vector3(x - .96f, top + 3.16f, span * .95f), .044f);
for (int light = -2; light <= 2; light++)
Coat(Paint.LitGlass).Box(new Vector3(x - .9f, top + 3.03f, light * span * .34f), new Vector3(.24f, .14f, .23f));
for (int row = 0; row < 2; row++)
for (int side = -1; side <= 1; side += 2)
{
float seatX = plan.StageSeatX(row);
float z = side * span * .56f;
Coat(Paint.Teak).Box(new Vector3(seatX, top + .17f, z), new Vector3(.48f, .34f, span * .76f));
Coat(Paint.DeckCanvas).Box(new Vector3(seatX, top + .37f, z), new Vector3(.46f, .11f, span * .73f));
Coat(Paint.Pearl).Box(new Vector3(seatX + .22f, top + .53f, z), new Vector3(.10f, .24f, span * .77f));
}
}
internal static void PoolBasin(HarborMesh coping, HarborMesh tile, HarborMesh water, Vector3 foot,
@@ -378,9 +432,38 @@ namespace Soundings
}
}
internal static float SunDeckCenter(float length, int deck) => DeckOffset(length, deck) + DeckLength(length, deck) * .01f;
internal readonly struct SunDeckLayout
{
internal readonly float Length, Offset, HalfBeam, PoolCenter, StageCenter, StageHalfWidth;
internal readonly bool HasPool, Resort, Theater;
internal readonly Vector2 PoolHalfSize;
internal static float LoungerX(float center, int index) => center - 3f + index * .94f;
internal SunDeckLayout(Ship ship)
{
int deck = ship.Decks.Count - 1;
Length = DeckLength(ship.Hull.Length, deck);
Offset = DeckOffset(ship.Hull.Length, deck);
HalfBeam = DeckHalfBeam(ship.Hull.Beam * .5f, deck);
Facility[] cells = ship.Decks[deck].Cells;
Resort = System.Array.IndexOf(cells, Facility.ResortPool) >= 0;
Theater = System.Array.IndexOf(cells, Facility.GrandTheater) >= 0;
HasPool = Resort || ship.Count(Facility.Amenity) > 0;
PoolCenter = Offset + Length * (Resort ? .033f : .01f);
PoolHalfSize = Resort ? new Vector2(Mathf.Min(7.15f, Length * .089f), Mathf.Min(2.77f, HalfBeam * .39f))
: new Vector2(PoolHalfLength, PoolHalfWidth);
StageCenter = Offset - Length * .376f;
StageHalfWidth = Mathf.Min(2.85f, HalfBeam * .39f);
}
internal int Loungers => Resort ? 10 : 8;
internal float LoungerDistance => HalfBeam * LoungerBeamFraction;
internal float LoungerX(int index) => Resort
? PoolCenter + Mathf.Lerp(-PoolHalfSize.x + .44f, PoolHalfSize.x - .44f, (float)index / (Loungers - 1))
: PoolCenter - 3f + index * .94f;
internal float StageSeatX(int row) => StageCenter + 3.04f + row * 1.04f;
}
internal static SunDeckLayout SunDeck(Ship ship) => new SunDeckLayout(ship);
private void BuildLounger(float x, float top, float sideDistance, int side)
{