**********************************************************

** Big Maps Projects code (incl. Multiplayer v1.5 **
**********************************************************
- Merged Big Maps Project code from BMP+MP trunk (Revision: 3340)
o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP
- Before THIS merge, I made a branch of the existing 1.13 source
o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src
- Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago
- I will add VS 2010 projects and solution file in the next few days

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2010-02-28 18:38:52 +00:00
parent a98c44ac78
commit 14750c6903
461 changed files with 23615 additions and 120157 deletions
+387 -401
View File
@@ -42,12 +42,14 @@
extern INT16 DirIncrementer[8];
UINT8 gubGridNoMarkers[ WORLD_MAX ];
//UINT8 gubGridNoMarkers[ WORLD_MAX ];
UINT8 * gubGridNoMarkers = NULL;
UINT8 gubGridNoValue = 254;
#ifdef _DEBUG
UINT8 gubFOVDebugInfoInfo[ WORLD_MAX ];
//UINT8 gubFOVDebugInfoInfo[ WORLD_MAX ];
UINT8 * gubFOVDebugInfoInfo = NULL;
#endif
@@ -177,7 +179,7 @@ void BuildSightDir(UINT32 dir, UINT32 *One, UINT32 *Two, UINT32 *Three, UINT32 *
typedef struct
{
INT16 sGridNo;
INT32 sGridNo;
BOOLEAN fAllocated;
} SLANT_ROOF_FOV_TYPE;
@@ -231,7 +233,7 @@ void ClearSlantRoofs( void )
guiNumSlantRoofs = 0;
}
BOOLEAN FindSlantRoofSlot( INT16 sGridNo )
BOOLEAN FindSlantRoofSlot( INT32 sGridNo )
{
UINT32 uiCount;
@@ -249,7 +251,7 @@ BOOLEAN FindSlantRoofSlot( INT16 sGridNo )
return( FALSE );
}
void AddSlantRoofFOVSlot( INT16 sGridNo )
void AddSlantRoofFOVSlot( INT32 sGridNo )
{
INT32 iSlantRoofSlot;
SLANT_ROOF_FOV_TYPE *pSlantRoof;
@@ -288,36 +290,36 @@ void ExamineSlantRoofFOVSlots( )
void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLocators, UINT8 ubLevel, BOOLEAN fForce )
{
UINT32 maincnt,markercnt,marker,tilesLeftToSee,prevmarker;
UINT8 cnt;
INT32 Inc[6],Dir[6];
INT8 itemVisible = FALSE;
INT8 Blocking,twoMoreTiles,markerDir;
INT8 nextDir=0;
UINT8 who; //,itemIndex; // for each square checked
UINT8 dir,range,Path2;
UINT8 ubRoomNo;
BOOLEAN fCheckForRooms = FALSE;
ITEM_POOL *pItemPool;
BOOLEAN fHiddenStructVisible;
UINT8 ubMovementCost;
BOOLEAN fTravelCostObs;
BOOLEAN fGoneThroughDoor = FALSE;
BOOLEAN fThroughWindow = FALSE;
BOOLEAN fItemsQuoteSaid = FALSE;
UINT16 usIndex;
BOOLEAN fRevealItems = TRUE;
BOOLEAN fStopRevealingItemsAfterThisTile = FALSE;
INT8 bTallestStructureHeight;
INT32 iDoorGridNo;
STRUCTURE * pStructure, *pDummy;
INT8 bStructHeight;
INT8 bThroughWindowDirection;
INT32 maincnt,markercnt,marker,tilesLeftToSee,prevmarker;
UINT8 cnt;
INT32 Inc[6],Dir[6];
INT8 itemVisible = FALSE;
INT8 Blocking,twoMoreTiles,markerDir;
INT8 nextDir=0;
UINT8 who; //,itemIndex; // for each square checked
UINT8 dir,range,Path2;
UINT8 ubRoomNo;
BOOLEAN fCheckForRooms = FALSE;
ITEM_POOL *pItemPool;
BOOLEAN fHiddenStructVisible;
UINT8 ubMovementCost;
BOOLEAN fTravelCostObs;
BOOLEAN fGoneThroughDoor = FALSE;
BOOLEAN fThroughWindow = FALSE;
BOOLEAN fItemsQuoteSaid = FALSE;
UINT16 usIndex;
BOOLEAN fRevealItems = TRUE;
BOOLEAN fStopRevealingItemsAfterThisTile = FALSE;
INT8 bTallestStructureHeight;
INT32 iDoorGridNo;
STRUCTURE *pStructure, *pDummy;
INT8 bStructHeight;
INT8 bThroughWindowDirection;
if ( pSoldier->flags.uiStatusFlags & SOLDIER_ENEMY )
{
//pSoldier->needToLookForItems = FALSE;
return;
//pSoldier->needToLookForItems = FALSE;
return;
}
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
@@ -325,10 +327,10 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
return;
}
// Return if this guy has no gridno, has bad life, etc
if( pSoldier->sGridNo == NOWHERE || !pSoldier->bInSector || pSoldier->stats.bLife < OKLIFE )
// Return if this guy has no gridno, has bad life, etc
if(TileIsOutOfBounds(pSoldier->sGridNo) || !pSoldier->bInSector || pSoldier->stats.bLife < OKLIFE )
{
return;
return;
}
if (pSoldier->bBlindedCounter > 0)
@@ -337,14 +339,14 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
}
gubGridNoValue++;
gubGridNoValue++;
if ( gubGridNoValue == 255 )
{
if ( gubGridNoValue == 255 )
{
// Reset!
memset( gubGridNoMarkers, 0, sizeof( gubGridNoMarkers ) );
gubGridNoValue = 1;
}
}
// OK, look for doors
@@ -354,7 +356,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
who = pSoldier->ubID;
dir = pSoldier->ubDirection;
//NumMessage("good old reveal",dir);
//NumMessage("good old reveal",dir);
// a gassed merc can only see 1 tile away due to blurred vision
if ( pSoldier->flags.uiStatusFlags & SOLDIER_GASSED )
@@ -363,7 +365,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
}
else
{
range = pSoldier->bViewRange;
range = pSoldier->bViewRange;
// balance item viewing range between normal and the limit set by opplist-type functions -- CJC
range = (AdjustMaxSightRangeForEnvEffects( pSoldier, LightTrueLevel( pSoldier->sGridNo, pSoldier->pathing.bLevel), range ) + range) / 2;
}
@@ -379,9 +381,9 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
Dir[5] = pSoldier->ubDirection;
if (dir % 2 == 1) /* even numbers use ViewPath2 */
Path2 = TRUE;
Path2 = TRUE;
else
Path2 = FALSE;
Path2 = FALSE;
// ATE: if in this special cercumstance... our guys are moving on their own...
@@ -395,161 +397,157 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
for (maincnt = 0; maincnt < MAXVIEWPATHS; maincnt++)
{
marker = pSoldier->sGridNo;
Blocking = FALSE;
twoMoreTiles = FALSE;
tilesLeftToSee = 99;
fRevealItems = TRUE;
fStopRevealingItemsAfterThisTile = FALSE;
#ifdef _DEBUG
if ( _KeyDown( NUM_LOCK ) )
{
memset( gubFOVDebugInfoInfo, 0, sizeof( gubFOVDebugInfoInfo ) );
SetRenderFlags( RENDER_FLAG_FULL );
RenderWorld( );
}
#endif
for (markercnt = 0; markercnt < range; markercnt++)
{
//fGoneThroughDoor = FALSE;
//fThroughWindow = FALSE;
prevmarker = marker;
nextDir = 99;
fCheckForRooms = FALSE;
fTravelCostObs = FALSE;
if ( fStopRevealingItemsAfterThisTile )
{
fRevealItems = FALSE;
fStopRevealingItemsAfterThisTile = FALSE;
}
if (Path2)
{
markerDir = ViewPath2[maincnt][markercnt];
if (markercnt < 12)
nextDir = ViewPath2[maincnt][markercnt+1];
}
else
{
markerDir = ViewPath[maincnt][markercnt];
if (markercnt < 12)
nextDir = ViewPath[maincnt][markercnt+1];
}
// OK, check flags for going through door/window last tile
if ( fThroughWindow == 1 )
{
// ATE: Make sure we are going through the same direction!
// THis is to solve the drassen SAM problem with seeing through walls
if ( Dir[markerDir] == bThroughWindowDirection)
{
fThroughWindow = 2;
}
else
{
fThroughWindow = 0;
}
}
else if ( fThroughWindow == 2 )
{
// We've overstayed our welcome - remove!
fThroughWindow = 0;
}
if ( fGoneThroughDoor == 1 )
{
fGoneThroughDoor = 2;
}
else if ( fGoneThroughDoor == 2 )
{
// We've overstayed our welcome - remove!
fGoneThroughDoor = 0;
}
//ATE CHECK FOR NOVIEW!
if ( nextDir == NOVIEW )
{
nextDir = 99;
}
marker = NewGridNo((INT16)marker,(INT16)Inc[markerDir]);
if ( marker == 12426 )
{
int i = 0;
}
// End if this is a no view...
if ( markerDir == NOVIEW && markercnt != 0 )
{
break;
}
marker = pSoldier->sGridNo;
Blocking = FALSE;
twoMoreTiles = FALSE;
tilesLeftToSee = 99;
fRevealItems = TRUE;
fStopRevealingItemsAfterThisTile = FALSE;
#ifdef _DEBUG
if ( _KeyDown( NUM_LOCK ) )
{
int cnt = GetJA2Clock( );
gubFOVDebugInfoInfo[ marker ] = (UINT8)markercnt;
StartFrameBufferRender();
RenderFOVDebug( );
SetFont( LARGEFONT1 );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
mprintf( 10, 10 , L"%d", maincnt );
//mprintf( 10, 20 , L"%d", marker );
//mprintf( 50, 20 , L"%d", pSoldier->sGridNo );
InvalidateScreen( );
EndFrameBufferRender();
RefreshScreen( NULL );
do
{
} while( ( GetJA2Clock( ) - cnt ) < 250 );
memset( gubFOVDebugInfoInfo, 0, sizeof( gubFOVDebugInfoInfo ) );
SetRenderFlags( RENDER_FLAG_FULL );
RenderWorld( );
}
#endif
// Check if we can get to this gridno from our direction in
ubMovementCost = gubWorldMovementCosts[ marker ][ Dir[ markerDir ] ][ ubLevel ];
// ATE: Added: If our current sector is below ground, ignore any blocks!
if ( gfCaves && ubMovementCost != TRAVELCOST_CAVEWALL )
{
ubMovementCost = TRAVELCOST_FLAT;
}
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
for (markercnt = 0; markercnt < range; markercnt++)
{
ubMovementCost = DoorTravelCost( pSoldier, marker, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
pStructure = FindStructure( (INT16) iDoorGridNo, STRUCTURE_ANYDOOR );
if ( pStructure != NULL && pStructure->fFlags & STRUCTURE_TRANSPARENT)
//fGoneThroughDoor = FALSE;
//fThroughWindow = FALSE;
prevmarker = marker;
nextDir = 99;
fCheckForRooms = FALSE;
fTravelCostObs = FALSE;
if ( fStopRevealingItemsAfterThisTile )
{
fRevealItems = FALSE;
fStopRevealingItemsAfterThisTile = FALSE;
}
if (Path2)
{
markerDir = ViewPath2[maincnt][markercnt];
if (markercnt < 12)
nextDir = ViewPath2[maincnt][markercnt+1];
}
else
{
markerDir = ViewPath[maincnt][markercnt];
if (markercnt < 12)
nextDir = ViewPath[maincnt][markercnt+1];
}
// OK, check flags for going through door/window last tile
if ( fThroughWindow == 1 )
{
// ATE: Make sure we are going through the same direction!
// THis is to solve the drassen SAM problem with seeing through walls
if ( Dir[markerDir] == bThroughWindowDirection)
{
fThroughWindow = 2;
}
else
{
fThroughWindow = 0;
}
}
else if ( fThroughWindow == 2 )
{
// We've overstayed our welcome - remove!
fThroughWindow = 0;
}
if ( fGoneThroughDoor == 1 )
{
fGoneThroughDoor = 2;
}
else if ( fGoneThroughDoor == 2 )
{
// We've overstayed our welcome - remove!
fGoneThroughDoor = 0;
}
//ATE CHECK FOR NOVIEW!
if ( nextDir == NOVIEW )
{
nextDir = 99;
}
marker = NewGridNo(marker,(INT16)Inc[markerDir]);
if ( marker == 12426 )
{
int i = 0;
}
// End if this is a no view...
if ( markerDir == NOVIEW && markercnt != 0 )
{
break;
}
#ifdef _DEBUG
if ( _KeyDown( NUM_LOCK ) )
{
int cnt = GetJA2Clock( );
gubFOVDebugInfoInfo[ marker ] = (UINT8)markercnt;
StartFrameBufferRender();
RenderFOVDebug( );
SetFont( LARGEFONT1 );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
mprintf( 10, 10 , L"%d", maincnt );
//mprintf( 10, 20 , L"%d", marker );
//mprintf( 50, 20 , L"%d", pSoldier->sGridNo );
InvalidateScreen( );
EndFrameBufferRender();
RefreshScreen( NULL );
do
{
} while( ( GetJA2Clock( ) - cnt ) < 250 );
}
#endif
// Check if we can get to this gridno from our direction in
ubMovementCost = gubWorldMovementCosts[ marker ][ Dir[ markerDir ] ][ ubLevel ];
// ATE: Added: If our current sector is below ground, ignore any blocks!
if ( gfCaves && ubMovementCost != TRAVELCOST_CAVEWALL )
{
// cell door or somehow otherwise transparent; allow merc to see through
ubMovementCost = TRAVELCOST_FLAT;
}
}
// If we have hit an obstacle, STOP HERE
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
if ( IS_TRAVELCOST_DOOR( ubMovementCost ) )
{
ubMovementCost = DoorTravelCost( pSoldier, marker, ubMovementCost, (BOOLEAN) (pSoldier->bTeam == gbPlayerNum), &iDoorGridNo );
pStructure = FindStructure( iDoorGridNo, STRUCTURE_ANYDOOR );
if ( pStructure != NULL && pStructure->fFlags & STRUCTURE_TRANSPARENT)
{
// cell door or somehow otherwise transparent; allow merc to see through
ubMovementCost = TRAVELCOST_FLAT;
}
}
// If we have hit an obstacle, STOP HERE
if ( ubMovementCost >= TRAVELCOST_BLOCKED )
{
// We have an obstacle here...
// If it is bigger than a breadbox... err... taller than a man...
@@ -567,7 +565,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
else
{
// walls are handled above, so the blocking object is guaranteed not to be a wall
bTallestStructureHeight = GetTallestStructureHeight( (INT16) marker, FALSE );
bTallestStructureHeight = GetTallestStructureHeight( marker, FALSE );
if (bTallestStructureHeight >= 3)
{
fTravelCostObs = TRUE;
@@ -582,9 +580,6 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
}
if ( (Dir[markerDir] % 2) == 1 )
{
// diagonal
@@ -595,7 +590,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
else
{
bTallestStructureHeight = GetTallestStructureHeight( (INT16) marker, FALSE );
bTallestStructureHeight = GetTallestStructureHeight( marker, FALSE );
if (bTallestStructureHeight >= 3)
{
fTravelCostObs = TRUE;
@@ -608,89 +603,88 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
}
}
}
// Check if it's been done already!
if ( gubGridNoMarkers[ marker ] != gubGridNoValue )
{
// Mark gridno
gubGridNoMarkers[ marker ] = gubGridNoValue;
// check and see if the gridno changed
// if the gridno is the same, avoid redundancy and break
if (marker==prevmarker && markercnt != 0 )
{
}
else // it changed
// Check if it's been done already!
if ( gubGridNoMarkers[ marker ] != gubGridNoValue )
{
// Skip others if we have gone through a door but are too far away....
if ( fGoneThroughDoor )
// Mark gridno
gubGridNoMarkers[ marker ] = gubGridNoValue;
// check and see if the gridno changed
// if the gridno is the same, avoid redundancy and break
if (marker==prevmarker && markercnt != 0 )
{
if (markercnt > 5 ) // Are we near the door?
}
else // it changed
{
// Skip others if we have gone through a door but are too far away....
if ( fGoneThroughDoor )
{
break;
if (markercnt > 5 ) // Are we near the door?
{
break;
}
}
// DO MINE FINDING STUFF
// GET INDEX FOR ITEM HERE
// if there IS a direction after this one, nextdir WILL NOT be 99
if (nextDir != 99)
{
Blocking = GetBlockingStructureInfo( marker, (INT8)Dir[ markerDir ], (INT8)Dir[ nextDir ], ubLevel, &bStructHeight, &pDummy, FALSE );
}
else // no "next" direction, so pass in a NOWHERE so that
// "SpecialViewObstruction" will know not to take it UINT32o consideration
{
Blocking = GetBlockingStructureInfo( marker, (INT8)Dir[markerDir], (INT8)30, ubLevel, &bStructHeight, &pDummy, FALSE );
}
}
// DO MINE FINDING STUFF
// GET INDEX FOR ITEM HERE
// if there IS a direction after this one, nextdir WILL NOT be 99
if (nextDir != 99)
{
Blocking = GetBlockingStructureInfo( (INT16)marker, (INT8)Dir[ markerDir ], (INT8)Dir[ nextDir ], ubLevel, &bStructHeight, &pDummy, FALSE );
}
else // no "next" direction, so pass in a NOWHERE so that
// "SpecialViewObstruction" will know not to take it UINT32o consideration
{
Blocking = GetBlockingStructureInfo( (INT16)marker, (INT8)Dir[markerDir], (INT8)30, ubLevel, &bStructHeight, &pDummy, FALSE );
}
if ( gfCaves )
{
Blocking = NOTHING_BLOCKING;
}
if ( gfCaves )
{
Blocking = NOTHING_BLOCKING;
}
// CHECK FOR ROOMS
if ( Blocking == BLOCKING_TOPLEFT_WINDOW || Blocking == BLOCKING_TOPLEFT_OPEN_WINDOW )
{
// CHECK FOR ROOMS
if ( Blocking == BLOCKING_TOPLEFT_WINDOW || Blocking == BLOCKING_TOPLEFT_OPEN_WINDOW )
{
// CHECK FACING DIRECTION!
if ( Dir[markerDir] == NORTH || Dir[markerDir] == SOUTH )
{
if (markercnt <= 1 ) // Are we right beside it?
{
fThroughWindow = TRUE;
bThroughWindowDirection = ( INT8 ) Dir[ markerDir ];
bThroughWindowDirection = ( INT8 ) Dir[ markerDir ];
}
}
}
if ( Blocking == BLOCKING_TOPRIGHT_WINDOW || Blocking == BLOCKING_TOPRIGHT_OPEN_WINDOW )
{
}
if ( Blocking == BLOCKING_TOPRIGHT_WINDOW || Blocking == BLOCKING_TOPRIGHT_OPEN_WINDOW )
{
// CHECK FACING DIRECTION!
if ( Dir[markerDir] == EAST || Dir[markerDir] == WEST )
{
if (markercnt <= 1 ) // Are we right beside it?
{
fThroughWindow = TRUE;
bThroughWindowDirection = ( INT8 ) Dir[ markerDir ];
bThroughWindowDirection = ( INT8 ) Dir[ markerDir ];
}
}
}
}
if ( Blocking == BLOCKING_TOPLEFT_DOOR )
{
if ( Blocking == BLOCKING_TOPLEFT_DOOR )
{
fGoneThroughDoor = TRUE;
}
if ( Blocking == BLOCKING_TOPRIGHT_DOOR )
{
}
if ( Blocking == BLOCKING_TOPRIGHT_DOOR )
{
fGoneThroughDoor = TRUE;
}
}
// ATE: If we hit this tile, find item always!
//if (Blocking < FULL_BLOCKING )
{
// ATE: If we hit this tile, find item always!
//if (Blocking < FULL_BLOCKING )
{
// Handle special things for our mercs, like uncovering roofs
// and revealing objects...
@@ -702,70 +696,68 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
if (itemsToo && fRevealItems ) // && itemIndex < MAXOBJECTLIST)
{
// OK, look for corpses...
LookForAndMayCommentOnSeeingCorpse( pSoldier, (INT16)marker, ubLevel );
// OK, look for corpses...
LookForAndMayCommentOnSeeingCorpse( pSoldier, marker, ubLevel );
if ( GetItemPool( (INT16)marker, &pItemPool, ubLevel ) )
if ( GetItemPool( marker, &pItemPool, ubLevel ) )
{
itemVisible = pItemPool->bVisible;
if ( SetItemPoolVisibilityOn( pItemPool, INVISIBLE, fShowLocators ) )
{
itemVisible = pItemPool->bVisible;
SetRenderFlags(RENDER_FLAG_FULL);
if ( SetItemPoolVisibilityOn( pItemPool, INVISIBLE, fShowLocators ) )
if ( fShowLocators )
{
// Set makred render flags
//gpWorldLevelData[marker].uiFlags|=MAPELEMENT_REDRAW;
//gpWorldLevelData[gusCurMousePos].pTopmostHead->uiFlags |= LEVELNODE_DYNAMIC;
//SetRenderFlags(RENDER_FLAG_MARKED);
SetRenderFlags(RENDER_FLAG_FULL);
// Hault soldier
// ATE: Only if in combat...
if ( gTacticalStatus.uiFlags & INCOMBAT )
{
SetRenderFlags(RENDER_FLAG_FULL);
if ( fShowLocators )
{
// Set makred render flags
//gpWorldLevelData[marker].uiFlags|=MAPELEMENT_REDRAW;
//gpWorldLevelData[gusCurMousePos].pTopmostHead->uiFlags |= LEVELNODE_DYNAMIC;
//SetRenderFlags(RENDER_FLAG_MARKED);
SetRenderFlags(RENDER_FLAG_FULL);
// Hault soldier
// ATE: Only if in combat...
if ( gTacticalStatus.uiFlags & INCOMBAT )
{
pSoldier->HaultSoldierFromSighting( FALSE );
}
else
{
// ATE: Make sure we show locators...
gTacticalStatus.fLockItemLocators = FALSE;
}
if ( !fItemsQuoteSaid && gTacticalStatus.fLockItemLocators == FALSE )
{
gTacticalStatus.fLockItemLocators = TRUE;
if ( gTacticalStatus.ubAttackBusyCount > 0 && ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
gTacticalStatus.fItemsSeenOnAttack = TRUE;
gTacticalStatus.ubItemsSeenOnAttackSoldier = pSoldier->ubID;
gTacticalStatus.sItemsSeenOnAttackGridNo = (INT16)(marker);
}
else
{
// Display quote!
if ( !AM_AN_EPC( pSoldier ) )
{
TacticalCharacterDialogueWithSpecialEvent( pSoldier, (UINT16)( QUOTE_SPOTTED_SOMETHING_ONE + Random( 2 ) ), DIALOGUE_SPECIAL_EVENT_SIGNAL_ITEM_LOCATOR_START, (INT16)(marker), 0 );
}
else
{
// Turn off item lock for locators...
gTacticalStatus.fLockItemLocators = FALSE;
// Slide to location!
SlideToLocation( 0, (INT16)(marker) );
}
}
fItemsQuoteSaid = TRUE;
}
}
pSoldier->HaultSoldierFromSighting( FALSE );
}
else
{
// ATE: Make sure we show locators...
gTacticalStatus.fLockItemLocators = FALSE;
}
}
if ( !fItemsQuoteSaid && gTacticalStatus.fLockItemLocators == FALSE )
{
gTacticalStatus.fLockItemLocators = TRUE;
if ( gTacticalStatus.ubAttackBusyCount > 0 && ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
gTacticalStatus.fItemsSeenOnAttack = TRUE;
gTacticalStatus.ubItemsSeenOnAttackSoldier = pSoldier->ubID;
gTacticalStatus.usItemsSeenOnAttackGridNo = marker;
}
else
{
// Display quote!
if ( !AM_AN_EPC( pSoldier ) )
{
TacticalCharacterDialogueWithSpecialEvent( pSoldier, (UINT16)( QUOTE_SPOTTED_SOMETHING_ONE + Random( 2 ) ), DIALOGUE_SPECIAL_EVENT_SIGNAL_ITEM_LOCATOR_START, marker, 0 );
}
else
{
// Turn off item lock for locators...
gTacticalStatus.fLockItemLocators = FALSE;
// Slide to location!
SlideToLocation( 0, marker );
}
}
fItemsQuoteSaid = TRUE;
}
}
}
}
}
// if blood here, let the user see it now...
@@ -775,135 +767,129 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
//DoRoofs(marker,gpSoldier);
tilesLeftToSee--;
}
// CHECK FOR HIDDEN STRUCTS
// IF we had a hidden struct here that is not visible ( which will still be true because
// we set it revealed below...
if ( DoesGridnoContainHiddenStruct( (INT16)marker, &fHiddenStructVisible ) )
{
if ( !fHiddenStructVisible )
{
gpWorldLevelData[marker].uiFlags|=MAPELEMENT_REDRAW;
SetRenderFlags(RENDER_FLAG_MARKED);
RecompileLocalMovementCosts( (INT16)marker );
}
}
if (tilesLeftToSee <= 0)
break;
if ( Blocking == FULL_BLOCKING || ( fTravelCostObs && !fThroughWindow ) )
{
break;
}
//if ( Blocking == NOTHING_BLOCKING || Blocking == BLOCKING_NEXT_TILE )
if ( Blocking == NOTHING_BLOCKING )
{
fCheckForRooms = TRUE;
}
if ( ubLevel != 0 )
{
fCheckForRooms = FALSE;
}
// CHECK FOR SLANT ROOF!
{
STRUCTURE *pStructure, *pBase;
pStructure = FindStructure( (INT16)marker, STRUCTURE_SLANTED_ROOF );
if ( pStructure != NULL )
// CHECK FOR HIDDEN STRUCTS
// IF we had a hidden struct here that is not visible ( which will still be true because
// we set it revealed below...
if ( DoesGridNoContainHiddenStruct( marker, &fHiddenStructVisible ) )
{
pBase = FindBaseStructure( pStructure );
// ADD TO SLANTED ROOF LIST!
AddSlantRoofFOVSlot( (INT16)marker );
}
}
// Set gridno as revealed
if ( ubLevel == FIRST_LEVEL )
{
if ( gfBasement || gfCaves )
{
// OK, if we are underground, we don't want to reveal stuff if
// 1 ) there is a roof over us and
// 2 ) we are not in a room
if ( gubWorldRoomInfo[ marker ] == NO_ROOM && TypeRangeExistsInRoofLayer( marker, FIRSTROOF, FOURTHROOF, &usIndex ) )
if ( !fHiddenStructVisible )
{
int i = 0;
gpWorldLevelData[marker].uiFlags|=MAPELEMENT_REDRAW;
SetRenderFlags(RENDER_FLAG_MARKED);
RecompileLocalMovementCosts( marker );
}
}
if (tilesLeftToSee <= 0)
break;
if ( Blocking == FULL_BLOCKING || ( fTravelCostObs && !fThroughWindow ) )
{
break;
}
//if ( Blocking == NOTHING_BLOCKING || Blocking == BLOCKING_NEXT_TILE )
if ( Blocking == NOTHING_BLOCKING )
{
fCheckForRooms = TRUE;
}
if ( ubLevel != 0 )
{
fCheckForRooms = FALSE;
}
// CHECK FOR SLANT ROOF!
{
STRUCTURE *pStructure, *pBase;
pStructure = FindStructure( marker, STRUCTURE_SLANTED_ROOF );
if ( pStructure != NULL )
{
pBase = FindBaseStructure( pStructure );
// ADD TO SLANTED ROOF LIST!
AddSlantRoofFOVSlot( marker );
}
}
// Set gridno as revealed
if ( ubLevel == FIRST_LEVEL )
{
if ( gfBasement || gfCaves )
{
// OK, if we are underground, we don't want to reveal stuff if
// 1 ) there is a roof over us and
// 2 ) we are not in a room
if ( gubWorldRoomInfo[ marker ] == NO_ROOM && TypeRangeExistsInRoofLayer( marker, FIRSTROOF, FOURTHROOF, &usIndex ) )
{
int i = 0;
}
else
{
gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_REVEALED;
if( gfCaves )
{
RemoveFogFromGridNo( marker );
}
}
}
else
{
gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_REVEALED;
if( gfCaves )
}
// CHECK FOR ROOMS
//if ( fCheckForRooms )
{
if ( InAHiddenRoom( marker, &ubRoomNo ) )
{
RemoveFogFromGridNo( marker );
RemoveRoomRoof( marker, ubRoomNo, pSoldier );
if ( ubRoomNo == ROOM_SURROUNDING_BOXING_RING && gWorldSectorX == BOXING_SECTOR_X && gWorldSectorY == BOXING_SECTOR_Y && gbWorldSectorZ == BOXING_SECTOR_Z )
{
// reveal boxing ring at same time
RemoveRoomRoof( marker, BOXING_RING, pSoldier );
}
}
}
}
else
{
gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_REVEALED;
gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_REVEALED_ROOF;
}
// CHECK FOR ROOMS
//if ( fCheckForRooms )
// Check for blood....
UpdateBloodGraphics( marker, ubLevel );
if ( Blocking != NOTHING_BLOCKING && Blocking != BLOCKING_TOPLEFT_DOOR && Blocking != BLOCKING_TOPRIGHT_DOOR && Blocking != BLOCKING_TOPLEFT_WINDOW && Blocking != BLOCKING_TOPRIGHT_WINDOW && Blocking != BLOCKING_TOPRIGHT_OPEN_WINDOW && Blocking != BLOCKING_TOPLEFT_OPEN_WINDOW)
{
if ( InAHiddenRoom( (INT16)marker, &ubRoomNo ) )
{
RemoveRoomRoof( (INT16)marker, ubRoomNo, pSoldier );
if ( ubRoomNo == ROOM_SURROUNDING_BOXING_RING && gWorldSectorX == BOXING_SECTOR_X && gWorldSectorY == BOXING_SECTOR_Y && gbWorldSectorZ == BOXING_SECTOR_Z )
{
// reveal boxing ring at same time
RemoveRoomRoof( (INT16)marker, BOXING_RING, pSoldier );
}
}
break;
}
//gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_SHADELAND;
}
else
{
gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_REVEALED_ROOF;
}
// Check for blood....
UpdateBloodGraphics( (INT16)marker, ubLevel );
if ( Blocking != NOTHING_BLOCKING && Blocking != BLOCKING_TOPLEFT_DOOR && Blocking != BLOCKING_TOPRIGHT_DOOR && Blocking != BLOCKING_TOPLEFT_WINDOW && Blocking != BLOCKING_TOPRIGHT_WINDOW && Blocking != BLOCKING_TOPRIGHT_OPEN_WINDOW && Blocking != BLOCKING_TOPLEFT_OPEN_WINDOW)
} // End of duplicate check
else
{
if ( fTravelCostObs )
{
break;
}
//gpWorldLevelData[ marker ].uiFlags |= MAPELEMENT_SHADELAND;
}
} // End of duplicate check
else
{
if ( fTravelCostObs )
{
break;
}
}
} // end of one path
} // end of path loop
} // end of one path
} // end of path loop
// Loop through all availible slant roofs we collected and perform cool stuff on them
ExamineSlantRoofFOVSlots( );
//pSoldier->needToLookForItems = FALSE;
//LookForDoors(pSoldier,UNAWARE);
//LookForDoors(pSoldier,UNAWARE);
}
//#endif