Fix port cinematics and expand ship attractions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user