Added property pages to make it easy to change build language (at least with VS2K5)

Added support for Russian city names and Items
Fixed contract length exploit (hire merc for 2 weeks for the price of 1 day)
Fixed insurance emails repeating when you choose "delete" but then say no
Corrected UTF-8 to wide char translation on Windows platforms (Windows doesn't handle mbstowcs correctly)
Moved UTF-8 to Wide Char translation for item descriptions and names so it happens at XML load time (fix bug that Russian has half the description space)
Fix overflow when combining two items with high counts (such as 200-round boxes of ammo)
Path AI fixes
Fixed issues with non-interruptable animations causing infinite clock
Fixed some issues with soldiers not reaching their plotted destination
Fixed escorted players who were cowering, being unable to move after joining party
Only allow militia to climb roofs if their orders allow them to move
Fix bug where AI might climb the wrong roof on the way to the destination roof
Allow AI who have gone outside their patrol grid, to return to the Grid


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1702 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2008-01-09 02:08:39 +00:00
parent 144426e896
commit 6049e8da5a
23 changed files with 621 additions and 407 deletions
+2 -2
View File
@@ -1389,9 +1389,9 @@ int CompareItemsForSorting( UINT16 usItem1Index, UINT16 usItem2Index, UINT8 ubIt
//}
//Madd: sort by name (for now at least):
if (_stricmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) < 0 )
if (_wcsicmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) < 0 )
return -1;
else if (_stricmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) > 0 )
else if (_wcsicmp(Item[usItem1Index].szBRName,Item[usItem2Index].szBRName) > 0 )
return 1;
else
{
+4 -4
View File
@@ -1081,8 +1081,8 @@ void HandleRenderInvSlots( SOLDIERTYPE *pSoldier, UINT8 fDirtyLevel )
# if defined( _DEBUG ) /* Sergeant_Kolja, to be removed later again */
if( pSoldier->inv[ cnt ].ItemData.Gun.ubGunAmmoType >= MAXITEMS )
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String("pObject (%s) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : "???" ));
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"pObject (%S) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : "???" );
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String("pObject (%S) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : L"???" ));
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"pObject (%s) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : L"???" );
DebugBreak();
AssertMsg( 0, "pObject corrupted! GetHelpTextForItem() can crash." );
}
@@ -7447,8 +7447,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
if ( (pObject->ItemData.Gun.ubGunAmmoType >= MAXITEMS)
)
{
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String( "corrupted pObject (%s) found in GetHelpTextForItem()", (usItem<MAXITEMS) ? Item[usItem].szItemName : "???" ));
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"corrupted pObject (%S) found in GetHelpTextForItem()" , (usItem<MAXITEMS) ? Item[usItem].szItemName : "???" );
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String( "corrupted pObject (%S) found in GetHelpTextForItem()", (usItem<MAXITEMS) ? Item[usItem].szItemName : L"???" ));
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"corrupted pObject (%s) found in GetHelpTextForItem()" , (usItem<MAXITEMS) ? Item[usItem].szItemName : L"???" );
DebugBreak();
AssertMsg( 0, "GetHelpTextForItem() would crash" );
}
+5 -5
View File
@@ -277,7 +277,7 @@ typedef struct
UINT16 fFlags;
UINT32 uiIndex; // added
CHAR8 szItemName[80]; //+1 for the null terminator //added
CHAR16 szItemName[80]; //+1 for the null terminator //added
BOOLEAN damageable;
BOOLEAN repairable;
@@ -297,10 +297,10 @@ typedef struct
BOOLEAN electronic;
BOOLEAN inseparable;
CHAR8 szLongItemName[80];
CHAR8 szItemDesc[400];
CHAR8 szBRName[80];
CHAR8 szBRDesc[400];
CHAR16 szLongItemName[80];
CHAR16 szItemDesc[400];
CHAR16 szBRName[80];
CHAR16 szBRDesc[400];
//TODO: quest items, boosters, money
+36 -11
View File
@@ -3551,20 +3551,45 @@ BOOLEAN AttachObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pTargetObj, OBJECTTYP
// count down through # of attaching items and add to status of item in position 0
for (bLoop = pAttachment->ubNumberOfObjects - 1; bLoop >= 0; bLoop--)
{
if (pTargetObj->ItemData.Generic.bStatus[0] + pAttachment->ItemData.Generic.bStatus[bLoop] <= ubLimit)
if ( Item[ pTargetObj->usItem ].usItemClass == IC_AMMO )
{
// consume this one totally and continue
pTargetObj->ItemData.Generic.bStatus[0] += pAttachment->ItemData.Generic.bStatus[bLoop];
RemoveObjFrom( pAttachment, bLoop );
// reset loop limit
bLoop = pAttachment->ubNumberOfObjects; // add 1 to counteract the -1 from the loop
}
// Cast to a bigger int to prevent overflow
UINT32 uiTotal = pTargetObj->ItemData.Ammo.ubShotsLeft[0] + pAttachment->ItemData.Ammo.ubShotsLeft[bLoop];
if ( uiTotal <= ubLimit)
{
// consume this one totally and continue
pTargetObj->ItemData.Ammo.ubShotsLeft[0] = (UINT8) uiTotal;
RemoveObjFrom( pAttachment, bLoop );
// reset loop limit
bLoop = pAttachment->ubNumberOfObjects; // add 1 to counteract the -1 from the loop
}
else
{
// add part of this one and then we're done
pAttachment->ItemData.Ammo.ubShotsLeft[bLoop] = (UINT8) (uiTotal - ubLimit);
pTargetObj->ItemData.Ammo.ubShotsLeft[0] = ubLimit;
break;
}
}
else
{
// add part of this one and then we're done
pAttachment->ItemData.Generic.bStatus[bLoop] -= (ubLimit - pTargetObj->ItemData.Generic.bStatus[0]);
pTargetObj->ItemData.Generic.bStatus[0] = ubLimit;
break;
// Cast to a bigger int to prevent overflow
INT32 iTotal = pTargetObj->ItemData.Generic.bStatus[0] + pAttachment->ItemData.Generic.bStatus[bLoop];
if ( iTotal <= ubLimit)
{
// consume this one totally and continue
pTargetObj->ItemData.Generic.bStatus[0] = (INT8) iTotal;
RemoveObjFrom( pAttachment, bLoop );
// reset loop limit
bLoop = pAttachment->ubNumberOfObjects; // add 1 to counteract the -1 from the loop
}
else
{
// add part of this one and then we're done
pAttachment->ItemData.Generic.bStatus[bLoop] = (INT8) (iTotal - ubLimit);
pTargetObj->ItemData.Generic.bStatus[0] = (INT8) ubLimit;
break;
}
}
}
break;
+3 -1
View File
@@ -2302,9 +2302,11 @@ void RestorePathAIToDefaults( void )
////////////////////////////////////////////////////////////////////////
INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMovementMode, INT8 bCopy, UINT8 fFlags )
{
s->sPlotSrcGrid = s->sGridNo;
#ifdef USE_ASTAR_PATHS
int retVal = ASTAR::AStarPathfinder::GetInstance().GetPath(s, sDestination, ubLevel, usMovementMode, bCopy, fFlags);
if (retVal) {
if (retVal || sDestination == NOWHERE) {
return retVal;
}
else {
+25 -2
View File
@@ -113,22 +113,45 @@ INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT16 sGridno, INT8 bDir, INT8
case TRAVELCOST_DEBRIS : sAPCost += AP_MOVEMENT_RUBBLE;
break;
case TRAVELCOST_SHORE : sAPCost += AP_MOVEMENT_SHORE; // wading shallow water
if (!IS_MERC_BODY_TYPE( pSoldier ))
{
return -1;
}
break;
case TRAVELCOST_KNEEDEEP : sAPCost += AP_MOVEMENT_LAKE; // wading waist/chest deep - very slow
if (!IS_MERC_BODY_TYPE( pSoldier ))
{
return -1;
}
break;
case TRAVELCOST_DEEPWATER: sAPCost += AP_MOVEMENT_OCEAN; // can swim, so it's faster than wading
if (!IS_MERC_BODY_TYPE( pSoldier ))
{
return -1;
}
break;
/*
case TRAVELCOST_VEINEND :
case TRAVELCOST_VEINMID : sAPCost += AP_MOVEMENT_FLAT;
break;
*/
case TRAVELCOST_DOOR : sAPCost += AP_MOVEMENT_FLAT + AP_OPEN_DOOR + AP_OPEN_DOOR; // Include open and close costs!
case TRAVELCOST_DOOR :
if (pSoldier->bTeam == gbPlayerNum)
{
return -1;
}
sAPCost += AP_MOVEMENT_FLAT + AP_OPEN_DOOR + AP_OPEN_DOOR; // Include open and close costs!
break;
// cost for jumping a fence REPLACES all other AP costs!
case TRAVELCOST_FENCE : return( AP_JUMPFENCE );
case TRAVELCOST_FENCE :
if (!IS_MERC_BODY_TYPE( pSoldier ))
{
return -1;
}
return( AP_JUMPFENCE );
case TRAVELCOST_NONE : return( 0 );
+20 -5
View File
@@ -2391,6 +2391,10 @@ BOOLEAN EVENT_InitNewSoldierAnim( SOLDIERTYPE *pSoldier, UINT16 usNewState, UINT
// CHECK IF THIS NEW STATE IS NON-INTERRUPTABLE
// IF SO - SET NON-INT FLAG
// 0verhaul: Okay, here is a question: Is the "non-interrupt" supposed to be transferrable to other anims?
// That is, if one anim is not interruptable but it chains to another anim, should the "not interruptable" flag
// remain? I'm going to try out the theory that new animations should reset the "don't interrupt" flag.
#if 0
if ( uiNewAnimFlags & ANIM_NONINTERRUPT )
{
pSoldier->fInNonintAnim = TRUE;
@@ -2400,6 +2404,10 @@ BOOLEAN EVENT_InitNewSoldierAnim( SOLDIERTYPE *pSoldier, UINT16 usNewState, UINT
{
pSoldier->fRTInNonintAnim = TRUE;
}
#else
pSoldier->fInNonintAnim = (uiNewAnimFlags & ANIM_NONINTERRUPT) != 0;
pSoldier->fRTInNonintAnim = (uiNewAnimFlags & ANIM_RT_NONINTERRUPT) != 0;
#endif
// CHECK IF WE ARE NOT AIMING, IF NOT, RESET LAST TAGRET!
if ( !(gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_FIREREADY ) && !(gAnimControl[ usNewState ].uiFlags & ANIM_FIREREADY ) )
@@ -2653,6 +2661,9 @@ BOOLEAN EVENT_InitNewSoldierAnim( SOLDIERTYPE *pSoldier, UINT16 usNewState, UINT
usNewGridNo = NewGridNo( (UINT16)pSoldier->sGridNo, DirectionInc( pSoldier->ubDirection ) );
usNewGridNo = NewGridNo( (UINT16)usNewGridNo, DirectionInc( pSoldier->ubDirection ) );
pSoldier->sPlotSrcGrid = pSoldier->sGridNo;
pSoldier->fPastXDest = FALSE;
pSoldier->fPastYDest = FALSE;
pSoldier->usPathDataSize = 0;
pSoldier->usPathIndex = 0;
pSoldier->usPathingData[ pSoldier->usPathDataSize ] = pSoldier->ubDirection;
@@ -8409,13 +8420,13 @@ InternalGivingSoldierCancelServices( pSoldier, FALSE );
void MoveMerc( SOLDIERTYPE *pSoldier, FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckRange )
{
INT16 dDegAngle;
//INT16 dDegAngle;
FLOAT dDeltaPos;
FLOAT dXPos , dYPos;
BOOLEAN fStop = FALSE;
dDegAngle = (INT16)( dAngle * 180 / PI );
//dDegAngle = (INT16)( dAngle * 180 / PI );
//sprintf( gDebugStr, "Move Angle: %d", (int)dDegAngle );
// Find delta Movement for X pos
@@ -8588,7 +8599,7 @@ UINT8 atan8( INT16 sXPos, INT16 sYPos, INT16 sXPos2, INT16 sYPos2 )
DOUBLE test_x = sXPos2 - sXPos;
DOUBLE test_y = sYPos2 - sYPos;
UINT8 mFacing = WEST;
INT16 dDegAngle;
//INT16 dDegAngle;
DOUBLE angle;
if ( test_x == 0 )
@@ -8599,7 +8610,7 @@ UINT8 atan8( INT16 sXPos, INT16 sYPos, INT16 sXPos2, INT16 sYPos2 )
angle = atan2( test_x, test_y );
dDegAngle = (INT16)( angle * 180 / PI );
//dDegAngle = (INT16)( angle * 180 / PI );
//sprintf( gDebugStr, "Move Angle: %d", (int)dDegAngle );
do
@@ -11602,6 +11613,8 @@ void ChangeToFlybackAnimation( SOLDIERTYPE *pSoldier, UINT8 ubDirection )
// Remove any previous actions
pSoldier->ubPendingAction = NO_PENDING_ACTION;
pSoldier->sPlotSrcGrid = pSoldier->sGridNo;
// Since we're manually setting our path, we have to reset these @#$@# flags too. Otherwise we don't reach the
// destination a lot of the time
pSoldier->fPastXDest = 0;
@@ -11647,6 +11660,8 @@ void ChangeToFallbackAnimation( SOLDIERTYPE *pSoldier, UINT8 ubDirection )
// Remove any previous actions
pSoldier->ubPendingAction = NO_PENDING_ACTION;
pSoldier->sPlotSrcGrid = pSoldier->sGridNo;
// Since we're manually setting our path, we have to reset these @#$@# flags too. Otherwise we don't reach the
// destination a lot of the time
pSoldier->fPastXDest = 0;
@@ -11689,7 +11704,7 @@ void SetSoldierCowerState( SOLDIERTYPE *pSoldier, BOOLEAN fOn )
}
else
{
if ( (pSoldier->uiStatusFlags & SOLDIER_COWERING) )
if ( (pSoldier->uiStatusFlags & SOLDIER_COWERING) || (gAnimControl[ pSoldier->usAnimState ].ubEndHeight != ANIM_STAND) )
{
EVENT_InitNewSoldierAnim( pSoldier, END_COWER, 0, FALSE );
+2
View File
@@ -1073,6 +1073,8 @@ public:
vector<int> bNewItemCount;
vector<int> bNewItemCycleCount;
INT16 sPlotSrcGrid;
}; // SOLDIERTYPE;
#define SIZEOF_SOLDIERTYPE_POD offsetof( SOLDIERTYPE, endOfPOD )
+2
View File
@@ -950,6 +950,8 @@ SOLDIERTYPE *ChangeSoldierTeam( SOLDIERTYPE *pSoldier, UINT8 ubTeam )
pNewSoldier->bScientific = pSoldier->bScientific;
pNewSoldier->bLastRenderVisibleValue = pSoldier->bLastRenderVisibleValue;
pNewSoldier->bVisible = pSoldier->bVisible;
// 0verhaul: Need to pass certain flags over. COWERING is one of them. Others to be determined.
pNewSoldier->uiStatusFlags |= pSoldier->uiStatusFlags & (SOLDIER_COWERING | SOLDIER_MUTE | SOLDIER_GASSED);
if ( ubTeam == gbPlayerNum )
{
+10
View File
@@ -128,11 +128,16 @@ ammoEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
if(pData->curIndex < pData->maxArraySize)
{
#if 0
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++)
{
temp = pData->szCharData[i];
AmmoCaliber[pData->curIndex][i] = temp;
}
#else
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, AmmoCaliber[pData->curIndex], sizeof(AmmoCaliber[0])/sizeof(AmmoCaliber[0][0]) );
AmmoCaliber[pData->curIndex][sizeof(AmmoCaliber[0])/sizeof(AmmoCaliber[0][0]) - 1] = '\0';
#endif
}
}
@@ -141,11 +146,16 @@ ammoEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
if(pData->curIndex < pData->maxArraySize)
{
#if 0
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++)
{
temp = pData->szCharData[i];
BobbyRayAmmoCaliber[pData->curIndex][i] = temp;
}
#else
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, BobbyRayAmmoCaliber[pData->curIndex], sizeof(BobbyRayAmmoCaliber[0])/sizeof(BobbyRayAmmoCaliber[0][0]) );
BobbyRayAmmoCaliber[pData->curIndex][sizeof(BobbyRayAmmoCaliber[0])/sizeof(BobbyRayAmmoCaliber[0][0]) - 1] = '\0';
#endif
}
}
+345 -345
View File
@@ -1957,73 +1957,73 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno, INT8 bOppLevel, UINT8 ubCaller, UINT8 ubCaller2)
{
INT8 bDoLocate = FALSE;
BOOLEAN fNewOpponent = FALSE;
BOOLEAN fNotAddedToList = TRUE;
INT8 bOldOppList = pSoldier->bOppList[pOpponent->ubID];
INT8 bDoLocate = FALSE;
BOOLEAN fNewOpponent = FALSE;
BOOLEAN fNotAddedToList = TRUE;
INT8 bOldOppList = pSoldier->bOppList[pOpponent->ubID];
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"ManSeesMan");
if (pSoldier->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
NumMessage("ManSeesMan: ERROR - ptr->guynum = ",ptr->guynum);
#endif
*/
return;
}
if (pSoldier->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
NumMessage("ManSeesMan: ERROR - ptr->guynum = ",ptr->guynum);
#endif
*/
return;
}
if (pOpponent->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
NumMessage("ManSeesMan: ERROR - oppPtr->guynum = ",oppPtr->guynum);
#endif
*/
return;
}
if (pOpponent->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
NumMessage("ManSeesMan: ERROR - oppPtr->guynum = ",oppPtr->guynum);
#endif
*/
return;
}
// if we're somehow looking while inactive, at base, dying or already dead
if (!pSoldier->bActive || !pSoldier->bInSector || (pSoldier->bLife < OKLIFE))
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - %s is SEEING ManSeesMan while inactive/at base/dead/dying",ExtMen[ptr->guynum].name);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're somehow looking while inactive, at base, dying or already dead
if (!pSoldier->bActive || !pSoldier->bInSector || (pSoldier->bLife < OKLIFE))
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - %s is SEEING ManSeesMan while inactive/at base/dead/dying",ExtMen[ptr->guynum].name);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're somehow seeing a guy who is inactive, at base, or already dead
if (!pOpponent->bActive || !pOpponent->bInSector || pOpponent->bLife <= 0)
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - %s sees %s, ManSeesMan, who is inactive/at base/dead",ExtMen[ptr->guynum].name,ExtMen[oppPtr->guynum].name);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're somehow seeing a guy who is inactive, at base, or already dead
if (!pOpponent->bActive || !pOpponent->bInSector || pOpponent->bLife <= 0)
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - %s sees %s, ManSeesMan, who is inactive/at base/dead",ExtMen[ptr->guynum].name,ExtMen[oppPtr->guynum].name);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're somehow seeing a guy who is on the same team
if (pSoldier->bTeam == pOpponent->bTeam)
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - on SAME TEAM. ptr->guynum = %d, oppPtr->guynum = %d",
ptr->guynum,oppPtr->guynum);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're somehow seeing a guy who is on the same team
if (pSoldier->bTeam == pOpponent->bTeam)
{
/*
#ifdef BETAVERSION
sprintf(tempstr,"ManSeesMan: ERROR - on SAME TEAM. ptr->guynum = %d, oppPtr->guynum = %d",
ptr->guynum,oppPtr->guynum);
PopMessage(tempstr);
#endif
*/
return;
}
// if we're seeing a guy we didn't see on our last chance to look for him
if (pSoldier->bOppList[pOpponent->ubID] != SEEN_CURRENTLY)
{
// if we're seeing a guy we didn't see on our last chance to look for him
if (pSoldier->bOppList[pOpponent->ubID] != SEEN_CURRENTLY)
{
if ( pOpponent->bTeam == gbPlayerNum )
{
if ( pSoldier->ubProfile != NO_PROFILE )
@@ -2048,95 +2048,95 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
AddToShouldBecomeHostileOrSayQuoteList( pSoldier->ubID );
fNotAddedToList = FALSE;
}
if ( fNotAddedToList )
{
switch( pSoldier->ubProfile )
{
case CARMEN:
if (pOpponent->ubProfile == SLAY ) // 64
{
// Carmen goes to war (against Slay)
if ( pSoldier->bNeutral )
{
//SetSoldierNonNeutral( pSoldier );
pSoldier->bAttitude = ATTACKSLAYONLY;
TriggerNPCRecord( pSoldier->ubProfile, 28 );
}
/*
if ( ! gTacticalStatus.uiFlags & INCOMBAT )
{
EnterCombatMode( pSoldier->bTeam );
}
*/
}
break;
case ELDIN:
case CARMEN:
if (pOpponent->ubProfile == SLAY ) // 64
{
// Carmen goes to war (against Slay)
if ( pSoldier->bNeutral )
{
UINT8 ubRoom = 0;
// if player is in behind the ropes of the museum display
// or if alarm has gone off (status red)
InARoom( pOpponent->sGridNo, &ubRoom );
//SetSoldierNonNeutral( pSoldier );
pSoldier->bAttitude = ATTACKSLAYONLY;
TriggerNPCRecord( pSoldier->ubProfile, 28 );
}
/*
if ( ! gTacticalStatus.uiFlags & INCOMBAT )
{
EnterCombatMode( pSoldier->bTeam );
}
*/
}
break;
case ELDIN:
if ( pSoldier->bNeutral )
{
UINT8 ubRoom = 0;
// if player is in behind the ropes of the museum display
// or if alarm has gone off (status red)
InARoom( pOpponent->sGridNo, &ubRoom );
if ( ( CheckFact( FACT_MUSEUM_OPEN, 0 ) == FALSE && ubRoom >= 22 && ubRoom <= 41 ) || CheckFact( FACT_MUSEUM_ALARM_WENT_OFF, 0 ) || ( ubRoom == 39 || ubRoom == 40 ) || ( FindObj( pOpponent, CHALICE ) != NO_SLOT ) )
{
SetFactTrue( FACT_MUSEUM_ALARM_WENT_OFF );
AddToShouldBecomeHostileOrSayQuoteList( pSoldier->ubID );
}
}
break;
case JIM:
case JACK:
case OLAF:
case RAY:
case OLGA:
case TYRONE:
// change orders, reset action!
if ( pSoldier->bOrders != SEEKENEMY )
if ( ( CheckFact( FACT_MUSEUM_OPEN, 0 ) == FALSE && ubRoom >= 22 && ubRoom <= 41 ) || CheckFact( FACT_MUSEUM_ALARM_WENT_OFF, 0 ) || ( ubRoom == 39 || ubRoom == 40 ) || ( FindObj( pOpponent, CHALICE ) != NO_SLOT ) )
{
pSoldier->bOrders = SEEKENEMY;
if ( pSoldier->bOppCnt == 0 )
{
// didn't see anyone before!
CancelAIAction( pSoldier, TRUE );
SetNewSituation( pSoldier );
}
SetFactTrue( FACT_MUSEUM_ALARM_WENT_OFF );
AddToShouldBecomeHostileOrSayQuoteList( pSoldier->ubID );
}
break;
case ANGEL:
if ( pOpponent->ubProfile == MARIA )
{
if ( CheckFact( FACT_MARIA_ESCORTED_AT_LEATHER_SHOP, MARIA ) == TRUE )
{
// she was rescued! yay!
TriggerNPCRecord( ANGEL, 12 );
}
}
else if ( ( CheckFact( FACT_ANGEL_LEFT_DEED, ANGEL ) == TRUE ) && ( CheckFact( FACT_ANGEL_MENTIONED_DEED, ANGEL ) == FALSE ) )
}
break;
case JIM:
case JACK:
case OLAF:
case RAY:
case OLGA:
case TYRONE:
// change orders, reset action!
if ( pSoldier->bOrders != SEEKENEMY )
{
pSoldier->bOrders = SEEKENEMY;
if ( pSoldier->bOppCnt == 0 )
{
// didn't see anyone before!
CancelAIAction( pSoldier, TRUE );
pSoldier->sAbsoluteFinalDestination = NOWHERE;
EVENT_StopMerc( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection );
TriggerNPCRecord( ANGEL, 20 );
// trigger Angel to walk off afterwards
//TriggerNPCRecord( ANGEL, 24 );
SetNewSituation( pSoldier );
}
break;
//case QUEEN:
case JOE:
case ELLIOT:
if ( ! ( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
}
break;
case ANGEL:
if ( pOpponent->ubProfile == MARIA )
{
if ( CheckFact( FACT_MARIA_ESCORTED_AT_LEATHER_SHOP, MARIA ) == TRUE )
{
if ( !AreInMeanwhile() )
{
TriggerNPCRecord( pSoldier->ubProfile, 4 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
}
// she was rescued! yay!
TriggerNPCRecord( ANGEL, 12 );
}
break;
default:
break;
}
else if ( ( CheckFact( FACT_ANGEL_LEFT_DEED, ANGEL ) == TRUE ) && ( CheckFact( FACT_ANGEL_MENTIONED_DEED, ANGEL ) == FALSE ) )
{
CancelAIAction( pSoldier, TRUE );
pSoldier->sAbsoluteFinalDestination = NOWHERE;
EVENT_StopMerc( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection );
TriggerNPCRecord( ANGEL, 20 );
// trigger Angel to walk off afterwards
//TriggerNPCRecord( ANGEL, 24 );
}
break;
//case QUEEN:
case JOE:
case ELLIOT:
if ( ! ( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
{
if ( !AreInMeanwhile() )
{
TriggerNPCRecord( pSoldier->ubProfile, 4 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
}
}
break;
default:
break;
}
}
}
@@ -2146,21 +2146,21 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
{
/*
case MIKE:
if ( gfPlayerTeamSawMike && !( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
{
InitiateConversation( pSoldier, pOpponent, NPC_INITIAL_QUOTE, 0 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
}
break;
*/
case IGGY:
if ( ! ( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
{
TriggerNPCRecord( pSoldier->ubProfile, 9 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
gbPublicOpplist[ gbPlayerNum ][ pSoldier->ubID ] = HEARD_THIS_TURN;
}
break;
if ( gfPlayerTeamSawMike && !( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
{
InitiateConversation( pSoldier, pOpponent, NPC_INITIAL_QUOTE, 0 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
}
break;
*/
case IGGY:
if ( ! ( gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
{
TriggerNPCRecord( pSoldier->ubProfile, 9 );
gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
gbPublicOpplist[ gbPlayerNum ][ pSoldier->ubID ] = HEARD_THIS_TURN;
}
break;
}
}
}
@@ -2206,7 +2206,7 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
else if ( pSoldier->ubCivilianGroup == HICKS_CIV_GROUP && CheckFact( FACT_HICKS_MARRIED_PLAYER_MERC, 0 ) == FALSE )
{
UINT32 uiTime;
INT16 sX, sY;
INT16 sX, sY;
// if before 6:05 or after 22:00, make hostile and enter combat
uiTime = GetWorldMinutesInDay();
@@ -2218,99 +2218,99 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
{
EnterCombatMode( pSoldier->bTeam );
LocateSoldier( pSoldier->ubID, TRUE );
GetSoldierScreenPos( pSoldier, &sX, &sY );
// begin quote
BeginCivQuote( pSoldier, CIV_QUOTE_HICKS_SEE_US_AT_NIGHT, 0, sX, sY );
}
LocateSoldier( pSoldier->ubID, TRUE );
GetSoldierScreenPos( pSoldier, &sX, &sY );
// begin quote
BeginCivQuote( pSoldier, CIV_QUOTE_HICKS_SEE_US_AT_NIGHT, 0, sX, sY );
}
}
}
}
}
}
else if ( pSoldier->bTeam == gbPlayerNum )
{
if ( (pOpponent->ubProfile == MIKE) && ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) && !(pSoldier->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_MIKE) )
{
if (gfMikeShouldSayHi == FALSE)
{
gfMikeShouldSayHi = TRUE;
}
TacticalCharacterDialogue( pSoldier, QUOTE_AIM_SEEN_MIKE );
pSoldier->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_MIKE;
}
else if ( pOpponent->ubProfile == JOEY && gfPlayerTeamSawJoey == FALSE )
{
TacticalCharacterDialogue( pSoldier, QUOTE_SPOTTED_JOEY );
gfPlayerTeamSawJoey = TRUE;
}
}
else if ( pSoldier->bTeam == gbPlayerNum )
{
if ( (pOpponent->ubProfile == MIKE) && ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC ) && !(pSoldier->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_MIKE) )
{
if (gfMikeShouldSayHi == FALSE)
{
gfMikeShouldSayHi = TRUE;
}
TacticalCharacterDialogue( pSoldier, QUOTE_AIM_SEEN_MIKE );
pSoldier->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_MIKE;
}
else if ( pOpponent->ubProfile == JOEY && gfPlayerTeamSawJoey == FALSE )
{
TacticalCharacterDialogue( pSoldier, QUOTE_SPOTTED_JOEY );
gfPlayerTeamSawJoey = TRUE;
}
}
// as soon as a bloodcat sees someone, it becomes hostile
// this is safe to do here because we haven't made this new person someone we've seen yet
// (so we are assured we won't count 'em twice for oppcnt purposes)
if ( pSoldier->ubBodyType == BLOODCAT )
{
if ( pSoldier->bNeutral )
{
// as soon as a bloodcat sees someone, it becomes hostile
// this is safe to do here because we haven't made this new person someone we've seen yet
// (so we are assured we won't count 'em twice for oppcnt purposes)
if ( pSoldier->ubBodyType == BLOODCAT )
{
if ( pSoldier->bNeutral )
{
MakeBloodcatsHostile();
/*
SetSoldierNonNeutral( pSoldier );
RecalculateOppCntsDueToNoLongerNeutral( pSoldier );
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
CheckForPotentialAddToBattleIncrement( pSoldier );
}
*/
PlayJA2Sample( BLOODCAT_ROAR, RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
}
else
{
if ( pSoldier->bOppCnt == 0 )
{
if ( Random( 2 ) == 0 )
{
PlayJA2Sample( BLOODCAT_ROAR, RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
}
}
}
}
else if ( pOpponent->ubBodyType == BLOODCAT && pOpponent->bNeutral)
{
MakeBloodcatsHostile();
/*
SetSoldierNonNeutral( pSoldier );
RecalculateOppCntsDueToNoLongerNeutral( pSoldier );
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
CheckForPotentialAddToBattleIncrement( pSoldier );
}
*/
PlayJA2Sample( BLOODCAT_ROAR, RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
}
else
{
if ( pSoldier->bOppCnt == 0 )
{
if ( Random( 2 ) == 0 )
{
PlayJA2Sample( BLOODCAT_ROAR, RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
}
}
}
}
else if ( pOpponent->ubBodyType == BLOODCAT && pOpponent->bNeutral)
{
MakeBloodcatsHostile();
/*
SetSoldierNonNeutral( pOpponent );
RecalculateOppCntsDueToNoLongerNeutral( pOpponent );
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
SetSoldierNonNeutral( pOpponent );
RecalculateOppCntsDueToNoLongerNeutral( pOpponent );
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
{
CheckForPotentialAddToBattleIncrement( pOpponent );
}
*/
}
*/
}
// if both of us are not neutral, AND
// if this man is actually a true opponent (we're not on the same side)
if (!CONSIDERED_NEUTRAL( pOpponent, pSoldier ) && !CONSIDERED_NEUTRAL( pSoldier, pOpponent ) && (pSoldier->bSide != pOpponent->bSide))
{
AddOneOpponent(pSoldier);
// if both of us are not neutral, AND
// if this man is actually a true opponent (we're not on the same side)
if (!CONSIDERED_NEUTRAL( pOpponent, pSoldier ) && !CONSIDERED_NEUTRAL( pSoldier, pOpponent ) && (pSoldier->bSide != pOpponent->bSide))
{
AddOneOpponent(pSoldier);
#ifdef TESTOPPLIST
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String( "ManSeesMan: ID %d(%S) to ID %d NEW TO ME",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String( "ManSeesMan: ID %d(%S) to ID %d NEW TO ME",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
#endif
// if we also haven't seen him earlier this turn
if (pSoldier->bOppList[pOpponent->ubID] != SEEN_THIS_TURN)
{
fNewOpponent = TRUE;
pSoldier->bNewOppCnt++; // increment looker's NEW opponent count
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Soldier %d sees soldier %d!", pSoldier->ubID, pOpponent->ubID );
// if we also haven't seen him earlier this turn
if (pSoldier->bOppList[pOpponent->ubID] != SEEN_THIS_TURN)
{
fNewOpponent = TRUE;
pSoldier->bNewOppCnt++; // increment looker's NEW opponent count
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Soldier %d sees soldier %d!", pSoldier->ubID, pOpponent->ubID );
//ExtMen[ptr->guynum].lastCaller = caller;
//ExtMen[ptr->guynum].lastCaller2 = caller2;
//ExtMen[ptr->guynum].lastCaller = caller;
//ExtMen[ptr->guynum].lastCaller2 = caller2;
IncrementWatchedLoc( pSoldier->ubID, pOpponent->sGridNo, pOpponent->bLevel );
if ( pSoldier->bTeam == OUR_TEAM && pOpponent->bTeam == ENEMY_TEAM )
{
if ( CheckFact( FACT_FIRST_BATTLE_FOUGHT, 0 ) == FALSE )
@@ -2320,182 +2320,182 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
}
}
}
else
{
SetWatchedLocAsUsed( pSoldier->ubID, pOpponent->sGridNo, pOpponent->bLevel );
}
// we already know the soldier isn't SEEN_CURRENTLY,
// now check if he is really "NEW" ie. not expected to be there
// we already know the soldier isn't SEEN_CURRENTLY,
// now check if he is really "NEW" ie. not expected to be there
// if the looker hasn't seen this opponent at all earlier this turn, OR
// if the opponent is not where the looker last thought him to be
if ((pSoldier->bOppList[pOpponent->ubID] != SEEN_THIS_TURN) ||
(gsLastKnownOppLoc[pSoldier->ubID][pOpponent->ubID] != sOppGridno))
{
// if the looker hasn't seen this opponent at all earlier this turn, OR
// if the opponent is not where the looker last thought him to be
if ((pSoldier->bOppList[pOpponent->ubID] != SEEN_THIS_TURN) ||
(gsLastKnownOppLoc[pSoldier->ubID][pOpponent->ubID] != sOppGridno))
{
SetNewSituation( pSoldier ); // force the looker to re-evaluate
}
else
{
// if we in a non-combat movement decision, presumably this is not
// something we were quite expecting, so make a new decision. For
// other (combat) movement decisions, we took his position into account
// when we made it, so don't make us think again & slow things down.
switch (pSoldier->bAction)
else
{
// if we in a non-combat movement decision, presumably this is not
// something we were quite expecting, so make a new decision. For
// other (combat) movement decisions, we took his position into account
// when we made it, so don't make us think again & slow things down.
switch (pSoldier->bAction)
{
case AI_ACTION_RANDOM_PATROL:
case AI_ACTION_SEEK_OPPONENT:
case AI_ACTION_SEEK_FRIEND:
case AI_ACTION_POINT_PATROL:
case AI_ACTION_LEAVE_WATER_GAS:
case AI_ACTION_SEEK_NOISE:
SetNewSituation( pSoldier ); // force the looker to re-evaluate
break;
case AI_ACTION_RANDOM_PATROL:
case AI_ACTION_SEEK_OPPONENT:
case AI_ACTION_SEEK_FRIEND:
case AI_ACTION_POINT_PATROL:
case AI_ACTION_LEAVE_WATER_GAS:
case AI_ACTION_SEEK_NOISE:
SetNewSituation( pSoldier ); // force the looker to re-evaluate
break;
}
}
}
}
}
}
}
#ifdef TESTOPPLIST
else
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String( "ManSeesMan: ID %d(%S) to ID %d ALREADYSEENCURRENTLY",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
else
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String( "ManSeesMan: ID %d(%S) to ID %d ALREADYSEENCURRENTLY",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
#endif
//bOldOppValue = pSoldier->bOppList[ pOpponent->ubID ];
// remember that the soldier is currently seen and his new location
UpdatePersonal(pSoldier,pOpponent->ubID,SEEN_CURRENTLY,sOppGridno,bOppLevel);
// remember that the soldier is currently seen and his new location
UpdatePersonal(pSoldier,pOpponent->ubID,SEEN_CURRENTLY,sOppGridno,bOppLevel);
if ( ubCaller2 == MANLOOKSFOROTHERTEAMS || ubCaller2 == OTHERTEAMSLOOKFORMAN || ubCaller2 == CALLER_UNKNOWN ) // unknown->hearing
{
if ( gubBestToMakeSightingSize != BEST_SIGHTING_ARRAY_SIZE_INCOMBAT && gTacticalStatus.bBoxingState == NOT_BOXING )
if ( ubCaller2 == MANLOOKSFOROTHERTEAMS || ubCaller2 == OTHERTEAMSLOOKFORMAN || ubCaller2 == CALLER_UNKNOWN ) // unknown->hearing
{
if ( fNewOpponent )
if ( gubBestToMakeSightingSize != BEST_SIGHTING_ARRAY_SIZE_INCOMBAT && gTacticalStatus.bBoxingState == NOT_BOXING )
{
if ( gTacticalStatus.uiFlags & INCOMBAT )
if ( fNewOpponent )
{
// presumably a door opening... we do require standard interrupt conditions
if (StandardInterruptConditionsMet(pSoldier,pOpponent->ubID,bOldOppList))
if ( gTacticalStatus.uiFlags & INCOMBAT )
{
// presumably a door opening... we do require standard interrupt conditions
if (StandardInterruptConditionsMet(pSoldier,pOpponent->ubID,bOldOppList))
{
ReevaluateBestSightingPosition( pSoldier, CalcInterruptDuelPts( pSoldier, pOpponent->ubID, TRUE ) );
}
}
// require the enemy not to be dying if we are the sighter; in other words,
// always add for AI guys, and always add for people with life >= OKLIFE
else if ( !(pSoldier->bTeam == gbPlayerNum && pOpponent->bLife < OKLIFE ) )
{
ReevaluateBestSightingPosition( pSoldier, CalcInterruptDuelPts( pSoldier, pOpponent->ubID, TRUE ) );
}
}
// require the enemy not to be dying if we are the sighter; in other words,
// always add for AI guys, and always add for people with life >= OKLIFE
else if ( !(pSoldier->bTeam == gbPlayerNum && pOpponent->bLife < OKLIFE ) )
{
ReevaluateBestSightingPosition( pSoldier, CalcInterruptDuelPts( pSoldier, pOpponent->ubID, TRUE ) );
}
}
}
}
// if this man has never seen this opponent before in this sector
if (gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] == FALSE)
// remember that he is just seeing him now for the first time (-1)
gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] = -1;
else
// man is seeing an opponent AGAIN whom he has seen at least once before
gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] = TRUE;
// if this man has never seen this opponent before in this sector
if (gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] == FALSE)
// remember that he is just seeing him now for the first time (-1)
gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] = -1;
else
// man is seeing an opponent AGAIN whom he has seen at least once before
gbSeenOpponents[pSoldier->ubID][pOpponent->ubID] = TRUE;
// if looker is on local team, and the enemy was invisible or "maybe"
// visible just prior to this
// if looker is on local team, and the enemy was invisible or "maybe"
// visible just prior to this
#ifdef WE_SEE_WHAT_MILITIA_SEES_AND_VICE_VERSA
if ( ( PTR_OURTEAM || (pSoldier->bTeam == MILITIA_TEAM) ) && (pOpponent->bVisible <= 0))
if ( ( PTR_OURTEAM || (pSoldier->bTeam == MILITIA_TEAM) ) && (pOpponent->bVisible <= 0))
#else
if (PTR_OURTEAM && (pOpponent->bVisible <= 0))
if (PTR_OURTEAM && (pOpponent->bVisible <= 0))
#endif
{
// if opponent was truly invisible, not just turned off temporarily (FALSE)
if (pOpponent->bVisible == -1)
{
// then locate to him and set his locator flag
bDoLocate = TRUE;
//rain
if( gfLightningInProgress ) gfHaveSeenSomeone = TRUE;
//end rain
}
// make opponent visible (to us)
// must do this BEFORE the locate since it checks for visibility
pOpponent->bVisible = TRUE;
//ATE: Cancel any fading going on!
// ATE: Added for fade in.....
if ( pOpponent->fBeginFade == 1 || pOpponent->fBeginFade == 2 )
{
pOpponent->fBeginFade = FALSE;
if ( pOpponent->bLevel > 0 && gpWorldLevelData[ pOpponent->sGridNo ].pRoofHead != NULL )
{
// if opponent was truly invisible, not just turned off temporarily (FALSE)
if (pOpponent->bVisible == -1)
{
pOpponent->ubFadeLevel = gpWorldLevelData[ pOpponent->sGridNo ].pRoofHead->ubShadeLevel;
// then locate to him and set his locator flag
bDoLocate = TRUE;
//rain
if( gfLightningInProgress ) gfHaveSeenSomeone = TRUE;
//end rain
}
else
// make opponent visible (to us)
// must do this BEFORE the locate since it checks for visibility
pOpponent->bVisible = TRUE;
//ATE: Cancel any fading going on!
// ATE: Added for fade in.....
if ( pOpponent->fBeginFade == 1 || pOpponent->fBeginFade == 2 )
{
pOpponent->ubFadeLevel = gpWorldLevelData[ pOpponent->sGridNo ].pLandHead->ubShadeLevel;
pOpponent->fBeginFade = FALSE;
if ( pOpponent->bLevel > 0 && gpWorldLevelData[ pOpponent->sGridNo ].pRoofHead != NULL )
{
pOpponent->ubFadeLevel = gpWorldLevelData[ pOpponent->sGridNo ].pRoofHead->ubShadeLevel;
}
else
{
pOpponent->ubFadeLevel = gpWorldLevelData[ pOpponent->sGridNo ].pLandHead->ubShadeLevel;
}
// Set levelnode shade level....
if ( pOpponent->pLevelNode )
{
pOpponent->pLevelNode->ubShadeLevel = pOpponent->ubFadeLevel;
}
}
// Set levelnode shade level....
if ( pOpponent->pLevelNode )
{
pOpponent->pLevelNode->ubShadeLevel = pOpponent->ubFadeLevel;
}
}
#ifdef TESTOPPLIST
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String("!!! ID %d (%S) MAKING %d VISIBLE",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3, String("!!! ID %d (%S) MAKING %d VISIBLE",pSoldier->ubID,pSoldier->name,pOpponent->ubID) );
#endif
// update variable for STATUS screen
//pOpponent->bLastKnownLife = pOpponent->life;
// update variable for STATUS screen
//pOpponent->bLastKnownLife = pOpponent->life;
if (bDoLocate)
{
if (bDoLocate)
{
// Change his anim speed!
SetSoldierAniSpeed( pOpponent );
// Change his anim speed!
SetSoldierAniSpeed( pOpponent );
// if show enemies is ON, then we must have already revealed these roofs
// and we're also following his movements, so don't bother sliding
if (!gbShowEnemies)
{
//DoSoldierRoofs(pOpponent);
// if show enemies is ON, then we must have already revealed these roofs
// and we're also following his movements, so don't bother sliding
if (!gbShowEnemies)
{
//DoSoldierRoofs(pOpponent);
// slide to the newly seen opponent, and if appropriate, start his locator
//SlideToMe = oppPtr->guynum;
}
// slide to the newly seen opponent, and if appropriate, start his locator
//SlideToMe = oppPtr->guynum;
}
//LastOpponentLocatedTo = oppPtr->guynum;
//LastOpponentLocatedTo = oppPtr->guynum;
/*
#ifdef RECORDNET
fprintf(NetDebugFile,"\tManSeesMan - LOCATE\n");
#endif
*/
/*
#ifdef RECORDNET
fprintf(NetDebugFile,"\tManSeesMan - LOCATE\n");
#endif
*/
if ( gTacticalStatus.uiFlags & TURNBASED && ( ( gTacticalStatus.uiFlags & INCOMBAT ) | gTacticalStatus.fVirginSector ) )
{
if (!pOpponent->bNeutral && (pSoldier->bSide != pOpponent->bSide))
{
if ( gTacticalStatus.uiFlags & TURNBASED && ( ( gTacticalStatus.uiFlags & INCOMBAT ) | gTacticalStatus.fVirginSector ) )
{
if (!pOpponent->bNeutral && (pSoldier->bSide != pOpponent->bSide))
{
//SlideTo(0,pOpponent->ubID, pSoldier->ubID, SETLOCATOR);
//rain
SlideTo(0,pOpponent->ubID, pSoldier->ubID, SETLOCATORFAST);
//end rain
}
}
}
}
}
}
}
}
else if (!PTR_OURTEAM)
{
// ATE: Check stance, change to threatending
ReevaluateEnemyStance( pSoldier, pSoldier->usAnimState );
// ATE: Check stance, change to threatending
ReevaluateEnemyStance( pSoldier, pSoldier->usAnimState );
}
}