New option DEFEAT_MODE:

- 0: default, any lost battle is considered defeat
- 1: if enemy team was alerted
- 2: if at least one of retreating mercs is not covert
- 3: if at least one merc was killed in battle
- 4: if all mercs were killed in battle

MORALE_RAN_AWAY:
- apply penalty when retreating from sector only if enemy team was alerted
- improved check for mercs in sector
- no MORALE_HEARD_BATTLE_LOST penalty
- no reputation loss when retreating from battle

CheckForEndOfBattle:
- only apply morale and loyalty penalty if player was defeated
- only play death music if player is defeated
- log defeat only when player was defeated
- clear aware status for enemy team, clear enemy kill counter

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8945 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-02-21 13:18:04 +00:00
parent 02d19f3240
commit 0e0d329b95
5 changed files with 111 additions and 39 deletions
+8 -4
View File
@@ -2148,7 +2148,8 @@ UINT32 EnemyStrength( void )
void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
{
if ( NumNonPlayerTeamMembersInSector( sSectorX, sSectorY, MILITIA_TEAM ) )
{ //Big morale penalty!
{
//Big morale penalty!
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, sSectorX, sSectorY, (INT8)sSectorZ );
}
@@ -2161,10 +2162,13 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX,
UINT8 DiffLevel = gGameOptions.ubDifficultyLevel;
if ( DiffLevel > DIF_LEVEL_INSANE )
DiffLevel = 1;
if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + DiffLevel)) >= EnemyStrength() ) )
// sevenfm: if enemy was alerted
if (gTacticalStatus.fEnemyInSector &&
gTacticalStatus.Team[ENEMY_TEAM].bAwareOfOpposition &&
((PlayerStrength() * (2 + DiffLevel)) >= EnemyStrength()))
{
HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
HandleMoraleEvent(NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ);
}
}
else