public static void Postfix(ref float __result, Thing thing, TradeCurrency currency)
 {
     if (currency == TradeCurrency.Silver && thing.def == BankDefOf.BankNote)
     {
         __result = thing.MarketValue;
     }
 }
Beispiel #2
0
        public static float GetPricePlayerSell(Thing thing, float priceFactorSell_TraderPriceType, float priceGain_PlayerNegotiator, float priceGain_FactionBase, TradeCurrency currency = TradeCurrency.Silver)
        {
            if (currency == TradeCurrency.Favor)
            {
                return(thing.RoyalFavorValue);
            }
            float statValue = thing.GetStatValue(StatDefOf.SellPriceFactor);
            float num       = thing.MarketValue * 0.6f * priceFactorSell_TraderPriceType * statValue * (1f - Find.Storyteller.difficulty.tradePriceFactorLoss);

            num *= 1f + priceGain_PlayerNegotiator + priceGain_FactionBase;
            num  = Mathf.Max(num, 0.01f);
            if (num > 99.5f)
            {
                num = Mathf.Round(num);
            }
            return(num);
        }