Пример #1
0
        public static Bonus <int> GetManagerGrowthBonus(GameEntity worker, TeamInfo teamInfo, bool hasTeacherInTeam, GameContext gameContext)
        {
            var rating = Humans.GetRating(worker);

            bool isCurious = worker.humanSkills.Traits.Contains(Trait.Curious);

            var bonus = new Bonus <int>("Growth");

            bonus
            //.Append("Base", 25)
            .Append("Rating", (int)Mathf.Pow(100 - rating, 0.95f))
            .AppendAndHideIfZero("Curious", isCurious ? 15 : 0)
            .AppendAndHideIfZero("Works with Teacher", hasTeacherInTeam ? 7 : 0)
            ;

            // market complexity
            // worker current rating (noob - fast growth, senior - slow)
            // trait: curious
            // consultant
            // loyalty change

            bonus.Cap(0, (rating < 100) ? 100 : 0);

            return(bonus);
        }
Пример #2
0
        public static Bonus <float> GetChurnRate(GameEntity c, GameContext gameContext, bool isBonus)
        {
            // market state
            var state         = c.nicheState.Phase;
            var marketIsDying = state == MarketState.Death;

            var baseRate = new Bonus <float>("Churn rate")
                           .RenderTitle()
                           .SetDimension("%")

                           .Append("Base", 10)
                           .AppendAndHideIfZero("Market is DYING", marketIsDying ? 5 : 0);

            ApplyChurnRateFromFeatures(baseRate, gameContext, c);

            return(baseRate.Cap(1, 40));
        }
Пример #3
0
        public static Bonus <float> GetFeatureRatingCap(GameEntity product, TeamInfo team, GameContext gameContext)
        {
            var productManager = Teams.GetWorkerInRole(team, WorkerRole.ProductManager, gameContext);

            var bonus = new Bonus <float>("Max feature lvl");

            bonus.Append("Base", 3f);
            bonus.AppendAndHideIfZero("Development Team", team.TeamType == TeamType.DevelopmentTeam ? 1f : 0);

            if (productManager != null)
            {
                // ... 5f
                var addedCap = 6 * Humans.GetRating(productManager) / 100f;

                bonus.AppendAndHideIfZero("Product Manager", addedCap);
            }

            // var culture = Companies.GetOwnCulture(Companies.GetManagingCompanyOf(product, gameContext));
            //
            // var cultureBonus = (10 - culture[CorporatePolicy.DoOrDelegate]) * 0.2f;
            // var cultureBonus2 = (culture[CorporatePolicy.DecisionsManagerOrTeam]) * 0.4f;
            //
            // bonus.Append("Corporate culture Do or Delegate", cultureBonus);
            // bonus.Append("Corporate culture Structure", cultureBonus2);


            //bool hasMainManager = Teams.HasMainManagerInTeam(team, gameContext, product);
            //if (hasMainManager)
            //{
            //    var focus = team.ManagerTasks.Count(t => t == ManagerTask.Polishing);
            //    cap += focus * 0.4f;
            //}

            bonus.Cap(0, 10);

            return(bonus);

            //return Mathf.Clamp(cap, 0, 10);
        }