public static void NotifyAboutInvestmentRound(GameEntity company, GameContext gameContext)
        {
            var playerCompany = GetPlayerCompany(gameContext);

            if (IsInSphereOfInterest(playerCompany, company))
            {
                NotificationUtils.AddNotification(gameContext, new NotificationMessageInvestmentRoundStarted(company.company.Id));
            }
        }
Esempio n. 2
0
        public static void NotifyAboutAcquisition(GameContext gameContext, GameEntity buyer, GameEntity target, long bid)
        {
            NotificationUtils.AddNotification(gameContext, new NotificationMessageBuyingCompany(target.company.Id, buyer.shareholder.Id, bid));

            if (IsInPlayerSphereOfInterest(target, gameContext))
            {
                NotificationUtils.AddPopup(gameContext, new PopupMessageAcquisitionOfCompanyInOurSphereOfInfluence(target.company.Id, buyer.shareholder.Id, bid));
            }


            Debug.LogFormat("ACQUISITION: {0} bought {1} for {2}!",
                            GetInvestorName(buyer),
                            target.company.Name,
                            Format.Money(bid));
        }
Esempio n. 3
0
        public static void NotifyAboutCorporateAcquisition(GameContext gameContext, GameEntity corporation, int targetCompanyId)
        {
            NotificationUtils.AddNotification(gameContext, new NotificationMessageBuyingCompany(targetCompanyId, corporation.shareholder.Id, 0));

            var company = Get(gameContext, targetCompanyId);

            if (IsInPlayerSphereOfInterest(company, gameContext))
            {
                NotificationUtils.AddPopup(gameContext, new PopupMessageAcquisitionOfCompanyInOurSphereOfInfluence(targetCompanyId, corporation.shareholder.Id, 0));
            }


            Debug.LogFormat("CORPORATE ACQUISITION: {0} integrated {1}!",
                            GetInvestorName(corporation),
                            company.company.Name);
        }
Esempio n. 4
0
        public static void UpdateMarketRequirements(GameEntity product, GameContext gameContext)
        {
            var niche = Markets.Get(gameContext, product.product.Niche);

            var demand   = Products.GetMarketDemand(niche);
            var newLevel = Products.GetProductLevel(product);

            if (newLevel > demand)
            {
                bool revolution = newLevel - demand > 1;

                // innovation
                //var clientChange = GiveInnovationBenefits(product, gameContext, revolution);
                var brandGain = revolution ? C.REVOLUTION_BRAND_POWER_GAIN : C.INNOVATION_BRAND_POWER_GAIN;
                Marketing.AddBrandPower(product, brandGain);

                // notify about innovation
                var player    = Companies.GetPlayerCompany(gameContext);
                var daughters = Companies.GetDaughtersAmount(player);


                //if (Companies.IsInPlayerSphereOfInterest(product, gameContext) && Markets.GetCompetitorsAmount(product, gameContext) > 1 && daughters == 1)
                //    NotificationUtils.AddPopup(gameContext, new PopupMessageInnovation(product.company.Id, clientChange));

                // && Markets.GetCompetitorsAmount(product, gameContext) > 1 && daughters == 1
                if (Companies.IsInPlayerSphereOfInterest(product, gameContext))
                {
                    NotificationUtils.AddNotification(gameContext, new NotificationMessageInnovation(product.company.Id, newLevel, revolution, 0, brandGain));
                }

                niche.ReplaceSegment(newLevel);

                // order matters
                RemoveTechLeaders(product, gameContext);
                product.isTechnologyLeader = true;
            }
            else if (newLevel == demand)
            {
                // if you are techonology leader and you fail to innovate, you will not lose tech leadership
                if (product.isTechnologyLeader)
                {
                    return;
                }

                RemoveTechLeaders(product, gameContext);
            }
        }
        public static void NotifyAboutAcquisition(GameContext gameContext, int buyerShareholderId, int targetCompanyId, long bid)
        {
            NotificationUtils.AddNotification(gameContext, new NotificationMessageBuyingCompany(targetCompanyId, buyerShareholderId, bid));

            var company = Get(gameContext, targetCompanyId);

            if (IsInPlayerSphereOfInterest(company, gameContext))
            {
                NotificationUtils.AddPopup(gameContext, new PopupMessageAcquisitionOfCompanyInOurSphereOfInfluence(targetCompanyId, buyerShareholderId, bid));
            }


            Debug.LogFormat("ACQUISITION: {0} bought {1} for {2}!",
                            GetInvestorName(gameContext, buyerShareholderId),
                            Get(gameContext, targetCompanyId).company.Name,
                            Format.Money(bid));
        }
Esempio n. 6
0
 public static void NotifyAboutProductSupportEnd(GameEntity company, GameContext gameContext)
 {
     NotificationUtils.AddNotification(gameContext, new NotificationMessageBankruptcy(company.company.Id));
     NotificationUtils.SendBankruptcyPopup(gameContext, company);
 }