//TODO: are the commodities checked against inventory first? public void CounterOffer(CommodityGroup additionals) //Dictionary<Commodity,int> addons, { int additionalsValue = additionals.GetValue(); if (ShakeDown) { CurrentComment = "it would be a shame if something happened to this nice shop."; Patience--; } else if (additionalsValue < Patience) { CurrentOffer.Add(additionals); TradeSuccess(); } else if (additionalsValue < Patience * 2) { //will suggest less if (additionals.GetAmount() > 1) { CurrentComment = "What about this?"; CurrentOffer.Add(additionals.GetResourcesOfValue(additionals.GetValue() - 1)); Patience /= 2; } else { CurrentComment = "nah.."; Patience--; } } else if (additionalsValue < Patience * 4) { CurrentComment = "That's too much."; Patience--; } else { CurrentComment = "No! I'm outta here. See ya!"; TradeFailure(); } OnUpdate.Invoke(); }
//TODO: use this when the game starts public void Setup() { LastVisit = -1; //TODO: use wealth to determine how much stuff they have foreach (var c in PrimaryResources) { Inventory.Add(c, 15); } Attitude = StartAttitude; }
private void UpdateResourceInOffer(string s, Commodity r) { OnOffer.Add(r, int.Parse(s)); }