anchor.diff:    //function FindBestTarget(var aBestTargetPlayer, aTargetPlayer: TKMHandIndex; var aTargetPoint: TKMPoint; aForceToAttack: Boolean = False): Boolean;
     function FindBestTarget(var aBestTargetPlayer: TKMHandIndex; var aTargetPoint: TKMPoint; aForceToAttack: Boolean): Boolean;
     const
  -    ALLIANCE_TARGET_COEF = 0.15;
  +    ALLIANCE_TARGET_COEF = 0.1;
       BEST_ALLIANCE_TARGET_COEF = 0.2;
  -    DISTANCE_COEF = 0.75; // If second enemy is twice as far away decrease chance by 3/8
  -    MIN_COMPARSION = 0.2; // 20% advantage for attacker
  +    DISTANCE_COEF = 0.3; // If second enemy is twice as far away decrease chance by 3/8
  +    MIN_COMPARSION = -0.2; // advantage for defender (but we are attacking as a team and team have advantage)
     var
  -    I, K, MinDist: Integer;
  -    Comparison, BestComparison: Single;
  -    OwnerArr: array of TKMHandIndex;
  +    I, K, MinDist, MaxDist: Integer;
  +    Comparison, BestComparison, invDistInterval: Single;
  +    OwnerArr: TKMHandIndexArray;
       EnemyStats: TKMEnemyStatisticsArray;
     begin
       Result := False;
  
positive.code:     BestAllianceCmp,WorstAllianceCmp: Single;
      BestEnemy: TKMHandIndex; // or index of Enemies array
      BestPoint: TKMPoint;
      Enemies: array of TKMHandIndex;
    end;
    TKMDefenceRequest = record
      Point: TKMPointArray;
      Ally: TKMHandIndex;
    end;
  
    TKMArmyManagement = class
  
negative.code: end;
  
  
  procedure TKMArmyManagement.RecruitSoldiers();
    function CanEquipIron: Boolean;
    begin
      Result := fSetup.UnlimitedEquip or gGame.CheckTime(fLastEquippedTimeIron + fSetup.EquipRateIron);
    end;
    function CanEquipLeather: Boolean;
    begin
      Result := fSetup.UnlimitedEquip or gGame.CheckTime(fLastEquippedTimeLeather + fSetup.EquipRateLeather);
    end;
  var
    Barracks: array of TKMHouseBarracks;
    H: TKMHouse;
  