Skip to content

Commit

Permalink
2.2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
innominata committed Sep 27, 2021
1 parent 3c9996d commit b9a0de5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion GalacticScale2/Scripts/Bootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class GS2
// [BepInDependency("nebula.api", BepInDependency.DependencyFlags.HardDependency)]
public class Bootstrap : BaseUnityPlugin
{
public const string VERSION = "2.2.0.4";
public const string VERSION = "2.2.0.5";

public new static ManualLogSource Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public float OrbitInclination
[SerializeField]
public float OrbitalPeriod
{
get => orbitalPeriod < 0 ? InitOrbitalPeriod() : orbitalPeriod;
get => orbitalPeriod == -1 ? InitOrbitalPeriod() : orbitalPeriod;
set => orbitalPeriod = value;
}

Expand Down Expand Up @@ -142,7 +142,7 @@ public float Obliquity
[SerializeField]
public float RotationPeriod
{
get => rotationPeriod < 0 ? InitRotationPeriod() : rotationPeriod;
get => rotationPeriod == -1 ? InitRotationPeriod() : rotationPeriod;
set => rotationPeriod = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,36 @@ public static PlanetData CreatePlanet(ref StarData star, GSPlanet gsPlanet, Rand
if (gsPlanet.MoonsCount > 0) CreateMoons(ref planet, gsPlanet, random);
//Log("PLANET RADIUS "+planetData.radius);
//Log("End|" + gsPlanet.Name);
if (planet.orbitalPeriod == planet.rotationPeriod) planet.singularity |= EPlanetSingularity.TidalLocked;

if (planet.obliquity > 75 || planet.obliquity < -75) planet.singularity |= EPlanetSingularity.LaySide;
//GS2.Log("Setting Singularities");
//GS2.Log($"Added Planet {planet.name} to galaxy with id:{planet.id} and index:{planet.index} star:{planet.star.name} with id:{planet.star.id} rotation:{planet.rotationPeriod} orbit:{planet.orbitalPeriod} obliq:{planet.obliquity} bodies:{gsPlanet.Bodies.Count}");
if (Math.Abs(planet.orbitalPeriod - planet.rotationPeriod) < 1f) {
//GS2.Log("Setting TidalLock");
planet.singularity |= EPlanetSingularity.TidalLocked;
}
if (Math.Abs(planet.orbitalPeriod - planet.rotationPeriod *2) < 1f) {
//GS2.Log("Setting TidalLock2");
planet.singularity |= EPlanetSingularity.TidalLocked2;
}
if (Math.Abs(planet.orbitalPeriod - planet.rotationPeriod*4) < 1f) {
//GS2.Log("Setting TidalLock4");
planet.singularity |= EPlanetSingularity.TidalLocked4;
}
if (gsPlanet.Bodies.Count > 2) {
//GS2.Log("Setting Multisatellite");
planet.singularity |= EPlanetSingularity.MultipleSatellites;
}
if (planet.obliquity > 75 || planet.obliquity < -75) {
//GS2.Log("Setting LaySide");
planet.singularity |= EPlanetSingularity.LaySide;
}

if (planet.rotationPeriod < 0) planet.singularity |= EPlanetSingularity.ClockwiseRotate;
//GS2.Log($"Added Planet {planet.name} to galaxy with id:{planet.id} and index:{planet.index} star:{planet.star.name} with id:{planet.star.id}");
if (planet.rotationPeriod < 0)
{
//GS2.Log("Setting ReverseRotation");
planet.singularity |= EPlanetSingularity.ClockwiseRotate;
}

GS2.Warn(planet.singularityString + " " + planet.singularity);
// Log($"{planet.name} created in {highStopwatch.duration:F5} s\r\n");
return planet;
}
Expand Down Expand Up @@ -172,7 +196,7 @@ public static void CreateMoons(ref PlanetData planetData, GSPlanet planet, Rando
}

moon.orbitAroundPlanet = planetData;
if (i > 1) planetData.singularity |= EPlanetSingularity.MultipleSatellites;

}
}

Expand Down

0 comments on commit b9a0de5

Please sign in to comment.