protected override bool TryComputeArmyMissionParameter()
    {
        if (this.RegionTarget == null)
        {
            base.Completion = AICommanderMission.AICommanderMissionCompletion.Fail;
            return(false);
        }
        base.ArmyMissionParameters.Clear();
        if (base.AIDataArmyGUID == GameEntityGUID.Zero)
        {
            return(false);
        }
        AIData_Army aidata = this.aiDataRepository.GetAIData <AIData_Army>(base.AIDataArmyGUID);

        if (aidata == null)
        {
            base.Completion = AICommanderMission.AICommanderMissionCompletion.Fail;
            return(false);
        }
        Army maxHostileArmy = AILayer_Pacification.GetMaxHostileArmy(base.Commander.Empire, this.RegionTarget.Index);

        if (maxHostileArmy != null && aidata.Army.GetPropertyValue(SimulationProperties.MilitaryPower) > 0.8f * maxHostileArmy.GetPropertyValue(SimulationProperties.MilitaryPower))
        {
            return(base.TryCreateArmyMission("MajorFactionAttackArmy", new List <object>
            {
                maxHostileArmy,
                this.RegionTarget.Index
            }));
        }
        return(base.TryCreateArmyMission("MajorFactionRoaming", new List <object>
        {
            this.RegionTarget.Index
        }));
    }
    public override WorldPosition GetTargetPositionForTheArmy()
    {
        Army maxHostileArmy = AILayer_Pacification.GetMaxHostileArmy(base.Commander.Empire, this.RegionTarget.Index);

        if (maxHostileArmy != null)
        {
            return(maxHostileArmy.WorldPosition);
        }
        if (this.RegionTarget != null)
        {
            return(this.RegionTarget.Barycenter);
        }
        return(WorldPosition.Invalid);
    }