mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Fix: captured enemy officers still provided boni
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7760 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -10453,7 +10453,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// enemy team gets a bonus if it has officers around
|
// enemy team gets a bonus if it has officers around
|
||||||
BOOL officertype = OFFICER_NONE;
|
UINT8 officertype = OFFICER_NONE;
|
||||||
if ( HighestEnemyOfficersInSector( officertype ) )
|
if ( HighestEnemyOfficersInSector( officertype ) )
|
||||||
{
|
{
|
||||||
enemysidestrength = enemysidestrength * (1.0f + gGameExternalOptions.dEnemyOfficerSurrenderStrengthBonus * officertype);
|
enemysidestrength = enemysidestrength * (1.0f + gGameExternalOptions.dEnemyOfficerSurrenderStrengthBonus * officertype);
|
||||||
@@ -10807,7 +10807,7 @@ INT8 CalcEffectiveShockLevel( SOLDIERTYPE * pSoldier )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: count number of enemy officers
|
// Flugente: count number of enemy officers
|
||||||
UINT8 HighestEnemyOfficersInSector( BOOL& aType )
|
UINT8 HighestEnemyOfficersInSector( UINT8& aType )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE* pSoldier;
|
SOLDIERTYPE* pSoldier;
|
||||||
INT32 cnt = 0;
|
INT32 cnt = 0;
|
||||||
@@ -10818,7 +10818,8 @@ UINT8 HighestEnemyOfficersInSector( BOOL& aType )
|
|||||||
{
|
{
|
||||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 )
|
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 )
|
||||||
{
|
{
|
||||||
if ( pSoldier->usSoldierFlagMask & SOLDIER_ENEMY_OFFICER )
|
// count officers, but do not count those that we have already captured
|
||||||
|
if ( (pSoldier->usSoldierFlagMask & SOLDIER_ENEMY_OFFICER) && !(pSoldier->usSoldierFlagMask & SOLDIER_POW) )
|
||||||
{
|
{
|
||||||
// officers with double squadleader trait are captains, otherwise lieutnant
|
// officers with double squadleader trait are captains, otherwise lieutnant
|
||||||
aType = max( aType, NUM_SKILL_TRAITS( pSoldier, SQUADLEADER_NT) );
|
aType = max( aType, NUM_SKILL_TRAITS( pSoldier, SQUADLEADER_NT) );
|
||||||
|
|||||||
+1
-1
@@ -398,7 +398,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Flugente: return number of enemy officers and highest rank found
|
// Flugente: return number of enemy officers and highest rank found
|
||||||
UINT8 HighestEnemyOfficersInSector(BOOL& aType);
|
UINT8 HighestEnemyOfficersInSector(UINT8& aType);
|
||||||
|
|
||||||
// count all soldiers in the current sector that have a specific flag set
|
// count all soldiers in the current sector that have a specific flag set
|
||||||
UINT16 NumSoldiersWithFlagInSector(UINT8 aTeam, UINT32 aFlag);
|
UINT16 NumSoldiersWithFlagInSector(UINT8 aTeam, UINT32 aFlag);
|
||||||
|
|||||||
@@ -17240,7 +17240,7 @@ INT8 SOLDIERTYPE::GetSuppressionResistanceBonus( )
|
|||||||
if ( this->bTeam == ENEMY_TEAM )
|
if ( this->bTeam == ENEMY_TEAM )
|
||||||
{
|
{
|
||||||
// bonus if we have an officer around
|
// bonus if we have an officer around
|
||||||
BOOL officertype = OFFICER_NONE;
|
UINT8 officertype = OFFICER_NONE;
|
||||||
if ( HighestEnemyOfficersInSector( officertype ) )
|
if ( HighestEnemyOfficersInSector( officertype ) )
|
||||||
{
|
{
|
||||||
bonus += gGameExternalOptions.sEnemyOfficerSuppressionResistanceBonus * officertype;
|
bonus += gGameExternalOptions.sEnemyOfficerSuppressionResistanceBonus * officertype;
|
||||||
@@ -17348,7 +17348,7 @@ FLOAT SOLDIERTYPE::GetMoraleModifier( )
|
|||||||
{
|
{
|
||||||
FLOAT mod = 1.0f;
|
FLOAT mod = 1.0f;
|
||||||
|
|
||||||
BOOL officertype = OFFICER_NONE;
|
UINT8 officertype = OFFICER_NONE;
|
||||||
if ( HighestEnemyOfficersInSector( officertype ) )
|
if ( HighestEnemyOfficersInSector( officertype ) )
|
||||||
{
|
{
|
||||||
mod += gGameExternalOptions.dEnemyOfficerMoraleModifier * officertype;
|
mod += gGameExternalOptions.dEnemyOfficerMoraleModifier * officertype;
|
||||||
|
|||||||
@@ -1760,7 +1760,7 @@ BOOLEAN TacticalCopySoldierFromCreateStruct( SOLDIERTYPE *pSoldier, SOLDIERCREAT
|
|||||||
if ( HAS_SKILL_TRAIT( pSoldier, SQUADLEADER_NT) )
|
if ( HAS_SKILL_TRAIT( pSoldier, SQUADLEADER_NT) )
|
||||||
{
|
{
|
||||||
UINT8 numenemies = NumEnemyInSector();
|
UINT8 numenemies = NumEnemyInSector();
|
||||||
BOOL officertype = OFFICER_NONE;
|
UINT8 officertype = OFFICER_NONE;
|
||||||
UINT8 numofficers = HighestEnemyOfficersInSector( officertype );
|
UINT8 numofficers = HighestEnemyOfficersInSector( officertype );
|
||||||
|
|
||||||
// this guy becomes an officer if there are enough soldiers around, and we aren't already at max of officers
|
// this guy becomes an officer if there are enough soldiers around, and we aren't already at max of officers
|
||||||
|
|||||||
Reference in New Issue
Block a user