Esempio n. 1
0
        protected override void OnSubModuleLoad()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(BasePath.Name + "Modules/RealisticBattleAiModule/config.xml");
            foreach (XmlNode childNode in xmlDocument.SelectSingleNode("/config").ChildNodes)
            {
                foreach (XmlNode subNode in childNode)
                {
                    XmlConfig.dict.Add(childNode.Name + "." + subNode.Name, float.Parse(subNode.InnerText));
                }
            }

            Module.CurrentModule.AddInitialStateOption(new InitialStateOption("RbmConfiguration", new TextObject("RBM AI Module Settings"), 4, delegate
            {
                ScreenManager.PushScreen(new RbmConfigScreen());
            }, () => (false, new TextObject("RBM AI Module Settings"))));

            MyPatcher.FirstPatch();
        }
Esempio n. 2
0
 public static void Postfix()
 {
     MyPatcher.DoPatching();
     OnTickAsAIPatch.itemPickupDistanceStorage.Clear();
     ManagedParameters.SetParameter(ManagedParametersEnum.BipedalRadius, 0.5f);
     if (Mission.Current.Teams.Any())
     {
         if (Mission.Current.MissionTeamAIType == Mission.MissionTeamAITypeEnum.FieldBattle)
         {
             foreach (Team team in Mission.Current.Teams.Where((Team t) => t.HasTeamAi).ToList())
             {
                 if (team.Side == BattleSideEnum.Attacker)
                 {
                     team.ClearTacticOptions();
                     team.AddTacticOption(new TacticFullScaleAttack(team));
                     team.AddTacticOption(new TacticRangedHarrassmentOffensive(team));
                     team.AddTacticOption(new TacticFrontalCavalryCharge(team));
                     team.AddTacticOption(new TacticCoordinatedRetreat(team));
                     //team.AddTacticOption(new TacticCharge(team));
                     //team.AddTacticOption(new TacticFullScaleAttackWithDedicatedSkirmishers(team));
                 }
                 if (team.Side == BattleSideEnum.Defender)
                 {
                     team.ClearTacticOptions();
                     team.AddTacticOption(new TacticDefensiveEngagement(team));
                     team.AddTacticOption(new TacticDefensiveLine(team));
                     team.AddTacticOption(new TacticFullScaleAttack(team));
                     team.AddTacticOption(new TacticCharge(team));
                     team.AddTacticOption(new TacticRangedHarrassmentOffensive(team));
                     //team.AddTacticOption(new TacticHoldChokePoint(team));
                     //team.AddTacticOption(new TacticHoldTheHill(team));
                     //team.AddTacticOption(new TacticRangedHarrassmentOffensive(team));
                     //team.AddTacticOption(new TacticCoordinatedRetreat(team));
                     //team.AddTacticOption(new TacticFrontalCavalryCharge(team));
                     //team.AddTacticOption(new TacticDefensiveRing(team));
                     //team.AddTacticOption(new TacticArchersOnTheHill(team));
                 }
             }
         }
     }
 }