public static Bonus <long> GetFounderOpinionAboutOffer(AcquisitionOfferComponent acquisitionOffer, GameEntity investor, GameEntity company, GameContext gameContext) { var bonus = new Bonus <long>("Founder Opinion"); var conditions = acquisitionOffer.BuyerOffer; var priceOk = conditions.Price < acquisitionOffer.SellerOffer.Price; bonus.Append("Offered price", priceOk ? -100 : 1); //var wantsOurShares = GetHashedRandom(company.company.Id, acquisitionOffer.BuyerId) > 0.22f; //if (conditions.ByShares > 0) // bonus.AppendAndHideIfZero("Does not want our shares", wantsOurShares ? 0 : -120); var ambition = GetFounderAmbition(company, gameContext); //var wantsToStayInCompany = ambition == Ambition.RuleProductCompany; var wantsToRuleIndependently = ambition == Ambition.RuleCorporation; //if (wantsToStayInCompany) // bonus.Append("Wants to stay in company", conditions.KeepLeaderAsCEO ? 0 : -100); //if (wantsToRuleIndependently) // bonus.Append("Ambitious founder", -1000); return(bonus); }
public static Bonus <long> GetVentureOpinionAboutOffer(AcquisitionOfferComponent acquisitionOffer, GameEntity investor, GameEntity company, GameContext gameContext) { var bonus = new Bonus <long>("Venture investor Opinion"); var conditions = acquisitionOffer.BuyerOffer; var priceOk = conditions.Price < acquisitionOffer.SellerOffer.Price; bonus.Append("Offered price", priceOk ? -100 : 1); //var wantsOurShares = GetHashedRandom(company.company.Id, acquisitionOffer.BuyerId) > 0.22f; //bonus.AppendAndHideIfZero("Does not want our shares", wantsOurShares ? 0 : -120); return(bonus); }
public static bool IsShareholderWillAcceptAcquisitionOffer(AcquisitionOfferComponent ackOffer, int shareholderId, GameContext gameContext) { var cost = Economy.GetCompanyCost(gameContext, ackOffer.CompanyId); var company = Get(gameContext, ackOffer.CompanyId); var investor = GetInvestorById(gameContext, shareholderId); var container = GetInvestorOpinionAboutAcquisitionOffer(ackOffer, investor, company, gameContext); bool willAcceptOffer = container.Sum() >= 0; // ackOffer.Offer > cost * modifier; bool isBestOffer = true; // when competing with other companies var offers = GetAcquisitionOffersToCompany(gameContext, ackOffer.CompanyId); var baseDesireToSellCompany = GetBaseDesireToSellShares(gameContext, company, shareholderId, investor.shareholder.InvestorType); var wantsToSellShares = true || baseDesireToSellCompany == 1; return(wantsToSellShares && willAcceptOffer && isBestOffer); }
// opinion about offer // TODO <float> public static Bonus <long> GetInvestorOpinionAboutAcquisitionOffer(AcquisitionOfferComponent ackOffer, GameEntity investor, GameEntity targetCompany, GameContext gameContext) { var container = new Bonus <long>("Opinion about acquisition offer"); switch (investor.shareholder.InvestorType) { case InvestorType.Founder: container = GetFounderOpinionAboutOffer(ackOffer, investor, targetCompany, gameContext); break; case InvestorType.VentureInvestor: container = GetVentureOpinionAboutOffer(ackOffer, investor, targetCompany, gameContext); break; case InvestorType.Strategic: container.Append("Views this company as strategic interest", -1000); break; } return(container); }
void RenderOffer(AcquisitionOfferComponent offer) { RenderCashOffer(offer.BuyerOffer, offer.Turn); RenderShareOffer(offer.BuyerOffer); }