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:
josh
2026-11-29 20:41:00 -05:00
parent 46624bf5ba
commit 290e4cb45d
67 changed files with 1783 additions and 301 deletions

View File

@@ -9,7 +9,7 @@ namespace BigShipTycoon
{
private static readonly (int HullIndex, bool Used)[] Offers =
{ (Market.Coastal, true), (Market.Coastal, false), (Market.Regional, true), (Market.Regional, false),
(Market.Ocean, false), (Market.Mega, false) };
(Market.Ocean, false), (Market.Mega, false), (Market.River, true), (Market.River, false) };
private enum DeckTools { GuestFacilities, LargerVenues, LeisureAndRetail, ShipSystems, Gaming, MegaVenues, MegaSystems }
private DeckTools deckTools;
@@ -66,6 +66,11 @@ namespace BigShipTycoon
Notify(null);
Render();
}, "work-deck-tab", "sun-deck-open");
if (ship.HullIndex == Market.River)
{
sunDeck.SetEnabled(false);
sunDeck.tooltip = "The riverboat has a fixed roof.";
}
sunDeck.EnableInClassList("work-selected", sunDeckEditing);
band.Add(sunDeck);
for (int i = ship.Decks.Count - 1; i >= 0; i--)
@@ -184,7 +189,7 @@ namespace BigShipTycoon
foreach (Facility option in options)
{
FacilitySpec spec = Market.Facilities[(int)option];
bool locked = ship.HullIndex < spec.MinimumHull;
bool locked = !Market.MeetsHullRequirement(ship.HullIndex, spec.MinimumHull);
Button button = Action("", () =>
{
if (tool != option)
@@ -328,7 +333,8 @@ namespace BigShipTycoon
private string PlacementBlock(Ship ship, int cell)
{
FacilitySpec spec = Market.Facilities[(int)tool];
return ship.HullIndex < spec.MinimumHull ? VenueRequirement(spec) : company.BuildBlock(ship, deckIndex, cell, tool, toolRotation);
return !Market.MeetsHullRequirement(ship.HullIndex, spec.MinimumHull)
? VenueRequirement(spec) : company.BuildBlock(ship, deckIndex, cell, tool, toolRotation);
}
private void BuildAtBerth(Ship ship, Deck deck, int cell)
@@ -403,7 +409,7 @@ namespace BigShipTycoon
FacilitySpec spec = Market.Facilities[(int)selected];
if (selected == Facility.Empty)
return "Select any bay in a fitted room to remove it and recover 25%.";
if (ship.HullIndex < spec.MinimumHull)
if (!Market.MeetsHullRequirement(ship.HullIndex, spec.MinimumHull))
return VenueRequirement(spec);
string plan = spec.BayCount == 1 ? "Select an open bay" : $"Point at a bay to preview the {FootprintLabel(spec, rotation)} fitting";
return $"{plan}. {spec.Name} · {spec.Details} · {Money(spec.Price)}";
@@ -609,6 +615,8 @@ namespace BigShipTycoon
{
int selection = item;
var offer = Offers[item];
if (offer.HullIndex == Market.River && !company.IsCaptainCareer)
continue;
HullSpec candidate = Market.Hulls[offer.HullIndex];
string requirement = company.ShipyardUnlock(offer.HullIndex);
Button option = Action("", () =>
@@ -662,6 +670,13 @@ namespace BigShipTycoon
contract.Add(buy);
if (block != null)
AddText(contract, block, "work-contract-block");
else if (company.IsCaptainCareer)
{
var (previous, trips, checks) = Company.CommandRequirement(hullIndex);
if (previous >= 0)
AddText(contract, $"{Market.Hulls[previous].Name} command signed off · {trips} voyages · {checks} helm qualifications",
"work-yard-specs");
}
}
private void DrawShipyardService(VisualElement order, Ship ship)
@@ -774,8 +789,9 @@ namespace BigShipTycoon
Painter2D pen = context.painter2D;
DrawDraftGrid(pen, bounds, 33);
Vector2 P(float x, float y) => new Vector2(bounds.width * x, bounds.height * y);
float stern = .178f - hullIndex * .028f;
float bow = .833f + hullIndex * .029f;
int rank = Market.HullRank(hullIndex);
float stern = .207f - rank * .029f;
float bow = .804f + rank * .029f;
float L(float position) => Mathf.Lerp(stern, bow, position);
void Path(params float[] xy)
{
@@ -817,16 +833,23 @@ namespace BigShipTycoon
Path(1,.897f, .988f,.913f);
pen.Stroke();
pen.fillColor = new Color(.13f, .23f, .24f);
pen.fillColor = hullIndex switch
{
Market.River => new Color(.17f, .30f, .31f),
Market.Coastal => new Color(.24f, .36f, .43f),
Market.Regional => new Color(.18f, .40f, .41f),
Market.Ocean => new Color(.12f, .22f, .31f),
_ => new Color(.22f, .32f, .36f)
};
pen.strokeColor = DraftInk;
pen.lineWidth = 1.8f;
pen.BeginPath();
Vector2 transom = P(stern, .56f);
Vector2 aftDeck = P(L(.21f), .565f);
Vector2 foreDeck = P(L(.79f), .565f);
Vector2 stem = P(bow, .49f);
Vector2 forwardKeel = P(L(.903f), .712f);
Vector2 aftKeel = P(L(.135f), .712f);
Vector2 stem = P(bow, hullIndex is Market.River or Market.Coastal ? .548f : .49f);
Vector2 forwardKeel = P(L(hullIndex == Market.Ocean ? .844f : .937f), .712f);
Vector2 aftKeel = P(L(hullIndex is Market.River or Market.Coastal ? .070f : .145f), .712f);
pen.MoveTo(transom);
TraceDraftCurve(pen, transom, P(L(.11f), .57f), aftDeck);
pen.LineTo(foreDeck);
@@ -847,8 +870,20 @@ namespace BigShipTycoon
int allowedDecks = Market.Hulls[hullIndex].MaxDecks;
bool mega = hullIndex == Market.Mega;
float deckRise = mega ? .0275f : .047f;
float LeftEdge(int level) => mega ? level >= levels - 1 ? .285f : .055f + level * .0018f : .079f + level * .031f;
float RightEdge(int level) => mega ? .934f - level * .0041f : .872f - level * .04f;
float LeftEdge(int level) => hullIndex switch
{
Market.Regional => .10f + level * .047f,
Market.Ocean => .055f + level * .017f,
Market.Mega => level >= levels - 1 ? .285f : .055f + level * .0018f,
_ => .079f + level * .031f
};
float RightEdge(int level) => hullIndex switch
{
Market.Coastal => .79f - level * .023f,
Market.Ocean => .898f - level * .047f,
Market.Mega => .934f - level * .0041f,
_ => .872f - level * .04f
};
pen.strokeColor = new Color(DraftFine.r, DraftFine.g, DraftFine.b, .28f);
pen.BeginPath();
for (int level = levels; level < allowedDecks; level++)
@@ -883,13 +918,38 @@ namespace BigShipTycoon
}
float top = .57f - levels * deckRise;
pen.fillColor = new Color(.38f, .30f, .19f);
pen.strokeColor = DraftGold;
pen.BeginPath();
Path(.403f,top, .420f,top - .111f, .466f,top - .111f, .452f,top);
pen.ClosePath();
pen.Fill();
pen.Stroke();
void RoofDetail(Color fill, params float[] coordinates)
{
pen.fillColor = fill;
pen.BeginPath();
Path(coordinates);
pen.ClosePath();
pen.Fill();
pen.Stroke();
}
var glazing = new Color(.20f, .42f, .46f);
var red = new Color(.55f, .28f, .22f);
switch (hullIndex)
{
case Market.River:
RoofDetail(glazing, .63f,top, .63f,top - .069f, .80f,top - .069f, .818f,top);
break;
case Market.Coastal:
RoofDetail(red, .378f,top, .380f,top - .056f, .424f,top - .060f, .435f,top);
break;
case Market.Regional:
RoofDetail(glazing, .320f,top, .311f,top - .092f, .340f,top - .092f, .362f,top);
RoofDetail(glazing, .388f,top, .376f,top - .079f, .404f,top - .079f, .428f,top);
break;
case Market.Ocean:
RoofDetail(red, .263f,top, .236f,top - .128f, .291f,top - .128f, .330f,top);
break;
case Market.Mega:
RoofDetail(glazing, .36f,top, .38f,top - .063f, .46f,top - .062f, .48f,top);
RoofDetail(glazing, .662f,top, .689f,top - .062f, .71f,top - .077f, .736f,top - .054f, .753f,top);
break;
}
pen.strokeColor = DraftInk;
pen.BeginPath();
Path(.645f,top + .01f, .645f,top - .125f);