Exemplo n.º 1
0
        public static Bonus <long> GetInnovationChanceBonus(GameEntity product, GameContext gameContext)
        {
            // market state
            var niche       = Markets.Get(gameContext, product);
            var phase       = Markets.GetMarketState(niche);
            var marketStage = Markets.GetMarketStageInnovationModifier(niche);

            var marketSpeedPenalty = GetNicheSpeedInnovationPenalty(niche);

            // culture bonuses
            var culture     = Companies.GetActualCorporateCulture(product);
            var createOrBuy = culture[CorporatePolicy.Make];

            // managers
            //var productManagerBonus = Teams.GetProductManagerBonus(product, gameContext);

            return(new Bonus <long>("Innovation chance")
                   // market
                   .Append("Market stage " + Markets.GetMarketStateDescription(phase), marketStage)
                   .Append("Market change speed", marketSpeedPenalty)

                   // corp culture
                   //.Append("Corporate Culture Mindset", maxCorpLevel - mindset)
                   .Append("Corporate Culture Expansion Policy", createOrBuy)

                   // managers
                   );
        }
Exemplo n.º 2
0
    public override bool HideIf()
    {
        var niche = Markets.Get(Q, SelectedNiche);

        var isResearching = Cooldowns.HasTask(Q, new CompanyTaskExploreMarket(SelectedNiche));

        return(niche.hasResearch || isResearching);
    }
Exemplo n.º 3
0
    public override bool Condition()
    {
        var niche = Markets.Get(Q, SelectedNiche);

        // or there are no companies

        return(niche.hasResearch && Markets.GetCompetitorsAmount(SelectedNiche, Q) > 0);
    }
Exemplo n.º 4
0
        internal static void ExploreMarket(CompanyTask task, GameContext gameContext)
        {
            var nicheType = (task as CompanyTaskExploreMarket).NicheType;

            var niche = Markets.Get(gameContext, nicheType);

            niche.AddResearch(1);
        }
Exemplo n.º 5
0
    public override string GetTitle(NotificationMessageTrendsChange message)
    {
        var nicheType = message.nicheType;
        var nicheName = Enums.GetFormattedNicheName(nicheType);

        var niche = Markets.Get(Q, nicheType);

        return(GetShortTitle(Markets.GetMarketState(niche), nicheName));
    }
        // always positive or equal to zero
        public static int GetDifferenceBetweenMarketDemandAndAppConcept(GameEntity product, GameContext gameContext)
        {
            var niche = Markets.Get(gameContext, product.product.Niche);

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

            return(demand - level);
        }
Exemplo n.º 7
0
    GameEntity GenerateProductCompany(string name, NicheType nicheType)
    {
        var product = Companies.GenerateProductCompany(Q, name, nicheType);

        var niche        = Markets.Get(Q, product);
        var startCapital = Markets.GetStartCapital(niche, Q) * Random.Range(150, 200) / 100;

        Companies.SetResources(product, startCapital, "start capital in game restore");

        return(product);
    }
Exemplo n.º 8
0
    void CloseUnworthyProducts(GameEntity product)
    {
        var niche = Markets.Get(gameContext, product.product.Niche);

        bool isProfitable = Economy.IsProfitable(gameContext, product);
        bool isNicheDead  = Markets.GetMarketState(niche) == MarketState.Death;

        if (isNicheDead && !isProfitable)
        {
            Companies.CloseCompany(gameContext, product);
        }
    }
Exemplo n.º 9
0
    public void Render()
    {
        if (entity == null)
        {
            return;
        }

        RenderAudienceGrowth();

        var niche  = Markets.Get(Q, entity.product.Niche);
        var rating = Markets.GetMarketRating(niche);

        SetAmountOfStars.SetStars(rating);
    }
Exemplo n.º 10
0
    public override string RenderValue()
    {
        var niche = Markets.Get(Q, SelectedNiche);

        var timeRemaining = niche.nicheState.Duration; // * NicheUtils.GetNichePeriodDurationInMonths(niche);

        var years = timeRemaining / 12;

        if (years > 1)
        {
            return($"{years}+ years");
        }

        return($"{timeRemaining} months");
    }
Exemplo n.º 11
0
    void NotifyAboutFeatureDiff2(NewProductFeature[] allfeatures, IEnumerable <GameEntity> competitors)
    {
        var reqs = Markets.GetCalculatedMarketRequirements(Markets.Get(Q, Flagship), Q);

        for (var i = 0; i < LastFeatures.Count; i++)
        {
            var feature = allfeatures[i].Name;

            var was = (int)LastFeatures[i];
            var now = (int)reqs[i];

            if (now <= was)
            {
                continue;
            }

            NotifyAboutNewLeader(competitors, feature);
        }
    }
Exemplo n.º 12
0
    void OnEnable()
    {
        var niche        = Markets.Get(Q, SelectedNiche);
        var startCapital = Markets.GetStartCapital(niche, Q);

        if (MyGroupEntity != null)
        {
            var groupName = Visuals.Colorize(MyGroupEntity.company.Name, Colors.COLOR_COMPANY_WHERE_I_AM_CEO);

            SetActions(true, $"Create a startup and attach it to group \n\n{groupName}\n\n "
                       //+ $"This will cost {Format.Money(startCapital)}"
                       );
        }
        else
        {
            SetActions(false, "You have one startup already!\n" +
                       "Promote it to group of companies or sell it if you want to start new project");
        }
    }
Exemplo n.º 13
0
    public override void ViewRender()
    {
        base.ViewRender();

        var nicheType    = SelectedCompany.product.Niche;
        var positionings = Markets.GetNichePositionings(nicheType, Q);
        var niche        = Markets.Get(Q, nicheType);

        var positioningData = positionings[segmentId];


        PositioningName.text = positioningData.name;

        var price = Markets.GetBaseProductPrice(nicheType, Q);

        IncomePerUser.text = $"+{price.ToString("0.0")}";

        var estimatedUsers = Markets.GetMarketSegmentAudiencePotential(Q, nicheType, segmentId);

        EstimatedUsers.text = Format.Minify(estimatedUsers);
    }
Exemplo n.º 14
0
        public static long GetBaseClientsForNewCompanies(GameContext gameContext, NicheType nicheType)
        {
            var niche = Markets.Get(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);
            }
        }
Exemplo n.º 15
0
    internal void SetEntity(NicheType nicheType)
    {
        var niche  = Markets.Get(Q, nicheType);
        var rating = Markets.GetMarketRating(niche);

        var share = Companies.GetControlInMarket(MyCompany, nicheType, Q);

        var marketSize = Markets.GetMarketSize(Q, nicheType);
        var audience   = Markets.GetAudienceSize(Q, nicheType);



        var hasCompany = Companies.HasCompanyOnMarket(MyCompany, nicheType, Q);

        //ShareSize.text = Format.MinifyMoney(marketSize);
        ShareSize.text  = Format.MinifyToInteger(audience) + "\nusers";
        ShareSize.color = Visuals.GetColorFromString(HasCompany ? Colors.COLOR_CONTROL : Colors.COLOR_CONTROL_NO);

        var phase = Markets.GetMarketState(niche).ToString();

        if (!ShowMarketStateOnlyByColor)
        {
            MarketState.text = phase;
        }

        var phaseColor = Visuals.GetGradientColor(0, 5f, rating);

        MarketState.color = phaseColor;

        var nicheName = Enums.GetFormattedNicheName(nicheType);

        NicheName.text = nicheName;

        LinkToNiche.SetNiche(nicheType);

        //var control = Companies.GetControlInMarket(MyCompany, nicheType, GameContext);
        //ControlInMarket.text = control + "%";

        RenderHint(nicheName, marketSize, share, phase, phaseColor, nicheType);
    }
Exemplo n.º 16
0
    public override string RenderValue()
    {
        var company = Flagship;

        if (company.isRelease)
        {
            return("");
        }

        var criticalMass = 500;
        var users        = Marketing.GetUsers(company);

        var usergoal = users >= criticalMass?Visuals.Positive("COMPLETED") : Visuals.Negative("In progress");

        var marketrequirements = Products.GetMarketDemand(Markets.Get(Q, company));
        var level = Products.GetProductLevel(company);

        var levelgoal = level >= marketrequirements?Visuals.Positive("COMPLETED") : Visuals.Negative("In progress");

        //var goal = Flagship.companyGoal.InvestorGoal;

        //var t = $"<b>Goals</b> ({goal})";

        //if (goal == InvestorGoalType.Prototype)
        //    t += $"\n\n<i>* Upgrade product to 1LVL</i>";

        //if (goal >= InvestorGoalType.FirstUsers)
        //    t += $"\n\n<i>* Gain Critical mass of users</i>\n\tyou have: {users} / {criticalMass} users {usergoal}";

        //if (goal >= InvestorGoalType.BecomeMarketFit)
        //    t += $"\n\n<i>* Reach market requirements</i>\n\tyou have: {level}LV / {marketrequirements}LV) {levelgoal}";

        //if (Companies.IsReleaseableApp(company))
        //{
        //    t += "\n\n" + Visuals.Positive("You can release your product!!!");
        //}

        //return t;
        return("RenderPrototypeGoals.cs");
    }
Exemplo n.º 17
0
    string RenderTrendChageText(NotificationMessageTrendsChange notification)
    {
        var nicheType = notification.nicheType;

        var niche = Markets.Get(Q, nicheType);
        var phase = Markets.GetMarketState(niche);

        var nicheName = Enums.GetFormattedNicheName(nicheType);


        var description = "";

        switch (phase)
        {
        case MarketState.Death:
            description = "People don't need them anymore and they will stop using these products. You'd better search new opportunities";
            break;

        case MarketState.Decay:
            description = $"New users don't arrive anymore and we need to keep existing ones as long as possible";
            break;

        case MarketState.MassGrowth:
            description = $"They are well known even by those, who are not fancy to technologies";
            break;

        case MarketState.Trending:
            description = $"We need to be quick if we want to make benefit from them";
            break;

        case MarketState.Innovation:
            description = $"Maybe it is the next big thing?";
            break;
        }

        return(description);
    }
Exemplo n.º 18
0
    void UpdateFeatures()
    {
        var features = Markets.GetCalculatedMarketRequirements(Markets.Get(Q, Flagship), Q);

        LastFeatures = Markets.CopyMarketRequirements(features);
    }
Exemplo n.º 19
0
    void MockySimulation(int skipDays, GameContext GameContext)
    {
        var markets    = Markets.GetNiches(GameContext);
        var skipMonths = skipDays / 30;

        var date = ScheduleUtils.GetCurrentDate(GameContext);
        List <NicheType> activatedMarkets = new List <NicheType>();

        // simulate market development
        foreach (var m in markets)
        {
            var spawnTime = m.nicheLifecycle.OpenDate;

            var monthsOfWork = (date - spawnTime) / 30;
            var accumulator  = monthsOfWork;

            // niche state promotion

            while (accumulator > 0)
            {
                Markets.PromoteNicheState(m);
                accumulator -= Markets.GetNicheDuration(m);
            }

            // filling with companies
            var amountOfCompanies = UnityEngine.Random.Range(0, monthsOfWork / 12);

            for (var i = 0; i < amountOfCompanies; i++)
            {
                Markets.FillMarket(m, GameContext);
            }

            var costs    = m.nicheCosts;
            var isMockup = costs.AcquisitionCost == 1 && costs.Audience == 1 && costs.BaseIncome == 1 && costs.TechCost == 1;
            if (!isMockup)
            {
                activatedMarkets.Add(m.niche.NicheType);
            }
        }

        Debug.Log("Mocky simulation: simulated markets");

        // simulate products

        var products = Companies.GetProductCompanies(GameContext);

        foreach (var p in products)
        {
            var niche     = Markets.Get(GameContext, p.product.Niche);
            var spawnTime = niche.nicheLifecycle.OpenDate;

            var monthsOfWork = (date - spawnTime) / 30;
            //Debug.Log($"Market={p.product.Niche}  Date: " + date + " openDate " + spawnTime + "  monthsOfWork = " + monthsOfWork);

            if (monthsOfWork < 0)
            {
                monthsOfWork = 0;
            }
        }

        Debug.Log("Mocky simulation: simulated product");

        //PrintMarketData(markets, activatedMarkets);
    }
Exemplo n.º 20
0
    public void Render(GameEntity company)
    {
        Clients.text = Format.Minify(Marketing.GetUsers(company));

        // market share
        bool isPlayerFlagship      = company.company.Id == Flagship.company.Id;
        bool needToShowMarketShare = company.isRelease;

        var share = Companies.GetMarketShareOfCompanyMultipliedByHundred(company, Q);

        MarketShare.GetComponent <Text>().text  = share.ToString("0") + "%";
        MarketShare.GetComponent <Text>().color = Visuals.GetGradientColor(0, 100, share);

        Draw(MarketShare, true);
        Draw(MarketShareLabel, false);

        ResizeFirmLogo(company);

        // product level
        var levelStatus = Products.GetConceptStatus(company, Q);
        var statusColor = Colors.COLOR_WHITE;

        if (levelStatus == ConceptStatus.Leader)
        {
            statusColor = Colors.COLOR_BEST;
        }

        if (levelStatus == ConceptStatus.Outdated)
        {
            statusColor = Colors.COLOR_NEGATIVE;
        }

        var market   = Markets.Get(Q, company);
        var maxLevel = Products.GetMarketDemand(market);

        var outOf = "";

        if (!company.isRelease)
        {
            outOf = $" / {maxLevel}";
        }

        var level = Products.GetProductLevel(company);

        ProductLevel.text  = level + outOf + "LVL";
        ProductLevel.color = Visuals.GetGradientColor(0, maxLevel, level);

        // brand
        Brand.text = (int)company.branding.BrandPower + "";
        Draw(BrandIcon, false); // company.isRelease
        Draw(Brand, false);

        // workers

        var str = "";

        foreach (var t in company.team.Teams)
        {
            str += "* " + t.Name + "\n";
            for (var taskId = 0; taskId < t.Tasks.Count; taskId++)
            {
                var task = t.Tasks[taskId];
                str += "  " + task.GetTaskName() + "\n";
            }
        }
        Teams.text = str;

        var change = Marketing.GetAudienceChange(company, Q);


        Growth.text  = Format.SignOf(change) + Format.Minify(change) + " weekly";
        Growth.color = Visuals.GetColorPositiveOrNegative(change);
    }
Exemplo n.º 21
0
    public override bool HideIf()
    {
        var niche = Markets.Get(Q, SelectedNiche);

        return(!niche.hasResearch);
    }
        public static int GetMarketRequirements(GameEntity product, GameContext gameContext)
        {
            var niche = Markets.Get(gameContext, product.product.Niche);

            return(GetMarketDemand(niche));
        }
Exemplo n.º 23
0
    public override string RenderValue()
    {
        var niche = Markets.Get(Q, SelectedNiche);

        return(Products.GetMarketRequirements(niche) + "LVL");
    }
Exemplo n.º 24
0
    public void Render()
    {
        NicheType nicheType = SelectedNiche;
        var       niche     = Markets.Get(Q, nicheType);

        var profile = niche.nicheBaseProfile.Profile;

        var nicheCosts = Markets.GetNicheCosts(Q, nicheType);

        var rating = Markets.GetMarketRating(niche);

        SetAmountOfStars.SetStars(rating);

        ChangeSpeed.text = "xxx days";

        PotentialMarketSize.text   = Format.Money(Markets.GetMarketPotential(niche));
        PotentialAudienceSize.text = Format.MinifyToInteger(Markets.GetMarketAudiencePotential(niche)) + " users";

        var    risk     = Markets.GetMarketDemandRisk(Q, nicheType);
        string riskText = Markets.ShowRiskStatus(risk).ToString();

        RiskLabel.text = $"{risk}% ({riskText})";

        var demand = Marketing.GetClientFlow(Q, nicheType); // * MarketingUtils.GetMarketingFinancingAudienceReachModifier(MarketingFinancing.High) * 30;

        Demand.text = Format.MinifyToInteger(demand) + " monthly";

        var baseMaintenance = Markets.GetBaseProductMaintenance(Q, niche);

        //Maintenance.text = Format.MinifyMoney(baseMaintenance) + " / month";
        Maintenance.text   = $"{nicheCosts.AcquisitionCost.ToString("0.0")} / user"; // Format.MinifyMoney(baseMaintenance) + " / month";
        IncomePerUser.text = $"{nicheCosts.BaseIncome.ToString("0.0")} / user";      // Format.MinifyMoney(baseMaintenance) + " / month";

        //var teamMaintenance = NicheUtils.GetTeamMaintenanceCost(niche);
        //TeamMaintenance.text = Format.MoneyToInteger(teamMaintenance) + " / month";

        TeamMaintenance.text = profile.AppComplexity.ToString();

        long maxIncome = 0;

        if (BiggestIncome != null)
        {
            var players = Markets.GetProductsOnMarket(Q, niche.niche.NicheType);


            if (players.Count() == 0)
            {
                BiggestIncome.text = "???";
            }
            else
            {
                maxIncome          = players.Max(p => Economy.GetIncome(Q, p));
                BiggestIncome.text = Format.Money(maxIncome) + " / month";
            }
        }

        var start = Markets.GetStartCapital(niche, Q);

        if (StartCapital != null)
        {
            StartCapital.text = Format.Money(start);

            var showStartCapital = !Companies.HasCompanyOnMarket(MyCompany, nicheType, Q);

            StartCapital.gameObject.SetActive(showStartCapital);
            StartCapitalLabel.gameObject.SetActive(showStartCapital);
        }

        //var monthlyMaintenance = marketingMaintenance + teamMaintenance;
        //if (MonthlyMaintenance != null)
        //    MonthlyMaintenance.text = Format.Money(monthlyMaintenance) + " / month";

        //if (ROI != null)
        //{
        //    var roi = (maxIncome - monthlyMaintenance) * 100 * 12 / (monthlyMaintenance + 1);
        //    ROI.text = $"{roi}% / yearly";
        //}
    }
Exemplo n.º 25
0
    public override void SetItem <T>(Transform t, T entity)
    {
        var niche = Markets.Get(Q, (NicheType)(object)entity);

        t.GetComponent <NichePreview>().SetNiche(niche);
    }