Some comments, cleanups.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2496 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-11-11 18:19:25 +00:00
parent eadd6cfcca
commit 2101e59604
+45 -34
View File
@@ -37,23 +37,18 @@ init_probe (void)
if (!GET_GAME_STATE (PROBE_MESSAGE_DELIVERED) if (!GET_GAME_STATE (PROBE_MESSAGE_DELIVERED)
&& GetGroupInfo (GLOBAL (BattleGroupRef), GROUP_INIT_IP) && GetGroupInfo (GLOBAL (BattleGroupRef), GROUP_INIT_IP)
&& (hStarShip = GetHeadLink ( && (hStarShip = GetHeadLink (&GLOBAL (npc_built_ship_q))))
&GLOBAL (npc_built_ship_q)
)))
{ {
SHIP_FRAGMENTPTR FragPtr; SHIP_FRAGMENTPTR FragPtr;
FragPtr = (SHIP_FRAGMENTPTR)LockStarShip ( FragPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (npc_built_ship_q), hStarShip &GLOBAL (npc_built_ship_q), hStarShip);
);
SET_GROUP_MISSION (FragPtr, IN_ORBIT); SET_GROUP_MISSION (FragPtr, IN_ORBIT);
SET_GROUP_LOC (FragPtr, 2 + 1); /* orbitting earth */ SET_GROUP_LOC (FragPtr, 2 + 1); /* orbitting earth */
SET_GROUP_DEST (FragPtr, 2 + 1); /* orbitting earth */ SET_GROUP_DEST (FragPtr, 2 + 1); /* orbitting earth */
FragPtr->ShipInfo.loc.x = FragPtr->ShipInfo.loc.y = 0; FragPtr->ShipInfo.loc.x = FragPtr->ShipInfo.loc.y = 0;
FragPtr->ShipInfo.group_counter = 0; FragPtr->ShipInfo.group_counter = 0;
UnlockStarShip ( UnlockStarShip (&GLOBAL (npc_built_ship_q), hStarShip);
&GLOBAL (npc_built_ship_q), hStarShip
);
return 1; return 1;
} }
@@ -204,7 +199,8 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = 457; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = 457;
break; break;
case 2: /* EARTH */ case 2: /* EARTH */
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = EARTH_ATMOSPHERE; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity =
EARTH_ATMOSPHERE;
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 100; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 100;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 100; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 100;
pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 23; pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 23;
@@ -225,7 +221,8 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -53; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -53;
break; break;
case 4: /* JUPITER */ case 4: /* JUPITER */
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = GAS_GIANT_ATMOSPHERE; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity =
GAS_GIANT_ATMOSPHERE;
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 24; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 24;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 1120; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 1120;
pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 3; pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 3;
@@ -233,10 +230,12 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 98; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 98;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -143; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -143;
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 520L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 520L / 100;
break; break;
case 5: /* SATURN */ case 5: /* SATURN */
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = GAS_GIANT_ATMOSPHERE; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity =
GAS_GIANT_ATMOSPHERE;
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 13; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 13;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 945; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 945;
pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 27; pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 27;
@@ -244,10 +243,12 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 102; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 102;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -197; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -197;
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 952L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 952L / 100;
break; break;
case 6: /* URANUS */ case 6: /* URANUS */
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = GAS_GIANT_ATMOSPHERE; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity =
GAS_GIANT_ATMOSPHERE;
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 21; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 21;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 411; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 411;
pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 98; pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 98;
@@ -255,10 +256,12 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 172; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 172;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -217; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -217;
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 1916L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 1916L / 100;
break; break;
case 7: /* NEPTUNE */ case 7: /* NEPTUNE */
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = GAS_GIANT_ATMOSPHERE; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity =
GAS_GIANT_ATMOSPHERE;
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 28; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 28;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 396; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 396;
pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 30; pSolarSysState->SysInfo.PlanetInfo.AxialTilt = 30;
@@ -266,7 +269,8 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 182; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 182;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -229; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -229;
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 2999L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 2999L / 100;
break; break;
case 8: /* PLUTO */ case 8: /* PLUTO */
if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI)) if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI))
@@ -274,12 +278,10 @@ generate_orbital (void)
LoadStdLanderFont (&pSolarSysState->SysInfo.PlanetInfo); LoadStdLanderFont (&pSolarSysState->SysInfo.PlanetInfo);
pSolarSysState->PlanetSideFrame[1] = pSolarSysState->PlanetSideFrame[1] =
CaptureDrawable ( CaptureDrawable (
LoadGraphic (SPAPLUTO_MASK_PMAP_ANIM) LoadGraphic (SPAPLUTO_MASK_PMAP_ANIM));
);
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = pSolarSysState->SysInfo.PlanetInfo.DiscoveryString =
CaptureStringTable ( CaptureStringTable (
LoadStringTable (SPAPLUTO_STRTAB) LoadStringTable (SPAPLUTO_STRTAB));
);
} }
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 0; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 0;
@@ -290,7 +292,8 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 1533; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 1533;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -235; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -235;
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 3937L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 3937L / 100;
break; break;
} }
@@ -310,19 +313,18 @@ generate_orbital (void)
switch (i) switch (i)
{ {
case 2: /* moons of EARTH */ case 2: /* moons of EARTH */
pSolarSysState->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN] = rand_val; pSolarSysState->SysInfo.PlanetInfo.ScanSeed[BIOLOGICAL_SCAN] =
rand_val;
if (!GET_GAME_STATE (MOONBASE_DESTROYED)) if (!GET_GAME_STATE (MOONBASE_DESTROYED))
{ {
LoadStdLanderFont (&pSolarSysState->SysInfo.PlanetInfo); LoadStdLanderFont (&pSolarSysState->SysInfo.PlanetInfo);
pSolarSysState->PlanetSideFrame[1] = pSolarSysState->PlanetSideFrame[1] =
CaptureDrawable ( CaptureDrawable (
LoadGraphic (MOONBASE_MASK_PMAP_ANIM) LoadGraphic (MOONBASE_MASK_PMAP_ANIM));
);
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = pSolarSysState->SysInfo.PlanetInfo.DiscoveryString =
CaptureStringTable ( CaptureStringTable (
LoadStringTable (MOONBASE_STRTAB) LoadStringTable (MOONBASE_STRTAB));
);
} }
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 60; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 60;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25;
@@ -332,31 +334,32 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -18; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -18;
break; break;
case 4: /* moons of JUPITER */ case 4: /* moons of JUPITER */
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 520L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist =
EARTH_RADIUS * 520L / 100;
switch (pSolarSysState->pOrbitalDesc - pSolarSysState->MoonDesc) switch (pSolarSysState->pOrbitalDesc - pSolarSysState->MoonDesc)
{ {
case 0: case 0: /* Io */
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 69; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 69;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25;
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 3; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 3;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 390; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 390;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -163; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -163;
break; break;
case 1: case 1: /* Europa */
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 54; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 54;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 25;
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 1; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 1;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 840; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 840;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -161; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -161;
break; break;
case 2: case 2: /* Ganymede */
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 35; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 35;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 41; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 41;
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 0;
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 1728; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 1728;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -164; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -164;
break; break;
case 3: case 3: /* Callisto */
pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 35; pSolarSysState->SysInfo.PlanetInfo.PlanetDensity = 35;
pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 38; pSolarSysState->SysInfo.PlanetInfo.PlanetRadius = 38;
pSolarSysState->SysInfo.PlanetInfo.Tectonics = 1; pSolarSysState->SysInfo.PlanetInfo.Tectonics = 1;
@@ -365,7 +368,7 @@ generate_orbital (void)
break; break;
} }
break; break;
case 5: /* moons of SATURN */ case 5: /* moon of SATURN: Titan */
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 952L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 952L / 100;
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 160; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 160;
pSolarSysState->SysInfo.PlanetInfo.Weather = 2; pSolarSysState->SysInfo.PlanetInfo.Weather = 2;
@@ -375,7 +378,7 @@ generate_orbital (void)
pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 3816; pSolarSysState->SysInfo.PlanetInfo.RotationPeriod = 3816;
pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -178; pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature = -178;
break; break;
case 7: /* moons of NEPTUNE */ case 7: /* moon of NEPTUNE: Triton */
pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 2999L / 100; pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist = EARTH_RADIUS * 2999L / 100;
pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 10; pSolarSysState->SysInfo.PlanetInfo.AtmoDensity = 10;
pSolarSysState->SysInfo.PlanetInfo.Weather = 1; pSolarSysState->SysInfo.PlanetInfo.Weather = 1;
@@ -455,6 +458,7 @@ GenerateSOL (BYTE control)
{ {
COUNT angle; COUNT angle;
/* Starbase: */
pSolarSysState->MoonDesc[0].data_index = (BYTE)~0; pSolarSysState->MoonDesc[0].data_index = (BYTE)~0;
pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS; pSolarSysState->MoonDesc[0].radius = MIN_MOON_RADIUS;
angle = HALF_CIRCLE + QUADRANT; angle = HALF_CIRCLE + QUADRANT;
@@ -463,6 +467,7 @@ GenerateSOL (BYTE control)
pSolarSysState->MoonDesc[0].location.y = pSolarSysState->MoonDesc[0].location.y =
SINE (angle, pSolarSysState->MoonDesc[0].radius); SINE (angle, pSolarSysState->MoonDesc[0].radius);
/* Luna: */
pSolarSysState->MoonDesc[1].data_index = SELENIC_WORLD; pSolarSysState->MoonDesc[1].data_index = SELENIC_WORLD;
pSolarSysState->MoonDesc[1].radius = MIN_MOON_RADIUS pSolarSysState->MoonDesc[1].radius = MIN_MOON_RADIUS
+ (MAX_MOONS - 1) * MOON_DELTA; + (MAX_MOONS - 1) * MOON_DELTA;
@@ -476,15 +481,21 @@ GenerateSOL (BYTE control)
} }
case 4: /* moons of JUPITER */ case 4: /* moons of JUPITER */
pSolarSysState->MoonDesc[0].data_index = RADIOACTIVE_WORLD; pSolarSysState->MoonDesc[0].data_index = RADIOACTIVE_WORLD;
/* Io */
pSolarSysState->MoonDesc[1].data_index = HALIDE_WORLD; pSolarSysState->MoonDesc[1].data_index = HALIDE_WORLD;
/* Europa */
pSolarSysState->MoonDesc[2].data_index = CYANIC_WORLD; pSolarSysState->MoonDesc[2].data_index = CYANIC_WORLD;
/* Ganymede */
pSolarSysState->MoonDesc[3].data_index = PELLUCID_WORLD; pSolarSysState->MoonDesc[3].data_index = PELLUCID_WORLD;
/* Callisto */
break; break;
case 5: /* moons of SATURN */ case 5: /* moons of SATURN */
pSolarSysState->MoonDesc[0].data_index = ALKALI_WORLD; pSolarSysState->MoonDesc[0].data_index = ALKALI_WORLD;
/* Titan */
break; break;
case 7: /* moons of NEPTUNE */ case 7: /* moons of NEPTUNE */
pSolarSysState->MoonDesc[0].data_index = VINYLOGOUS_WORLD; pSolarSysState->MoonDesc[0].data_index = VINYLOGOUS_WORLD;
/* Triton */
break; break;
} }
break; break;