Add MEGA Ocean Liner, split decks, and detailed ship materials
This commit is contained in:
@@ -119,23 +119,34 @@ namespace BigShipTycoon
|
||||
|
||||
public HullSpec Hull => Market.Hulls[HullIndex];
|
||||
public int Beds => FacilityCapacity(Facility.Cabin) + SuiteBerths;
|
||||
public int SuiteBerths => FacilityCapacity(Facility.Suite) + FacilityCapacity(Facility.GrandSuite);
|
||||
public int SuiteBerths => FacilityCapacity(Facility.Suite) + GrandSuiteBerths + SkyResidenceBerths;
|
||||
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) + SunDeckPlan.AddedShows;
|
||||
internal int SkyResidenceBerths => FacilityCapacity(Facility.SkyResidence);
|
||||
public int Meals => (FacilityCapacity(Facility.Dining) + FacilityCapacity(Facility.Restaurant) + FacilityCapacity(Facility.MarketHall)) * 3;
|
||||
public int Entertainment => FacilityCapacity(Facility.Entertainment) + FacilityCapacity(Facility.GrandTheater)
|
||||
+ FacilityCapacity(Facility.OceanArena) + OutdoorShowCapacity;
|
||||
public int PoolCapacity => FacilityCapacity(Facility.Amenity) + FacilityCapacity(Facility.ResortPool)
|
||||
+ 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);
|
||||
+ FacilityCapacity(Facility.Spa) + FacilityCapacity(Facility.WaterPark) + FacilityCapacity(Facility.ThermalSpa) + OutdoorAmenityCapacity;
|
||||
public int BarCapacity => FacilityCapacity(Facility.Bar) + FacilityCapacity(Facility.CocktailLounge) + FacilityCapacity(Facility.PanoramaClub);
|
||||
public int RetailCapacity => FacilityCapacity(Facility.Shop) + FacilityCapacity(Facility.ShoppingArcade) + FacilityCapacity(Facility.Galleria);
|
||||
public int CasinoCapacity => FacilityCapacity(Facility.CasinoLounge) + FacilityCapacity(Facility.Casino)
|
||||
+ FacilityCapacity(Facility.GrandCasino) + FacilityCapacity(Facility.RoyalCasino);
|
||||
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);
|
||||
public int WaterCapacity => 16000 + HullIndex * 7600 + FacilityCapacity(Facility.Water);
|
||||
public int WaterProduction => 9000 + HullIndex * 3900 + Count(Facility.Water) * 6000;
|
||||
public int WasteCapacity => 12000 + HullIndex * 6800 + FacilityCapacity(Facility.Waste);
|
||||
public int WasteTreatment => 5500 + HullIndex * 3400 + Count(Facility.Waste) * 7000;
|
||||
public int Tank => Hull.Tank + FacilityCapacity(Facility.Tank);
|
||||
public int GalleyCapacity => (HullIndex == Market.Mega ? 540 : 168 + HullIndex * 72)
|
||||
+ FacilityCapacity(Facility.Galley) + FacilityCapacity(Facility.ProductionGalley);
|
||||
public int FoodCapacity => (HullIndex == Market.Mega ? 5600 : 1500 + HullIndex * 640)
|
||||
+ FacilityCapacity(Facility.Stores) + FacilityCapacity(Facility.ColdChain);
|
||||
public int WaterCapacity => (HullIndex == Market.Mega ? 62000 : 16000 + HullIndex * 7600)
|
||||
+ FacilityCapacity(Facility.Water) + FacilityCapacity(Facility.MembranePlant);
|
||||
public int WaterProduction => (HullIndex == Market.Mega ? 28000 : 9000 + HullIndex * 3900)
|
||||
+ Count(Facility.Water) * 6000 + Count(Facility.MembranePlant) * 36000;
|
||||
public int WasteCapacity => (HullIndex == Market.Mega ? 52000 : 12000 + HullIndex * 6800)
|
||||
+ FacilityCapacity(Facility.Waste) + FacilityCapacity(Facility.ReclamationPlant);
|
||||
public int WasteTreatment => (HullIndex == Market.Mega ? 26000 : 5500 + HullIndex * 3400)
|
||||
+ Count(Facility.Waste) * 7000 + Count(Facility.ReclamationPlant) * 40000;
|
||||
internal int FittedRepairCapacity => FacilityCapacity(Facility.Workshop) + FacilityCapacity(Facility.EngineeringCenter);
|
||||
internal int FittedLaundryCapacity => FacilityCapacity(Facility.LaundryPlant);
|
||||
public int Tank => Hull.Tank + FacilityCapacity(Facility.Tank) + FacilityCapacity(Facility.BunkerFarm);
|
||||
public double BurnPerMile => Hull.TonsPerMile * (1 + (100 - Condition) * .003);
|
||||
public int SafeRange => Math.Max(0, (int)Math.Floor(Math.Min(Fuel - 6, Fuel * 100 / 112) / BurnPerMile));
|
||||
|
||||
@@ -280,15 +291,27 @@ namespace BigShipTycoon
|
||||
|
||||
public string ShipyardBlock(int hullIndex, bool used)
|
||||
{
|
||||
HullSpec hull = Market.Hulls[hullIndex];
|
||||
if (used && hullIndex == Market.Ocean)
|
||||
return "Ocean Class hulls are available as new commissions.";
|
||||
if ((uint)hullIndex >= (uint)Market.Hulls.Count)
|
||||
return "Choose a hull at the shipyard.";
|
||||
if (used && hullIndex >= Market.Ocean)
|
||||
return $"{Market.Hulls[hullIndex].Name} hulls are available as new commissions.";
|
||||
if (Fleet.Count >= Market.MaxFleet)
|
||||
return "The fleet has reached its eight-ship limit.";
|
||||
string unlock = ShipyardUnlock(hullIndex);
|
||||
if (unlock != null)
|
||||
return unlock;
|
||||
if (AvailableCash < (used ? Market.UsedPrice(hullIndex) : Market.Hulls[hullIndex].Price))
|
||||
return "The company needs more cash.";
|
||||
return null;
|
||||
}
|
||||
|
||||
internal string ShipyardUnlock(int hullIndex)
|
||||
{
|
||||
HullSpec hull = Market.Hulls[hullIndex];
|
||||
if (hullIndex == Market.Mega && !Flagship)
|
||||
return "Complete the Ocean Class flagship charter from Bermuda to Lisbon.";
|
||||
if (Voyages < hull.Voyages || Reputation < hull.Reputation)
|
||||
return $"Requires {hull.Voyages} voyages and {hull.Reputation} reputation.";
|
||||
if (AvailableCash < (used ? Market.UsedPrice(hullIndex) : hull.Price))
|
||||
return "The company needs more cash.";
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -325,7 +348,7 @@ namespace BigShipTycoon
|
||||
Name = name,
|
||||
HullIndex = hullIndex,
|
||||
Condition = original ? 78 : used ? 72 : 100,
|
||||
Fare = hullIndex == 0 ? 550 : hullIndex == 1 ? 850 : 1250,
|
||||
Fare = hullIndex switch { Market.Coastal => 550, Market.Regional => 850, Market.Mega => 1450, _ => 1250 },
|
||||
Fuel = original ? 48 : used ? 25 : 0
|
||||
};
|
||||
ship.FuelValue = ship.Fuel * Market.FuelPrice(0, 1);
|
||||
@@ -353,7 +376,7 @@ namespace BigShipTycoon
|
||||
return "The hull has reached its deck limit.";
|
||||
if (AvailableCash < price)
|
||||
return "The company needs more cash.";
|
||||
if (ship.SunDeckPlan.CustomLayout && !new SunDeckGrid(ship, ship.Decks.Count + 1).Valid(ship.SunDeckPlan))
|
||||
if (!ship.SunDecksFitAt(ship.Decks.Count + 1))
|
||||
return "Move fittings clear of the new sun deck's rails and structures before adding a deck.";
|
||||
Cash -= price;
|
||||
ship.AddEmptyDeck();
|
||||
@@ -371,7 +394,7 @@ namespace BigShipTycoon
|
||||
int anchor = deck.AnchorAt(cell, columns);
|
||||
Facility previous = deck.Cells[anchor];
|
||||
if (plan == Facility.Empty)
|
||||
return previous == Facility.Tank && ship.Fuel > ship.Tank - Market.Facilities[(int)Facility.Tank].Capacity
|
||||
return Market.BaseFacility(previous) == Facility.Tank && ship.Fuel > ship.Tank - Market.Facilities[(int)previous].Capacity
|
||||
? "Burn more fuel before removing this tank." : null;
|
||||
|
||||
FacilitySpec spec = Market.Facilities[(int)plan];
|
||||
@@ -511,16 +534,19 @@ namespace BigShipTycoon
|
||||
|
||||
double saturation = Math.Max(.66, 1 - recentSailings * .085);
|
||||
double entertainment = Math.Min(1, (double)ship.Entertainment / Math.Max(1, ship.Capacity));
|
||||
double marketDemand = (150 + ship.Capacity * .50) * from.MarketSize * to.Appeal * season * saturation;
|
||||
double classDemand = ship.HullIndex == Market.Mega ? 230 + ship.Capacity * .68 : 150 + ship.Capacity * .50;
|
||||
double marketDemand = classDemand * from.MarketSize * to.Appeal * season * saturation;
|
||||
double product = (.66 + Reputation * .006 + entertainment * .20) * (.8 + ship.Condition * .002);
|
||||
int roomDemand = Math.Max(0, (int)Math.Round(marketDemand * fareFactor * product));
|
||||
int guests = Math.Min(roomDemand, ship.Capacity);
|
||||
int suiteBerths = ship.SuiteBerths;
|
||||
int suiteGuests = suiteBerths == 0 ? 0 : (int)Math.Round(guests * (double)suiteBerths / ship.Beds);
|
||||
int grandSuiteGuests = suiteGuests == 0 ? 0 : (int)Math.Round(suiteGuests * (double)ship.GrandSuiteBerths / suiteBerths);
|
||||
int skyGuests = suiteGuests == 0 ? 0 : (int)Math.Round(suiteGuests * (double)ship.SkyResidenceBerths / suiteBerths);
|
||||
int premierGuests = suiteGuests == 0 ? 0 : (int)Math.Round(suiteGuests * (double)(ship.GrandSuiteBerths + ship.SkyResidenceBerths) / suiteBerths);
|
||||
int suitePremium = (int)Math.Round(ship.Fare / 100.0 * (
|
||||
(suiteGuests - grandSuiteGuests) * Market.Facilities[(int)Facility.Suite].FarePremiumPercent
|
||||
+ grandSuiteGuests * Market.Facilities[(int)Facility.GrandSuite].FarePremiumPercent));
|
||||
(suiteGuests - premierGuests) * Market.Facilities[(int)Facility.Suite].FarePremiumPercent
|
||||
+ (premierGuests - skyGuests) * Market.Facilities[(int)Facility.GrandSuite].FarePremiumPercent
|
||||
+ skyGuests * Market.Facilities[(int)Facility.SkyResidence].FarePremiumPercent));
|
||||
double unitCost = ship.Fuel > 0 ? ship.FuelValue / ship.Fuel : Market.FuelPrice(ship.Port, Day);
|
||||
int[] crew = ship.CaptureCrew();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user