Beispiel #1
0
 private void PreBattle(MobileParty targetParty)
 {
     PlayerEncounter.LeaveSettlement();
     PlayerEncounter.Finish(true);
     StartBattleAction.Apply(targetParty.Party, MobileParty.MainParty.Party);
     PlayerEncounter.RestartPlayerEncounter(MobileParty.MainParty.Party, targetParty.Party, true);
     PlayerEncounter.Update();
 }
        public void OnEndMission()
        {
            _messengers.Remove(_activeMessenger);
            _activeMessenger = null;

            if (PlayerEncounter.Current != null)
            {
                PlayerEncounter.Finish();
            }
        }
Beispiel #3
0
 private void OnConversationEnded(CharacterObject character)
 {
     if (meetingEncounter != null)
     {
         PlayerEncounter.Finish(false);
         meetingEncounter = null;
         meetingHero      = null;
         AccessTools.Property(typeof(Campaign), "PlayerEncounter").SetValue(Campaign.Current, keepEncounter);
         keepEncounter = null;
         Hero.MainHero.PartyBelongedTo.CurrentSettlement = keepSettlement;
         keepSettlement = null;
     }
 }
Beispiel #4
0
        public void BattleInCenter(MenuCallbackArgs args)
        {
            MobileParty targetParty = this._parties.Where(obj => obj.Name.ToString() == args.Text.ToString()).GetRandomElement();

            if (null == targetParty)
            {
                PlayerEncounter.LeaveSettlement();
                PlayerEncounter.Finish(true);
                return;
            }

            int    upgradeLevel = Settlement.CurrentSettlement.GetComponent <Town>().GetWallLevel();
            String scene        = LocationComplex.Current.GetLocationWithId("center").GetSceneName(upgradeLevel);

            PreBattle(targetParty);
            StartBattleNormal(scene, upgradeLevel);
        }
Beispiel #5
0
        public void BattleInLordShall(MenuCallbackArgs args)
        {
            Hero target = this._lordHeros.Where(obj => obj.Name.ToString() == args.Text.ToString()).GetRandomElement();

            if (null == target)
            {
                PlayerEncounter.LeaveSettlement();
                PlayerEncounter.Finish(true);
                return;
            }
            int    upgradeLevel = Settlement.CurrentSettlement.GetComponent <Town>().GetWallLevel();
            String scene        = LocationComplex.Current.GetLocationWithId("lordshall").GetSceneName(upgradeLevel);

            MobileParty targetParty = target.Clan.CreateNewMobileParty(target);

            AddRandomTroopToParty(targetParty);
            SelectMainPartyMember(args, () => {
                PreBattle(targetParty);
                OpenBattleJustHero(scene, upgradeLevel);
            }, SneakMaxNum);

            //InformationManager.AddQuickInformation();
        }
        public void BattleInLordShall(MenuCallbackArgs args)
        {
            this._sneakType = SneakType.LordShall;
            Hero target = this._lordHerosWithOutParty.Where(obj => obj.Name.ToString() == args.Text.ToString()).ToList().GetRandomElement();

            if (null == target)
            {
                PlayerEncounter.LeaveSettlement();
                PlayerEncounter.Finish(true);
                return;
            }
            int    upgradeLevel = Settlement.CurrentSettlement.GetComponent <Town>().GetWallLevel();
            String scene        = LocationComplex.Current.GetLocationWithId("lordshall").GetSceneName(upgradeLevel);

            //empire_castle_keep_a_l3_interior

            this._tempTargetParty = target.Clan.CreateNewMobileParty(target);
            AddRandomTroopToParty(this._tempTargetParty);
            SelectMainPartyMember(args, () => {
                PreBattle(this._tempTargetParty);
                OpenBattleJustHero(scene, upgradeLevel);
            }, SneakMaxNum);
        }
        private void OnSessionLaunched(CampaignGameStarter starter)
        {
            MBTextManager.SetTextVariable("PLAYER_CAMP_STATE", "idling");
            MBTextManager.SetTextVariable("PLAYER_CAMP_START_STOP", "Start");

            starter.AddGameMenu(
                PlayerCampMenu,
                "Player camp.\n \nTroops are currently {PLAYER_CAMP_STATE}.\nResources left for {PLAYER_CAMP_RESOURCES} days.",
                null
                );

            starter.AddGameMenuOption(
                PlayerCampMenu,
                "player_camp_train",
                "{PLAYER_CAMP_START_STOP} training",
                Utils.positiveLeaveType(GameMenuOption.LeaveType.Recruit),
                _ =>
            {
                if (_establishedCamp != null)
                {
                    _establishedCamp.IsTraining = !_establishedCamp.IsTraining;

                    MBTextManager.SetTextVariable("PLAYER_CAMP_STATE", _establishedCamp.IsTraining ? "training" : "idling");
                    MBTextManager.SetTextVariable("PLAYER_CAMP_START_STOP", _establishedCamp.IsTraining ? "Stop" : "Start");
                }
            }
                );

            starter.AddGameMenuOption(
                PlayerCampMenu,
                "player_camp_remove",
                "Remove camp",
                Utils.positiveLeaveType(GameMenuOption.LeaveType.Continue),
                _ =>
            {
                RemoveCamp();
                PlayerEncounter.Finish();
            },
                true
                );

            starter.AddGameMenuOption(
                PlayerCampMenu,
                "player_camp_wait",
                "Wait",
                Utils.positiveLeaveType(GameMenuOption.LeaveType.Wait),
                _ => GameMenu.ActivateGameMenu("player_camp_menu_wait")
                );

            starter.AddGameMenuOption(
                PlayerCampMenu,
                "player_camp_leave",
                "Leave",
                Utils.positiveLeaveType(GameMenuOption.LeaveType.Leave),
                _ => PlayerEncounter.Finish()
                );

            // wait menu
            starter.AddWaitGameMenu("player_camp_menu_wait", "Waiting.",
                                    null,
                                    args =>
            {
                args.MenuContext.GameMenu.AllowWaitingAutomatically();
                args.optionLeaveType = GameMenuOption.LeaveType.Wait;
                return(true);
            },
                                    null,
                                    null,
                                    GameMenu.MenuAndOptionType.WaitMenuHideProgressAndHoursOption
                                    );

            starter.AddGameMenuOption(
                "player_camp_menu_wait",
                "wait_leave",
                "{=UqDNAZqM}Stop waiting",
                Utils.positiveLeaveType(GameMenuOption.LeaveType.Leave),
                _ => GameMenu.ActivateGameMenu(PlayerCampMenu)
                );
        }
Beispiel #8
0
 public void Leave(MenuCallbackArgs args)
 {
     PlayerEncounter.LeaveSettlement();
     PlayerEncounter.Finish(true);
 }
 private void game_menu_steal_wait_on_consequence(MenuCallbackArgs args)
 {
     PlayerEncounter.Finish(true);
 }
Beispiel #10
0
 protected override void OnMenuOptionClicked(MenuCallbackArgs args)
 {
     PlayerEncounter.LeaveSettlement();
     PlayerEncounter.Finish();
 }