void ChangeBrandPowers(GameEntity[] products)
    {
        for (var i = 0; i < products.Length; i++)
        {
            var powerChange = Marketing.GetBrandChange(products[i], gameContext).Sum();

            Marketing.AddBrandPower(products[i], (float)powerChange);
        }
    }
示例#2
0
    public override string RenderValue()
    {
        if (!SelectedCompany.hasProduct)
        {
            return("");
        }

        //if (Companies.IsExploredCompany(Q, SelectedCompany))
        return(Marketing.GetBrandChange(SelectedCompany, Q).ToString());
    }
示例#3
0
    private void RenderCompanyInfo(GameEntity e)
    {
        var brand       = (int)e.branding.BrandPower;
        var brandChange = Marketing.GetBrandChange(e, Q).Sum();

        var newClients = Marketing.GetAudienceGrowth(e, Q);

        Clients.text = "+" + Format.Minify(newClients) + $" users ({brand} brand)";

        Concept.text = "" + brand + "  " + Visuals.PositiveOrNegativeMinified(brandChange);
    }
示例#4
0
    void DrawProductGrowth(GameEntity product, ProductCompanyResult result)
    {
        var bonus  = Marketing.GetBrandChange(product, Q);
        var change = bonus.Sum();

        ClientGrowth.text = $"Brand\n{(int)product.branding.BrandPower} ({Visuals.PositiveOrNegativeMinified(change)})";
        ClientGrowth.gameObject.GetComponent <Hint>().SetHint(bonus.ToString());

        var shareChange = (long)result.MarketShareChange;
        var share       = Companies.GetMarketShareOfCompanyMultipliedByHundred(product, Q);

        MarketShareChange.text = "Market share\n" + Visuals.Colorize(share.ToString(), shareChange >= 0) + "%";
    }
示例#5
0
    public override void ViewRender()
    {
        base.ViewRender();

        var anim = GetComponent <Animation>();

        anim.Play();

        var growth = Marketing.GetBrandChange(Flagship, Q).Sum();

        Text.text  = Format.Sign(growth, true);
        Text.color = Visuals.GetColorPositiveOrNegative(growth > 0);
    }
示例#6
0
    void Render(long maxClients)
    {
        var company = Companies.Get(Q, companyId);

        var clients     = Marketing.GetUsers(company);
        var growthBonus = Marketing.GetAudienceGrowthBonus(company);
        var newClients  = growthBonus.Sum();

        var marketRequirements = Products.GetMarketRequirements(company, Q);
        var level       = Products.GetProductLevel(company);
        var levelStatus = Products.GetConceptStatus(company, Q);

        Clients.text    = Format.Minify(clients) + " users"; //  +
        NewClients.text = Format.Minify(newClients);

        if (Growth != null)
        {
            var cli = Format.Minify(clients);
            var clientChangeColor = Visuals.GetColorFromString(newClients > 0 ? Colors.COLOR_WHITE : Colors.COLOR_NEGATIVE);

            var newCli = Format.Sign(newClients, true);

            Growth.text = $"{Visuals.Colorize(newCli, clientChangeColor)} users (#1)"; // {cli} users
            //Growth.color = clientChangeColor; // Visuals.GetColorPositiveOrNegative(newClients);
            growthBonus.SortByModule();
            Growth.GetComponent <Hint>().SetHint("Weekly growth\n\n" + growthBonus.MinifyValues().ToString());
        }

        WeeklyGrowth.text = $"Growth (#1)";

        var brandChange      = Marketing.GetBrandChange(company, Q).Sum();
        var brandChangeValue = Format.Sign(brandChange);

        Brand.text = (int)company.branding.BrandPower + $" {Visuals.DescribeValueWithText(brandChange, brandChangeValue, brandChangeValue, "")}";

        // name
        var isPlayerRelated = Companies.IsDirectlyRelatedToPlayer(Q, company);
        var nameColor       = isPlayerRelated ? Colors.COLOR_COMPANY_WHERE_I_AM_CEO : Colors.COLOR_COMPANY_WHERE_I_AM_NOT_CEO;

        //Name.text = $"{company.company.Name} ({Format.Minify(clients)} users)"; // + $" - <b>{level}LVL</b>";
        Name.text  = $"{company.company.Name}"; // + $" - <b>{level}LVL</b>";
        Name.color = Visuals.GetColorFromString(nameColor);

        if (ProductLevel != null)
        {
            if (CurrentScreen == ScreenMode.NicheScreen)
            {
                ProductLevel.text = $"{level}LVL";
            }
            else
            {
                ProductLevel.text = $"{level}LVL / {marketRequirements}LVL";
            }
        }

        if (Innovations != null)
        {
            Innovations.text = Products.GetInnovationChance(company, Q) + "%";
        }

        // link to project
        LinkToProjectView.CompanyId = company.company.Id;

        var brand = (int)company.branding.BrandPower;

        ClientChange.SetHint($"{company.company.Name} will get {Format.Minify(newClients)} clients next week, due to their brand power ({brand})");


        RenderConceptProgress(clients, maxClients, company);
    }
示例#7
0
    void Render()
    {
        if (company == null)
        {
            return;
        }

        var id = company.company.Id;

        var clients      = Marketing.GetClients(company);
        var churn        = Marketing.GetChurnRate(Q, company);
        var churnClients = Marketing.GetChurnClients(Q, id);

        var profit = Economy.GetProfit(Q, id);

        bool hasControl = Companies.GetControlInCompany(MyCompany, company, Q) > 0;

        var nameColor   = hasControl ? Colors.COLOR_CONTROL : Colors.COLOR_NEUTRAL;
        var profitColor = profit >= 0 ? Colors.COLOR_POSITIVE : Colors.COLOR_NEGATIVE;

        var positionOnMarket = Markets.GetPositionOnMarket(Q, company) + 1;

        var brand       = (int)company.branding.BrandPower;
        var brandChange = Marketing.GetBrandChange(company, Q);

        var effeciency = Products.GetTeamEffeciency(Q, company);



        SetEmblemColor();

        Clients.text = Format.Minify(clients);

        CompanyHint.SetHint(GetCompanyHint());

        Expertise.text = $"Effeciency: {effeciency}%";

        Name.text  = company.company.Name;
        Name.color = Visuals.GetColorFromString(nameColor);

        Profitability.text  = Format.Money(profit);
        Profitability.color = Visuals.GetColorFromString(profitColor);

        PositionOnMarket.text = $"#{positionOnMarket}";

        Brand.text  = $"{brand} ({brandChange.Sum()})";
        Brand.color = Visuals.GetGradientColor(0, 100, brand);

        UpdateIfNecessary(BrandIcon, company.isRelease);
        UpdateIfNecessary(Brand, company.isRelease);


        // buttons

        // set
        LinkToProjectView.CompanyId = id;
        HireWorker.companyId        = id;
        ReleaseApp.SetCompanyId(id);

        TestCampaignButton.SetCompanyId(id);
        StartRegularAdCampaign.SetCompanyId(id);
        StartBrandingCampaign.SetCompanyId(id);
        UpgradeChurn.SetCompanyId(id);
        UpgradeMonetisation.SetCompanyId(id);
        LinkToHiringScreen.SetCompanyId(id);


        var max     = Products.GetNecessaryAmountOfWorkers(company, Q);
        var workers = Teams.GetAmountOfWorkers(company, Q);

        var canHireTopManagers = false && workers > 5;

        var targetingCost = Marketing.GetTargetingCost(company, Q);
        var brandingCost  = Marketing.GetBrandingCost(company, Q);


        // enable / disable them
        UpdateIfNecessary(ReleaseApp, Companies.IsReleaseableApp(company, Q));

        UpdateIfNecessary(TestCampaignButton, !company.isRelease);
        UpdateIfNecessary(StartRegularAdCampaign, company.isRelease);
        UpdateIfNecessary(StartBrandingCampaign, company.isRelease);

        UpdateIfNecessary(LinkToHiringScreen, canHireTopManagers);
        UpdateIfNecessary(ManagementLabel, canHireTopManagers);


        // render
        HireWorker.GetComponentInChildren <TextMeshProUGUI>().text = $"Hire Worker ({workers}/{max})";
        HireWorker.GetComponentInChildren <Button>().interactable  = workers < max;
        HireWorker.GetComponentInChildren <Hint>().SetHint(workers < max ?
                                                           "Hiring workers will increase development speed"
            :
                                                           Visuals.Negative("You reached max limit of workers") + "\n\nTo increase this limit, hire TOP managers"
                                                           );

        StartRegularAdCampaign.GetComponent <Hint>().SetHint($"Cost: {Format.Money(targetingCost)}");
        StartBrandingCampaign.GetComponent <Hint>().SetHint($"Cost: {Format.Money(brandingCost)}");
    }