コード例 #1
0
 protected override bool TryComputeArmyMissionParameter()
 {
     this.besiegers = null;
     if (this.City.BesiegingEmpire != null)
     {
         this.besiegers = DepartmentOfTheInterior.GetBesiegers(this.City);
         if (this.besiegers.Length == 0)
         {
             return(false);
         }
         float    num      = 0f;
         float    num2     = 0f;
         Garrison defender = this.besiegers[0];
         this.intelligenceAiHelper.EstimateMPInBattleground(this.City, defender, ref num, ref num2);
         if (num > num2)
         {
             return(this.AskForArmy(true));
         }
         float propertyValue  = this.City.GetPropertyValue(SimulationProperties.CityDefensePoint);
         float besiegingPower = DepartmentOfTheInterior.GetBesiegingPower(this.City, true);
         if (propertyValue <= besiegingPower)
         {
             return(this.AskForArmy(true));
         }
     }
     else
     {
         if (base.AIDataArmyGUID.IsValid)
         {
             return(this.DisbandArmy());
         }
         base.Completion = AICommanderMission.AICommanderMissionCompletion.Success;
     }
     return(false);
 }