예제 #1
0
        private void OnSessionLaunched(CampaignGameStarter game)
        {
            game.BlockSentences(
                () => !TelepathyBehaviour.MeetingInProgress,
                "main_option_discussions_1"                 // joining army
                );
            game.BlockSentences(
                () => !TelepathyBehaviour.MeetingInProgress || !TelepathySettings.Instance.HideQuestDialogLines,
                "hero_give_issue",                 // taking a quest
                "hero_task_given",                 // discuss a quest
                "caravan_create_conversation_1"    // form a caravan
                );

            game.AddPlayerLine(
                "lord_talk_ask_something_2",
                "lord_talk_ask_something_2",
                "telepathy_tell_location",
                new TextObject("{=Telepathy_Where_Are_You}Where are you?", null).ToString(),
                new ConversationSentence.OnConditionDelegate(() => meetingEncounter != null),
                null, 101, null, null);
            game.AddDialogLine(
                "telepathy_tell_location",
                "telepathy_tell_location",
                "lord_talk_ask_something_again",
                "{LORD_LOCATION_ANSWER}",
                new ConversationSentence.OnConditionDelegate(() => {
                HeroHelper.SetLastSeenLocation(meetingHero, true);
                var answer = meetingHero.LastSeenInSettlement
                                                ? new TextObject("{=Telepathy_Im_In}I'm in {Settlement}.", null)
                                                : new TextObject("{=Telepathy_Im_Near}I'm near {Settlement}.", null);
                answer.SetTextVariable("Settlement", meetingHero.LastSeenPlace.EncyclopediaLinkWithName);
                MBTextManager.SetTextVariable("LORD_LOCATION_ANSWER", answer, false);
                return(true);
            }),
                null, 100, null);
            game.AddPlayerLine(
                "lord_talk_ask_something_2",
                "lord_talk_ask_something_2",
                "telepathy_tell_objective",
                new TextObject("{=Telepathy_What_Are_You_Doing}What are you doing?", null).ToString(),
                new ConversationSentence.OnConditionDelegate(() => meetingEncounter != null),
                null, 101, null, null);
            game.AddDialogLine(
                "telepathy_tell_objective",
                "telepathy_tell_objective",
                "lord_talk_ask_something_again",
                "{LORD_OBJECTIVE_ANSWER}",
                new ConversationSentence.OnConditionDelegate(() => {
                string answer = meetingHero.PartyBelongedTo == null
                                                ? new TextObject("{=Telepathy_Nothing}Nothing actually.", null).ToString()
                                                : CampaignUIHelper.GetMobilePartyBehaviorText(meetingHero.PartyBelongedTo);
                MBTextManager.SetTextVariable("LORD_OBJECTIVE_ANSWER", answer, false);
                return(true);
            }),
                null, 100, null);
        }
예제 #2
0
 public static void SetHeroLastSeenLocation(this Hero hero, bool willUpdateImmediately)
 {
     try
     {
         HeroHelper.SetLastSeenLocation(hero, willUpdateImmediately);
     }
     catch (Exception e)
     {
         DisplayMessage(e);
     }
 }
예제 #3
0
 public static string GetHeroLastKnownLocation(this Hero hero, bool refresh = true, bool willUpdateImmediately = true)
 {
     try
     {
         if (refresh)
         {
             HeroHelper.SetLastSeenLocation(hero, willUpdateImmediately);
         }
         return(StringHelpers.GetLastKnownLocation(hero)?.ToString());
     }
     catch (Exception e)
     {
         return(e.ToString());
     }
 }
예제 #4
0
        public void RefreshMembersList()
        {
            Family.Clear();
            Companions.Clear();
            List <Hero> list = new List <Hero>();

            foreach (Hero noble in _faction.Nobles)
            {
                HeroHelper.SetLastSeenLocation(noble, willUpdateImmediately: true);
                if (noble.IsAlive)
                {
                    if (noble == Hero.MainHero)
                    {
                        list.Insert(0, noble);
                    }
                    else
                    {
                        list.Add(noble);
                    }
                }
            }
            IEnumerable <Hero> enumerable = _faction.Companions.Where((Hero m) => m.IsPlayerCompanion);

            foreach (Hero item in list)
            {
                Family.Add(new WangLordItemVM(item, OnMemberSelection));
            }
            foreach (Hero item2 in enumerable)
            {
                Companions.Add(new WangLordItemVM(item2, OnMemberSelection));
            }
            GameTexts.SetVariable("COMPANION_COUNT", _faction.Companions.Count());
            GameTexts.SetVariable("COMPANION_LIMIT", _faction.CompanionLimit);
            CompanionsText = GameTexts.FindText("str_companions_group").ToString();
            OnMemberSelection(GetDefaultMember());
        }