Пример #1
0
        public static Bonus <long> GetChurnBonus(GameContext gameContext, GameEntity c)
        {
            var state = Markets.GetMarketState(gameContext, c.product.Niche);

            var fromProductLevel = Products.GetDifferenceBetweenMarketDemandAndAppConcept(c, gameContext);
            var marketIsDying    = state == MarketState.Death;


            var niche        = Markets.GetNiche(gameContext, c.product.Niche);
            var monetisation = niche.nicheBaseProfile.Profile.MonetisationType;
            var baseValue    = GetChurnRateBasedOnMonetisationType(monetisation);

            var isCompetitorDumping = HasDumpingCompetitors(gameContext, c);

            var retentionImprovement = c.features.features[ProductFeature.Retention];

            return(new Bonus <long>("Churn rate")
                   .RenderTitle()
                   .SetDimension("%")
                   .Append("Base value for " + Enums.GetFormattedMonetisationType(monetisation), baseValue)
                   .Append("Retention features", -retentionImprovement * 2)

                   .AppendAndHideIfZero("DUMPING", c.isDumping ? -100 : 0)
                   .AppendAndHideIfZero("Competitor is DUMPING", isCompetitorDumping ? 15 : 0)

                   .Append($"Concept difference to market ({fromProductLevel})", fromProductLevel * fromProductLevel)
                   .AppendAndHideIfZero("Market is DYING", marketIsDying ? 5 : 0)
                   .Cap(1, 100)
                   );
        }
Пример #2
0
        public static int GetNecessaryAmountOfProgrammers(GameEntity e, GameContext gameContext)
        {
            var concept    = Products.GetProductLevel(e);
            var niche      = Markets.GetNiche(gameContext, e);
            var complexity = (int)niche.nicheBaseProfile.Profile.AppComplexity;

            return((int)Mathf.Pow(1 + complexity / 20f, concept));
        }
Пример #3
0
        public static float GetBrandBasedMarketShare(GameEntity e, GameContext gameContext)
        {
            var niche = Markets.GetNiche(gameContext, e);

            var sumOfBrandPowers = GetSumOfBrandPowers(niche, gameContext);

            // +1 : avoid division by zero
            return(e.branding.BrandPower / (sumOfBrandPowers + 1));
        }
Пример #4
0
        // always positive or equal to zero
        public static int GetDifferenceBetweenMarketDemandAndAppConcept(GameEntity product, GameContext gameContext)
        {
            var niche = Markets.GetNiche(gameContext, product.product.Niche);

            var demand = GetMarketDemand(niche);
            var level  = GetProductLevel(product);

            return(demand - level);
        }
Пример #5
0
        public static float GetMonetisationModifier(GameContext gameContext, GameEntity c)
        {
            var niche = Markets.GetNiche(gameContext, c.product.Niche);

            var pricingType = niche.nicheBaseProfile.Profile.MonetisationType;

            var baseValue  = GetBaseMonetisationValue(pricingType);
            var multiplier = GetImprovementMonetisationValue(pricingType);


            var improvements = c.features.features[ProductFeature.Monetisation];

            return(baseValue + improvements * multiplier / 100);
        }
Пример #6
0
        // TODO remove
        public static void SetFounderAmbitionDueToMarketSize(GameEntity company, GameContext gameContext)
        {
            var niche  = Markets.GetNiche(gameContext, company.product.Niche);
            var rating = Markets.GetMarketPotentialRating(niche);


            var rand = UnityEngine.Random.Range(1f, 2f) * 5;

            // 5...25
            var ambition = 65 + Mathf.Clamp(rating * rand, 0, 30);
            var CeoId    = GetCEOId(company);

            var ceo = Humans.GetHuman(gameContext, CeoId);

            Humans.SetTrait(ceo, TraitType.Ambitions, (int)ambition);
        }
Пример #7
0
        public static long GetBaseClientsForNewCompanies(GameContext gameContext, NicheType nicheType)
        {
            var niche = Markets.GetNiche(gameContext, nicheType);

            var monetisation = niche.nicheBaseProfile.Profile.MonetisationType;

            switch (monetisation)
            {
            case Monetisation.Adverts: return(5000);

            case Monetisation.Enterprise: return(3);

            case Monetisation.Paid: return(100);

            case Monetisation.Service: return(500);

            case Monetisation.IrregularPaid: return(350);

            default: return(0);
            }
        }
Пример #8
0
 public static GameEntity[] GetDumpingCompetitors(GameContext gameContext, GameEntity product) => GetDumpingCompetitors(gameContext, Markets.GetNiche(gameContext, product), product);
Пример #9
0
 public static float GetSumOfBrandPowers(NicheType nicheType, GameContext gameContext) => GetSumOfBrandPowers(Markets.GetNiche(gameContext, nicheType), gameContext);
Пример #10
0
 public static int GetBaseIterationTime(GameContext gameContext, GameEntity company) => GetBaseIterationTime(Markets.GetNiche(gameContext, company));
Пример #11
0
        public static int GetMarketRequirements(GameEntity product, GameContext gameContext)
        {
            var niche = Markets.GetNiche(gameContext, product.product.Niche);

            return(GetMarketDemand(niche));
        }
Пример #12
0
 public static void SetStartCapital(GameEntity product, GameContext gameContext) => SetStartCapital(product, Markets.GetNiche(gameContext, product), gameContext);