private void ConvinceCaptivesAI(Architecture architecture2) { if (this.BelongedFaction == null) return; if (this.HasHostileTroopsInView()) return; Captive extremeLoyaltyCaptive = architecture2.GetLowestLoyaltyCaptiveRecruitable(); if (extremeLoyaltyCaptive != null && extremeLoyaltyCaptive.CaptivePerson != null && (extremeLoyaltyCaptive.Loyalty < 100 || (GlobalVariables.AIAutoTakePlayerCaptives && !GlobalVariables.AIAutoTakePlayerCaptiveOnlyUnfull && base.Scenario.IsPlayer(extremeLoyaltyCaptive.CaptiveFaction))) && (extremeLoyaltyCaptive.CaptiveFaction == null || extremeLoyaltyCaptive.CaptivePerson != extremeLoyaltyCaptive.CaptiveFaction.Leader)) { PersonList firstHalfPersonList = this.GetFirstHalfPersonList("ConvinceAbility"); foreach (Person i in firstHalfPersonList) { if ((GameObject.Random(this.BelongedFaction.PersonCount) < 5 && i != null) || (i != null && (!this.HasFollowedLeaderMilitary(i) || GameObject.Chance(33)) && GameObject.Random(i.NonFightingNumber) > GameObject.Random(i.FightingNumber) && GameObject.Random(i.FightingNumber) < 100 && GameObject.Random(i.ConvinceAbility) >= 200 && GameObject.Random(i.ConvinceAbility) > GameObject.Random(extremeLoyaltyCaptive.Loyalty * 5))) { i.OutsideDestination = new Point?(base.Scenario.GetClosestPoint(architecture2.ArchitectureArea, this.Position)); i.GoForConvince(extremeLoyaltyCaptive.CaptivePerson); } } } }