private static void ml_garrison_commander_intro_menu_init(MenuCallbackArgs args)
        {
            args.MenuTitle = new TextObject("Commander's Office", null);
            TextObject comment = new TextObject();

            if (Settlement.CurrentSettlement.OwnerClan == Hero.MainHero.Clan)
            {
                comment = new TextObject("{=ml.commander.town.clan}You knock on the door that says 'Commander,' and after a short wait a stout man with misadjusted spectacles comes and quickly hails you before speaking. \n \n 'Nothing to report, your {ML_PLAYER_G_PREFIX}ship. Is there something you need?'", null);
            }
            else if (Settlement.CurrentSettlement.MapFaction == Hero.MainHero.MapFaction)
            {
                comment = new TextObject("{=ml.commander.town.faction}You knock on the door that says 'Commander,' and after a short wait a stout man with misadjusted spectacles steps out and cordially greets you before speaking. \n \n 'Hello, my {ML_PLAYER_G_PREFIX}. I'll forward your business to the steward of this town when he returns. Is there something you need?'", null);
            }
            else
            {
                comment = new TextObject("{=ml.commander.town}You knock on the door that says 'Commander,' and after a short wait a stout man pushes open the door and greets you. \n \n 'Hmm? What is it? I'm a busy man.'", null);
            }

            if (Hero.MainHero.IsFemale)
            {
                comment.SetTextVariable("ML_PLAYER_G_PREFIX", "lady");
            }
            else
            {
                comment.SetTextVariable("ML_PLAYER_G_PREFIX", "lord");
            }

            MBTextManager.SetTextVariable("ML_COMMANDER_INTRO", comment);
        }
        private bool HireCustomMercsViaMenuConditionToPartyLimit(MenuCallbackArgs args)
        {
            if (MobileParty.MainParty.CurrentSettlement == null || !MobileParty.MainParty.CurrentSettlement.IsTown)
            {
                return(false);
            }
            CustomMercData customMercData = GetCustomMercDataOfPlayerEncounter();

            if (customMercData != null && customMercData.Number > 0)
            {
                int troopRecruitmentCost   = this.troopRecruitmentCost(customMercData);
                int numOfTroopSlotsOpen    = PartyBase.MainParty.PartySizeLimit - PartyBase.MainParty.NumberOfAllMembers;
                int numOfTroopPlayerCanBuy = (troopRecruitmentCost == 0) ? customMercData.Number : Hero.MainHero.Gold / troopRecruitmentCost;
                if (numOfTroopSlotsOpen > 0 && Hero.MainHero.Gold >= troopRecruitmentCost && numOfTroopSlotsOpen < customMercData.Number && numOfTroopSlotsOpen < numOfTroopPlayerCanBuy)
                {
                    int numOfMercs = Math.Min(customMercData.Number, numOfTroopPlayerCanBuy);
                    numOfMercs = Math.Min(numOfTroopSlotsOpen, numOfMercs);
                    MBTextManager.SetTextVariable("C_MEN_COUNT_PL", numOfMercs);
                    MBTextManager.SetTextVariable("C_MERCENARY_NAME_PL", customMercData.TroopInfoCharObject().Name);
                    MBTextManager.SetTextVariable("C_TOTAL_AMOUNT_PL", numOfMercs * troopRecruitmentCost);
                    args.optionLeaveType = GameMenuOption.LeaveType.RansomAndBribe;
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
        private bool ConversationConditionTalkToPrisonerInParty()
        {
            CharacterObject captive = CharacterObject.OneToOneConversationCharacter;

            if (captive != null && captive.IsHero && captive.HeroObject.GetSkillValue(CESkills.IsSlave) == 1)
            {
                if (captive.HeroObject.GetSkillValue(CESkills.Slavery) > 250)
                {
                    MBTextManager.SetTextVariable("RESPONSE_STRING", "{=CEEVENTS1053}Yes you came {?PLAYER.GENDER}mistress{?}master{\\?}! [ib:confident][rb:very_positive]");
                }
                else if (captive.HeroObject.GetSkillValue(CESkills.Slavery) > 100)
                {
                    MBTextManager.SetTextVariable("RESPONSE_STRING", "{=CEEVENTS1054}Yes {?PLAYER.GENDER}mistress{?}master{\\?} [ib:weary][rb:positive]");
                }
                else if (captive.HeroObject.GetSkillValue(CESkills.Slavery) > 50)
                {
                    MBTextManager.SetTextVariable("RESPONSE_STRING", "{=CEEVENTS1055}Yes? [ib:weary][rb:unsure]");
                }
                else
                {
                    MBTextManager.SetTextVariable("RESPONSE_STRING", "{=CEEVENTS1072}I am not your slave! [ib:aggressive][rb:very_negative]");
                }
            }
            else
            {
                MBTextManager.SetTextVariable("RESPONSE_STRING", "{=CEEVENTS1057}What do you want? [ib:nervous][rb:very_negative]");
            }

            return(Hero.OneToOneConversationHero != null && Hero.OneToOneConversationHero.PartyBelongedToAsPrisoner != null && Hero.OneToOneConversationHero.PartyBelongedToAsPrisoner.IsMobile && Hero.OneToOneConversationHero.HeroState == Hero.CharacterStates.Prisoner);
        }
Ejemplo n.º 4
0
        //Outputs the relationship change
        private void RelationshipOutput(int rel, int newRelation, String hero)
        {
            bool   ChatLogOutput = FTRConfig.newInstance.FTRInitialize.EnableChatLogOutput;
            String display       = "Error";
            Color  col           = new Color(1000, 1000, 1000);

            if (rel < 0)
            {
                display = FTRConfig.newInstance.GetMessage("Relation_Message", "On_Relation_Loss");
                MBTextManager.SetTextVariable("DECREASED_VALUE", rel);
                MBTextManager.SetTextVariable("NEW_RELATION_VALUE", newRelation);
                MBTextManager.SetTextVariable("HERO", hero);
                col = new Color(10000, 1000, 1000);
            }
            if (rel > 0)
            {
                display = FTRConfig.newInstance.GetMessage("Relation_Message", "On_Relation_Gain");
                MBTextManager.SetTextVariable("INCREASED_VALUE", rel);
                MBTextManager.SetTextVariable("NEW_RELATION_VALUE", newRelation);
                MBTextManager.SetTextVariable("HERO", hero);
                col = Color.FromUint(4282569842U);
            }
            if (ChatLogOutput == false)
            {
                TextObject popUpText = new TextObject(display, null);
                InformationManager.AddQuickInformation(popUpText, 0, null, "");
            }
            if (ChatLogOutput == true)
            {
                InformationManager.DisplayMessage(new InformationMessage(display, col));
            }
        }
Ejemplo n.º 5
0
        public void EstablishCamp(MobileParty parentParty)
        {
            var party = MobileParty.Create("main_player_camp:0");

            party.StringId = "main_player_camp:0";
            party.InitializeMobileParty(new TextObject("Player Camp"), new TroopRoster(), new TroopRoster(), MobileParty.MainParty.Position2D, 1f, 0.5f);

            var roster = MobileParty.MainParty.MemberRoster;

            roster.RemoveTroop(Hero.MainHero.CharacterObject);
            party.Party.AddMembers(roster.ToFlattenedRoster());
            roster.Clear();

            party.Party.ItemRoster.Add(MobileParty.MainParty.ItemRoster);
            MobileParty.MainParty.ItemRoster.RemoveAllItems();

            MobileParty.MainParty.AddElementToMemberRoster(Hero.MainHero.CharacterObject, 1);
            party.DisableAi();
            party.Party.Owner = Hero.MainHero;

            _establishedCamp = new PlayerEstablishedCamp
            {
                Party       = party,
                ParentParty = parentParty,
                IsTraining  = false,
            };

            MBTextManager.SetTextVariable("PLAYER_CAMP_RESOURCES", _establishedCamp.Party.GetNumDaysForFoodToLast());
        }
 private static bool game_menu_town_wait_on_condition(MenuCallbackArgs args)
 {
     args.MenuContext.GameMenu.AllowWaitingAutomatically();
     args.optionLeaveType = GameMenuOption.LeaveType.Wait;
     MBTextManager.SetTextVariable("CURRENT_SETTLEMENT", Settlement.CurrentSettlement.EncyclopediaLinkWithName, false);
     return(true);
 }
        private static void ml_garrison_buy_patrol_menu_init(MenuCallbackArgs args, Dictionary <string, List <TownPatrolData> > dict)
        {
            args.MenuTitle = new TextObject("Commander's Office", null);

            MBTextManager.SetTextVariable("ML_GARRISON_PATROL_NUM", dict[Settlement.CurrentSettlement.StringId].Count());
            MBTextManager.SetTextVariable("ML_GARRISON_PATROL_MAX", TownUtils.GetNumberOfDetachmentsFormable(Settlement.CurrentSettlement.Town));
        }
Ejemplo n.º 8
0
 private bool ArmorSmithDialogOnPayCondition()
 {
     MBTextManager.SetTextVariable("ITEM", selectedItem.Name);
     MBTextManager.SetTextVariable("COST", selectedItem.Value);
     goldPaidInAdvance = selectedItem.Value / 2;
     return(true);
 }
        private static void RecruitMercenaries(int count)
        {
            try
            {
                var cost = GetMercenaryCost();
                MobileParty.MainParty.AddElementToMemberRoster(PlayerEncounter.Settlement.Town.MercenaryData.TroopType, count,
                                                               false);
                GiveGoldAction.ApplyBetweenCharacters(Hero.MainHero, null, count * cost, true);
                CampaignEventDispatcher.Instance.OnUnitRecruited(PlayerEncounter.Settlement.Town.MercenaryData.TroopType, count);
                PlayerEncounter.Settlement.Town.MercenaryData.ChangeMercenaryCount(-count);

                if (count == 1)
                {
                    InformationManager.DisplayMessage(new InformationMessage(
                                                          $"You recruited one {PlayerEncounter.Settlement.Town.MercenaryData.TroopType.Name}."));
                }
                else
                {
                    InformationManager.DisplayMessage(new InformationMessage(
                                                          $"You recruited {count} {PlayerEncounter.Settlement.Town.MercenaryData.TroopType.Name}s."));
                }

                MBTextManager.SetTextVariable("GOLD_AMOUNT", count * cost, false);
                InformationManager.DisplayMessage(new InformationMessage(GameTexts.FindText("str_gold_removed_with_icon", null).ToString(), "event:/ui/notification/coins_negative"));
            }
            catch (Exception ex)
            {
                NativeMethods.MessageBox(IntPtr.Zero, ex.Message, "RecruitAllButton -- RecruitMercenaries", NativeMethods.MB_ICONERROR | NativeMethods.MB_OK);
            }
        }
Ejemplo n.º 10
0
 public static void Postfix(ref bool __result)
 {
     try
     {
         if (SettingsHelper.SubSystemEnabled(SubSystemType.LoyaltyInConversations, Hero.OneToOneConversationHero.Clan))
         {
             if (!__result && LoyaltyRebalance.EnsuredLoyalty.LoyaltyManager.CheckLoyalty(Hero.OneToOneConversationHero.Clan, Clan.PlayerClan.Kingdom))
             {
                 float RelationWithPlayer = Hero.OneToOneConversationHero.GetRelationWithPlayer();
                 if (RelationWithPlayer >= 30)
                 {
                     MBTextManager.SetTextVariable("LIEGE_IS_RELATIVE", new TextObject(LoyaltyFriendlyRefuse), false);
                 }
                 else
                 {
                     MBTextManager.SetTextVariable("LIEGE_IS_RELATIVE", new TextObject(!RelativesHelper.BloodRelatives(Hero.OneToOneConversationHero, Hero.MainHero) && RelationWithPlayer <= -10 ? LoyaltyRefuse : LoyaltyPoliteRefuse), false);
                 }
                 __result = true;
             }
         }
     }
     catch (Exception ex)
     {
         MethodInfo?methodInfo = MethodBase.GetCurrentMethod() as MethodInfo;
         DebugHelper.HandleException(ex, methodInfo, "Harmony patch for conversation_lord_from_ruling_clan_on_condition");
     }
 }
Ejemplo n.º 11
0
        public bool conversation_player_abortion_ask_on_condition()
        {
            Hero       conversationHero = Hero.OneToOneConversationHero;
            TextObject empty            = (TextObject)TextObject.Empty;

            MBTextManager.SetTextVariable("ABORTION_ASK", ((object)new TextObject(Utillty.ET("{=pcm_abor_ask_1}I don't want our unborn child anymore."), null)).ToString(), false);
            return(PregCampHelper.IsInPregnancies(conversationHero, Hero.MainHero) && !this.IsPreAbortion(conversationHero));
        }
        // Conditions for Hiring options and functions that follow
        private bool custom_mercenary_hire_one_condition()
        {
            CustomMercData customMercData         = GetCustomMercDataOfPlayerEncounter();
            int            troopRecruitmentCost   = this.troopRecruitmentCost(customMercData);
            int            numOfTroopPlayerCanBuy = Hero.MainHero.Gold / troopRecruitmentCost;

            MBTextManager.SetTextVariable("CMERCS_GOLD_AMOUNT_FOR_ONE", troopRecruitmentCost);
            return(1 < customMercData.Number && numOfTroopPlayerCanBuy > 1);
        }
Ejemplo n.º 13
0
        public bool conversation_player_abortion_reply_on_condition()
        {
            Hero       conversationHero = Hero.OneToOneConversationHero;
            TextObject empty            = (TextObject)TextObject.Empty;

            MBTextManager.SetTextVariable("ABORTION_REPLY", ((object)new TextObject(Utillty.ET("{=pcm_abor_reply_1}Ok."), null)).ToString(), false);
            this.RecordPreAbortion(conversationHero, Hero.MainHero);
            return(true);
        }
Ejemplo n.º 14
0
 private void WishCurrentMemberPerks()
 {
     if (CanWashPerks)
     {
         var time = (3 - Campaign.Current.GetCampaignBehavior <HeroLearningSkillBehaviour>().GetWishPerkTime(CurrentSelectedMember.GetHero())).ToString();
         MBTextManager.SetTextVariable("WASH_TIME", time);
         InformationManager.ShowInquiry(new InquiryData(string.Empty, new TextObject("{=wang_washPerkConfirm}you now wash perks? current hero remains {WASH_TIME}").ToString(), isAffirmativeOptionShown: true, isNegativeOptionShown: true, GameTexts.FindText("str_yes").ToString(), GameTexts.FindText("str_no").ToString(), OnWishPerks, null));
     }
 }
Ejemplo n.º 15
0
        private static bool ProductionCondition(MenuCallbackArgs args)
        {
            var stash = GetCurrentSettlementStash();
            MBTextManager.SetTextVariable("STASH_INPUT", stash.InputTrue ? "Yes" : "No", true);
            MBTextManager.SetTextVariable("STASH_OUTPUT", stash.OutputTrue ? "Yes" : "No", true);

            args.optionLeaveType = GameMenuOption.LeaveType.Craft;
            return true;
        }
Ejemplo n.º 16
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);
        }
        private bool custom_mercenary_hire_all_condition()
        {
            CustomMercData customMercData       = GetCustomMercDataOfPlayerEncounter();
            int            troopRecruitmentCost = this.troopRecruitmentCost(customMercData);
            int            numOfTroopSlotsOpen  = PartyBase.MainParty.PartySizeLimit - PartyBase.MainParty.NumberOfAllMembers;

            MBTextManager.SetTextVariable("CMERCS_PLURAL", (customMercData.Number > 1) ? 1 : 0);
            MBTextManager.SetTextVariable("CMERCS_GOLD_AMOUNT_ALL", troopRecruitmentCost * customMercData.Number);
            return(Hero.MainHero.Gold >= customMercData.Number * troopRecruitmentCost && numOfTroopSlotsOpen >= customMercData.Number);
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Updates the bank menu headline text variable with current values.
 /// </summary>
 private void UpdateBankMenuText()
 {
     MBTextManager.SetTextVariable(
         "IronBank_Menu_Bank",
         $"\"Welcome to the <b>Iron Bank</b> embassy of {Settlement.CurrentSettlement?.EncyclopediaLinkWithName}\", says the emissary.\n" +
         $"Your bank account balance is <b>{BankAccount.Gold}</b>{{GOLD_ICON}}.\n" +
         $"Daily interest rate is {BankAccount.InterestsRate:P} ({BankAccount.ReinvestmentRatio * 100:0}% will stay on your account).",
         false
         );
 }
 private void UpdateBankMenuTextVariables()
 {
     MBTextManager.SetTextVariable("XORBERAX_BANKS_SETTLEMENT_NAME", Settlement.CurrentSettlement.Name);
     MBTextManager.SetTextVariable("XORBERAX_BANKS_BALANCE", GetBalanceAtSettlement(Settlement.CurrentSettlement));
     MBTextManager.SetTextVariable("XORBERAX_BANKS_INTEREST_RATE", $"{GetInterestRateAtSettlement(Settlement.CurrentSettlement):0.0000}");
     MBTextManager.SetTextVariable("XORBERAX_BANKS_BANK_ACCOUNT_OPENING_COST", GetBankAccountOpeningCostAtSettlement(Settlement.CurrentSettlement));
     MBTextManager.SetTextVariable("XORBERAX_BANKS_REMAINING_UNPAID_LOAN", GetRemainingUnpaidLoanAtSettlement(Settlement.CurrentSettlement));
     MBTextManager.SetTextVariable("XORBERAX_BANKS_LOAN_INFO", BuildLoanInfoText(Settlement.CurrentSettlement));
     MBTextManager.SetTextVariable("XORBERAX_BANKS_BANK_ACCOUNT_INFO", BuildBankAccountInfoText(Settlement.CurrentSettlement));
 }
        private bool JawwalResponse2Setup()
        {
            var townMerchants       = new List <Hero>(Hero.MainHero.CurrentSettlement.Notables).FindAll(h => h.CharacterObject.Occupation == Occupation.Merchant);
            var pickedMerchantIndex = (new Random()).Next(0, townMerchants.Count);

            questGiver = townMerchants[pickedMerchantIndex];
            MBTextManager.SetTextVariable("MERCHANT", questGiver.Name);
            MBTextManager.SetTextVariable("IS_MALE", questGiver.IsFemale ? 0 : 1);
            return(true);
        }
        private static void ml_town_init_garrison_menu(MenuCallbackArgs args)
        {
            args.MenuTitle = new TextObject("{ml.garrison.title}Garrison Headquarters", null);
            MBTextManager.SetTextVariable("ML_GARRISON_TOWN_NAME", Settlement.CurrentSettlement.Name, false);
            float garrisonSatsifaction = TownUtils.CalculateGarrisonSatsifaction(Settlement.CurrentSettlement.Town);

            switch (Settlement.CurrentSettlement.Town.GetProsperityLevel())
            {
            case SettlementComponent.ProsperityLevel.Low:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "modest wooden stockade");
                break;

            case SettlementComponent.ProsperityLevel.Mid:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "stout wooden blockhouse");
                break;

            case SettlementComponent.ProsperityLevel.High:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "large stone towerhouse");
                break;
            }

            switch (Settlement.CurrentSettlement.Town.GetProsperityLevel())
            {
            case SettlementComponent.ProsperityLevel.Low:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of destitution. The soldiers look underfed and glance longingly at their empty coin pouches between swigs of cheap alcohol. Some men curse out their commanders and lords in the corner.");
                break;

            case SettlementComponent.ProsperityLevel.Mid:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of typical military attitude. One or two men curse the commander under their breath, and some look on at the town with displeasure, but generally everyone is adquately fed and well enough off for their status.");
                break;

            case SettlementComponent.ProsperityLevel.High:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of general happiness and camraderie. The men look content and well-fed, and they sling jokes back and forth. Everyone seems like friends.");
                break;
            }

            float num = MBRandom.RandomFloatRanged(0, 1f);

            if (num <= 0.25)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "soldiers milling about, playing board games and catching up on the latest gossip.");
            }
            else if (num <= 0.5)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "soldiers and stewards moving about on duty. On the officer's desk, there's a colossal stack of parchments.");
            }
            else if (num <= 0.75)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "a handful of guards chatting in a corner, their comrades diligently watching the ramparts just outside.");
            }
            else
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "a smattering of armed men lounging about, some eating or catching up on sleep.");
            }
        }
Ejemplo n.º 22
0
 private bool player_needs_heal_on_condition(MenuCallbackArgs args)
 {
     if (Hero.MainHero.HitPoints < Hero.MainHero.MaxHitPoints)
     {
         int price = PriceToHeal(Hero.MainHero);
         MBTextManager.SetTextVariable("HEAL_SELF_AMOUNT", price);
         args.optionLeaveType = GameMenuOption.LeaveType.RansomAndBribe;
         return(true);
     }
     return(false);
 }
 private void InformSergeantPlayer()
 {
     if (Mission.Current.MainAgent == null || this.formation.Team.GeneralAgent == null || (this.formation.Team.IsPlayerGeneral || !this.formation.Team.IsPlayerSergeant) || this.formation.PlayerOwner != Agent.Main)
     {
         return;
     }
     MBTextManager.SetTextVariable("BEHAVIOR", this.GetBehaviorString(), false);
     MBTextManager.SetTextVariable("PLAYER_NAME", Mission.Current.MainAgent.Name, false);
     MBTextManager.SetTextVariable("TEAM_LEADER", this.formation.Team.GeneralAgent.Name, false);
     InformationManager.AddQuickInformation(new TextObject("{=L91XKoMD}{TEAM_LEADER}: {PLAYER_NAME}, {BEHAVIOR}"), 4000, this.formation.Team.GeneralAgent.Character);
 }
Ejemplo n.º 24
0
        private bool town_notable_rebellion_condition()
        {
            if (Settlement.CurrentSettlement != null)
            {
                MBTextManager.SetTextVariable("FACTION_NAME", Settlement.CurrentSettlement.MapFaction.Name, false);
            }

            IFaction faction;

            return(Hero.OneToOneConversationHero != null && Hero.OneToOneConversationHero.IsNotable && Hero.OneToOneConversationHero.SupporterOf == Hero.MainHero.Clan && Settlement.CurrentSettlement != null && Hero.MainHero.MapFaction != Settlement.CurrentSettlement.MapFaction && Hero.OneToOneConversationHero.Culture != Settlement.CurrentSettlement.MapFaction.Culture && Hero.OneToOneConversationHero.Culture != Settlement.CurrentSettlement.OwnerClan.Culture && !RebelliousNotables.TryGetValue(Hero.OneToOneConversationHero, out faction));
        }
Ejemplo n.º 25
0
        public bool conversation_player_sex_nor_ask_on_condition()
        {
            Hero       mainHero         = Hero.MainHero;
            Hero       conversationHero = Hero.OneToOneConversationHero;
            bool       flag1            = Config.Instance.EnableNotSpouseGaySex || (mainHero == conversationHero.Spouse || mainHero.IsFemale != conversationHero.IsFemale);
            bool       sex   = this.IsEnoughRealtionToSex(mainHero, conversationHero);
            bool       flag2 = this.IsSexEnableToday(mainHero);
            TextObject empty = (TextObject)TextObject.Empty;

            MBTextManager.SetTextVariable("SEX_NOR_ASK", ((object)new TextObject(Utillty.ET("{=pcm_sex_nor_ask_1}Less talking! More f*****g!"), null)).ToString(), false);
            return(!conversationHero.IsWanderer & flag1 & sex & flag2);
        }
Ejemplo n.º 26
0
 private bool town_notable_rebellion_ask_2a_condition()
 {
     if (Settlement.CurrentSettlement.IsVillage)
     {
         MBTextManager.SetTextVariable("LOYALTY", new TextObject(Settlement.CurrentSettlement.Village.Bound.Town.Loyalty.ToString()), false);
         return(Settlement.CurrentSettlement.Village.Bound.Town.Loyalty > (double)Campaign.Current.Models.SettlementLoyaltyModel.RebelliousStateStartLoyaltyThreshold);
     }
     else
     {
         MBTextManager.SetTextVariable("LOYALTY", new TextObject(Settlement.CurrentSettlement.Town.Loyalty.ToString()), false);
         return(Settlement.CurrentSettlement.Town.Loyalty > (double)Campaign.Current.Models.SettlementLoyaltyModel.RebelliousStateStartLoyaltyThreshold);
     }
 }
Ejemplo n.º 27
0
        public void AddTroopMenu(CampaignGameStarter obj)
        {
            obj.AddGameMenuOption("town", "info_troop_type", "Recruit a Bandit Brigand from the local Gangleader. (30)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits5(30); }, false, 5);
            obj.AddGameMenuOption("town", "info_troop_type", "Recruit Asyrina and her Frostmaiden. (1000)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits6(1000); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit Klyka the Banditlord and his Warrior. (1000)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits(1000); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit Rengo and his Merry Men. (1000)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits7(1000); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit Bandit Squad (500)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits1(500); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit a Horsethief (30)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits2(30); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit Recruit Bandit Ambusher (50)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits3(50); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit Ruffian and Cutthroat (30)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits4(30); }, false, 5);
            obj.AddGameMenuOption("hideout_place", "info_troop_type", "Recruit a Bandit Brigand (30)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits5(30); }, false, 5);
            obj.AddGameMenuOption("info_troop_type", "info_troop_type", "Recruit a Bandit Brigand from the local Gangleader. (30)", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { AddHideoutBandits5(30); }, false, 5);


            obj.AddGameMenu("test", "The guild manager goes to the back and after a while comes back to the front with two lists of available mercenaries. " +
                            "{RENOWN_STATUS} " +
                            "The ones you paid for will wait by the gates.",
                            (MenuCallbackArgs args) =>
            {
                if (Clan.PlayerClan.Tier == 0)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She tells you that no one here has heard of you so not many are willing to join.", false);
                }
                else if (Clan.PlayerClan.Tier == 1)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She tells you that she cannot remember you or your face but some of their trainees were talking about you.", false);
                }
                else if (Clan.PlayerClan.Tier == 2)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She thanks you for waiting and tells you that some of their trainees were waiting for you to come again.", false);
                }
                else if (Clan.PlayerClan.Tier == 3)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She thanks you for waiting and tells you that some of their experienced members were discussing your exploits from time to time.", false);
                }
                else if (Clan.PlayerClan.Tier == 4)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She thanks you for your patronage and tells you that noblemen are declining other requests to join you instead.", false);
                }
                else if (Clan.PlayerClan.Tier == 5)
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She bows and thanks you for your continued patronage. She tells you that there is now a waiting list to get on the list to join your party.", false);
                }
                else
                {
                    MBTextManager.SetTextVariable("RENOWN_STATUS", "She bows and thanks you for your continued patronage. The whole guild is entirely maintained with your money at this point.", false);
                }
            });

            obj.AddGameMenuOption("town", "info_troop_type", "Hire Basilisk Guild Troops", game_menu_just_add_recruit_conditional, (MenuCallbackArgs args) => { GameMenu.SwitchToMenu("test"); }, false, 5);
        }
        private bool ml_player_purchase_med_group_condition(bool keyPresent)
        {
            float pRelation            = Hero.OneToOneConversationHero.GetRelationWithPlayer();
            bool  overallDisadvantaged = DiplomacyUtils.IsFactionOverallAtDisadvantage(Hero.OneToOneConversationHero.MapFaction);

            if (keyPresent)
            {
                return(false);
            }
            else if (PlayerEncounter.InsideSettlement)
            {
                return(false);
            }
            else if (MobileParty.ConversationParty.MemberRoster.TotalHealthyCount < 60)
            {
                return(false);
            }
            else if ((Hero.MainHero.MapFaction == Hero.OneToOneConversationHero.MapFaction) && overallDisadvantaged)
            {
                return(false);
            }
            else if ((Hero.MainHero.MapFaction == Hero.OneToOneConversationHero.MapFaction) && (pRelation <= -10))
            {
                return(false);
            }
            else if (Hero.OneToOneConversationHero.MapFaction.IsKingdomFaction)
            {
                return(false);
            }
            else if (pRelation <= -10)
            {
                return(false);
            }
            else
            {
                int num = (int)(MobileParty.ConversationParty.MemberRoster.TotalHealthyCount * 0.12f);
                MBTextManager.SetTextVariable("MD_TROOP_NUM", num);

                if ((int)(num * 0.1f) >= 1)
                {
                    MBTextManager.SetTextVariable("MD_OFF_NUM", (int)(num * 0.1f));
                }
                else
                {
                    MBTextManager.SetTextVariable("MD_OFF_NUM", "no");
                }

                MBTextManager.SetTextVariable("MD_GOLD_AMOUNT", num * 45);
                return((num > 0) && (Hero.MainHero.Gold > num * 45));
            }
        }
Ejemplo n.º 29
0
        private void UpdateRecruiterMenuTextVariables()
        {
            MBTextManager.SetTextVariable("DANGER_RECRUITER_SETTLEMENT_NAME", Settlement.CurrentSettlement.Name);

            // cost
            var recruiterData = GetRecruiterDataAtSettlement(Settlement.CurrentSettlement);

            MBTextManager.SetTextVariable("DANGER_RECRUITER_COST", GetRecruiterCost(recruiterData.RecruiterLevel + 1));

            // recruits per day
            MBTextManager.SetTextVariable("DANGER_RECRUITS_PER_DAY", GetRecruitsPerDay(recruiterData.RecruiterLevel + 1));

            // title
            var recruiterTitle = recruiterData.RecruiterLevel >= 1
                ? $"recruiter (Level {recruiterData.RecruiterLevel})"
                : "recruiter";

            MBTextManager.SetTextVariable("DANGER_RECRUITER_TITLE", recruiterTitle);

            // action
            var recruiterAction = recruiterData.RecruiterLevel == 0
                ? "Hire a recruiter"
                : $"Upgrade to Level {recruiterData.RecruiterLevel + 1} ({GetRecruitsPerDay(recruiterData.RecruiterLevel + 1)} per day)";

            MBTextManager.SetTextVariable("DANGER_RECRUITER_ACTION", recruiterAction);

            // enable or disable
            var recruiterEnableOrDisable = recruiterData.IsRecruiterEnabled
                ? $"Disable recruiter in {Settlement.CurrentSettlement.Name}"
                : $"Enable recruiter in {Settlement.CurrentSettlement.Name}";

            MBTextManager.SetTextVariable("DANGER_RECRUITER_ENABLE_OR_DISABLE", recruiterEnableOrDisable);

            // increase and decrease limit
            MBTextManager.SetTextVariable("DANGER_RECRUITER_CURRENT_LIMIT", $"Current limit: {GetRecruiterDataAtSettlement(Settlement.CurrentSettlement).MaxPercentOfUnitsInGarrison}% of the garrison's max limit.");
            MBTextManager.SetTextVariable("DANGER_RECRUITER_INCREASE_LIMIT", $"Increase limit to {GetIncreaseLimitInPercent(Settlement.CurrentSettlement)}%.");
            MBTextManager.SetTextVariable("DANGER_RECRUITER_DECREASE_LIMIT", $"Decrease limit to {GetDecreaseLimitInPercent(Settlement.CurrentSettlement)}%.");
            MBTextManager.SetTextVariable("DANGER_RECRUITER_APPLY_SAME_LIMIT_TO_ALL", $"Apply this limit to all settlements ({GetRecruiterDataAtSettlement(Settlement.CurrentSettlement).MaxPercentOfUnitsInGarrison}%).");

            // info
            var recruitsPerDay = GetRecruitsPerDayAtSettlement(Settlement.CurrentSettlement);
            var recruiterInfo  = recruiterData.HasRecruiter
                ? $"The {recruiterTitle} is active, {recruitsPerDay} new recruits will join your garrison every day."
                : "There is no active recruiter yet. Hire one to get 5 new recruits in your garrison every day.";

            if ((recruiterData.HasRecruiter && !recruiterData.IsRecruiterEnabled) || recruiterData.MaxPercentOfUnitsInGarrison == 0)
            {
                recruiterInfo = $"The {recruiterTitle} produces no recruits because it is disabled or the limit is set too low.";
            }
            MBTextManager.SetTextVariable("DANGER_RECRUITER_INFO", recruiterInfo);
        }
Ejemplo n.º 30
0
        private bool party_characters_needs_heal_on_condition(MenuCallbackArgs args)
        {
            int numberInjured = 0;
            int price         = 0;

            CalculatePriceAndNumInjured(ref price, ref numberInjured, true, false);
            if (numberInjured > 1 && Hero.MainHero.HitPoints < Hero.MainHero.MaxHitPoints)
            {
                MBTextManager.SetTextVariable("HEAL_ALL_AMOUNT", price);
                args.optionLeaveType = GameMenuOption.LeaveType.RansomAndBribe;
                return(true);
            }
            return(false);
        }