Exemple #1
0
    //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();
    }
Exemple #2
0
    public string MakeSaleArgument(ArgumentType argumentType)
    {
        var arg = SaleArguments.First(a => a.Type == argumentType);

        HasMadeSalesPitch = true;

        if (ShakeDown)
        {
            CurrentComment = "I don't care.";
            Patience--;
        }
        else if (arg.LikesArgument.Any(Buyer.LeaderTraits.Contains))
        {
            CurrentComment = $"I like {argumentType} stuff. This is my new offer.";
            //TODO: test that it is not possible to get lower amount
            CurrentOffer = Buyer.Inventory.GetResourcesOfValue(CurrentOffer.GetValue() * 2);
        }
        else if (arg.DislikesArgument.Any(Buyer.LeaderTraits.Contains))
        {
            CurrentComment = $"Why would I like {argumentType} stuff!? You Moron!";

            Patience /= 2;
        }
        else
        {
            CurrentComment = $"So...";

            Patience--;
        }

        OnUpdate.Invoke();

        //TODO: actually use this in player speech bubble
        return(arg.Text);
    }