Ejemplo n.º 1
0
        private void ConversationCEEventBrothelOnConsequence()
        {
            CharacterObject captive = CharacterObject.OneToOneConversationCharacter;

            captive.HeroObject.PartyBelongedToAsPrisoner.AddPrisoner(captive, -1);
            PartyBase.MainParty.AddPrisoner(captive, 1);

            CEBrothelBehavior.AddBrothelPrisoner(Settlement.CurrentSettlement, captive);
        }
Ejemplo n.º 2
0
 private bool ConversationCEEventBrothelOnCondition(out TextObject text)
 {
     text = TextObject.Empty;
     if (Settlement.CurrentSettlement != null && CEBrothelBehavior.DoesOwnBrothelInSettlement(Settlement.CurrentSettlement))
     {
         return(true);
     }
     text = new TextObject("{=}You do not own the brothel in this settlement.");
     return(false);
 }
Ejemplo n.º 3
0
        private void ExecuteSellBrothel(object identifier)
        {
            if (_brothel == null)
            {
                return;
            }
            GiveGoldAction.ApplyBetweenCharacters(null, Hero.MainHero, _brothel.Capital);
            CEBrothelBehavior.BrothelInteraction(_brothel.Settlement, false);

            Action onRefresh = _onRefresh;

            onRefresh?.Invoke();
        }
        private static void CalculateClanIncomeInternal(Clan clan, ref ExplainedNumber goldChange, bool applyWithdrawals = false)
        {
            if (clan.IsEliminated)
            {
                return;
            }

            if (Clan.PlayerClan != clan)
            {
                return;
            }
            int num  = 0;
            int num2 = 0;

            foreach (CEBrothel brothel in CEBrothelBehavior.GetPlayerBrothels())
            {
                if (brothel.IsRunning)
                {
                    int num3 = (int)(Math.Max(0, brothel.ProfitMade) / Campaign.Current.Models.ClanFinanceModel.RevenueSmoothenFraction());
                    num3 *= (brothel.Level + 1);
                    num  += num3;

                    if (applyWithdrawals && num3 > 0)
                    {
                        brothel.ChangeGold(-num3);
                    }

                    if (num3 > 0 && Hero.MainHero.Clan.Leader.GetPerkValue(DefaultPerks.Trade.ArtisanCommunity) && applyWithdrawals)
                    {
                        num2++;
                    }
                }
            }

            goldChange.Add(num, new TextObject("{=CEBROTHEL1001}Brothel income."));
            if (Hero.MainHero.Clan.Leader.GetPerkValue(DefaultPerks.Trade.ArtisanCommunity) && applyWithdrawals)
            {
                Hero.MainHero.Clan.AddRenown(num2 * DefaultPerks.Trade.ArtisanCommunity.PrimaryBonus);
            }
        }