Beispiel #1
0
        private static long GiveInnovationBenefits(GameEntity product, GameContext gameContext, bool revolution)
        {
            long sum = 0;

            if (revolution)
            {
                // get your competitor's clients
                var innovatorCompetitors = Markets.GetProductsOnMarket(gameContext, product)
                                           .Where(p => p.isRelease)
                                           .Where(p => p.company.Id != product.company.Id);


                foreach (var p in innovatorCompetitors)
                {
                    var disloyal = Marketing.GetUsers(p) / 15;

                    //Marketing.LoseClients(p, disloyal);
                    //Marketing.AddClients(product, disloyal);

                    sum += disloyal;
                }
            }

            return(sum);
        }
        public static long GetIncomePerSegment(GameEntity company)
        {
            int segmentId = 0;

            var clients       = Marketing.GetUsers(company);
            var incomePerUser = GetIncomePerUser(company, segmentId);

            return(Convert.ToInt64(clients * incomePerUser));
        }
        public static long GetClientLoad(GameEntity product)
        {
            long attack = 0;

            if (product.hasServerAttack)
            {
                attack = product.serverAttack.Load;
            }

            return(Marketing.GetUsers(product) + attack); // add DDoS multiplier ??
        }
Beispiel #4
0
        private static List <GoalRequirements> GetInvestmentGoalMillionUsersReqs(InvestmentGoal goal, GameEntity company, GameContext gameContext)
        {
            var        g       = goal as InvestmentGoalMillionUsers;
            GameEntity product = GetProduct(goal, company, gameContext);

            return(new List <GoalRequirements>
            {
                new GoalRequirements
                {
                    have = Marketing.GetUsers(product),
                    need = 1_000_000,

                    description = "Users > " + Format.Minify(g.TargetUsersAmount)
                }
            });
        internal static void ReturnUsersWhenCompanyIsClosed(GameEntity e, GameContext gameContext)
        {
            var users = Marketing.GetUsers(e);

            var niche = Get(gameContext, e.product.Niche);

            var companies = GetProductsOnMarket(gameContext, e.company.Id);

            var powers = companies.Sum(c => c.branding.BrandPower + 1) - e.branding.BrandPower;

            //foreach (var c in companies)
            //{
            //    if (c == e)
            //        continue;

            //    var part = (long)((1 + c.branding.BrandPower) * users / powers);
            //    Marketing.AddClients(c, part);
            //}

            //Marketing.AddClients(e, -users);
        }
        public static List <InvestmentGoal> GetProductGoals(GameEntity product, GameContext Q)
        {
            var goals = new List <InvestmentGoal>();

            // productOnly goals
            var productGoals = new List <InvestorGoalType>
            {
                InvestorGoalType.ProductPrototype,
                InvestorGoalType.ProductFirstUsers,
                InvestorGoalType.ProductBecomeMarketFit,
                InvestorGoalType.ProductRelease,

                InvestorGoalType.ProductStartMonetising,
                InvestorGoalType.GrowUserBase,
                InvestorGoalType.OutcompeteCompanyByUsers,
                InvestorGoalType.GainMoreSegments,

                InvestorGoalType.ProductRegainLoyalty,
            };

            #region data
            bool isPrototype     = !product.isRelease;
            bool releasedProduct = product.isRelease;

            long users = Marketing.GetUsers(product);
            #endregion

            if (isPrototype)
            {
                // has no goals at start
                if (!Completed(product, InvestorGoalType.ProductPrototype))
                {
                    return(OnlyGoal(new InvestmentGoalMakePrototype()));
                }
                else
                {
                    AddOnce(goals, product, new InvestmentGoalFirstUsers(5_000));
                }

                if (Completed(product, InvestorGoalType.ProductFirstUsers))
                {
                    AddOnce(goals, product, new InvestmentGoalMakeProductMarketFit());
                }

                if (Completed(product, InvestorGoalType.ProductBecomeMarketFit))
                {
                    AddOnce(goals, product, new InvestmentGoalPrepareForRelease());
                }

                if (Completed(product, InvestorGoalType.ProductPrepareForRelease))
                {
                    AddOnce(goals, product, new InvestmentGoalRelease());
                }
            }

            if (releasedProduct)
            {
                if (Completed(product, InvestorGoalType.ProductRelease))
                {
                    AddOnce(goals, product, new InvestmentGoalStartMonetisation());
                }

                if (Completed(product, InvestorGoalType.ProductStartMonetising))
                {
                    goals.Add(new InvestmentGoalGrowAudience(Marketing.GetUsers(product) * 2));
                }

                if (Completed(product, InvestorGoalType.GrowUserBase))
                {
                    if (users < 1_000_000)
                    {
                        AddOnce(goals, product, new InvestmentGoalMillionUsers(1_000_000));
                        goals.RemoveAll(g => g.InvestorGoalType == InvestorGoalType.GrowUserBase);
                    }

                    // protect from no goals situation
                    if (goals.Count == 0)
                    {
                        goals.Add(new InvestmentGoalGrowAudience(Marketing.GetUsers(product) * 2));
                    }
                }
            }

            /*if (Marketing.IsHasDisloyalAudiences(product))
             *  return OnlyGoal(new InvestmentGoalRegainLoyalty());*/
            //return OnlyGoal(InvestorGoalType.ProductRegainLoyalty);

            return(goals);
        }