mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- added some required functions for new AI
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@202 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
|
||||
#else
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
INT16 zVersionLabel[256] = { L"Release v1.13.194" };
|
||||
INT16 zVersionLabel[256] = { L"Release v1.13.202" };
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib"
|
||||
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.189_2006_06_07.exe"
|
||||
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.202_2006_06_07.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
|
||||
@@ -546,7 +546,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
|
||||
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.189_2006_06_07.exe"
|
||||
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.202_2006_06_07.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
|
||||
|
||||
@@ -523,6 +523,7 @@ UINT8 NumberOfTeamMatesAdjacent( SOLDIERTYPE * pSoldier, INT16 sGridNo )
|
||||
return( ubCount );
|
||||
}
|
||||
|
||||
static INT16 gsDesiredGridNo = NOWHERE;
|
||||
INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentBetter)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2AI,DBG_LEVEL_3,String("FindBestNearbyCover"));
|
||||
@@ -2780,3 +2781,53 @@ BOOLEAN CanClimbFromHere (SOLDIERTYPE * pSoldier, BOOLEAN fUp )
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
extern BUILDING gBuildings[ MAX_BUILDINGS ];
|
||||
extern UINT8 gubNumberOfBuildings;
|
||||
|
||||
|
||||
INT16 FindBestCoverNearTheGridNo(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubSearchRadius )
|
||||
{
|
||||
INT32 iPercentBetter;
|
||||
// INT16 sTrueGridNo;
|
||||
INT16 sResultGridNo;
|
||||
INT8 bRealWisdom = pSoldier->bWisdom;
|
||||
|
||||
// sTrueGridNo = pSoldier->sGridNo;
|
||||
// pSoldier->sGridNo = sGridNo;
|
||||
gsDesiredGridNo = sGridNo;
|
||||
pSoldier->bWisdom = 8 * ubSearchRadius;// 5 tiles
|
||||
|
||||
sResultGridNo = FindBestNearbyCover( pSoldier, MORALE_NORMAL, &iPercentBetter);
|
||||
|
||||
pSoldier->bWisdom = bRealWisdom;
|
||||
// pSoldier->sGridNo = sTrueGridNo;
|
||||
|
||||
gsDesiredGridNo = NOWHERE;
|
||||
|
||||
if( sResultGridNo != NOWHERE )
|
||||
return sResultGridNo;
|
||||
else
|
||||
return sGridNo;
|
||||
|
||||
}
|
||||
|
||||
INT8 FindDirectionForClimbing( INT16 sGridNo )
|
||||
{
|
||||
UINT16 usBuildingID;
|
||||
UINT16 usClimbSpotIndex;
|
||||
|
||||
for( usBuildingID = 0; usBuildingID < gubNumberOfBuildings ; ++usBuildingID )
|
||||
for( usClimbSpotIndex = 0; usClimbSpotIndex < gBuildings[ usBuildingID ].ubNumClimbSpots ; ++usClimbSpotIndex )
|
||||
if( gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ] == sGridNo )
|
||||
{
|
||||
if( WhoIsThere2( gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ], 1 ) == NOBODY )
|
||||
return atan8(CenterX(sGridNo),CenterY(sGridNo),CenterX(gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ]),CenterY(gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ]));
|
||||
}else if( gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ] == sGridNo )
|
||||
{
|
||||
if( WhoIsThere2( gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ], 0 ) == NOBODY )
|
||||
return atan8(CenterX(sGridNo),CenterY(sGridNo),CenterX(gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ]),CenterY(gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ]));
|
||||
}
|
||||
return DIRECTION_IRRELEVANT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user