mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Work has begun to enable strategic movement for other teams than just player and enemy.
- I've changed the GROUP struct - instead of BOOLEAN fPlayer we now have UINT8 usGroupTeam. - To further simplify the code, I've replaced UINT8 NumEnemiesInSector( INT16 sSectorX, INT16 sSectorY ); with UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam ); In the next days, more strategic functions will be simplified, merged and replaced. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7707 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -361,7 +361,7 @@ void HandleDisease()
|
||||
}
|
||||
|
||||
// the bulk of doctoring will come from the military
|
||||
doctors += NumEnemiesInSector( sX, sY ) * GetMilitaryPopulationDoctorRate( );
|
||||
doctors += NumNonPlayerTeamMembersInSector( sX, sY, ENEMY_TEAM ) * GetMilitaryPopulationDoctorRate( );
|
||||
|
||||
UINT32 doctorpower = doctors * GetPopulationDoctorPoints( );
|
||||
|
||||
@@ -479,8 +479,7 @@ UINT16 GetSectorPopulation( INT16 sX, INT16 sY, BOOLEAN fWithMilitary )
|
||||
if ( fWithMilitary )
|
||||
{
|
||||
// add number of enemies...
|
||||
UINT16 sNumberOfEnemies = NumEnemiesInSector( sX, sY );
|
||||
population += sNumberOfEnemies;
|
||||
population += NumNonPlayerTeamMembersInSector( sX, sY, ENEMY_TEAM );
|
||||
}
|
||||
|
||||
return population;
|
||||
|
||||
@@ -4460,7 +4460,7 @@ void MilitiaChangesSides( )
|
||||
{
|
||||
if (pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife)
|
||||
{
|
||||
if ( (gWorldSectorX ==0 && gWorldSectorY == 0) || !NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) )
|
||||
if ( (gWorldSectorX == 0 && gWorldSectorY == 0) || !NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM ) )
|
||||
MakeCivHostile( pSoldier, 2 );
|
||||
RecalculateOppCntsDueToNoLongerNeutral( pSoldier );
|
||||
}
|
||||
@@ -7070,7 +7070,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
{
|
||||
if( !gbWorldSectorZ )
|
||||
{
|
||||
SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY) ].bLastKnownEnemies = NumEnemiesInSector( gWorldSectorX, gWorldSectorY );
|
||||
SectorInfo[SECTOR( gWorldSectorX, gWorldSectorY )].bLastKnownEnemies = NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM );
|
||||
}
|
||||
|
||||
// Flugente: note number of wounded for campaign stats
|
||||
@@ -10906,7 +10906,7 @@ BOOLEAN GetRandomEnemyTownSector(INT8 bTownId, UINT16& aSector)
|
||||
{
|
||||
usSector = CALCULATE_STRATEGIC_INDEX( iCounterA, iCounterB );
|
||||
|
||||
if ( StrategicMap[usSector].bNameId == bTownId && NumEnemiesInSector( iCounterA, iCounterB ) > 0 && !SectorHasVIP( iCounterA, iCounterB ) )
|
||||
if ( StrategicMap[usSector].bNameId == bTownId && NumNonPlayerTeamMembersInSector( iCounterA, iCounterB, ENEMY_TEAM ) > 0 && !SectorHasVIP( iCounterA, iCounterB ) )
|
||||
{
|
||||
possiblesectors.push_back( usSector );
|
||||
}
|
||||
|
||||
@@ -17914,7 +17914,7 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN
|
||||
GROUP *pGroup = gpGroupList;
|
||||
while ( pGroup )
|
||||
{
|
||||
if ( !pGroup->fPlayer && !pGroup->fVehicle && pGroup->ubSectorX == sSectorX && pGroup->ubSectorY == sSectorY )
|
||||
if ( pGroup->usGroupTeam == bTeam && !pGroup->fVehicle && pGroup->ubSectorX == sSectorX && pGroup->ubSectorY == sSectorY )
|
||||
{
|
||||
nummortars += pGroup->ubGroupSize;
|
||||
numshells += gSkillTraitValues.usVOMortarPointsTroop * pGroup->ubGroupSize;
|
||||
|
||||
Reference in New Issue
Block a user