src/game/Strategic/Strategic_Town_Loyalty.cc
void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
{
	if( CountAllMilitiaInSector( sSectorX, sSectorY ) )
	{ //Big morale penalty!
		HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, sSectorX, sSectorY, (INT8)sSectorZ );
	}

	//Standard retreat penalty
	if ( bRetreatCode == RETREAT_TACTICAL_TRAVERSAL )
	{
		// if not worse than 2:1 odds, then penalize morale
		if ( gTacticalStatus.fEnemyInSector && ( PlayerStrength() * 2 >= EnemyStrength() ) )
		{
			HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
		}
	}
	else
	{
		HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
	}
}
//Function assumes that mercs have retreated already.  Handles two cases, one for general merc retreat
//which slightly demoralizes the mercs, the other handles abandonment of militia forces which poses
//as a serious loyalty penalty.
Function assumes that mercs have retreated already.  Handles two cases, one for general merc retreat
which slightly demoralizes the mercs, the other handles abandonment of militia forces which poses
as a serious loyalty penalty.
Function assumes that mercs have retreated already . Handles two cases one for general merc retreat which slightly demoralizes the mercs the other handles abandonment of militia forces which poses as a serious loyalty penalty .
void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
{
	if( CountAllMilitiaInSector( sSectorX, sSectorY ) )
	{ 
		HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_ABANDON_MILITIA, sSectorX, sSectorY, (INT8)sSectorZ );
	}
	if ( bRetreatCode == RETREAT_TACTICAL_TRAVERSAL )
	{
		if ( gTacticalStatus.fEnemyInSector && ( PlayerStrength() * 2 >= EnemyStrength() ) )
		{
			HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
		}
	}
	else
	{
		HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
	}
}
void HandleLoyaltyImplicationsOfMercRetreat ( INT8 bRetreatCode , INT16 sSectorX , INT16 sSectorY , INT16 sSectorZ ) { if ( CountAllMilitiaInSector ( sSectorX , sSectorY ) ) { HandleGlobalLoyaltyEvent ( GLOBAL_LOYALTY_ABANDON_MILITIA , sSectorX , sSectorY , ( INT8 ) sSectorZ ) ; } if ( bRetreatCode == RETREAT_TACTICAL_TRAVERSAL ) { if ( gTacticalStatus . fEnemyInSector && ( PlayerStrength ( ) * 2 >= EnemyStrength ( ) ) ) { HandleMoraleEvent ( NULL , MORALE_RAN_AWAY , sSectorX , sSectorY , ( INT8 ) sSectorZ ) ; } } else { HandleMoraleEvent ( NULL , MORALE_RAN_AWAY , sSectorX , sSectorY , ( INT8 ) sSectorZ ) ; } }
Function assumes that mercs have retreated already.
Function assumes that mercs have retreated already .
//Big morale penalty! //Standard retreat penalty // if not worse than 2:1 odds, then penalize morale