Ejemplo n.º 1
0
 private void InitPriceDataIfNeeded()
 {
     if (!(pricePlayerBuy > 0f))
     {
         if (IsCurrency)
         {
             pricePlayerBuy  = BaseMarketValue;
             pricePlayerSell = BaseMarketValue;
         }
         else
         {
             priceFactorBuy_TraderPriceType      = PriceTypeFor(TradeAction.PlayerBuys).PriceMultiplier();
             priceFactorSell_TraderPriceType     = PriceTypeFor(TradeAction.PlayerSells).PriceMultiplier();
             priceGain_PlayerNegotiator          = TradeSession.playerNegotiator.GetStatValue(StatDefOf.TradePriceImprovement);
             priceGain_Settlement                = TradeSession.trader.TradePriceImprovementOffsetForPlayer;
             priceFactorSell_ItemSellPriceFactor = AnyThing.GetStatValue(StatDefOf.SellPriceFactor);
             pricePlayerBuy  = TradeUtility.GetPricePlayerBuy(AnyThing, priceFactorBuy_TraderPriceType, priceGain_PlayerNegotiator, priceGain_Settlement);
             pricePlayerSell = TradeUtility.GetPricePlayerSell(AnyThing, priceFactorSell_TraderPriceType, priceGain_PlayerNegotiator, priceGain_Settlement);
             if (pricePlayerSell >= pricePlayerBuy)
             {
                 Log.ErrorOnce("Trying to put player-sells price above player-buys price for " + AnyThing, 65387);
                 pricePlayerSell = pricePlayerBuy;
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void InitPriceDataIfNeeded()
 {
     if (pricePlayerBuy > 0f)
     {
         return;
     }
     if (IsCurrency)
     {
         pricePlayerBuy  = BaseMarketValue;
         pricePlayerSell = BaseMarketValue;
         return;
     }
     priceFactorBuy_TraderPriceType      = PriceTypeFor(TradeAction.PlayerBuys).PriceMultiplier();
     priceFactorSell_TraderPriceType     = PriceTypeFor(TradeAction.PlayerSells).PriceMultiplier();
     priceGain_PlayerNegotiator          = TradeSession.playerNegotiator.GetStatValue(StatDefOf.TradePriceImprovement);
     priceGain_Settlement                = TradeSession.trader.TradePriceImprovementOffsetForPlayer;
     priceFactorSell_ItemSellPriceFactor = AnyThing.GetStatValue(StatDefOf.SellPriceFactor);
     pricePlayerBuy  = TradeUtility.GetPricePlayerBuy(AnyThing, priceFactorBuy_TraderPriceType, priceGain_PlayerNegotiator, priceGain_Settlement);
     pricePlayerSell = TradeUtility.GetPricePlayerSell(AnyThing, priceFactorSell_TraderPriceType, priceGain_PlayerNegotiator, priceGain_Settlement, TradeSession.TradeCurrency);
     if (pricePlayerSell >= pricePlayerBuy)
     {
         pricePlayerSell = pricePlayerBuy;
     }
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     return(AnyThing.GetHashCode());
 }