Fix port cinematics and expand ship attractions
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Soundings.Editor
|
||||
VerifyHullDeckProgression();
|
||||
VerifyMultiBerthFacilities();
|
||||
VerifyRotatableFacilities();
|
||||
VerifySunDeckRefit();
|
||||
VerifyFlagshipCampaign();
|
||||
VerifyLiveCrossingSettlement();
|
||||
VerifyConcurrentSettlement();
|
||||
@@ -20,7 +21,34 @@ namespace Soundings.Editor
|
||||
VerifyPortOrders();
|
||||
VerifyMultiStopItinerary();
|
||||
VerifyShoreExcursions();
|
||||
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.");
|
||||
Debug.Log("Big Ship Tycoon economy verification passed for both starts, pricing, fuel, venue and sun deck refits, fleet settlements, saves, weather, ship systems, crew payroll, laundry, port orders, multi-stop itineraries and shore excursions.");
|
||||
}
|
||||
|
||||
private static void VerifySunDeckRefit()
|
||||
{
|
||||
Company company = Company.Start(false);
|
||||
Ship ship = company.ActiveShip;
|
||||
int cash = company.Cash, originalCapacity = ship.PoolCapacity;
|
||||
var plan = new SunDeckPlan
|
||||
{
|
||||
Pool = SunPoolStyle.Compact,
|
||||
Shape = SunPoolShape.Oval,
|
||||
Position = SunPoolPosition.Aft,
|
||||
Attraction = SunAttraction.MiniGolf,
|
||||
ExtraLoungers = true
|
||||
};
|
||||
Require(company.ChangeSunDeck(ship, plan) == null && company.Cash < cash && ship.PoolCapacity > originalCapacity,
|
||||
"a pool and miniature golf course cost cash and add amenity places");
|
||||
int remaining = company.Cash;
|
||||
Require(company.ChangeSunDeck(ship, plan) == null && company.Cash == remaining, "unchanged sun deck refits do not charge again");
|
||||
Company restored = JsonUtility.FromJson<Company>(JsonUtility.ToJson(company));
|
||||
Require(restored.CanLoad() && restored.ActiveShip.SunDeckPlan.Pool == plan.Pool
|
||||
&& restored.ActiveShip.SunDeckPlan.Shape == plan.Shape && restored.ActiveShip.SunDeckPlan.Position == plan.Position
|
||||
&& restored.ActiveShip.SunDeckPlan.Attraction == plan.Attraction && restored.ActiveShip.SunDeckPlan.ExtraLoungers,
|
||||
"sun deck fittings and placement survive a career save");
|
||||
plan.Attraction = SunAttraction.RollerCoaster;
|
||||
Require(company.ChangeSunDeck(ship, plan) != null && company.Cash == remaining && ship.SunDeckPlan.Attraction == SunAttraction.MiniGolf,
|
||||
"a small hull cannot install a roller coaster or spend money attempting it");
|
||||
}
|
||||
|
||||
private static void VerifyCrewAndLaundry()
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Soundings.Editor
|
||||
EditorBuildSettings.scenes = new[] { new EditorBuildSettingsScene(ScenePath, true) };
|
||||
PlayerSettings.companyName = "Soundings";
|
||||
PlayerSettings.productName = "Big Ship Tycoon";
|
||||
PlayerSettings.bundleVersion = "0.11.0";
|
||||
PlayerSettings.bundleVersion = "0.12.0";
|
||||
PlayerSettings.defaultScreenWidth = 1920;
|
||||
PlayerSettings.defaultScreenHeight = 1080;
|
||||
PlayerSettings.fullScreenMode = FullScreenMode.FullScreenWindow;
|
||||
|
||||
12
Assets/Soundings/Resources/SunDeck.uss
Normal file
12
Assets/Soundings/Resources/SunDeck.uss
Normal file
@@ -0,0 +1,12 @@
|
||||
.sun-deck-panel { flex-shrink: 0; }
|
||||
.sun-deck-options { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 5px; }
|
||||
.sun-deck-option-label { width: 127px; color: #c3d6d0; font-size: 13px; }
|
||||
.sun-deck-choice { min-height: 30px; padding: 0 10px; margin: 2px 5px 2px 0; }
|
||||
.sun-deck-choice.sun-deck-selected { background-color: #c5d8c6; color: #193633; border-color: #b9cba7; }
|
||||
.sun-deck-diagram { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
|
||||
.sun-diagram-fitting { position: absolute; justify-content: center; align-items: center; }
|
||||
.sun-diagram-label { font-size: 12px; color: #ebead8; -unity-font-style: bold; }
|
||||
.sun-diagram-fixed { background-color: #283a42; border-width: 1px; border-color: #647f80; }
|
||||
.sun-diagram-attraction { background-color: #445733; border-width: 1px; border-color: #a5b47b; }
|
||||
.sun-diagram-pool { background-color: #146c79; border-width: 2px; border-color: #81cfd4; border-radius: 4px; }
|
||||
.sun-diagram-oval { border-radius: 58px; }
|
||||
12
Assets/Soundings/Resources/SunDeck.uss.meta
Normal file
12
Assets/Soundings/Resources/SunDeck.uss.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c02ce1a519bc01cca2bb1da320fb0b0
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
unsupportedSelectorAction: 0
|
||||
54
Assets/Soundings/Runtime/CasinoDeck.cs
Normal file
54
Assets/Soundings/Runtime/CasinoDeck.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
internal sealed partial class DeckPassengers
|
||||
{
|
||||
private static void FitCasino(Venue room, Facility facility, float width, float depth)
|
||||
{
|
||||
float tableHalfWidth = Mathf.Min(1.30f, width * .14f);
|
||||
int rows = facility == Facility.CasinoLounge ? 1 : facility == Facility.GrandCasino ? 3 : 2;
|
||||
for (int i = 0; i < rows * 2; i++)
|
||||
{
|
||||
float x = (i % 2 == 0 ? -1 : 1) * width * .24f;
|
||||
float z = (i / 2 - (rows - 1) * .5f) * depth * (rows == 2 ? .34f : .26f);
|
||||
room.Solid(Joinery, x, .71f, z, tableHalfWidth * 2, .15f, 1.05f);
|
||||
room.Box(CasinoFelt, x, .799f, z, tableHalfWidth * 1.86f, .026f, .91f);
|
||||
room.Box(Brass, x, .769f, z - .519f, tableHalfWidth * 1.98f, .038f, .017f);
|
||||
room.Box(DeckTrim, x, .29f, z, .29f, .57f, .54f);
|
||||
room.Box(Alloy, x, .061f, z, .71f, .08f, .70f);
|
||||
for (int seat = -1; seat <= 1; seat++)
|
||||
{
|
||||
float place = x + seat * tableHalfWidth * .59f;
|
||||
room.Seat(place, z - .90f, ShowVelvet);
|
||||
room.Guest(GuestActivity.PlayCards, place, z - .90f, 17 + i * 11 + seat, OnboardService.Casino,
|
||||
.08f + (seat + 1) * .045f + i * .025f, .49f);
|
||||
for (int card = 0; card < 2; card++)
|
||||
room.Box(Ivory, place + card * .08f, .816f, z - .25f, .063f, .006f, .09f);
|
||||
for (int chip = 0; chip < 3; chip++)
|
||||
room.Cylinder(chip == 1 ? Ivory : Brass, place + .24f, .81f + chip * .011f, z - .14f, .011f, .025f);
|
||||
}
|
||||
room.Guest(GuestActivity.Dealer, x, z + .94f, 61 + i, OnboardService.Casino, .04f, direction: -1);
|
||||
room.Box(Alloy, x, .825f, z + .35f, .59f, .042f, .13f);
|
||||
}
|
||||
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
for (int i = 0; i < rows + 1; i++)
|
||||
{
|
||||
float x = side * width * .448f;
|
||||
float z = (i - rows * .5f) * Mathf.Min(.92f, depth * .16f);
|
||||
room.Solid(DisplayDark, x, .70f, z, .63f, 1.40f, .64f);
|
||||
room.Box(Brass, x - side * .322f, 1.09f, z, .046f, .46f, .53f);
|
||||
room.Box(ScreenChart, x - side * .348f, 1.12f, z, .018f, .28f, .38f);
|
||||
room.Box(ScreenAmber, x - side * .355f, .91f, z, .026f, .053f, .23f);
|
||||
}
|
||||
|
||||
float cashZ = depth * .41f;
|
||||
room.Solid(Joinery, 0, .48f, cashZ, 2.48f, .96f, .63f);
|
||||
room.Box(Marble, 0, .99f, cashZ, 2.62f, .10f, .73f);
|
||||
room.Box(Alloy, 0, .55f, cashZ - .326f, 2.3f, .045f, .034f);
|
||||
room.Box(DeckTrim, -.63f, 1.10f, cashZ + .12f, .37f, .16f, .29f);
|
||||
room.Station(StationKind.Casino, 0, cashZ - .56f);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Soundings/Runtime/CasinoDeck.cs.meta
Normal file
2
Assets/Soundings/Runtime/CasinoDeck.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b267118ba936b92887d5ce06e902f7f
|
||||
@@ -122,11 +122,12 @@ namespace Soundings
|
||||
public int SuiteBerths => FacilityCapacity(Facility.Suite) + FacilityCapacity(Facility.GrandSuite);
|
||||
internal int GrandSuiteBerths => FacilityCapacity(Facility.GrandSuite);
|
||||
public int Meals => (FacilityCapacity(Facility.Dining) + FacilityCapacity(Facility.Restaurant)) * 3;
|
||||
public int Entertainment => FacilityCapacity(Facility.Entertainment) + FacilityCapacity(Facility.GrandTheater);
|
||||
public int Entertainment => FacilityCapacity(Facility.Entertainment) + FacilityCapacity(Facility.GrandTheater) + SunDeckPlan.AddedShows;
|
||||
public int PoolCapacity => FacilityCapacity(Facility.Amenity) + FacilityCapacity(Facility.ResortPool)
|
||||
+ FacilityCapacity(Facility.Spa) + FacilityCapacity(Facility.WaterPark);
|
||||
+ FacilityCapacity(Facility.Spa) + FacilityCapacity(Facility.WaterPark) + SunDeckPlan.AddedAmenities;
|
||||
public int BarCapacity => FacilityCapacity(Facility.Bar) + FacilityCapacity(Facility.CocktailLounge);
|
||||
public int RetailCapacity => FacilityCapacity(Facility.Shop) + FacilityCapacity(Facility.ShoppingArcade);
|
||||
public int CasinoCapacity => FacilityCapacity(Facility.CasinoLounge) + FacilityCapacity(Facility.Casino) + FacilityCapacity(Facility.GrandCasino);
|
||||
public int Capacity => Math.Min(Beds, Meals);
|
||||
public int GalleyCapacity => 168 + HullIndex * 72 + FacilityCapacity(Facility.Galley);
|
||||
public int FoodCapacity => 1500 + HullIndex * 640 + FacilityCapacity(Facility.Stores);
|
||||
@@ -251,7 +252,7 @@ namespace Soundings
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ship.Fuel > ship.Tank || !ValidSavedItinerary(ship) || !ship.ValidShorePlans() || !ship.ValidCrew()
|
||||
if (ship.Fuel > ship.Tank || !ValidSavedItinerary(ship) || !ship.ValidShorePlans() || !ship.ValidCrew() || !ship.HasValidSunDeckPlan
|
||||
|| ship.ShoreCall is ShoreCall call && (call.CallId < 1 || call.CallId > Voyages
|
||||
|| !callIds.Add(call.CallId) || !call.CanLoad(ship.Port)))
|
||||
return false;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Soundings
|
||||
private static readonly (int HullIndex, bool Used)[] Offers =
|
||||
{ (0, true), (0, false), (1, true), (1, false), (2, false) };
|
||||
|
||||
private enum DeckTools { GuestFacilities, LargerVenues, LeisureAndRetail, ShipSystems }
|
||||
private enum DeckTools { GuestFacilities, LargerVenues, LeisureAndRetail, ShipSystems, Gaming }
|
||||
private DeckTools deckTools;
|
||||
private int toolRotation;
|
||||
private Action refreshDeckPlacement;
|
||||
@@ -20,6 +20,7 @@ namespace Soundings
|
||||
private static readonly Facility[] ExpandedTools = { Facility.Suite, Facility.GrandSuite, Facility.Restaurant,
|
||||
Facility.GrandTheater, Facility.ResortPool, Facility.CocktailLounge, Facility.Empty };
|
||||
private static readonly Facility[] LeisureTools = { Facility.Shop, Facility.ShoppingArcade, Facility.Spa, Facility.WaterPark, Facility.Empty };
|
||||
private static readonly Facility[] CasinoTools = { Facility.CasinoLounge, Facility.Casino, Facility.GrandCasino, Facility.Empty };
|
||||
private static readonly Facility[] SystemsTools = { Facility.Galley, Facility.Stores, Facility.Water,
|
||||
Facility.Waste, Facility.Workshop, Facility.Empty };
|
||||
|
||||
@@ -46,20 +47,30 @@ namespace Soundings
|
||||
var heading = Add(titleBar, "ship-work-name");
|
||||
AddText(heading, "DECK PLANS", "work-caption");
|
||||
AddDisplay(heading, ship.Name, "ship-work-heading");
|
||||
AddText(heading, $"{ship.Hull.Name} hull · Deck {deckIndex + 1} of {ship.Decks.Count}", "ship-work-detail");
|
||||
string deckTitle = sunDeckEditing ? "Open-air sun deck" : $"Deck {deckIndex + 1} of {ship.Decks.Count}";
|
||||
AddText(heading, $"{ship.Hull.Name} hull · {deckTitle}", "ship-work-detail");
|
||||
|
||||
var deckControls = Add(titleBar, "work-deck-controls");
|
||||
var selector = Add(deckControls, "work-deck-selector");
|
||||
Button sunDeck = Action("Sun deck", () =>
|
||||
{
|
||||
sunDeckEditing = true;
|
||||
Notify(null);
|
||||
Render();
|
||||
}, "work-deck-tab", "sun-deck-open");
|
||||
sunDeck.EnableInClassList("work-selected", sunDeckEditing);
|
||||
selector.Add(sunDeck);
|
||||
for (int i = ship.Decks.Count - 1; i >= 0; i--)
|
||||
{
|
||||
int floor = i;
|
||||
Button level = Action($"Deck {i + 1}", () =>
|
||||
{
|
||||
deckIndex = floor;
|
||||
sunDeckEditing = false;
|
||||
Notify(null);
|
||||
Render();
|
||||
}, "work-deck-tab", $"deck-{i}");
|
||||
level.EnableInClassList("work-selected", deckIndex == i);
|
||||
level.EnableInClassList("work-selected", !sunDeckEditing && deckIndex == i);
|
||||
selector.Add(level);
|
||||
}
|
||||
int deckPrice = company.DeckPrice(ship);
|
||||
@@ -68,12 +79,22 @@ namespace Soundings
|
||||
{
|
||||
string failure = company.AddDeck(ship);
|
||||
if (failure == null)
|
||||
{
|
||||
deckIndex = ship.Decks.Count - 1;
|
||||
sunDeckEditing = false;
|
||||
}
|
||||
Apply(failure, "New deck ready to fit out.");
|
||||
}, "work-deck-add", "add-deck");
|
||||
add.SetEnabled(ship.Decks.Count < ship.Hull.MaxDecks && company.AvailableCash >= deckPrice);
|
||||
deckControls.Add(add);
|
||||
|
||||
if (sunDeckEditing)
|
||||
{
|
||||
refreshDeckPlacement = null;
|
||||
DrawSunDeckEditor(work, ship);
|
||||
return;
|
||||
}
|
||||
|
||||
var board = Add(work, "work-draft");
|
||||
board.generateVisualContent += context => DrawDeckOutline(context, ship.Hull.Columns);
|
||||
var markings = Add(board, "work-draft-markings");
|
||||
@@ -111,6 +132,8 @@ namespace Soundings
|
||||
else
|
||||
AddText(gauges, $"{ship.BarCapacity:N0} drink orders", "work-capacity");
|
||||
}
|
||||
else if (deckTools == DeckTools.Gaming)
|
||||
AddText(gauges, $"{ship.CasinoCapacity:N0} gaming seats", "work-capacity");
|
||||
else
|
||||
AddText(gauges, $"{ship.Tank:N0} t bunker capacity", "work-capacity");
|
||||
AddText(gauges, $"{ship.Capacity:N0} guests per sailing", "work-capacity work-capacity-emphasis");
|
||||
@@ -120,6 +143,7 @@ namespace Soundings
|
||||
AddBuildToolTab(toolMode, "Guest facilities", "facility-guests", DeckTools.GuestFacilities, Facility.Cabin);
|
||||
AddBuildToolTab(toolMode, "Larger venues", "facility-larger", DeckTools.LargerVenues, Facility.Suite);
|
||||
AddBuildToolTab(toolMode, "Leisure & retail", "facility-leisure", DeckTools.LeisureAndRetail, Facility.Shop);
|
||||
AddBuildToolTab(toolMode, "Casinos", "facility-casino", DeckTools.Gaming, Facility.CasinoLounge);
|
||||
AddBuildToolTab(toolMode, "Ship systems", "facility-systems", DeckTools.ShipSystems, Facility.Galley);
|
||||
FacilitySpec selectedSpec = Market.Facilities[(int)tool];
|
||||
if (selectedSpec.BayCount > 1)
|
||||
@@ -134,6 +158,7 @@ namespace Soundings
|
||||
{
|
||||
DeckTools.LargerVenues => ExpandedTools,
|
||||
DeckTools.LeisureAndRetail => LeisureTools,
|
||||
DeckTools.Gaming => CasinoTools,
|
||||
DeckTools.ShipSystems => SystemsTools,
|
||||
_ => GuestTools
|
||||
};
|
||||
@@ -489,6 +514,13 @@ namespace Soundings
|
||||
Segment(9,9,9,6,10,4,14,4,15,6,15,9);
|
||||
Line(8,15,16,15);
|
||||
break;
|
||||
case Facility.Casino:
|
||||
case Facility.CasinoLounge:
|
||||
case Facility.GrandCasino:
|
||||
Segment(5,10,11,4,20,13,14,19,5,10);
|
||||
Segment(4,12,12,21,15,20);
|
||||
Segment(11,10,13,8,15,11,13,14,11,10);
|
||||
break;
|
||||
case Facility.Galley:
|
||||
Segment(3,13,17,13,15,18,5,18,3,13);
|
||||
Line(17,13,22,11);
|
||||
|
||||
@@ -179,6 +179,10 @@ namespace Soundings
|
||||
Heard(DeckSound.Retail, station.Position, .30f * Service(OnboardService.Retail), .92f);
|
||||
Heard(DeckSound.Crowd, station.Position, passengers * Service(OnboardService.Retail) * .25f, 1);
|
||||
break;
|
||||
case StationKind.Casino:
|
||||
Heard(DeckSound.Dining, station.Position, Service(OnboardService.Casino) * .21f, .98f);
|
||||
Heard(DeckSound.Crowd, station.Position, passengers * Service(OnboardService.Casino) * .30f, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return focus;
|
||||
|
||||
@@ -154,7 +154,9 @@ namespace Soundings
|
||||
if ((rotation & 1) != 0)
|
||||
(width, depth) = (depth, width);
|
||||
var room = new Venue(structure, layout, center, row == 0 ? -1 : 1, seed, rotation);
|
||||
if (facility is Facility.Shop or Facility.Spa or Facility.WaterPark)
|
||||
if (Market.IsCasino(facility))
|
||||
FitCasino(room, facility, width, depth);
|
||||
else if (facility is Facility.Shop or Facility.Spa or Facility.WaterPark)
|
||||
FitNewVenue(room, facility, width, depth);
|
||||
else
|
||||
{
|
||||
@@ -224,7 +226,7 @@ namespace Soundings
|
||||
|
||||
private static bool IsGlazed(Facility facility) => facility is Facility.Cabin or Facility.Dining or Facility.Bar or Facility.Amenity
|
||||
or Facility.Suite or Facility.GrandSuite or Facility.Restaurant or Facility.ResortPool or Facility.CocktailLounge
|
||||
or Facility.Shop or Facility.ShoppingArcade or Facility.Spa or Facility.WaterPark;
|
||||
or Facility.Shop or Facility.ShoppingArcade or Facility.Spa or Facility.WaterPark || Market.IsCasino(facility);
|
||||
|
||||
private static int FacilityFloor(Facility facility) => facility switch
|
||||
{
|
||||
@@ -232,6 +234,7 @@ namespace Soundings
|
||||
Facility.Entertainment or Facility.GrandTheater => 11, Facility.Bar or Facility.CocktailLounge => 7,
|
||||
Facility.Suite or Facility.GrandSuite => SuiteCarpet, Facility.ResortPool or Facility.Spa or Facility.WaterPark => PoolDeck,
|
||||
Facility.Shop or Facility.ShoppingArcade => Marble,
|
||||
Facility.Casino or Facility.CasinoLounge or Facility.GrandCasino => SuiteCarpet,
|
||||
Facility.Amenity => PoolDeck, Facility.Galley or Facility.Workshop => BridgeFloor, _ => DeckTrim
|
||||
};
|
||||
|
||||
@@ -246,6 +249,7 @@ namespace Soundings
|
||||
Facility.Water => StationKind.Water, Facility.Waste => StationKind.Waste,
|
||||
Facility.Workshop => StationKind.Maintenance,
|
||||
Facility.Shop or Facility.ShoppingArcade => StationKind.Retail,
|
||||
Facility.Casino or Facility.CasinoLounge or Facility.GrandCasino => StationKind.Casino,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Soundings
|
||||
ScreenGreen = 35, ScreenAmber = 36, BridgeFloor = 37, Upholstery = 38, SafetyGreen = 39,
|
||||
ScreenWater = 40, ScreenLand = 41, ScreenRed = 42, WindowGlass = 43, PoolWater = 44, PoolTile = 45,
|
||||
SuiteCarpet = 46, Brass = 47, ShowVelvet = 48, PoolDeck = 49, LoungeLeather = 50, Marble = 51,
|
||||
PromenadeRunner = 52, Linen = 53;
|
||||
PromenadeRunner = 52, Linen = 53, CasinoFelt = 54;
|
||||
private static readonly string[] Paint =
|
||||
{
|
||||
"142C3F", "E1DBCA", "B88754", "8A613C", "283846", "678B93", "B45944", "497975",
|
||||
@@ -24,7 +24,7 @@ namespace Soundings
|
||||
"B7BFC0", "AD825C", "91A9AF", "284550", "385361", "DCE1DB", "FFF1D7", "202D36",
|
||||
"111D25", "8ED9E0", "65C89B", "E7B868", "3F565C", "416172", "527D65", "29485A", "A8AB71",
|
||||
"D66D57", "80B6C5", "3796A3", "47878F", "485C6C", "BD9660", "85424D", "9BAFA8", "59716B", "E7E0D5",
|
||||
"43696C", "E9DEBD"
|
||||
"43696C", "E9DEBD", "346952"
|
||||
};
|
||||
|
||||
private readonly Transform shipRoot;
|
||||
@@ -205,6 +205,8 @@ namespace Soundings
|
||||
animationTime += Mathf.Max(0, delta);
|
||||
if (bridgeView)
|
||||
return;
|
||||
if (activeIndex < 0)
|
||||
TickSunAttraction(session, delta);
|
||||
Layout layout = activeIndex < 0 ? promenade : decks[activeIndex];
|
||||
if (!layout.Crowd.activeSelf)
|
||||
layout.Crowd.SetActive(true);
|
||||
@@ -254,16 +256,18 @@ namespace Soundings
|
||||
if (plan.HasPool)
|
||||
{
|
||||
float waterY = BridgeHeight + VesselExterior.PoolWaterHeight;
|
||||
float swimLength = poolLength * (plan.OvalPool ? .82f : 1);
|
||||
float wadeLength = plan.OvalPool ? poolLength * .80f : poolLength;
|
||||
AddGuest(layout, GuestActivity.Swim, new Vector3(pool, waterY, -poolWidth * (plan.Resort ? .61f : .47f)),
|
||||
440, 90, sunDeckService, .20f, swimHalfLength: poolLength - 1.11f);
|
||||
440, 90, sunDeckService, .20f, swimHalfLength: swimLength - 1.11f);
|
||||
AddGuest(layout, GuestActivity.Swim, new Vector3(pool - .32f, waterY, plan.Resort ? 0 : .25f),
|
||||
587, -90, sunDeckService, .53f, swimHalfLength: poolLength - 1.43f);
|
||||
587, -90, sunDeckService, .53f, swimHalfLength: swimLength - 1.43f);
|
||||
if (plan.Resort)
|
||||
AddGuest(layout, GuestActivity.Swim, new Vector3(pool - .64f, waterY, poolWidth * .61f),
|
||||
387, 90, sunDeckService, .62f, swimHalfLength: poolLength - 1.76f);
|
||||
AddGuest(layout, GuestActivity.Wade, new Vector3(pool + poolLength - .89f, waterY, poolWidth * .55f),
|
||||
387, 90, sunDeckService, .62f, swimHalfLength: swimLength - 1.76f);
|
||||
AddGuest(layout, GuestActivity.Wade, new Vector3(pool + wadeLength - .89f, waterY, poolWidth * .55f),
|
||||
768, -96, sunDeckService, .33f);
|
||||
AddGuest(layout, GuestActivity.Wade, new Vector3(pool + poolLength - 1.61f, waterY, poolWidth * .64f),
|
||||
AddGuest(layout, GuestActivity.Wade, new Vector3(pool + wadeLength - 1.61f, waterY, poolWidth * .64f),
|
||||
921, 82, sunDeckService, .67f);
|
||||
AddGuest(layout, GuestActivity.Photograph, new Vector3(pool + poolLength + .31f, y, -poolWidth - .52f), 62, -53,
|
||||
sunDeckService, .64f);
|
||||
@@ -285,6 +289,7 @@ namespace Soundings
|
||||
-90, shows, .24f + seat * .18f + row * .15f, .37f);
|
||||
}
|
||||
}
|
||||
AddSunAttractionGuests(layout, plan, y);
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
||||
@@ -600,6 +600,7 @@ namespace Soundings
|
||||
foreach (Deck deck in ship.Decks)
|
||||
for (int cell = 0; cell < deck.Cells.Length; cell++)
|
||||
layout = unchecked(layout * 109 + (uint)deck.Cells[cell] * 4 + (uint)deck.RotationAt(cell) + 1);
|
||||
layout = unchecked(layout * 109 + (uint)ship.SunDeckPlanCode);
|
||||
|
||||
if (ReferenceEquals(displayedShip, ship) && hullIndex == lastHull && deckCount == lastDecks && layout == lastLayout)
|
||||
return;
|
||||
@@ -678,6 +679,8 @@ namespace Soundings
|
||||
VesselExterior.Paint.DeckCanvas => ("315263", .91f, 0f, 0f, .15f),
|
||||
VesselExterior.Paint.PortLight => ("D84738", .25f, .05f, .90f, 0f),
|
||||
VesselExterior.Paint.StarboardLight => ("4DCA8E", .25f, .05f, .90f, 0f),
|
||||
VesselExterior.Paint.Turf => ("5F8E54", .92f, 0f, 0f, .08f),
|
||||
VesselExterior.Paint.Fringe => ("375D3D", .95f, 0f, 0f, .12f),
|
||||
_ => ("318994", .16f, .40f, .05f, .13f)
|
||||
};
|
||||
ColorUtility.TryParseHtmlString("#" + hex, out Color color);
|
||||
|
||||
@@ -19,6 +19,14 @@ namespace Soundings
|
||||
|
||||
internal bool PortCinematicActive => cinematicPort >= 0;
|
||||
|
||||
internal (Vector2 Near, Vector2 Far, Vector4 Matte) PortCinematicAlignment()
|
||||
{
|
||||
Vector3 edge = new(0, 1.4f, -QuayWidth * .5f);
|
||||
Vector3 near = portQuay.transform.TransformPoint(edge - Vector3.right * QuayLength * .45f);
|
||||
Vector3 far = portQuay.transform.TransformPoint(edge + Vector3.right * QuayLength * .45f);
|
||||
return (viewCamera.WorldToViewportPoint(near), viewCamera.WorldToViewportPoint(far), water.GetVector("_PortMatteCrop"));
|
||||
}
|
||||
|
||||
internal bool BeginPortCinematic(int port, bool arriving)
|
||||
{
|
||||
if (PortCinematicActive || vessel == null || port < 0 || port >= Market.Ports.Count)
|
||||
@@ -101,7 +109,7 @@ namespace Soundings
|
||||
|
||||
private (Vector2 Center, float Heading, float Knots) PortMotion(float t)
|
||||
{
|
||||
float run = Mathf.Min(35f, vesselLength * .38f);
|
||||
float run = PortRun;
|
||||
if (portArrival)
|
||||
{
|
||||
float slowing = t * (2f - t);
|
||||
@@ -116,6 +124,8 @@ namespace Soundings
|
||||
castOff * 10.5f, Mathf.Lerp(1.4f, 12.6f, t));
|
||||
}
|
||||
|
||||
private float PortRun => Mathf.Min(35f, vesselLength * .38f);
|
||||
|
||||
private static Vector2 PortBow(float heading)
|
||||
{
|
||||
float radians = heading * Mathf.Deg2Rad;
|
||||
@@ -130,20 +140,34 @@ namespace Soundings
|
||||
|
||||
private void ComposePortCinematic()
|
||||
{
|
||||
if (portMatteAspect > 0)
|
||||
{
|
||||
// Painted waterfronts were framed broadside. A fixed lens keeps the painted shore and 3D berth aligned.
|
||||
var fixedFacing = Quaternion.Euler(portArrival ? 10.4f : 9.9f, 0, 0);
|
||||
var fixedFocus = new Vector3(PortRun * (portArrival ? -.36f : .10f), vesselTop * .32f, -.85f);
|
||||
SetPortCamera(fixedFocus, fixedFacing, vesselLength * 1.43f, 39f);
|
||||
return;
|
||||
}
|
||||
|
||||
// Keep the ship ahead of the lens and the quay in frame as the camera tracks along the water.
|
||||
float glide = Mathf.SmoothStep(0, 1, portFrame);
|
||||
float angle = portArrival ? Mathf.Lerp(-28f, 31f, glide) : Mathf.Lerp(32f, -25f, glide);
|
||||
float elevation = portArrival ? Mathf.Lerp(10.8f, 8.9f, glide) : Mathf.Lerp(8.0f, 12.2f, glide);
|
||||
float distance = vesselLength * (portArrival ? Mathf.Lerp(1.49f, 1.25f, glide) : Mathf.Lerp(1.23f, 1.44f, glide));
|
||||
distance *= Mathf.Max(1, 1.63f / ViewAspect);
|
||||
Quaternion facing = Quaternion.Euler(elevation, -angle, 0);
|
||||
Vector3 focus = vessel.position;
|
||||
focus.x = focus.x * .64f + vesselLength * (portArrival ? .021f : .048f);
|
||||
focus.y = vesselTop * .32f;
|
||||
focus.z -= .85f;
|
||||
SetPortCamera(focus, facing, distance, Mathf.Lerp(37.5f, 40.5f, portArrival ? 1f - glide : glide));
|
||||
}
|
||||
|
||||
private void SetPortCamera(Vector3 focus, Quaternion facing, float distance, float fieldOfView)
|
||||
{
|
||||
distance *= Mathf.Max(1, 1.63f / ViewAspect);
|
||||
viewCamera.orthographic = false;
|
||||
viewCamera.nearClipPlane = OrbitNearClip;
|
||||
viewCamera.fieldOfView = Mathf.Lerp(37.5f, 40.5f, portArrival ? 1f - glide : glide);
|
||||
viewCamera.fieldOfView = fieldOfView;
|
||||
viewCamera.transform.SetPositionAndRotation(focus + facing * Vector3.back * distance, facing);
|
||||
FitViewport();
|
||||
}
|
||||
|
||||
@@ -89,11 +89,7 @@ namespace Soundings
|
||||
{
|
||||
float cropX = Mathf.Min(1, aspect / portMatteAspect) * .91f;
|
||||
float cropY = Mathf.Min(1, portMatteAspect / aspect) * .91f;
|
||||
float pan = Mathf.Lerp(-.041f, .057f, portFrame) * (portArrival ? -1 : 1);
|
||||
float shiftX = Mathf.Clamp(pan, -.46f * (1 - cropX), .46f * (1 - cropX));
|
||||
float shiftY = Mathf.Lerp(-.088f, -.108f, portArrival ? 1f - portFrame : portFrame);
|
||||
shiftY = Mathf.Clamp(shiftY, -.49f * (1 - cropY), .49f * (1 - cropY));
|
||||
water.SetVector("_PortMatteCrop", new Vector4(cropX, cropY, shiftX, shiftY));
|
||||
water.SetVector("_PortMatteCrop", new Vector4(cropX, cropY, 0, -.49f * (1 - cropY)));
|
||||
}
|
||||
|
||||
internal static bool AllPortsHaveScenery => PortProfiles.Length == Market.Ports.Count;
|
||||
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
internal enum StationKind { Helm, Engine, Galley, Stores, Maintenance, Water, Waste, Cabins, Dining, Bar, Stage, Pool, Retail, Laundry }
|
||||
internal enum StationKind { Helm, Engine, Galley, Stores, Maintenance, Water, Waste, Cabins, Dining, Bar, Stage, Pool, Retail, Laundry, Casino }
|
||||
|
||||
internal readonly struct ShipStation
|
||||
{
|
||||
|
||||
@@ -160,6 +160,9 @@ namespace Soundings
|
||||
AddText(statement, $"Includes {Money(sales[(int)OnboardService.Retail])} in shop sales", "log-secondary");
|
||||
if (trip.Onboard?.Expenses > 0)
|
||||
LogLine(statement, "Onboard operating costs", Money(-trip.Onboard.Expenses));
|
||||
if (trip.Onboard?.ServiceSales is int[] takings && takings.Length > (int)OnboardService.Casino
|
||||
&& takings[(int)OnboardService.Casino] > 0)
|
||||
AddText(statement, $"Casino · {Money(takings[(int)OnboardService.Casino])} in stakes · {Money(trip.Onboard.CasinoPayouts)} paid out", "log-secondary");
|
||||
LogLine(statement, "Crew payroll", Money(-trip.Crew));
|
||||
LogLine(statement, "Catering", Money(-trip.Catering));
|
||||
if (trip.Plan != null)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Soundings
|
||||
{
|
||||
Empty, Cabin, Dining, Entertainment, Tank, Bar, Amenity, Galley, Stores, Water, Waste, Workshop,
|
||||
Suite, GrandSuite, Restaurant, GrandTheater, ResortPool, CocktailLounge, Extension,
|
||||
Shop, ShoppingArcade, Spa, WaterPark
|
||||
Shop, ShoppingArcade, Spa, WaterPark, Casino, CasinoLounge, GrandCasino
|
||||
}
|
||||
|
||||
public sealed class FacilitySpec
|
||||
@@ -164,9 +164,14 @@ namespace Soundings
|
||||
new FacilitySpec("Gift shop", "SH", "64 retail orders per service", 12600, 64),
|
||||
new FacilitySpec("Shopping arcade", "SA", "190 retail orders per service", 41500, 190, 2, Regional, depth: 2, corner: true),
|
||||
new FacilitySpec("Spa retreat", "SP", "144 amenity admissions per service", 48300, 144, 2, Regional, depth: 2),
|
||||
new FacilitySpec("Water park", "WP", "460 amenity admissions per service", 107000, 460, 3, Ocean, depth: 2)
|
||||
new FacilitySpec("Water park", "WP", "460 amenity admissions per service", 107000, 460, 3, Ocean, depth: 2),
|
||||
new FacilitySpec("Casino", "CS", "144 gaming seats · table stakes and guest payouts", 57900, 144, 2, Regional, depth: 2),
|
||||
new FacilitySpec("Casino lounge", "CG", "54 gaming seats · table stakes and guest payouts", 32700, 54, 2),
|
||||
new FacilitySpec("Grand casino", "GC", "264 gaming seats · table stakes and guest payouts", 109000, 264, 3, Ocean, depth: 2)
|
||||
};
|
||||
|
||||
internal static bool IsCasino(Facility facility) => facility is Facility.Casino or Facility.CasinoLounge or Facility.GrandCasino;
|
||||
|
||||
public static readonly IReadOnlyList<HullSpec> Hulls = new[]
|
||||
{
|
||||
new HullSpec("Coastal", "A compact hull for short Caribbean crossings.", 6, 2, 2, 3, 210000, 0, 0, 74, .092, 7200, 1200, 72, 14),
|
||||
|
||||
@@ -2,13 +2,14 @@ using System;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
public enum OnboardService { Rooms, Meals, Drinks, Shows, Amenities, Retail }
|
||||
public enum OnboardService { Rooms, Meals, Drinks, Shows, Amenities, Retail, Casino }
|
||||
|
||||
[Serializable]
|
||||
public sealed class OnboardReport
|
||||
{
|
||||
public int Happiness, Health, Revenue, Expenses, Decisions, FuelBurn, Repair, Provisions, WaterPercent, SewagePercent, CrewCalls;
|
||||
public int LaundryCleaned, LaundryBacklog;
|
||||
public int CasinoPayouts;
|
||||
public int[] ServiceSales;
|
||||
}
|
||||
|
||||
@@ -43,11 +44,11 @@ namespace Soundings
|
||||
|
||||
public sealed partial class OnboardSession
|
||||
{
|
||||
private const int ServiceKinds = (int)OnboardService.Retail + 1;
|
||||
private const int ServiceKinds = (int)OnboardService.Casino + 1;
|
||||
private const int PromotionTicks = 5;
|
||||
private const int WholesalePrice = 5;
|
||||
private static readonly int[] Defaults = { 0, 12, 7, 18, 10, 22 };
|
||||
private static readonly double[] BaseDemand = { 0, .71, .59, .43, .51, .29 };
|
||||
private static readonly int[] Defaults = { 0, 12, 7, 18, 10, 22, 18 };
|
||||
private static readonly double[] BaseDemand = { 0, .71, .59, .43, .51, .29, .36 };
|
||||
private static readonly VoyageEvent[] Events =
|
||||
{
|
||||
new VoyageEvent("Dinner rush", "An early seating is filling up. Open overflow tables to expand meal capacity and lift the survey.",
|
||||
@@ -78,6 +79,7 @@ namespace Soundings
|
||||
public int Happiness => (int)Math.Round(satisfaction);
|
||||
public int Revenue { get; private set; }
|
||||
public int Expenses { get; private set; }
|
||||
public int CasinoPayouts { get; private set; }
|
||||
public float Progress => (float)tick / ticks;
|
||||
public VoyageEvent? CurrentEvent => openedAt < 0 ? null :
|
||||
(Quote.Weather == WeatherCondition.Storm ? StormEvents : Events)[nextEvent];
|
||||
@@ -94,10 +96,11 @@ namespace Soundings
|
||||
capacity[0] = ship.Beds;
|
||||
capacity[1] = ship.Meals;
|
||||
capacity[2] = ship.BarCapacity;
|
||||
capacity[3] = ship.Entertainment;
|
||||
capacity[3] = ship.Entertainment - (quote.Weather == WeatherCondition.Storm ? ship.SunDeckPlan.AddedShows : 0);
|
||||
int outdoor = ship.PoolCapacity;
|
||||
capacity[4] = quote.Weather switch { WeatherCondition.Storm => 0, WeatherCondition.Swell => outdoor * 2 / 3, _ => outdoor };
|
||||
capacity[(int)OnboardService.Retail] = ship.RetailCapacity;
|
||||
capacity[(int)OnboardService.Casino] = ship.CasinoCapacity;
|
||||
|
||||
prices = (int[])Defaults.Clone();
|
||||
if (ship.ServicePrices != null)
|
||||
@@ -115,6 +118,7 @@ namespace Soundings
|
||||
OnboardService.Drinks => "Drinks",
|
||||
OnboardService.Shows => "Entertainment",
|
||||
OnboardService.Retail => "Shopping",
|
||||
OnboardService.Casino => "Casino",
|
||||
_ => "Amenities"
|
||||
};
|
||||
|
||||
@@ -207,6 +211,7 @@ namespace Soundings
|
||||
SewagePercent = SewagePercent,
|
||||
LaundryCleaned = LaundryCleaned,
|
||||
LaundryBacklog = LaundryBacklog,
|
||||
CasinoPayouts = CasinoPayouts,
|
||||
Revenue = Revenue,
|
||||
Expenses = Expenses,
|
||||
Decisions = decisions,
|
||||
@@ -218,10 +223,14 @@ namespace Soundings
|
||||
sample[0] = new OnboardSample(Math.Max(Quote.Guests, Quote.RoomDemand), Quote.Guests, capacity[0], 0);
|
||||
double fulfillment = 1;
|
||||
double mealFulfillment = 1;
|
||||
int serviceCount = capacity[(int)OnboardService.Retail] > 0 ? ServiceKinds : ServiceKinds - 1;
|
||||
for (int i = 1; i < serviceCount; i++)
|
||||
int serviceCount = 1;
|
||||
for (int i = 1; i < ServiceKinds; i++)
|
||||
{
|
||||
bool retail = i == (int)OnboardService.Retail;
|
||||
bool gaming = i == (int)OnboardService.Casino;
|
||||
if ((retail || gaming) && capacity[i] == 0)
|
||||
continue;
|
||||
serviceCount++;
|
||||
int price = EffectivePrice((OnboardService)i);
|
||||
double wave = .76 + .48 * (.5 + .5 * Math.Sin((tick + i * 2.1) * .66));
|
||||
double appeal = Math.Max(.23, Math.Min(1.6, (Defaults[i] + 5.0) / (price + 5.0)));
|
||||
@@ -231,7 +240,7 @@ namespace Soundings
|
||||
bool performance = i == (int)OnboardService.Shows && PerformanceActive;
|
||||
if (performance)
|
||||
rush += PortPlanning.ShowDemand(BookedProgram);
|
||||
double indoorShift = Quote.Weather == WeatherCondition.Storm && (i == 2 || i == 3 || retail) ? 1.28 : 1;
|
||||
double indoorShift = Quote.Weather == WeatherCondition.Storm && (i == 2 || i == 3 || retail || gaming) ? 1.28 : 1;
|
||||
int requested = Math.Min(Quote.Guests, rush + (int)Math.Round(Quote.Guests * BaseDemand[i] * appeal * wave * indoorShift));
|
||||
int extraSeats = performance ? PortPlanning.ShowSeats(BookedProgram) : 0;
|
||||
int possible = ServiceCapacity(i, capacity[i] + (featured ? additionalCapacity : 0) + CrewServiceBoost(i)) + extraSeats;
|
||||
@@ -246,6 +255,15 @@ namespace Soundings
|
||||
takings = orders * price;
|
||||
Expenses += orders * WholesalePrice;
|
||||
}
|
||||
else if (gaming)
|
||||
{
|
||||
takings = (int)Math.Round(served * .24) * price;
|
||||
// Deterministic payouts make shifts vary while keeping saved voyages reproducible.
|
||||
double returnRate = .82 + .16 * Math.Sin(tick * 1.37 + Quote.Origin * .71 + Quote.Destination);
|
||||
int paidOut = (int)Math.Round(takings * returnRate);
|
||||
CasinoPayouts += paidOut;
|
||||
Expenses += paidOut;
|
||||
}
|
||||
else
|
||||
takings = (int)Math.Round(served * price * (i == 1 ? .17 : .13));
|
||||
revenue[i] += takings;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Soundings
|
||||
public sealed partial class OnboardSession
|
||||
{
|
||||
private static readonly float[] CrewCallSchedule = { .12f, .43f, .71f };
|
||||
private readonly int[] stationReadyAt = new int[(int)StationKind.Laundry + 1];
|
||||
private readonly int[] stationReadyAt = new int[(int)StationKind.Casino + 1];
|
||||
private readonly int[] stationBoostUntil = new int[ServiceKinds];
|
||||
private int nextCrewCall, crewCallDeadline;
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Soundings
|
||||
StationKind.Stage => "Show lounge",
|
||||
StationKind.Retail => "Shop checkout",
|
||||
StationKind.Laundry => "Laundry control",
|
||||
StationKind.Casino => "Casino cashier",
|
||||
_ => "Pool terrace"
|
||||
};
|
||||
|
||||
@@ -47,6 +48,7 @@ namespace Soundings
|
||||
StationKind.Pool => "Host a poolside game",
|
||||
StationKind.Retail => "Start a shop sale · 25% off",
|
||||
StationKind.Laundry => $"Authorize an extra laundry shift · ${LaundryShiftCost:N0}",
|
||||
StationKind.Casino => "Start low-stakes hour · 25% lower stakes",
|
||||
_ => "Take the helm"
|
||||
};
|
||||
|
||||
@@ -80,6 +82,9 @@ namespace Soundings
|
||||
StationKind.Laundry when AssignedCrew(CrewRole.Laundry) == 0 => "No laundry crew is assigned",
|
||||
StationKind.Laundry when LaundryBoost => "The extra shift is already running",
|
||||
StationKind.Laundry when !CanExtendLaundry => "No room in the operating budget",
|
||||
StationKind.Casino when DiscountTicks(OnboardService.Casino) > 0 => "Low-stakes hour is already underway",
|
||||
StationKind.Casino when Get(OnboardService.Casino).Capacity == 0 => "No casino tables are staffed",
|
||||
StationKind.Casino when GetPrice(OnboardService.Casino) == 0 => "Set a table stake before starting a special",
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
@@ -107,6 +112,7 @@ namespace Soundings
|
||||
case StationKind.Pool: stationBoostUntil[(int)OnboardService.Amenities] = tick + 6; break;
|
||||
case StationKind.Retail: StartSpecial(OnboardService.Retail); break;
|
||||
case StationKind.Laundry: ExtendLaundry(); break;
|
||||
case StationKind.Casino: StartSpecial(OnboardService.Casino); break;
|
||||
}
|
||||
stationReadyAt[(int)station] = tick + (station == StationKind.Engine ? 1 : 8);
|
||||
|
||||
@@ -136,6 +142,7 @@ namespace Soundings
|
||||
StationKind.Stage => "Show lounge ready for guests",
|
||||
StationKind.Retail => "Shop sale started · Merchandise is 25% off",
|
||||
StationKind.Laundry => "Extra laundry shift running · More linen loads per day",
|
||||
StationKind.Casino => "Low-stakes hour is underway",
|
||||
_ => "Poolside game started · More terrace capacity"
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Soundings
|
||||
internal sealed class OnboardSessionSnapshot
|
||||
{
|
||||
public int Tick, NextEvent, OpenedAt, EventBenefitUntil, FeaturedService, AdditionalCapacity, Decisions;
|
||||
public int Revenue, Expenses;
|
||||
public int Revenue, Expenses, CasinoPayouts;
|
||||
public int[] Prices, ServiceRevenue, SaleUntil, StationReadyAt, StationBoostUntil;
|
||||
public ServiceSampleSnapshot[] Samples;
|
||||
public double Satisfaction, Provisions, Water, Waste, FuelIntegrated, Health, Hydration;
|
||||
@@ -39,7 +39,7 @@ namespace Soundings
|
||||
{
|
||||
Tick = tick, NextEvent = nextEvent, OpenedAt = openedAt, EventBenefitUntil = eventBenefitUntil,
|
||||
FeaturedService = featuredService, AdditionalCapacity = additionalCapacity, Decisions = decisions,
|
||||
Satisfaction = satisfaction, Revenue = Revenue, Expenses = Expenses, EventResult = EventResult,
|
||||
Satisfaction = satisfaction, Revenue = Revenue, Expenses = Expenses, CasinoPayouts = CasinoPayouts, EventResult = EventResult,
|
||||
Prices = (int[])prices.Clone(), ServiceRevenue = (int[])revenue.Clone(), SaleUntil = (int[])saleUntil.Clone(),
|
||||
Samples = samples, Provisions = provisions, Water = water, Waste = waste, FuelIntegrated = fuelIntegrated,
|
||||
Health = health, Hydration = hydration, GalleyUntil = galleyUntil, PumpsUntil = pumpsUntil,
|
||||
@@ -67,6 +67,7 @@ namespace Soundings
|
||||
satisfaction = state.Satisfaction;
|
||||
Revenue = state.Revenue;
|
||||
Expenses = state.Expenses;
|
||||
CasinoPayouts = state.CasinoPayouts;
|
||||
EventResult = state.EventResult;
|
||||
Array.Copy(state.Prices, prices, state.Prices.Length);
|
||||
Array.Copy(state.ServiceRevenue, revenue, state.ServiceRevenue.Length);
|
||||
@@ -121,7 +122,8 @@ namespace Soundings
|
||||
|| state.OpenedAt < -1 || state.OpenedAt > state.Tick || (state.OpenedAt >= 0 && state.NextEvent >= offerCount)
|
||||
|| state.FeaturedService < -1 || state.FeaturedService >= state.Prices.Length || state.AdditionalCapacity < 0
|
||||
|| state.EventBenefitUntil < 0 || state.Decisions < 0 || state.Decisions > offerCount
|
||||
|| state.Revenue < 0 || state.Expenses < 0 || state.EngineMode < 0 || state.EngineMode >= FuelRates.Length
|
||||
|| state.Revenue < 0 || state.Expenses < 0 || state.CasinoPayouts < 0 || state.CasinoPayouts > state.Expenses
|
||||
|| state.EngineMode < 0 || state.EngineMode >= FuelRates.Length
|
||||
|| state.RepairCredit < 0 || state.RepairCredit > 6 || state.GalleyUntil < 0 || state.PumpsUntil < 0
|
||||
|| state.LaundryUntil < 0 || state.LaundryUntil > ticks + 7
|
||||
|| state.TreatmentUntil < 0 || state.NextCrewCall < 0 || state.NextCrewCall > CrewCallSchedule.Length
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Soundings
|
||||
int portions = (int)Math.Floor(provisions / PortionPerMeal);
|
||||
return Math.Min(venueCapacity, Math.Min(galley, portions));
|
||||
}
|
||||
if (service == (int)OnboardService.Shows)
|
||||
if (service is (int)OnboardService.Shows or (int)OnboardService.Casino)
|
||||
return (int)Math.Round(venueCapacity * Math.Min(1, Coverage(CrewRole.Entertainment)));
|
||||
int staffed = (int)Math.Round(venueCapacity * Math.Min(1, Coverage(CrewRole.Housekeeping)));
|
||||
return service == (int)OnboardService.Amenities && WaterPercent < 22 ? staffed / 3 : staffed;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Soundings
|
||||
{
|
||||
public sealed partial class SoundingsApp
|
||||
{
|
||||
private static readonly string[] PassageServices = { "rooms", "meals", "drinks", "shows", "amenities", "retail" };
|
||||
private static readonly string[] PassageServices = { "rooms", "meals", "drinks", "shows", "amenities", "retail", "casino" };
|
||||
private readonly Label[] passageDemand = new Label[PassageServices.Length];
|
||||
private readonly Label[] passagePrices = new Label[PassageServices.Length];
|
||||
private readonly Button[] passageSpecials = new Button[PassageServices.Length];
|
||||
@@ -17,6 +17,7 @@ namespace Soundings
|
||||
private float renderedPassageProgress = -1, nextPassageReadout;
|
||||
private Button passageEventAccept;
|
||||
private string passageEventTitle;
|
||||
private Label casinoBalance;
|
||||
|
||||
private void DrawUnderway(VisualElement workspace)
|
||||
{
|
||||
@@ -138,6 +139,7 @@ namespace Soundings
|
||||
private void DrawPassageBusiness(VisualElement left)
|
||||
{
|
||||
var book = Add(left, "voyage-business-book");
|
||||
casinoBalance = null;
|
||||
var metrics = Add(book, "voyage-business-metrics");
|
||||
var happiness = Add(metrics, "voyage-business-metric");
|
||||
AddText(happiness, "GUEST HAPPINESS", "voyage-caption");
|
||||
@@ -152,7 +154,8 @@ namespace Soundings
|
||||
for (int i = 0; i < PassageServices.Length; i++)
|
||||
{
|
||||
OnboardService service = (OnboardService)i;
|
||||
if (service == OnboardService.Retail && Ship.RetailCapacity == 0)
|
||||
if (service == OnboardService.Retail && Ship.RetailCapacity == 0
|
||||
|| service == OnboardService.Casino && Ship.CasinoCapacity == 0)
|
||||
{
|
||||
passageDemand[i] = null;
|
||||
continue;
|
||||
@@ -164,6 +167,8 @@ namespace Soundings
|
||||
passageDemand[i] = AddText(line, "", "voyage-service-demand");
|
||||
if (service == OnboardService.Shows && underway.Plan?.Program is EntertainmentProgram.LiveMusic or EntertainmentProgram.Headline)
|
||||
passagePerformance = AddText(entry, "", "voyage-service-included");
|
||||
if (service == OnboardService.Casino)
|
||||
casinoBalance = AddText(entry, "", "voyage-service-included");
|
||||
if (service == OnboardService.Amenities && underway.Weather == WeatherCondition.Storm)
|
||||
AddText(entry, "Outdoor venues closed", "voyage-service-included voyage-demand-short");
|
||||
if (service == OnboardService.Rooms)
|
||||
@@ -174,11 +179,11 @@ namespace Soundings
|
||||
|
||||
var prices = Add(entry, "voyage-price-row");
|
||||
passageMinus[i] = Action("−", () => AdjustPassagePrice(service, -1), "voyage-price-step", $"passage-price-{slug}-minus");
|
||||
passageMinus[i].tooltip = "Lower the onboard price by $1";
|
||||
passageMinus[i].tooltip = service == OnboardService.Casino ? "Lower the table stake by $1" : "Lower the onboard price by $1";
|
||||
prices.Add(passageMinus[i]);
|
||||
passagePrices[i] = AddText(prices, "", "voyage-service-price");
|
||||
passagePlus[i] = Action("+", () => AdjustPassagePrice(service, 1), "voyage-price-step", $"passage-price-{slug}-plus");
|
||||
passagePlus[i].tooltip = "Raise the onboard price by $1";
|
||||
passagePlus[i].tooltip = service == OnboardService.Casino ? "Raise the table stake by $1" : "Raise the onboard price by $1";
|
||||
prices.Add(passagePlus[i]);
|
||||
passageSpecials[i] = Action("Special −25%", () => StartPassageSpecial(service), "voyage-special", $"passage-special-{slug}");
|
||||
prices.Add(passageSpecials[i]);
|
||||
@@ -241,6 +246,8 @@ namespace Soundings
|
||||
SetPassageText(passageSales, Money(livePassage.Revenue));
|
||||
if (passagePerformance != null)
|
||||
SetPassageText(passagePerformance, livePassage.PerformanceLabel);
|
||||
if (casinoBalance != null)
|
||||
SetPassageText(casinoBalance, $"{Money(livePassage.Get(OnboardService.Casino).Revenue - livePassage.CasinoPayouts)} net after payouts");
|
||||
for (int i = 0; i < PassageServices.Length; i++)
|
||||
{
|
||||
if (passageDemand[i] == null)
|
||||
@@ -257,7 +264,7 @@ namespace Soundings
|
||||
SetPassageText(passagePrices[i], ticks > 0 ? Money(Mathf.Max(1, price * 3 / 4)) : Money(price));
|
||||
passageMinus[i].SetEnabled(price > 0 && demand.Capacity > 0);
|
||||
passagePlus[i].SetEnabled(demand.Capacity > 0);
|
||||
string offer = ticks > 0 ? $"Special · {ticks} left" : "Special −25%";
|
||||
string offer = ticks > 0 ? $"Special · {ticks} left" : service == OnboardService.Casino ? "Low-stakes hour" : "Special −25%";
|
||||
if (passageSpecials[i].text != offer)
|
||||
passageSpecials[i].text = offer;
|
||||
passagePrices[i].tooltip = ticks > 0 ? $"Regular price: {Money(price)}" : "";
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace Soundings
|
||||
{
|
||||
internal enum GuestActivity
|
||||
{
|
||||
Walk, Rail, Talk, Photograph, Read, Dine, Drink, Watch, Perform, Rest, Guitar, Revue, Swim, Wade, TendBar, Lounge, Shopper, ShopClerk
|
||||
Walk, Rail, Talk, Photograph, Read, Dine, Drink, Watch, Perform, Rest, Guitar, Revue, Swim, Wade, TendBar, Lounge, Shopper, ShopClerk,
|
||||
PlayCards, Dealer
|
||||
}
|
||||
|
||||
internal sealed class DeckGuest
|
||||
@@ -121,7 +122,7 @@ namespace Soundings
|
||||
if (guest.Service >= 0)
|
||||
{
|
||||
OnboardSample service = session.Get((OnboardService)guest.Service);
|
||||
occupancy = guest.Activity is (GuestActivity.TendBar or GuestActivity.ShopClerk) && service.Capacity > 0
|
||||
occupancy = guest.Activity is (GuestActivity.TendBar or GuestActivity.ShopClerk or GuestActivity.Dealer) && service.Capacity > 0
|
||||
? 1 : service.Served / (float)Mathf.Max(1, service.Capacity);
|
||||
}
|
||||
if (guest.Program.HasValue)
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Soundings
|
||||
bool walking = activity == GuestActivity.Walk;
|
||||
bool swimming = activity == GuestActivity.Swim;
|
||||
bool inWater = swimming || activity == GuestActivity.Wade;
|
||||
bool staff = activity is GuestActivity.TendBar or GuestActivity.ShopClerk;
|
||||
bool staff = activity is GuestActivity.TendBar or GuestActivity.ShopClerk or GuestActivity.Dealer;
|
||||
bool lounging = activity == GuestActivity.Lounge;
|
||||
bool seated = guest.SeatHeight > 0;
|
||||
float heading = guest.Heading;
|
||||
@@ -139,6 +139,7 @@ namespace Soundings
|
||||
GuestActivity.Read => 23f, GuestActivity.Dine => 9f, GuestActivity.Drink => 5f,
|
||||
GuestActivity.TendBar => 12f, GuestActivity.Photograph => -2f, GuestActivity.Lounge => -11f,
|
||||
GuestActivity.Shopper => 16f, GuestActivity.ShopClerk => 15f,
|
||||
GuestActivity.PlayCards or GuestActivity.Dealer => 18f,
|
||||
_ => seated ? -3f : 0
|
||||
};
|
||||
float spot = Mathf.Sin(time * .67f) * (walking ? 12 : 23);
|
||||
@@ -305,6 +306,10 @@ namespace Soundings
|
||||
case GuestActivity.ShopClerk:
|
||||
return side > 0 ? new Vector3(.22f - beat * .15f, hip + .133f + .10f * beat, .43f)
|
||||
: new Vector3(-.118f, hip + .14f, .40f + .072f * beat);
|
||||
case GuestActivity.PlayCards:
|
||||
return new Vector3(side * (.11f + .048f * beat), hip + .16f + .17f * beat, .44f - .12f * beat);
|
||||
case GuestActivity.Dealer:
|
||||
return new Vector3(side * (.19f + .052f * beat), hip + .06f + .09f * beat, .40f + .10f * beat);
|
||||
case GuestActivity.Watch:
|
||||
float clap = beat * (.66f + .34f * Mathf.Sin(time * 17f));
|
||||
return new Vector3(side * Mathf.Lerp(.155f, .031f, clap), hip + .108f + beat * .25f, .295f + beat * .055f);
|
||||
@@ -446,6 +451,11 @@ namespace Soundings
|
||||
Shell(SmallOrb, palm + new Vector3(-.068f, .038f, .028f), new Vector3(.106f, .065f, .011f), Quaternion.Euler(-45, yaw, 0),
|
||||
Paper, Surface.Accessory);
|
||||
break;
|
||||
case GuestActivity.PlayCards:
|
||||
case GuestActivity.Dealer:
|
||||
Shell(SmallOrb, palm + new Vector3(-.013f, .018f, .025f), new Vector3(.039f, .052f, .006f),
|
||||
Quaternion.Euler(-56 + 17 * lift, yaw, 8), Paper, Surface.Accessory);
|
||||
break;
|
||||
case GuestActivity.Photograph:
|
||||
Shell(SmallOrb, palm + new Vector3(-.036f, .044f, .009f), new Vector3(.037f, .065f, .009f), Quaternion.Euler(-12 + lift * 23, yaw, 0),
|
||||
Strap, Surface.Accessory);
|
||||
|
||||
@@ -16,15 +16,26 @@ namespace Soundings
|
||||
holdCinematicClock = true;
|
||||
StartCompany(false);
|
||||
yield return null;
|
||||
BeginVoyage(company.Forecast(Ship, 1));
|
||||
yield return WritePortFrames(output, "Departure-Miami");
|
||||
EndPortCinematic();
|
||||
FinishVoyage();
|
||||
yield return WritePortFrames(output, "Arrival-Nassau");
|
||||
EndPortCinematic();
|
||||
if (company.Permit(2) is string permitFailure)
|
||||
throw new IOException(permitFailure);
|
||||
foreach (int destination in new[] { 1, 2, 0 })
|
||||
{
|
||||
Voyage quote = company.Forecast(Ship, destination);
|
||||
if (Ship.Fuel < quote.RequiredFuel && company.Refuel(Ship, quote.RequiredFuel - Ship.Fuel) is string fuelFailure)
|
||||
throw new IOException(fuelFailure);
|
||||
|
||||
string origin = Market.Ports[Ship.Port].Name.Replace(" ", "");
|
||||
string arrival = Market.Ports[destination].Name.Replace(" ", "");
|
||||
BeginVoyage(company.Forecast(Ship, destination));
|
||||
yield return WritePortFrames(output, "Departure-" + origin);
|
||||
EndPortCinematic();
|
||||
FinishVoyage();
|
||||
yield return WritePortFrames(output, "Arrival-" + arrival);
|
||||
EndPortCinematic();
|
||||
}
|
||||
Time.captureFramerate = 0;
|
||||
holdCinematicClock = false;
|
||||
Debug.Log("Soundings port clips exported to " + output);
|
||||
Debug.Log("Big Ship Tycoon port clips exported to " + output);
|
||||
Application.Quit(0);
|
||||
}
|
||||
|
||||
@@ -37,24 +48,39 @@ namespace Soundings
|
||||
int frames = Mathf.CeilToInt(Harbor.PortCinematicDuration * PortClipFrameRate);
|
||||
using var stream = File.Create(Path.Combine(output, name + ".raw"));
|
||||
var rendered = new WaitForEndOfFrame();
|
||||
for (int frame = 0; frame < frames; frame++)
|
||||
int width = Screen.width, height = Screen.height;
|
||||
var target = new RenderTexture(width, height, 0, RenderTextureFormat.ARGB32);
|
||||
var image = new Texture2D(width, height, TextureFormat.RGBA32, false);
|
||||
var bytes = new byte[width * height * 4];
|
||||
try
|
||||
{
|
||||
cinematicTime = frame * step;
|
||||
PresentPortCinematicFrame(step);
|
||||
yield return rendered;
|
||||
Texture2D image = ScreenCapture.CaptureScreenshotAsTexture();
|
||||
try
|
||||
File.WriteAllText(Path.Combine(output, name + ".txt"), $"{width} {height} {image.format} {PortClipFrameRate}");
|
||||
for (int frame = 0; frame < frames; frame++)
|
||||
{
|
||||
if (frame == 0)
|
||||
File.WriteAllText(Path.Combine(output, name + ".txt"), $"{image.width} {image.height} {image.format} {PortClipFrameRate}");
|
||||
byte[] bytes = image.GetRawTextureData();
|
||||
cinematicTime = frame * step;
|
||||
PresentPortCinematicFrame(step);
|
||||
yield return rendered;
|
||||
ScreenCapture.CaptureScreenshotIntoRenderTexture(target);
|
||||
RenderTexture previous = RenderTexture.active;
|
||||
try
|
||||
{
|
||||
RenderTexture.active = target;
|
||||
image.ReadPixels(new Rect(0, 0, width, height), 0, 0, false);
|
||||
}
|
||||
finally
|
||||
{
|
||||
RenderTexture.active = previous;
|
||||
}
|
||||
image.GetRawTextureData<byte>().CopyTo(bytes);
|
||||
stream.Write(bytes, 0, bytes.Length);
|
||||
yield return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Destroy(image);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
target.Release();
|
||||
Destroy(target);
|
||||
Destroy(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Soundings
|
||||
root = document.rootVisualElement;
|
||||
root.style.flexGrow = 1;
|
||||
root.style.unityFontDefinition = interfaceFont;
|
||||
foreach (string sheet in new[] { "Soundings", "Shipwork", "Ledger", "FirstVoyageGuide", "Passage", "ServiceControls", "FleetOverview", "Careers", "ShoreExcursions", "CrewOffice" })
|
||||
foreach (string sheet in new[] { "Soundings", "Shipwork", "Ledger", "FirstVoyageGuide", "Passage", "ServiceControls", "FleetOverview", "Careers", "ShoreExcursions", "CrewOffice", "SunDeck" })
|
||||
{
|
||||
StyleSheet stylesheet = Resources.Load<StyleSheet>(sheet);
|
||||
if (stylesheet != null)
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace Soundings
|
||||
StationKind.Bar => (Facility.Bar, Facility.CocktailLounge, Facility.CocktailLounge),
|
||||
StationKind.Stage => (Facility.Entertainment, Facility.GrandTheater, Facility.GrandTheater),
|
||||
StationKind.Retail => (Facility.Shop, Facility.ShoppingArcade, Facility.ShoppingArcade),
|
||||
StationKind.Casino => (Facility.CasinoLounge, Facility.Casino, Facility.GrandCasino),
|
||||
_ => (Facility.Amenity, Facility.ResortPool, Facility.ResortPool)
|
||||
};
|
||||
for (int i = 0; i < Ship.Decks.Count; i++)
|
||||
|
||||
250
Assets/Soundings/Runtime/SunDeckAttractions.cs
Normal file
250
Assets/Soundings/Runtime/SunDeckAttractions.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
internal sealed partial class VesselExterior
|
||||
{
|
||||
private void BuildSunAttraction(SunDeckLayout plan, float top)
|
||||
{
|
||||
switch (plan.Attraction)
|
||||
{
|
||||
case SunAttraction.MiniGolf: BuildPuttingGreens(plan, top); break;
|
||||
case SunAttraction.GoKarts: BuildKartCircuit(plan, top); break;
|
||||
case SunAttraction.RollerCoaster: BuildCoaster(plan, top); break;
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildPuttingGreens(SunDeckLayout plan, float top)
|
||||
{
|
||||
Vector2 half = plan.AttractionHalfSize;
|
||||
Coat(Paint.TeakSeam).Box(new Vector3(plan.AttractionCenter, top + .027f, 0), new Vector3(half.x * 1.96f, .06f, half.y * 1.88f));
|
||||
for (int lane = -1; lane <= 1; lane++)
|
||||
{
|
||||
Vector2 center = new(plan.AttractionCenter + lane * half.x * .09f, lane * half.y * .60f);
|
||||
var contour = new Vector2[36];
|
||||
for (int point = 0; point < contour.Length; point++)
|
||||
{
|
||||
float a = point * Mathf.PI * 2 / contour.Length;
|
||||
float x = Mathf.Cos(a);
|
||||
contour[point] = center + new Vector2(x * half.x * .83f,
|
||||
(Mathf.Sin(a) * (.237f + .035f * Mathf.Cos(3 * a + lane)) + .042f * x * lane) * half.y);
|
||||
}
|
||||
Coat(Paint.Fringe).Loft(contour, center, true, new Vector3(1, top + .052f, 1), new Vector3(1, top + .092f, 1));
|
||||
Coat(Paint.Turf).Loft(contour, center, true, new Vector3(.95f, top + .094f, .86f));
|
||||
float end = lane == 0 ? -1 : 1;
|
||||
Vector3 cup = new(center.x + end * half.x * .61f, top + .102f, center.y + .13f * lane);
|
||||
Coat(Paint.Black).Disc(cup, Vector3.right * .106f, Vector3.back * .106f, 14);
|
||||
Coat(Paint.Pearl).Rod(cup, cup + Vector3.up * .58f, .015f, 6);
|
||||
Coat(lane == 0 ? Paint.Lifeboat : Paint.PortLight).Box(cup + new Vector3(.14f, .49f, 0),
|
||||
new Vector3(.28f, .17f, .021f));
|
||||
Coat(Paint.Teak).Box(new Vector3(center.x - end * half.x * .56f, top + .105f, center.y), new Vector3(.56f, .019f, .37f));
|
||||
if (lane != 0)
|
||||
{
|
||||
Vector3 bunker = new(center.x + end * half.x * .10f, top + .105f, center.y - lane * half.y * .075f);
|
||||
Coat(Paint.Ivory).Disc(bunker, Vector3.right * .54f, Vector3.back * .20f, 18);
|
||||
}
|
||||
}
|
||||
|
||||
for (int end = -1; end <= 1; end += 2)
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
Vector3 pot = new(plan.AttractionCenter + end * half.x * .90f, top + .21f, side * half.y * .90f);
|
||||
Coat(Paint.Teak).Box(pot, new Vector3(.58f, .42f, .43f));
|
||||
Coat(Paint.Fringe).Radome(pot + Vector3.up * .27f, .30f);
|
||||
Coat(Paint.Turf).Radome(pot + new Vector3(.14f, .37f, .04f), .22f);
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildKartCircuit(SunDeckLayout plan, float top)
|
||||
{
|
||||
float trackWidth = SunRideRoute.KartHalfWidth(plan);
|
||||
for (int i = 0; i < SunRideRoute.Segments; i++)
|
||||
{
|
||||
float first = i / (float)SunRideRoute.Segments, next = (i + 1f) / SunRideRoute.Segments;
|
||||
Vector3 a = SunRideRoute.Point(plan, top, first), b = SunRideRoute.Point(plan, top, next);
|
||||
Vector3 acrossA = SunRideRoute.Across(plan, top, first), acrossB = SunRideRoute.Across(plan, top, next);
|
||||
Ribbon(Paint.Black, a, b, acrossA, acrossB, trackWidth);
|
||||
bool stripe = i % 6 < 2;
|
||||
if (stripe)
|
||||
Ribbon(Paint.Ivory, a + Vector3.up * .008f, b + Vector3.up * .008f, acrossA, acrossB, .026f);
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
Vector3 edgeA = a + acrossA * (trackWidth * side), edgeB = b + acrossB * (trackWidth * side);
|
||||
Coat(i / 2 % 2 == 0 ? Paint.Ivory : Paint.PortLight).Rod(edgeA, edgeB, .072f, 5);
|
||||
if (side > 0)
|
||||
continue;
|
||||
edgeA -= acrossA * .13f;
|
||||
edgeB -= acrossB * .13f;
|
||||
Barrier(edgeA, edgeB, i % 3 == 0);
|
||||
}
|
||||
}
|
||||
|
||||
Vector3 start = SunRideRoute.Point(plan, top, .25f);
|
||||
Coat(Paint.Pearl).Box(start + Vector3.up * .014f, new Vector3(.19f, .012f, trackWidth * 2));
|
||||
for (int edge = -1; edge <= 1; edge += 2)
|
||||
{
|
||||
Vector3 pylon = start + Vector3.forward * edge * (trackWidth + .16f);
|
||||
Coat(Paint.Steel).Rod(pylon, pylon + Vector3.up * 1.24f, .043f, 6, true);
|
||||
}
|
||||
Coat(Paint.DeckCanvas).Box(start + Vector3.up * 1.27f, new Vector3(.26f, .22f, trackWidth * 2.32f));
|
||||
}
|
||||
|
||||
private void Barrier(Vector3 a, Vector3 b, bool post)
|
||||
{
|
||||
Coat(Paint.Steel).Rod(a + Vector3.up * .31f, b + Vector3.up * .31f, .027f, 6);
|
||||
if (post)
|
||||
Coat(Paint.Steel).Rod(a, a + Vector3.up * .31f, .026f, 6, true);
|
||||
}
|
||||
|
||||
private void Ribbon(Paint paint, Vector3 a, Vector3 b, Vector3 acrossA, Vector3 acrossB, float halfWidth)
|
||||
{
|
||||
Vector3 sideA = acrossA * halfWidth, sideB = acrossB * halfWidth;
|
||||
Coat(paint).Quad(a - sideA, a + sideA, b + sideB, b - sideB);
|
||||
}
|
||||
|
||||
private void BuildCoaster(SunDeckLayout plan, float top)
|
||||
{
|
||||
const float gauge = .31f;
|
||||
for (int i = 0; i < SunRideRoute.Segments; i++)
|
||||
{
|
||||
float first = i / (float)SunRideRoute.Segments, next = (i + 1f) / SunRideRoute.Segments;
|
||||
Vector3 a = SunRideRoute.Point(plan, top, first), b = SunRideRoute.Point(plan, top, next);
|
||||
Vector3 acrossA = SunRideRoute.Across(plan, top, first), acrossB = SunRideRoute.Across(plan, top, next);
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
Coat(Paint.Lifeboat).Rod(a + acrossA * (gauge * side), b + acrossB * (gauge * side), .057f, 7, true);
|
||||
Coat(Paint.Gold).Rod(a - acrossA * .38f, a + acrossA * .38f, .045f, 6);
|
||||
Coat(Paint.Navy).Rod(a - Vector3.up * .18f, b - Vector3.up * .18f, .047f, 6);
|
||||
if (i % 4 != 0)
|
||||
continue;
|
||||
Vector3 lower = a - Vector3.up * .10f;
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
Vector3 foot = new(a.x, top + .045f, a.z);
|
||||
foot += acrossA * (side * .46f);
|
||||
Coat(Paint.Pearl).Box(foot, new Vector3(.24f, .098f, .24f));
|
||||
Coat(Paint.Steel).Rod(foot, lower, .063f, 8, true);
|
||||
if (a.y - top > 1.45f)
|
||||
Coat(Paint.Steel).Rod(foot, lower + Vector3.forward * .40f, .039f, 6);
|
||||
}
|
||||
}
|
||||
|
||||
Vector3 station = SunRideRoute.Point(plan, top, .70f) + Vector3.forward * .63f;
|
||||
Coat(Paint.Teak).Box(new Vector3(station.x, top + .28f, station.z), new Vector3(2.92f, .54f, .83f));
|
||||
}
|
||||
}
|
||||
|
||||
internal static class SunRideRoute
|
||||
{
|
||||
internal const int Segments = 56;
|
||||
internal static float KartHalfWidth(VesselExterior.SunDeckLayout plan) => Mathf.Clamp(plan.AttractionHalfSize.y * .18f, .48f, .73f);
|
||||
|
||||
internal static Vector3 Point(VesselExterior.SunDeckLayout plan, float top, float cycle)
|
||||
{
|
||||
float angle = cycle * Mathf.PI * 2f;
|
||||
Vector2 half = plan.AttractionHalfSize;
|
||||
bool coaster = plan.Attraction == SunAttraction.RollerCoaster;
|
||||
float x = Mathf.Cos(angle) * half.x * .82f;
|
||||
float z = Mathf.Sin(angle) * half.y * (coaster ? .68f : .70f);
|
||||
if (!coaster)
|
||||
return new Vector3(plan.AttractionCenter + x, top + .081f, z);
|
||||
|
||||
float rise = Mathf.Clamp(half.x * .28f, 2.3f, 3.55f);
|
||||
float lift = .5f + .5f * Mathf.Sin(angle + .09f);
|
||||
return new Vector3(plan.AttractionCenter + x, top + .62f + rise * lift * lift + .13f * Mathf.Sin(angle * 2), z);
|
||||
}
|
||||
|
||||
internal static Vector3 Tangent(VesselExterior.SunDeckLayout plan, float top, float cycle) =>
|
||||
(Point(plan, top, cycle + .0015f) - Point(plan, top, cycle - .0015f)).normalized;
|
||||
|
||||
internal static Vector3 Across(VesselExterior.SunDeckLayout plan, float top, float cycle) =>
|
||||
Vector3.Cross(Tangent(plan, top, cycle), Vector3.up).normalized;
|
||||
}
|
||||
|
||||
internal sealed partial class DeckPassengers
|
||||
{
|
||||
private readonly Transform[] rideVehicles = new Transform[3];
|
||||
private VesselExterior.SunDeckLayout rideCourse;
|
||||
private float rideCycle, rideDeckHeight;
|
||||
|
||||
private void AddSunAttractionGuests(Layout layout, VesselExterior.SunDeckLayout plan, float height)
|
||||
{
|
||||
if (plan.Attraction == SunAttraction.MiniGolf)
|
||||
{
|
||||
for (int lane = -1; lane <= 1; lane++)
|
||||
{
|
||||
float end = lane == 0 ? -1 : 1;
|
||||
float x = plan.AttractionCenter + lane * plan.AttractionHalfSize.x * .09f - end * plan.AttractionHalfSize.x * .51f;
|
||||
var player = new Vector3(x, height + .085f, (lane * .60f + .115f) * plan.AttractionHalfSize.y);
|
||||
AddGuest(layout, GuestActivity.Talk, player, 347 + lane * 13, end * 90, (int)OnboardService.Amenities, .16f + (lane + 1) * .18f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (plan.Attraction is not (SunAttraction.GoKarts or SunAttraction.RollerCoaster))
|
||||
return;
|
||||
|
||||
rideCourse = plan;
|
||||
rideDeckHeight = height - .015f;
|
||||
bool coaster = plan.Attraction == SunAttraction.RollerCoaster;
|
||||
for (int i = 0; i < rideVehicles.Length; i++)
|
||||
{
|
||||
var car = Piece(coaster ? "Coaster car" : "Go-kart", layout.Room.transform);
|
||||
rideVehicles[i] = car.transform;
|
||||
FitRideVehicle(car.transform, coaster, i);
|
||||
}
|
||||
PositionRideVehicles();
|
||||
|
||||
Vector3 queue = new(plan.AttractionCenter - plan.AttractionHalfSize.x * .67f, height, plan.AttractionHalfSize.y * .94f);
|
||||
for (int i = 0; i < 3; i++)
|
||||
AddGuest(layout, GuestActivity.Talk, queue + Vector3.right * i * .52f, 198 + i * 17, 179,
|
||||
(int)OnboardService.Amenities, .16f + i * .21f);
|
||||
}
|
||||
|
||||
private void FitRideVehicle(Transform parent, bool coaster, int variant)
|
||||
{
|
||||
var shape = new Geometry(this, parent);
|
||||
int body = variant switch { 0 => ScreenRed, 1 => ScreenAmber, _ => ScreenChart };
|
||||
if (coaster)
|
||||
{
|
||||
shape.Box(body, new Vector3(0, .17f, 0), new Vector3(.77f, .28f, .78f));
|
||||
shape.Box(Gasket, new Vector3(0, .36f, -.21f), new Vector3(.61f, .31f, .16f));
|
||||
shape.Box(Alloy, new Vector3(0, .38f, .18f), new Vector3(.61f, .048f, .081f));
|
||||
shape.Box(DeckTrim, new Vector3(0, .08f, .01f), new Vector3(.83f, .088f, .42f));
|
||||
}
|
||||
else
|
||||
{
|
||||
shape.Box(Gasket, new Vector3(0, .135f, 0), new Vector3(.62f, .115f, 1.12f));
|
||||
shape.Box(body, new Vector3(0, .218f, .29f), new Vector3(.46f, .16f, .49f));
|
||||
shape.Box(Gasket, new Vector3(0, .29f, -.17f), new Vector3(.38f, .22f, .14f));
|
||||
shape.Box(Alloy, new Vector3(0, .29f, -.36f), new Vector3(.33f, .12f, .25f));
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
for (int end = -1; end <= 1; end += 2)
|
||||
{
|
||||
Vector3 axle = new(side * .28f, .119f, end * .34f);
|
||||
shape.Mesh(Gasket).Rod(axle, axle + Vector3.right * side * .14f, .118f, 10, true);
|
||||
}
|
||||
}
|
||||
shape.Finish();
|
||||
}
|
||||
|
||||
private void TickSunAttraction(OnboardSession session, float delta)
|
||||
{
|
||||
if (rideVehicles[0] == null || session.Quote.Weather == WeatherCondition.Storm || session.Get(OnboardService.Amenities).Served == 0)
|
||||
return;
|
||||
float pace = rideCourse.Attraction == SunAttraction.RollerCoaster ? .145f : .112f;
|
||||
rideCycle = Mathf.Repeat(rideCycle + Mathf.Max(0, delta) * pace, 1);
|
||||
PositionRideVehicles();
|
||||
}
|
||||
|
||||
private void PositionRideVehicles()
|
||||
{
|
||||
for (int i = 0; i < rideVehicles.Length; i++)
|
||||
{
|
||||
float spacing = rideCourse.Attraction == SunAttraction.RollerCoaster ? .028f : .31f;
|
||||
float t = rideCycle + .17f - i * spacing;
|
||||
rideVehicles[i].localPosition = SunRideRoute.Point(rideCourse, rideDeckHeight, t) + Vector3.up * .025f;
|
||||
rideVehicles[i].localRotation = Quaternion.LookRotation(SunRideRoute.Tangent(rideCourse, rideDeckHeight, t), Vector3.up);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Soundings/Runtime/SunDeckAttractions.cs.meta
Normal file
2
Assets/Soundings/Runtime/SunDeckAttractions.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba3312bcbcff14f6d9cadbf112dc36b4
|
||||
128
Assets/Soundings/Runtime/SunDeckEditor.cs
Normal file
128
Assets/Soundings/Runtime/SunDeckEditor.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
public sealed partial class SoundingsApp
|
||||
{
|
||||
private bool sunDeckEditing;
|
||||
|
||||
private static readonly (SunPoolStyle Style, string Label, string Id)[] SunPools =
|
||||
{
|
||||
(SunPoolStyle.Automatic, "Auto", "auto"), (SunPoolStyle.None, "None", "none"),
|
||||
(SunPoolStyle.Compact, "Compact", "compact"), (SunPoolStyle.Family, "Family", "family"),
|
||||
(SunPoolStyle.Resort, "Resort", "resort")
|
||||
};
|
||||
|
||||
private static readonly (SunAttraction Fitting, string Label, string Id)[] SunAttractions =
|
||||
{
|
||||
(SunAttraction.Automatic, "Auto", "auto"), (SunAttraction.None, "None", "none"),
|
||||
(SunAttraction.MiniGolf, "Mini golf", "golf"), (SunAttraction.Theater, "Outdoor theater", "theater"),
|
||||
(SunAttraction.GoKarts, "Go-karts", "karts"), (SunAttraction.RollerCoaster, "Roller coaster", "coaster")
|
||||
};
|
||||
|
||||
private void DrawSunDeckEditor(VisualElement work, Ship ship)
|
||||
{
|
||||
SunDeckPlan plan = ship.SunDeckPlan;
|
||||
VesselExterior.SunDeckLayout layout = VesselExterior.SunDeck(ship);
|
||||
var board = Add(work, "work-draft");
|
||||
board.generateVisualContent += context => DrawDeckOutline(context, ship.Hull.Columns);
|
||||
var markings = Add(board, "work-draft-markings");
|
||||
AddText(markings, "STERN", "work-caption");
|
||||
AddText(markings, "SUN DECK", "work-caption");
|
||||
AddText(markings, "BOW →", "work-caption");
|
||||
var diagram = Add(board, "sun-deck-diagram");
|
||||
|
||||
if (layout.Attraction != SunAttraction.None)
|
||||
AddSunDiagramFit(diagram, layout, layout.AttractionCenter, layout.AttractionHalfSize.x, layout.AttractionHalfSize.y,
|
||||
System.Array.Find(SunAttractions, option => option.Fitting == layout.Attraction).Label, "sun-diagram-attraction");
|
||||
AddSunDiagramFit(diagram, layout, layout.Offset - layout.Length * .24f, 2.25f, layout.HalfBeam * .34f,
|
||||
"Funnels", "sun-diagram-fixed");
|
||||
AddSunDiagramFit(diagram, layout, VesselExterior.BridgeCenter(ship.Hull.Length, ship.Decks.Count), 4.55f,
|
||||
layout.HalfBeam * .70f, "Bridge", "sun-diagram-fixed");
|
||||
if (layout.HasPool)
|
||||
AddSunDiagramFit(diagram, layout, layout.PoolCenter, layout.PoolHalfSize.x, layout.PoolHalfSize.y,
|
||||
"Pool", layout.OvalPool ? "sun-diagram-pool sun-diagram-oval" : "sun-diagram-pool");
|
||||
|
||||
var fittings = Add(work, "work-fittings sun-deck-panel");
|
||||
var capacity = Add(fittings, "work-capacity-strip");
|
||||
AddText(capacity, $"{ship.PoolCapacity:N0} amenity admissions", "work-capacity");
|
||||
AddText(capacity, $"{ship.Entertainment:N0} show seats", "work-capacity");
|
||||
if (layout.HasPool)
|
||||
AddText(capacity, $"Pool {layout.PoolHalfSize.x * 2:0.0} × {layout.PoolHalfSize.y * 2:0.0} m", "work-capacity");
|
||||
AddText(capacity, $"{layout.Loungers * 2} loungers", "work-capacity");
|
||||
|
||||
var pools = SunDeckOptions(fittings, "Pool size");
|
||||
foreach (var option in SunPools)
|
||||
{
|
||||
SunDeckPlan next = plan;
|
||||
next.Pool = option.Style;
|
||||
AddSunOption(pools, ship, next, option.Label, "sun-pool-" + option.Id, plan.Pool == option.Style,
|
||||
option.Style == SunPoolStyle.Resort ? Market.Regional : 0);
|
||||
}
|
||||
|
||||
var poolTrim = SunDeckOptions(fittings, "Pool layout");
|
||||
foreach (SunPoolPosition position in new[] { SunPoolPosition.Aft, SunPoolPosition.Midship, SunPoolPosition.Forward })
|
||||
{
|
||||
SunDeckPlan next = plan;
|
||||
next.Position = position;
|
||||
AddSunOption(poolTrim, ship, next, position.ToString(), "sun-pool-" + position.ToString().ToLowerInvariant(), plan.Position == position);
|
||||
}
|
||||
var rectangle = plan;
|
||||
rectangle.Shape = SunPoolShape.Rectangle;
|
||||
AddSunOption(poolTrim, ship, rectangle, "Rectangle", "sun-shape-rectangle", plan.Shape == SunPoolShape.Rectangle);
|
||||
var oval = plan;
|
||||
oval.Shape = SunPoolShape.Oval;
|
||||
AddSunOption(poolTrim, ship, oval, "Oval", "sun-shape-oval", plan.Shape == SunPoolShape.Oval);
|
||||
var shade = plan;
|
||||
shade.NoShade = !plan.NoShade;
|
||||
AddSunOption(poolTrim, ship, shade, plan.NoShade ? "Add parasols" : "Remove parasols", "sun-shade", false);
|
||||
var seating = plan;
|
||||
seating.ExtraLoungers = !plan.ExtraLoungers;
|
||||
AddSunOption(poolTrim, ship, seating, plan.ExtraLoungers ? "Standard seating" : "Extra loungers", "sun-loungers", false);
|
||||
|
||||
var attractions = SunDeckOptions(fittings, "Stern attraction");
|
||||
foreach (var option in SunAttractions)
|
||||
{
|
||||
SunDeckPlan next = plan;
|
||||
next.Attraction = option.Fitting;
|
||||
AddSunOption(attractions, ship, next, option.Label, "sun-attraction-" + option.Id,
|
||||
plan.Attraction == option.Fitting, SunDeckPlan.RequiredHull(option.Fitting));
|
||||
}
|
||||
}
|
||||
|
||||
private static VisualElement SunDeckOptions(VisualElement panel, string caption)
|
||||
{
|
||||
var row = Add(panel, "sun-deck-options");
|
||||
AddText(row, caption, "sun-deck-option-label");
|
||||
return row;
|
||||
}
|
||||
|
||||
private void AddSunOption(VisualElement row, Ship ship, SunDeckPlan next, string label, string id, bool selected,
|
||||
int minimumHull = 0)
|
||||
{
|
||||
string requirement = ship.HullIndex < minimumHull ? $"Requires a {Market.Hulls[minimumHull].Name} hull" : null;
|
||||
int cost = Company.SunDeckCost(ship, next);
|
||||
string detail = requirement == null && cost > 0 ? $" {Money(cost)}" : "";
|
||||
Button option = Action(label + detail, () => Apply(company.ChangeSunDeck(ship, next), "Sun deck refitted."), "sun-deck-choice", id);
|
||||
option.EnableInClassList("sun-deck-selected", selected);
|
||||
option.SetEnabled(requirement == null && company.AvailableCash >= cost);
|
||||
option.tooltip = requirement ?? (cost > 0 ? $"Refit cost {Money(cost)}" : "No refit charge");
|
||||
row.Add(option);
|
||||
}
|
||||
|
||||
private static void AddSunDiagramFit(VisualElement diagram, VesselExterior.SunDeckLayout layout,
|
||||
float center, float halfLength, float halfWidth, string caption, string classes)
|
||||
{
|
||||
var outline = Add(diagram, "sun-diagram-fitting " + classes);
|
||||
float x = Mathf.InverseLerp(layout.Offset - layout.Length * .50f, layout.Offset + layout.Length * .50f, center);
|
||||
float width = halfLength * 174f / layout.Length;
|
||||
float height = halfWidth * 69f / layout.HalfBeam;
|
||||
outline.style.left = Length.Percent(6 + x * 87 - width * .5f);
|
||||
outline.style.top = Length.Percent(50 - height * .5f);
|
||||
outline.style.width = Length.Percent(width);
|
||||
outline.style.height = Length.Percent(height);
|
||||
AddText(outline, caption, "sun-diagram-label");
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Soundings/Runtime/SunDeckEditor.cs.meta
Normal file
2
Assets/Soundings/Runtime/SunDeckEditor.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d831d1982ca12c9e3ae9deb1a3252be4
|
||||
88
Assets/Soundings/Runtime/SunDeckPlan.cs
Normal file
88
Assets/Soundings/Runtime/SunDeckPlan.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
public enum SunPoolStyle { Automatic, None, Compact, Family, Resort }
|
||||
public enum SunPoolShape { Rectangle, Oval }
|
||||
public enum SunPoolPosition { Midship, Aft, Forward }
|
||||
public enum SunAttraction { Automatic, None, MiniGolf, Theater, GoKarts, RollerCoaster }
|
||||
|
||||
[Serializable]
|
||||
public struct SunDeckPlan
|
||||
{
|
||||
public SunPoolStyle Pool;
|
||||
public SunPoolShape Shape;
|
||||
public SunPoolPosition Position;
|
||||
public SunAttraction Attraction;
|
||||
public bool NoShade, ExtraLoungers;
|
||||
|
||||
internal int Code => (int)Pool | (int)Shape << 3 | (int)Position << 4 | (int)Attraction << 6
|
||||
| (NoShade ? 1 << 9 : 0) | (ExtraLoungers ? 1 << 10 : 0);
|
||||
|
||||
internal int PoolPrice => Pool switch { SunPoolStyle.Compact => 9500, SunPoolStyle.Family => 21000, SunPoolStyle.Resort => 59000, _ => 0 };
|
||||
internal int AttractionPrice => Attraction switch
|
||||
{
|
||||
SunAttraction.MiniGolf => 16000, SunAttraction.Theater => 36000, SunAttraction.GoKarts => 62000,
|
||||
SunAttraction.RollerCoaster => 145000, _ => 0
|
||||
};
|
||||
|
||||
internal int AddedAmenities => (Pool switch
|
||||
{
|
||||
SunPoolStyle.Compact => 42, SunPoolStyle.Family => 86, SunPoolStyle.Resort => 172, _ => 0
|
||||
}) + (Attraction switch
|
||||
{
|
||||
SunAttraction.MiniGolf => 52, SunAttraction.GoKarts => 78, SunAttraction.RollerCoaster => 124, _ => 0
|
||||
});
|
||||
|
||||
internal int AddedShows => Attraction == SunAttraction.Theater ? 110 : 0;
|
||||
|
||||
internal bool ValidFor(int hull) => (uint)Pool <= (uint)SunPoolStyle.Resort && (uint)Shape <= (uint)SunPoolShape.Oval
|
||||
&& (uint)Position <= (uint)SunPoolPosition.Forward && (uint)Attraction <= (uint)SunAttraction.RollerCoaster
|
||||
&& (Pool != SunPoolStyle.Resort || hull >= Market.Regional) && hull >= RequiredHull(Attraction);
|
||||
|
||||
internal static int RequiredHull(SunAttraction attraction) => attraction switch
|
||||
{
|
||||
SunAttraction.Theater or SunAttraction.GoKarts => Market.Regional,
|
||||
SunAttraction.RollerCoaster => Market.Ocean,
|
||||
_ => 0
|
||||
};
|
||||
}
|
||||
|
||||
public sealed partial class Ship
|
||||
{
|
||||
[SerializeField] private SunDeckPlan sunDeckPlan;
|
||||
public SunDeckPlan SunDeckPlan => sunDeckPlan;
|
||||
internal int SunDeckPlanCode => sunDeckPlan.Code;
|
||||
internal bool HasValidSunDeckPlan => sunDeckPlan.ValidFor(HullIndex);
|
||||
internal void SetSunDeckPlan(SunDeckPlan plan) => sunDeckPlan = plan;
|
||||
}
|
||||
|
||||
public sealed partial class Company
|
||||
{
|
||||
internal static int SunDeckCost(Ship ship, SunDeckPlan next)
|
||||
{
|
||||
SunDeckPlan current = ship.SunDeckPlan;
|
||||
int pool = Math.Max(0, next.PoolPrice - current.PoolPrice);
|
||||
int attraction = next.Attraction == current.Attraction ? 0 : Math.Max(0, next.AttractionPrice - current.AttractionPrice / 4);
|
||||
return pool + attraction;
|
||||
}
|
||||
|
||||
public string ChangeSunDeck(Ship ship, SunDeckPlan next)
|
||||
{
|
||||
if (ship == null || !Fleet.Contains(ship))
|
||||
return "Choose a ship from your fleet.";
|
||||
if (!next.ValidFor(ship.HullIndex))
|
||||
return "This fitting requires a larger hull.";
|
||||
if (next.Code == ship.SunDeckPlanCode)
|
||||
return null;
|
||||
int cost = SunDeckCost(ship, next);
|
||||
if (AvailableCash < cost)
|
||||
return $"The company needs ${cost:N0} available for this refit.";
|
||||
|
||||
Cash -= cost;
|
||||
ship.SetSunDeckPlan(next);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Soundings/Runtime/SunDeckPlan.cs.meta
Normal file
2
Assets/Soundings/Runtime/SunDeckPlan.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e67dacdcd14d92557a63675761cbca21
|
||||
@@ -12,7 +12,7 @@ namespace Soundings
|
||||
internal enum Paint
|
||||
{
|
||||
Navy, Ivory, Pearl, Gold, Teak, TeakSeam, Steel, Black, Glass, BlueGlass, LitGlass, Lounge,
|
||||
Lifeboat, Pool, Antifouling, DeckCanvas, PortLight, StarboardLight
|
||||
Lifeboat, Pool, Antifouling, DeckCanvas, PortLight, StarboardLight, Turf, Fringe
|
||||
}
|
||||
|
||||
private readonly Dictionary<Paint, HarborMesh> batches = new Dictionary<Paint, HarborMesh>();
|
||||
@@ -176,6 +176,9 @@ namespace Soundings
|
||||
case Facility.ShoppingArcade:
|
||||
case Facility.Spa:
|
||||
case Facility.WaterPark:
|
||||
case Facility.Casino:
|
||||
case Facility.CasinoLounge:
|
||||
case Facility.GrandCasino:
|
||||
BuildWindow(floor, along, outward, side, width * .88f, 1.35f, 1.23f, 3,
|
||||
(i + deck * 2) % 6 == 0 ? Paint.Lounge : Paint.Glass);
|
||||
break;
|
||||
@@ -339,19 +342,22 @@ namespace Soundings
|
||||
if (plan.HasPool)
|
||||
{
|
||||
PoolBasin(Coat(Paint.Pearl), Coat(Paint.BlueGlass), Coat(Paint.Pool), new Vector3(pool, top, 0),
|
||||
plan.PoolHalfSize, .37f, PoolWaterHeight);
|
||||
plan.PoolHalfSize, .37f, PoolWaterHeight, plan.OvalPool);
|
||||
BuildPoolDeckFittings(plan, top);
|
||||
}
|
||||
|
||||
for (int side = -1; side <= 1; side += 2)
|
||||
{
|
||||
if (plan.HasPool)
|
||||
PoolRails(Coat(Paint.Steel), new Vector3(pool - plan.PoolHalfSize.x + .53f, top, side * plan.PoolHalfSize.y), side);
|
||||
{
|
||||
float railX = plan.OvalPool ? pool - .38f : pool - plan.PoolHalfSize.x + .53f;
|
||||
PoolRails(Coat(Paint.Steel), new Vector3(railX, 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)
|
||||
if (plan.Shade)
|
||||
BuildParasol(new Vector3(pool + plan.PoolHalfSize.x + 1.25f, top, side * plan.HalfBeam * .55f), side > 0);
|
||||
if (!plan.Resort || plan.OvalPool)
|
||||
continue;
|
||||
|
||||
// Floating dividers leave three clear routes through the long basin.
|
||||
@@ -367,6 +373,8 @@ namespace Soundings
|
||||
|
||||
if (plan.Theater)
|
||||
BuildOpenAirStage(plan, top);
|
||||
else
|
||||
BuildSunAttraction(plan, top);
|
||||
}
|
||||
|
||||
private void BuildOpenAirStage(SunDeckLayout plan, float top)
|
||||
@@ -402,14 +410,14 @@ namespace Soundings
|
||||
}
|
||||
|
||||
internal static void PoolBasin(HarborMesh coping, HarborMesh tile, HarborMesh water, Vector3 foot,
|
||||
Vector2 halfSize, float rimHeight, float waterHeight)
|
||||
Vector2 halfSize, float rimHeight, float waterHeight, bool oval = false)
|
||||
{
|
||||
Vector2 center = new Vector2(foot.x, foot.z);
|
||||
float radius = Mathf.Min(.31f, halfSize.y * .45f);
|
||||
const float surround = .23f;
|
||||
Vector2[] inner = RoundedRectangle(center, halfSize.x, halfSize.y, radius);
|
||||
Vector2[] edging = RoundedRectangle(center, halfSize.x + .036f, halfSize.y + .036f, radius + .036f);
|
||||
Vector2[] outer = RoundedRectangle(center, halfSize.x + surround, halfSize.y + surround, radius + surround);
|
||||
Vector2[] inner = BasinOutline(0);
|
||||
Vector2[] edging = BasinOutline(.036f);
|
||||
Vector2[] outer = BasinOutline(surround);
|
||||
float rim = foot.y + rimHeight;
|
||||
float surface = foot.y + waterHeight;
|
||||
coping.Loft(outer, center, false, new Vector3(1f, foot.y, 1f), new Vector3(1f, rim, 1f));
|
||||
@@ -424,6 +432,19 @@ namespace Soundings
|
||||
tile.Quad(HarborMesh.Point(inner[i], surface), HarborMesh.Point(inner[next], surface),
|
||||
HarborMesh.Point(inner[next], rim), HarborMesh.Point(inner[i], rim));
|
||||
}
|
||||
|
||||
Vector2[] BasinOutline(float extra)
|
||||
{
|
||||
if (!oval)
|
||||
return RoundedRectangle(center, halfSize.x + extra, halfSize.y + extra, radius + extra);
|
||||
var ellipse = new Vector2[32];
|
||||
for (int i = 0; i < ellipse.Length; i++)
|
||||
{
|
||||
float angle = i * Mathf.PI * 2 / ellipse.Length;
|
||||
ellipse[i] = center + new Vector2(Mathf.Cos(angle) * (halfSize.x + extra), Mathf.Sin(angle) * (halfSize.y + extra));
|
||||
}
|
||||
return ellipse;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void PoolRails(HarborMesh steel, Vector3 edge, int side)
|
||||
@@ -445,9 +466,10 @@ namespace Soundings
|
||||
|
||||
internal readonly struct SunDeckLayout
|
||||
{
|
||||
internal readonly float Length, Offset, HalfBeam, PoolCenter, StageCenter, StageHalfWidth;
|
||||
internal readonly bool HasPool, Resort, Theater;
|
||||
internal readonly Vector2 PoolHalfSize;
|
||||
internal readonly float Length, Offset, HalfBeam, PoolCenter, StageCenter, StageHalfWidth, AttractionCenter;
|
||||
internal readonly bool HasPool, Resort, OvalPool, Shade, ExtraLoungers;
|
||||
internal readonly Vector2 PoolHalfSize, AttractionHalfSize;
|
||||
internal readonly SunAttraction Attraction;
|
||||
|
||||
internal SunDeckLayout(Ship ship)
|
||||
{
|
||||
@@ -456,24 +478,45 @@ namespace Soundings
|
||||
Offset = DeckOffset(ship.Hull.Length, deck);
|
||||
HalfBeam = DeckHalfBeam(ship.Hull.Beam * .5f, deck);
|
||||
Facility[] cells = ship.Decks[deck].Cells;
|
||||
bool waterPark = System.Array.IndexOf(cells, Facility.WaterPark) >= 0;
|
||||
Resort = waterPark || 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 = waterPark
|
||||
? new Vector2(Mathf.Min(8.95f, Length * .105f), Mathf.Min(3f, HalfBeam * .40f))
|
||||
SunDeckPlan design = ship.SunDeckPlan;
|
||||
bool automatic = design.Pool == SunPoolStyle.Automatic;
|
||||
bool waterPark = automatic && System.Array.IndexOf(cells, Facility.WaterPark) >= 0;
|
||||
Resort = waterPark || (automatic && System.Array.IndexOf(cells, Facility.ResortPool) >= 0)
|
||||
|| design.Pool == SunPoolStyle.Resort;
|
||||
HasPool = automatic ? Resort || ship.Count(Facility.Amenity) > 0 : design.Pool != SunPoolStyle.None;
|
||||
OvalPool = design.Shape == SunPoolShape.Oval;
|
||||
Shade = !design.NoShade;
|
||||
ExtraLoungers = design.ExtraLoungers;
|
||||
PoolHalfSize = waterPark ? new Vector2(Mathf.Min(8.95f, Length * .105f), Mathf.Min(3f, HalfBeam * .40f))
|
||||
: Resort ? new Vector2(Mathf.Min(7.15f, Length * .089f), Mathf.Min(2.77f, HalfBeam * .39f))
|
||||
: new Vector2(PoolHalfLength, PoolHalfWidth);
|
||||
StageCenter = Offset - Length * .376f;
|
||||
: design.Pool == SunPoolStyle.Family ? new Vector2(Mathf.Min(4.48f, Length * .085f), Mathf.Min(2.18f, HalfBeam * .38f))
|
||||
: new Vector2(PoolHalfLength, PoolHalfWidth);
|
||||
float desired = Offset + Length * (design.Position switch
|
||||
{
|
||||
SunPoolPosition.Aft => -.09f, SunPoolPosition.Forward => .11f, _ => Resort ? .033f : .01f
|
||||
});
|
||||
PoolCenter = Mathf.Clamp(desired, Offset - Length * .24f + PoolHalfSize.x + 4.1f,
|
||||
BridgeCenter(ship.Hull.Length, ship.Decks.Count) - PoolHalfSize.x - 6.1f);
|
||||
|
||||
Attraction = design.Attraction == SunAttraction.Automatic
|
||||
? System.Array.IndexOf(cells, Facility.GrandTheater) >= 0 ? SunAttraction.Theater : SunAttraction.None
|
||||
: design.Attraction;
|
||||
AttractionCenter = Offset - Length * .367f;
|
||||
AttractionHalfSize = new Vector2(Length * .085f, HalfBeam * .62f);
|
||||
StageCenter = design.Attraction == SunAttraction.Automatic ? Offset - Length * .376f : AttractionCenter;
|
||||
StageHalfWidth = Mathf.Min(2.85f, HalfBeam * .39f);
|
||||
}
|
||||
|
||||
internal int Loungers => Resort ? 10 : 8;
|
||||
internal bool Theater => Attraction == SunAttraction.Theater;
|
||||
internal int Loungers => (Resort ? 10 : 8) + (ExtraLoungers ? 2 : 0);
|
||||
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 LoungerX(int index)
|
||||
{
|
||||
if (!Resort && !ExtraLoungers && PoolHalfSize.x < 3f)
|
||||
return PoolCenter - 3f + index * .94f;
|
||||
float span = Mathf.Max(PoolHalfSize.x - .44f, (Loungers - 1) * .45f);
|
||||
return PoolCenter + Mathf.Lerp(-span, span, (float)index / (Loungers - 1));
|
||||
}
|
||||
internal float StageSeatX(int row) => StageCenter + 3.04f + row * 1.04f;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,10 +110,12 @@ namespace Soundings
|
||||
&& passageAudio.Caption.Contains("next port of call is Nassau"), "Cast off at Miami with a short cinematic and named PA"))
|
||||
yield break;
|
||||
Vector3 departureStart = harbor.PassageWorldPosition;
|
||||
var miamiBerth = harbor.PortCinematicAlignment();
|
||||
yield return new WaitForSecondsRealtime(1.3f);
|
||||
if (!CheckSmoke(harbor.PortCinematicActive && passageHelm.Progress == 0
|
||||
&& Vector3.Distance(departureStart, harbor.PassageWorldPosition) > 1,
|
||||
"Departure moves the ship through the harbor before starting the voyage clock")
|
||||
|| !CheckSmoke(miamiBerth == harbor.PortCinematicAlignment(), "Miami's quay and shoreline stay aligned through cast-off")
|
||||
|| !CheckSmoke(harbor.HasActiveGuest(GuestActivity.Swim) && harbor.HasActiveGuest(GuestActivity.Wade)
|
||||
&& harbor.HasActiveGuest(GuestActivity.Lounge), "Guests swim, wade, and use the pool loungers in calm weather"))
|
||||
yield break;
|
||||
@@ -287,9 +289,11 @@ namespace Soundings
|
||||
if (!SubmitSmoke("dock-now") || !CheckSmoke(harbor.PortCinematicActive && Ship.Port == 1 && company.Voyages == 1
|
||||
&& root.Q<Label>("port-cinematic-name")?.text == "Nassau", "Arrival shot opens on the destination after settlement"))
|
||||
yield break;
|
||||
var nassauBerth = harbor.PortCinematicAlignment();
|
||||
FinishVoyage();
|
||||
yield return new WaitForSecondsRealtime(1.4f);
|
||||
if (!CheckSmoke(harbor.PortCinematicActive && company.Voyages == 1, "Arrival cannot settle the voyage twice"))
|
||||
if (!CheckSmoke(harbor.PortCinematicActive && company.Voyages == 1, "Arrival cannot settle the voyage twice")
|
||||
|| !CheckSmoke(nassauBerth == harbor.PortCinematicAlignment(), "Nassau's quay and shoreline stay aligned during docking"))
|
||||
yield break;
|
||||
yield return CaptureSmoke(directory, "07-arrival-cinematic");
|
||||
yield return new WaitUntil(() => !harbor.PortCinematicActive);
|
||||
@@ -390,6 +394,11 @@ namespace Soundings
|
||||
"Complete the itinerary with two linked ledger records"))
|
||||
yield break;
|
||||
holdCinematicClock = true;
|
||||
var keyWestBerth = harbor.PortCinematicAlignment();
|
||||
cinematicTime = 1.4f;
|
||||
PresentPortCinematicFrame(cinematicTime);
|
||||
if (!CheckSmoke(keyWestBerth == harbor.PortCinematicAlignment(), "Key West's quay and shoreline stay aligned during docking"))
|
||||
yield break;
|
||||
yield return CapturePortAndSkipSmoke(directory, "11d-key-west-cinematic", 1.4f);
|
||||
yield return CaptureSmoke(directory, "11d-itinerary-complete");
|
||||
|
||||
@@ -423,6 +432,12 @@ namespace Soundings
|
||||
"Larger venues show the lock on a Coastal hull")
|
||||
|| !CheckSmoke(company.BuildBlock(Ship, 0, 4, Facility.Suite) != null, "A Coastal hull cannot fit a suite"))
|
||||
yield break;
|
||||
if (!SubmitSmoke("facility-casino")
|
||||
|| !CheckSmoke(root.Q<Button>($"facility-{(int)Facility.CasinoLounge}")?.ClassListContains("work-tool-locked") == false
|
||||
&& root.Q<Button>($"facility-{(int)Facility.Casino}")?.ClassListContains("work-tool-locked") == true
|
||||
&& root.Q<Button>($"facility-{(int)Facility.GrandCasino}")?.ClassListContains("work-tool-locked") == true,
|
||||
"The compact casino is available on Coastal hulls and larger casinos require bigger ships"))
|
||||
yield break;
|
||||
|
||||
company.Voyages = 3;
|
||||
company.Reputation = 24;
|
||||
@@ -483,11 +498,26 @@ namespace Soundings
|
||||
"Rotate a 3×2 water park to span three rows"))
|
||||
yield break;
|
||||
yield return CaptureSmoke(directory, "15b-rotated-water-park-plan");
|
||||
if (!SubmitSmoke("deck-4") || !SubmitSmoke("facility-casino") || !SubmitSmoke($"facility-{(int)Facility.GrandCasino}")
|
||||
|| !SubmitSmoke("berth-4") || !CheckSmoke(Ship.CasinoCapacity == Market.Facilities[(int)Facility.GrandCasino].Capacity,
|
||||
"Fit a 3×2 grand casino using Deck Plans"))
|
||||
yield break;
|
||||
if (!CheckSmoke(company.Build(Ship, 7, 10, Facility.Restaurant) == null && company.Build(Ship, 7, 21, Facility.CocktailLounge) == null
|
||||
&& company.Build(Ship, 7, 0, Facility.ResortPool) == null && company.Build(Ship, 7, 3, Facility.GrandTheater) == null
|
||||
&& company.Build(Ship, 7, 14, Facility.GrandSuite) == null && company.Build(Ship, 7, 28, Facility.Shop) == null
|
||||
&& VesselExterior.SunDeck(Ship).Theater
|
||||
&& company.Refuel(Ship, 100) == null, "Fit and fuel the largest hull") || !SubmitSmoke("nav-0"))
|
||||
&& company.Refuel(Ship, 100) == null, "Fit and fuel the largest hull"))
|
||||
yield break;
|
||||
float oldPoolCenter = VesselExterior.SunDeck(Ship).PoolCenter;
|
||||
if (!SubmitSmoke("sun-deck-open") || !SubmitSmoke("sun-pool-resort") || !SubmitSmoke("sun-shape-oval")
|
||||
|| !SubmitSmoke("sun-pool-forward") || !SubmitSmoke("sun-attraction-coaster"))
|
||||
yield break;
|
||||
var sunDeck = VesselExterior.SunDeck(Ship);
|
||||
if (!CheckSmoke(sunDeck.HasPool && sunDeck.OvalPool && sunDeck.PoolCenter > oldPoolCenter
|
||||
&& sunDeck.Attraction == SunAttraction.RollerCoaster, "Customize the actual outdoor pool and stern attraction"))
|
||||
yield break;
|
||||
yield return CaptureSmoke(directory, "15c-custom-sun-deck");
|
||||
if (!SubmitSmoke("nav-0"))
|
||||
yield break;
|
||||
Ship flagship = Ship;
|
||||
yield return CaptureSmoke(directory, "16-ocean-class-hull");
|
||||
@@ -497,6 +527,27 @@ namespace Soundings
|
||||
yield break;
|
||||
holdCinematicClock = true;
|
||||
yield return CapturePortAndSkipSmoke(directory, "16b-ocean-class-departure", 1.4f);
|
||||
harbor.Zoom(-7, new Vector2(.51f, .48f));
|
||||
yield return new WaitForSecondsRealtime(.5f);
|
||||
yield return CaptureSmoke(directory, "16b-custom-sun-deck-at-sea");
|
||||
harbor.ResetView(true);
|
||||
int regularStake = livePassage.GetPrice(OnboardService.Casino);
|
||||
if (!SubmitSmoke("passage-price-casino-plus") || !SubmitSmoke("passage-special-casino")
|
||||
|| !CheckSmoke(livePassage.GetPrice(OnboardService.Casino) == regularStake + 1
|
||||
&& livePassage.DiscountTicks(OnboardService.Casino) > 0, "Set table stakes and run a low-stakes hour"))
|
||||
yield break;
|
||||
MovePassageToSmoke(.12f);
|
||||
if (!CheckSmoke(livePassage.Get(OnboardService.Casino).Served > 0
|
||||
&& livePassage.CasinoPayouts > 0 && livePassage.Get(OnboardService.Casino).Revenue > livePassage.CasinoPayouts,
|
||||
"The fitted casino serves guests and records stakes and payouts")
|
||||
|| !SubmitSmoke("passage-deck-4"))
|
||||
yield break;
|
||||
harbor.Zoom(-14, new Vector2(.51f, .49f));
|
||||
yield return new WaitForSecondsRealtime(.5f);
|
||||
if (!CheckSmoke(harbor.HasActiveGuest(GuestActivity.PlayCards) && harbor.HasActiveGuest(GuestActivity.Dealer),
|
||||
"Casino tables have active guests and dealers"))
|
||||
yield break;
|
||||
yield return CaptureSmoke(directory, "16c-casino");
|
||||
int retailPrice = livePassage.GetPrice(OnboardService.Retail) + 1;
|
||||
if (!SubmitSmoke("passage-price-retail-plus") || !livePassage.TryWorkStation(StationKind.Retail, out _)
|
||||
|| !CheckSmoke(livePassage.Get(OnboardService.Retail).Served > 0
|
||||
@@ -561,7 +612,13 @@ namespace Soundings
|
||||
yield break;
|
||||
|
||||
MovePassageToSmoke(.30f);
|
||||
if (!SubmitSmoke("passage-deck-7") || !SubmitSmoke("passage-special-retail") || !SubmitSmoke("company-menu"))
|
||||
if (!SubmitSmoke("passage-deck-7"))
|
||||
yield break;
|
||||
RefreshPassageBusiness();
|
||||
if (livePassage.DiscountTicks(OnboardService.Retail) == 0 && !SubmitSmoke("passage-special-retail"))
|
||||
yield break;
|
||||
if (!CheckSmoke(livePassage.DiscountTicks(OnboardService.Retail) > 0, "Keep a shop sale active for the fleet save")
|
||||
|| !SubmitSmoke("company-menu"))
|
||||
yield break;
|
||||
int savedReserve = company.ReservedCash;
|
||||
Company departingCompany = company;
|
||||
@@ -587,6 +644,8 @@ namespace Soundings
|
||||
|| !CheckSmoke(SameSavedCrossing(before[0], after[0]), "The background crossing retains its navigation and operation state")
|
||||
|| !CheckSmoke(SameSavedCrossing(before[1], after[1]), "The foreground crossing retains its navigation and operation state")
|
||||
|| !CheckSmoke(Ship.Decks[6].RotationAt(3) == 1 && Ship.Decks[5].RotationAt(4) == 1, "Both rotated layouts load intact")
|
||||
|| !CheckSmoke(Ship.SunDeckPlan.Shape == SunPoolShape.Oval && Ship.SunDeckPlan.Position == SunPoolPosition.Forward
|
||||
&& Ship.SunDeckPlan.Attraction == SunAttraction.RollerCoaster, "The outdoor deck layout stays fitted after reloading")
|
||||
|| !CheckSmoke(passageDeck == 7 && livePassage.GetPrice(OnboardService.Retail) == retailPrice
|
||||
&& livePassage.DiscountTicks(OnboardService.Retail) > 0, "The selected deck and active shop sale resume"))
|
||||
yield break;
|
||||
|
||||
Reference in New Issue
Block a user