Skip to content

Commit

Permalink
Merge pull request #132 from Pulsar4xDevs/Survey
Browse files Browse the repository at this point in the history
Survey
  • Loading branch information
NathanH- committed Apr 3, 2016
2 parents e7edb68 + 6cab857 commit 3e26118
Show file tree
Hide file tree
Showing 48 changed files with 5,624 additions and 693 deletions.
2 changes: 1 addition & 1 deletion MITLicense.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Aurora is Copyright Steve Walmsley
Aurora is Copyright Steve Walmsley.

The names of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.
174 changes: 173 additions & 1 deletion Pulsar4X/Pulsar4X.Lib/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ public enum OrderType
/// </summary>
LoadInstallation,
LoadShipComponent,
LoadPDCPart,
UnloadInstallation,
UnloadShipComponent,
UnloadPDCPart,
UnloadAll,
LoadAllMinerals,
UnloadAllMinerals,
Expand Down Expand Up @@ -444,6 +446,20 @@ public enum OrderType
TractorSpecifiedShipyard,
ReleaseAt,

/// <summary>
/// Transport equipped ships
/// </summary>
LoadGroundUnit,
UnloadGroundUnit,

/// <summary>
/// Any ship can carry teams or commanders.
/// </summary>
LoadCommander,
LoadTeam,
UnloadCommander,
UnloadTeam,

/// <summary>
/// Number of orders available.
/// </summary>
Expand Down Expand Up @@ -474,6 +490,120 @@ public enum LoadType
Troop,
TypeCount
}

public enum DefaultOrders
{
NoSpecialOrder,
SurveyNearestAsteroid,
SurveyNearestMoon,
SurveyNearestPlanet,
SurveyNearestPlanetOrMoon,
SurveyNearestBody,
SurveyNextFiveBodies,
SurveyNearestSurveyLocation,
SurveyNextThreeSurveyLocations,

/// <summary>
/// Superior formation.
/// </summary>
FollowHigherFleetInSystem,
MoveToEntryJumpPoint,
RefuelInCurrentSystem,

/// <summary>
/// Any Colony with > 25M people that is set as a colonist source.
/// </summary>
LoadColonistsAtNearestSource,
LoadColonistsAtCapital,

/// <summary>
/// Any colony with less than 25M people, or otherwise set as a colonist destination.
/// </summary>
UnloadColonistsAtNearestDestination,
BuildJumpGateAtNearestJumpPoint,

/// <summary>
/// Colony with citizens who likely don't need automines.
/// </summary>
LoadAutomineFromPopulation,

/// <summary>
/// No people, only mines present,
/// </summary>
UnloadAutomineToMiningColony,

/// <summary>
/// Special tradeship only conditional.
/// </summary>
MoveToTradeLocation,

/// <summary>
/// Luxury ships? rescue vessels?
/// </summary>
UnloadPassengersAtNearestColony,

/// <summary>
/// World with minerals available above world reserve levels?
/// </summary>
MoveToMineralSource,
MoveToSoriumGasGiant,
SalvageNearestWreck,
TerraformColony,
TypeCount
}

public enum Condition
{
NoCondition,
FuelLessThan50,
FuelLessThan40,
FuelLessThan30,
FuelLessThan20,
FuelLessThan10,
FuelTanksFull,
ParentFleetInSystem,
SubFleetInSameLocation,
SpeedLessThanMax,
SupplyPointsLessThan20,
SupplyPointsLessThan10,
HostileActiveContactInSystem,
TypeCount
}

public enum ConditionalOrders
{
NoConditionalOrder,
Unload90PercentOfFuelAtNearestColony,
UnloadFuelAtColonyAndMoveToSoriumGasGiant,
JoinParentFleetIfInSystem,
RefuelAtNearestColony,

/// <summary>
/// Tanker must have more than 10% of its fuel available to refuel with.
/// </summary>
RefuelAtNearestAvailableTanker,

/// <summary>
/// Can be world or tanker.
/// </summary>
RefuelAtNearestAvailableSource,

/// <summary>
/// All restrictions that apply to fuel harvesting apply here.
/// </summary>
ResupplyAtNearestColony,
ResupplyAtNearestSupplyShip,
RessuplyAtNearestSource,

ActivateShields,
DeactivateShields,
ClearOrders,
IncorporateSubFleetsAtLocation,
ChangeToMaximumSpeed,
ActiveSensorsOn,
OverhaulAtNearestColony,
TypeCount
}
}

/// <summary>
Expand Down Expand Up @@ -723,10 +853,36 @@ public static class SensorTN
public static byte[] ActiveStrength = { 10, 12, 16, 21, 28, 36, 48, 60, 80, 100, 135, 180 };
public static byte[] PassiveStrength = { 5, 6, 8, 11, 14, 18, 24, 32, 40, 50, 60, 75 };

/// <summary>
/// Strength of geological and gravitational survey sensors for standard,improved,advanced, and phased sensors.
/// </summary>
public static byte[] SurveyStrength = { 1, 2, 3, 5 };
public const int SurveyStrengthMax = 4;

/// <summary>
/// What value are sensors calibrated around searching for?
/// </summary>
public const uint DefaultPassiveSignature = 1000;

/// <summary>
/// Survey point requirement will be based on body radius relative to earth.
/// </summary>
public const float EarthRadius = (float)(6378.1 / Constants.Units.KmPerAu);

/// <summary>
/// And relative to earth's point value from Aurora.
/// </summary>
public const uint EarthSurvey = 637;

/// <summary>
/// Each survey ring is 2B km out for every 1.0 unit of solar mass present. solar mass is sqrted for this calculation as per survey cost and then multiplied by this value. units in AU.
/// </summary>
public const double EarthRingDistance = 13.36917422;

/// <summary>
/// How many survey points are there? this is only referenced in taskgroup grav survey code for now.
/// </summary>
public const int SurveyPointCount = 30;
}

/// <summary>
Expand Down Expand Up @@ -1005,6 +1161,14 @@ public static class JumpEngineTN

}

public static class GameConstants
{
/// <summary>
/// 10k km is the basic unit of AuroraTN distance that pretty much all calculations will go to. I don't expect this to ever change, but would prefer to keep it as a constant regardless.
/// </summary>
public const double BasicUnitOfDistance = 10000.0;
}

/// <summary>
/// List of game-specific settings.
/// Since we don't have save/load yet, I'm just sticking this here.
Expand Down Expand Up @@ -1052,9 +1216,17 @@ public static class GameSettings
/// <summary>
/// Jumppoints will not appear on secondary stars if true.
/// </summary>
public static bool PrimaryOnlyJumpPoints = false;
public static bool PrimaryOnlyJumpPoints = true;

/// <summary>
/// Follow TN terraforming rules regarding what can be terraformed, and what gases generate what hostile effects.
/// </summary>
public static bool TNTerraformingRules = false;

/// <summary>
/// Jumppoint generation uses the current 6.50 method of reducing the total number of JPs created.
/// </summary>
public static bool Aurora65JPGeneration = true;
}
}
}
27 changes: 27 additions & 0 deletions Pulsar4X/Pulsar4X.Lib/Entities/Components/CargoTN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ public ComponentDefTN cargoComponentType
get { return CargoComponentType; }
}

/// <summary>
/// What type of mineral is being carried?
/// </summary>
private Constants.Minerals.MinerialNames MineralType;
public Constants.Minerals.MinerialNames mineralType
{
get { return MineralType; }
}

#warning Cargo entries should be reworked to account for the various things that can be held in cargo, there is no PDC holding yet for example.

/// <summary>
/// Size of Installation being carried.
/// </summary>
Expand All @@ -46,11 +57,27 @@ public CargoListEntryTN(Installation.InstallationType Type, int SizeInTons)
Tons = SizeInTons;
}

/// <summary>
/// Constructor for Component transfers.
/// </summary>
/// <param name="Type">Type of component</param>
/// <param name="SizeInTons">Tons of said component</param>
public CargoListEntryTN(ComponentDefTN Type, int SizeInTons)
{
CargoComponentType = Type;
Tons = SizeInTons;
}

/// <summary>
/// This is the constructor for minerals in cargo.
/// </summary>
/// <param name="Type">Type of mineral</param>
/// <param name="SizeInTons">Tons of said mineral</param>
public CargoListEntryTN(Constants.Minerals.MinerialNames Type, int SizeInTons)
{
MineralType = Type;
Tons = SizeInTons;
}
}

/// <summary>
Expand Down
21 changes: 20 additions & 1 deletion Pulsar4X/Pulsar4X.Lib/Entities/Components/ComponentListTN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ public class ComponentDefListTN
/// </summary>
public BindingList<JumpEngineDefTN> JumpEngineDef { get; set; }

/// <summary>
/// Survey sensor definitions.
/// </summary>
public BindingList<SurveySensorDefTN> SurveySensorDef { get; set; }

/// <summary>
/// Number of the total components this faction has for ship building purposes. MissileEngineDef and MissileDef are excluded from this.
/// </summary>
Expand Down Expand Up @@ -174,6 +179,8 @@ public ComponentDefListTN()

JumpEngineDef = new BindingList<JumpEngineDefTN>();

SurveySensorDef = new BindingList<SurveySensorDefTN>();

DefaultPassives = new PassiveSensorDefTN("Default, Don't display this one.", 1.0f, 1, PassiveSensorType.Thermal, 1.0f, 1);
}

Expand Down Expand Up @@ -356,6 +363,18 @@ public void AddInitialComponents()
MissileDef.Add(MissileAMMDef);


/// <summary>
/// Sensor components should be added upon researching the appropriate technology, as they cannot be designed, Count should be at 46
/// </summary>
SurveySensorDefTN GeoSurvey = new SurveySensorDefTN("Geological Survey Sensor", SurveySensorDefTN.SurveySensorType.Geological, 1.0f);
SurveySensorDefTN GravSurvey = new SurveySensorDefTN("Gravitational Survey Sensor", SurveySensorDefTN.SurveySensorType.Gravitational, 1.0f);

SurveySensorDef.Add(GeoSurvey);
SurveySensorDef.Add(GravSurvey);

TotalComponents = TotalComponents + 2;



}

Expand All @@ -367,7 +386,7 @@ public void SanityCheck()
TotalComponents = CrewQuarters.Count + FuelStorage.Count + EngineeringSpaces.Count + OtherComponents.Count + Engines.Count +
PassiveSensorDef.Count + ActiveSensorDef.Count + CargoHoldDef.Count + ColonyBayDef.Count + CargoHandleSystemDef.Count +
BeamFireControlDef.Count + BeamWeaponDef.Count + ReactorDef.Count + ShieldDef.Count + MLauncherDef.Count + MagazineDef.Count +
MissileFireControlDef.Count + CIWSDef.Count + TurretDef.Count + JumpEngineDef.Count;
MissileFireControlDef.Count + CIWSDef.Count + TurretDef.Count + JumpEngineDef.Count + SurveySensorDef.Count;

}
}
Expand Down
2 changes: 2 additions & 0 deletions Pulsar4X/Pulsar4X.Lib/Entities/Components/ComponentTN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public enum ComponentTypeTN

JumpEngine,

SurveySensor,

TypeCount
}

Expand Down
Loading

0 comments on commit 3e26118

Please sign in to comment.