Make Soundings voyages playable with ship operations and guided tips

This commit is contained in:
josh
2026-11-27 22:24:17 -05:00
parent 4b870fb0ce
commit 33cdd6dfa7
37 changed files with 2734 additions and 126 deletions

View File

@@ -8,6 +8,8 @@ namespace Soundings
private static readonly (int HullIndex, bool Used)[] Offers =
{ (0, true), (0, false), (1, true), (1, false), (2, false) };
private bool systemTools;
private static readonly Color DraftGrid = new Color(.37f, .62f, .65f, .19f);
private static readonly Color DraftFine = new Color(.47f, .75f, .74f, .42f);
private static readonly Color DraftInk = new Color(.64f, .89f, .82f, .88f);
@@ -112,16 +114,31 @@ namespace Soundings
var fittings = Add(work, "work-fittings");
var gauges = Add(fittings, "work-capacity-strip");
AddText(gauges, $"{ship.Beds:N0} berths", "work-capacity");
AddText(gauges, $"{ship.Meals:N0} meal covers", "work-capacity");
AddText(gauges, $"{ship.Entertainment:N0} show seats", "work-capacity");
AddText(gauges, $"{ship.Tank:N0} t bunker capacity", "work-capacity");
AddText(gauges, $"{ship.Capacity:N0} guests per sailing", "work-capacity work-capacity-emphasis");
var tools = Add(fittings, "work-tool-tray");
for (int i = 1; i <= Market.Facilities.Count; i++)
if (systemTools)
{
Facility option = (Facility)(i % Market.Facilities.Count);
AddText(gauges, $"{ship.GalleyCapacity:N0} galley covers", "work-capacity");
AddText(gauges, $"{ship.FoodCapacity:N0} stored portions", "work-capacity");
AddText(gauges, $"{ship.WaterCapacity:N0} L freshwater", "work-capacity");
AddText(gauges, $"{ship.WasteCapacity:N0} L sewage buffer", "work-capacity");
}
else
{
AddText(gauges, $"{ship.Beds:N0} berths", "work-capacity");
AddText(gauges, $"{ship.Meals:N0} meal covers", "work-capacity");
AddText(gauges, $"{ship.Entertainment:N0} show seats", "work-capacity");
AddText(gauges, $"{ship.Tank:N0} t bunker capacity", "work-capacity");
AddText(gauges, $"{ship.Capacity:N0} guests per sailing", "work-capacity work-capacity-emphasis");
}
var toolMode = Add(fittings, "work-fit-modes");
toolMode.Add(Action("Guest facilities", () => ChangeBuildTools(false), systemTools ? "" : "work-selected", "facility-guests"));
toolMode.Add(Action("Ship systems", () => ChangeBuildTools(true), systemTools ? "work-selected" : "", "facility-systems"));
var tools = Add(fittings, "work-tool-tray");
int start = systemTools ? (int)Facility.Galley : 1;
int end = systemTools ? Market.Facilities.Count : (int)Facility.Galley;
for (int i = start; i <= end; i++)
{
Facility option = i == end ? Facility.Empty : (Facility)i;
FacilitySpec spec = Market.Facilities[(int)option];
Button button = Action("", () =>
{
@@ -135,11 +152,21 @@ namespace Soundings
var copy = Add(button, "work-tool-copy");
copy.pickingMode = PickingMode.Ignore;
AddText(copy, spec.Name, "work-tool-name");
AddText(copy, option == Facility.Empty ? spec.Details : Money(spec.Price), "work-tool-cost");
AddText(copy, option == Facility.Empty ? "25% refund" : Money(spec.Price), "work-tool-cost");
tools.Add(button);
}
}
private void ChangeBuildTools(bool systems)
{
if (systemTools == systems)
return;
systemTools = systems;
tool = systems ? Facility.Galley : Facility.Cabin;
Notify(null);
Render();
}
private static string PlacementInstruction(Facility selected)
{
FacilitySpec spec = Market.Facilities[(int)selected];
@@ -211,6 +238,37 @@ namespace Soundings
Line(6,11,18,11);
Line(6,16,18,16);
break;
case Facility.Bar:
Segment(4,5,20,5,12,13,4,5);
Segment(12,13,12,20,7,20);
Line(12,20,17,20);
Line(8,8,16,8);
break;
case Facility.Amenity:
Segment(4,11,6,7,10,5,14,5,18,7,20,11,4,11);
Line(12,11,12,17);
Segment(3,19,6,17,9,19,12,17,15,19,18,17,21,19);
break;
case Facility.Galley:
Segment(3,13,17,13,15,18,5,18,3,13);
Line(17,13,22,11);
Line(8,10,8,6);
Line(12,10,12,5);
break;
case Facility.Stores:
Segment(4,5,20,5,20,19,4,19,4,5);
Line(4,11,20,11);
Line(8,8,16,8);
Line(8,15,16,15);
break;
case Facility.Water:
case Facility.Waste:
Segment(12,3,18,11,19,15,17,19,12,21,7,19,5,15,6,11,12,3);
Line(8,16,16,16);
break;
case Facility.Workshop:
Segment(6,19,15,10,14,7,18,5,20,7,19,10,16,11,8,21,6,19);
break;
default:
Line(6,6,18,18);
Line(6,18,18,6);