diff --git a/Strategic/ASD.cpp b/Strategic/ASD.cpp index 2593684b9..81d4b3f92 100644 --- a/Strategic/ASD.cpp +++ b/Strategic/ASD.cpp @@ -56,8 +56,8 @@ extern INT32 giReinforcementPool; - extern BOOLEAN gfTacticalDoHeliRun; +extern BOOLEAN gfUnlimitedTroops; // Arulco special division decision code @@ -488,11 +488,13 @@ void ASDDecideHeliOperations() { // attack this sector! heli.SetHeliFlightPath( (*it).first ); - heli.troopcount = gEnemyHeliMaxTroops; - giReinforcementPool -= gEnemyHeliMaxTroops; - heli.flagmask |= ENEMYHELI_ORDER_DROPTROOPS; + // sevenfm: don't change reinforcement pool when unlimited reinforcements enabled + if (!gfUnlimitedTroops) + giReinforcementPool -= gEnemyHeliMaxTroops; + + heli.flagmask |= ENEMYHELI_ORDER_DROPTROOPS; AddStrategicEvent( EVENT_ENEMY_HELI_UPDATE, GetWorldTotalMin( ) + gEnemyHeliTravelTimePerSector, id ); break; diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 4372aa9e8..e7fc23d65 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -105,6 +105,8 @@ class SOLDIERTYPE; // Flugente: external sector data extern SECTOR_EXT_DATA SectorExternalData[256][4]; +// sevenfm +extern BOOLEAN gfUnlimitedTroops; // various reason an assignment can be aborted before completion enum{ @@ -7824,7 +7826,9 @@ void Interrogateprisoner(UINT8 aPrisonerType, FLOAT aChanceModifier, INT8& arMil // there is a chance that freed prisoners may return to the queen... if ( arMilitiaType < 0 && aPrisonerType != PRISONER_CIVILIAN && Chance( gGameExternalOptions.ubPrisonerReturntoQueenChance ) ) { - ++giReinforcementPool; + // sevenfm: don't change reinforcement pool when unlimited reinforcements enabled + if (!gfUnlimitedTroops) + ++giReinforcementPool; } } diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 8540ff8e7..5d0d93dfc 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -3431,7 +3431,7 @@ void EvaluateQueenSituation() uiOffset = max( 100 - giRequestPoints, 0); uiOffset = uiOffset + Random( uiOffset * 4 ); - // Flugente: enemy generals can speed up the AI decision process (justification: the generals are the ones planning the military operations, so if theay are around, the army is more efficient) + // Flugente: enemy generals can speed up the AI decision process (justification: the generals are the ones planning the military operations, so if they are around, the army is more efficient) FLOAT dEnemyGeneralsSpeedupFactor = 1.0f; if ( gGameExternalOptions.fEnemyRoles && gGameExternalOptions.fEnemyGenerals ) { @@ -3440,14 +3440,13 @@ void EvaluateQueenSituation() uiOffset += dEnemyGeneralsSpeedupFactor * (zDiffSetting[gGameOptions.ubDifficultyLevel].iBaseDelayInMinutesBetweenEvaluations + Random( zDiffSetting[gGameOptions.ubDifficultyLevel].iEvaluationDelayVariance )); - if( !giReinforcementPool ) + // sevenfm: allow recruiting when pool size drops below iQueenPoolIncrementPerDifficultyLevel, this should result in more stable strategic AI behavior + if (giReinforcementPool <= 0 || !gfUnlimitedTroops && giReinforcementPool < zDiffSetting[gGameOptions.ubDifficultyLevel].iQueenPoolIncrementPerDifficultyLevel) { - //Queen has run out of reinforcements. Simulate recruiting and training new troops - uiOffset *= 10; - //Madd: don't need an unlimited troops check here, since they can never run out like this - - giReinforcementPool += ( zDiffSetting[gGameOptions.ubDifficultyLevel].iQueenPoolIncrementPerDifficultyLevel * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ; - + //Queen has run out of reinforcements. Simulate recruiting and training new troops + // sevenfm: with default values, it can be up to 8 days of doing nothing, I think that skipping once cycle of decisions should be enough + //uiOffset *= 10; + giReinforcementPool += ( zDiffSetting[gGameOptions.ubDifficultyLevel].iQueenPoolIncrementPerDifficultyLevel * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ; AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 ); return; }