Exemplo n.º 1
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);
        }
Exemplo n.º 2
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();
        }