Some cleanups. Room for many more.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1860 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+259
-256
@@ -570,296 +570,299 @@ CheckObjectCollision (COUNT index)
|
|||||||
for (; index != END_OF_LIST; index = GetPredLink (GetPrimLinks (pPrim)))
|
for (; index != END_OF_LIST; index = GetPredLink (GetPrimLinks (pPrim)))
|
||||||
{
|
{
|
||||||
INTERSECT_CONTROL ElementControl;
|
INTERSECT_CONTROL ElementControl;
|
||||||
|
HELEMENT hElement, hNextElement;
|
||||||
|
|
||||||
pPrim = &DisplayArray[index];
|
pPrim = &DisplayArray[index];
|
||||||
ElementControl.IntersectStamp = pPrim->Object.Stamp;
|
ElementControl.IntersectStamp = pPrim->Object.Stamp;
|
||||||
ElementControl.EndPoint =
|
ElementControl.EndPoint = ElementControl.IntersectStamp.origin;
|
||||||
ElementControl.IntersectStamp.origin;
|
|
||||||
|
|
||||||
if (GetFrameHandle (
|
if (GetFrameHandle (ElementControl.IntersectStamp.frame)
|
||||||
ElementControl.IntersectStamp.frame
|
== LanderHandle)
|
||||||
) == LanderHandle)
|
|
||||||
CheckObjectCollision (index);
|
|
||||||
else if (DrawablesIntersect (&LanderControl,
|
|
||||||
&ElementControl, MAX_TIME_VALUE))
|
|
||||||
{
|
{
|
||||||
HELEMENT hElement, hNextElement;
|
CheckObjectCollision (index);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (hElement = GetHeadElement ();
|
if (!DrawablesIntersect (&LanderControl,
|
||||||
hElement; hElement = hNextElement)
|
&ElementControl, MAX_TIME_VALUE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (hElement = GetHeadElement (); hElement; hElement = hNextElement)
|
||||||
|
{
|
||||||
|
ELEMENTPTR ElementPtr;
|
||||||
|
|
||||||
|
LockElement (hElement, &ElementPtr);
|
||||||
|
hNextElement = GetSuccElement (ElementPtr);
|
||||||
|
|
||||||
|
if (&DisplayArray[ElementPtr->PrimIndex] == pLanderPrim)
|
||||||
{
|
{
|
||||||
ELEMENTPTR ElementPtr;
|
ElementPtr->state_flags |= DISAPPEARING;
|
||||||
|
UnlockElement (hElement);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (&DisplayArray[ElementPtr->PrimIndex] != pPrim
|
||||||
|
|| !(ElementPtr->state_flags & BAD_GUY))
|
||||||
|
{
|
||||||
|
UnlockElement (hElement);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
LockElement (hElement, &ElementPtr);
|
{
|
||||||
hNextElement = GetSuccElement (ElementPtr);
|
COUNT scan, NumRetrieved;
|
||||||
|
SIZE which_node;
|
||||||
|
|
||||||
if (&DisplayArray[ElementPtr->PrimIndex] == pLanderPrim)
|
scan = LOBYTE (ElementPtr->life_span);
|
||||||
|
if (pLanderPrim == 0)
|
||||||
{
|
{
|
||||||
ElementPtr->state_flags |= DISAPPEARING;
|
if (HIBYTE (pMenuState->delta_item) == 0
|
||||||
UnlockElement (hElement);
|
|| pPSD->InTransit)
|
||||||
|
break;
|
||||||
|
|
||||||
continue;
|
if (ElementPtr->state_flags & FINITE_LIFE)
|
||||||
}
|
|
||||||
else if (&DisplayArray[ElementPtr->PrimIndex] == pPrim
|
|
||||||
&& (ElementPtr->state_flags & BAD_GUY))
|
|
||||||
{
|
|
||||||
COUNT scan, NumRetrieved;
|
|
||||||
SIZE which_node;
|
|
||||||
|
|
||||||
scan = LOBYTE (ElementPtr->life_span);
|
|
||||||
if (pLanderPrim == 0)
|
|
||||||
{
|
{
|
||||||
if (HIBYTE (pMenuState->delta_item) == 0
|
/* A natural disaster */
|
||||||
|| pPSD->InTransit)
|
scan = ElementPtr->mass_points;
|
||||||
break;
|
switch (scan)
|
||||||
|
|
||||||
/* if a natural disaster */
|
|
||||||
if (ElementPtr->state_flags & FINITE_LIFE)
|
|
||||||
{
|
{
|
||||||
scan = ElementPtr->mass_points;
|
case EARTHQUAKE_DISASTER:
|
||||||
switch (scan)
|
case LAVASPOT_DISASTER:
|
||||||
{
|
if ((BYTE)TFB_Random () < (256 >> 2))
|
||||||
case EARTHQUAKE_DISASTER:
|
DeltaLanderCrew (-1, scan);
|
||||||
case LAVASPOT_DISASTER:
|
break;
|
||||||
if ((BYTE)TFB_Random () < (256 >> 2))
|
|
||||||
DeltaLanderCrew (-1, scan);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
UnlockElement (hElement);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (scan == ENERGY_SCAN)
|
|
||||||
{
|
|
||||||
if (ElementPtr->mass_points == 1)
|
|
||||||
{
|
|
||||||
DWORD TimeIn;
|
|
||||||
|
|
||||||
/* ran into Spathi on Pluto */
|
|
||||||
TimeIn = GetTimeCounter ();
|
|
||||||
which_node = 8;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
DeltaLanderCrew (-1, LANDER_INJURED);
|
|
||||||
SleepThreadUntil (TimeIn + ONE_SECOND / 20);
|
|
||||||
TimeIn = GetTimeCounter();
|
|
||||||
} while (HIBYTE (pMenuState->delta_item) && --which_node);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HIBYTE (pMenuState->delta_item)
|
|
||||||
&& pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
|
||||||
&& CurStarDescPtr->Index != ANDROSYNTH_DEFINED)
|
|
||||||
{
|
|
||||||
UnbatchGraphics ();
|
|
||||||
DoDiscoveryReport (MenuSounds);
|
|
||||||
BatchGraphics ();
|
|
||||||
}
|
|
||||||
if (ElementPtr->mass_points == 0)
|
|
||||||
{
|
|
||||||
DestroyStringTable (ReleaseStringTable (
|
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
|
||||||
));
|
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0;
|
|
||||||
UnlockElement (hElement);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (scan == BIOLOGICAL_SCAN
|
|
||||||
&& ElementPtr->hit_points)
|
|
||||||
{
|
|
||||||
BYTE danger_vals[] =
|
|
||||||
{
|
|
||||||
0, 6, 13, 26
|
|
||||||
};
|
|
||||||
|
|
||||||
if (((COUNT)TFB_Random () & 127) < danger_vals[
|
|
||||||
(CreatureData[
|
|
||||||
ElementPtr->mass_points
|
|
||||||
& ~CREATURE_AWARE
|
|
||||||
].Attributes & DANGER_MASK)
|
|
||||||
>> DANGER_SHIFT
|
|
||||||
])
|
|
||||||
{
|
|
||||||
PlaySound (SetAbsSoundIndex (
|
|
||||||
LanderSounds, BIOLOGICAL_DISASTER
|
|
||||||
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
|
||||||
DeltaLanderCrew (-1, BIOLOGICAL_DISASTER);
|
|
||||||
}
|
|
||||||
UnlockElement (hElement);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NumRetrieved = ElementPtr->mass_points;
|
|
||||||
}
|
|
||||||
/* if a natural disaster */
|
|
||||||
else if (ElementPtr->state_flags & FINITE_LIFE)
|
|
||||||
{
|
|
||||||
UnlockElement (hElement);
|
UnlockElement (hElement);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else if (scan == ENERGY_SCAN)
|
||||||
{
|
{
|
||||||
BYTE value;
|
if (ElementPtr->mass_points == 1)
|
||||||
|
{
|
||||||
|
DWORD TimeIn;
|
||||||
|
|
||||||
if (scan == ENERGY_SCAN)
|
/* Ran into Spathi on Pluto */
|
||||||
{
|
TimeIn = GetTimeCounter ();
|
||||||
UnlockElement (hElement);
|
which_node = 8;
|
||||||
break;
|
do
|
||||||
}
|
|
||||||
else if (scan == BIOLOGICAL_SCAN
|
|
||||||
&& (value = LONIBBLE (CreatureData[
|
|
||||||
ElementPtr->mass_points
|
|
||||||
& ~CREATURE_AWARE
|
|
||||||
].ValueAndHitPoints)))
|
|
||||||
{
|
|
||||||
if (ElementPtr->hit_points)
|
|
||||||
{
|
{
|
||||||
if (--ElementPtr->hit_points == 0)
|
DeltaLanderCrew (-1, LANDER_INJURED);
|
||||||
{
|
SleepThreadUntil (TimeIn + ONE_SECOND / 20);
|
||||||
ElementPtr->mass_points = value;
|
TimeIn = GetTimeCounter();
|
||||||
DisplayArray[
|
} while (HIBYTE (pMenuState->delta_item) && --which_node);
|
||||||
ElementPtr->PrimIndex
|
|
||||||
].Object.Stamp.frame =
|
|
||||||
pSolarSysState->PlanetSideFrame[0];
|
|
||||||
}
|
|
||||||
else if (CreatureData[
|
|
||||||
ElementPtr->mass_points
|
|
||||||
& ~CREATURE_AWARE
|
|
||||||
].Attributes & SPEED_MASK)
|
|
||||||
{
|
|
||||||
COUNT angle;
|
|
||||||
|
|
||||||
angle = FACING_TO_ANGLE (GetFrameIndex (
|
|
||||||
LanderControl.IntersectStamp.frame
|
|
||||||
) - ANGLE_TO_FACING (FULL_CIRCLE));
|
|
||||||
DeltaVelocityComponents (
|
|
||||||
&ElementPtr->velocity,
|
|
||||||
COSINE (angle, WORLD_TO_VELOCITY (1)),
|
|
||||||
SINE (angle, WORLD_TO_VELOCITY (1))
|
|
||||||
);
|
|
||||||
ElementPtr->thrust_wait = 0;
|
|
||||||
ElementPtr->mass_points |= CREATURE_AWARE;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetPrimType (pPrim, STAMPFILL_PRIM);
|
|
||||||
SetPrimColor (pPrim, WHITE_COLOR);
|
|
||||||
|
|
||||||
PlaySound (SetAbsSoundIndex (
|
|
||||||
LanderSounds, LANDER_HITS), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
|
||||||
}
|
|
||||||
UnlockElement (hElement);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NumRetrieved = 0;
|
if (HIBYTE (pMenuState->delta_item)
|
||||||
}
|
&& pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
||||||
|
&& CurStarDescPtr->Index != ANDROSYNTH_DEFINED)
|
||||||
if (NumRetrieved)
|
|
||||||
{
|
|
||||||
switch (scan)
|
|
||||||
{
|
{
|
||||||
case ENERGY_SCAN:
|
UnbatchGraphics ();
|
||||||
break;
|
DoDiscoveryReport (MenuSounds);
|
||||||
case MINERAL_SCAN:
|
BatchGraphics ();
|
||||||
if (pPSD->ElementLevel < pPSD->MaxElementLevel)
|
}
|
||||||
{
|
if (ElementPtr->mass_points == 0)
|
||||||
if (pPSD->ElementLevel
|
{
|
||||||
+ NumRetrieved > pPSD->MaxElementLevel)
|
DestroyStringTable (ReleaseStringTable (
|
||||||
NumRetrieved = (COUNT)(pPSD->MaxElementLevel
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
||||||
- pPSD->ElementLevel);
|
));
|
||||||
FillLanderHold (pPSD, scan, NumRetrieved);
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0;
|
||||||
if (scan == MINERAL_SCAN)
|
UnlockElement (hElement);
|
||||||
{
|
continue;
|
||||||
BYTE EType;
|
|
||||||
UNICODE ch, *pStr;
|
|
||||||
|
|
||||||
EType = ElementPtr->turn_wait;
|
|
||||||
pPSD->ElementAmounts[
|
|
||||||
ElementCategory (EType)
|
|
||||||
] += NumRetrieved;
|
|
||||||
|
|
||||||
pPSD->NumFrames = NUM_TEXT_FRAMES;
|
|
||||||
wsprintf (pPSD->AmountBuf, "%u", NumRetrieved);
|
|
||||||
pStr = GAME_STRING (EType + ELEMENTS_STRING_BASE);
|
|
||||||
|
|
||||||
pPSD->MineralText[0].baseline.x =
|
|
||||||
(SURFACE_WIDTH >> 1)
|
|
||||||
+ (ElementControl.EndPoint.x
|
|
||||||
- LanderControl.EndPoint.x);
|
|
||||||
pPSD->MineralText[0].baseline.y =
|
|
||||||
(SURFACE_HEIGHT >> 1)
|
|
||||||
+ (ElementControl.EndPoint.y
|
|
||||||
- LanderControl.EndPoint.y);
|
|
||||||
pPSD->MineralText[0].CharCount = (COUNT)~0;
|
|
||||||
pPSD->MineralText[1].pStr = pStr;
|
|
||||||
while ((ch = *pStr++) && ch != ' ')
|
|
||||||
;
|
|
||||||
if (ch == '\0')
|
|
||||||
{
|
|
||||||
pPSD->MineralText[1].CharCount = (COUNT)~0;
|
|
||||||
pPSD->MineralText[2].CharCount = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pPSD->MineralText[1].CharCount =
|
|
||||||
(pStr - pPSD->MineralText[1].pStr) - 1;
|
|
||||||
pPSD->MineralText[2].pStr = pStr;
|
|
||||||
pPSD->MineralText[2].CharCount = (COUNT)~0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
PlaySound (SetAbsSoundIndex (
|
|
||||||
LanderSounds, LANDER_FULL
|
|
||||||
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
|
||||||
continue;
|
|
||||||
case BIOLOGICAL_SCAN:
|
|
||||||
if (pPSD->BiologicalLevel < MAX_SCROUNGED)
|
|
||||||
{
|
|
||||||
if (pPSD->BiologicalLevel
|
|
||||||
+ NumRetrieved > MAX_SCROUNGED)
|
|
||||||
NumRetrieved = (COUNT)(
|
|
||||||
MAX_SCROUNGED
|
|
||||||
- pPSD->BiologicalLevel
|
|
||||||
);
|
|
||||||
FillLanderHold (pPSD, scan, NumRetrieved);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
PlaySound (SetAbsSoundIndex (
|
|
||||||
LanderSounds, LANDER_FULL
|
|
||||||
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (scan == BIOLOGICAL_SCAN
|
||||||
which_node = HIBYTE (ElementPtr->life_span) - 1;
|
&& ElementPtr->hit_points)
|
||||||
pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] |=
|
|
||||||
(1L << which_node);
|
|
||||||
pSolarSysState->CurNode = (COUNT)~0;
|
|
||||||
(*pSolarSysState->GenFunc) ((BYTE)(scan + GENERATE_MINERAL));
|
|
||||||
|
|
||||||
if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] &
|
|
||||||
(1L << which_node)))
|
|
||||||
{
|
{
|
||||||
if (DestroyStringTable (ReleaseStringTable (
|
BYTE danger_vals[] =
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
{
|
||||||
)))
|
0, 6, 13, 26
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0;
|
};
|
||||||
}
|
int creatureIndex = ElementPtr->mass_points
|
||||||
else
|
& ~CREATURE_AWARE;
|
||||||
{
|
int dangerLevel =
|
||||||
if (NumRetrieved && scan == ENERGY_SCAN)
|
(CreatureData[creatureIndex].Attributes &
|
||||||
pPSD->InTransit = TRUE;
|
DANGER_MASK) >> DANGER_SHIFT;
|
||||||
|
|
||||||
SET_GAME_STATE (PLANETARY_CHANGE, 1);
|
if (((COUNT)TFB_Random () & 127) <
|
||||||
ElementPtr->state_flags |= DISAPPEARING;
|
danger_vals[dangerLevel])
|
||||||
|
{
|
||||||
|
PlaySound (SetAbsSoundIndex (
|
||||||
|
LanderSounds, BIOLOGICAL_DISASTER
|
||||||
|
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||||
|
DeltaLanderCrew (-1, BIOLOGICAL_DISASTER);
|
||||||
|
}
|
||||||
|
UnlockElement (hElement);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NumRetrieved = ElementPtr->mass_points;
|
||||||
|
}
|
||||||
|
/* if a natural disaster */
|
||||||
|
else if (ElementPtr->state_flags & FINITE_LIFE)
|
||||||
|
{
|
||||||
UnlockElement (hElement);
|
UnlockElement (hElement);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnlockElement (hElement);
|
BYTE value;
|
||||||
|
|
||||||
|
if (scan == ENERGY_SCAN)
|
||||||
|
{
|
||||||
|
UnlockElement (hElement);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (scan == BIOLOGICAL_SCAN
|
||||||
|
&& (value = LONIBBLE (CreatureData[
|
||||||
|
ElementPtr->mass_points
|
||||||
|
& ~CREATURE_AWARE
|
||||||
|
].ValueAndHitPoints)))
|
||||||
|
{
|
||||||
|
if (ElementPtr->hit_points)
|
||||||
|
{
|
||||||
|
if (--ElementPtr->hit_points == 0)
|
||||||
|
{
|
||||||
|
ElementPtr->mass_points = value;
|
||||||
|
DisplayArray[
|
||||||
|
ElementPtr->PrimIndex
|
||||||
|
].Object.Stamp.frame =
|
||||||
|
pSolarSysState->PlanetSideFrame[0];
|
||||||
|
}
|
||||||
|
else if (CreatureData[
|
||||||
|
ElementPtr->mass_points
|
||||||
|
& ~CREATURE_AWARE
|
||||||
|
].Attributes & SPEED_MASK)
|
||||||
|
{
|
||||||
|
COUNT angle;
|
||||||
|
|
||||||
|
angle = FACING_TO_ANGLE (GetFrameIndex (
|
||||||
|
LanderControl.IntersectStamp.frame
|
||||||
|
) - ANGLE_TO_FACING (FULL_CIRCLE));
|
||||||
|
DeltaVelocityComponents (
|
||||||
|
&ElementPtr->velocity,
|
||||||
|
COSINE (angle, WORLD_TO_VELOCITY (1)),
|
||||||
|
SINE (angle, WORLD_TO_VELOCITY (1))
|
||||||
|
);
|
||||||
|
ElementPtr->thrust_wait = 0;
|
||||||
|
ElementPtr->mass_points |= CREATURE_AWARE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetPrimType (pPrim, STAMPFILL_PRIM);
|
||||||
|
SetPrimColor (pPrim, WHITE_COLOR);
|
||||||
|
|
||||||
|
PlaySound (SetAbsSoundIndex (
|
||||||
|
LanderSounds, LANDER_HITS),
|
||||||
|
NotPositional (), NULL,
|
||||||
|
GAME_SOUND_PRIORITY);
|
||||||
|
}
|
||||||
|
UnlockElement (hElement);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
NumRetrieved = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NumRetrieved)
|
||||||
|
{
|
||||||
|
switch (scan)
|
||||||
|
{
|
||||||
|
case ENERGY_SCAN:
|
||||||
|
break;
|
||||||
|
case MINERAL_SCAN:
|
||||||
|
if (pPSD->ElementLevel < pPSD->MaxElementLevel)
|
||||||
|
{
|
||||||
|
if (pPSD->ElementLevel
|
||||||
|
+ NumRetrieved > pPSD->MaxElementLevel)
|
||||||
|
NumRetrieved = (COUNT)(pPSD->MaxElementLevel
|
||||||
|
- pPSD->ElementLevel);
|
||||||
|
FillLanderHold (pPSD, scan, NumRetrieved);
|
||||||
|
if (scan == MINERAL_SCAN)
|
||||||
|
{
|
||||||
|
BYTE EType;
|
||||||
|
UNICODE ch, *pStr;
|
||||||
|
|
||||||
|
EType = ElementPtr->turn_wait;
|
||||||
|
pPSD->ElementAmounts[
|
||||||
|
ElementCategory (EType)
|
||||||
|
] += NumRetrieved;
|
||||||
|
|
||||||
|
pPSD->NumFrames = NUM_TEXT_FRAMES;
|
||||||
|
wsprintf (pPSD->AmountBuf, "%u", NumRetrieved);
|
||||||
|
pStr = GAME_STRING (EType + ELEMENTS_STRING_BASE);
|
||||||
|
|
||||||
|
pPSD->MineralText[0].baseline.x =
|
||||||
|
(SURFACE_WIDTH >> 1)
|
||||||
|
+ (ElementControl.EndPoint.x
|
||||||
|
- LanderControl.EndPoint.x);
|
||||||
|
pPSD->MineralText[0].baseline.y =
|
||||||
|
(SURFACE_HEIGHT >> 1)
|
||||||
|
+ (ElementControl.EndPoint.y
|
||||||
|
- LanderControl.EndPoint.y);
|
||||||
|
pPSD->MineralText[0].CharCount = (COUNT)~0;
|
||||||
|
pPSD->MineralText[1].pStr = pStr;
|
||||||
|
while ((ch = *pStr++) && ch != ' ')
|
||||||
|
;
|
||||||
|
if (ch == '\0')
|
||||||
|
{
|
||||||
|
pPSD->MineralText[1].CharCount = (COUNT)~0;
|
||||||
|
pPSD->MineralText[2].CharCount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pPSD->MineralText[1].CharCount =
|
||||||
|
(pStr - pPSD->MineralText[1].pStr) - 1;
|
||||||
|
pPSD->MineralText[2].pStr = pStr;
|
||||||
|
pPSD->MineralText[2].CharCount = (COUNT)~0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PlaySound (SetAbsSoundIndex (
|
||||||
|
LanderSounds, LANDER_FULL
|
||||||
|
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||||
|
continue;
|
||||||
|
case BIOLOGICAL_SCAN:
|
||||||
|
if (pPSD->BiologicalLevel < MAX_SCROUNGED)
|
||||||
|
{
|
||||||
|
if (pPSD->BiologicalLevel
|
||||||
|
+ NumRetrieved > MAX_SCROUNGED)
|
||||||
|
NumRetrieved = (COUNT)(
|
||||||
|
MAX_SCROUNGED
|
||||||
|
- pPSD->BiologicalLevel
|
||||||
|
);
|
||||||
|
FillLanderHold (pPSD, scan, NumRetrieved);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PlaySound (SetAbsSoundIndex (
|
||||||
|
LanderSounds, LANDER_FULL
|
||||||
|
), NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
which_node = HIBYTE (ElementPtr->life_span) - 1;
|
||||||
|
pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] |=
|
||||||
|
(1L << which_node);
|
||||||
|
pSolarSysState->CurNode = (COUNT)~0;
|
||||||
|
(*pSolarSysState->GenFunc) ((BYTE)(scan + GENERATE_MINERAL));
|
||||||
|
|
||||||
|
if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] &
|
||||||
|
(1L << which_node)))
|
||||||
|
{
|
||||||
|
if (DestroyStringTable (ReleaseStringTable (
|
||||||
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString
|
||||||
|
)))
|
||||||
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (NumRetrieved && scan == ENERGY_SCAN)
|
||||||
|
pPSD->InTransit = TRUE;
|
||||||
|
|
||||||
|
SET_GAME_STATE (PLANETARY_CHANGE, 1);
|
||||||
|
ElementPtr->state_flags |= DISAPPEARING;
|
||||||
|
}
|
||||||
|
UnlockElement (hElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user