Space Viking's many mercs changes plus numerous generic bug fixes

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2498 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
SpaceViking
2009-01-15 01:26:13 +00:00
parent f64f58fbf8
commit f26095d86f
138 changed files with 3493 additions and 3265 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ void DeleteAIListEntry( AILIST * pEntry )
UINT8 FindEmptyAIListEntry( void )
{
UINT8 ubLoop;
UINT8 ubLoop;
for ( ubLoop = 0; ubLoop < AI_LIST_SIZE; ubLoop++ )
{
+2 -2
View File
@@ -950,8 +950,8 @@ INT16 FindAdjacentSpotBeside(SOLDIERTYPE *pSoldier, INT16 sGridno)
UINT8 GetMostThreateningOpponent( SOLDIERTYPE *pSoldier )
{
UINT32 uiLoop;
INT32 iThreatVal,iMinThreat = 30000;
SOLDIERTYPE *pTargetSoldier;
INT32 iThreatVal,iMinThreat = 30000;
SOLDIERTYPE *pTargetSoldier;
UINT8 ubTargetSoldier = NOBODY;
// Loop through all mercs
+2 -2
View File
@@ -1286,7 +1286,7 @@ INT16 ClosestPC( SOLDIERTYPE *pSoldier, INT16 * psDistance )
// NOTE: skips EPCs!
UINT8 ubLoop;
UINT8 ubLoop;
SOLDIERTYPE *pTargetSoldier;
INT16 sMinDist = (INT16)WORLD_MAX;
INT16 sDist;
@@ -1640,7 +1640,7 @@ INT16 ClosestReachableFriendInTrouble(SOLDIERTYPE *pSoldier, BOOLEAN * pfClimbin
INT16 DistanceToClosestFriend( SOLDIERTYPE * pSoldier )
{
// find the distance to the closest person on the same team
UINT8 ubLoop;
UINT8 ubLoop;
SOLDIERTYPE *pTargetSoldier;
INT16 sMinDist = 1000;
INT16 sDist;
+11 -3
View File
@@ -1309,7 +1309,6 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
STR16 tempstr;
#endif
if (fCivilian)
{
if (pSoldier->flags.uiStatusFlags & SOLDIER_COWERING)
@@ -2472,10 +2471,11 @@ if(!is_networked)//hayden
}
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: calculate morale");
// calculate our morale
pSoldier->aiData.bAIMorale = CalcMorale(pSoldier);
// WDS DEBUG - this will make all enemies run away (to test retreating into occupied sector bugs)
// pSoldier->aiData.bAIMorale = MORALE_HOPELESS;
// if a guy is feeling REALLY discouraged, he may continue to run like hell
if ((pSoldier->aiData.bAIMorale == MORALE_HOPELESS) && ubCanMove)
@@ -4170,7 +4170,13 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
}
// NB a desire of 4 or more is only achievable by brave/aggressive guys with high morale
if ( pSoldier->bActionPoints == pSoldier->bInitialActionPoints && ubBestAttackAction == AI_ACTION_FIRE_GUN && (pSoldier->aiData.bShock == 0) && (pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2) && BestAttack.ubChanceToReallyHit < 30 && ( PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) > Weapon[ pSoldier->inv[ BestAttack.bWeaponIn ].usItem ].usRange / CELL_X_SIZE ) && RangeChangeDesire( pSoldier ) >= 4 )
if ( (pSoldier->bActionPoints == pSoldier->bInitialActionPoints) &&
(ubBestAttackAction == AI_ACTION_FIRE_GUN) &&
(pSoldier->aiData.bShock == 0) &&
(pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2) &&
(BestAttack.ubChanceToReallyHit < 30) &&
(PythSpacesAway( pSoldier->sGridNo, BestAttack.sTarget ) > Weapon[ pSoldier->inv[ BestAttack.bWeaponIn ].usItem ].usRange / CELL_X_SIZE ) &&
(RangeChangeDesire( pSoldier ) >= 4) )
{
// okay, really got to wonder about this... could taking cover be an option?
if (ubCanMove && pSoldier->aiData.bOrders != STATIONARY && !gfHiddenInterrupt &&
@@ -5019,7 +5025,9 @@ INT8 DecideAction(SOLDIERTYPE *pSoldier)
//TODO: don't say this again after reloading a savegame
SayQuoteFromAnyBodyInSector( QUOTE_WEARY_SLASH_SUSPUCIOUS );
}
}
// turn off cautious flag
pSoldier->aiData.fAIFlags &= (~AI_CAUTIOUS);
//reset flank count
+1 -1
View File
@@ -509,7 +509,7 @@ INT32 CalcCoverValue(SOLDIERTYPE *pMe, INT16 sMyGridNo, INT32 iMyThreat, INT32 i
UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT16 sGridNo )
{
UINT8 ubLoop, ubCount, ubWhoIsThere;
UINT8 ubLoop, ubCount, ubWhoIsThere;
INT16 sTempGridNo;
ubCount = 0;
+1 -1
View File
@@ -43,7 +43,7 @@ BOOLEAN FindAutobandageClimbPoint( INT16 sDesiredGridNo, BOOLEAN fClimbUp )
// checks for existance of location to climb up to building, not occupied by a medic
BUILDING * pBuilding;
UINT8 ubNumClimbSpots;
UINT8 ubLoop;
UINT8 ubLoop;
UINT8 ubWhoIsThere;
pBuilding = FindBuilding( sDesiredGridNo );
+14 -14
View File
@@ -327,7 +327,7 @@ BOOLEAN ReloadQuoteFileIfLoaded( UINT8 ubNPC )
BOOLEAN RefreshNPCScriptRecord( UINT8 ubNPC, UINT8 ubRecord )
{
UINT8 ubLoop;
UINT8 ubLoop;
NPCQuoteInfo * pNewArray;
if ( ubNPC == NO_PROFILE )
@@ -460,7 +460,7 @@ BOOLEAN ReloadCivQuoteFileIfLoaded( UINT8 ubIndex )
void ShutdownNPCQuotes( void )
{
UINT8 ubLoop;
UINT8 ubLoop;
for ( ubLoop = 0; ubLoop < NUM_PROFILES; ubLoop++ )
{
@@ -618,7 +618,7 @@ UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach )
void ApproachedForFirstTime( MERCPROFILESTRUCT * pNPCProfile, INT8 bApproach )
{
UINT8 ubLoop;
UINT8 ubLoop;
UINT32 uiTemp;
pNPCProfile->bApproached |= gbFirstApproachFlags[bApproach - 1];
@@ -1499,7 +1499,7 @@ void ReplaceLocationInNPCDataFromProfileID( UINT8 ubNPC, INT16 sOldGridNo, INT16
void ResetOncePerConvoRecords( NPCQuoteInfo * pNPCQuoteInfoArray )
{
UINT8 ubLoop;
UINT8 ubLoop;
for ( ubLoop = 0; ubLoop < NUM_NPC_QUOTE_RECORDS; ubLoop++ )
{
@@ -1522,7 +1522,7 @@ void ResetOncePerConvoRecordsForNPC( UINT8 ubNPC )
void ResetOncePerConvoRecordsForAllNPCsInLoadedSector( void )
{
UINT8 ubLoop;
UINT8 ubLoop;
if ( gWorldSectorX == 0 || gWorldSectorY == 0 )
{
@@ -2314,7 +2314,7 @@ void NPCReachedDestination( SOLDIERTYPE * pNPC, BOOLEAN fAlreadyThere )
UINT8 ubNPC;
NPCQuoteInfo * pQuotePtr;
NPCQuoteInfo * pNPCQuoteInfoArray;
UINT8 ubLoop;
UINT8 ubLoop;
UINT8 ubQuoteRecord;
if ( pNPC->ubQuoteRecord == 0 )
@@ -2441,7 +2441,7 @@ void TriggerNPCRecordImmediately( UINT8 ubTriggerNPC, UINT8 ubTriggerNPCRec )
void PCsNearNPC( UINT8 ubNPC )
{
UINT8 ubLoop;
UINT8 ubLoop;
NPCQuoteInfo * pNPCQuoteInfoArray;
SOLDIERTYPE *pSoldier;
NPCQuoteInfo * pQuotePtr;
@@ -2482,7 +2482,7 @@ void PCsNearNPC( UINT8 ubNPC )
BOOLEAN PCDoesFirstAidOnNPC( UINT8 ubNPC )
{
UINT8 ubLoop;
UINT8 ubLoop;
NPCQuoteInfo * pNPCQuoteInfoArray;
SOLDIERTYPE *pSoldier;
NPCQuoteInfo * pQuotePtr;
@@ -2573,7 +2573,7 @@ BOOLEAN TriggerNPCWithIHateYouQuote( UINT8 ubTriggerNPC )
NPCQuoteInfo * pNPCQuoteInfoArray;
NPCQuoteInfo *pQuotePtr;
BOOLEAN fDisplayDialogue = TRUE;
UINT8 ubLoop;
UINT8 ubLoop;
if (EnsureQuoteFileLoaded( ubTriggerNPC ) == FALSE)
{
@@ -2605,7 +2605,7 @@ BOOLEAN NPCHasUnusedRecordWithGivenApproach( UINT8 ubNPC, UINT8 ubApproach )
// Check if we have a quote that could be used
NPCQuoteInfo * pNPCQuoteInfoArray;
NPCQuoteInfo *pQuotePtr;
UINT8 ubLoop;
UINT8 ubLoop;
if (EnsureQuoteFileLoaded( ubNPC ) == FALSE)
{
@@ -2633,7 +2633,7 @@ BOOLEAN NPCHasUnusedHostileRecord( UINT8 ubNPC, UINT8 ubApproach )
// Check if we have a quote that could be used
NPCQuoteInfo * pNPCQuoteInfoArray;
NPCQuoteInfo *pQuotePtr;
UINT8 ubLoop;
UINT8 ubLoop;
if (EnsureQuoteFileLoaded( ubNPC ) == FALSE)
{
@@ -2696,7 +2696,7 @@ BOOLEAN GetInfoForAbandoningEPC( UINT8 ubNPC, UINT16 * pusQuoteNum, UINT16 * pus
// Check if we have a quote that could be used
NPCQuoteInfo * pNPCQuoteInfoArray;
NPCQuoteInfo *pQuotePtr;
UINT8 ubLoop;
UINT8 ubLoop;
if (EnsureQuoteFileLoaded( ubNPC ) == FALSE)
{
@@ -2725,7 +2725,7 @@ BOOLEAN TriggerNPCWithGivenApproach( UINT8 ubTriggerNPC, UINT8 ubApproach, BOOLE
NPCQuoteInfo * pNPCQuoteInfoArray;
NPCQuoteInfo *pQuotePtr;
BOOLEAN fDisplayDialogue = TRUE;
UINT8 ubLoop;
UINT8 ubLoop;
if (EnsureQuoteFileLoaded( ubTriggerNPC ) == FALSE)
{
@@ -3383,7 +3383,7 @@ BOOLEAN RecordHasDialogue( UINT8 ubNPC, UINT8 ubRecord )
INT8 FindCivQuoteFileIndex( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
{
UINT8 ubLoop;
UINT8 ubLoop;
if ( sSectorZ > 0 )
{