This updates how Sol generates to have more stuff.
It's a bunch of hacky things I threw together. Some accurate, some not. Mostly just to play with the algorithms which generate stuff -- I want the generation to be unaltered if I slip in new stuff between planets. To do this, I have to understand when RNG gets updated, how, and what other constants affect the generation computations.
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "../lander.h"
|
#include "../lander.h"
|
||||||
#include "../lifeform.h"
|
#include "../lifeform.h"
|
||||||
#include "../planets.h"
|
#include "../planets.h"
|
||||||
|
#include "../../comm.h"
|
||||||
#include "../../build.h"
|
#include "../../build.h"
|
||||||
#include "../../encount.h"
|
#include "../../encount.h"
|
||||||
#include "../../globdata.h"
|
#include "../../globdata.h"
|
||||||
@@ -31,6 +32,10 @@
|
|||||||
|
|
||||||
#include "../../starbase.h"
|
#include "../../starbase.h"
|
||||||
|
|
||||||
|
#define KELVIN( t ) ( t - 273 );
|
||||||
|
#define DENSITY( d ) ( 100 * ( d / 5.513 ) );
|
||||||
|
#define RADIUS( r ) ( 100 * ( r / 6.356 ) )
|
||||||
|
|
||||||
|
|
||||||
static bool GenerateSol_initNpcs (SOLARSYS_STATE *solarSys);
|
static bool GenerateSol_initNpcs (SOLARSYS_STATE *solarSys);
|
||||||
static bool GenerateSol_reinitNpcs (SOLARSYS_STATE *solarSys);
|
static bool GenerateSol_reinitNpcs (SOLARSYS_STATE *solarSys);
|
||||||
@@ -112,18 +117,28 @@ GenerateSol_generatePlanets (SOLARSYS_STATE *solarSys)
|
|||||||
#define SOL_SEED 334241042L
|
#define SOL_SEED 334241042L
|
||||||
RandomContext_SeedRandom (SysGenRNG, SOL_SEED);
|
RandomContext_SeedRandom (SysGenRNG, SOL_SEED);
|
||||||
|
|
||||||
solarSys->SunDesc[0].NumPlanets = 9;
|
#define SOL_PLANETS 10
|
||||||
for (planetI = 0; planetI < 9; ++planetI)
|
|
||||||
|
solarSys->SunDesc[0].NumPlanets = SOL_PLANETS;
|
||||||
|
DWORD saved_seed;
|
||||||
|
for (planetI = 0; planetI < SOL_PLANETS; ++planetI)
|
||||||
{
|
{
|
||||||
COUNT angle;
|
COUNT angle;
|
||||||
DWORD rand_val;
|
DWORD rand_val;
|
||||||
UWORD word_val;
|
UWORD word_val;
|
||||||
PLANET_DESC *pCurDesc = &solarSys->PlanetDesc[planetI];
|
PLANET_DESC *pCurDesc = &solarSys->PlanetDesc[planetI];
|
||||||
|
|
||||||
pCurDesc->rand_seed = RandomContext_Random (SysGenRNG);
|
if( planetI != 4 ) /* Skip Ceres to avoid it making the rest have bizarre angles */
|
||||||
rand_val = pCurDesc->rand_seed;
|
{
|
||||||
word_val = LOWORD (rand_val);
|
pCurDesc->rand_seed = RandomContext_Random (SysGenRNG);
|
||||||
angle = NORMALIZE_ANGLE ((COUNT)HIBYTE (word_val));
|
rand_val = pCurDesc->rand_seed;
|
||||||
|
word_val = LOWORD (rand_val);
|
||||||
|
angle = NORMALIZE_ANGLE ((COUNT)HIBYTE (word_val));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
angle= HALF_CIRCLE + ( OCTANT / 2 );
|
||||||
|
}
|
||||||
|
|
||||||
switch (planetI)
|
switch (planetI)
|
||||||
{
|
{
|
||||||
@@ -135,43 +150,48 @@ GenerateSol_generatePlanets (SOLARSYS_STATE *solarSys)
|
|||||||
case 1: /* VENUS */
|
case 1: /* VENUS */
|
||||||
pCurDesc->data_index = PRIMORDIAL_WORLD;
|
pCurDesc->data_index = PRIMORDIAL_WORLD;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 72L / 100;
|
pCurDesc->radius = EARTH_RADIUS * 72L / 100;
|
||||||
pCurDesc->NumPlanets = 0;
|
pCurDesc->NumPlanets = 2;
|
||||||
angle = NORMALIZE_ANGLE (FULL_CIRCLE - angle);
|
angle = NORMALIZE_ANGLE (FULL_CIRCLE - angle);
|
||||||
break;
|
break;
|
||||||
case 2: /* EARTH */
|
case 2: /* EARTH */
|
||||||
pCurDesc->data_index = WATER_WORLD | PLANET_SHIELDED;
|
pCurDesc->data_index = WATER_WORLD ; //| PLANET_SHIELDED;
|
||||||
pCurDesc->radius = EARTH_RADIUS;
|
pCurDesc->radius = EARTH_RADIUS;
|
||||||
pCurDesc->NumPlanets = 2;
|
pCurDesc->NumPlanets = 2;
|
||||||
break;
|
break;
|
||||||
case 3: /* MARS */
|
case 3: /* MARS */
|
||||||
pCurDesc->data_index = DUST_WORLD;
|
pCurDesc->data_index = DUST_WORLD;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 152L / 100;
|
pCurDesc->radius = EARTH_RADIUS * 152L / 100;
|
||||||
pCurDesc->NumPlanets = 0;
|
pCurDesc->NumPlanets = 3;
|
||||||
break;
|
break;
|
||||||
case 4: /* JUPITER */
|
case 4: /* CERES */
|
||||||
|
pCurDesc->data_index= PELLUCID_WORLD;
|
||||||
|
pCurDesc->radius= EARTH_RADIUS * 277L / 100;
|
||||||
|
pCurDesc->NumPlanets= 0;
|
||||||
|
break;
|
||||||
|
case 5: /* JUPITER */
|
||||||
pCurDesc->data_index = RED_GAS_GIANT;
|
pCurDesc->data_index = RED_GAS_GIANT;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 500L /* 520L */ / 100;
|
pCurDesc->radius = EARTH_RADIUS * 500L /* 520L */ / 100;
|
||||||
pCurDesc->NumPlanets = 4;
|
pCurDesc->NumPlanets = 4;
|
||||||
break;
|
break;
|
||||||
case 5: /* SATURN */
|
case 6: /* SATURN */
|
||||||
pCurDesc->data_index = ORA_GAS_GIANT;
|
pCurDesc->data_index = YEL_GAS_GIANT;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 750L /* 952L */ / 100;
|
pCurDesc->radius = EARTH_RADIUS * 750L /* 952L */ / 100;
|
||||||
pCurDesc->NumPlanets = 1;
|
pCurDesc->NumPlanets = 1;
|
||||||
break;
|
break;
|
||||||
case 6: /* URANUS */
|
case 7: /* URANUS */
|
||||||
pCurDesc->data_index = GRN_GAS_GIANT;
|
pCurDesc->data_index = CYA_GAS_GIANT;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 1000L /* 1916L */ / 100;
|
pCurDesc->radius = EARTH_RADIUS * 1000L /* 1916L */ / 100;
|
||||||
pCurDesc->NumPlanets = 0;
|
pCurDesc->NumPlanets = 0;
|
||||||
break;
|
break;
|
||||||
case 7: /* NEPTUNE */
|
case 8: /* NEPTUNE */
|
||||||
pCurDesc->data_index = BLU_GAS_GIANT;
|
pCurDesc->data_index = BLU_GAS_GIANT;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 1250L /* 2999L */ / 100;
|
pCurDesc->radius = EARTH_RADIUS * 1250L /* 2999L */ / 100;
|
||||||
pCurDesc->NumPlanets = 1;
|
pCurDesc->NumPlanets = 1;
|
||||||
break;
|
break;
|
||||||
case 8: /* PLUTO */
|
case 9: /* PLUTO */
|
||||||
pCurDesc->data_index = PELLUCID_WORLD;
|
pCurDesc->data_index = PELLUCID_WORLD;
|
||||||
pCurDesc->radius = EARTH_RADIUS * 1550L /* 3937L */ / 100;
|
pCurDesc->radius = EARTH_RADIUS * 1550L /* 3937L */ / 100;
|
||||||
pCurDesc->NumPlanets = 0;
|
pCurDesc->NumPlanets = 1; // Charon
|
||||||
angle = FULL_CIRCLE - OCTANT;
|
angle = FULL_CIRCLE - OCTANT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -194,6 +214,34 @@ GenerateSol_generateMoons (SOLARSYS_STATE *solarSys, PLANET_DESC *planet)
|
|||||||
planetNr = planetIndex (solarSys, planet);
|
planetNr = planetIndex (solarSys, planet);
|
||||||
switch (planetNr)
|
switch (planetNr)
|
||||||
{
|
{
|
||||||
|
case 1: /* "moons" of VENUS */
|
||||||
|
{
|
||||||
|
COUNT angle;
|
||||||
|
|
||||||
|
// Phobos
|
||||||
|
angle = QUADRANT;
|
||||||
|
solarSys->MoonDesc[ 0 ].data_index= TELLURIC_WORLD;
|
||||||
|
solarSys->MoonDesc[ 0 ].radius= MIN_MOON_RADIUS;
|
||||||
|
|
||||||
|
solarSys->MoonDesc[ 0 ].location.x =
|
||||||
|
COSINE (angle, solarSys->MoonDesc[ 0 ].radius);
|
||||||
|
solarSys->MoonDesc[ 0 ].location.y =
|
||||||
|
SINE (angle, solarSys->MoonDesc[ 0 ].radius);
|
||||||
|
|
||||||
|
// Deimos
|
||||||
|
#if 1
|
||||||
|
angle = HALF_CIRCLE;
|
||||||
|
solarSys->MoonDesc[ 1 ].data_index= WATER_WORLD;
|
||||||
|
solarSys->MoonDesc[ 1 ].radius= MIN_MOON_RADIUS + MOON_DELTA * .5;
|
||||||
|
|
||||||
|
solarSys->MoonDesc[ 1 ].location.x =
|
||||||
|
COSINE (angle, solarSys->MoonDesc[ 1 ].radius);
|
||||||
|
solarSys->MoonDesc[ 1 ].location.y =
|
||||||
|
SINE (angle, solarSys->MoonDesc[ 1 ].radius);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 2: /* moons of EARTH */
|
case 2: /* moons of EARTH */
|
||||||
{
|
{
|
||||||
COUNT angle;
|
COUNT angle;
|
||||||
@@ -219,7 +267,47 @@ GenerateSol_generateMoons (SOLARSYS_STATE *solarSys, PLANET_DESC *planet)
|
|||||||
SINE (angle, solarSys->MoonDesc[1].radius);
|
SINE (angle, solarSys->MoonDesc[1].radius);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4: /* moons of JUPITER */
|
case 3: /* moons of MARS and Mars station */
|
||||||
|
{
|
||||||
|
COUNT angle;
|
||||||
|
|
||||||
|
// Phobos
|
||||||
|
angle = QUADRANT;
|
||||||
|
solarSys->MoonDesc[ 0 ].data_index= SELENIC_WORLD;
|
||||||
|
solarSys->MoonDesc[ 0 ].radius= MIN_MOON_RADIUS * .6667;
|
||||||
|
|
||||||
|
solarSys->MoonDesc[ 0 ].location.x =
|
||||||
|
COSINE (angle, solarSys->MoonDesc[ 0 ].radius);
|
||||||
|
solarSys->MoonDesc[ 0 ].location.y =
|
||||||
|
SINE (angle, solarSys->MoonDesc[ 0 ].radius);
|
||||||
|
|
||||||
|
// Deimos
|
||||||
|
#if 1
|
||||||
|
angle = OCTANT + ( OCTANT / 2 );
|
||||||
|
solarSys->MoonDesc[ 1 ].data_index= SELENIC_WORLD;
|
||||||
|
solarSys->MoonDesc[ 1 ].radius= MIN_MOON_RADIUS * .6667 + MOON_DELTA * .40;
|
||||||
|
|
||||||
|
solarSys->MoonDesc[ 1 ].location.x =
|
||||||
|
COSINE (angle, solarSys->MoonDesc[ 1 ].radius);
|
||||||
|
solarSys->MoonDesc[ 1 ].location.y =
|
||||||
|
SINE (angle, solarSys->MoonDesc[ 1 ].radius);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// Base
|
||||||
|
angle = 0;
|
||||||
|
solarSys->MoonDesc[ 2 ].data_index = HIERARCHY_STARBASE;
|
||||||
|
solarSys->MoonDesc[ 2 ].radius = MIN_MOON_RADIUS + ( MAX_MOONS - 1 ) * MOON_DELTA;
|
||||||
|
|
||||||
|
|
||||||
|
solarSys->MoonDesc[ 2 ].location.x =
|
||||||
|
COSINE (angle, solarSys->MoonDesc[ 2 ].radius);
|
||||||
|
solarSys->MoonDesc[ 2 ].location.y =
|
||||||
|
SINE (angle, solarSys->MoonDesc[ 2 ].radius);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5: /* moons of JUPITER */
|
||||||
solarSys->MoonDesc[0].data_index = RADIOACTIVE_WORLD;
|
solarSys->MoonDesc[0].data_index = RADIOACTIVE_WORLD;
|
||||||
/* Io */
|
/* Io */
|
||||||
solarSys->MoonDesc[1].data_index = HALIDE_WORLD;
|
solarSys->MoonDesc[1].data_index = HALIDE_WORLD;
|
||||||
@@ -229,14 +317,19 @@ GenerateSol_generateMoons (SOLARSYS_STATE *solarSys, PLANET_DESC *planet)
|
|||||||
solarSys->MoonDesc[3].data_index = PELLUCID_WORLD;
|
solarSys->MoonDesc[3].data_index = PELLUCID_WORLD;
|
||||||
/* Callisto */
|
/* Callisto */
|
||||||
break;
|
break;
|
||||||
case 5: /* moons of SATURN */
|
case 6: /* moons of SATURN */
|
||||||
solarSys->MoonDesc[0].data_index = ALKALI_WORLD;
|
solarSys->MoonDesc[0].data_index = ALKALI_WORLD;
|
||||||
/* Titan */
|
/* Titan */
|
||||||
break;
|
break;
|
||||||
case 7: /* moons of NEPTUNE */
|
case 8: /* moons of NEPTUNE */
|
||||||
solarSys->MoonDesc[0].data_index = VINYLOGOUS_WORLD;
|
solarSys->MoonDesc[0].data_index = VINYLOGOUS_WORLD;
|
||||||
/* Triton */
|
/* Triton */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 9: /* moons of PLUTO */
|
||||||
|
solarSys->MoonDesc[ 0 ].data_index= PELLUCID_WORLD;
|
||||||
|
/* Charon */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -246,9 +339,37 @@ static bool
|
|||||||
GenerateSol_generateName (const SOLARSYS_STATE *solarSys,
|
GenerateSol_generateName (const SOLARSYS_STATE *solarSys,
|
||||||
const PLANET_DESC *world)
|
const PLANET_DESC *world)
|
||||||
{
|
{
|
||||||
|
|
||||||
COUNT planetNr = planetIndex (solarSys, world);
|
COUNT planetNr = planetIndex (solarSys, world);
|
||||||
utf8StringCopy (GLOBAL_SIS (PlanetName), sizeof (GLOBAL_SIS (PlanetName)),
|
fprintf( stderr, "ADAM: in `generateName` (planetNr = %d)\n", planetNr );
|
||||||
GAME_STRING (PLANET_NUMBER_BASE + planetNr));
|
|
||||||
|
if( matchWorld( solarSys, world, 3, 0 ) )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "ADAM: Trying to set Phobos\n" );
|
||||||
|
utf8StringCopy( GLOBAL_SIS( PlanetName ), sizeof( GLOBAL_SIS( PlanetName ) ),
|
||||||
|
"Phobos" );
|
||||||
|
}
|
||||||
|
else if( matchWorld( solarSys, world, 3, 1 ) )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "ADAM: Trying to set Deimos\n" );
|
||||||
|
utf8StringCopy( GLOBAL_SIS( PlanetName ), sizeof( GLOBAL_SIS( PlanetName ) ),
|
||||||
|
"Deimos" );
|
||||||
|
}
|
||||||
|
else if( matchWorld( solarSys, world, 4, MATCH_PLANET ) )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "ADAM: Trying to set Ceres\n" );
|
||||||
|
utf8StringCopy( GLOBAL_SIS( PlanetName ), sizeof( GLOBAL_SIS( PlanetName ) ),
|
||||||
|
"Ceres" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf( stderr, "ADAM: Trying to set from default to: %s\n", GAME_STRING( PLANET_NUMBER_BASE + planetNr ) );
|
||||||
|
COUNT xPlanetNr= planetNr;
|
||||||
|
if( xPlanetNr > 4 ) xPlanetNr-= 1;
|
||||||
|
utf8StringCopy (GLOBAL_SIS (PlanetName), sizeof (GLOBAL_SIS (PlanetName)),
|
||||||
|
GAME_STRING (PLANET_NUMBER_BASE + xPlanetNr));
|
||||||
|
}
|
||||||
|
|
||||||
SET_GAME_STATE (BATTLE_PLANET, solarSys->PlanetDesc[planetNr].data_index);
|
SET_GAME_STATE (BATTLE_PLANET, solarSys->PlanetDesc[planetNr].data_index);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -262,9 +383,37 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
|
|
||||||
if (matchWorld (solarSys, world, 2, 0))
|
if (matchWorld (solarSys, world, 2, 0))
|
||||||
{
|
{
|
||||||
|
// Earth base...
|
||||||
return PrepareToVisitStarBase();
|
return PrepareToVisitStarBase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (matchWorld (solarSys, world, 3, 2))
|
||||||
|
{
|
||||||
|
// Mars base...
|
||||||
|
return PrepareToVisitStarBase();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matchWorld (solarSys, world, 2, MATCH_PLANET))
|
||||||
|
{
|
||||||
|
//NotifyOthers (ILWRATH_SHIP, IPNL_ALL_CLEAR);
|
||||||
|
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||||
|
ReinitQueue (&GLOBAL (ip_group_q));
|
||||||
|
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
|
||||||
|
|
||||||
|
CloneShipFragment (ANDROSYNTH_ID,
|
||||||
|
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
|
||||||
|
|
||||||
|
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||||
|
InitCommunication( SUPOX_CONVERSATION );
|
||||||
|
|
||||||
|
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
|
||||||
|
{
|
||||||
|
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
|
||||||
|
ReinitQueue (&GLOBAL (npc_built_ship_q));
|
||||||
|
GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DoPlanetaryAnalysis (&solarSys->SysInfo, world);
|
DoPlanetaryAnalysis (&solarSys->SysInfo, world);
|
||||||
rand_val = RandomContext_GetSeed (SysGenRNG);
|
rand_val = RandomContext_GetSeed (SysGenRNG);
|
||||||
|
|
||||||
@@ -320,7 +469,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.RotationPeriod = 246;
|
solarSys->SysInfo.PlanetInfo.RotationPeriod = 246;
|
||||||
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -53;
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -53;
|
||||||
break;
|
break;
|
||||||
case 4: /* JUPITER */
|
case 5: /* JUPITER */
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
||||||
GAS_GIANT_ATMOSPHERE;
|
GAS_GIANT_ATMOSPHERE;
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetDensity = 24;
|
solarSys->SysInfo.PlanetInfo.PlanetDensity = 24;
|
||||||
@@ -333,7 +482,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 520L / 100;
|
EARTH_RADIUS * 520L / 100;
|
||||||
break;
|
break;
|
||||||
case 5: /* SATURN */
|
case 6: /* SATURN */
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
||||||
GAS_GIANT_ATMOSPHERE;
|
GAS_GIANT_ATMOSPHERE;
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetDensity = 13;
|
solarSys->SysInfo.PlanetInfo.PlanetDensity = 13;
|
||||||
@@ -346,7 +495,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 952L / 100;
|
EARTH_RADIUS * 952L / 100;
|
||||||
break;
|
break;
|
||||||
case 6: /* URANUS */
|
case 7: /* URANUS */
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
||||||
GAS_GIANT_ATMOSPHERE;
|
GAS_GIANT_ATMOSPHERE;
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetDensity = 21;
|
solarSys->SysInfo.PlanetInfo.PlanetDensity = 21;
|
||||||
@@ -359,7 +508,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 1916L / 100;
|
EARTH_RADIUS * 1916L / 100;
|
||||||
break;
|
break;
|
||||||
case 7: /* NEPTUNE */
|
case 8: /* NEPTUNE */
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
solarSys->SysInfo.PlanetInfo.AtmoDensity =
|
||||||
GAS_GIANT_ATMOSPHERE;
|
GAS_GIANT_ATMOSPHERE;
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetDensity = 28;
|
solarSys->SysInfo.PlanetInfo.PlanetDensity = 28;
|
||||||
@@ -372,7 +521,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 2999L / 100;
|
EARTH_RADIUS * 2999L / 100;
|
||||||
break;
|
break;
|
||||||
case 8: /* PLUTO */
|
case 9: /* PLUTO */
|
||||||
if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI))
|
if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI))
|
||||||
{
|
{
|
||||||
LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
|
LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
|
||||||
@@ -439,7 +588,32 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -18;
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -18;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: /* moons of JUPITER */
|
case 3: /* moons of MARS */
|
||||||
|
{
|
||||||
|
switch( moonNr )
|
||||||
|
{
|
||||||
|
case 0: // Phobos
|
||||||
|
solarSys->SysInfo.PlanetInfo.PlanetDensity= DENSITY( 1.861 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.PlanetRadius= RADIUS( .022 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.Tectonics= 0;
|
||||||
|
solarSys->SysInfo.PlanetInfo.RotationPeriod= 390;
|
||||||
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature= KELVIN( 233 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.AtmoDensity = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // Deimos
|
||||||
|
solarSys->SysInfo.PlanetInfo.PlanetDensity= DENSITY( 1.465 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.PlanetRadius= RADIUS( .006 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.Tectonics= 0;
|
||||||
|
solarSys->SysInfo.PlanetInfo.RotationPeriod= 390;
|
||||||
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature= KELVIN( 233 );
|
||||||
|
solarSys->SysInfo.PlanetInfo.AtmoDensity = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 5: /* moons of JUPITER */
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 520L / 100;
|
EARTH_RADIUS * 520L / 100;
|
||||||
switch (moonNr)
|
switch (moonNr)
|
||||||
@@ -475,7 +649,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5: /* moon of SATURN: Titan */
|
case 6: /* moon of SATURN: Titan */
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 952L / 100;
|
EARTH_RADIUS * 952L / 100;
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity = 160;
|
solarSys->SysInfo.PlanetInfo.AtmoDensity = 160;
|
||||||
@@ -487,7 +661,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -178;
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -178;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7: /* moon of NEPTUNE: Triton */
|
case 8: /* moon of NEPTUNE: Triton */
|
||||||
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
solarSys->SysInfo.PlanetInfo.PlanetToSunDist =
|
||||||
EARTH_RADIUS * 2999L / 100;
|
EARTH_RADIUS * 2999L / 100;
|
||||||
solarSys->SysInfo.PlanetInfo.AtmoDensity = 10;
|
solarSys->SysInfo.PlanetInfo.AtmoDensity = 10;
|
||||||
@@ -498,6 +672,9 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
|||||||
solarSys->SysInfo.PlanetInfo.RotationPeriod = 4300;
|
solarSys->SysInfo.PlanetInfo.RotationPeriod = 4300;
|
||||||
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -216;
|
solarSys->SysInfo.PlanetInfo.SurfaceTemperature = -216;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 9: /* moon of PLUTO: Charon */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
solarSys->SysInfo.PlanetInfo.SurfaceGravity =
|
solarSys->SysInfo.PlanetInfo.SurfaceGravity =
|
||||||
@@ -512,7 +689,7 @@ static COUNT
|
|||||||
GenerateSol_generateEnergy (const SOLARSYS_STATE *solarSys,
|
GenerateSol_generateEnergy (const SOLARSYS_STATE *solarSys,
|
||||||
const PLANET_DESC *world, COUNT whichNode, NODE_INFO *info)
|
const PLANET_DESC *world, COUNT whichNode, NODE_INFO *info)
|
||||||
{
|
{
|
||||||
if (matchWorld (solarSys, world, 8, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 9, MATCH_PLANET))
|
||||||
{
|
{
|
||||||
/* Pluto */
|
/* Pluto */
|
||||||
// This check is needed because the retrieval bit is not set for
|
// This check is needed because the retrieval bit is not set for
|
||||||
@@ -530,7 +707,7 @@ GenerateSol_generateEnergy (const SOLARSYS_STATE *solarSys,
|
|||||||
|
|
||||||
return 1; // only matters when count is requested
|
return 1; // only matters when count is requested
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchWorld (solarSys, world, 2, 1))
|
if (matchWorld (solarSys, world, 2, 1))
|
||||||
{
|
{
|
||||||
/* Earth Moon */
|
/* Earth Moon */
|
||||||
@@ -558,7 +735,7 @@ static bool
|
|||||||
GenerateSol_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
GenerateSol_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
|
||||||
COUNT whichNode)
|
COUNT whichNode)
|
||||||
{
|
{
|
||||||
if (matchWorld (solarSys, world, 8, MATCH_PLANET))
|
if (matchWorld (solarSys, world, 9, MATCH_PLANET))
|
||||||
{ // Pluto
|
{ // Pluto
|
||||||
assert (!GET_GAME_STATE (FOUND_PLUTO_SPATHI) && whichNode == 0);
|
assert (!GET_GAME_STATE (FOUND_PLUTO_SPATHI) && whichNode == 0);
|
||||||
|
|
||||||
|
|||||||
@@ -1760,11 +1760,19 @@ GetNamedPlanetaryBody (void)
|
|||||||
|
|
||||||
planet = planetIndex (pSolarSysState, pSolarSysState->pOrbitalDesc);
|
planet = planetIndex (pSolarSysState, pSolarSysState->pOrbitalDesc);
|
||||||
|
|
||||||
|
if (worldIsPlanet (pSolarSysState, pSolarSysState->pOrbitalDesc)
|
||||||
|
&& planet == 4 )
|
||||||
|
{
|
||||||
|
return "Ceres";
|
||||||
|
}
|
||||||
|
if( planet > 4 ) planet-= 1;
|
||||||
|
|
||||||
if (worldIsPlanet (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
if (worldIsPlanet (pSolarSysState, pSolarSysState->pOrbitalDesc))
|
||||||
{ // A planet
|
{ // A planet
|
||||||
return GAME_STRING (PLANET_NUMBER_BASE + planet);
|
return GAME_STRING (PLANET_NUMBER_BASE + planet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Moons
|
// Moons
|
||||||
moon = moonIndex (pSolarSysState, pSolarSysState->pOrbitalDesc);
|
moon = moonIndex (pSolarSysState, pSolarSysState->pOrbitalDesc);
|
||||||
switch (planet)
|
switch (planet)
|
||||||
@@ -1778,6 +1786,13 @@ GetNamedPlanetaryBody (void)
|
|||||||
return GAME_STRING (PLANET_NUMBER_BASE + 9);
|
return GAME_STRING (PLANET_NUMBER_BASE + 9);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 3: // Mars
|
||||||
|
switch( moon )
|
||||||
|
{
|
||||||
|
case 0: return "Phobos";
|
||||||
|
case 1: return "Deimos";
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 4: // Jupiter
|
case 4: // Jupiter
|
||||||
switch (moon)
|
switch (moon)
|
||||||
{
|
{
|
||||||
@@ -1799,6 +1814,11 @@ GetNamedPlanetaryBody (void)
|
|||||||
if (moon == 0) // Triton
|
if (moon == 0) // Triton
|
||||||
return GAME_STRING (PLANET_NUMBER_BASE + 15);
|
return GAME_STRING (PLANET_NUMBER_BASE + 15);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 8: // Pluto
|
||||||
|
if( moon == 0 ) // Charon
|
||||||
|
return "Charon";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CurStarDescPtr->Index == SPATHI_DEFINED)
|
else if (CurStarDescPtr->Index == SPATHI_DEFINED)
|
||||||
|
|||||||
Reference in New Issue
Block a user