bug fixes from Overhaul:

- Data type changes 
- Templates removed

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-05-09 13:16:37 +00:00
parent 61d6152ce5
commit 0530b53b9c
256 changed files with 2000 additions and 2228 deletions
+35 -35
View File
@@ -102,7 +102,7 @@ void DebugAI( STR szOutput )
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, szOutput );
if ((DebugFile = fopen( "aidebug.txt", "a+t" )) != NULL)
{
fputs( reinterpret_cast<const char *>(szOutput), DebugFile );
fputs( szOutput, DebugFile );
fputs( "\n", DebugFile );
fclose( DebugFile );
}
@@ -234,7 +234,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because set to moved", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because set to moved", pSoldier->ubID ) );
}
#endif
// this guy doesn't get to act!
@@ -284,7 +284,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because not a boxer", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because not a boxer", pSoldier->ubID ) );
}
#endif
EndAIGuysTurn( pSoldier );
@@ -302,7 +302,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because bad life/inactive", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because bad life/inactive", pSoldier->ubID ) );
}
#endif
@@ -324,7 +324,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because asleep and no scheduled action", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because asleep and no scheduled action", pSoldier->ubID ) );
}
#endif
@@ -339,7 +339,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because out of sector and no scheduled action", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because out of sector and no scheduled action", pSoldier->ubID ) );
}
#endif
@@ -353,7 +353,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because is vehicle or robot", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because is vehicle or robot", pSoldier->ubID ) );
}
#endif
@@ -372,7 +372,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because unconscious", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because unconscious", pSoldier->ubID ) );
}
#endif
@@ -483,7 +483,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier )
// display deadlock message
gfUIInDeadlock = TRUE;
gUIDeadlockedSoldier = pSoldier->ubID;
DebugAI( (STR) String("DEADLOCK soldier %d action %s ABC %d", pSoldier->ubID, gzActionStr[pSoldier->bAction], gTacticalStatus.ubAttackBusyCount ) );
DebugAI( String("DEADLOCK soldier %d action %s ABC %d", pSoldier->ubID, gzActionStr[pSoldier->bAction], gTacticalStatus.ubAttackBusyCount ) );
#else
// If we are in beta version, also report message!
@@ -709,7 +709,7 @@ void EndAIGuysTurn( SOLDIERTYPE *pSoldier )
#ifdef TESTAICONTROL
if (!(gTacticalStatus.uiFlags & DEMOMODE))
DebugAI( (STR)String("Ending control for %d", pSoldier->ubID ) );
DebugAI( String("Ending control for %d", pSoldier->ubID ) );
#endif
// find the next AI guy
@@ -721,7 +721,7 @@ void EndAIGuysTurn( SOLDIERTYPE *pSoldier )
}
// We are at the end, return control to next team
DebugAI( (STR)String("Ending AI turn\n" ) );
DebugAI( String("Ending AI turn\n" ) );
EndAITurn();
}
@@ -752,7 +752,7 @@ void EndAIDeadlock(void)
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because breaking deadlock", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because breaking deadlock", pSoldier->ubID ) );
}
#endif
@@ -798,7 +798,7 @@ void StartNPCAI(SOLDIERTYPE *pSoldier)
#ifdef TESTAICONTROL
if (!(gTacticalStatus.uiFlags & DEMOMODE))
DebugAI( (STR)String("Giving control to %d", pSoldier->ubID ) );
DebugAI( String("Giving control to %d", pSoldier->ubID ) );
#endif
gTacticalStatus.uiTimeSinceMercAIStart = GetJA2Clock();
@@ -1270,7 +1270,7 @@ void NPCDoesNothing(SOLDIERTYPE *pSoldier)
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because doing no-action", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because doing no-action", pSoldier->ubID ) );
}
#endif
@@ -1288,7 +1288,7 @@ void CancelAIAction(SOLDIERTYPE *pSoldier, UINT8 ubForce)
if (SkipCoverCheck)
{
STR tempstr;
sprintf((CHAR *) tempstr, "CancelAIAction: SkipCoverCheck turned OFF\n",0 );
sprintf( tempstr, "CancelAIAction: SkipCoverCheck turned OFF\n",0 );
DebugAI (tempstr);
}
#endif
@@ -1345,7 +1345,7 @@ void ActionTimeoutExceeded(SOLDIERTYPE *pSoldier, UCHAR alreadyFreedUp)
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"ActionInProgress - ERROR: %s's timeout limit exceeded. Action #%d (%d)",
sprintf(tempstr,"ActionInProgress - ERROR: %s's timeout limit exceeded. Action #%d (%d)",
pSoldier->name,pSoldier->bAction,pSoldier->usActionData);
#ifdef RECORDNET
@@ -1508,7 +1508,7 @@ void MarkDetectableMines(SOLDIERTYPE *pSoldier)
if (MarkedNPCMines)
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"MarkDetectableMines: ERROR - mines still marked! Guynum %d",pSoldier->ubID);
sprintf(tempstr,"MarkDetectableMines: ERROR - mines still marked! Guynum %d",pSoldier->ubID);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n\n",tempstr);
@@ -1754,7 +1754,7 @@ void TurnBasedHandleNPCAI(SOLDIERTYPE *pSoldier)
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr, "HandleManAI - DECIDING for guynum %d(%s) at gridno %d, APs %d\n",
sprintf( tempstr, "HandleManAI - DECIDING for guynum %d(%s) at gridno %d, APs %d\n",
pSoldier->ubID,pSoldier->name,pSoldier->sGridNo,pSoldier->bActionPoints );
DebugAI ( tempstr );
#endif
@@ -2016,11 +2016,11 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
#ifdef TESTAICONTROL
if (gfTurnBasedAI || gTacticalStatus.fAutoBandageMode)
{
DebugAI( (STR)String( "%d does %s (a.d. %d) in %d with %d APs left", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, pSoldier->sGridNo, pSoldier->bActionPoints ) );
DebugAI( String( "%d does %s (a.d. %d) in %d with %d APs left", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, pSoldier->sGridNo, pSoldier->bActionPoints ) );
}
#endif
DebugAI( (STR)String( "%d does %s (a.d. %d) at time %ld", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, GetJA2Clock() ) );
DebugAI( String( "%d does %s (a.d. %d) at time %ld", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, GetJA2Clock() ) );
switch (pSoldier->bAction)
{
@@ -2052,7 +2052,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr, "ExecuteAction: SkipCoverCheck ON\n" );
sprintf( tempstr, "ExecuteAction: SkipCoverCheck ON\n" );
DebugAI (tempstr);
#endif
@@ -2064,7 +2064,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
if (!StartTurn(pSoldier,pSoldier->usActionData,FASTTURN))
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"ERROR: %s tried TURN to direction %d, StartTurn failed, action %d CANCELED",
sprintf(tempstr,"ERROR: %s tried TURN to direction %d, StartTurn failed, action %d CANCELED",
pSoldier->name,pSoldier->usActionData,pSoldier->bAction);
PopMessage(tempstr);
#endif
@@ -2152,7 +2152,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
// check for loop
else if ( pSoldier->usActionData == pSoldier->sLastTwoLocations[1] && pSoldier->sGridNo == pSoldier->sLastTwoLocations[0] )
{
DebugAI( (STR)String( "%d in movement loop, aborting turn", pSoldier->ubID ) );
DebugAI( String( "%d in movement loop, aborting turn", pSoldier->ubID ) );
// loop found!
ActionDone( pSoldier );
@@ -2279,7 +2279,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
{
#ifdef BETAVERSION
// this should NEVER happen, indicates AI picked an illegal spot!
sprintf((CHAR *)tempstr,"ExecuteAction: ERROR - %s tried MOVE to gridno %d, NewDest failed, action %d CANCELED",
sprintf(tempstr,"ExecuteAction: ERROR - %s tried MOVE to gridno %d, NewDest failed, action %d CANCELED",
pSoldier->name,pSoldier->usActionData,pSoldier->bAction);
#ifdef RECORDNET
@@ -2288,7 +2288,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
PopMessage(tempstr);
sprintf((CHAR *)tempstr,"BLACK-LISTING gridno %d for %s",pSoldier->usActionData,pSoldier->name);
sprintf(tempstr,"BLACK-LISTING gridno %d for %s",pSoldier->usActionData,pSoldier->name);
PopMessage(tempstr);
SaveGame(ERROR_SAVE);
@@ -2296,7 +2296,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
// temporarily black list this gridno to stop enemy from going there
pSoldier->sBlackList = (INT16) pSoldier->usActionData;
DebugAI( (STR)String( "Setting blacklist for %d to %d", pSoldier->ubID, pSoldier->sBlackList ) );
DebugAI( String( "Setting blacklist for %d to %d", pSoldier->ubID, pSoldier->sBlackList ) );
CancelAIAction(pSoldier,FORCE);
return(FALSE); // nothing is in progress
@@ -2354,7 +2354,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
#ifdef TESTVERSION
if (pSoldier->bAction == AI_ACTION_KNIFE_MOVE)
{
sprintf((CHAR *)tempstr,"TEST MSG: %s is about to go stab %s. MAKE SURE HE DOES!",
sprintf(tempstr,"TEST MSG: %s is about to go stab %s. MAKE SURE HE DOES!",
pSoldier->name,
ExtMen[WhoIsThere(pSoldier->usActionData)].name);
@@ -2370,14 +2370,14 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
{
if ( iRetCode != ITEM_HANDLE_BROKEN ) // if the item broke, this is 'legal' and doesn't need reporting
{
DebugAI( (STR)String( "AI %d got error code %ld from HandleItem, doing action %d, has %d APs... aborting deadlock!", pSoldier->ubID, iRetCode, pSoldier->bAction, pSoldier->bActionPoints ) );
DebugAI( String( "AI %d got error code %ld from HandleItem, doing action %d, has %d APs... aborting deadlock!", pSoldier->ubID, iRetCode, pSoldier->bAction, pSoldier->bActionPoints ) );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"AI %d got error code %ld from HandleItem, doing action %d... aborting deadlock!", pSoldier->ubID, iRetCode, pSoldier->bAction );
}
CancelAIAction( pSoldier, FORCE);
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because of error from HandleItem", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because of error from HandleItem", pSoldier->ubID ) );
}
#endif
EndAIGuysTurn( pSoldier );
@@ -2464,7 +2464,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
SkipCoverCheck = TRUE;
#ifdef DEBUGDECISIONS
sprintf((CHAR *) tempstr, "ExecuteAction: SkipCoverCheck ON\n" );
sprintf( tempstr, "ExecuteAction: SkipCoverCheck ON\n" );
DebugAI (tempstr);
#endif
SendChangeSoldierStanceEvent( pSoldier, (UINT8) pSoldier->usActionData );
@@ -2512,7 +2512,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because of error from HandleItem", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because of error from HandleItem", pSoldier->ubID ) );
}
#endif
EndAIGuysTurn( pSoldier );
@@ -2547,7 +2547,7 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because of error opening door", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because of error opening door", pSoldier->ubID ) );
}
#endif
EndAIGuysTurn( pSoldier );
@@ -2787,7 +2787,7 @@ void ManChecksOnFriends(SOLDIERTYPE *pSoldier)
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s sees %s on alert, goes to RED ALERT!",pSoldier->name,pFriend->name );
sprintf(tempstr,"%s sees %s on alert, goes to RED ALERT!",pSoldier->name,pFriend->name );
AIPopMessage(tempstr);
#endif
@@ -2804,7 +2804,7 @@ void ManChecksOnFriends(SOLDIERTYPE *pSoldier)
(pSoldier->bAlertStatus < STATUS_YELLOW))
{
#ifdef TESTVERSION
sprintf((CHAR *)tempstr,"TEST MSG: %s sees %s listening, goes to YELLOW ALERT!",pSoldier->name,ExtMen[pFriend->ubID].name);
sprintf(tempstr,"TEST MSG: %s sees %s listening, goes to YELLOW ALERT!",pSoldier->name,ExtMen[pFriend->ubID].name);
PopMessage(tempstr);
#endif
pSoldier->bAlertStatus = STATUS_YELLOW; // also get suspicious
@@ -2862,7 +2862,7 @@ void HandleAITacticalTraversal( SOLDIERTYPE * pSoldier )
#ifdef TESTAICONTROL
if (gfTurnBasedAI)
{
DebugAI( (STR)String("Ending turn for %d because traversing out", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because traversing out", pSoldier->ubID ) );
}
#endif
+15 -15
View File
@@ -493,7 +493,7 @@ BOOLEAN IsActionAffordable(SOLDIERTYPE *pSoldier)
if (ptsNeeded > pSoldier->bActionPoints)
{
/*
sprintf((CHAR *)tempstr,"AI ERROR: %s has insufficient points for attack action %d at grid %d",
sprintf(tempstr,"AI ERROR: %s has insufficient points for attack action %d at grid %d",
pSoldier->name,pSoldier->bAction,pSoldier->usActionData);
PopMessage(tempstr);
*/
@@ -1587,7 +1587,7 @@ INT16 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbin
// if we can get there
if (sPathCost != 0)
{
//sprintf((CHAR *)tempstr,"Path cost to friend %s's location is %d",pFriend->name,pathCost);
//sprintf(tempstr,"Path cost to friend %s's location is %d",pFriend->name,pathCost);
//PopMessage(tempstr);
if (sPathCost < sShortestPath)
@@ -1911,7 +1911,7 @@ INT8 CalcMorale(SOLDIERTYPE *pSoldier)
sOppThreatValue = (iPercent * CalcManThreatValue(pOpponent,pSoldier->sGridNo,FALSE,pSoldier)) / 100;
//sprintf((CHAR *)tempstr,"Known opponent %s, opplist status %d, percent %d, threat = %d",
//sprintf(tempstr,"Known opponent %s, opplist status %d, percent %d, threat = %d",
// ExtMen[pOpponent->ubID].name,ubMostRecentOpplistValue,ubPercent,sOppThreatValue);
//PopMessage(tempstr);
@@ -1967,7 +1967,7 @@ INT8 CalcMorale(SOLDIERTYPE *pSoldier)
sFrndThreatValue = (iPercent * CalcManThreatValue(pFriend,pOpponent->sGridNo,FALSE,pSoldier)) / 100;
//sprintf((CHAR *)tempstr,"Known by friend %s, opplist status %d, percent %d, threat = %d",
//sprintf(tempstr,"Known by friend %s, opplist status %d, percent %d, threat = %d",
// ExtMen[pFriend->ubID].name,pFriend->bOppList[pOpponent->ubID],ubPercent,sFrndThreatValue);
//PopMessage(tempstr);
@@ -2087,7 +2087,7 @@ INT8 CalcMorale(SOLDIERTYPE *pSoldier)
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr, "Morale = %d (category %d)\n",
sprintf( tempstr, "Morale = %d (category %d)\n",
pSoldier->bMorale,bMoraleCategory);
DebugAI (tempstr);
#endif
@@ -2210,14 +2210,14 @@ INT32 CalcManThreatValue( SOLDIERTYPE *pEnemy, INT16 sMyGrid, UINT8 ubReduceForC
iThreatValue = 1;
}
//sprintf((CHAR *)tempstr,"%s's iThreatValue = ",pEnemy->name);
//sprintf(tempstr,"%s's iThreatValue = ",pEnemy->name);
//NumMessage(tempstr,iThreatValue);
#ifdef BETAVERSION // unnecessary for real release
// NOTE: maximum is about 200 for a healthy Mike type with a mortar!
if (iThreatValue > 250)
{
sprintf((CHAR *)tempstr,"CalcManThreatValue: WARNING - %d has a very high threat value of %d",pEnemy->ubID,iThreatValue);
sprintf(tempstr,"CalcManThreatValue: WARNING - %d has a very high threat value of %d",pEnemy->ubID,iThreatValue);
#ifdef RECORDNET
fprintf(NetDebugFile,"\t%s\n",tempstr);
@@ -2289,7 +2289,7 @@ INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT16 * pusFromGridNo)
return(MAX_ROAMING_RANGE);
default:
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"%s has invalid orders = %d",pSoldier->name,pSoldier->bOrders);
sprintf(tempstr,"%s has invalid orders = %d",pSoldier->name,pSoldier->bOrders);
PopMessage(tempstr);
#endif
return(0);
@@ -2517,27 +2517,27 @@ BOOLEAN ArmySeesOpponents( void )
#ifdef DEBUGDECISIONS
void AIPopMessage ( STR16 str )
{
DebugAI((STR)str);
DebugAI(str);
}
void AIPopMessage ( const char* str )
void AIPopMessage ( const STR8 str )
{
STR tempstr;
sprintf((CHAR *) tempstr,"%s", str);
sprintf( tempstr,"%s", str);
DebugAI(tempstr);
}
void AINumMessage(const char* str, INT32 num)
void AINumMessage(const STR8 str, INT32 num)
{
STR tempstr;
sprintf((CHAR *) tempstr,"%s %d", str, num);
sprintf( tempstr,"%s %d", str, num);
DebugAI(tempstr);
}
void AINameMessage(SOLDIERTYPE * pSoldier,const char* str,INT32 num)
void AINameMessage(SOLDIERTYPE * pSoldier,const STR8 str,INT32 num)
{
STR tempstr;
sprintf((CHAR *) tempstr,"%d %s %d",pSoldier->name , str, num);
sprintf( tempstr,"%d %s %d",pSoldier->name , str, num);
DebugAI( tempstr );
}
#endif
+5 -5
View File
@@ -282,7 +282,7 @@ void CalcBestShot(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestShot, BOOLEAN shootUns
// ExtMen[pOpponent->ubID].haveStats = TRUE;
//NumMessage("chance to Hit = ",ubChanceToHit);
//sprintf((CHAR *)tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//sprintf(tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//PopMessage(tempstr);
iHitRate = (pSoldier->bActionPoints * ubChanceToHit) / (ubRawAPCost + ubAimTime);
@@ -1133,7 +1133,7 @@ void CalcBestThrow(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
pBestThrow->ubAPCost = ubMinAPcost + ubMaxPossibleAimTime;
pBestThrow->bTargetLevel = bOpponentLevel[ubLoop];
//sprintf((CHAR *)tempstr,"new best THROW AttackValue = %d at grid #%d",iAttackValue/100000,gridno);
//sprintf(tempstr,"new best THROW AttackValue = %d at grid #%d",iAttackValue/100000,gridno);
//PopMessage(tempstr);
}
}
@@ -1296,7 +1296,7 @@ void CalcBestStab(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab, BOOLEAN fBladeAt
ubChanceToHit = MAXCHANCETOHIT;
//NumMessage("chance to Hit = ",ubChanceToHit);
//sprintf((CHAR *)tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//sprintf(tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//PopMessage(tempstr);
if (ubRawAPCost < 1)
@@ -1472,7 +1472,7 @@ void CalcTentacleAttack(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestStab )
ubChanceToHit = MAXCHANCETOHIT;
//NumMessage("chance to Hit = ",ubChanceToHit);
//sprintf((CHAR *)tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//sprintf(tempstr,"Vs. %s, at AimTime %d, ubChanceToHit = %d",ExtMen[pOpponent->ubID].name,ubAimTime,ubChanceToHit);
//PopMessage(tempstr);
if (ubRawAPCost < 1)
@@ -2014,7 +2014,7 @@ INT8 CanNPCAttack(SOLDIERTYPE *pSoldier)
{
//LocateMember(pSoldier->ubID,SETLOCATOR); // locate to this NPC, don't center
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s can't attack! (not OKToAttack, Reason code = %d)",pSoldier->name,bCanAttack);
sprintf(tempstr,"%s can't attack! (not OKToAttack, Reason code = %d)",pSoldier->name,bCanAttack);
AIPopMessage(tempstr);
}
#endif
+18 -18
View File
@@ -216,7 +216,7 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -285,7 +285,7 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - RANDOM PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - RANDOM PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -347,7 +347,7 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
if (RandomFriendWithin(pSoldier))
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEK FRIEND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEK FRIEND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -403,7 +403,7 @@ INT8 CreatureDecideActionGreen( SOLDIERTYPE * pSoldier )
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - TURNS to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -495,7 +495,7 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
pSoldier->usActionData = ubNoiseDir;
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS NOISE to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS NOISE to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
//if ( InternalIsValidStance( pSoldier, (INT8) pSoldier->usActionData, ANIM_STAND ) )
@@ -564,7 +564,7 @@ INT8 CreatureDecideActionYellow( SOLDIERTYPE * pSoldier )
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - INVESTIGATING NOISE at grid %d, moving to %d",
sprintf(tempstr,"%s - INVESTIGATING NOISE at grid %d, moving to %d",
pSoldier->name,sNoiseGridNo,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -643,7 +643,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -689,7 +689,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s RESTS (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
sprintf(tempstr,"%s RESTS (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
AIPopMessage(tempstr);
#endif
@@ -765,7 +765,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
sprintf(tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
pSoldier->name,sClosestFriend,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -792,7 +792,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
#ifdef DEBUGDECISIONS
// do it!
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - SEEKING OPPONENT at grid %d, MOVING to %d",
sprintf(tempstr,"%s - SEEKING OPPONENT at grid %d, MOVING to %d",
pSoldier->name,sClosestDisturbance,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -868,7 +868,7 @@ INT8 CreatureDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1013,7 +1013,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - GASSED or LOW ON BREATH (%d), RUNNING AWAY to grid %d",pSoldier->name,pSoldier->bBreath,pSoldier->usActionData);
sprintf(tempstr,"%s - GASSED or LOW ON BREATH (%d), RUNNING AWAY to grid %d",pSoldier->name,pSoldier->bBreath,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1037,7 +1037,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
{
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1246,7 +1246,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
// get the minimum cost to attack with this knife
ubMinAPCost = MinAPsToAttack(pSoldier,pSoldier->sLastTarget,DONTADDTURNCOST);
//sprintf((CHAR *)tempstr,"%s - ubMinAPCost = %d",pSoldier->name,ubMinAPCost);
//sprintf(tempstr,"%s - ubMinAPCost = %d",pSoldier->name,ubMinAPCost);
//PopMessage(tempstr);
// if we can afford the minimum AP cost to stab with this knife weapon
@@ -1347,7 +1347,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr, "%d(%s) %s %d(%s) at gridno %d (%d APs aim)\n",
sprintf( tempstr, "%d(%s) %s %d(%s) at gridno %d (%d APs aim)\n",
pSoldier->ubID,pSoldier->name,
(ubBestAttackAction == AI_ACTION_FIRE_GUN)?"SHOOTS":((ubBestAttackAction == AI_ACTION_TOSS_PROJECTILE)?"TOSSES AT":"STABS"),
BestAttack.ubOpponent,ExtMen[BestAttack.ubOpponent].name,
@@ -1411,7 +1411,7 @@ INT8 CreatureDecideActionBlack( SOLDIERTYPE * pSoldier )
#ifdef DEBUGDECISIONS
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1491,7 +1491,7 @@ INT8 CreatureDecideAction( SOLDIERTYPE *pSoldier )
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr, "DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData );
sprintf( tempstr, "DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData );
DebugAI(tempstr);
#endif
@@ -1631,7 +1631,7 @@ void CreatureDecideAlertStatus( SOLDIERTYPE *pSoldier )
// if (!pSoldier->human)
// {
STR16 tempstr;
sprintf((CHAR *)tempstr,"%s's Alert Status changed from %d to %d",
sprintf(tempstr,"%s's Alert Status changed from %d to %d",
pSoldier->name ,bOldStatus,pSoldier->bAlertStatus);
AIPopMessage(tempstr);
// }
+36 -36
View File
@@ -546,7 +546,7 @@ INT8 DecideActionBoxerEnteringRing(SOLDIERTYPE *pSoldier)
pSoldier->usActionData = ubDesiredMercDir;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS CLOSEST PC to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS CLOSEST PC to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -606,7 +606,7 @@ INT8 DecideActionNamedNPC( SOLDIERTYPE * pSoldier )
pSoldier->usActionData = ubDesiredMercDir;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS CLOSEST PC to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS CLOSEST PC to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -885,7 +885,7 @@ BOOLEAN fCivilian = (PTR_CIVILIAN && (pSoldier->ubCivilianGroup == NON_CIV_GROUP
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1050,7 +1050,7 @@ BOOLEAN fCivilian = (PTR_CIVILIAN && (pSoldier->ubCivilianGroup == NON_CIV_GROUP
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - RANDOM PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - RANDOM PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1114,7 +1114,7 @@ BOOLEAN fCivilian = (PTR_CIVILIAN && (pSoldier->ubCivilianGroup == NON_CIV_GROUP
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEK FRIEND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEK FRIEND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1230,7 +1230,7 @@ DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DecideActionGreen: Snipers like to raise
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1353,7 +1353,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
{
pSoldier->usActionData = ubNoiseDir;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS NOISE to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS NOISE to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
if ( pSoldier->bOrders == SNIPER )
@@ -1576,7 +1576,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - INVESTIGATING NOISE at grid %d, moving to %d",
sprintf(tempstr,"%s - INVESTIGATING NOISE at grid %d, moving to %d",
pSoldier->name,sNoiseGridNo,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1716,7 +1716,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
sprintf(tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
pSoldier->name,sClosestFriend,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1812,7 +1812,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TAKING COVER at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TAKING COVER at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -1849,7 +1849,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
if (!fCivilian && !PTR_CROUCHED && IsValidStance( pSoldier, ANIM_CROUCH ) )
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s CROUCHES (STATUS YELLOW)",pSoldier->name);
sprintf(tempstr,"%s CROUCHES (STATUS YELLOW)",pSoldier->name);
AIPopMessage(tempstr);
#endif
@@ -1974,7 +1974,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -2377,7 +2377,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: crouch and rest if running out
if (!fCivilian && !PTR_CROUCHED && IsValidStance( pSoldier, ANIM_CROUCH ) && gAnimControl[ pSoldier->usAnimState ].ubHeight != ANIM_PRONE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s CROUCHES, NEEDING REST (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
sprintf(tempstr,"%s CROUCHES, NEEDING REST (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
AIPopMessage(tempstr);
#endif
@@ -2390,7 +2390,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: crouch and rest if running out
}
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s RESTS (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
sprintf(tempstr,"%s RESTS (STATUS RED), breath = %d",pSoldier->name,pSoldier->bBreath);
AIPopMessage(tempstr);
#endif
@@ -2418,7 +2418,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: calculate morale");
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -2724,7 +2724,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
{
#ifdef DEBUGDECISIONS
// do it!
sprintf((CHAR *)tempstr,"%s - SEEKING OPPONENT at grid %d, MOVING to %d",
sprintf(tempstr,"%s - SEEKING OPPONENT at grid %d, MOVING to %d",
pSoldier->name,sClosestDisturbance,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -2934,7 +2934,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
sprintf(tempstr,"%s - SEEKING FRIEND at %d, MOVING to %d",
pSoldier->name,sClosestFriend,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -3055,7 +3055,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -3080,7 +3080,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s CROUCHES (STATUS RED)",pSoldier->name);
sprintf(tempstr,"%s CROUCHES (STATUS RED)",pSoldier->name);
AIPopMessage(tempstr);
#endif
@@ -3145,7 +3145,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
pSoldier->usActionData = ubOpponentDir;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
if ( pSoldier->bOrders == SNIPER )
@@ -3195,7 +3195,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
pSoldier->usActionData = ubOpponentDir;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS TOWARDS CLOSEST ENEMY to face direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -3306,7 +3306,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?");
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s CROUCHES (STATUS RED)",pSoldier->name );
sprintf(tempstr,"%s CROUCHES (STATUS RED)",pSoldier->name );
AIPopMessage(tempstr);
#endif
@@ -3525,7 +3525,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - GASSED or LOW ON BREATH (%d), RUNNING AWAY to grid %d",pSoldier->name,pSoldier->bBreath,pSoldier->usActionData);
sprintf(tempstr,"%s - GASSED or LOW ON BREATH (%d), RUNNING AWAY to grid %d",pSoldier->name,pSoldier->bBreath,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -3559,7 +3559,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - SEEKING NEAREST UNGASSED LAND at grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -3574,7 +3574,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - NO LAND NEAR, RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - NO LAND NEAR, RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -4168,7 +4168,7 @@ bCanAttack = FALSE;
#ifdef DEBUGDECISIONS
STR tempstr="";
sprintf((CHAR *) tempstr, "%s - CHOICE: iOffense = %d, iDefense = %d\n",
sprintf( tempstr, "%s - CHOICE: iOffense = %d, iDefense = %d\n",
pSoldier->name,iOffense,iDefense);
DebugAI( tempstr );
#endif
@@ -4237,7 +4237,7 @@ bCanAttack = FALSE;
pSoldier->usActionData = bDirection;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -4491,7 +4491,7 @@ bCanAttack = FALSE;
#ifdef DEBUGDECISIONS
STR tempstr="";
sprintf((CHAR *) tempstr,
sprintf( tempstr,
"%d(%s) %s %d(%s) at gridno %d (%d APs aim)\n",
pSoldier->ubID,pSoldier->name,
(ubBestAttackAction == AI_ACTION_FIRE_GUN)?"SHOOTS":((ubBestAttackAction == AI_ACTION_TOSS_PROJECTILE)?"TOSSES AT":"STABS"),
@@ -4597,7 +4597,7 @@ bCanAttack = FALSE;
{
#ifdef DEBUGDECISIONS
STR tempstr="";
sprintf ((CHAR *) tempstr,"%s - TAKING COVER at gridno %d (%d%% better)\n",
sprintf ( tempstr,"%s - TAKING COVER at gridno %d (%d%% better)\n",
pSoldier->name,sBestCover,iCoverPercentBetter);
DebugAI( tempstr ) ;
#endif
@@ -4624,7 +4624,7 @@ bCanAttack = FALSE;
if (pSoldier->usActionData != NOWHERE)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - RUNNING AWAY to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -4704,7 +4704,7 @@ bCanAttack = FALSE;
pSoldier->usNextActionData = pSoldier->usActionData;
pSoldier->usActionData = bDirection;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
return(AI_ACTION_CHANGE_FACING);
@@ -4758,7 +4758,7 @@ bCanAttack = FALSE;
pSoldier->usActionData = bDirection;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - TURNS to face CLOSEST OPPONENT in direction %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -4996,8 +4996,8 @@ INT8 DecideAction(SOLDIERTYPE *pSoldier)
#ifdef DEBUGDECISIONS
sprintf((CHAR *) tempstr,"DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData);
DebugAI((STR) tempstr );
sprintf( tempstr,"DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData);
DebugAI( tempstr );
#endif
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"DecideAction done");
@@ -5015,7 +5015,7 @@ INT8 DecideActionEscort(SOLDIERTYPE *pSoldier)
if (pSoldier->usActionData != NOWHERE && (pSoldier->sGridNo != pSoldier->usActionData))
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - ESCORTED NPC GOING to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - ESCORTED NPC GOING to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -5180,7 +5180,7 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier )
#ifdef DEBUGDECISIONS
// don't report status changes for human-controlled mercs
sprintf((CHAR *)tempstr,"%s's Alert Status changed from %d to %d",
sprintf(tempstr,"%s's Alert Status changed from %d to %d",
pSoldier->name,bOldStatus,pSoldier->bAlertStatus);
AIPopMessage(tempstr);
#endif
+10 -10
View File
@@ -55,7 +55,7 @@ INT32 CalcPercentBetter(INT32 iOldValue, INT32 iNewValue, INT32 iOldScale, INT32
if (iValueChange <= 0)
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"CalcPercentBetter: ERROR - invalid valueChange = %d",valueChange);
sprintf(tempstr,"CalcPercentBetter: ERROR - invalid valueChange = %d",valueChange);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n\n",tempstr);
@@ -74,7 +74,7 @@ INT32 CalcPercentBetter(INT32 iOldValue, INT32 iNewValue, INT32 iOldScale, INT32
if (iScaleSum <= 0)
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"CalcPercentBetter: ERROR - invalid scaleSum = %d",iScaleSum);
sprintf(tempstr,"CalcPercentBetter: ERROR - invalid scaleSum = %d",iScaleSum);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n\n",tempstr);
@@ -777,7 +777,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
// add this opponent's cover value to our current total cover value
iCurrentCoverValue += CalcCoverValue(pSoldier,pSoldier->sGridNo,iMyThreatValue,pSoldier->bActionPoints,uiLoop,Threat[uiLoop].iOrigRange,morale,&iCurrentScale);
}
//sprintf((CHAR *)tempstr,"iCurrentCoverValue after opponent %d is now %d",iLoop,iCurrentCoverValue);
//sprintf(tempstr,"iCurrentCoverValue after opponent %d is now %d",iLoop,iCurrentCoverValue);
//PopMessage(tempstr);
}
@@ -824,7 +824,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
#ifdef DEBUGDECISIONS
STR tempstr="";
sprintf((CHAR *) tempstr, "FBNC: CURRENT iCoverValue = %d\n",iCurrentCoverValue );
sprintf( tempstr, "FBNC: CURRENT iCoverValue = %d\n",iCurrentCoverValue );
DebugAI( tempstr );
#endif
@@ -960,7 +960,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
uiLoop,iThreatRange,morale,&iCoverScale);
}
//sprintf((CHAR *)tempstr,"iCoverValue after opponent %d is now %d",iLoop,iCoverValue);
//sprintf(tempstr,"iCoverValue after opponent %d is now %d",iLoop,iCoverValue);
//PopMessage(tempstr);
}
@@ -1029,7 +1029,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr,"FBNC: NEW BEST iCoverValue at gridno %d is %d\n",sGridNo,iCoverValue );
sprintf( tempstr,"FBNC: NEW BEST iCoverValue at gridno %d is %d\n",sGridNo,iCoverValue );
DebugAI( tempstr );
#endif
// remember it instead
@@ -1081,7 +1081,7 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
{
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *) tempstr,"Found Cover: current %ld, best %ld, %%%%Better %ld\n", iCurrentCoverValue,iBestCoverValue,*piPercentBetter );
sprintf( tempstr,"Found Cover: current %ld, best %ld, %%%%Better %ld\n", iCurrentCoverValue,iBestCoverValue,*piPercentBetter );
DebugAI( tempstr );
#endif
@@ -1937,7 +1937,7 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
if (sBestSpot != NOWHERE)
{
DebugAI( (STR)String( "%d decides to pick up %S", pSoldier->ubID, ItemNames[ gWorldItems[ iBestItemIndex ].o.usItem ] ) );
DebugAI( String( "%d decides to pick up %S", pSoldier->ubID, ItemNames[ gWorldItems[ iBestItemIndex ].o.usItem ] ) );
if (Item[gWorldItems[ iBestItemIndex ].o.usItem].usItemClass == IC_GUN)
{
if (FindBetterSpotForItem( pSoldier, HANDPOS ) == FALSE)
@@ -1949,14 +1949,14 @@ INT8 SearchForItems( SOLDIERTYPE * pSoldier, INT8 bReason, UINT16 usItem )
if (pSoldier->inv[HANDPOS].fFlags & OBJECT_UNDROPPABLE)
{
// destroy this item!
DebugAI( (STR)String( "%d decides he must drop %S first so destroys it", pSoldier->ubID, ItemNames[ pSoldier->inv[HANDPOS].usItem ] ) );
DebugAI( String( "%d decides he must drop %S first so destroys it", pSoldier->ubID, ItemNames[ pSoldier->inv[HANDPOS].usItem ] ) );
DeleteObj( &(pSoldier->inv[HANDPOS]) );
DeductPoints( pSoldier, AP_PICKUP_ITEM, 0 );
}
else
{
// we want to drop this item!
DebugAI( (STR)String( "%d decides he must drop %S first", pSoldier->ubID, ItemNames[ pSoldier->inv[HANDPOS].usItem ] ) );
DebugAI( String( "%d decides he must drop %S first", pSoldier->ubID, ItemNames[ pSoldier->inv[HANDPOS].usItem ] ) );
pSoldier->bNextAction = AI_ACTION_PICKUP_ITEM;
pSoldier->usNextActionData = sBestSpot;
+12 -12
View File
@@ -139,7 +139,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
{
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *)tempstr, "%d CONTINUES MOVEMENT to gridno %d...\n", pSoldier->ubID,sGridno );
sprintf(tempstr, "%d CONTINUES MOVEMENT to gridno %d...\n", pSoldier->ubID,sGridno );
DebugAI( tempstr );
#endif
@@ -158,7 +158,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
else
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"TryToResumeMovement: ERROR - NewDest failed for %s, action CANCELED",pSoldier->name);
sprintf(tempstr,"TryToResumeMovement: ERROR - NewDest failed for %s, action CANCELED",pSoldier->name);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n",tempstr);
@@ -179,7 +179,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT16 sGridno)
// legally if another soldier gets in the way between turns
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"TryToResumeMovement: %d can't continue to gridno %d, no longer legal!",pSoldier->ubID,gridno);
sprintf(tempstr,"TryToResumeMovement: %d can't continue to gridno %d, no longer legal!",pSoldier->ubID,gridno);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n",tempstr);
@@ -247,7 +247,7 @@ INT16 NextPatrolPoint(SOLDIERTYPE *pSoldier)
if ((pSoldier->bPatrolCnt < 1) || (pSoldier->bPatrolCnt >= MAXPATROLGRIDS))
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"NextPatrolPoint: ERROR: Invalid patrol count = %d for %s",pSoldier->bPatrolCnt,pSoldier->name);
sprintf(tempstr,"NextPatrolPoint: ERROR: Invalid patrol count = %d for %s",pSoldier->bPatrolCnt,pSoldier->name);
PopMessage(tempstr);
#endif
@@ -337,7 +337,7 @@ INT8 PointPatrolAI(SOLDIERTYPE *pSoldier)
// passed all tests - start moving towards next patrol point
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - POINT PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - POINT PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -427,7 +427,7 @@ INT8 RandomPointPatrolAI(SOLDIERTYPE *pSoldier)
// passed all tests - start moving towards next patrol point
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - POINT PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
sprintf(tempstr,"%s - POINT PATROL to grid %d",pSoldier->name,pSoldier->usActionData);
AIPopMessage(tempstr);
#endif
@@ -486,7 +486,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
}
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s wants to go towards %d (has range %d)",pSoldier->name,sDesGrid,usMaxDist);
sprintf(tempstr,"%s wants to go towards %d (has range %d)",pSoldier->name,sDesGrid,usMaxDist);
AIPopMessage(tempstr);
#endif
@@ -532,7 +532,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
if (!LegalNPCDestination(pSoldier,sDesGrid,ENSURE_PATH,NOWATER,fPathFlags))
{
#ifdef DEBUGDECISIONS
AIPopMessage((STR16)"destination Grid # itself not valid, looking around it");
AIPopMessage("destination Grid # itself not valid, looking around it");
#endif
if ( CREATURE_OR_BLOODCAT( pSoldier ) )
{
@@ -625,7 +625,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
if (sTempDest == sGoToGrid)
{
#ifdef BETAVERSION
sprintf((CHAR *)tempstr,"GoAsFarAsPossibleTowards: ERROR - gridno along valid route is invalid! guynum %d, sTempDest = %d",pSoldier->ubID,sTempDest);
sprintf(tempstr,"GoAsFarAsPossibleTowards: ERROR - gridno along valid route is invalid! guynum %d, sTempDest = %d",pSoldier->ubID,sTempDest);
#ifdef RECORDNET
fprintf(NetDebugFile,"\n\t%s\n",tempstr);
@@ -733,7 +733,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
if (sGoToGrid == pSoldier->sGridNo)
{
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s will go NOWHERE, path doesn't meet criteria",pSoldier->name);
sprintf(tempstr,"%s will go NOWHERE, path doesn't meet criteria",pSoldier->name);
AIPopMessage(tempstr);
#endif
@@ -859,13 +859,13 @@ void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier)
AdjustNoAPToFinishMove( pSoldier, TRUE );
// We'll keep his action intact though...
DebugAI( (STR)String("NO AP TO FINISH MOVE for %d (%d APs left)",pSoldier->ubID, pSoldier->bActionPoints) );
DebugAI( String("NO AP TO FINISH MOVE for %d (%d APs left)",pSoldier->ubID, pSoldier->bActionPoints) );
// if this dude is under AI right now, then pass the baton to someone else
if (pSoldier->uiStatusFlags & SOLDIER_UNDERAICONTROL)
{
#ifdef TESTAICONTROL
DebugAI( (STR)String("Ending turn for %d because out of APs for movement", pSoldier->ubID ) );
DebugAI( String("Ending turn for %d because out of APs for movement", pSoldier->ubID ) );
#endif
EndAIGuysTurn(pSoldier);
+2 -2
View File
@@ -1169,9 +1169,9 @@ BOOLEAN HandleNPCBeingGivenMoneyByPlayer( UINT8 ubNPC, UINT32 uiMoneyAmount, UIN
}
else
{
INT16 sTempString[ 100 ];
CHAR16 sTempString[ 100 ];
swprintf( (wchar_t *)sTempString, L"%ld", iCost - uiMoneyAmount - giHospitalTempBalance );
swprintf( sTempString, L"%ld", iCost - uiMoneyAmount - giHospitalTempBalance );
InsertDollarSignInToString( sTempString );
// not enough cash
+3 -3
View File
@@ -268,7 +268,7 @@ INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove)
if (pSoldier->bActionPoints >= AP_USE_REMOTE)
{
#ifdef TESTVERSION
sprintf((CHAR *)tempstr,"TEST MSG: %s - ACTIVATING his DETONATOR!",pSoldier->name);
sprintf(tempstr,"TEST MSG: %s - ACTIVATING his DETONATOR!",pSoldier->name);
PopMessage(tempstr);
#endif
// blow up all the PANIC bombs!
@@ -346,7 +346,7 @@ INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove)
pSoldier->usActionData = sPanicTriggerGridNo;
#ifdef TESTVERSION
sprintf((CHAR *)tempstr,"TEST MSG: %s - PULLS PANIC TRIGGER at grid %d",
sprintf(tempstr,"TEST MSG: %s - PULLS PANIC TRIGGER at grid %d",
pSoldier->name,pSoldier->usActionData);
PopMessage(tempstr);
#endif
@@ -372,7 +372,7 @@ INT8 PanicAI(SOLDIERTYPE *pSoldier, UINT8 ubCanMove)
pSoldier->bPathStored = TRUE;
#ifdef DEBUGDECISIONS
sprintf((CHAR *)tempstr,"%s - GETTING CLOSER to PANIC TRIGGER at grid %d (Trigger at %d)", pSoldier->name,pSoldier->usActionData,sPanicTriggerGridNo);
sprintf(tempstr,"%s - GETTING CLOSER to PANIC TRIGGER at grid %d (Trigger at %d)", pSoldier->name,pSoldier->usActionData,sPanicTriggerGridNo);
AIPopMessage(tempstr);
#endif
+1 -1
View File
@@ -38,7 +38,7 @@ UINT8 gubNPCDebugOutPutLevel = QD_OUTPUT_LEVEL_ALL;
//set the current output mode for either the NPC or the quest output
void ToggleQuestDebugModes( UINT8 ubType )
{
wchar_t sType[16];
CHAR16 sType[16];
UINT8 ubLevel;
if( ubType == QD_NPC_MSG )
+2 -2
View File
@@ -29,8 +29,8 @@ INT8 RTPlayerDecideAction( SOLDIERTYPE * pSoldier )
#ifdef DEBUGDECISIONS
STR tempstr;
sprintf((CHAR *)tempstr,"DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData);
DebugAI((STR) tempstr );
sprintf(tempstr,"DecideAction: selected action %d, actionData %d\n\n",bAction,pSoldier->usActionData);
DebugAI( tempstr );
#endif
return(bAction);