Add manual helm, grounded interiors, and taller ship classes
This commit is contained in:
@@ -34,6 +34,8 @@ namespace Soundings
|
||||
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));
|
||||
|
||||
internal void AddEmptyDeck() => Decks.Add(new Deck(Hull.Columns * Hull.Rows));
|
||||
|
||||
public int Count(Facility facility)
|
||||
{
|
||||
int count = 0;
|
||||
@@ -104,7 +106,7 @@ namespace Soundings
|
||||
if (ship == null || string.IsNullOrWhiteSpace(ship.Name) || ship.HullIndex < 0 || ship.HullIndex >= Market.Hulls.Count
|
||||
|| ship.Port < 0 || ship.Port >= Permits.Length || !Permits[ship.Port] || ship.Condition < 24
|
||||
|| ship.Condition > 100 || ship.Fare < Market.MinFare || ship.Fare > Market.MaxFare
|
||||
|| ship.Decks == null || ship.Decks.Count < Market.FirstDecks || ship.Decks.Count > ship.Hull.MaxDecks
|
||||
|| ship.Decks == null || ship.Decks.Count < Market.Hulls[0].StarterDecks || ship.Decks.Count > ship.Hull.MaxDecks
|
||||
|| ship.Fuel < 0 || double.IsNaN(ship.FuelValue) || double.IsInfinity(ship.FuelValue) || ship.FuelValue < 0)
|
||||
return false;
|
||||
|
||||
@@ -128,6 +130,13 @@ namespace Soundings
|
||||
return true;
|
||||
}
|
||||
|
||||
public void RestoreHullDecks()
|
||||
{
|
||||
foreach (Ship ship in Fleet)
|
||||
while (ship.Decks.Count < ship.Hull.StarterDecks)
|
||||
ship.AddEmptyDeck();
|
||||
}
|
||||
|
||||
public string ShipyardBlock(int hullIndex, bool used)
|
||||
{
|
||||
HullSpec hull = Market.Hulls[hullIndex];
|
||||
@@ -179,8 +188,8 @@ namespace Soundings
|
||||
Fuel = original ? 48 : used ? 25 : 0
|
||||
};
|
||||
ship.FuelValue = ship.Fuel * Market.FuelPrice(0, 1);
|
||||
for (int i = 0; i < Market.FirstDecks; i++)
|
||||
ship.Decks.Add(new Deck(ship.Hull.Columns * ship.Hull.Rows));
|
||||
for (int i = 0; i < ship.Hull.StarterDecks; i++)
|
||||
ship.AddEmptyDeck();
|
||||
if (used)
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
@@ -204,7 +213,7 @@ namespace Soundings
|
||||
if (Cash < price)
|
||||
return "The company needs more cash.";
|
||||
Cash -= price;
|
||||
ship.Decks.Add(new Deck(ship.Hull.Columns * ship.Hull.Rows));
|
||||
ship.AddEmptyDeck();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user