Add fleet save slots and rotatable onboard venues
This commit is contained in:
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
public enum OnboardService { Rooms, Meals, Drinks, Shows, Amenities }
|
||||
public enum OnboardService { Rooms, Meals, Drinks, Shows, Amenities, Retail }
|
||||
|
||||
[Serializable]
|
||||
public sealed class OnboardReport
|
||||
@@ -42,10 +42,11 @@ namespace Soundings
|
||||
|
||||
public sealed partial class OnboardSession
|
||||
{
|
||||
private const int ServiceKinds = 5;
|
||||
private const int ServiceKinds = (int)OnboardService.Retail + 1;
|
||||
private const int PromotionTicks = 5;
|
||||
private static readonly int[] Defaults = { 0, 12, 7, 18, 10 };
|
||||
private static readonly double[] BaseDemand = { 0, .71, .59, .43, .51 };
|
||||
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 VoyageEvent[] Events =
|
||||
{
|
||||
new VoyageEvent("Dinner rush", "An early seating is filling up. Open overflow tables to expand meal capacity and lift the survey.",
|
||||
@@ -95,8 +96,11 @@ namespace Soundings
|
||||
capacity[3] = ship.Entertainment;
|
||||
int outdoor = ship.PoolCapacity;
|
||||
capacity[4] = quote.Weather switch { WeatherCondition.Storm => 0, WeatherCondition.Swell => outdoor * 2 / 3, _ => outdoor };
|
||||
capacity[(int)OnboardService.Retail] = ship.RetailCapacity;
|
||||
|
||||
prices = (int[])(ship.ServicePrices?.Length == ServiceKinds ? ship.ServicePrices : Defaults).Clone();
|
||||
prices = (int[])Defaults.Clone();
|
||||
if (ship.ServicePrices != null)
|
||||
Array.Copy(ship.ServicePrices, prices, Math.Min(ship.ServicePrices.Length, prices.Length));
|
||||
for (int i = 0; i < ServiceKinds; i++)
|
||||
prices[i] = Market.Clamp(prices[i], 0, Defaults[i] * 4);
|
||||
InitializeSystems();
|
||||
@@ -109,6 +113,7 @@ namespace Soundings
|
||||
OnboardService.Meals => "Meals",
|
||||
OnboardService.Drinks => "Drinks",
|
||||
OnboardService.Shows => "Entertainment",
|
||||
OnboardService.Retail => "Shopping",
|
||||
_ => "Amenities"
|
||||
};
|
||||
|
||||
@@ -210,8 +215,10 @@ namespace Soundings
|
||||
sample[0] = new OnboardSample(Math.Max(Quote.Guests, Quote.RoomDemand), Quote.Guests, capacity[0], 0);
|
||||
double fulfillment = 1;
|
||||
double mealFulfillment = 1;
|
||||
for (int i = 1; i < ServiceKinds; i++)
|
||||
int serviceCount = capacity[(int)OnboardService.Retail] > 0 ? ServiceKinds : ServiceKinds - 1;
|
||||
for (int i = 1; i < serviceCount; i++)
|
||||
{
|
||||
bool retail = i == (int)OnboardService.Retail;
|
||||
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)));
|
||||
@@ -221,7 +228,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) ? 1.28 : 1;
|
||||
double indoorShift = Quote.Weather == WeatherCondition.Storm && (i == 2 || i == 3 || retail) ? 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] + extraSeats + (featured ? additionalCapacity : 0) + CrewServiceBoost(i));
|
||||
@@ -229,7 +236,15 @@ namespace Soundings
|
||||
|
||||
if (collect)
|
||||
{
|
||||
int takings = (int)Math.Round(served * price * (i == 1 ? .17 : .13));
|
||||
int takings;
|
||||
if (retail)
|
||||
{
|
||||
int orders = price == 0 ? 0 : (int)Math.Round(served * .13);
|
||||
takings = orders * price;
|
||||
Expenses += orders * WholesalePrice;
|
||||
}
|
||||
else
|
||||
takings = (int)Math.Round(served * price * (i == 1 ? .17 : .13));
|
||||
revenue[i] += takings;
|
||||
Revenue += takings;
|
||||
}
|
||||
@@ -246,7 +261,7 @@ namespace Soundings
|
||||
if (collect)
|
||||
{
|
||||
UpdateHealth(mealFulfillment);
|
||||
double target = Math.Min(100, 40 + 55 * fulfillment / ServiceKinds - (100 - health) * .28 + CrewSurveyBonus);
|
||||
double target = Math.Min(100, 40 + 55 * fulfillment / serviceCount - (100 - health) * .28 + CrewSurveyBonus);
|
||||
satisfaction = satisfaction * .77 + target * .23;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user