private static bool Prefix(CharacterCreation characterCreation)
        //private static void Test(CharacterCreation characterCreation)
        {
            //Change here to make addtl cultures first one to load
            int maincultures = 0;

            foreach (CultureObject cultureObject in MBObjectManager.Instance.GetObjectTypeList <CultureObject>())
            {
                if (cultureObject.IsMainCulture)
                {
                    maincultures++;
                }
            }
            if (maincultures == 6)
            {
                CultureStartOptions.AddGameOption(characterCreation);
            }
            else
            {
                CultureStartOptions.AddtlCultures(characterCreation);
                CultureStartOptions.AddGameOption(characterCreation);
            }

            //CultureStartOptions.AddStartOption(characterCreation, CharacterCreationContent.Instance);

            //CultureStartOptions.AddStartLocation(characterCreation);
            return(true);
        }
Beispiel #2
0
        private static bool Prefix(TrainingFieldCampaignBehavior __instance)
        {
            if (!CultureStartOptions.FreePlayLoadedOnCondition())
            {
                //foreach (CharacterObject troop in PartyBase.MainParty.MemberRoster..ToList<CharacterObject>())
                //{
                // if (!troop.IsPlayerCharacter)
                // {
                //    PartyBase.MainParty.MemberRoster.RemoveTroop(troop, 1, default(UniqueTroopDescriptor), 0);

                // }
                // }
                //Setting Various extra values to try and match usual complete tutorial phase to make sure events fire.
                AccessTools.Field(typeof(TrainingFieldCampaignBehavior), "_talkedWithBrotherForTheFirstTime").SetValue(__instance, true);
                TutorialPhase.Instance.PlayerTalkedWithBrotherForTheFirstTime();

                Hero brother = (Hero)AccessTools.Property(typeof(StoryModeHeroes), "ElderBrother").GetValue(null);
                brother.ChangeState(Hero.CharacterStates.Disabled);
                //Believe this is line missed that is causing all the brother issues
                brother.Clan = CampaignData.NeutralFaction;


                StoryMode.StoryMode.Current.MainStoryLine.CompleteTutorialPhase(true);
                Vec2 StartPos = GetSettlementLoc(CSCharCreationOption.CSOptionSettlement());
                MobileParty.MainParty.Position2D = StartPos;
                MapState mapstate;
                mapstate = (GameStateManager.Current.ActiveState as MapState);
                mapstate.Handler.TeleportCameraToMainParty();
                SelectClanName();
                CSApplyChoices.ApplyStoryOptions();
            }
            return(false);
        }
 private static bool Prefix(CharacterCreation characterCreation, CharacterCreationContent __instance)
 //private static void Test(CharacterCreation characterCreation)
 {
     CharacterCreationContent.AddParentsMenu(characterCreation);
     CharacterCreationContent.AddChildhoodMenu(characterCreation);
     CharacterCreationContent.AddEducationMenu(characterCreation);
     CharacterCreationContent.AddYouthMenu(characterCreation);
     CharacterCreationContent.AddAdulthoodMenu(characterCreation);
     CultureStartOptions.AddStartOption(characterCreation);
     CharacterCreationContent.Instance.GetType().GetMethod("AddEscapeMenu", BindingFlags.NonPublic | BindingFlags.Static).Invoke(CharacterCreationContent.Instance, new object[] { characterCreation });
     //CultureStartOptions.AddStartOption2(characterCreation);
     return(false);
 }
Beispiel #4
0
        protected override void OnSubModuleLoad()
        {
            base.OnSubModuleLoad();


            var     BannerInvestigationQuest = typeof(BannerInvestigationQuestBehavior).Assembly.GetType("StoryMode.Behaviors.Quests.FirstPhase.BannerInvestigationQuestBehavior+BannerInvestigationQuest").GetMethod("InitializeNotablesToTalkList", BindingFlags.NonPublic | BindingFlags.Instance);
            var     postfix = typeof(CSTalkWithNoblePatch).GetMethod("NoblePatch", BindingFlags.NonPublic | BindingFlags.Static);
            Harmony harmony = new Harmony("mod.bannerlord.CS");

            if (CultureStartOptions.FreePlayLoadedOnCondition())
            {
                var FPStart   = AccessTools.Method(AccessTools.TypeByName("FreePlay.FreePlayGameStartBehavior"), "OnCharacterCreationIsOver");
                var FPPostfix = typeof(CSFreePlayPatch).GetMethod("Postfix", BindingFlags.NonPublic | BindingFlags.Static);
                harmony.Patch(FPStart, null, new HarmonyMethod(FPPostfix));
            }

            harmony.Patch(BannerInvestigationQuest, new HarmonyMethod(postfix));

            harmony.PatchAll();
        }
        private static bool Prefix(CharacterCreation characterCreation)
        {
            //Major change due to change in escape, i'm just patching on this function not modifying the menu anymore. Will show brother/siblings and shit but \o/
            List <CharacterCreationMenu> CurMenus = (List <CharacterCreationMenu>)AccessTools.Field(typeof(CharacterCreation), "CharacterCreationMenu").GetValue(characterCreation);
            bool loaded = false;

            foreach (CharacterCreationMenu x in CurMenus)
            {
                if (x.Text.ToString() == "Beginning your new adventure")
                {
                    loaded = true;
                    break;
                }
            }
            ;
            if (!loaded)
            {
                CultureStartOptions.AddStartLocation(characterCreation);
            }

            return(true);
        }